From be872a8ddae5812eb5690841fbc066967d0d9bb3 Mon Sep 17 00:00:00 2001 From: Tetsuya Murakami Date: Fri, 10 Dec 2021 08:11:07 -0800 Subject: srv6-mobile: Update GTP4/6.D function GTP4/6.D behavior is updated as shown below. 1. When receiving GTP-U message or IPv6 linklocal destination in inner IP, GTP packet is tnralated to SRv6. 2. When receiving T-PDU packet, OuterIP/UDP/GTP headers are stripped off and Inner IP is encapsulated into SRv6 based on L3VPN SRv6 manner. Type: feature Signed-off-by: Tetsuya Murakami Change-Id: I6092c98ea80236d54017f84c5b35cca0b645f034 Signed-off-by: Tetsuya Murakami --- test/test_srv6_mobile.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'test/test_srv6_mobile.py') diff --git a/test/test_srv6_mobile.py b/test/test_srv6_mobile.py index a695c9d7115..e617acef9ab 100644 --- a/test/test_srv6_mobile.py +++ b/test/test_srv6_mobile.py @@ -69,9 +69,10 @@ class TestSRv6EndMGTP4E(VppTestCase): pkts = self.create_packets([("A::1", "B::1"), ("C::1", "D::1")]) self.vapi.cli( - "sr localsid address {} behavior end.m.gtp4.e v4src_position 64" - .format(pkts[0]['IPv6'].dst)) - self.logger.info(self.vapi.cli("show sr localsids")) + "sr localsid address {} behavior end.m.gtp4.e " + .format(pkts[0]['IPv6'].dst) + + "v4src_position 64 fib-table 0") + self.logger.info(self.vapi.cli("show sr localsid")) self.vapi.cli("clear errors") @@ -150,8 +151,8 @@ class TestSRv6TMGTP4D(VppTestCase): self.vapi.cli("set sr encaps source addr A1::1") self.vapi.cli("sr policy add bsid D4:: next D2:: next D3::") self.vapi.cli( - "sr policy add bsid D5:: behavior t.m.gtp4.d" - "D4::/32 v6src_prefix C1::/64 nhtype ipv6") + "sr policy add bsid D5:: behavior t.m.gtp4.d D4::/32 " + + "v6src_prefix C1::/64 nhtype ipv6 fib-table 0 drop-in") self.vapi.cli("sr steer l3 {}/32 via bsid D5::".format(self.ip4_dst)) self.vapi.cli("ip route add D2::/32 via {}".format(self.ip6_dst)) @@ -236,11 +237,11 @@ class TestSRv6EndMGTP6E(VppTestCase): pkts = self.create_packets([("A::1", "B::1"), ("C::1", "D::1")]) self.vapi.cli( - "sr localsid prefix {}/64 behavior end.m.gtp6.e" + "sr localsid prefix {}/64 behavior end.m.gtp6.e fib-table 0" .format(pkts[0]['IPv6'].dst)) self.vapi.cli( "ip route add a1::/64 via {}".format(self.ip6_nhop)) - self.logger.info(self.vapi.cli("show sr localsids")) + self.logger.info(self.vapi.cli("show sr localsid")) self.vapi.cli("clear errors") @@ -316,10 +317,12 @@ class TestSRv6EndMGTP6D(VppTestCase): self.vapi.cli("set sr encaps source addr A1::1") self.vapi.cli("sr policy add bsid D4:: next D2:: next D3::") self.vapi.cli( - "sr localsid prefix 2001::/64 behavior end.m.gtp6.d D4::/64") + "sr localsid prefix 2001::/64 behavior end.m.gtp6.d " + + "D4::/64 fib-table 0 drop-in") self.vapi.cli("ip route add D2::/64 via {}".format(self.ip6_nhop)) self.logger.info(self.vapi.cli("show sr policies")) + self.logger.info(self.vapi.cli("show sr localsid")) self.vapi.cli("clear errors") @@ -334,7 +337,11 @@ class TestSRv6EndMGTP6D(VppTestCase): for pkt in capture: self.logger.info(pkt.show2(dump=True)) - self.logger.info("GTP6.D Address={}".format( + self.logger.info("GTP6.D SID0={}".format( str(pkt[IPv6ExtHdrSegmentRouting].addresses[0]))) + self.logger.info("GTP6.D SID1={}".format( + str(pkt[IPv6ExtHdrSegmentRouting].addresses[1]))) + self.assertEqual( + str(pkt[IPv6ExtHdrSegmentRouting].addresses[0]), "2001::1") self.assertEqual( - str(pkt[IPv6ExtHdrSegmentRouting].addresses[0]), "d4::c800:0") + str(pkt[IPv6ExtHdrSegmentRouting].addresses[1]), "d4::c800:0") -- cgit 1.2.3-korg