High level layout of Group subsystem components is depicted below.
Provides the following API to applications
void CreateGroup(Device, GroupType, Collection<GroupBuckets>, GroupKey, appid)
Group GetGroup(Device, GroupKey)
void AddBucketsToGroup(Device, OldGroupKey, Collection<GroupBuckets>, NewGroupKey, appid)
void RemoveBucketsFromGroup(Device, OldGroupKey, Collection<GroupBuckets>, NewGroupKey, appid)
GetAllGroupStatistics(Device, appid)
DataModel
Group Types to be supported
Select
Indirect
All
Failover
Key
An application specific cookie that supports Hash and Equals method
Id
Integer
Bucket
One or more collection of Traffic Instructions
{ Collection<TrafficTreatment> groupBuckets = new ArrayList<TrafficTreatment>(); List<PortNumber> outPorts = getPortsToDevice(srcDevice, neighborDevice); for (PortNumber portNumber: outPorts) { TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); tBuilder.setOutput(portNumber) .setEthDst(getRouterMacAddress(neighborDevice)) .setEthSrc(getRouterMacAddress(srcDevice)) .pushMpls() .setMpls(getMplsId(finalDstDevice)); groupBuckets.add(tBuilder.build()); } GroupKey gorupKey = SegmentRoutingGroupKey.build(srcDevice, Collection<NeighborDevice>, dstDevice); Future<Group> future = groupService.createGroup(srcDevice, Group.Type.SELECT, groupBuckets, groupKey, getAppId()); Group group = future.get(); } public void SetIpRule() { .... GroupKey gorupKey = SegmentRoutingGroupKey.build(srcDevice, Collection<NeighborDevice>, dstDevice); Group group = groupService.getGroup(srcDevice, groupKey); tbuilder.setGroup(group.id()); .... } |
This component implements the Group Service interface by defining Group create/modify/remove/query operations on devices.
If the Master for the device is local instance, then the operations are performed locally. If the device is not under the current controller instance, this component send GROUP_ADD_REQUEST to the master controller instance of that device.
Maintains monotonically increasing Group ID number space for each device that will be incremented every time a new group is created.
Creates the groups only if the device doesn’t have those groups populated. If group already exists, the create APIs doesn't perform any operation.
As shown in the below figure, Group Manager perform a AUDIT whenever a device connects to current controller instance as Master. During the Group AUDIT, no group operations can be supported.
Group Store handles the distribution functionality of Group subsystem. Based on the design decision, the Group Store replicates the Groups to either all instances or to a subset of instances. Similarly based on the consistency and durability needs, the type of the data store to be used for Group store would be determined.
Group Store will have authoritative role. i.e. When a Device is connected to the controller as a Master, Group Store will wipe off all extraneous groups in the device and inserts if any groups are missing.
High level flow of events in the Group subsystem is depicted below when an operation like CreateGroup is submitted by the application.
High level flow of events in the Group subsystem is depicted below when an operation like CreateGroup is submitted by the application to non-Master controller instance in a multi-instance environment.
TODO
Provides SB APIs towards core
CreateGroup(GroupId, Buckets)
ModifyGroup(GroupId, Buckets)
RemoveGroup(GroupId)
GetGroups()
Implements Group Providers interface
Builds OF GROUP_MOD (ADD/MOD/DELETE) Message depending on the API invocation and writes the message to switch driver
No changes