ospf neighbor relationship query

Unanswered Question
Dec 18th, 2009
User Badges:

Hello, how does ospf find out if neighbor is directly connected or not. Can ospf form neighbor with nondirect router for all network types say point-to-point.  OSPF uses mcast address 224.0.0.5 and 224.0.0.6 so it looks like ttl 1 is what causes directly connected check but what happens when it does not use mcast and uses ucast to form neighbor than where/how and which packet it checks for direct relationship. does all igp have the same behavior. thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Jon Marshall Sat, 12/19/2009 - 04:07
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

nedk12345 wrote:


Hello, how does ospf find out if neighbor is directly connected or not. Can ospf form neighbor with nondirect router for all network types say point-to-point.  OSPF uses mcast address 224.0.0.5 and 224.0.0.6 so it looks like ttl 1 is what causes directly connected check but what happens when it does not use mcast and uses ucast to form neighbor than where/how and which packet it checks for direct relationship. does all igp have the same behavior. thanks


OSPF hello packets are sent with a TTL of 1 so they cannot be routed. So even unicast packets have a TTL of 1. The only exception to this are virtual links where you can establish an adjacency with router not directly connected.


Jon

lamav Sat, 12/19/2009 - 07:50
User Badges:
  • Blue, 1500 points or more

Hello:


Just to add a bit to what Jon wrote, on Broadcast and point-to-point networks, Hello packets are multicast to the the AllSPFRouters address of 224.0.0.5.


On NBMA (like Frame Relay and ATM), point-to-multipoint, and virtual link network types, Hello packets are unicast to their individual neighbors. The implication of this, of course, is that the router already knows about an attached neighbor -- and that can require extra configuration commands, or a mechanism like Inverse ARP.


The old solution is to use the "neighbor" command to define the neighbor to the OSPF speaker. No dynamic discovery.


The newer solution is to change the OSPF network type on each interface to Broadcast, in which case the Hellos will be multicast to the 224.0.0.5 address, as described above.


In addition, for the most typical NBMA network -- Frame Relay -- the frame-relay map command will be used with the "Broadcast" keyword at the end of it to inform the router how to reach the other routers on the NBMA network by mapping an IP address to a DLCI.


By the way, on an NBMA network, Hello packets are sent every Poll Interval, which is 120 seconds by default on Cisco routers.


HTH


Victor

nedk12345 Sat, 12/19/2009 - 14:00
User Badges:

I don't see TTL field in hello. Is it in IP Header. How does it know that the packet is a hello packet and it needs to be ent with ttl1. How is OSPF encapsulated in IP. Does that mean OSPF is at layer 4 (transport layer) protocol as all routing protocol sit at layer 3.


All documents say ospf hello interval is 30 seconds on nbma. is poll interval different from hello interval. Thanx

Jon Marshall Sat, 12/19/2009 - 14:26
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

nedk12345 wrote:


I don't see TTL field in hello. Is it in IP Header. How does it know that the packet is a hello packet and it needs to be ent with ttl1. How is OSPF encapsulated in IP. Does that mean OSPF is at layer 4 (transport layer) protocol as all routing protocol sit at layer 3.


All documents say ospf hello interval is 30 seconds on nbma. is poll interval different from hello interval. Thanx


Yes the TTL is in the IP header. OSPF has a protocol number at the IP layer (89) and is encapsulated directly into an IP header. So it is not at layer 4 ie. TCP/UDP,  it is at L3.  Bear in mind that the IP model does not map properly to the OSI model so it can be a bit fuzzy when we talk about layer 3/layer 4 etc.


How does it know it is a hello packet, not sure what you mean. The OSPF code will know what type of packet is being sent.


Edit - missed last question. Poll interval is not the same as hello interval. Polls are used when a neighbor is down and it is polled to check it's status.


Jon

lamav Sat, 12/19/2009 - 15:36
User Badges:
  • Blue, 1500 points or more

OSPF packets are directly encapsulated by IP. It is the IP header that has the TTL field that is set to 1 when a multicast Hello packet is sent. OSPF is IP protocol number 89.


All routing protocols do not reside in layer 3. RIP rides on top of UDP (port number 520) and BGP rides on top of TCP (port number 179).


The Poll Interval is separate from the Hello timer.


HTH


Victor

lamav Sat, 12/19/2009 - 15:39
User Badges:
  • Blue, 1500 points or more

Jon sorry for the cross post.


I was about to answer his post - had the form open, but then went to eat dinner before my girlfriend hit me with a soup ladle. I came back and posted, not knowing you already answered.


Thanks


Victor

Giuseppe Larosa Sun, 12/20/2009 - 07:52
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Ned,


OSPF is a routing protocol that works at OSI layer3 but if we look at an OSPF packet we see that OSPF has its own protocol number over IP (89).


Let's not confuse where a protocol works with how a protocol is encapsulated.


BGP uses TCP port 179 on one side so it is above transport level, but its activity is to route IP traffic so it works at level3.



Hope to help

Giuseppe

Actions

This Discussion