Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow IPv4 link-local nexthops #1903

Merged
merged 1 commit into from
Feb 28, 2022
Merged

Conversation

utpalkantpintoo
Copy link
Contributor

What I did
Fix for issue: sonic-net/sonic-buildimage#8606

Why I did it
Orchagent (NeighOrch) currently ignores IPv4 link-local neighbours. Any route pointing to such a nexthop is not added to the ASIC DB. Such routes are expected and should be supported.

How I verified it

root@sonic:/home/admin# redis-cli hgetall "NEIGH_TABLE:Ethernet0:169.254.0.1"
1) "family"
2) "IPv4"
3) "neigh"
4) "00:10:94:00:00:01"
root@sonic:/home/admin#
root@sonic:/home/admin# redis-cli hgetall "ROUTE_TABLE:50.0.1.0/24"
1) "nexthop"
2) "169.254.0.1"
3) "ifname"
4) "Ethernet0"
root@sonic:/home/admin#


--- Syslog ---

Sep 10 08:51:22.177963 sonic NOTICE swss#orchagent: :- addNeighbor: Created neighbor ip 169.254.0.1, 00:10:94:00:00:01 on Ethernet0
Sep 10 08:51:22.178802 sonic NOTICE swss#orchagent: :- addNextHop: Created next hop 169.254.0.1 on Ethernet0

Sep 10 08:55:34.173418 sonic INFO swss#orchagent: :- create_entry: EntityBulker.create_entry 1, 1, 2, 1
Sep 10 08:55:34.174798 sonic INFO swss#orchagent: :- flush_creating_entries: EntityBulker.flush creating_entries 1
Sep 10 08:55:34.174798 sonic INFO swss#orchagent: :- addRoutePost: Post create route 50.0.1.0/24 with next hop(s) 169.254.0.1@Ethernet0

-------

root@sonic:/home/admin# redis-cli -n 1 keys *NEIGH*
1) "ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{\"ip\":\"169.254.0.1\",\"rif\":\"oid:0x6000000000600\",\"switch_id\":\"oid:0x21000000000000\"}"
root@sonic:/home/admin#

root@sonic:/home/admin# redis-cli -n 1 keys *NEXT_HOP*
1) "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x4000000000621"
root@sonic:/home/admin#

root@sonic:/home/admin# redis-cli -n 1 hgetall "ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{\"ip\":\"169.254.0.1\",\"rif\":\"oid:0x6000000000600\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS"
2) "00:10:94:00:00:01"
3) "SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE"
4) "true"
root@sonic:/home/admin# 

root@sonic:/home/admin# redis-cli -n 1 hgetall "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x4000000000621"
1) "SAI_NEXT_HOP_ATTR_TYPE"
2) "SAI_NEXT_HOP_TYPE_IP"
3) "SAI_NEXT_HOP_ATTR_IP"
4) "169.254.0.1"
5) "SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID"
6) "oid:0x6000000000600"
root@sonic:/home/admin#

root@sonic:/home/admin# redis-cli -n 1 hgetall "ASIC_STATE:SAI_OBJECT_TYPE_ROUTE_ENTRY:{\"dest\":\"50.0.1.0/24\",\"switch_id\":\"oid:0x21000000000000\",\"vr\":\"oid:0x3000000000022\"}"
1) "SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID"
2) "oid:0x4000000000621"
root@sonic:/home/admin#

Details if related

Signed-off-by: Utpal Kant Pintoo utpal.pintoo@broadcom.com
@ghost
Copy link

ghost commented Sep 13, 2021

CLA assistant check
All CLA requirements met.

continue;
}
}

NeighborEntry neighbor_entry = { ip_address, alias };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root@sonic:/home/admin# redis-cli hgetall "NEIGH_TABLE:Ethernet0:169.254.0.1"

  1. "family"
  2. "IPv4"
  3. "neigh"
  4. "00:10:94:00:00:01"

Is this static or dynamic neighbor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing, the neighbour/route entries were manually added to APP DB. In typical use-case, this neighbour entry will be static.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, which module would push this static ARP and MAC into the kernel? I believe, we should push static nbr entry add/del code as well to community to support BGP unnumbered use-case, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FRR(Zebra) is already adding static(PERMANENT) IPv4 LL neighbours in kernel. Please check the APP DB log in the issue. This change is only to allow such entries in NeighOrch as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@utpalkantpintoo Can you attach the testing logs of BGP unnumbered use-case with the community image, just to make sure this code is working fine for that use-case?

@utpalkantpintoo
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Collaborator

prsunny commented Sep 23, 2021

@venkatmahalingam , @dgsudharsan , could you please review and signoff?

@venkatmahalingam
Copy link
Contributor

@venkatmahalingam , @dgsudharsan , could you please review and signoff?

Sure Prince, I left one last comment now for the BGP unnumbered use-case testing, since there are multiple PRs being raised, it's always better to attach the integration testing logs for the benefit of the community.

@dgsudharsan
Copy link
Collaborator

@utpalkantpintoo @prsunny @venkatmahalingam
This seems to be different from the HLD design which proposes to have IPv6 next hop for IPv4 over using IPv4 link local. Why is this design changed. Is this updated in the HLD?
sonic-net/SONiC#625 (comment)

Copy link
Collaborator

@dgsudharsan dgsudharsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add UT to route module to cover link local next hop cases. Can you please add them?

@dgsudharsan
Copy link
Collaborator

@utpalkantpintoo Can you please provide an ETA when UT will be provided?

@dgsudharsan
Copy link
Collaborator

@utpalkantpintoo @adyeung Can you please provide an ETA for addressing the review comments?

@utpalkantpintoo
Copy link
Contributor Author

Hi

I have verified the changes with IPv4/v6 traffic in 2-node topology with BGP un-numbered config.
Relevant logs have been pasted below, please let me know if any further information is required.

TG1 -----> DUT1 [TH1] =====> DUT2 [TH2] -----> TG2

root@sonic:/home/admin# show ipv6 interfaces
Interface    Master    IPv4 address/mask                         Admin/Oper    BGP Neighbor    Neighbor IP
-----------  --------  ----------------------------------------  ------------  --------------  -------------
Bridge                 fe80::3008:2aff:fe85:6f95%Bridge/64       up/down       N/A             N/A
Ethernet8              fe80::3e2c:99ff:fe2e:d875%Ethernet8/64    up/up         N/A             N/A
Ethernet24             fe80::3e2c:99ff:fe2e:d875%Ethernet24/64   up/up         N/A             N/A
Ethernet108            fe80::3e2c:99ff:fe2e:d875%Ethernet108/64  up/up         N/A             N/A
docker0                fd00::1/80                                up/down       N/A             N/A
                       fe80::1%docker0/64                                      N/A             N/A
eth0                   fe80::3e2c:99ff:fe2e:d875%eth0/64         up/up         N/A             N/A
lo                     ::1/128                                   up/up         N/A             N/A
root@sonic:/home/admin#

root@sonic:/home/admin# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

K>* 0.0.0.0/0 [0/0] via 10.59.128.1, eth0, 00:47:54
C>* 10.59.128.0/20 is directly connected, eth0, 00:47:54
B>* 150.0.1.0/24 [20/0] via fe80::3e2c:99ff:fe2d:8435, Ethernet24, weight 1, 00:04:51
  *                     via fe80::3e2c:99ff:fe2d:8435, Ethernet108, weight 1, 00:04:51

root@sonic:/home/admin#

root@sonic:/home/admin# show ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

B>* 1500::/64 [20/0] via fe80::3e2c:99ff:fe2d:8435, Ethernet24, weight 1, 00:04:45
  *                  via fe80::3e2c:99ff:fe2d:8435, Ethernet108, weight 1, 00:04:45
K>* fd00::/80 [0/1024] is directly connected, docker0, 00:48:01
C * fe80::/64 is directly connected, Ethernet8, 00:21:21
C * fe80::/64 is directly connected, Ethernet108, 00:44:58
C * fe80::/64 is directly connected, Ethernet24, 00:44:58
C>* fe80::/64 is directly connected, eth0, 00:48:00

root@sonic:/home/admin#

root@sonic:/home/admin# ip neigh show | grep -v eth0
169.254.0.1 dev Ethernet108 lladdr 3c:2c:99:2d:84:35 PERMANENT
169.254.0.1 dev Ethernet24 lladdr 3c:2c:99:2d:84:35 PERMANENT
fe80::3e2c:99ff:fe2d:8435 dev Ethernet24 lladdr 3c:2c:99:2d:84:35 router REACHABLE
fe80::3e2c:99ff:fe2d:8435 dev Ethernet108 lladdr 3c:2c:99:2d:84:35 router REACHABLE
root@sonic:/home/admin#

root@sonic:/home/admin# ip route show
default via 10.59.128.1 dev eth0
10.59.128.0/20 dev eth0 proto kernel scope link src 10.59.142.46
150.0.1.0/24 proto bgp metric 20
	nexthop via 169.254.0.1 dev Ethernet24 weight 1 onlink
	nexthop via 169.254.0.1 dev Ethernet108 weight 1 onlink
240.127.1.0/24 dev docker0 proto kernel scope link src 240.127.1.1 linkdown
root@sonic:/home/admin#

root@sonic:/home/admin# ip -6 route show
::1 dev lo proto kernel metric 256 pref medium
1500::/64 proto bgp metric 20
	nexthop via fe80::3e2c:99ff:fe2d:8435 dev Ethernet24 weight 1
	nexthop via fe80::3e2c:99ff:fe2d:8435 dev Ethernet108 weight 1 pref medium
fd00::/80 dev docker0 proto kernel metric 256 linkdown pref medium
fd00::/80 dev docker0 metric 1024 linkdown pref medium
fe80::/64 dev docker0 proto kernel metric 256 linkdown pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev Bridge proto kernel metric 256 linkdown pref medium
fe80::/64 dev Ethernet108 proto kernel metric 256 pref medium
fe80::/64 dev Ethernet24 proto kernel metric 256 pref medium
fe80::/64 dev Ethernet8 proto kernel metric 256 pref medium
root@sonic:/home/admin#


>>>>>> APP DB:

root@sonic:/home/admin# redis-cli
127.0.0.1:6379> HGETALL "INTF_TABLE:Ethernet108"
1) "ipv6_use_link_local_only"
2) "enable"
3) "mac_addr"
4) "00:00:00:00:00:00"
127.0.0.1:6379> HGETALL "INTF_TABLE:Ethernet24"
1) "ipv6_use_link_local_only"
2) "enable"
3) "mac_addr"
4) "00:00:00:00:00:00"
127.0.0.1:6379>
127.0.0.1:6379> HGETALL "NEIGH_TABLE:Ethernet108:fe80::3e2c:99ff:fe2d:8435"
1) "neigh"
2) "3c:2c:99:2d:84:35"
3) "family"
4) "IPv6"
127.0.0.1:6379> HGETALL "NEIGH_TABLE:Ethernet108:169.254.0.1"
1) "neigh"
2) "3c:2c:99:2d:84:35"
3) "family"
4) "IPv4"
127.0.0.1:6379>
127.0.0.1:6379> HGETALL "NEIGH_TABLE:Ethernet24:fe80::3e2c:99ff:fe2d:8435"
1) "neigh"
2) "3c:2c:99:2d:84:35"
3) "family"
4) "IPv6"
127.0.0.1:6379> HGETALL "NEIGH_TABLE:Ethernet24:169.254.0.1"
1) "neigh"
2) "3c:2c:99:2d:84:35"
3) "family"
4) "IPv4"
127.0.0.1:6379>
127.0.0.1:6379> HGETALL "ROUTE_TABLE:150.0.1.0/24"
1) "nexthop"
2) "169.254.0.1,169.254.0.1"
3) "ifname"
4) "Ethernet24,Ethernet108"
127.0.0.1:6379>
127.0.0.1:6379> HGETALL "ROUTE_TABLE:1500::/64"
1) "nexthop"
2) "fe80::3e2c:99ff:fe2d:8435,fe80::3e2c:99ff:fe2d:8435"
3) "ifname"
4) "Ethernet24,Ethernet108"
127.0.0.1:6379>
root@sonic:/home/admin#

>>>>>> ASIC DB:

root@sonic:/home/admin# redis-cli -n 1
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{\"ip\":\"fe80::3e2c:99ff:fe2d:8435\",\"rif\":\"oid:0x60000000005e0\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS"
2) "3C:2C:99:2D:84:35"
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{\"ip\":\"169.254.0.1\",\"rif\":\"oid:0x60000000005e0\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS"
2) "3C:2C:99:2D:84:35"
3) "SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE"
4) "true"
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{\"ip\":\"fe80::3e2c:99ff:fe2d:8435\",\"rif\":\"oid:0x60000000005e1\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS"
2) "3C:2C:99:2D:84:35"
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{\"ip\":\"169.254.0.1\",\"rif\":\"oid:0x60000000005e1\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS"
2) "3C:2C:99:2D:84:35"
3) "SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE"
4) "true"
127.0.0.1:6379[1]>
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x40000000005e5"
1) "SAI_NEXT_HOP_ATTR_TYPE"
2) "SAI_NEXT_HOP_TYPE_IP"
3) "SAI_NEXT_HOP_ATTR_IP"
4) "fe80::3e2c:99ff:fe2d:8435"
5) "SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID"
6) "oid:0x60000000005e1"
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x40000000005e2"
1) "SAI_NEXT_HOP_ATTR_TYPE"
2) "SAI_NEXT_HOP_TYPE_IP"
3) "SAI_NEXT_HOP_ATTR_IP"
4) "fe80::3e2c:99ff:fe2d:8435"
5) "SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID"
6) "oid:0x60000000005e0"
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x40000000005e3"
1) "SAI_NEXT_HOP_ATTR_TYPE"
2) "SAI_NEXT_HOP_TYPE_IP"
3) "SAI_NEXT_HOP_ATTR_IP"
4) "169.254.0.1"
5) "SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID"
6) "oid:0x60000000005e0"
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x40000000005e4"
1) "SAI_NEXT_HOP_ATTR_TYPE"
2) "SAI_NEXT_HOP_TYPE_IP"
3) "SAI_NEXT_HOP_ATTR_IP"
4) "169.254.0.1"
5) "SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID"
6) "oid:0x60000000005e1"
127.0.0.1:6379[1]>
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_ROUTE_ENTRY:{\"dest\":\"1500::/64\",\"switch_id\":\"oid:0x21000000000000\",\"vr\":\"oid:0x3000000000022\"}"
1) "SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID"
2) "oid:0x50000000005ed"
127.0.0.1:6379[1]>
127.0.0.1:6379[1]> HGETALL "ASIC_STATE:SAI_OBJECT_TYPE_ROUTE_ENTRY:{\"dest\":\"150.0.1.0/24\",\"switch_id\":\"oid:0x21000000000000\",\"vr\":\"oid:0x3000000000022\"}"
1) "SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID"
2) "oid:0x50000000005ea"
127.0.0.1:6379[1]>
root@sonic:/home/admin# 

@liat-grozovik
Copy link
Collaborator

@utpalkantpintoo, @prsunny do we need this on 2021111 as well?

@prsunny prsunny merged commit 18c73a1 into sonic-net:master Feb 28, 2022
judyjoseph pushed a commit that referenced this pull request Mar 7, 2022
*Orchagent (NeighOrch) currently ignores IPv4 link-local neighbours. Any route pointing to such a nexthop is not added to the ASIC DB. Such routes are expected and should be supported.
Signed-off-by: Utpal Kant Pintoo utpal.pintoo@broadcom.com
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
*Orchagent (NeighOrch) currently ignores IPv4 link-local neighbours. Any route pointing to such a nexthop is not added to the ASIC DB. Such routes are expected and should be supported.
Signed-off-by: Utpal Kant Pintoo utpal.pintoo@broadcom.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants