Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 1 | VLAN Cross Connect |
| 2 | ================== |
Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 3 | |
Charles Chan | 18c9483 | 2020-09-15 15:45:42 -0700 | [diff] [blame] | 4 | VLAN cross connect creates a L2 bridge between two given endpoints on the same |
| 5 | device. Once configured, every packets arriving at one of the endpoints with |
| 6 | specific VLAN tag will be sent to another endpoint directly. Current |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 7 | implementation only matches on the outermost VLAN tag. If the packet is double |
| 8 | tagged, the S-tag will be matched and both the S-tag and C-tag will be |
| 9 | persisted. |
| 10 | |
Charles Chan | 18c9483 | 2020-09-15 15:45:42 -0700 | [diff] [blame] | 11 | .. note:: |
| 12 | An endpoint could be a physical port number or a logical port load balancer ID. |
| 13 | See examples below. |
| 14 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 15 | VLAN cross connect only works on the same device. If you are looking for |
| 16 | transporting L2 traffic across devices, please refer to :doc:`pseoduwire |
| 17 | <pseudowire>` |
Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 18 | |
| 19 | View cross connect via CLI |
| 20 | -------------------------- |
| 21 | To view a list of cross connects configured in the system through ONOS CLI: |
| 22 | |
| 23 | .. code-block:: text |
| 24 | |
| 25 | sr-xconnect |
| 26 | |
| 27 | Add cross connect via CLI |
| 28 | ------------------------- |
| 29 | |
| 30 | .. code-block:: text |
| 31 | |
Charles Chan | 18c9483 | 2020-09-15 15:45:42 -0700 | [diff] [blame] | 32 | sr-xconnect-add <deviceId> <vlanId> <ep1> <ep2> |
Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 33 | |
| 34 | - ``deviceId``: device ID, e.g. **of:0000000000000201** |
| 35 | - ``vlanId``: VLAN ID, e.g. **94** |
Charles Chan | 18c9483 | 2020-09-15 15:45:42 -0700 | [diff] [blame] | 36 | - ``ep1``: One end point of the cross connect. |
| 37 | Use integer to specify physical port number (e.g. **1**). |
| 38 | Use ``LB:<key>`` to specify port load balancer key (e.g. **LB:2**) |
| 39 | - ``ep2``: Another end point of the cross connect. |
| 40 | Use integer to specify physical port number (e.g. **3**). |
| 41 | Use ``LB:<key>`` to specify port load balancer key (e.g. **LB:4**) |
Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 42 | |
| 43 | Remove cross connect via CLI |
| 44 | ---------------------------- |
| 45 | |
| 46 | .. code-block:: text |
| 47 | |
| 48 | sr-xconnect-remove <deviceId> <vlanId> |
| 49 | |
| 50 | - ``deviceId``: device ID, e.g. **of:0000000000000201** |
| 51 | - ``vlanId``: VLAN ID, e.g. **94** |
| 52 | |
| 53 | View cross connect via REST |
| 54 | --------------------------- |
| 55 | |
| 56 | .. code-block:: console |
| 57 | |
| 58 | $ curl -X GET --header 'Accept: application/json' 'http://${ONOS-IP}:8181/onos/segmentrouting/xconnect' |
| 59 | |
| 60 | Add cross connect via REST |
| 61 | -------------------------- |
| 62 | |
| 63 | .. code-block:: console |
| 64 | |
| 65 | $ curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ |
| 66 | "deviceId": "of:0000000000000201", \ |
| 67 | "vlanId": "94", \ |
Charles Chan | 18c9483 | 2020-09-15 15:45:42 -0700 | [diff] [blame] | 68 | "endpoints": [ 1, 2 ] \ |
Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 69 | }' 'http://${ONOS-IP}/onos/segmentrouting/xconnect' |
| 70 | |
| 71 | - ``deviceId``: device ID, e.g. **of:0000000000000201** |
| 72 | - ``vlanId``: VLAN ID, e.g. **94** |
Charles Chan | 18c9483 | 2020-09-15 15:45:42 -0700 | [diff] [blame] | 73 | - ``endpoints``: endpoints of the cross connect, e.g. **[1, 2]** |
Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame] | 74 | |
| 75 | Remove cross connect via REST |
| 76 | ----------------------------- |
| 77 | |
| 78 | .. code-block:: console |
| 79 | |
| 80 | $ curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ |
| 81 | "deviceId": "of:0000000000000201", \ |
| 82 | "vlanId": "94" \ |
| 83 | }' 'http://${ONOS-IP}:8181/onos/segmentrouting/xconnect' |
| 84 | |
| 85 | - ``deviceId``: device ID, e.g. **of:0000000000000201** |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 86 | - ``vlanId``: VLAN ID, e.g. **94** |
Charles Chan | c65ac05 | 2020-08-05 11:58:07 -0700 | [diff] [blame] | 87 | |
| 88 | .. caution:: |
| 89 | For a given port, we should avoid using the same VLAN ID in both xconnect and interface configuration at the same time (regardless of untagged, tagged or native) |