Hi Xyxue, The junk value for the last label in the stack was a result of you configuring 9 labels, when the mpls_label_dpo_t can contain only 8. I have pushed patch: https://gerrit.fd.io/r/#/c/9739/ to: 1 – up this value to 12, which is as many as will allow a mpls_label_dpo_t to still fit on one cache line 2 – not go wandering into random memory when the stack size is exceeded, but instead log and error and stack on drop. If more than 12 labels are really needed, then I’ll need to revisit this and probably play the same trick as we do for handling more that 4 load-balance buckets.
Regards, neale From: 薛欣颖 <xy...@fiberhome.com> Date: Thursday, 30 November 2017 at 12:44 To: "Neale Ranns (nranns)" <nra...@cisco.com>, "Pablo Camarillo (pcamaril)" <pcama...@cisco.com>, vpp-dev <vpp-dev@lists.fd.io> Subject: Re: Re: [vpp-dev] SR MPLS not effective Hi Neale, I can't configure the command like this: 'VPP# sr mpls policy add bsid 999 next 210 209 208 207 206 205 204 203 202 201 unknown input `209 208 207 206 205 204 ...'' I configured the command like before. And the all info is shown below: packet info: 00:05:58:166326: af-packet-input af_packet: hw_if_index 1 next-index 4 tpacket2_hdr: status 0x20000001 len 78 snaplen 78 mac 66 net 80 sec 0x5a1feacb nsec 0x372a239a vlan 0 00:05:58:166355: ethernet-input IP4: 00:00:00:66:00:55 -> 00:0c:29:4d:af:b5 00:05:58:166385: ip4-input ICMP: 21.1.1.5 -> 23.1.1.5 tos 0x00, ttl 64, length 64, checksum 0x4cb1 fragment id 0x0001 ICMP echo_request checksum 0x5f5d 00:05:58:166391: ip4-lookup fib 0 dpo-idx 33 flow hash: 0x00000000 ICMP: 21.1.1.5 -> 23.1.1.5 tos 0x00, ttl 64, length 64, checksum 0x4cb1 fragment id 0x0001 ICMP echo_request checksum 0x5f5d 00:05:58:166401: ip4-load-balance fib 0 dpo-idx 33 flow hash: 0x00000000 ICMP: 21.1.1.5 -> 23.1.1.5 tos 0x00, ttl 64, length 64, checksum 0x4cb1 fragment id 0x0001 ICMP echo_request checksum 0x5f5d 00:05:58:166405: ip4-mpls-label-imposition mpls-header:[16416:63:0:eos] //when I configured two layer label,this info is ' mpls-header:[101:63:0:eos] ' 00:05:58:166415: mpls-label-imposition mpls-header:[211:255:0:neos] 00:05:58:166416: mpls-output adj-idx 3 : mpls via 14.1.1.2 host-eth2: 000c290fe2a8000c294dafa18847 flow hash: 0x00000000 00000000: 0000000000000000000000000000000000000000000000000000000000000000 00000020: 00000000000000000000000000000000000000000000000000000000 00:05:58:166424: host-eth2-output host-eth2 MPLS: 00:0c:29:4d:af:a1 -> 00:0c:29:0f:e2:a8 label 211 exp 0, s 0, ttl 255 VPP# show sr mpls policies <CR> <CR> VPP# show sr mpls policies SR MPLS policies: [0].- BSID: 999 Type: Default Segment Lists: [0].- < 210, 209, 208, 207, 206, 205, 204, 203, 202, 201 > ----------- VPP# show mpls fib label 999 MPLS-VRF:0, fib_index 0 999:neos/21 fib:0 index:26 locks:2 src:SR refs:1 index:27 locks:4 flags:shared, uPRF-list:28 len:1 itfs:[2, ] index:27 pl-index:27 mpls weight=1 pref=0 recursive: oper-flags:resolved, via 210 neos in fib:0 via-fib:27 via-dpo:[dpo-load-balance:29] Extensions: path:27 labels:209 208 207 206 205 204 203 202 201 forwarding: mpls-neos-chain [@0]: dpo-load-balance: [proto:mpls index:30 buckets:1 uRPF:28 to:[0:0]] [0] [@8]: mpls-label:[0]:[209:255:0:neos][208:255:0:neos][207:255:0:neos][206:255:0:neos][205:255:0:neos][204:255:0:neos][203:255:0:neos][202:255:0:neos][16416:0:1:neos] [@2]: dpo-load-balance: [proto:mpls index:29 buckets:1 uRPF:29 to:[0:0] via:[586:58600]] [0] [@8]: mpls-label:[3]:[211:255:0:neos] [@3]: mpls via 14.1.1.2 host-eth2: 000c290fe2a8000c294dafa18847 999:eos/21 fib:0 index:28 locks:4 src:SR refs:1 index:27 locks:4 flags:shared, uPRF-list:28 len:1 itfs:[2, ] index:27 pl-index:27 mpls weight=1 pref=0 recursive: oper-flags:resolved, via 210 neos in fib:0 via-fib:27 via-dpo:[dpo-load-balance:29] Extensions: path:27 labels:209 208 207 206 205 204 203 202 201 src:recursive-resolution cover:-1 refs:1 forwarding: mpls-eos-chain [@0]: dpo-load-balance: [proto:mpls index:31 buckets:1 uRPF:28 to:[0:0]] [0] [@8]: mpls-label:[2]:[209:255:0:neos][208:255:0:neos][207:255:0:neos][206:255:0:neos][205:255:0:neos][204:255:0:neos][203:255:0:neos][202:255:0:neos][16416:0:1:neos] [@2]: dpo-load-balance: [proto:mpls index:29 buckets:1 uRPF:29 to:[0:0] via:[586:58600]] [0] [@8]: mpls-label:[3]:[211:255:0:neos] [@3]: mpls via 14.1.1.2 host-eth2: 000c290fe2a8000c294dafa18847 VPP# show mpls fib label 210 MPLS-VRF:0, fib_index 0 210:neos/21 fib:0 index:27 locks:4 src:CLI refs:1 index:29 locks:2 flags:shared, uPRF-list:29 len:1 itfs:[2, ] index:29 pl-index:29 ip4 weight=1 pref=0 attached-nexthop: oper-flags:resolved, 14.1.1.2 host-eth2 [@0]: ipv4 via 14.1.1.2 host-eth2: 000c290fe2a8000c294dafa10800 Extensions: path:29 labels:211 src:recursive-resolution cover:-1 refs:1 forwarding: mpls-neos-chain [@0]: dpo-load-balance: [proto:mpls index:29 buckets:1 uRPF:29 to:[0:0] via:[686:68600]] [0] [@8]: mpls-label:[3]:[211:255:0:neos] [@3]: mpls via 14.1.1.2 host-eth2: 000c290fe2a8000c294dafa18847 Thanks, Xyxue ________________________________ From: Neale Ranns (nranns)<mailto:nra...@cisco.com> Date: 2017-11-30 18:40 To: 薛欣颖<mailto:xy...@fiberhome.com>; Pablo Camarillo (pcamaril)<mailto:pcama...@cisco.com>; vpp-dev<mailto:vpp-dev@lists.fd.io> Subject: Re: [vpp-dev] SR MPLS not effective Hi Xyxue, To get a 10 label stack, you need to do; sr mpls policy add bsid 999 next 210 209 208 207 206 205 204 203 202 201 i.e. only use the ‘next’ keyword once. And then if you don’t get the desired result, could show me the following outputs; sh sr mpls polic sh mpls fib 999 sh mpls fib 210 st trace <<< for a ‘bad’ packet. thanks, neale From: 薛欣颖 <xy...@fiberhome.com> Date: Thursday, 30 November 2017 at 10:23 To: "Neale Ranns (nranns)" <nra...@cisco.com>, "Pablo Camarillo (pcamaril)" <pcama...@cisco.com>, vpp-dev <vpp-dev@lists.fd.io> Subject: Re: Re: [vpp-dev] SR MPLS not effective Hi Neale, After referring to your example, I modified my configuration. And the two layer label SR MPLS works well. But when configure ten layer label, the bottom label is different from the configuration. vpp1 configuration: create host-interface name eth4 mac 00:0c:29:4d:af:b5 create host-interface name eth2 mac 00:0c:29:4d:af:a1 set interface state host-eth2 up set interface state host-eth4 up set interface ip address host-eth2 14.1.1.1/24 set interface ip address host-eth4 21.1.1.1/24 mpls table add 0 set interface mpls host-eth2 enable sr mpls policy add bsid 999 next 210 next 209 next 208 next 207 next 206 next 205 next 204 next 203 next 202 next 201 // encap 10 layer label sr mpls steer l3 23.1.1.0/24 via sr policy bsid 999 mpls local-label add non-eos 210 via 14.1.1.2 host-eth2 out-label 211 Actually, the bottom is 16416 (the value configured is 201). The ttl is 63 and others is 255. The trace info and message info is shown below: 00:31:47:618725: af-packet-input af_packet: hw_if_index 1 next-index 4 tpacket2_hdr: status 0x20000001 len 78 snaplen 78 mac 66 net 80 sec 0x5a1fb1aa nsec 0x22ae91a9 vlan 0 00:31:47:618752: ethernet-input IP4: 00:00:00:66:00:55 -> 00:0c:29:4d:af:b5 00:31:47:618815: ip4-input ICMP: 21.1.1.5 -> 23.1.1.5 tos 0x00, ttl 64, length 64, checksum 0x4cb1 fragment id 0x0001 ICMP echo_request checksum 0x5f5d 00:31:47:618823: ip4-lookup fib 0 dpo-idx 34 flow hash: 0x00000000 ICMP: 21.1.1.5 -> 23.1.1.5 tos 0x00, ttl 64, length 64, checksum 0x4cb1 fragment id 0x0001 ICMP echo_request checksum 0x5f5d 00:31:47:618833: ip4-load-balance fib 0 dpo-idx 34 flow hash: 0x00000000 ICMP: 21.1.1.5 -> 23.1.1.5 tos 0x00, ttl 64, length 64, checksum 0x4cb1 fragment id 0x0001 ICMP echo_request checksum 0x5f5d 00:31:47:618837: ip4-mpls-label-imposition mpls-header:[16416:63:0:eos] 00:31:47:618844: mpls-label-imposition mpls-header:[211:255:0:neos] 00:31:47:618846: mpls-output adj-idx 3 : mpls via 14.1.1.2 host-eth2: 000c290fe2a8000c294dafa18847 flow hash: 0x00000000 00000000: 0000000000000000000000000000000000000000000000000000000000000000 00000020: 00000000000000000000000000000000000000000000000000000000 00:31:47:618853: host-eth2-output host-eth2 MPLS: 00:0c:29:4d:af:a1 -> 00:0c:29:0f:e2:a8 label 211 exp 0, s 0, ttl 255 Thanks for your help. Thanks, Xyxue ________________________________ From: Neale Ranns (nranns)<mailto:nra...@cisco.com> Date: 2017-11-29 16:37 To: 薛欣颖<mailto:xy...@fiberhome.com>; Pablo Camarillo (pcamaril)<mailto:pcama...@cisco.com>; vpp-dev<mailto:vpp-dev@lists.fd.io> Subject: Re: [vpp-dev] SR MPLS not effective Hi Xyxue, Here’s a hastily assembled guide on how I would do it; https://wiki.fd.io/view/VPP/Segment_Routing_for_MPLS I’ve not verified the configs myself. If you use it, please let me know any errors you find. Regards, neale From: 薛欣颖 <xy...@fiberhome.com> Date: Wednesday, 29 November 2017 at 08:13 To: "Neale Ranns (nranns)" <nra...@cisco.com>, "Pablo Camarillo (pcamaril)" <pcama...@cisco.com>, vpp-dev <vpp-dev@lists.fd.io> Subject: Re: Re: [vpp-dev] SR MPLS not effective After add the 'mpls local-label add non-eos 33 mpls-lookup-in-table 0 ' on P, the mistake still exist.
_______________________________________________ vpp-dev mailing list vpp-dev@lists.fd.io https://lists.fd.io/mailman/listinfo/vpp-dev