-
Notifications
You must be signed in to change notification settings - Fork 31
Ethernet Learning Switch
This project provides an implementation of an L2 learning switch in P4 targeting the SimpleSumeSwitch architecture. Ethernet packets are forwarded based on the destination MAC address (forward
table). If the destination MAC address is unknown, the packet is broadcasted with source port pruning (broadcast
table). Forwarding entries are learned based on the source MAC address. If the source MAC address is unknown the packet's source port and source MAC address are sent to the control-plane (smac
table). The control-plane will then add the appropriate entries to the forward
and smac
tables.
Note: In the P4 programming model, the data-plane cannot add entries to tables. This is why the packet digest information must be sent to control-plane, which then adds the appropriate entries.
- Build the learning switch P4 project directory
- Build the bitfile
- Load the bitfile + table entries
- Run the control-plane program:
$ cd $P4_PROJECT_DIR/sw/learning_sw/ $ sudo bash # ./learn.py