"Are you P4 compliant ?". In France in the 1990's it was a pure French private joke before the military service was officially abolished. At that time being "classé P4" meant that you were mentally unable to join the French military army. Even if you wanted to. Therefore, at the age of 18, some daring people faked mental illness in order to avoid the "Service militaire" (1 year duration). Of course here, P4 is about the data plane programming language from P4Lang project.
Requirement
|
Overview
For those who are not familiar with data plane programming and especially with P4, "P4 is a domain-specific programming language for specifying the behaviour of the dataplanes of network-forwarding elements." (from p4.org) in short it helps you to write a "program specifying how a switch processes packets".
Article objective
In this article we'll using freeRouter setup deployed in #002 and replace the pcapInt providing freeRouter native software dataplane with P4Lang's dataplane. Actually the effective dataplane is ensured P4lang virtual simple_switch_grpc running RARE P4 program called: router.p4.
Diagram
[ #003 ] - Cookbook
Verification
Conclusion
In this article you:
- had a demonstration of how to integrate freeRouter into a local area network (Similar to article #002)
- However instead of using pcapInt you are now using a software P4 dataplane from P4lang project: bmv2
- BMv2 simple_switch_grpc target is used an run RARE router.p4
- communication between freeRouter control plane and bmv2 is ensured by pcapInt via veth pair [ veth250 - veth251 ]
- This communication is possible via RARE forwarder.py based on GRPC P4Lang P4Runtime python binding
- In this example the BMv2 P4 switch has only 1 dataplane interface that is bound to enp0s9 VM interface exposed to the local network as a bridged interface
[ #003 ] RARE/FreeRouter-101 - key take-away
- FreeRouter is using UNIX socket in order to forward packet dedicated to control plane + dataplane communication.
This essential paradigm is used to ensure communication between freeRouter and BMv2 P4 dataplane. It is ensured by pcapInt binary from freeRouter net-tools that will bind freeRouter socket (veth251@locathost:22710) to a virtual network interface (veth250@localhost:22709) connected to CPU_PORT 64.
- freeRouter control plane and dataplane communication is enabled by RARE forwarder.py
forwarder.py is a simple python script based on GRPC P4Runtime python library.
freeRouter is doing all the control plane route computation and write/modify/remove message entry via P4Runtime so that P4 entries are created/modified/removed accordingly from P4 tables
- BMv2 target
While BMv2 target is a very good choice for packet processing algorithm validation, it is not an ideal target for production use. We will see in next articles how we can reach a higher rate throughput related required by use cases defined by network operators.
While in article #001 of the 101 series we learnt how to spawn 2 router instances on the same VM, this use case is only useful for learning/pedagogic purposes. freeRouter can be considered as networking Swiss Army Knife in real networks. We will demonstrate further freeRouter capability to take control a a full VM and then be able to directly communicate with the external real world via the VM network device interface. i.e Out of the VM scope.
Requirement
|
Overview
Working with freeRouter inside VM is interesting but working and interact with the outside world is way more exciting !
Article objective
In this article we'll explain how to integrate freeRouter in an existing local area network (my home network) and how to inherit from IPv4 DHCP and IPv6 SLAAC. Though this simple example is consumer/end user oriented, freeRouter can be incorporated into a Internet Service provider environment. You can easily imagine how to build a highly scalable and versatile BGP route Reflector, sophisticated route server, ROA/RPKI validator or even a BGP BMP server ... (and the list of features set is huge). For example, in one of my project since 2015 I'm using freeRouter as a BGP route reflector inside a k8s cluster running calico network plugin.
Diagram
[ #002 ] - Cookbook
Verification
Conclusion
In this article you:
- had a demonstration of how to integrate freeRouter to a local area network
- learn how to configure an interface in order to act as an IPv4 DCHP client
- learn how to configure an interface using IPv6 SLAAC
[ #002 ] RARE/FreeRouter-101 - key take-away
- FreeRouter is using UNIX socket in order to forward packet.
You can use pcapInt binary from freeRouter net-tools that will bind freeRouter socket (locathost:26011) to a physical network interface (localhost:26021@enp0s9)
- freeRouter is a Swiss Army Knife
It support a huge list of feature with IPv4/IPv6 parity. In this example we demonstrated how an interface can inherit IPv4/IPv6 addresses from IPv4 DHCP server or IPv6 SLAAC
- freeRouter can interact with the real network (in various flavors. We will develop this in further articles)
It can be used as a BGP route reflector in Internet Service Provider environment, as ROA/RPKI validator, BMP server, BGP looking glass, route server etc.
The main objective of [RARE / FreeRouter 101] series is to help you getting started with FreeRouter from scratch without any prior knowledge.
Requirement
|
Overview
freeRouter is a free, open source router control plane software. For nostalgic and networkers from prehistoric era (like me), freeRouter besides Ethernet, is able to handle HDLC, X25, frame-relay, ATM encapsulation. Since it handles packets itself at the socket layer, it is independent of underlying Operation System capabilities. We will see in the next articles how freeRouter subtlety leverage this inherently independence to connect different data-plane such as OpenFlow, P4 and other possible data-plane that would appear in the near future.
The command line tries to mimic the industry standards with one exception:
- no global routing table: every routed interface must be in a virtual routing table
- positive side effect: there are no vrf-awareness questions
Article objective
This article is meant to simply deploy 2 instances of freeRouter on the same fresh linux installed linux box. We are voluntary using freeRouter (freerouter.nop.hu) "raw" official repository in order to get familiar with the deployment manual process. Even if the deployment process is straightforward, it is not self explanatory for people non familiar with java/linux.
In order to simplify the deployment we have automated freeRouter daily builds on:
- launchpad packages for ubuntu 18.04 and 20.04
- debian 10 (aka buster) package on OpenSuse Build System
- container on Docker Hub
But let's get our "hand dirty" and follow the simple manual installation.
Diagram
[ #001 ] - Cookbook
Verification
Conclusion
In this article you:
- had a brief introduction of freeRouter networking Swiss army knife
- learn how to deploy 2 instances of freeRouter and interconnect them via 2 UNIX sockets on a VM guest running on VirtualBox
- this setup is ideal, for network simulation encompassing hundreds of nodes, self contained in the same VM without interaction with the external world. (protocol experimentation, convergence test etc.)
[ #001 ] RARE/FreeRouter-101 - key take-away
- FreeRouter is using UNIX socket in order to forward packet.
This is a key feature that will be leveraged to connect freeRouter control plane to any type of data-plane
- In FreeRouter everything is in a VRF (so there is no global VRF)
This design choice has very positive consequences like: No VRF awareness questions,have multiple bgp processes for the same freeRouter instance (each bound to a different VRF)
- freeRouter is dual stack
All the feature set is IPv4 and IPv6 compliant. So there is no compromised !