Skip to content

BUG: srv6 ad failed to create ip neighbor #1880

@scottlx

Description

@scottlx

Test case

restful config

{
  "vppConfig": {
    "routes": [
      {
        "dst_network": "fc01::1a/128",
        "next_hop_addr": "fdab::10",
        "weight": 1
      },
      {
        "dst_network": "fc03::1a/128",
        "next_hop_addr": "fdab::30",
        "weight": 1
      },
      {
        "dst_network": "192.168.1.0/24",
        "outgoing_interface": "GigabitEthernet0/5/0",
        "weight": 1
      },
      {
        "dst_network": "192.168.3.0/24",
        "outgoing_interface": "GigabitEthernet0/6/0",
        "weight": 1
      }
    ],
    "interfaces": [
      {
        "name": "GigabitEthernet0/5/0",
        "type": "DPDK",
        "enabled": true,
        "ipAddresses": [
          "192.168.100.100/24"
        ]
      },
      {
        "name": "GigabitEthernet0/6/0",
        "type": "DPDK",
        "enabled": true,
        "ipAddresses": [
          "192.168.101.100/24"
        ]
      },
      {
        "name": "GigabitEthernet0/f/0",
        "type": "DPDK",
        "enabled": true,
        "ipAddresses": [
          "fdab::20/64"
        ]
      },
      {
        "name": "loop0",
        "type": "SOFTWARE_LOOPBACK",
        "enabled": true,
        "ipAddresses": [
          "fc02::1/64"
        ]
      }
    ],
    "srv6_localsids": [
      {
        "sid": "fc02::1a",
        "installation_vrf_id": 0,
        "end_function_ad": {
          "outgoing_interface": "GigabitEthernet0/5/0",
          "incoming_interface": "GigabitEthernet0/5/0",
          "l3_service_address": "192.168.100.227"
        }
      },
      {
        "sid": "fc02::2a",
        "installation_vrf_id": 0,
        "end_function_ad": {
          "outgoing_interface": "GigabitEthernet0/6/0",
          "incoming_interface": "GigabitEthernet0/6/0",
          "l3_service_address": "192.168.101.162"
        }
      }
    ]
  }
}

vpp

vpp# show sr localsids 
SRv6 - My LocalSID Table:
=========================
	Address: 	fc02::1a/128
	Behavior: 	End.AD (Endpoint with dynamic proxy to SR-unaware appliance)
	Next-hop:	192.168.100.227
	Outgoing iface:	GigabitEthernet0/5/0
	Incoming iface:	GigabitEthernet0/5/0
	Good rewrite traffic: 	[0 packets : 0 bytes]
	Bad rewrite traffic:  	[0 packets : 0 bytes]
	Good traffic: 	[0 packets : 0 bytes]
	Bad traffic:  	[0 packets : 0 bytes]
--------------------
	Address: 	fc02::2a/128
	Behavior: 	End.AD (Endpoint with dynamic proxy to SR-unaware appliance)
	Next-hop:	192.168.101.162
	Outgoing iface:	GigabitEthernet0/6/0
	Incoming iface:	GigabitEthernet0/6/0
	Good rewrite traffic: 	[0 packets : 0 bytes]
	Bad rewrite traffic:  	[0 packets : 0 bytes]
	Good traffic: 	[0 packets : 0 bytes]
	Bad traffic:  	[0 packets : 0 bytes]
--------------------
vpp# show ip neighbors
    Time                       IP                    Flags      Ethernet              Interface       
      4.8595                fdab::30                   D    fa:93:ec:db:33:02 GigabitEthernet0/f/0
      4.8592                fdab::10                   D    fa:b4:8e:3b:e5:02 GigabitEthernet0/f/0

vpp failed to create nh address in adjacency table! !

Reason

Key: interfaces.InterfaceKey(ef.EndFunctionAd.OutgoingInterface),

The dependency is InterfaceKey rather than InterfaceAddressKey, which cause ad localsid cli running before the interface has ip address.

time="2022-10-18 16:07:21.43811" level=debug msg="Adding/deleting Local SIDfc02::1a" delete=false end function="AD{L3ServiceAddress: 192.168.100.227, OutgoingInterface: Gi
gabitEthernet0/5/0, IncomingInterface: GigabitEthernet0/5/0}" installationVrfID=0 localSID="fc02::1a" logger=vpp-srplugin
time="2022-10-18 16:07:21.43897" level=debug msg="Interface 1 set to VRF 0" logger=vpp-ifplugin
Running Linux cmd:ps ux | awk '/\/usr\/bin\/vpp/ && !/awk/ {print $2}'
time="2022-10-18 16:07:21.44964" level=info msg="send cli ready signal(USR1) to vpp, pid: 23913" logger=vpp-ifplugin.if-descriptor
time="2022-10-18 16:07:21.44970" level=debug msg="publish add to ifplugin_ifstate{{GigabitEthernet0/6/0 false false vpp-interface-index} 0xc000423540}" logger=vpp-ifplugin
.if-descriptor
time="2022-10-18 16:07:21.44980" level=debug msg="Adding/deleting Local SIDfc02::2a" delete=false end function="AD{L3ServiceAddress: 192.168.101.162, OutgoingInterface: Gi
gabitEthernet0/6/0, IncomingInterface: GigabitEthernet0/6/0}" installationVrfID=0 localSID="fc02::2a" logger=vpp-srplugin
time="2022-10-18 16:07:21.45072" level=debug msg="Interface 2 set to VRF 0" logger=vpp-ifplugin
Running Linux cmd:ps ux | awk '/\/usr\/bin\/vpp/ && !/awk/ {print $2}'
time="2022-10-18 16:07:21.46198" level=info msg="send cli ready signal(USR1) to vpp, pid: 23913" logger=vpp-ifplugin.if-descriptor
time="2022-10-18 16:07:21.46206" level=debug msg="publish add to ifplugin_ifstate{{GigabitEthernet0/f/0 false false vpp-interface-index} 0xc000b58190}" logger=vpp-ifplugin
.if-descriptor
time="2022-10-18 16:07:21.46251" level=debug msg="Interface 3 set to VRF 0" logger=vpp-ifplugin
Running Linux cmd:ps ux | awk '/\/usr\/bin\/vpp/ && !/awk/ {print $2}'
time="2022-10-18 16:07:21.47733" level=info msg="send cli ready signal(USR1) to vpp, pid: 23913" logger=vpp-ifplugin.if-descriptor
time="2022-10-18 16:07:21.47739" level=debug msg="publish add to ifplugin_ifstate{{loop0 false false vpp-interface-index} 0xc000ca43c0}" logger=vpp-ifplugin.if-descriptor
time="2022-10-18 16:07:21.47771" level=debug msg="Interface 5 set to VRF 0" logger=vpp-ifplugin
o----------------------------------------------------------------------------------------------------------------------o
  * executed operations (2022-10-18 16:07:21.414 +0800 CST -> 2022-10-18 16:07:21.48 +0800 CST, dur: 66ms):
      1. CREATE:
          - key: config/vpp/v2/interfaces/GigabitEthernet0/5/0
          - value: { name:"GigabitEthernet0/5/0" type:DPDK enabled:true ip_addresses:"192.168.100.100/24" }
      2. CREATE:
          - key: config/vpp/srv6/v2/localsid/fc02::1a
          - value: { sid:"fc02::1a" end_function_ad:{outgoing_interface:"GigabitEthernet0/5/0" incoming_interface:"GigabitEthernet0/5/0" l3_service_address:"192.168.100.22
7"} }
      3. CREATE [DERIVED]:
          - key: vpp/interface/GigabitEthernet0/5/0/vrf/0/ip-version/v4
          - value: <EMPTY>
      4. CREATE [DERIVED]:
          - key: vpp/interface/GigabitEthernet0/5/0/address/static/192.168.100.100/24
          - value: <EMPTY>
      5. CREATE [DERIVED]:
          - key: vpp/interface/GigabitEthernet0/5/0/has-IP-address
          - value: <EMPTY>

vpp add xconnect adjacency on the first step
https://github.com/FDio/vpp/blob/f284c14c7bd8731367ba3527cdfffa610a8c6de4/src/plugins/srv6-ad/ad.c#L57

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions