Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use different external interace name when VLAN ID=0 #233

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Conversation

zolug
Copy link
Collaborator

@zolug zolug commented Jun 2, 2022

In case VLAN ID=0 NSM won't create a VLAN subinterface.
In fact, the base interface might not even be a VLAN interface.
So let Remote VLAN NSE create an interace with the name "ext"
in such cases.

Testing VLAN ID=0 requires NSM 1.4.0 uplift including an NSC patch to disable data-path healing: #231

Also, prior to starting NSM vpp forwarders the device selector config map must be updated to contain the VLAN interface(s) to be used.

Example:

# adjust device selector config map then deploy NSM
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: device-selector
data:
  selector: "---\ninterfaces:\n
    \  - name: eth0\n
    \    matches:\n
    \       - labelSelector:\n
    \          - via: eth0\n
    \  - name: eth1.200\n
    \    matches:\n
    \       - labelSelector:\n
    \          - via: eth1.200\n
    \  - name: eth1\n
    \    matches:\n
    \       - labelSelector:\n
    \          - via: eth1\n     \n"

# start trench-a based on host interface eth1.200
helm install Meridio/deployments/helm/ --generate-name --namespace default --set trench.name=trench-a --set vlan.interface=eth1.200,vlan.id=0 --set ipFamily=dualstack

Note: Occasionally vpp "fails to learn" all the interfaces in the device selector config map (could be more common when device selector contains more interfaces). In which case the external interface won't be created in the fe container.
Important: Currently vpp forwarder will quit processing the devices whenever it encounters an interface that does not exist on the host (not considered a fatal error). Devices are stored in a map (which does not guarantee any ordering when iterating), thus even using the same device selector config map different NSM starts might or might not experience the above problem.

Check the interfaces by entering the vpp forwarder container and then fetching the known interfaces through vppcli:

kubectl exec -ti -n nsm forwarder-vpp-269t2 -- bash
root@vm-001:/# vppctl show interface
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count     
host-eth1                         1      up     1500/1500/1500/1500 rx packets                 31071
                                                                    rx bytes                11605708
                                                                    drops                      31071
                                                                    ip4                        14128
                                                                    ip6                         2543
local0                            0     down          0/0/0/0       

kubectl exec -ti -n nsm forwarder-vpp-w7xkx -- bash
root@vm-001:/# vppctl show interface
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count     
host-eth0.200                     1      up     1500/1500/1500/1500 
host-eth1                         5      up     1500/1500/1500/1500 rx packets                  2871
                                                                    rx bytes                 1183370
                                                                    tx packets                     2
                                                                    tx bytes                      84
                                                                    drops                       2871
                                                                    ip4                         1215
                                                                    ip6                          207
host-eth1.200                     2      up     1500/1500/1500/1500 
host-eth2                         4      up     1500/1500/1500/1500 rx packets                     1
                                                                    rx bytes                      70
                                                                    drops                          1
host-eth2.200                     3      up     1500/1500/1500/1500 
local0                            0     down          0/0/0/0       


In case VLAN ID=0 NSM won't create a VLAN subinterface.
In fact, the base interface might not even be a VLAN interface.
So let Remote VLAN NSE create an interace with the name "ext"
in such cases.
@zolug zolug requested a review from LionelJouin June 3, 2022 10:45
@zolug
Copy link
Collaborator Author

zolug commented Jun 9, 2022

@zolug zolug merged commit 6c0e161 into master Jun 9, 2022
@zolug zolug deleted the no-vlan-subint branch March 4, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants