Skip to content

Ethernet Learning Switch

sibanez12 edited this page Jul 8, 2017 · 2 revisions

Ethernet Learning Switch

Description

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.

Usage

  1. Build the learning switch P4 project directory
  2. Build the bitfile
  3. Load the bitfile + table entries
  4. Run the control-plane program:
    $ cd $P4_PROJECT_DIR/sw/learning_sw/
    $ sudo bash
    # ./learn.py