Skip to content
New issue

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

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

Already on GitHub? # to your account

Sonic doesn't create NextHopGroup even some Next Hops are Resolved. #1216

Open
samKDas opened this issue Mar 5, 2020 · 2 comments
Open

Sonic doesn't create NextHopGroup even some Next Hops are Resolved. #1216

samKDas opened this issue Mar 5, 2020 · 2 comments

Comments

@samKDas
Copy link

samKDas commented Mar 5, 2020

Hi ,
In our test scenario , a vlan interface is created and 3 ips are added to the Vlan Interface. 3 nexthop ips for a destination network (81.1.1.0/24)are added which are in the same respective subnets of the above Vlan interface ips. We resolved arp for only two next hops. Even though we have 2 valid next hops for the same destination network, sonic doesn't create a NextHopGroup.
The following are the logs .

root@sonic:/home/admin# config vlan add 1007
root@sonic:/home/admin# config vlan member add 1007 Ethernet8
root@sonic:/home/admin# config vlan member add 1007 Ethernet9
root@sonic:/home/admin# config vlan member add 1007 Ethernet10
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# show vlan brief
+-----------+--------------+------------+----------------+-----------------------+
| VLAN ID | IP Address | Ports | Port Tagging | DHCP Helper Address |
+===========+==============+============+================+=======================+
| 1007 | | Ethernet8 | tagged | |
| | | Ethernet9 | tagged | |
| | | Ethernet10 | tagged | |
+-----------+--------------+------------+----------------+-----------------------+
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# config interface ip add Vlan1007 10.1.1.1/24
root@sonic:/home/admin# config interface ip add Vlan1007 20.1.1.1/24
root@sonic:/home/admin# config interface ip add Vlan1007 30.1.1.1/24
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# vtysh

Hello, this is FRRouting (version 7.2-sonic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

sonic#
sonic#
sonic# conf t
sonic(config)# config interface ip add Vlan1007 10.1.1.1/24
% Unknown command: config interface ip add Vlan1007 10.1.1.1/24
sonic(config)# config interface ip add Vlan1007 20.1.1.1/24
% Unknown command: config interface ip add Vlan1007 20.1.1.1/24
sonic(config)# config interface ip add Vlan1007 30.1.1.1/24
% Unknown command: config interface ip add Vlan1007 30.1.1.1/24
sonic(config)#
sonic(config)#
sonic(config)# ip route 81.1.1.0 255.255.255.0 10.1.1.2
sonic(config)# ip route 81.1.1.0 255.255.255.0 20.1.1.2
sonic(config)# ip route 81.1.1.0 255.255.255.0 30.1.1.2
sonic(config)#
sonic(config)#
sonic(config)# exit
sonic# exit
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 route, r - rejected route

S>* 0.0.0.0/0 [200/0] via 10.28.32.1, eth0, 00:03:56
C>* 10.1.1.0/24 is directly connected, Vlan1007, 00:01:58
C>* 10.28.32.0/23 is directly connected, eth0, 00:03:57
C>* 20.1.1.0/24 is directly connected, Vlan1007, 00:01:57
C>* 30.1.1.0/24 is directly connected, Vlan1007, 00:01:55
S>* 81.1.1.0/24 [1/0] via 10.1.1.2, Vlan1007, 00:00:21
via 20.1.1.2, Vlan1007, 00:00:21
via 30.1.1.2, Vlan1007, 00:00:21
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# tail -n200 -f /var/log/syslog | grep swss
Jan 19 19:36:35.535319 sonic NOTICE swss#orchagent: :- addVlan: Create an empty VLAN Vlan1007 vid:1007
Jan 19 19:36:36.081641 sonic NOTICE swss#orchagent: :- setHostIntfsStripTag: Set SAI_HOSTIF_VLAN_TAG_KEEP to host interface: Ethernet8
Jan 19 19:36:36.081844 sonic NOTICE swss#orchagent: :- addBridgePort: Add bridge port Ethernet8 to default 1Q bridge
Jan 19 19:36:36.084313 sonic NOTICE swss#orchagent: :- addVlanMember: Add member Ethernet8 to VLAN Vlan1007 vid:1007 pid1000000000009
Jan 19 19:36:36.615909 sonic NOTICE swss#orchagent: :- setHostIntfsStripTag: Set SAI_HOSTIF_VLAN_TAG_KEEP to host interface: Ethernet9
Jan 19 19:36:36.616063 sonic NOTICE swss#orchagent: :- addBridgePort: Add bridge port Ethernet9 to default 1Q bridge
Jan 19 19:36:36.616928 sonic NOTICE swss#orchagent: :- addVlanMember: Add member Ethernet9 to VLAN Vlan1007 vid:1007 pid100000000000a
Jan 19 19:36:38.187778 sonic NOTICE swss#orchagent: :- setHostIntfsStripTag: Set SAI_HOSTIF_VLAN_TAG_KEEP to host interface: Ethernet10
Jan 19 19:36:38.187778 sonic NOTICE swss#orchagent: :- addBridgePort: Add bridge port Ethernet10 to default 1Q bridge
Jan 19 19:36:38.188237 sonic NOTICE swss#orchagent: :- addVlanMember: Add member Ethernet10 to VLAN Vlan1007 vid:1007 pid100000000000b
Jan 19 19:37:10.547675 sonic NOTICE swss#orchagent: :- addRouterIntfs: Create router interface Vlan1007 MTU 9100
Jan 19 19:37:10.556585 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:10.1.1.1
Jan 19 19:37:10.556585 sonic NOTICE swss#orchagent: :- addDirectedBroadcast: Add broadcast route for ip:10.1.1.255
Jan 19 19:37:11.151159 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:20.1.1.1
Jan 19 19:37:11.151419 sonic NOTICE swss#orchagent: :- addDirectedBroadcast: Add broadcast route for ip:20.1.1.255
Jan 19 19:37:12.728041 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:30.1.1.1
Jan 19 19:37:12.728750 sonic NOTICE swss#orchagent: :- addDirectedBroadcast: Add broadcast route for ip:30.1.1.255
Jan 19 19:39:02.864777 sonic INFO swss#supervisord 2017-01-19 19:38:59,901 INFO exited: enable_counters (exit status 0; expected)

Jan 19 19:40:04.725942 sonic NOTICE swss#orchagent: :- addNeighbor: Created neighbor 00:00:01:56:fe:07 on Vlan1007
Jan 19 19:40:04.726474 sonic NOTICE swss#orchagent: :- addNextHop: Created next hop 10.1.1.2 on Vlan1007
Jan 19 19:40:06.897371 sonic NOTICE swss#orchagent: :- addNeighbor: Created neighbor 00:00:01:57:aa:d2 on Vlan1007
Jan 19 19:40:06.898138 sonic NOTICE swss#orchagent: :- addNextHop: Created next hop 20.1.1.2 on Vlan1007
root@sonic:/home/admin# show arp
Address MacAddress Iface Vlan
--------- + -------------- +--------- +------
10.1.1.2 00:00:01:56:fe:07 Ethernet8 1007
10.28.32.16 00:19:99:e0:c3:a1 eth0 -
20.1.1.2 00:00:01:57:aa:d2 Ethernet9 1007
Total number of entries 3
root@sonic:/home/admin#
root@sonic:/home/admin# redis-cli -n 1 keys NEXT

  1. "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x400000000034c"
  2. "ASIC_STATE:SAI_OBJECT_TYPE_NEXT_HOP:oid:0x400000000034d"
    root@sonic:/home/admin#
    root@sonic:/home/admin#
    root@sonic:/home/admin#

From the above swss logs we see that no NextHopGroup is created even though we have two valid
next hops resolved.

Regards
Sambit

@prsunny
Copy link
Collaborator

prsunny commented Mar 5, 2020

I don't see the logs where route 81.1.1.0 is added. NH Group is created when orchagent gets the route update. can you get the output from APP_DB route table for 81.1.1.0 ?

@samKDas
Copy link
Author

samKDas commented Mar 6, 2020

Hi ,
Below are the logs.
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 route, r - rejected route

S>* 0.0.0.0/0 [200/0] via 10.28.32.1, eth0, 00:20:57
C>* 10.1.1.0/24 is directly connected, Vlan1007, 00:19:39
C>* 10.28.32.0/23 is directly connected, eth0, 00:20:59
C>* 20.1.1.0/24 is directly connected, Vlan1007, 00:19:39
C>* 30.1.1.0/24 is directly connected, Vlan1007, 00:19:38
C>* 50.1.1.0/24 is directly connected, Ethernet11, 00:19:36
S>* 81.1.1.0/24 [1/0] via 10.1.1.2, Vlan1007, 00:19:03
via 20.1.1.2, Vlan1007, 00:19:03
via 30.1.1.2, Vlan1007, 00:19:03
root@sonic:/home/admin#
root@sonic:/home/admin# tail -n200 -f /var/log/syslog | grep swss
Jan 20 05:10:16.798078 sonic NOTICE swss#orchagent: :- addRouterIntfs: Create router interface Vlan1007 MTU 9100
Jan 20 05:10:16.811304 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:10.1.1.1
Jan 20 05:10:16.811547 sonic NOTICE swss#orchagent: :- addDirectedBroadcast: Add broadcast route for ip:10.1.1.255
Jan 20 05:10:17.362035 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:20.1.1.1
Jan 20 05:10:17.362845 sonic NOTICE swss#orchagent: :- addDirectedBroadcast: Add broadcast route for ip:20.1.1.255
Jan 20 05:10:17.877059 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:30.1.1.1
Jan 20 05:10:17.877411 sonic NOTICE swss#orchagent: :- addDirectedBroadcast: Add broadcast route for ip:30.1.1.255
Jan 20 05:10:20.272123 sonic NOTICE swss#orchagent: :- addRouterIntfs: Create router interface Ethernet11 MTU 9100
Jan 20 05:10:20.280903 sonic NOTICE swss#orchagent: :- addIp2MeRoute: Create IP2me route ip:50.1.1.1
Jan 20 05:12:46.520263 sonic INFO swss#supervisord 2017-01-20 05:12:44,594 INFO exited: enable_counters (exit status 0; expected)
Jan 20 05:14:13.801914 sonic NOTICE swss#orchagent: :- addNeighbor: Created neighbor 00:00:08:26:e0:b9 on Vlan1007
Jan 20 05:14:13.802803 sonic NOTICE swss#orchagent: :- addNextHop: Created next hop 10.1.1.2 on Vlan1007
Jan 20 05:14:27.068828 sonic NOTICE swss#orchagent: :- addNeighbor: Created neighbor 00:00:08:27:67:4e on Vlan1007
Jan 20 05:14:27.069333 sonic NOTICE swss#orchagent: :- addNextHop: Created next hop 20.1.1.2 on Vlan1007
Jan 20 05:14:48.964548 sonic NOTICE swss#orchagent: :- addNeighbor: Created neighbor 00:00:08:28:11:69 on Ethernet11
Jan 20 05:14:48.965131 sonic NOTICE swss#orchagent: :- addNextHop: Created next hop 50.1.1.2 on Ethernet11

^C
root@sonic:/home/admin#
root@sonic:/home/admin# redis-cli -n 0 KEYS ROUTE

  1. "ROUTE_TABLE:20.1.1.0/24"
  2. "ROUTE_TABLE:fe80::/64"
  3. "ROUTE_TABLE:0.0.0.0/0"
  4. "ROUTE_TABLE:81.1.1.0/24"
  5. "ROUTE_TABLE:10.1.1.0/24"
  6. "ROUTE_TABLE:10.28.32.0/23"
  7. "ROUTE_TABLE:30.1.1.0/24"
  8. "ROUTE_TABLE:50.1.1.0/24"
    root@sonic:/home/admin#
    root@sonic:/home/admin#
    root@sonic:/home/admin#

One more point which was noticed is the nextHop Group gets created only when the 3rd next Hop 30.1.1.2 is arp gets resolved.
When all the next hops to a destination network are resolved , then only the nextHop Group gets created.

Regards
Sambit

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this issue Feb 28, 2022
* Added Multi-ASIC support for show ip(v6) route. Python3 compatible, test coverage > 95%
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this issue Mar 1, 2023
What I did:

Moved the SAI header to v1.8.1.
   7cd3a7ed84db3fc9cec13496a5339b6fe1888bb7 (HEAD, tag: v1.8.1, origin/v1.8) Update SAI version to V1.8.1 (sonic-net#1218)
   5913e4cdd0c9c7ae859baa2e18086327b39a94da Fix error when compiling Broadcom SAI with v1.8.0 (sonic-net#1216)
   5a98bc3c7e86c01f3cf702054f9af7c7c5ca6daf (HEAD, tag: v1.8.0, origin/master, origin/HEAD, master) Update version to 1.8.0 (sonic-net#1207)
   b3244ceceb45184ffe37da55bb9a98ef126050ce saineighbor.h: Updated SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX and deprecated SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_IMPOSE_INDEX (sonic-net#1202)
   8731ca6e09c7ba99b0b009e5821d80598e216756 Add source/dest/double NAPT entry available attributes (sonic-net#1194)
   f053d899feb9517f2db43ee462589a30572b5ed1 Add switch attributes for hash offset configuration. (sonic-net#1195)
   13e5cd6940f9a0da1878d00f08e5941e09f16e7f PRBS RX State Data Type (sonic-net#1179)
   9755845a06525a3c17f03e7b936a70783e8ef068 Packet header based VRF classification (sonic-net#1185)
   2369ecb59fff1a5cae948d41eea06bf8b71330b2 SAI versioning (sonic-net#1183)
   744279839c176e68b19734657975e3f5ec6f1a32 Replaced SAI_SWITCH_ATTR_MACSEC_OBJECT_ID with SAI_SWITCH_ATTR_MACSEC_OBJECT_LIST (sonic-net#1199)
   584c724864fe565357e82d097ddcc7363bddefac [CI] Set up CI&PR with Azure Pipelines (sonic-net#1200)
   08192237963174cc60edae9b4812a39c43b291fd Add attribute to query available packet DMA pool size (sonic-net#1198)
   f092ef1e3ce695fc3f9552721025695312b961a2 Add IPv6 flow label hash attribute. (sonic-net#1192)
   cbc9562bb7a8f2c3a79702b99be55f3b3afa6957 Override VRF (sonic-net#1186)
   1eb35afdb2146baf40e6c2b8f2f8bfe99075eaee Add SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO format for GB MDIO sysfs access   (sonic-net#1171)
   b2d4c9a57c7f00b2632c35ca5eb3dd6480f7916a Switch scoped tunnel attributes (sonic-net#1173)
   96adc95bf8316e1905143d9ecd21f32a43e80d7f Enhancements for MPLS support (sonic-net#1181)
   3dcf1f2028da4060b345ad78e8a0c87d225bf5d0 Support for ACL extensions in metadata (sonic-net#1178)
   24076be95b871e8f82ecaeb908cad951dc68896c [meta] Add support for allow empty list tag (sonic-net#1190)
   a2b3344cdde0bf5a4f8e98e1c676a658c0c615b0 spell check fixes (sonic-net#1189)
   bf4271bab6e8884bd96050bcba44e3134adaaec3 Do not call sai_metadata_sai get APIs before checking if they are allocated (sonic-net#1182)
   5d5784dc3dbfc713c92ae7d2c472680b837bb002 [macsec]: Separate XPN configuration attribute from read-only attribute (sonic-net#1169)
   6d5a9bf5ad17cb82621cabbe2449524320930606 [macsec]: add SAI_MACSEC_ATTR_SUPPORTED_CIPHER_SUITE_LIST (sonic-net#1172)
   e72c8f3a0cc543cb228554be82c97a63db917740 [meta] Print each tool version in Makefile (sonic-net#1177)
   8f19677da88c7494d563ef7c5acb0529ecbd0b6e [meta] Add check for START, END and RANBE_BASE enums (sonic-net#1175)
   24ad7906f145930b2e25682b6248909289d39e72 [meta] Create sai_switch_pointers_t struct (sonic-net#1174)
   4f5f84df3fcd0e146707df41d3e2837c48f7c760 Tunnel loopback packet action as resource (sonic-net#1163)
   8a0e82c57aa0e22e696158735516904e7dc14052 [meta] Add create only oid attribute check on switch object (sonic-net#1170)
   14cf50772e478551920963ecf11f4fd019a0c106 Remove obsolete stub folder (sonic-net#1168)
   f14f406340e4f5f1b1d674f6fdd5fd861a54c877 [meta] Use safer calloc for integer overflow check (sonic-net#1166)

Also this PR include changes of this sonic-net#815

SAI commit b2d4c9a57c7f00b2632c35ca5eb3dd6480f7916a Switch scoped tunnel attributes (sonic-net#1173) needed change in sai_redis_switch.cpp and sai_vs_switch.cpp for compilation.

How I verify:

Verify Build is fine of libsairedis*.deb, syncd*.deb, swss*.deb

Co-authored-by: Ann Pokora <apokora@juniper.net>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants