Added basic pseudowire support for Trellis.
- Configurable pseudowires supporting untagged-untagged, single-single, double-double tagged traffic.
- Commands for listing, adding and removing pseudowires.
- Initial support for link failures.
- Pseudowires also configurable by network configuration.
- Tested with ofdpa_3.0.5.
Known limitations that I plan to fix soon :
- Adding pseudowires from configuration is inconvenient because we need to ammend new pws to the
existing configuration. We should create a REST API for adding/removing/listing pws and abandond the
network configuration.
- Spine fabric switches have rules matching a special mpls tag used for pw traffic for a specific leaf.
However, this rules redirect to an "indirect" group for forwarding traffic. If the resulting port there
is no mechanism as of now to handle this. We should use the MPLS ECMP Groups of ofdpa, however they are
not functional. Thus, we need to inject logic into the application to handle this case.
Change-Id: Ia85cf4514ebab627fc6ed5a19ad9f6cdc67dc24c
diff --git a/apps/segmentrouting/src/test/resources/pwaas-conflicting-vlan.json b/apps/segmentrouting/src/test/resources/pwaas-conflicting-vlan.json
new file mode 100644
index 0000000..fac162d
--- /dev/null
+++ b/apps/segmentrouting/src/test/resources/pwaas-conflicting-vlan.json
@@ -0,0 +1,24 @@
+{
+ "1": {
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000002/2",
+ "cP1InnerTag": "10",
+ "cP1OuterTag": "20",
+ "cP2InnerTag": "11",
+ "cP2OuterTag": "21",
+ "mode": "RAW",
+ "sdTag": "",
+ "pwLabel": "255"
+ },
+ "20": {
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000002/2",
+ "cP1InnerTag": "100",
+ "cP1OuterTag": "",
+ "cP2InnerTag": "21",
+ "cP2OuterTag": "",
+ "mode": "RAW",
+ "sdTag": "",
+ "pwLabel": "1255"
+ }
+}
diff --git a/apps/segmentrouting/src/test/resources/pwaas-invalid-mode.json b/apps/segmentrouting/src/test/resources/pwaas-invalid-mode.json
new file mode 100644
index 0000000..af0a9d1
--- /dev/null
+++ b/apps/segmentrouting/src/test/resources/pwaas-invalid-mode.json
@@ -0,0 +1,13 @@
+{
+ "1": {
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000011/1",
+ "cP1InnerTag": "10",
+ "cP1OuterTag": "20",
+ "cP2InnerTag": "11",
+ "cP2OuterTag": "",
+ "mode": "UNDEFINED_MODED",
+ "sdTag": "40",
+ "pwLabel": "255"
+ }
+}
diff --git a/apps/segmentrouting/src/test/resources/pwaas-invalid-pwlabel.json b/apps/segmentrouting/src/test/resources/pwaas-invalid-pwlabel.json
new file mode 100644
index 0000000..66697f5
--- /dev/null
+++ b/apps/segmentrouting/src/test/resources/pwaas-invalid-pwlabel.json
@@ -0,0 +1,13 @@
+{
+ "1": {
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000011/1",
+ "cP1InnerTag": "10",
+ "cP1OuterTag": "20",
+ "cP2InnerTag": "11",
+ "cP2OuterTag": "",
+ "mode": "1",
+ "sdTag": "40",
+ "pwLabel": "255.555551"
+ }
+}
diff --git a/apps/segmentrouting/src/test/resources/pwaas-invalid-vlan.json b/apps/segmentrouting/src/test/resources/pwaas-invalid-vlan.json
new file mode 100644
index 0000000..b556e06
--- /dev/null
+++ b/apps/segmentrouting/src/test/resources/pwaas-invalid-vlan.json
@@ -0,0 +1,24 @@
+{
+ "1": {
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000002/2",
+ "cP1InnerTag": "10",
+ "cP1OuterTag": "20",
+ "cP2InnerTag": "11",
+ "cP2OuterTag": "21",
+ "mode": "RAW",
+ "sdTag": "",
+ "pwLabel": "255"
+ },
+ "20": {
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000002/2",
+ "cP1InnerTag": "100",
+ "cP1OuterTag": "200.55",
+ "cP2InnerTag": "1100",
+ "cP2OuterTag": "210",
+ "mode": "RAW",
+ "sdTag": "",
+ "pwLabel": "1255"
+ }
+}
diff --git a/apps/segmentrouting/src/test/resources/pwaas-invalid.json b/apps/segmentrouting/src/test/resources/pwaas-invalid.json
deleted file mode 100644
index f282abe..0000000
--- a/apps/segmentrouting/src/test/resources/pwaas-invalid.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "1": {
- "cP1": "of:0000000000000001/1",
- "cP2": "of:0000000000000011/1",
- "cP1InnerTag": "10",
- "cP1OuterTag": "20",
- "cP2InnerTag": "11",
- "cP2OuterTag": "",
- "mode": "1",
- "allVlan": true,
- "sdTag": "40",
- "pwLabel": "255"
- },
- "20": {
- "cP1": "of:0000000000000002/1",
- "cP2": "of:0000000000000012/1",
- "cP1InnerTag": "100",
- "cP1OuterTag": "200",
- "cP2InnerTag": "110",
- "cP2OuterTag": "210",
- "mode": "TAGGED",
- "allVlan": false,
- "sdTag": "-1",
- "pwLabel": "4095"
- }
-}
diff --git a/apps/segmentrouting/src/test/resources/pwaas.json b/apps/segmentrouting/src/test/resources/pwaas.json
index 902611e..2a58b4e 100644
--- a/apps/segmentrouting/src/test/resources/pwaas.json
+++ b/apps/segmentrouting/src/test/resources/pwaas.json
@@ -1,26 +1,24 @@
{
"1": {
"cP1": "of:0000000000000001/1",
- "cP2": "of:0000000000000011/1",
+ "cP2": "of:0000000000000002/1",
"cP1InnerTag": "10",
"cP1OuterTag": "20",
- "cP2InnerTag": "11",
+ "cP2InnerTag": "10",
"cP2OuterTag": "21",
"mode": "RAW",
- "allVlan": true,
- "sdTag": "40",
+ "sdTag": "",
"pwLabel": "255"
},
"20": {
- "cP1": "of:0000000000000002/1",
- "cP2": "of:0000000000000012/1",
+ "cP1": "of:0000000000000001/1",
+ "cP2": "of:0000000000000002/1",
"cP1InnerTag": "100",
"cP1OuterTag": "200",
- "cP2InnerTag": "110",
+ "cP2InnerTag": "100",
"cP2OuterTag": "210",
- "mode": "TAGGED",
- "allVlan": false,
- "sdTag": "-1",
- "pwLabel": "4095"
+ "mode": "RAW",
+ "sdTag": "",
+ "pwLabel": "1255"
}
}