The 802.1CB feature provides a mechanism to split a traffic stream into multiple duplicate streams. Each duplicate stream can take a different path through the network to the destination device and the packets are marked with a sequence number using the R-Tag field. At the destination device the switch examines the packet sequence number in the R-Tag field, accepts the first packet with a unique sequence number, and removes packets with duplicate sequence number. The intent of the 802.1CB feature is to avoid any packet loss when links or switches fail.
Dot1cb OpEN API
This document provides a brief description of the Dot1cb OpEN APIs. It provides the following services:
- Get the 802.1CB mode for a given VLAN.
- Set the 802.1CB mode for a given VLAN.
- Get the 802.1CB ARP/NDP forwarding mode for a given VLAN.
- Set the 802.1CB ARP/NDP forwarding mode for a given VLAN.
- Get the configured flow ID.
- Get the configured flow type.
- Set the flow type and ID of an existing macfilter.
- Get the 802.1CB RTAG mode for the specified interface.
- Set the 802.1CB RTAG mode for the specified interface.
- Clear all the 802.1CB statistics.
- Get the 802.1CB global statistics.
- Get the 802.1CB statistics for the specified interface.
- Get the next valid 802.1CB interface.
- Add an IPv4 classifier.
- Delete an IPv4 classifier.
- Get an IPv4 classifier.
- Get the next IPv4 classifier.
- Get the number of configured IPv4 classifiers.
- Get the status flag indicating whether IPv4 classifiers are installed in the hardware.
- Add an IPv6 classifier.
- Delete an IPv6 classifier.
- Get an IPv6 classifier.
- Get the next IPv6 classifier.
- Get the number of configured IPv6 classifiers.
- Get the status flag indicating whether IPv6 classifiers are installed in the hardware.
- Get the number of transit flows installed in the hardware.
- Get the number of initiator flows installed in the hardware.
- Get the number of MFDB entries associated with flows.
- Get the number of 802.1CB enabled VLANs.
- Get the next 802.1CB enabled VLAN.
- Get the 802.1CB initiator flow and its status/statistics.
- Get the next 802.1CB initiator flow and its status/statistics.
- Get the 802.1CB transit flow and its status/statistics.
- Get the next 802.1CB transit flow and its status/statistics.
- Get the 802.1CB transit flow configuration.
- Set the history window size for an 802.1CB transit flow.
- Set the acceptance window size for an 802.1CB transit flow.
- Set the age time for an 802.1CB transit flow.
All 'Set' operations would affect the Switch behavior and configuration.
Example C Application dot1cb_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
dot1cb_example
dot1cb_example.c is a sample application that demonstrates the use of OpEN's Dot1cb APIs. dot1cb_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./dot1cb_example <test#> <arg1> <arg2> ...
- Test 1: Get the 802.1CB mode for a given VLAN: dot1cb_example 1 <vlanID>
- Test 2: Set the 802.1CB mode for a given VLAN: dot1cb_example 2 <vlanID><mode>
- Test 3: Get the 802.1CB ARP/NDP forwarding mode for a given VLAN: dot1cb_example 3 <vlanID>
- Test 4: Set the 802.1CB ARP/NDP forwarding mode for a given VLAN: dot1cb_example 4 <vlanID><mode>
- Test 5: Get the configured flow ID: dot1cb_example 5 <buf><vlanID>
- Test 6: Get the configured flow type: dot1cb_example 6 <buf><vlanID>
- Test 7: Set the flow type and ID of an existing macfilter: dot1cb_example 7 <buf><vlanID><flowType><flowId>
- Test 8: Get the 802.1CB RTAG mode for the specified interface: dot1cb_example 8 <ifNum>
- Test 9: Set the 802.1CB RTAG mode for the specified interface: dot1cb_example 9 <ifNum><mode>
- Test 10: Clear all the 802.1CB statistics: dot1cb_example 10
- Test 11: Get the 802.1CB global statistics: dot1cb_example 11
- Test 12: Get the 802.1CB statistics for the specified interface: dot1cb_example 12 <ifNum>
- Test 13: Get the next valid 802.1CB interface: dot1cb_example 13 <ifNum>
- Test 14: Add an IPv4 classifier: dot1cb_example 14 <srcAddr><srcMaskLen><dstAddr><dstMaskLen><flowType><flowId>
- Test 15: Delete an IPv4 classifier: dot1cb_example 15 <srcAddr><srcMaskLen><dstAddr><dstMaskLen>
- Test 16: Get an IPv4 classifier: dot1cb_example 16 <srcAddr><srcMaskLen><dstAddr><dstMaskLen>
- Test 17: Get the next IPv4 classifier: dot1cb_example 17 <srcAddr><srcMaskLen><dstAddr><dstMaskLen>
- Test 18: Get the number of configured IPv4 classifiers: dot1cb_example 18
- Test 19: Get the status flag indicating whether IPv4 classifiers are installed in the hardware: dot1cb_example 19
- Test 20: Add an IPv6 classifier: dot1cb_example 20 <srcAddr><srcMaskLen><dstAddr><dstMaskLen><flowType><flowId>
- Test 21: Delete an IPv6 classifier: dot1cb_example 21 <srcAddr><srcMaskLen><dstAddr><dstMaskLen>
- Test 22: Get an IPv6 classifier: dot1cb_example 22 <srcAddr><srcMaskLen><dstAddr><dstMaskLen>
- Test 23: Get the next IPv6 classifier: dot1cb_example 23 <srcAddr><srcMaskLen><dstAddr><dstMaskLen>
- Test 24: Get the number of configured IPv6 classifiers: dot1cb_example 24
- Test 25: Get the status flag indicating whether IPv6 classifiers are installed in the hardware: dot1cb_example 25
- Test 26: Get the number of transit flows installed in the hardware: dot1cb_example 26
- Test 27: Get the number of initiator flows installed in the hardware: dot1cb_example 27
- Test 28: Get the number of MFDB entries associated with flows: dot1cb_example 28
- Test 29: Get the number of 802.1CB enabled VLANs: dot1cb_example 29
- Test 30: Get the next 802.1CB enabled VLAN: dot1cb_example 30 <vid>
- Test 31: Get the 802.1CB initiator flow and its status/statistics: dot1cb_example 31 <flowId>
- Test 32: Get the next 802.1CB initiator flow and its status/statistics: dot1cb_example 32 <flowId>
- Test 33: Get the 802.1CB transit flow and its status/statistics: dot1cb_example 33 <flowId>
- Test 34: Get the next 802.1CB transit flow and its status/statistics: dot1cb_example 34 <flowId>
- Test 35: Get the 802.1CB transit flow configuration: dot1cb_example 35 <flowId>
- Test 36: Set the history window size for an 802.1CB transit flow: dot1cb_example 36 <flowId><historyWindow>
- Test 37: Set the acceptance window size for an 802.1CB transit flow: dot1cb_example 37 <flowId><acceptanceWindow>
- Test 38: Set the age time for an 802.1CB transit flow: dot1cb_example 38 <flowId><ageTime>
- Test 39: Get the SA-MAC/VLAN flow association mode: dot1cb_example 39
- Test 40: Set the SA-MAC/VLAN flow association mode: dot1cb_example 40 <mode>
- Test 41: Run API sanity checks: dot1cb_example 41
Dot1cb CLI/API Cross Reference