Ethernet Hub Tutorial - Real Hardware
You will test your Ethernet hub as a group (the same group used for your projects). Before starting, look at the Project Groups page to find the number and IP address of the netfpga system that your group has been assigned. For example, if you belong to group #1, your netfpga system can be accessed using the name netfpga01.
Tip: We have set up the /etc/hosts file to provide helpful names so you don't have to remember IP addresses. These names are shown on the Network Topology page, which provides an overview of how your NetFPGA board is connected to other computers in the lab.
To begin, first start your local X11 server, enable X forwarding (tunneling), and SSH to ecs-network.serv.pacific.edu. While on the main server, open up a console window on the server via
Gnome-terminal is used in this tutorial because it allows you to have tabs, which will help us stay organized. In your new ecs-network terminal window, open four tabs via the File menu or Shift-Ctrl-T. These tabs will connect to:
- Tab 1 - Your netfpga system
- Tab 2 - Server 1
- Tab 3 - Server 2
- Tab 4 - Server 3
In Tab 1, SSH to the netfpga system for your group, which might be netfpga01 through netfpga0X. Don't forget to enable X forwarding.
ssh -Y <netfpgaXX>
In Tab 2, SSH to the class server 1.
ssh -Y server1
In Tab 3, SSH to the class server 2.
ssh -Y server2
In Tab 4, SSH to the class server 3.
ssh -Y server3
In Tab 1 (your netfpga system), download your new Ethernet hub bitfile to the FPGA.
op nf_download $NF_ROOT/bitfiles/ethernet_hub.bit
Congratulations! You now have an Ethernet hub!
Well, perhaps we should test it first before declaring victory...
On all four machines (all four open tabs), run the Wireshark packet analysis program. Pay attention to which computer opens which Wireshark window! They will all look the same otherwise.
op wireshark &
Note: The Wireshark program must be run with administrative privileges because it needs to set the Ethernet adapter to promiscuous mode and capture all packets received.
You should now have Wireshark running on four machines that are connected to your NetFPGA Ethernet hub. Visit the Network Topology page to refresh your memory of what the network layout looks like.
In all Wireshark windows, we need to tell it to start listening to the correct network interface. If you pick the wrong network interface on the servers, you will be looking at traffic from other groups, which will be very confusing. Here's how to pick the correct interface for all three computers:
- Server 1: You should see four network devices (plus Any and Lo). The device with the 10.10.xxx.xxx address is the control NIC in the computer (connected to the campus network), and the remaining devices with 192.168.xxx.xxx address are connected to each group's NetFPGA boards. Choose the link connected to your group's NetFPGA board based on IP address. (For example, if you are group #1, choose the link that has IP 192.168.1.xxx)
- Server 2: Follow the same process as server 1.
- Server 3: Follow the same process as server 1.
- netfpga0X: Choose the link connected to the 192.168.x.x interface (the private link to the NetFPGA board).
In Wireshark for all three machines, go to Capture->Interfaces, and click on the Options button next to the desired capture interface. For this tutorial, make sure the following 3 options are enabled. Note that you might not always want these as your defaults if you're capturing a lot of traffic for later analysis.
- Update list of packets in real time (in particular, this is very slow when capturing many packets!)
- Automatic scrolling in live capture
- Hide capture info dialog
Now, you should have 4 copies of Wireshark running and capturing all Ethernet packets on the correct network interface.
Tip: To clear the list of collected packets, go to Interfaces->Restart. This might be helpful so that they all start at approximately the same place in time.
To verify that you hub is working correctly, you need to demonstrate the following items:
- Pings from server1 to server2 work correctly. (This must be done via YOUR HUB, not another group's hub, and not by the campus network). Use the Network Topology page to determine the correct IP address to target.
- You already have a console window open to server1, so enter the ping command at that shell: ping 192.168.X.66 (replace X with your group's IP number)
- Wireshark on server1, server2, server3, and netfpga0X should all show the same echo request and echo reply (i.e. ping) packets appearing.
- Why do they all show the requests and replies?