blob: 12f39da0e8c1f6a39899a9682936985fbba86d1a [file] [log] [blame]
Charles Chan9e5c6172019-09-07 11:24:54 -07001VLAN Cross Connect
2==================
Charles Chan9e5c6172019-09-07 11:24:54 -07003
Charles Chan18c94832020-09-15 15:45:42 -07004VLAN cross connect creates a L2 bridge between two given endpoints on the same
5device. Once configured, every packets arriving at one of the endpoints with
6specific VLAN tag will be sent to another endpoint directly. Current
Zack Williamsd63d35b2020-06-23 14:12:46 -07007implementation only matches on the outermost VLAN tag. If the packet is double
8tagged, the S-tag will be matched and both the S-tag and C-tag will be
9persisted.
10
Charles Chan18c94832020-09-15 15:45:42 -070011.. note::
12 An endpoint could be a physical port number or a logical port load balancer ID.
13 See examples below.
14
Zack Williamsd63d35b2020-06-23 14:12:46 -070015VLAN cross connect only works on the same device. If you are looking for
16transporting L2 traffic across devices, please refer to :doc:`pseoduwire
17<pseudowire>`
Charles Chan9e5c6172019-09-07 11:24:54 -070018
19View cross connect via CLI
20--------------------------
21To view a list of cross connects configured in the system through ONOS CLI:
22
23.. code-block:: text
24
25 sr-xconnect
26
27Add cross connect via CLI
28-------------------------
29
30.. code-block:: text
31
Charles Chan18c94832020-09-15 15:45:42 -070032 sr-xconnect-add <deviceId> <vlanId> <ep1> <ep2>
Charles Chan9e5c6172019-09-07 11:24:54 -070033
34- ``deviceId``: device ID, e.g. **of:0000000000000201**
35- ``vlanId``: VLAN ID, e.g. **94**
Charles Chan18c94832020-09-15 15:45:42 -070036- ``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 Chan9e5c6172019-09-07 11:24:54 -070042
43Remove 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
53View 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
60Add 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 Chan18c94832020-09-15 15:45:42 -070068 "endpoints": [ 1, 2 ] \
Charles Chan9e5c6172019-09-07 11:24:54 -070069 }' 'http://${ONOS-IP}/onos/segmentrouting/xconnect'
70
71- ``deviceId``: device ID, e.g. **of:0000000000000201**
72- ``vlanId``: VLAN ID, e.g. **94**
Charles Chan18c94832020-09-15 15:45:42 -070073- ``endpoints``: endpoints of the cross connect, e.g. **[1, 2]**
Charles Chan9e5c6172019-09-07 11:24:54 -070074
75Remove 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 Williamsd63d35b2020-06-23 14:12:46 -070086- ``vlanId``: VLAN ID, e.g. **94**
Charles Chanc65ac052020-08-05 11:58:07 -070087
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)