NetFPGA Demo ——reference_nic_nf1_cml

NetFPGA Demo ——reference_nic_nf1_cml

实验平台

  • OS:deepin 15.4
  • 开发板:NetFPGA_1G_CML

实验过程

NetFPGA-1G-CML从零开始环境配置即已经把该demo烧写到NetFPGA上,接下来即是,复刻一下官方Wiki上的真机测试部分。

实验拓扑图

在PC1中设置NF0的ip为192.168.0.1

sudo ifconfig nf0 192.168.0.1

在PC2中设置有NF0连接的网卡ip为192.168.0.2,以下的网卡为eth1

sudo ifconfig eth1 192.168.0.2

连通性测试

Test 1: Ping

在PC2中执行

ping 192.168.0.1

可得以下结果

PING 192.168.0.2 192.168.0.2) 56(84) bytes of data.

64 bytes from 192.168.0.2: icmp_req=1 ttl=50 time=1.04 ms

64 bytes from 192.168.0.2: icmp_req=2 ttl=50 time=1.04 ms

64 bytes from 192.168.0.2: icmp_req=3 ttl=50 time=1.04 ms

64 bytes from 192.168.0.2: icmp_req=4 ttl=50 time=1.04 ms

Test 2: iperf

首先在PC1以及PC2中都应安装iperf,分别在PC1,PC2执行以下命令,保证能连接上Internet

sudo apt-get install iperf

在PC1中,输入以下命令,令PC1作为服务器接收端

iperf -s

在PC2中,输入以下命令,令PC2作为客户端

iperf -c 192.168.0.1

可得接受速率

------------------------------------------------------------

Client connecting to localhost, TCP port 5001

TCP window size:  132 KByte (default)

------------------------------------------------------------

[  3] local 192.168.0.2 port 52787 connected with 192.168.0.1 port 5001

[ ID] Interval       Transfer     Bandwidth

[  3]  0.0-10.0 sec  9.35 GBytes  935 Mbits/sec

实验结论

确实达到了1G的速率,成功让NetFGPA实现了简单的网卡功能。

原文地址:https://www.cnblogs.com/wpqwpq/p/6952608.html