Why port listening with Netcat does not work

I run the following command in Ubuntu:

nc -l -p 5004 -v >> /home/anders/Dropbox/netcatFiles/test 

which includes a command to make him listen to 5004.

I am sending an RTP stream to port 5004 using VLC. When I observe the loopback interface in Wireshark, I notice ICMP packets with the message "Destination unreachable".

Opening another VLC and telling him to play incoming data on port 5004, everything works and the stream plays.

What should I do to get Netcat to listen on port 5004?

+6
source share
2 answers

I think you need to add the "-u" parameter so that it listens for UDP.

By default, netcat operates in TCP mode, but the RTP protocol is based on UDP.

β€œTransmission Control Protocol (TCP), although standardized for Using RTP, [5] is not commonly used in an RTP application because TCP maintains reliability over timeliness. Instead, most RTP implementations are built on user datagram protocol (UDP).”

http://en.wikipedia.org/wiki/Real-time_Transport_Protocol

+11
source

do not use -p ( man nc (1) )

-p source_port Specifies what source port nc should use, subject to privilege and availability restrictions. Error using this option in connection with the -l option.

so just specify

 nc -l 5004 -v >> /home/anders/Dropbox/netcatFiles/test 
+6
source

Source: https://habr.com/ru/post/919456/


All Articles