netcat 2

This is a follow on from the NetCat basic

Background

I am trying to do some Spark development I wrote my Server to generate data - but wrote it using UDP Broardcast Which at the time seemed a clever thing to do.

However when asking Spark Stream to connect to the UDP stream I have found that by default it only connects to a TCP Sock stream.

NetCat Piping

  • The program broardcast.py sends text terminated with \r\n the format is UDP - port 50000 ip 192.168.1.255 (broadcast)

  • This data is collected via a UDP netcat command

  • The Output now piped through lv so I can check the data rates

  • The Output now passed into NetCat TCP Server - port 50001 TCP mode

  • Checked in a seperate process by reading port 50001 TCP from 192.168.1.215

And this looks like

python broardcast.py&
nc -l -s 192.168.1.255 -p 50000 -u | \
pv | \
nc  -l  -p 50001&
#check process
#This should see TCP data on port 50001 
nc -l -s 192.168.1.215 -p 50001

Very impressed with Netcat