Compare commits

...

1 Commits

Author SHA1 Message Date
Rahul Thakur
5e9c28cee4 bridgemngr: design proposal 2024-04-23 15:51:34 +05:30

113
bridgemngr/docs/design.md Normal file
View File

@@ -0,0 +1,113 @@
# Bridge manager design proposal
Aim of this document is to propose initial design for bridge manager.
The bridge manager provides flexibility to the user to use the config device section
or the bridge-vlan section for setting up bridges in the network uci. Essentially,
this package maps tr181 Device.Bridging.Bridge object to network uci.
# How it works?
The implementation of Bridging.Bridge object is moved to bridgemngr and lauched
as a microservice.
Please note that the bridgemngr does not have a separate uci for it. It maps to
network uci, just the way to configure bridges in network uci changes.
We maintain two separate, mutually exclusive implementation of the Bridging.Bridge
object in the bridgemngr and introduce compile time flags to pick which is selected
in the build. The proposed options are:
- CONFIG_BRIDGEMNGR_BACKEND_DEVICE (default)
- CONFIG_BRIDGEMNGR_BACKEND_BRIDGE_VLAN
based on the flag selected, the .so is generated using the corresponding implementation.
In case of backend implementation using device, nothing changes, so the UCI for a bridge looks as follows:
```bash
config device 'l2'
option type '8021q'
option ifname 'eth2'
option vid '100'
option name 'eth2.100'
config device 'w100'
option type '8021q'
option ifname 'eth0'
option vid '100'
option name 'eth0.100'
config device 'v100'
option name 'br-v100'
option type 'bridge'
list ports 'eth0.100'
list ports 'eth2.100'
config device 'i1'
option device 'br-v100'
```
Where as in case of backend implementation using bridge-vlan, it looks as follows:
```bash
config device 'v100'
option name 'br-v100'
option type 'bridge'
list ports 'eth0'
list ports 'eth2'
config bridge-vlan 'v1'
option device 'br-v100'
option vlan '100'
list ports 'eth0:t'
list ports 'eth2:t'
```
# Limitation with bridge-vlan
Please note that the following scenarios cannot be realised with bridge-vlan
- Managed bridge - device cannot get ip address
- VLAN Translation
- The p-bit in header cannot be written at the device so, p-bit translation
and setting is possible. The p-bit in the header from the LAN/WAN device
is passed on untouched.
Also note that QinQ is possible with bridge-vlans with the uci
```bash
config device 'vlan100'
option name 'br-v100'
option type 'bridge'
option ports 'eth2'
config device 'eth0_100'
option ifname 'eth0'
option name 'eth0.100'
option vid '100'
option type '8021q'
config device 'eth0_200'
option ifname 'eth0.100'
option name 'eth0.100.200'
option vid '200'
option type '8021ad'
config bridge-vlan
option device 'br-v100'
option vlan '100'
list ports 'eth2:t'
list ports 'eth0.100.200'
config interface 'v100'
option device 'br-v100'
```
# Limitations with device backend
Please note that the following limitations exist when device backend is used
- Traffic prioritization with vlan and p-bit value
- Preserving the p-bit in the header from LAN/WAN device. The p-bit value
is overwritten by the egress_qos_mapping at the vlandev.