Hubbry Logo
Hop (networking)Hop (networking)Main
Open search
Hop (networking)
Community hub
Hop (networking)
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Hop (networking)
Hop (networking)
from Wikipedia
An illustration of hops in a wired network (assuming a 0-origin hop count [1]). The hop count between the computers in this case is 2.

In wired computer networking a hop occurs when a packet is passed from one network segment to the next. Data packets pass through routers as they travel between source and destination. The hop count refers to the number of network devices through which data passes from source to destination (depending on routing protocol, this may include the source/destination, that is, the first hop is counted as hop 0 or hop 1[1]).

Since store and forward and other latencies are incurred through each hop, a large number of hops between source and destination implies lower real-time performance.

Hop count

[edit]

In wired networks, the hop count refers to the number of networks or network devices through which data passes between source and destination (depending on routing protocol, this may include the source/destination, that is, the first hop is counted as hop 0 or hop 1[1]). Thus, hop count is a rough measure of distance between two hosts. For a routing protocol using 1-origin hop counts[1] (such as RIP), a hop count of n means that n networks separate the source host from the destination host.[1][2] Other protocols such as DHCP use the term "hop" to refer to the number of times a message has been forwarded.[3]

On a layer 3 network such as Internet Protocol (IP), each router along the data path constitutes a hop. By itself, this metric is, however, not useful for determining the optimum network path, as it does not take into consideration the speed, load, reliability, or latency of any particular hop, but merely the total count. Nevertheless, some routing protocols, such as Routing Information Protocol (RIP), use hop count as their sole metric.[4]

Each time a router receives a packet, it modifies the packet, decrementing the time to live (TTL). The router discards any packets received with a zero TTL value. This prevents packets from endlessly bouncing around the network in the event of routing errors. Routers are capable of managing hop counts, but other types of network devices (e.g. Ethernet hubs and bridges) are not.

Hop limit

[edit]

Known as time to live (TTL) in IPv4, and hop limit in IPv6, this field specifies a limit on the number of hops a packet is allowed before being discarded. Routers modify IP packets as they are forwarded, decrementing the respective TTL or hop limit fields. Routers do not forward packets with a resultant field of 0 or less. This prevents packets from following a loop forever.

Next hop

[edit]

When configuring network devices the hop may refer to next hop.[5] When a hop forwards network traffic the next hop is what the local hop considers to be the next element towards the final destination. A routing table usually consists of a list of possible destination networks or IP addresses for which the next hop is known. By only storing next-hop information, next-hop routing or next-hop forwarding reduces the size of routing tables. A given gateway only knows one step along the path, not the complete path to a destination. If no next hop is known a hop may silently discard a packet or return an error depending on the type of network. Devices in consumer networks are often only provided with routes for the local network as well as a default gateway as the traffic can only ever reach the local network or be forwarded to the internet service provider.[6] Routers require multiple routes to be able to forward traffic between different networks.[7] In practice routes are configured either implicitly with address assignment by means of a netmask, by manual assignment using tools such as route, or dynamically using configuration protocols like DHCP or routing protocols.

In TCP/IP networks using Ethernet as the link layer the destination is always an IP address, however the next hop is not technically required to be of the same address family. As the packet needs to be forwarded on the link layer the next hop needs only to resolve to a link layer address such as a MAC address. On Linux for instance the next hop is required to be either an IP address or an interface. The address families of the destination address and the next hop need not match, therefore it is possible to forward IPv4 traffic on an IPv6 network and vice versa. If no address is provided the destination is assumed to be present on the local link, otherwise the next hop is used. Either address is then passed to NDP or ARP for IPv6 and IPv4 respectively to be resolved to the link layer address required to pass the packet along on the network stack. In other scenarios link layer resolution may require different methods such as a virtual private network which needs to determine the peer to send the packet to. What is common to forwarding is that the next hop needs to be logically connected to the current hop, thereby building an uninterrupted chain between source and destination. A logical connection does not necessitate a physical connection as the packet may be passed on to a virtual tunnel.[citation needed]

Source routing describes networks in which data is encoded in the packet that allows a hop (such as the source of the packet) to influence routing decisions on intermediary hops.[8] This allows for advanced teletraffic engineering used to improve network delay, decrease network congestion, or meet other requirements.

Diagnostics

[edit]

The traceroute command can be used to measure the number of router hops from one host to another. Hop counts are often useful to find faults in a network or to discover if routing is indeed correct.

Wireless ad hoc networking

[edit]

In a wireless ad hoc network, commonly, every participating node is also acting as a router. This means that the terms "hop" and "hop count" are often the subject of confusion. Often, the sending node is simply counted as the first hop, thus yielding the same number for "hops" for both interpretations of "hop" as "traversed routers" and "jumps from node to node". For example, RFC 6130 defines a "1-hop neighbor" as any other node that is directly reachable via the wireless interface.

See also

[edit]

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
In computer networking, a hop refers to the transmission of a data packet from one to the next, typically across an intermediate device such as a router or gateway, as it travels from the source to the destination. The hop count is the total number of such intermediate devices a packet encounters along its path, serving as a basic measure of the route's length in terms of steps rather than physical or latency. This concept is fundamental to understanding packet efficiency and . Hop count plays a critical role in routing protocols by providing a simple metric for path selection and loop prevention. For instance, in the (RIP), the hop count determines the optimal route, with each router incrementing the count by one and preferring paths with the lowest value; however, RIP imposes a maximum of 15 hops, beyond which a destination is deemed unreachable to avoid infinite loops. The Internet Protocol (IP) further enforces this by using the (TTL) field in IPv4 packet headers or the equivalent Hop Limit field in , which decrements by one per hop and discards the packet if it reaches zero, preventing endless circulation. While effective for small networks, hop count has limitations as a metric, as it ignores factors like bandwidth, delay, or congestion, prompting the adoption of more advanced protocols such as OSPF, which use link-state information for comprehensive path evaluation. Network administrators and tools rely on hop count for diagnostics and performance analysis. The traceroute utility (or tracert on Windows) measures hop count by sending packets with successively increasing TTL values, causing each intermediate router to respond with an ICMP "Time Exceeded" message, thereby mapping the exact path and identifying potential bottlenecks or failures. Typical paths range from 10 to 20 hops for most connections as of the late , though this varies by and ; excessive hops can indicate inefficient or issues like tunneling. Overall, hops and hop counts remain essential for maintaining reliable data transmission in both local and global networks.

Basic Concepts

Definition

In computer networking, a hop refers to the transmission of a data packet from one network device, such as a router or gateway, to the next intermediate device in the path toward its destination. This process occurs at the network layer, where each device forwards the packet based on routing information without regard to the underlying physical medium. Each hop represents a single traversal of a link in the network topology, marking a discrete step in the packet's journey across interconnected devices. Importantly, a hop is a logical unit of distance, independent of geographic or physical separation between devices; for instance, two closely located routers may still count as one hop, while a long-distance satellite link might represent the same. The term "hop" was used in early packet-switched networks like the ARPANET in the 1970s to describe the sequential passage of data packets between nodes in a distributed system. As an illustrative example, consider a basic network setup in which data travels from host A directly to a single intervening router before reaching host B; this path involves exactly one hop. The cumulative hops along an entire path form the hop count, a fundamental metric in routing protocols.

Role in Routing

In hop-by-hop routing, each intermediate router independently processes incoming packets by examining the packet header to determine the appropriate outgoing interface for forwarding. The router consults its based on the destination address in the header, selects the next hop, and transmits the packet onward, typically decrementing a hop-related counter such as the (TTL) field to prevent indefinite looping. This sequential decision-making occurs at every router along the path, ensuring packets traverse multiple network segments without requiring global coordination among all devices. This mechanism is integral to store-and-forward networking, where each router fully receives, buffers, and validates the entire packet—including error checking—before retransmitting it to the next hop. By handling packets in this manner, routers can manage variable link speeds, perform fragmentation if necessary, and isolate faults at individual nodes, enhancing overall network reliability in packet-switched environments. Unlike end-to-end , which relies on source and destination hosts to manage the complete path, hop-by-hop decentralizes control by allowing each intermediate node to make autonomous forwarding decisions based on local information. This approach promotes scalability in large, distributed networks like the , as it avoids the need for centralized path computation while enabling adaptation to dynamic topology changes. For instance, in IP networks, each hop uses the destination from the packet header to perform a longest-prefix match in the router's forwarding table, directing the packet to the immediate next hop without knowledge of the full end-to-end route.

Metrics and Limits

Hop Count

In computer networking, the hop count represents the total number of intermediate devices, such as routers or gateways, that a packet traverses from its source to its destination. This metric quantifies the path length in terms of the number of routing hops, providing a straightforward indicator of the route's complexity within a . The hop count is calculated by counting each router or gateway the packet passes through, excluding the originating source and the final destination host. For instance, a direct connection between two devices on the same local results in a hop count of zero, as no intermediate devices are involved. In contrast, a packet traveling across multiple interconnected networks might accumulate a hop count of several units, each increment corresponding to a forwarding decision at an intermediate node. Hop count serves as a fundamental measure for assessing network —the maximum path length between any two nodes—and as a rough for latency, since each hop introduces and transmission delays, typically ranging from 1 to 10 milliseconds depending on the device's capabilities and link speeds. It is particularly valued in scenarios requiring quick path evaluations, such as monitoring overall network or estimating times in large-scale infrastructures. Despite its simplicity, hop count has notable limitations, as it ignores critical factors like link bandwidth, congestion levels, or physical distances between nodes. For example, two paths with identical hop counts might exhibit vastly different performance: one could traverse high-capacity fiber links for low latency, while the other routes through slower segments, resulting in higher delays and throughput constraints. In certain routing protocols, hop count functions as the primary metric for path selection. The (RIP), for instance, relies exclusively on hop count to determine the shortest path, advertising routes with increments up to a maximum of 15 hops; beyond this threshold, a route is deemed unreachable to mitigate infinite loops in the network. This approach, while easy to implement, underscores hop count's role in maintaining routing stability, though it often necessitates complementary metrics in modern protocols for more optimal decisions.

Hop Limit

In networking, the hop limit refers to a predefined maximum number of hops a packet can traverse before being discarded, primarily to prevent infinite loops in paths. This mechanism ensures that packets do not circulate endlessly in the event of errors or misconfigurations, thereby protecting network resources. The core mechanism involves embedding a counter in the packet header, which is decremented by one at each intermediate router or hop. When the counter reaches zero, the packet is dropped, and an ICMP Time Exceeded message (Type 11, Code 0) is typically sent back to the source to notify it of the expiration. This process, originally conceptualized as a time-based limit in seconds but implemented as a hop count in practice, applies across various protocols to enforce bounded forwarding. In IPv4, this is implemented via the 8-bit (TTL) field in the , where the source sets an initial value—commonly 64 or 128, though up to 255 is possible—and routers decrement it accordingly. IPv6 renames this to the Hop Limit field with identical 8-bit semantics and behavior, explicitly framing it as a hop counter rather than time to avoid ambiguity. In the (RIP), the hop limit is strictly capped at 15, with 16 designated as to indicate unreachability, limiting the protocol's applicability to smaller networks. Introduced in the original specification in 1981, the hop limit addressed the risks of loops in early dynamic internetworks, where static configurations could lead to perpetual packet circulation without such safeguards. When the hop limit is exhausted, the packet is discarded to halt further propagation, resulting in delivery failure at the destination but providing diagnostic value through the returned ICMP message, which can reveal loop conditions if expirations recur from the same router.

Routing Mechanisms

Next Hop

In IP networking, the next hop refers to the immediate neighboring router or directly connected interface to which an IP packet is forwarded from the current router, determined based on the packet's destination prefix. This forwarding decision is made by consulting the router's (FIB), which maps destination prefixes to the corresponding next hop or outgoing interface. If the destination is on a directly connected network, the next hop is the destination itself; otherwise, it is the of an intermediate router on a directly connected link. Routing table entries specify these next hops, often in the format "destination network via next-hop IP" or including the outgoing interface, such as "10.0.0.0/8 via 172.16.0.1 eth0." For example, in a forwarding table, packets destined for the 10.0.0.0/8 network might be directed to the next hop 172.16.0.1 on interface eth0, ensuring the packet is encapsulated and sent to the appropriate neighbor. The selection process applies pruning rules to the FIB, prioritizing the , (TOS) if applicable, lowest metric, and administrative preferences when multiple routes exist. Next hops can be established through static or . Static routes manually configure next hops by administrators, specifying the destination prefix and explicit next hop (e.g., via a particular ), which remain fixed until reconfigured and are stored in . In contrast, dynamic protocols like OSPF and BGP compute next hops algorithmically based on advertisements; OSPF, for instance, uses link-state information to calculate shortest paths and populate next hops in the , while BGP employs path attributes to select the best route and its associated next hop. Routers must support OSPF for dynamic interior routing and may use RIP or BGP for specific domains. This next-hop mechanism enables scalability in hierarchical by allowing each router to forward packets independently without maintaining complete end-to-end path , distributing state across the network and minimizing per-router storage and processing requirements. In large-scale systems, this hop-by-hop approach supports efficient , where routers only need local knowledge to select the next hop, facilitating growth without overwhelming individual devices.

Path Computation

Path computation in networking refers to the algorithmic processes used by protocols to determine multi-hop paths between network nodes, typically by minimizing a defined metric that may incorporate hop count either directly or indirectly. These algorithms evaluate information exchanged among routers to select paths that balance factors such as , , and reliability, ensuring efficient across networks. Distance-vector routing protocols, such as the (), compute paths using a distributed Bellman-Ford algorithm where each router maintains a vector of distances to destinations and updates them based on neighbor advertisements. In , hop count serves as the primary metric, with each link assigned a cost of 1, leading to the selection of paths with the fewest hops; the distance dd to a destination is updated via d=min(di+1)d = \min(d_i + 1), where did_i is the distance reported by neighbor ii. Link-state protocols like () employ Dijkstra's shortest-path algorithm to construct a complete map from link-state advertisements and compute the minimum-cost tree rooted at the local router, where link costs (often inversely proportional to bandwidth) indirectly reflect hop count when costs are uniform across links. Path-vector protocols, exemplified by (), select paths by evaluating attributes including the AS_PATH length, which counts the number of autonomous systems (AS hops) traversed; shorter AS_PATH lengths are preferred to minimize inter-domain transit and avoid loops, as a longer path indicates more AS traversals. Hop minimization is a core objective in many protocols, particularly through shortest-path algorithms that prioritize low-hop routes when metrics align with hop count. In OSPF, minimizes the cumulative link cost, which can effectively minimize hops if each link cost is set to 1, though administrators often tune costs for bandwidth optimization; in cases of equal , the protocol supports equal-cost multipath but does not explicitly use hop count as a tiebreaker. Similarly, RIP's hop-based metric ensures paths are chosen for minimal router traversals, capping feasible paths at 15 hops to bound network diameter. During network convergence—when topology changes trigger route recomputation—hop limits play a crucial role in detecting and mitigating unstable or looping paths. In distance-vector protocols like RIP, the hop limit of 15 prevents count-to-infinity problems by declaring routes with a metric of 16 as unreachable, allowing faster detection of failures and expediting convergence without indefinite metric . In link-state protocols, while hop count is not a direct limit, the global view from link-state floods enables rapid recomputation via Dijkstra's, though excessive hops in large networks can increase computational overhead. For BGP, AS_PATH loop detection (via prepending the local AS) inherently limits path instability by discarding cyclic routes during selection. As an illustrative example, in , a router receiving updates from multiple neighbors selects the path with the lowest hop count; if neighbor A reports 3 hops to a destination and neighbor B reports 2, the router adopts B's path and advertises 3 hops onward, using the update formula d=min(di+1)d = \min(d_i + 1) to propagate minimal-hop routes while respecting the 16-hop threshold.

Diagnostics and Analysis

is a command-line diagnostic utility that traces the route IP packets take across a network from source to destination, identifying each intermediate router (hop) and measuring round-trip times (RTTs) to assess path performance and locate potential issues. Developed by Van Jacobson in 1988 based on a suggestion from Steve Deering, it serves primarily for troubleshooting connectivity, latency, and routing problems by mapping the network path. The tool operates by exploiting the Time-to-Live (TTL) field in the , which functions as a hop limit to prevent infinite loops. It sends probe packets—typically three per hop—with an initial TTL of 1, incrementing by 1 for each subsequent set until reaching the destination or a predefined maximum (often 30 or 64). At each router, the TTL decrements by 1; when it hits zero, the router discards the packet and returns an ICMP Time Exceeded message (Type 11, Code 0) containing its and the first 64 bits of the original packet for identification. Upon reaching the destination, an ICMP Echo Reply (or UDP/TCP response, depending on variant) confirms arrival. This process reveals the sequential hops without altering normal . Variants adapt traceroute to different protocols and environments. The traditional Unix/Linux implementation uses UDP probes on high port numbers to minimize filtering, while the Windows equivalent, tracert, defaults to ICMP Echo Requests for broader compatibility. TCP-based variants send SYN packets to a specified port, useful for traversing firewalls that block UDP or ICMP. For IPv6 networks, tools like traceroute6 employ similar TTL mechanics with ICMPv6 messages. A 1993 experimental extension in RFC 1393 proposed an IP option for more efficient tracing with fewer packets and additional details like MTU, though it saw limited adoption compared to the original method. Output from a command, such as traceroute example.com, lists in order, showing the hop number, resolved or , and three RTT values in milliseconds for redundancy. A typical result might appear as:

1 192.168.1.1 (router.local) 1.234 ms 1.123 ms 1.456 ms 2 10.0.0.1 (isp-gateway) 5.678 ms 5.567 ms 5.789 ms 3 * * * (no response)

1 192.168.1.1 (router.local) 1.234 ms 1.123 ms 1.456 ms 2 10.0.0.1 (isp-gateway) 5.678 ms 5.567 ms 5.789 ms 3 * * * (no response)

Here, asterisks denote timeouts or blocked responses at unresponsive hops, often due to or configuration. Paths commonly span 5 to 15 in global networks, varying by and . Despite its utility, traceroute has limitations that can hinder accurate path mapping. It traces only the forward route, so asymmetric —where inbound and outbound paths differ—may not reflect return traffic behavior. or firewall policies blocking ICMP can result in incomplete outputs with multiple asterisks, obscuring hops without alternative responses. Additionally, load balancing across equal-cost paths or anonymization techniques may cause inconsistent or hidden router information across probe sets.

Hop-Based Troubleshooting

Hop-based troubleshooting involves leveraging hop count and path information to diagnose and resolve issues, focusing on the sequence of intermediate devices packets traverse. Common problems include high hop counts that introduce excessive latency, as each hop adds and transmission , potentially degrading application in scenarios requiring low response times. Asymmetric paths, where inbound and outbound follow different routes, can cause one-way or packet drops, particularly when stateful devices like firewalls expect symmetric flows and fail to recognize return packets. Black holes at specific hops occur when routers silently discard packets due to misconfigurations, policies, or , halting without generating error messages. Techniques for hop-based analysis include examining hop counts from path traces to detect suboptimal , where unexpectedly high counts (e.g., over 15-20 in typical enterprise paths) indicate inefficient paths or load-balancing issues. Network administrators can compare expected hop counts—based on known —against actual measurements to identify misconfigurations, such as incorrect default gateways or errors. Integration with tools enhances precision; for instance, using ping with a controlled TTL value allows testing to specific by setting the TTL to the target hop number, revealing failures at intermediate points without full path traversal. Log analysis of hop-related errors, such as frequent ICMP Time Exceeded messages, helps pinpoint issues like congestion or device overload at particular hops. Best practices emphasize proactive monitoring of hop limits in router and switch logs to detect indications of routing loops, where packets increment hop counts indefinitely until TTL expires, as seen in protocols like that cap at 15 hops to mitigate this. For example, to diagnose packet loss at hop 3, administrators perform incremental TTL pings starting from TTL=1, increasing until responses cease, isolating the problematic router for further inspection like interface checks or ACL reviews. serves as a primary tool for initial hop data collection in these workflows. In advanced environments like (SDN), hop tracing tools enable detailed flow path verification, allowing controllers to install temporary rules for probe packets that reveal deviations or failures without disrupting production traffic.

Specialized Applications

Wired Networks

In wired networks, hop paths exhibit high predictability due to the structured topologies employed in enterprise local area networks (LANs) and (ISP) infrastructures, where end devices connect through fixed layers of switches and core routers arranged in hierarchical designs. This fixed architecture minimizes variability in routing decisions, as packets follow predefined paths via protocols like OSPF or static routes within a single autonomous system (AS), enabling consistent performance in environments such as networks. For instance, Cisco's LAN design guidelines emphasize layered switching to maintain stable hop sequences from access to distribution layers. Hop efficiency in wired setups is characterized by relatively low counts within local segments, often ranging from 3 to 5 hops in enterprise LANs, facilitated by layer-2 switches that forward frames without full overhead and layer-3 routers that aggregate traffic efficiently. At the wider scale, (BGP) introduces additional AS-level hops, with studies inferring an average path length of approximately 3.9 AS hops based on global analyses up to 2016, though full router-level paths can extend to 10-15 hops due to inter-domain . However, challenges arise from congestion at high-traffic bottleneck hops, where excessive packet queuing on core routers or links can degrade throughput, as seen in scenarios where demand exceeds link capacity in dense enterprise backbones. Fiber optic backbones exemplify wired efficiency by minimizing physical through long-haul transmission over single spanning hundreds of kilometers without intermediate , yet they often incorporate multiple logical at the IP layer for across provider edges. The evolution of hop management in wired networks traces from early Ethernet implementations using hubs, which operated in single broadcast domains with effectively zero , to modern multilayer switching and (MPLS), where label-based forwarding reduces per-hop processing by avoiding repeated IP lookups and enabling path aggregation. This shift, originating in the mid-1990s, has streamlined core network operations by decreasing the effective hop burden in large-scale infrastructures. Regarding metrics, wired hop counts demonstrate a stronger with latency compared to other mediums, as each hop introduces predictable and ; empirical measurements reveal a positive linear relationship between round-trip time (RTT) and hop count, with a of 0.16 and RTT modeled as approximately 648.7 + 1.148 × hops in tested wired paths. Hop count thus serves as a key metric for path optimization in wired environments, guiding latency-sensitive applications like VoIP in enterprise settings.

Wireless Ad Hoc Networks

Wireless ad hoc networks are self-configuring, decentralized systems of wireless nodes that operate without fixed , enabling devices to function both as hosts and routers to facilitate communication. These networks, commonly exemplified by Mobile Networks (MANETs), allow autonomous mobile devices to interconnect dynamically over bandwidth-constrained wireless links, forming temporary topologies as nodes move. In wireless ad hoc networks, data transmission relies on multi-hop relaying, where packets are forwarded hop-by-hop through intermediate neighboring nodes to reach destinations beyond direct radio range. Protocols such as the Ad hoc On-Demand Distance Vector (AODV) enable this by discovering multi-hop routes on-demand through route request broadcasts that propagate until they reach the target or an intermediate node with a known path. Each hop in these routes increments a hop count metric, which helps establish the shortest path in terms of node traversals while adapting to the network's fluid structure. Key challenges in these networks include variable hop counts arising from node mobility, where frequent link breaks due to movement can force rerouting and increase the effective number of hops required for delivery. Additionally, wireless interference from concurrent transmissions degrades hop reliability, leading to packet losses and retransmissions that exacerbate path instability in dense or contested environments. Practical applications of wireless ad hoc networks include tactical operations, where they support rapid deployment of communication among mobile units in the field without reliance on centralized bases. They are also vital in scenarios, enabling to establish resilient connectivity in areas where traditional infrastructure has failed. To mitigate excessive network overhead during route discovery, protocols like AODV incorporate hop limits, such as a time-to-live (TTL) value in route requests, which caps propagation and prevents broadcast flooding across the entire network. Regarding performance metrics, the energy cost per hop is notably higher in wireless ad hoc networks due to the need for nodes to transmit and receive at each point, rapidly depleting limited battery resources in mobile devices. Techniques like geographic address this by minimizing hops through position-based forwarding, where nodes select next-hop relays that make the most progress toward the destination's known coordinates, as demonstrated in protocols such as Greedy Perimeter Stateless (GPSR). Historically, wireless networks emerged in the 1990s alongside the development of standards, which introduced ad hoc mode to enable connections without access points, laying the foundation for infrastructure-free wireless communication. In these dynamic environments, next-hop selection occurs during route discovery to adapt to changing topologies.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.