Skip to content

DTCHUONG/p4-sdn

 
 

Repository files navigation

p4-sdn

Software-defined Networks (SDN) is a new approach for networking in contrast to traditional networks. Network control is decoupled from forwarding functions and is directly programmable in SDN, instead of being (manually) configurable as in traditional networks. RFC7426 delineates the key points to comprehend SDN.

We demonstrate SDN based on P4 and P4-Runtime, which are a data plane programming language and the API for communication between the control plane and the data plane, respectively (check p4.org/specs for specifications of P4 and P4Runtime). In the past (since approx. 2010), OpenFlow tended to be the standard for SDN. Recently, OpenFlow is claimed to be replaced by P4 (see: Clarifying the differences between P4 and OpenFlow).

The library of this repository, p4utils, is based on the p4-utils repository, which is again based on the p4-shell repository. We implement further APIs for the SDN controller, e.g., packet-in, packet-out, APIs related to idle timeout, and provide useful examples.

The examples are designed for the Rechnernetze Praktikum (RNP) at MNM-Team, LMU. The specification of the infrastructure and details about the course are provided in the course's script. The course are usually held annually in the winter semester (e.g., RNP WS2023/2024).

One can also create his/her own test-bed (e.g., in a laptop) by following instructions in Infrastructure-as-Code. After finishing basic setup, a description of the desired test-bed in json format can be input to the existing script to bring it up. The VM-based test-bed allows customization of each individual component (e.g., host, switch, controller...) as one's wish.

  • We first explain SDN based on P4 and P4-Runtime, which is important to understand the basic of P4 and SDN, and to understand the subsequent examples.

  • The simple_demo example shows a simple demonstration of SDN.

  • The simple_switch examples illustrate how a normal switch can be implemented by P4-based SDN.

  • As a switch cannot work properly in a network topology containing loops, we present a more advanced example, ARPcache, to cope with that problem.

  • The controller can measure the data throughput of a switch's port, or the number of packets matched by a certain rule in a switch. Counters are used for these purposes.

  • In some case, we might want to remove idle rules, i.e., rules that do not match any packet for some lapse of time. The idle timeout example demonstrates how this can be achieved.

  • SDN boosts the adoption of policy-based network management, and recently intent-based networking. In this regard, we provide an example, in which the SDN controller exposes useful REST APIs for controlling the data plane. Check it out in Intent-based Networking.

For deeper diving in the area, we propose a selection of ideas. They are relevant for small projects in the RNP-Praktikum, some can be developed further for theses.

TODO:

  • Topics for projects, theses (see ideas)
  • Network Telemetry

About

SDN based on P4 and P4-Runtime

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.7%
  • HTML 8.8%
  • P4 3.7%
  • JavaScript 3.0%
  • Shell 1.0%
  • CSS 0.4%
  • Other 0.4%