15. Networking and Communications¶
This group assignment consisted in sending a message between two projects.
For this group assignment we used the UDP protocol and socket, a low-level networking interface, to send a message from Robin’s computer, from his home, to Quentin’s rail. The received message aimed at moving the chart on the rail.
As a start we used the python files provided by the FABACADEMY, i.e. udpsnd.py and udprcv.py, coming with a tutorial video.
At the beginning we tried to get familiar with this protocol by using these files on our own at home. In a command window we executed the receiver file udprcv.py with the following command:
py -2 udprcv.py 12345
Note that the file provided works with python version 2. By executing this command we are actually to listen on port 12345.
In a second window, we executed the sender file udpsnd.py with the following command:
py -2 udpsnd.py localhost 12345 "Hello"
This command sent the message “Hello” to port 12345 of at the localhost IP address. As the following picture demonstrates it, the procedure worked as expected:
Once able to send messages on our own computers through the UDP protocol we decided to move forward and send a message from one place to another, i.e. from Robin’s place to Quentin’s one. To be able to communicate with one another on remote we first had to open a port on our server. This is specific to each modem. Having a VOO modem, we look at how to open a port on VOO modems and followed the following procedure.
As a first test Robin executed the following command:
py -2 udpsnd.py IpAddressOfQuentin xxxx "Salut Quentin"
Note that for privacy and security matters it is obvious that we wrote substitution names for the IP address and actual port used to communicate in the previous and following commands.
On his side Quentin received the message:
Then, to move Quentin’s rail Robin executed the following command:
py -2 udpsnd.py IpAddressOfQuentin xxxx "G1 X100\n"
On his side Quentin received the message…
… that made the chart move on the rail.