Skip to main content

MPLS Ping In IOS XR

·869 words·5 mins
Rory
Author
Rory
Step by step the ladder is ascended

MPLS Ping
#

虽然是 Ping 的一种, 但是采用的不是 ICMP 探针检测中间路径,使用的是 IPv4 或者 IPv6 UDP 数据包。 有两种报文,MPLS Echo Request/MPLS Echo Reply。

  • MPLS Echo Request/MPLS Echo Reply UDP 的源目端口号为 3503
  • MPLS Echo Request 的目的 IP 地址为127.0.0.1
  • MPLS Echo Request 内层 IP TTL 为 1,MPLS TTL 正常
  • MPLS Echo Request 中携带 FEC 相关信息。

MPLS Ping

MPLS Echo Request
#

Alt text

MPLS Echo Reply
#

Alt text

MPLS Echo Request 在 XR 设备中的处理
#

源设备
#

在 MPLS Echo Request send 的源设备上, 数据包会有 RP 的 UDP -> RP SPP -> RP NETIO -> LC SPP -> LC NetIO -> 出接口送出。

从 LC LPTS 中,我们可以检查出从 RP 产生的数据包 counter:

RP/0/RSP0/CPU0:ASR9901-1# show lpts pifib hardware static-police location 0/0/CPU0 | in PUNT_NETIO
Fri Sep  1 05:50:28.611 UTC
PUNT_NETIO_RP_TO_LC_CPU NETIO_HI                5000       1000       12119                0                    Local

目的设备
#

RP/0/RSP0/CPU0:ASR9901-2#show packet-trace results
Sun Sep  3 03:02:50.970 UTC
T: D - Drop counter; P - Pass counter
Location     | Source       | Counter                   | T | Last-Attribute                           | Count
------------   ------------   -------------------------   -   ----------------------------------------   ---------------
0/0/CPU0       NP0            PACKET_MARKED               P   TenGigE0_0_0_12                            100
0/0/CPU0       NP0            PACKET_FROM_INJECT          P                                              100
0/0/CPU0       NP0            PACKET_TO_PUNT              P                                              300
0/0/CPU0       NP0            PACKET_INGR_TOP_LOOPBACK    P                                              100
0/0/CPU0       NP0            PACKET_INGR_TM_LOOPBACK     P                                              100
0/0/CPU0       SPP-PI         CLIENT_PUNT_SUCCESS         P   stage1                                     100
0/0/CPU0       NETIO-PI       PUNT_DROP                   D   packet_input                               100
0/0/CPU0       NETIO-PI       BYPASS_IN_COUNT             P   netio_send_pulse_punt                      100
0/0/CPU0       spp-LIB        ENTRY_COUNT                 P   SPP PD Punt: stage1                        200
0/0/CPU0       netio-LIB      ENTRY_COUNT                 P   lpts_pifib_remote_delivers                 400
0/0/CPU0       spp-LIB        EXIT_COUNT                  P   SPP PD Inject: injectfun                   100
0/0/CPU0       netio-LIB      EXIT_COUNT                  P   NETIO PD Inject: transmit_pak              100
0/RSP0/CPU0    SPP-PI         CLIENT_PUNT_SUCCESS         P   stage1                                     100
0/RSP0/CPU0    NETIO-PI       BYPASS_MUT_QFULL_DROP       D   packet_input_bypass                        100
0/RSP0/CPU0    NETIO-PI       IP_COUNT                    P   netio_send_pulse_input                     100
0/RSP0/CPU0    spp-LIB        ENTRY_COUNT                 P   SPP PD Punt: stage1                        100
0/RSP0/CPU0    netio-LIB      ENTRY_COUNT                 P   lpts_npmb_ipv4_delivers                    300
0/RSP0/CPU0    udp-LIB        ENTRY_COUNT                 P   sosend xipc pulse                          100
0/RSP0/CPU0    UDP            RECV_NETIO_MANY_RRCVD       P   udp deliver many-rx                        100
0/RSP0/CPU0    UDP            RECV_RQUEUED                P   udp deliver - xipcwrite                    100

用 Packet-trace,我们可以很看出这种特殊类型的数据包会经由 NP->LPTS Punt-> LC NetIO -> LC SPP - RP NetIO -> RP SPP.

LPTS Punt 的原因为 PUNT_TTL_EXCEEDED (因为内层的 IP 报文 TTL 为 1):

RP/0/RSP0/CPU0:ASR9901-2#show lpts pifib hardware static-police location 0/0/CPU0
Sun Sep  3 04:13:30.780 UTC
PUNT_TTL_EXCEEDED       NETIO_LOW               2000       400        11600                0                    Local

因为最终会被送到 RP 的 UDP 上去, 所以我们还有些命令来检查下 UDP 上的一些 counter。

RP/0/RSP0/CPU0:ASR9901-2#show udp brief  | in 3503
Sun Sep  3 04:17:59.115 UTC
0x7ff1a401cbd0 0x60000000      0      0  :::3503                :::0
0x7ff1a401a680 0x60000000      0      0  0.0.0.0:3503           0.0.0.0:0
RP/0/RSP0/CPU0:ASR9901-2#
RP/0/RSP0/CPU0:ASR9901-2#
RP/0/RSP0/CPU0:ASR9901-2#show udp statistics pcb 0x7ff1a401a680
Sun Sep  3 04:18:03.382 UTC

 Statistics for PCB 0x7ff1a401a680, vrfid 0x60000000
Send:   0 packets received from application
        0 xipc pulse received from application
        0 packets sent to network (v4/v6 IO)
        0 packets sent to network (NetIO)
        0 packets failed getting queued to network (v4/v6 IO)
        0 packets failed getting queued to network (NetIO)
Rcvd:   11600 packets received from network
        11600 packets queued to application (PCB)
        0 packets failed queued to application (PCB)
        0 packets dropped due to minttl check (PCB)
        11600 packets queued to application socket (GLOBAL)
        0 packets failed queued to application socket (GLOBAL)

UDP trace 也会保存一些报文的交互, 但是此 buffer 非常的小,保留的信息很快就会被冲掉。

RP/0/RSP0/CPU0:ASR9901-2#show udp  trace  reverse location 0/rSP0/CPU0 | in 35$
Sun Sep  3 04:18:51.991 UTC
Sep  3 04:18:50.320 udp/event 0/RSP0/CPU0 t8236 udp_input:pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 deliverycnt=1 error 0xb
Sep  3 04:18:50.320 udp/event 0/RSP0/CPU0 t8236 UDP: queue pcb (0x7ff1a401a680) pak (0x63c028ab) to xipc recv q: 3503 -> 3503
Sep  3 04:18:50.320 udp/event 0/RSP0/CPU0 t8236 UDP input: pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 ismulticast=0
Sep  3 04:18:50.315 udp/event 0/RSP0/CPU0 t8236 udp_input:pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 deliverycnt=1 error 0xb
Sep  3 04:18:50.315 udp/event 0/RSP0/CPU0 t8236 UDP: queue pcb (0x7ff1a401a680) pak (0x63c028ab) to xipc recv q: 3503 -> 3503
Sep  3 04:18:50.315 udp/event 0/RSP0/CPU0 t8236 UDP input: pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 ismulticast=0
Sep  3 04:18:50.309 udp/event 0/RSP0/CPU0 t8236 udp_input:pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 deliverycnt=1 error 0xb
Sep  3 04:18:50.309 udp/event 0/RSP0/CPU0 t8236 UDP: queue pcb (0x7ff1a401a680) pak (0x63c028ab) to xipc recv q: 3503 -> 3503
Sep  3 04:18:50.309 udp/event 0/RSP0/CPU0 t8236 UDP input: pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 ismulticast=0
Sep  3 04:18:50.303 udp/event 0/RSP0/CPU0 t8236 udp_input:pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 deliverycnt=1 error 0xb
Sep  3 04:18:50.303 udp/event 0/RSP0/CPU0 t8236 UDP: queue pcb (0x7ff1a401a680) pak (0x63c028ab) to xipc recv q: 3503 -> 3503
Sep  3 04:18:50.303 udp/event 0/RSP0/CPU0 t8236 UDP input: pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 ismulticast=0
Sep  3 04:18:50.296 udp/event 0/RSP0/CPU0 t8236 udp_input:pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 deliverycnt=1 error 0xb
Sep  3 04:18:50.296 udp/event 0/RSP0/CPU0 t8236 UDP: queue pcb (0x7ff1a401a680) pak (0x63c028ab) to xipc recv q: 3503 -> 3503
Sep  3 04:18:50.296 udp/event 0/RSP0/CPU0 t8236 UDP input: pak(0x63c0696b): 3503 -> 3503, vrf 0x60000000, len=64 ismulticast=0

MPLS Echo Reply 在 XR 设备中的处理
#

MPLS Echo Reply 由设备的 RP 产生,送到出向板卡,经正常数据包封装转发出来。

在目的设备中解封装,同样会有 LC Punt 到 RP 上去处理:

RP/0/RSP0/CPU0:ASR9901-1#show packet-trace results
Fri Sep  1 05:43:35.876 UTC
T: D - Drop counter; P - Pass counter
Location     | Source       | Counter                   | T | Last-Attribute                           | Count
------------   ------------   -------------------------   -   ----------------------------------------   ---------------
0/0/CPU0       NP0            PACKET_MARKED               P   TenGigE0_0_0_12                            5
0/0/CPU0       NP0            PACKET_TO_PUNT              P                                              5
0/RSP0/CPU0    SPP-PI         CLIENT_PUNT_SUCCESS         P   stage1                                     5
0/RSP0/CPU0    NETIO-PI       BYPASS_MUT_QFULL_DROP       D   packet_input_bypass                        5
0/RSP0/CPU0    NETIO-PI       IP_COUNT                    P   netio_send_pulse_input                     5
0/RSP0/CPU0    spp-LIB        ENTRY_COUNT                 P   SPP PD Punt: stage1                        5
0/RSP0/CPU0    netio-LIB      ENTRY_COUNT                 P   lpts_npmb_ipv4_delivers                    15
0/RSP0/CPU0    udp-LIB        ENTRY_COUNT                 P   ip lib - input from netio                  10
0/RSP0/CPU0    UDP            RECV_NETIO_MANY_RRCVD       P   udp deliver many-rx                        5
0/RSP0/CPU0    UDP            RECV_RQUEUED                P   udp deliver - xipcwrite                    5