In my reading there default values that an MPLS LSE should take
on MPLS push is not entirely clear in some circumstances.

This patch illustrates some discrepancies in the Ryu and Open vSwtich
implementations by moving the Ryu tests to match that of Open vSwtich.

* When pushing an MPLS LSE onto a packet which is neither IP nor MPLS
  use 64 as the TTL of the new LSE.

  Ryu currently uses 0.

* When pushing an MPLS LSE onto an IPv6 packet
  use 2 (IPv6 Explicit NULL) as the default label.

  Ryu currently uses 0 (IPv4 Explicit NULL).

Another approach, which would neatly bypass the lack of clarity in
the spec would be to perform explicit set_mpls_ttl and set_label
actions as part of the tests.

Signed-off-by: Simon Horman <[email protected]>
---
 ryu/tests/switch/of13/action/19_PUSH_MPLS.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ryu/tests/switch/of13/action/19_PUSH_MPLS.json 
b/ryu/tests/switch/of13/action/19_PUSH_MPLS.json
index dfa06ec..853461d 100644
--- a/ryu/tests/switch/of13/action/19_PUSH_MPLS.json
+++ b/ryu/tests/switch/of13/action/19_PUSH_MPLS.json
@@ -108,7 +108,7 @@
                 ],
                 "egress":[
                     "ethernet(dst='22:22:22:22:22:22', 
src='11:11:11:11:11:11', ethertype=34887)",
-                    "mpls(ttl=64)",
+                    "mpls(label=2, ttl=64)",
                     "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, 
hop_limit=64, traffic_class=32)",
                     "tcp(dst_port=2222, option='\\x00\\x00\\x00\\x00', 
src_port=11111)",
                     
"'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
@@ -165,7 +165,7 @@
                 ],
                 "egress":[
                     "ethernet(dst='22:22:22:22:22:22', 
src='11:11:11:11:11:11', ethertype=34887)",
-                    "mpls(ttl=0)",
+                    "mpls(ttl=64)",
                     "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', 
opcode=1, src_ip='192.168.10.10',src_mac='11:11:11:11:11:11')",
                     
"'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'"
                 ]
-- 
1.8.5.2


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to