Page Content

Tutorials

What is a Hop Count in Networking and Why Hop Count Matters

What is a Hop count

A data packet’s hop count is the number of routers or gateways it passes through on its destination in a network. Each router hop adds one to the count, which is used by protocols like RIP to find the shortest route (fewest hops), but it can also miss faster paths with more hops. The Time-To-Live (TTL) field in IP packets, which decreases with each hop and eliminates infinite loops by rejecting packets when it hits zero, is likewise connected to it.

Core Mechanics and Calculation

Each router that a data packet passes through during network traffic adds one hop to the total number of hops. A routing protocol’s unique usage will determine whether the initial hop is regarded as hop 0 or hop 1.

The next hop, which is the router or interface that the present device transfers the packet to, is a related idea. Rather than maintaining the whole path, routers can drastically reduce the size of their routing tables by merely storing the next-hop information.

Ex: If a packet goes from your computer to Router A, then Router B, then Router C, and finally to the server:

Source -> Router A (1 hop)

Router A -> Router B (2 hops)

Router B -> Router C (3 hops)

Router C -> Server (4 hops)

The hop count would be 4 (or 3 if counting only intermediate routers, depending on the protocol’s definition). 

You can also read Advantages, Disadvantages Of Routers & How Do Routers Work

Role in Routing Protocols

A fundamental distance metric called hop count is employed by different routing protocols to identify the most effective route.

  1. RIP (Routing Information Protocol): Hop count is the only measure used by the Routing Information Protocol (RIP). It chooses the route with the lowest count in order to determine the optimal path. With a maximum hop count of 15 a count of 16 is deemed “infinity” or unreachable RIP is intended for smaller networks.
  2. EIGRP: It uses a default limit of 100 hops (configurable up to 255) to define network borders, but it uses bandwidth and latency for its main computations.
  3. Novell IPX RIP: This primarily measures “ticks” (time), with hop count serving as a tiebreaker.
  4. IPv4 and IPv6: The maximum number of hops that IPv4 and IPv6 protocols can make is 255.

Why Hop Count Matters

  • Path Selection: To choose the most effective path, several routing systems, such as RIP (Routing Information Protocol), employ hop count as their main measure. In general, the road with the fewest hops is the one that is favored.
  • Avoiding Loops: A packet has a limit to keep it from going indefinitely if it becomes trapped in a loop.
  • Time to Live (TTL): The IP header’s TTL field contains a value that drops by at least one with each hop. The router discards the packet and notifies the sender of the error when the TTL drops to zero.

Loop Prevention: TTL and Hop Limit

A field to limit the lifespan of packets is included in IP headers to stop them from cycling indefinitely because of routing errors:

  1. Time to Live (TTL): Every router in IPv4 decrements this field by one from its initial value, which may be 64, 128, or 255.
  2. Hop Limit: This value serves the same purpose as the TTL field in IPv6. An ICMP error message is usually returned to the packet is deleted if either value drops to zero.

Impact on Network Performance

Despite being a straightforward measure, hop count is not necessarily a reliable gauge of quality.

  • Latency: Because of “store and forward” processing, each hop adds a little delay. As a result, a high hop count frequently indicates poorer real-time performance.
  • Limitations: Hop count does not account for reliability, load, or link speed. The two-hop path over a slow 56k dial-up connection, for instance, would be theoretically “shorter” than the three-hop path over 10Gbps fiber, even if it is far slower.

You can also read What Is A Metropolitan Area Network Architecture & Benefits

Diagnostic Tools

SystemCommandPurpose
Windowstracert google.comLists every router and the hop count to reach Google.
Mac/Linuxtraceroute google.comProvides the same path analysis for Unix-based systems.

Analogy

An analogy would be to compare a hop count to the bus transfer cap on a ticket. Your ticket will be deemed invalid and your trip will have to be terminated if it permits three transfers (hops) to get you to your destination and you have not arrived after the third. By lowering its TTL, each router “punches” the packet’s header until the trip is either finished or the limit is reached, much like a bus driver could do with your ticket in each transfer.

Agarapu Geetha
Agarapu Geetha
My name is Agarapu Geetha, a B.Com graduate with a strong passion for technology and innovation. I work as a content writer at Govindhtech, where I dedicate myself to exploring and publishing the latest updates in the world of tech.
Index