From 7462a240edabe066168c2dd8695ba8d9f0d73085 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Sun, 21 Feb 2021 11:08:03 +0000 Subject: [PATCH] added tc based datapath mode for vr routers --- clab/config.go | 10 ++++++---- docs/manual/vrnetlab.md | 40 ++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/clab/config.go b/clab/config.go index e85810bb6..b3f66c7c2 100644 --- a/clab/config.go +++ b/clab/config.go @@ -25,6 +25,8 @@ const ( dockerNetMTU = "1450" srlDefaultType = "ixr6" vrsrosDefaultType = "sr-1" + // default connection mode for vrnetlab based containers + vrDefConnMode = "tc" ) // supported kinds @@ -586,7 +588,7 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error { // env vars are used to set launch.py arguments in vrnetlab container defEnv := map[string]string{ - "CONNECTION_MODE": "ovs"} + "CONNECTION_MODE": vrDefConnMode} node.Env = mergeStringMaps(defEnv, envs) // mount tftpboot dir @@ -608,7 +610,7 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error { defEnv := map[string]string{ "USERNAME": "admin", "PASSWORD": "admin@123", - "CONNECTION_MODE": "ovs", + "CONNECTION_MODE": vrDefConnMode, } node.Env = mergeStringMaps(defEnv, envs) @@ -629,7 +631,7 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error { defEnv := map[string]string{ "USERNAME": "clab", "PASSWORD": "clab@123", - "CONNECTION_MODE": "ovs", + "CONNECTION_MODE": vrDefConnMode, } node.Env = mergeStringMaps(defEnv, envs) @@ -650,7 +652,7 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error { defEnv := map[string]string{ "USERNAME": "clab", "PASSWORD": "clab@123", - "CONNECTION_MODE": "ovs", + "CONNECTION_MODE": vrDefConnMode, "VCPU": "2", "RAM": "12288", } diff --git a/docs/manual/vrnetlab.md b/docs/manual/vrnetlab.md index b44868031..cdb444f79 100644 --- a/docs/manual/vrnetlab.md +++ b/docs/manual/vrnetlab.md @@ -46,30 +46,26 @@ To build a container image with XRv9k/XRv inside users should follow [the instru ### Connection modes -Containerlab offers several ways VM based routers can be connected with the rest of the docker workloads. By default, vrnetlab integrated routers will use **Openvswitch** backend, which assumes that openvswitch is installed on the containerlab host. OVS backend allows vrnetlab based routers to use LACP/STP/LLDP protocols without restrictions. +Containerlab offers several ways VM based routers can be connected with the rest of the docker workloads. By default, vrnetlab integrated routers will use **tc** backend[^2] which doesn't require any additional packages to be installed on the containerhost and supoprts transparent passage of LACP frames. -
+
-??? "How to install openvswitch?" - Debian based systems (i.e. Ubuntu) can install ovs with `apt install openvswitch-switch` command. - Centos users can follow [this installation manual](https://gist.github.com/umardx/a31bf6a13600a55c0d07d4ca33133834). +??? "Any other datapaths?" + Althout `tc` based datapath should cover all the needed connectivity requirements, if other, bridge-like, datapaths are needed, Containerlab offers OpenvSwitch and Linux bridge modes. + Users can plug in those datapaths by specifying `CONNECTION_MODE` env variable: + ```yaml + # the env variable can also be set in the defaults section + name: myTopo -If OVS can't be installed on containerlab host, it is possible to use **Linux Bridge** backend. Linux bridges won't pass LACP frames, but they will pass LLDP and don't require any packages to be installed on the containerlab hostgo. To use Linux Bridge backend, the users should set an environment variable like so: + topology: + nodes: + sr1: + kind: vr-sros + image: vrnetlab/vr-sros:20.10.R1 + env: + CONNECTION_MODE: bridge # use `ovs` for openvswitch datapath + ``` -```yaml -# the env variable can also be set in the defaults section -name: myTopo -topology: - nodes: - sr1: - kind: vr-sros - image: vrnetlab/vr-sros:20.10.R1 - env: - CONNECTION_MODE: bridge -``` - -### Limitations and known issues -* When Linux Bridge connection mode is used LACP and BPDU packets can not be delivered to/from VM's running inside the containers. By default containerlab uses OVS backend, where LACP and BPDU work. - -[^1]: see [this example lab](../lab-examples/vr-sros.md) with a license path provided in the topology definition file \ No newline at end of file +[^1]: see [this example lab](../lab-examples/vr-sros.md) with a license path provided in the topology definition file +[^2]: pros and cons of different datapaths were examined [here](https://netdevops.me/2021/transparently-redirecting-packets/frames-between-interfaces/) \ No newline at end of file