Segment Routing Group Handling:
SR GroupKey data model
Segment Routing application interacts with the Group subsystem using the below SR specific GroupKey. So SR application associate a SRDefaultGroupKey or SRPolicyGroupKey for every group it creates. The SRGroupKey consists of collection of <PortNumber + Label Stack to be pushed on that port> where leftmost label representing the outermost label and rightmost label representing innermost label to be pushed.
For e.g. a ECMP group with two buckets pushing label L1 and output to two ports P1 and P2 respectively can be represented with a SRDefaultGroupKey {{P1, L1}, {P2, L1}}.
SR GroupKey data model
Segment Routing application interacts with the Group subsystem using the below SR specific GroupKey. So SR application associate a SRDefaultGroupKey or SRPolicyGroupKey for every group it creates. The SRGroupKey consists of collection of <PortNumber + Label Stack to be pushed on that port> where leftmost label representing the outermost label and rightmost label representing innermost label to be pushed.
Default Group Handler & Recovery
During Start-up:
Create Segment Id database of all the nodes in the network
Get all devices from Topology service
Add to above list when DEVICE_ADDED event received
For each switch that this instance is master,
If the Group subsystem peforming Group AUDIT, then wait until AUDIT completes
Create Neighbor list
Get all outgoing links from Link service
Update above list when LINK_ADDED event received
Get all Groups from the Store
Perform Audit using above Neighbor list
Policy Group Handler & Recovery
While creating the tunnel, ensure all the stitched groups are created before creating the Group chain in the ingress router
Similarly, while deleting the tunnel, ensure the group is deleted at ingress router before deleting any stitched groups
Group Event Handling