Skip to content
Amy Buck edited this page Aug 7, 2017 · 8 revisions

The NAS L2 STG module provides STG-related services of the NPU (accessed through SAI interfaces), requested by the CPS layer/third-party applications/kernel.

Services

  • Create/delete STG instance in the NPU
  • Associate/delete list of VLANs to a STG instance
  • Update STP port state (disabled/ blocking, listening, learning, forwarding) of a port within STG instance
  • Retrieve STG specific details (list of VLANs associated to a STG, STP port state)
  • Create/delete STG Instance per Bridge which has STP enabled on it in the kernel

NAS L2 STG module

This module mostly works as a pass-through module to configure/retrieval of STG-related attributes. There is a limited sanity check made within this module on the parameters passed from CPS layer. The NAS L2 STG module maintains a limited software cache. This module would instantiate default spanning tree group (STG 0) during the initialization.

This STG module listens to kernel Netlink message and call corresponding SAI API to program the NPU. User can create bridge and associate VLANs with it.

Kernel bridges can act as broadcast domain, so there should be single VLAN associated with the kernel bridge. When STP is enabled on the bridge, NAS-L2-STG module will create a new STG instance in the NPU based on netlink message. If the bridge has a VLAN interface in it, NAS L2 STG will add that to the STG instance in NPU. This behavior is similar to PVST. This module maintains the mapping between the Linux kernel bridge (kernel ifindex for corresponding bridge interface) and NPU STG instance.

If there is a bridge with no VLAN configured and STP is enabled on it, interfaces under this bridge will be part of the default VLAN. There will be a default STG instance associated with the default VLAN. NAS L2 STG module then uses default STG instance to update port STP state in NPU when it receives netlink message from the kernel.

NOTE: Enabling STP on a bridge with no VLAN configured may result in undefined behavior. Attempting to configure multiple VLANs to a bridge is not supported.

It is assumed that the NAS-CoPP module takes care of assigning respective priority queue in NPU for protocol xSTP (handling BPDU) and related discussion is out of the current scope.

This STG module listens for VLAN updates from NAS-VLAN module. If default VLAN ID changes (generally VLAN 1 is initialized as default VLAN), it updates the default STG instance associated with default VLAN.

Clone this wiki locally