以太网
开发板板配备2个千兆网口
- ETH0 RGMII:end0,默认网卡。
- ETH1 RGMII:end1。
- 请使用网线将开发板对应网口、PC 机连接至同一个路由器。
网络连通测试
进入文件系统,执行如下命令获取 IP 以及查看网口配置信息。
root@linaro-alip:/# ifconfig
end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.49.176 netmask 255.255.255.0 broadcast 192.168.49.255
inet6 fe80::561a:9e84:b5bd:20d7 prefixlen 64 scopeid 0x20<link>
ether 32:b0:e6:11:eb:7e txqueuelen 1000 (Ethernet)
RX packets 3236 bytes 236287 (230.7 KiB)
RX errors 0 dropped 569 overruns 0 frame 0
TX packets 745 bytes 63449 (61.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 69
end1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 36:b0:e6:11:eb:7e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 67
执行如下命令测试网口连接外网是否正常,以访问"www.baidu.com"为例。"-I"代表指定网口,不加"-I"则使用默认网卡。可按"Ctrl + C"终止 ping 命令。
root@linaro-alip:/# ping www.baidu.com -I end0
PING www.a.shifen.com (183.2.172.42) 56(84) bytes of data.
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=1 ttl=50 time=9.28 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=2 ttl=50 time=8.77 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=3 ttl=50 time=8.65 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=4 ttl=50 time=8.83 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=5 ttl=50 time=8.63 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=6 ttl=50 time=8.73 ms
--- www.a.shifen.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 8.630/8.813/9.275/0.216 ms
root@linaro-alip:/# ping www.baidu.com -I end1
PING www.a.shifen.com (183.2.172.42) 56(84) bytes of data.
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=1 ttl=50 time=8.35 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=2 ttl=50 time=8.88 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=3 ttl=50 time=9.07 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=4 ttl=50 time=8.91 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=5 ttl=50 time=8.67 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=6 ttl=50 time=8.66 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=7 ttl=50 time=8.78 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=8 ttl=50 time=8.41 ms
--- www.a.shifen.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7011ms
rtt min/avg/max/mdev = 8.352/8.716/9.068/0.230 ms
TCP带宽测试
服务端
在开发板上联网安装iperf3工具,执行如下命令:
root@linaro-alip:/# sudo apt update
root@linaro-alip:/# sudo apt install iperf3
开发板做服务端,执行以下命令:
root@linaro-alip:/# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
客户端
windows的iperf3工具可以在测试工具包中获取。
在windows系统中打开powershell,进入iperf3工具所在路径下 windows做客户端发送数据,执行以下命令:
.\iperf3.exe -c 192.168.137.149 // 192.168.137.149为服务端IP地址
测试结果
- 服务端
root@linaro-alip:/# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.49.85, port 53618
[ 5] local 192.168.49.245 port 5201 connected to 192.168.49.85 port 53619
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 112 MBytes 936 Mbits/sec
[ 5] 1.00-2.00 sec 112 MBytes 937 Mbits/sec
[ 5] 2.00-3.00 sec 112 MBytes 939 Mbits/sec
[ 5] 3.00-4.00 sec 112 MBytes 938 Mbits/sec
[ 5] 4.00-5.00 sec 112 MBytes 937 Mbits/sec
[ 5] 5.00-6.00 sec 111 MBytes 931 Mbits/sec
[ 5] 6.00-7.00 sec 111 MBytes 929 Mbits/sec
[ 5] 7.00-8.00 sec 111 MBytes 930 Mbits/sec
[ 5] 8.00-9.00 sec 111 MBytes 933 Mbits/sec
[ 5] 9.00-10.00 sec 111 MBytes 929 Mbits/sec
[ 5] 10.00-10.00 sec 265 KBytes 885 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1.09 GBytes 934 Mbits/sec receiver
-----------------------------------------------------------
- 客户端