You are receiving the ICMP echo request you are sending, and VPP happily routes 
them again over the same interface. This creates a loop, which ends when the IP 
TTL is finally down to 0. This is why you see 253 duplicates (TTL is set to 254 
initially).
My best guess: 20:6b:cb:d9:20:33 is the mac address of eth2 in Linux. If I am 
correct, you are sending your ICMP echo request to eth2, so you receive them in 
VPP on host-eth2 too.
Host interface receives a copy of all packets arriving on the Linux interface, 
regardless of their origin. Note that it is a copy, the Linux stack gets them 
too. When using host interface, you usually do not configure the interface on 
Linux side (or you end up in situations like yours).
What are you trying to achieve? To connect containers and VPP, it is better to 
use tun/tap interfaces instead.

Best
ben

> -----Original Message-----
> From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of
> hyong...@gmail.com
> Sent: lundi 28 décembre 2020 23:38
> To: vpp-dev@lists.fd.io
> Subject: [vpp-dev] Pinging a neighbor generates duplicate echo requests
> #vpp #vpp-dev
> 
> Hi,
> 
> I have a network that consists of a number of docker containers running on
> the same host, and vpp (v20.09) is running on one of them.  The vpp has
> two interfaces (created via 'create host-interface').  The problem is that
> when I ping an interface's neighbor in 'vppctl' with a single echo request
> (i.e., '#vpp ping 10.100.0.2 repeat 1'), I see ~253 duplicate echo
> requests being sent.  Have you seen this kind of a behavior before?  If I
> issue the same ping command without the vpp up, it works without problem.
> Any tips or help would be greatly appreciated.
> 
> Thanks,
> --Hyong
> 
> ===== startup conf =====
> unix {
>     cli-listen /run/vpp/cli.sock
>     log /tmp/vpp.log
> }
> socksvr {
>     socket-name /run/vpp/api.sock
> }
> logging {
>     default-log-level debug
> }
> api-segment {
>     prefix vpp
> }
> api-trace {
>     on
> }
> 
> ===== interfaces =====
> vpp# show int
>               Name               Idx    State  MTU (L3/IP4/IP6/MPLS)
> Counter          Count
> host-eth0                         1      up          9000/0/0/0     rx
> packets                    13
>                                                                     rx
> bytes                    1054
>                                                                     tx
> packets                     7
>                                                                     tx
> bytes                     634
>                                                                     drops
> 13
>                                                                     ip4
> 5
>                                                                     ip6
> 6
> host-eth2                         2      up          9000/0/0/0     rx
> packets                  1027
>                                                                     rx
> bytes                  112418
>                                                                     tx
> packets                   510
>                                                                     tx
> bytes                   55964
>                                                                     drops
> 21
>                                                                     ip4
> 1016
>                                                                     ip6
> 7
> local0                            0     down          0/0/0/0
> 
> ===== interface addresses =====
> vpp# show int addr
> host-eth0 (up):
>   L3 10.100.5.2/24
> host-eth2 (up):
>   L3 10.100.0.1/24
> local0 (dn):
> 
> ====== ip neighbors =====
> vpp# show ip neighbors
>     Time                       IP                    Flags      Ethernet
> Interface
>     116.3940               10.100.5.1                  D
> 54:ed:63:8e:b6:5c host-eth0
>     106.6661               10.100.0.2                  D
> 20:6b:cb:d9:20:33 host-eth2
> 
> ===== vpp routing table =====
> pv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] epoch:0
> flags:none locks:[adjacency:1, default-route:1, nat-hi:2, ]
> 0.0.0.0/0
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:1 buckets:1 uRPF:0 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 0.0.0.0/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:2 buckets:1 uRPF:1 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 10.100.0.0/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:14 buckets:1 uRPF:15 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 10.100.0.0/24
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:13 buckets:1 uRPF:14 to:[1:96]]
>     [0] [@4]: ipv4-glean: host-eth2: mtu:9000 next:2
> ffffffffffff02feaac7f6c80806
> 10.100.0.1/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:16 buckets:1 uRPF:19
> to:[516:49592]]
>     [0] [@2]: dpo-receive: 10.100.0.1 on host-eth2
> 10.100.0.2/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:17 buckets:1 uRPF:18
> to:[510:48960]]
>     [0] [@5]: ipv4 via 10.100.0.2 host-eth2: mtu:9000 next:3
> 206bcbd9203302feaac7f6c80800
> 10.100.0.255/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:15 buckets:1 uRPF:17 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 10.100.5.0/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:10 buckets:1 uRPF:9 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 10.100.5.1/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:18 buckets:1 uRPF:20
> to:[5:480]]
>     [0] [@5]: ipv4 via 10.100.5.1 host-eth0: mtu:9000 next:4
> 54ed638eb65c02fe50d983f90800
> 10.100.5.0/24
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:9 buckets:1 uRPF:8 to:[1:96]]
>     [0] [@4]: ipv4-glean: host-eth0: mtu:9000 next:1
> ffffffffffff02fe50d983f90806
> 10.100.5.2/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:12 buckets:1 uRPF:13
> to:[10:960]]
>     [0] [@2]: dpo-receive: 10.100.5.2 on host-eth0
> 10.100.5.255/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:11 buckets:1 uRPF:11 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 224.0.0.0/4
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:4 buckets:1 uRPF:3 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 240.0.0.0/4
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:3 buckets:1 uRPF:2 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 255.255.255.255/32
>   unicast-ip4-chain
>   [@0]: dpo-load-balance: [proto:ip4 index:5 buckets:1 uRPF:4 to:[0:0]]
>     [0] [@0]: dpo-drop ip4
> 
> ====== ping 10.100.0.2 =====
> vpp# ping 10.100.0.2 repeat 1
> 116 bytes from 10.100.0.2: icmp_seq=1 ttl=64 time=5.2880 ms
> 116 bytes from 10.100.0.2: icmp_seq=1 ttl=64 time=5.4023 ms
> ...
> 116 bytes from 10.100.0.2: icmp_seq=1 ttl=64 time=22.2952 ms
> 
> Statistics: 1 sent, 254 received, -25300% packet loss
> 
> ===== trace =======
> ------------------- Start of thread 0 vpp_main -------------------
> Packet 1
> 
> 00:10:35:217051: af-packet-input
>   af_packet: hw_if_index 2 next-index 4
>     tpacket2_hdr:
>       status 0x20000001 len 110 snaplen 110 mac 66 net 80
>       sec 0x5fea567e nsec 0x17700ce7 vlan 0 vlan_tpid 0
> 00:10:35:217065: ethernet-input
>   IP4: 02:fe:aa:c7:f6:c8 -> 20:6b:cb:d9:20:33
> 00:10:35:217071: ip4-input
>   ICMP: 10.100.0.1 -> 10.100.0.2
>     tos 0x00, ttl 254, length 96, checksum 0xa7d2 dscp CS0 ecn NON_ECN
>     fragment id 0x0000
>   ICMP echo_request checksum 0xe3ae
> 00:10:35:217081: ip4-lookup
>   fib 0 dpo-idx 2 flow hash: 0x00000000
>   ICMP: 10.100.0.1 -> 10.100.0.2
>     tos 0x00, ttl 254, length 96, checksum 0xa7d2 dscp CS0 ecn NON_ECN
>     fragment id 0x0000
>   ICMP echo_request checksum 0xe3ae
> 00:10:35:217086: ip4-rewrite
>   tx_sw_if_index 2 dpo-idx 2 : ipv4 via 10.100.0.2 host-eth2: mtu:9000
> next:3 206bcbd9203302feaac7f6c80800 flow hash: 0x00000000
>   00000000:
> 206bcbd9203302feaac7f6c808004500006000000000fd01a8d20a6400010a64
>   00000020: 00020800e3ae738200013cb3d73d1e55050000010203040506070809
> 00:10:35:217091: host-eth2-output
>   host-eth2
>   IP4: 02:fe:aa:c7:f6:c8 -> 20:6b:cb:d9:20:33
>   ICMP: 10.100.0.1 -> 10.100.0.2
>     tos 0x00, ttl 253, length 96, checksum 0xa8d2 dscp CS0 ecn NON_ECN
>     fragment id 0x0000
>   ICMP echo_request checksum 0xe3ae
> 
> Packet 2
> 
> 00:10:35:217051: af-packet-input
>   af_packet: hw_if_index 2 next-index 4
>     tpacket2_hdr:
>       status 0x20000001 len 110 snaplen 110 mac 66 net 80
>       sec 0x5fea567e nsec 0x1770eba3 vlan 0 vlan_tpid 0
> 00:10:35:217065: ethernet-input
>   IP4: 20:6b:cb:d9:20:33 -> 02:fe:aa:c7:f6:c8
> 00:10:35:217071: ip4-input
>   ICMP: 10.100.0.2 -> 10.100.0.1
>     tos 0x00, ttl 64, length 96, checksum 0xb369 dscp CS0 ecn NON_ECN
>     fragment id 0xb269
>   ICMP echo_reply checksum 0xebae
> 00:10:35:217081: ip4-lookup
>   fib 0 dpo-idx 8 flow hash: 0x00000000
>   ICMP: 10.100.0.2 -> 10.100.0.1
>     tos 0x00, ttl 64, length 96, checksum 0xb369 dscp CS0 ecn NON_ECN
>     fragment id 0xb269
>   ICMP echo_reply checksum 0xebae
> 00:10:35:217088: ip4-local
>     ICMP: 10.100.0.2 -> 10.100.0.1
>       tos 0x00, ttl 64, length 96, checksum 0xb369 dscp CS0 ecn NON_ECN
>       fragment id 0xb269
>     ICMP echo_reply checksum 0xebae
> 00:10:35:217092: ip4-icmp-input
>   ICMP: 10.100.0.2 -> 10.100.0.1
>     tos 0x00, ttl 64, length 96, checksum 0xb369 dscp CS0 ecn NON_ECN
>     fragment id 0xb269
>   ICMP echo_reply checksum 0xebae
> 00:10:35:217105: ip4-icmp-echo-reply
>   ICMP4 echo id 29570 seq 1 send to cli node 667
> 
> Packet 3 (this is a duplicate of Packet 1)
> 
> 00:10:35:217189: af-packet-input
>   af_packet: hw_if_index 2 next-index 4
>     tpacket2_hdr:
>       status 0x20000001 len 110 snaplen 110 mac 66 net 80
>       sec 0x5fea567e nsec 0x177249bc vlan 0 vlan_tpid 0
> 00:10:35:217193: ethernet-input
>   IP4: 02:fe:aa:c7:f6:c8 -> 20:6b:cb:d9:20:33
> 00:10:35:217195: ip4-input
>   ICMP: 10.100.0.1 -> 10.100.0.2
>     tos 0x00, ttl 253, length 96, checksum 0xa8d2 dscp CS0 ecn NON_ECN
>     fragment id 0x0000
>   ICMP echo_request checksum 0xe3ae
> 00:10:35:217198: ip4-lookup
>   fib 0 dpo-idx 2 flow hash: 0x00000000
>   ICMP: 10.100.0.1 -> 10.100.0.2
>     tos 0x00, ttl 253, length 96, checksum 0xa8d2 dscp CS0 ecn NON_ECN
>     fragment id 0x0000
>   ICMP echo_request checksum 0xe3ae
> 00:10:35:217201: ip4-rewrite
>   tx_sw_if_index 2 dpo-idx 2 : ipv4 via 10.100.0.2 host-eth2: mtu:9000
> next:3 206bcbd9203302feaac7f6c80800 flow hash: 0x00000000
>   00000000:
> 206bcbd9203302feaac7f6c808004500006000000000fc01a9d20a6400010a64
>   00000020: 00020800e3ae738200013cb3d73d1e55050000010203040506070809
> 00:10:35:217203: host-eth2-output
>   host-eth2
>   IP4: 02:fe:aa:c7:f6:c8 -> 20:6b:cb:d9:20:33
>   ICMP: 10.100.0.1 -> 10.100.0.2
>     tos 0x00, ttl 252, length 96, checksum 0xa9d2 dscp CS0 ecn NON_ECN
>     fragment id 0x0000
>   ICMP echo_request checksum 0xe3ae
> 
> ....
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18458): https://lists.fd.io/g/vpp-dev/message/18458
Mute This Topic: https://lists.fd.io/mt/79279816/21656
Mute #vpp:https://lists.fd.io/g/vpp-dev/mutehashtag/vpp
Mute #vpp-dev:https://lists.fd.io/g/vpp-dev/mutehashtag/vpp-dev
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to