22 Dec 2019 - Fun with UDP on a Nix Box. So Ive yet to learn much of anything about Internet protocols. While idly poking around the other night, I came across something called UDP or User Datagram Protocol. From what little Ive read about it, [1][2] it looks ideal for several things including private chatting and sending in data from remote sources like a Raspberry Pi sensor suite. First off, youll need to choose a port for your UDP connection. I chose 3497 which is unofficially reserved for The PlayStation Network. Having ZERO interest in the Sony PlayStation, this suits me fine. Then its time to set up port forwarding on your router for that specific port. This is straightforward. Consult your routers docs. Thats it for the underlying infrastructure. Simple, Yeah? Now well be making our test connection with one of those clever little Linux Swiss Army Knives. This one's called netcat. Netcat can do A LOT of stuff. Well be using it twice. Open a terminal window and type the command: nc -luk 3479 # Listening... Recall that 3479 is the port I chose above -l means to listen to the port -u means we're dealing with UDP connections -k means to keep listening after a sender disconnects Now open a second terminal and type: nc -u localhost 3479 # Making Connection -u means we're dealing with a UDP connection you can substitute an ip or url for localhost Hitting [ENTER] in both cases will cause the cursor to sit there, blinking expectantly on a new line. In that second console type something. Hello World is fine. If all went well, you should see the text appear in the first terminal. Continue typing until you get bored. End your fun with [CRTL]+C in the second console. Terminal One will happily continue looking for new connections until you close netcat there. Wow. Its the little things that tickle my simple brain! I hope this gets some creative juices flowing out there. Best, -Tim [1] https://searchnetworking.techtarget.com/definition/UDP-User-Datagram-Protocol [2] https://linux.die.net/man/1/nc ******************************** * AS ALWAYS, IF I'VE MIS-SPOKE * * HERE AND PROVIDED INACCURATE * * INFO BECAUSE OF MY IGNORANCE * * KINDLY LET ME KNOW. THANKS! * ********************************