06-24-2021 11:54 PM - edited 06-25-2021 12:12 AM
While I am searching for the Next hop filed behavior of OSPF routes I have found following quote.
broadcast” and “non-broadcast” network types will use the next hop IP address of the router advertising the network and the “point to point”, "point to multipoint' and "point to multipoint non broadcast" network types will use the next hop IP address of the router that we received the information from.
But I have hard time to believe this concept.
broadcast” and “non-broadcast” network types will use the next hop IP address of the router advertising the network
Please check following topology
R1,R2,R3 and R4 Fa 0/0 is configure as broadcast interface type.R5 loopback is advertised to OSPF and R1,R2 and R4 list the Next Hop as 10.1.1.3 for this route. This loopback is advertised by R5 .So above statement make me confusion. I think OSPF first run SPF algorithm for his LSDB and find the shortest fast (Through R3) then he will marked the Next Hop as 10.1.1.3 .In this case he will not check the reachability for 10.1.1.3 because of configured network type "Broadcast". Therefore in the environment like DMVPN and Frame relay ,OSPF routing table will list the Nexthop like 10.1.1.3 although it may not reachable.
"point to multipoint' and "point to multipoint non broadcast" network types will use the next hop IP address of the router that we received the information from.
I think router will learn LSA/ LSU from all its neighbors. we can not exactly say from which neighbor it received this information first. For a instance , If we consider only one Area (Area 0) Topology with all router has point to multipoint interface type , all routers have same LSDB and if new router join it will receive this information from the first router which reached to full state. Therefore above statement bit unclear to me.
I thinks this scenario with "ponit to point " interfaces will check reachability information to decide the Next hop unlike in broadcast and non broadcast scenario after running SPF. But not consider where it received this information. Because OSPF is link state routing protocol and from whom it received this information is not important.
Please help me to understand this behavior clearly....
Also please clarify the exact procedure followed by the OSPF protocol when deciding the next hop.
Thank you very much for your valuable time ....
Solved! Go to Solution.
06-25-2021 01:49 AM - edited 06-25-2021 02:02 AM
Hello @Ariyarathna ,
OSPF is link state IGP, it has a complete topology information for each area the router is member of.
So, OSPF uses LSA data structures of different types to describe topology and to advertise IPv4 prefixes ( we consider OSPFv2 in this post).
For each destination the SPF algorythm is run to find the shortest path, the path with the lowest cumulated metric to destination.
Each LSA has an orginator / owner the LSA is flooded in the whole area unchanged and all routers in an OSPF area have the same set of LSAs.
Coming to your question:
if the exit link to a prefix is a point to point link then the local OSPF router will use the single neighbor on the p2p link as the "next-hop" L3 preparing the packet to be received by neighbor.
In a broadcast domain, a DR and BDR are elected with the purpose to minimize the number of full Adjacencies that need to be formed.
In a broadcast domain a new LSA is sent by a DR other router to the 224.0.0.6 ALL OSPF DR routers in segment.
The DR will send the new LSA to 224.0.0.5 to all the other routers.
So in this case the "next-hop" for the prefix described in this LSA is actually the LAN address of the device that originated the LSA.
The DR creates and mantains the Network LSA that lists the OSPF RIDs of devices connected to the segment.
From the new LSA each router can find out the OSPF RID of the advertising router.
Looking at the Router LSA of the advertising router they can find out the LAN address in the broadcast segment ( the DR address is reported in the router LSA to allow to find out this easily).
So the next-hop on a brodcast segment is the LAN address of LSA originator or the LAN address of the device on the shortest path to destination.
When we move to special OSPF network type like point to multipoint . Here OSPF cannot assume that all devices in the subnet can be reached directly.
In this case the packet has to be sent to the device that is able to reach the intended next-hop.
If we use a Frame-Relay toplogy as an example we need to use the DLCI to the hub that then will switch the packet to another DLCI to the other spoke.
So here at IP level the next-hop is the other spoke but packet rewrite needs to send to the hub.
A frame-relay map command for remote spoke IP using the same DLCI to the hub needs to be configured.
Speaking of next-hop for link state protocols is not appropriate and it can be misleading.
The next-hop in OSPF or IS-IS is not the device from which the prefix was received but it is the device on the best path to destination.
Hope to help
Giuseppe
06-25-2021 01:49 AM - edited 06-25-2021 02:02 AM
Hello @Ariyarathna ,
OSPF is link state IGP, it has a complete topology information for each area the router is member of.
So, OSPF uses LSA data structures of different types to describe topology and to advertise IPv4 prefixes ( we consider OSPFv2 in this post).
For each destination the SPF algorythm is run to find the shortest path, the path with the lowest cumulated metric to destination.
Each LSA has an orginator / owner the LSA is flooded in the whole area unchanged and all routers in an OSPF area have the same set of LSAs.
Coming to your question:
if the exit link to a prefix is a point to point link then the local OSPF router will use the single neighbor on the p2p link as the "next-hop" L3 preparing the packet to be received by neighbor.
In a broadcast domain, a DR and BDR are elected with the purpose to minimize the number of full Adjacencies that need to be formed.
In a broadcast domain a new LSA is sent by a DR other router to the 224.0.0.6 ALL OSPF DR routers in segment.
The DR will send the new LSA to 224.0.0.5 to all the other routers.
So in this case the "next-hop" for the prefix described in this LSA is actually the LAN address of the device that originated the LSA.
The DR creates and mantains the Network LSA that lists the OSPF RIDs of devices connected to the segment.
From the new LSA each router can find out the OSPF RID of the advertising router.
Looking at the Router LSA of the advertising router they can find out the LAN address in the broadcast segment ( the DR address is reported in the router LSA to allow to find out this easily).
So the next-hop on a brodcast segment is the LAN address of LSA originator or the LAN address of the device on the shortest path to destination.
When we move to special OSPF network type like point to multipoint . Here OSPF cannot assume that all devices in the subnet can be reached directly.
In this case the packet has to be sent to the device that is able to reach the intended next-hop.
If we use a Frame-Relay toplogy as an example we need to use the DLCI to the hub that then will switch the packet to another DLCI to the other spoke.
So here at IP level the next-hop is the other spoke but packet rewrite needs to send to the hub.
A frame-relay map command for remote spoke IP using the same DLCI to the hub needs to be configured.
Speaking of next-hop for link state protocols is not appropriate and it can be misleading.
The next-hop in OSPF or IS-IS is not the device from which the prefix was received but it is the device on the best path to destination.
Hope to help
Giuseppe
06-25-2021 07:07 AM
@Giuseppe Larosa Thank you very much for the great explanation
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide