OSPF Hop Count Limitation

Answered Question
Aug 17th, 2007
User Badges:

In a practice test for CCNA exam 640-801, the correct answer given to a question re OSPF hop count limitation was that this is unlimited when OSPF is being used on a network. I am confused by this as there is an 8-bit TTL field in the IP datagram header, and this is decremented by 1 by each router traversed. When this TTL count reaches zero the IP packet should be discarded. The max for 8-bit field is 255, so shouldn't there be a hop count limit of 255 for OSPF, and indeed ANY routing protocol ?



Correct Answer by Richard Burts about 9 years 8 months ago

Mohammed


When an OSPF router receives an advertisement from a neighbor it will NEVER just relay it. (for one thing the multicast address used by OSPF for advertisements is a link local address which should never be forwarded) The router takes the information from the advertisement, puts it into its link state data base, and then generates a new advertisement reflecting the information.


I do not think that we have articulated it clearly yet, but it seems to me that this whole discussion is confusing the functionality of 2 protocols. There is TTL which is used by the IP protocol to minimize the impact of any packet that happens to get into a routing loop. And there is hop count which is used by some routing protocols to determine if something is so far away that it should no longer be advertised. These are 2 different functions in 2 different protocols and we should not treat them as if they were the same.


So the answer to the original question is that in OSPF hop count is unlimited. The delivery of data packets may be bounded by TTL but advertisement of destinations in OSPF is not limited at all by hop count.


HTH


Rick

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
royalblues Fri, 08/17/2007 - 10:02
User Badges:
  • Green, 3000 points or more

This is a good question.


According to me the unlimited hop count limitation in OSPF would mean that the routes would still be installed in the RT eventhough the hop count values exceeded 255.

There is no TTL field in the OSPF packets


But the Packet would definitley be dropped at the device where the TTL has been decremented to 0


Somebody in this forum may have a better and valid answer though



Narayan


Richard Burts Fri, 08/17/2007 - 10:48
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

It seems to me that we can look at it in at least 2 ways to see the answer.

1) It is a matter of semantics: while the TTL may enforce a limit on how far a data packet may be forwarded before it is dropped, the drop is not done by the routing protocol. Also since there is not anything in the protocol specification that identifies hop count as a limiting factor potentially the protocol will accept and advertise routes with any number of hops.

2) As Narayan points out, there is no field for hop count in the OSPF advertisement. So when OSPF receives an advertisement there is not any way at that point to know exactly how many hops this destination is.


HTH


Rick

mohammedmahmoud Fri, 08/17/2007 - 11:02
User Badges:
  • Green, 3000 points or more

Hi,


Rick, please correct me if i am wrong, the reason is simply because OSPF uses its own IP protocol (number 89) which has no TTL in the packet structure, and thus hops won't be detected.


BR,

Mohammed Mahmoud.

Richard Burts Fri, 08/17/2007 - 11:29
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Mohammed


I think we need to be very careful about saying that there is no TTL in the packet structure. In fact there is a TTL in the IP header of the OSPF packet. There is a TTL in the IP header of every IP packet.


Part of the point is that there is nothing in the specification of OSPF that says that OSPF should care about the TTL or about hop count.


Also since an OSPF advertisement is never forwarded off of the local segment, the TTL of the OSPF packet tells nothing about the hop count of the route being advertised.


HTH


Rick

mohammedmahmoud Fri, 08/17/2007 - 11:45
User Badges:
  • Green, 3000 points or more

Rick,


Ok, the point is, if the TTL works normally in the OSPF header, then the router not the OSPF process is going to drop the packet even if the OSPF process doesn't care for the TTL value.


If we take this issue from another prospective, a router getting a certain LSA, will it originate it with a new packet or would it just relay it with its original received header info (after decreasing the TTL).


HTH,

Mohammed Mahmoud.

Correct Answer
Richard Burts Fri, 08/17/2007 - 12:02
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Mohammed


When an OSPF router receives an advertisement from a neighbor it will NEVER just relay it. (for one thing the multicast address used by OSPF for advertisements is a link local address which should never be forwarded) The router takes the information from the advertisement, puts it into its link state data base, and then generates a new advertisement reflecting the information.


I do not think that we have articulated it clearly yet, but it seems to me that this whole discussion is confusing the functionality of 2 protocols. There is TTL which is used by the IP protocol to minimize the impact of any packet that happens to get into a routing loop. And there is hop count which is used by some routing protocols to determine if something is so far away that it should no longer be advertised. These are 2 different functions in 2 different protocols and we should not treat them as if they were the same.


So the answer to the original question is that in OSPF hop count is unlimited. The delivery of data packets may be bounded by TTL but advertisement of destinations in OSPF is not limited at all by hop count.


HTH


Rick

mohammedmahmoud Fri, 08/17/2007 - 12:21
User Badges:
  • Green, 3000 points or more

Rick,


Perfectly formalized.


BR,

Mohammed Mahmoud.

rossua994 Fri, 08/17/2007 - 14:08
User Badges:

Thanks for all replies. The final conclusion that OSPF has no hop count limitation is in keeping with the answer expected in the practice test question. Some routing protocols DO have hop count limits, namely RIP has a limit of 15, and IGRP has a limit of 100 by default (configurable up to 255).


Hop count limitations also exist in general owing to the TTL field in an IP datagram, but this is not due to the routing protocol.


Its a subtle distinction but I now see where they are coming from. Such subtle questions are typical in exams.



Richard Burts Sat, 08/18/2007 - 17:03
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Ross


Your summary of the discussion about hop count in routing protocols (and of TTL) is quite correct.


I think that your comment about subtle distinctions and their importance is Cisco certification exams is quite insightful. I hope that many participants in the forum will read and remember your comment.


HTH


Rick

rossua994 Mon, 08/20/2007 - 03:14
User Badges:

Thanks for your comment Rick. I took CompTIA A+ and N+ exams last year, and I note that these also include this type of question. Maybe its a general feature in certification exams.

Actions

This Discussion