Skip to main content

Network on Toradex Computer on Modules

Introduction

This article contains relevant information about network configuration and testing on Toradex SoMs. The following topics are covered:

  • Reading and configuring MAC addresses of SoMs.
  • Enabling the use of second Ethernet ports.
  • Ethernet benchmarking on SoMs.

MAC Address

A MAC address is used to identify computers on the network. This section describes how to get and customize MAC addresses of SoMs.

Get the MAC address

To get the MAC address of SoMs, use the ip command in the module's terminal:

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:14:2d:4d:c7:30 brd ff:ff:ff:ff:ff:ff

In the example above, the MAC address of the Ethernet interface is 00:14:2d:4d:c7:30.

Alternatively, you can obtain the MAC address of a SoM from its serial number. For more information, see MAC address. To search for a module's MAC address from your PC, see Scan your local network to find the board IP and MAC address.

Manually Force a Custom MAC Address

From within U-Boot, set a new value to the ethaddr environment variable. Then, save the environment:

U-Boot # setenv ethaddr 01:23:45:67:89:ab
U-Boot # saveenv
Saving Environment to MMC...
Writing to MMC(0)... done

If your SoM has a second Ethernet port, the second MAC address is set through the eth1addr variable:

U-Boot # setenv eth1addr 01:23:45:67:89:ac
U-Boot # saveenv
Saving Environment to MMC...
Writing to MMC(0)... done

Reset the MAC Address to the Factory Default

To reset the MAC address to the factory default from within U-Boot, you can also use the setenv command:

U-Boot # setenv ethaddr
U-Boot # saveenv
Saving Environment to MMC...
Writing to MMC(0)... done

Add a Second Ethernet Port

Some SoMs feature a second Ethernet controller available as a reduced gigabit media independent interface (RGMII). To use it, a second Ethernet PHY on your carrier board is required. The freely available design of the Verdin Development Board can be used as a reference.

This is the case for the Verdin iMX8M Plus. The following code snippet shows the device tree node that configures the second Ethernet port. Note that the Ethernet PHY provided in this design has the power switching controlled by the PWR_CTRL_4 signal, which is connected to a GPIO Expander. You should assign the pin for Power Switching (ETH_PWR_EN) in the device tree.

imx8mp-verdin-dev.dtsi
    reg_eth2phy: regulator-eth2phy {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio_expander_21 4 GPIO_ACTIVE_HIGH>; /* PWR_CTRL_4/ETH_PWR_EN */
off-on-delay = <500000>;
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3300000>;
regulator-name = "+V3.3_ETH";
startup-delay-us = <200000>;
vin-supply = <&reg_3p3v>;
};

For more details about this specific example, check the Verdin iMX8M Plus Datasheet.

Learn more about the pin-compatibility concepts of Always Compatible, Reserved, and Module-specific pins on the Verdin Family Specification page.

Ethernet Benchmark

To test the maximum Ethernet bandwidth offered by Toradex SoMs, you can use the iperf3 tool. For SoMs with a 100Base-T connection, such as the Colibri modules, expect approximately 95 Mbits/sec. For SoMs featuring a 1000Base-T connection, such as Verdin and Apalis modules, expect results ranging from 700 to 900 Mbits/sec. Note that The CPU's dynamic voltage scaling (DVFS) in combination with TCP's flow control may negatively impact throughput.

info

The i.MX6 bandwidth is limited to around 400 Mbits/sec, see NXP's Errata ERR004512.

The following sections show a benchmark for a host computer as a server and a Verdin iMX8M Plus as a client and vice versa.

SoM as Client

Start the server on your PC:

$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.22.1.190, port 38470
[ 5] local 10.22.1.73 port 5201 connected to 10.22.1.190 port 38474
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 112 MBytes 939 Mbits/sec
[ 5] 1.00-2.00 sec 112 MBytes 942 Mbits/sec
[ 5] 2.00-3.00 sec 112 MBytes 942 Mbits/sec
[ 5] 3.00-4.00 sec 112 MBytes 942 Mbits/sec
[ 5] 4.00-5.00 sec 112 MBytes 942 Mbits/sec
[ 5] 5.00-6.00 sec 112 MBytes 942 Mbits/sec
[ 5] 6.00-7.00 sec 112 MBytes 941 Mbits/sec
[ 5] 7.00-8.00 sec 112 MBytes 941 Mbits/sec
[ 5] 8.00-9.00 sec 112 MBytes 942 Mbits/sec
[ 5] 9.00-10.00 sec 112 MBytes 942 Mbits/sec
[ 5] 10.00-10.00 sec 274 KBytes 935 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver

Start the client on your SoM:

# iperf3 -c 10.22.1.73
Connecting to host 10.22.1.73, port 5201
[ 5] local 10.22.1.190 port 38474 connected to 10.22.1.73 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 114 MBytes 957 Mbits/sec 0 363 KBytes
[ 5] 1.00-2.00 sec 112 MBytes 938 Mbits/sec 0 380 KBytes
[ 5] 2.00-3.00 sec 112 MBytes 941 Mbits/sec 0 380 KBytes
[ 5] 3.00-4.00 sec 112 MBytes 941 Mbits/sec 0 380 KBytes
[ 5] 4.00-5.00 sec 113 MBytes 945 Mbits/sec 0 397 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 939 Mbits/sec 0 397 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 941 Mbits/sec 0 397 KBytes
[ 5] 7.00-8.00 sec 113 MBytes 947 Mbits/sec 0 397 KBytes
[ 5] 8.00-9.00 sec 112 MBytes 938 Mbits/sec 0 397 KBytes
[ 5] 9.00-10.00 sec 112 MBytes 939 Mbits/sec 0 397 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver

SoM as Server

Start the server on your SoM:

# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 10.22.1.92, port 49036
[ 5] local 10.22.1.190 port 5201 connected to 10.22.1.92 port 49046
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 112 MBytes 940 Mbits/sec
[ 5] 1.00-2.00 sec 112 MBytes 941 Mbits/sec
[ 5] 2.00-3.00 sec 112 MBytes 941 Mbits/sec
[ 5] 3.00-4.00 sec 112 MBytes 941 Mbits/sec
[ 5] 4.00-5.00 sec 112 MBytes 941 Mbits/sec
[ 5] 5.00-6.00 sec 112 MBytes 941 Mbits/sec
[ 5] 6.00-7.00 sec 112 MBytes 941 Mbits/sec
[ 5] 7.00-8.00 sec 112 MBytes 941 Mbits/sec
[ 5] 8.00-9.00 sec 112 MBytes 941 Mbits/sec
[ 5] 9.00-10.00 sec 112 MBytes 941 Mbits/sec
[ 5] 10.00-10.00 sec 91.9 KBytes 567 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver

Start the client on your PC:

$ iperf3 -c 192.168.10.215
Connecting to host 10.22.1.190, port 5201
[ 5] local 10.22.1.92 port 49046 connected to 10.22.1.190 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 114 MBytes 958 Mbits/sec 0 383 KBytes
[ 5] 1.00-2.00 sec 112 MBytes 936 Mbits/sec 0 383 KBytes
[ 5] 2.00-3.00 sec 113 MBytes 946 Mbits/sec 0 383 KBytes
[ 5] 3.00-4.00 sec 112 MBytes 940 Mbits/sec 0 383 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 938 Mbits/sec 0 383 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 942 Mbits/sec 0 383 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 939 Mbits/sec 0 383 KBytes
[ 5] 7.00-8.00 sec 113 MBytes 946 Mbits/sec 0 383 KBytes
[ 5] 8.00-9.00 sec 112 MBytes 937 Mbits/sec 0 443 KBytes
[ 5] 9.00-10.00 sec 112 MBytes 942 Mbits/sec 0 443 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 942 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver


Send Feedback!