Its probably a novice doubt since I am new to linux development.
I’m looking for a simple solution to send random Ethernet packets from TX2 to RPi 4B.
Host device: Jetson TX2 with Jetpack 4.2 (Ubuntu 18.04 LTS up & running)
RPi 4B running on latest NOOBs version.
Hardware: a simple Cat 6 cable
Bandwidth limitation: 1Gbit/s
Application: to test the Ethernet bandwidth between TX2 and RPi using random data (can be anything, video, files…) and monitor the latency. I want to maximize the Ethernet bandwidth for testing purposes.
The transmission can be bi-directional as well, regardless of who is sending TX2 or RPi.
So the questions are:
How to setup a link between the two (from respect to software)?
How to send/receive random traffic over these ports? on TX2 and RPi?
Is it possible to somehow send a timestamp with every packet sent and monitor it on the receiver side to check the latency?
Netcat is good for easy random testing (“ncat” is the actual program). The “cat” command simply reads out bytes, e.g., the bytes of a file. A README file could be read with “cat README”. “ncat” (“netcat” is the human readable name, not the program spelling) is a network extension of that idea. If you run “man ncat” you should see some examples and options (you might want to do this from the Ubuntu desktop since by default L4T Ubuntu probably did not install man pages).
Now the device special file “/dev/urandom” is not able to put out random characters quickly, but you can use this as an example data source. Locally:
cat /dev/urandom | strings
# Control-c when done.
You can find several examples online with a Google search for “linux ncat examples”. Basically this will allow you to send any program or file data to a socket, and then read that data from a different computer. In many cases you will need “sudo” to bind to sockets.
Cross-over might be required if one end does not support auto detect and there is no intervening switch. If you add a switch or a cross-over, and there is still no ping, then you’ll want to post the output of this for both the RPi and the Jetson:
“Connection refused” is either the port is not open, or some sort of firewall or other rule is blocking the port. IP address 0.0.0.0 is a broadcast port, which you don’t want to use. The result is that some router somewhere in the system is being asked to do whatever it can since you don’t know where you are trying to go…broadcast is generally a privileged function on routers.
Are you using ethernet over the ethernet port? If so, then the Jetson never had an IP address assigned (a router would usually assign the address).
The 169.254.x.x address block (the RPi shows 169.254.13.221) is usually what you get if router setup fails. Technically there might be cases where a private network (not touching the internet) could actually use this to talk to other computers on that same subnet. However, it’s probably better to start with the assumption that there is no valid IP address setup on the RPi.
Are you using the wired ethernet connection, and are you going through a router and/or switch?
Yes, I am using Ethernet over Ethernet port. The Jetson and Rpi is connected directly with a Cat6 cable, no router or switches in between.
Yes, it seems the IPs are not assigned to both of them.
I tried to give a static IP on both, I followed some tutorials but couldn’t succeed with a connection. Although, I could set up a connection between Rpi and Windows PC successfully, by assigning static IP on Rpi of Windows’s IP 169.254.X.X block. But the same for Jetson and Windows PC didn’t work, also Jetson and Rpi didn’t work.
Also, can I assign the static IP on Jetson the same way I did on Rpi? Or is there a different file/command for it? Because, I opened the sudo vi /etc/dhcpcd.conf file and it was empty, no lines written in it.
Jetson static IP address setup is just standard “Ubuntu”, and so any tutorials you find on the internet for Ubuntu 18.04 network setup should be valid. WiFi is (in my opinion) much harder to set up versus wired, and so far you are using wired, so there won’t be any particularly difficult issues. A google search such as this would get things started:
[url]ubuntu 18.04 static ip address - Google Search
RPi setup shouldn’t be any different than how you set up for previously, but I’d suggest using the “192.168.1.x” private subnet (netmask either “/24” or “255.255.255.0”). Example, use “192.168.1.2” on the Jetson, and “192.168.1.3” on the RPi.
I finally used a switch which was much more easier, since I could not get any cross-over cables in time.
I configured TX2 to static IP 192.168.1.1 (using the GUI for network settings)
I configured Rpi to static IP 192.168.1.2 (using the GUI for network settings)
Connected them via a Gigabit Ethernet switch and the ping was successful.
I then ran iperf3 on both. TX2 as client and Rpi as server and maximized the bandwidth for about 10secs.