-
Notifications
You must be signed in to change notification settings - Fork 140
PortAggregator
- Status :
- Version :
- Authors :
- NetFPGA base source :
This is a sample project using Vlan remover/adder and outport_aggregator modules. This project allows you to decouple each NetFPGA input/output queue from a physical NetFPGA MAC port. This project uses Vlan tag values instead of physical port number to identify its 'source port'. It translates each 'destination port' information into the corresponding Vlan tag (specified through registers) and uses only one actual output port for sending out packets.
You can use a set of vlan_adder, vlan_remover and outport_aggregator modules as a wrapper for your own project.
Note: Since this design aggregates four ports into one, there is a bandwidth limitation allowing 1Gbps for 4 physical ports.
- Install the NetFPGA Base Package
Download from Here
The regression tests verify the functionality of this project. In order to run the tests, you need to have the machine connected for the regression tests as stated in the Run Regression Tests section of the Guide.
Before you run regression tests, perform following command to create necessary headers and libraries for the tests. (Usually this script runs automatically when you run a simulation or run 'make' to do synthesis and implementation.)
nf2_register_gen.pl --project port_aggregator
type the following command to run the regression tests.
nf2_regress_test.pl --project port_aggregator
- Name :
- Description :
- Location
projects/port_aggregator/regress/test_loopback_simple
- Output
SUCCESS!
- Name :
- Description :
- Location
projects/port_aggregator/regress/test_drop_novlan
- Output
SUCCESS!
- Name :
- Description :
- Location
projects/port_aggregator/regress/test_drop_wrongvlan
- Output
SUCCESS!
- Name :
- Description :
- Location
projects/port_aggregator/regress/test_inaggr_outrandom
- Output
SUCCESS!
- Name :
- Description :
- Location
projects/port_aggregator/regress/test_inaggr_outmod
- Output
SUCCESS!
Edit register-configuration file:
cd projects/port_aggregator/sw/ vi register_setup.sh
You will find 17 variables on the top part of the file. They are 8 registers for setup forwarding output-ports, 4 registers for VLAN tag description for input ports, 4 registers or VLAN tag description for output ports and one register for specifying the output port. See comments for each section and modify accordingly.
Connect the cables as you described in the register setup file above.
Download the project bitfile:
su nf2_download port_aggregator.bit
Run the script you have modified:
su cd projects/port_aggregator/sw/ ./register_setup.sh
Now you are ready to use this design.
vlan_tag_handler
This module is attached as the first module of user_data_path. This module passes through all the packets coming from CPU ports. If an incoming packet is not from CPU port, it checks if it has VLAN ethernet type (0x8100) and checks VLAN tag value. If tag is not found or is different from the values setup in the registers, it discards the packet. Otherwise, it strips VLAN ether type field and VLAN tag field (totally 4 octets). VLAN tag field is inserted in a module header right after the IOQ module header. It also recalculates the packet size and replaces values in IOQ module header. So now the VLAN information resides in a module header and the packet itself doesn't have VLAN tag.
This module aggregates packets from four ports in one outgoing port. The output port must be specified via a register. It inputs data from all four ports in parallel and choose one of them at a time in a round robin fashion. Now the data from four ports are aggregated in one queue. The data are copied and send out to all four output ports, but this module activates control signals of one output port (specified via a register).