Recent from talks
Nothing was collected or created yet.
Hop (networking)
View on Wikipedia
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]- ^ a b c d e Comer, Douglas (2014). Internetworking with TCP/IP. Volume one (Sixth ed.). Harlow. p. 294 (footnotes). ISBN 978-1-292-05623-4. OCLC 971612806.
{{cite book}}: CS1 maint: location missing publisher (link) - ^ Comer, Douglas (2014). Internetworking with TCP/IP (Sixth ed.). Upper Saddle River, New Jersey. pp. 293, 655. ISBN 978-0-13-608530-0. OCLC 855671923.
{{cite book}}: CS1 maint: location missing publisher (link) - ^ Comer, Douglas (2014). Internetworking with TCP/IP. Volume one (Sixth ed.). Harlow. p. 466. ISBN 978-1-292-05623-4. OCLC 971612806.
{{cite book}}: CS1 maint: location missing publisher (link) - ^ RFC 1058, Routing Information Protocol, C. Hendrik, The Internet Society (June 1988)
- ^ "CCNP Practical Studies: Layer 3 Switching > Introduction to Layer 3 Switching". www.ciscopress.com. Retrieved 2019-07-05.
- ^ Salter, Jim (2016-04-17). "The Ars guide to building a Linux router from scratch". Ars Technica. Retrieved 2024-12-18.
- ^ Beijnum, Iljitsch van (2008-01-17). "Internet routing shows growing pains?again". Ars Technica. Retrieved 2024-12-18.
- ^ "2.2.10. Disable Source Routing | Red Hat Product Documentation". docs.redhat.com. Retrieved 2024-12-18.
Hop (networking)
View on GrokipediaBasic 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.[7] This process occurs at the network layer, where each device forwards the packet based on routing information without regard to the underlying physical medium.[7] 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.[7] 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.[6] 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.[8] 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.[7] The cumulative hops along an entire path form the hop count, a fundamental metric in routing protocols.[7]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 routing table 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 Time to Live (TTL) field to prevent indefinite looping.[9] 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.[9] Unlike end-to-end routing, which relies on source and destination hosts to manage the complete path, hop-by-hop routing decentralizes control by allowing each intermediate node to make autonomous forwarding decisions based on local routing information. This approach promotes scalability in large, distributed networks like the Internet, as it avoids the need for centralized path computation while enabling adaptation to dynamic topology changes.[10] For instance, in IP networks, each hop uses the destination IP address 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.[11]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 data 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 network topology. 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 network segment results in a hop count of zero, as no intermediate routing 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 diameter—the maximum path length between any two nodes—and as a rough approximation for latency, since each hop introduces processing 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 reachability or estimating propagation 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 wireless segments, resulting in higher delays and throughput constraints. In certain routing protocols, hop count functions as the primary metric for path selection. The Routing Information Protocol (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 routing paths. This mechanism ensures that packets do not circulate endlessly in the event of routing errors or misconfigurations, thereby protecting network resources.[12] 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.[12][13] In IPv4, this is implemented via the 8-bit Time to Live (TTL) field in the IP header, 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 Routing Information Protocol (RIP), the hop limit is strictly capped at 15, with 16 designated as infinity to indicate unreachability, limiting the protocol's applicability to smaller networks.[12][14][15] Introduced in the original Internet Protocol specification in 1981, the hop limit addressed the risks of routing loops in early dynamic internetworks, where static configurations could lead to perpetual packet circulation without such safeguards.[12] 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.[13]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 IP address prefix. This forwarding decision is made by consulting the router's forwarding information base (FIB), which maps destination prefixes to the corresponding next hop IP address or outgoing interface. If the destination is on a directly connected network, the next hop is the destination IP address itself; otherwise, it is the IP address of an intermediate router on a directly connected link.[16] 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 longest prefix match, Type of Service (TOS) if applicable, lowest metric, and administrative preferences when multiple routes exist.[17] Next hops can be established through static or dynamic routing. Static routes manually configure next hops by administrators, specifying the destination prefix and explicit next hop (e.g., via a particular IP address), which remain fixed until reconfigured and are stored in non-volatile memory. In contrast, dynamic protocols like OSPF and BGP compute next hops algorithmically based on network topology advertisements; OSPF, for instance, uses link-state information to calculate shortest paths and populate next hops in the routing table, 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.[18] This next-hop mechanism enables scalability in hierarchical routing by allowing each router to forward packets independently without maintaining complete end-to-end path information, distributing state across the network and minimizing per-router storage and processing requirements. In large-scale systems, this hop-by-hop approach supports efficient information hiding, where routers only need local topology 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 routing 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 topology information exchanged among routers to select paths that balance factors such as distance, cost, and reliability, ensuring efficient packet forwarding across networks.[19][15][20] Distance-vector routing protocols, such as the Routing Information Protocol (RIP), 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 RIP, 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 to a destination is updated via , where is the distance reported by neighbor .[15] Link-state protocols like Open Shortest Path First (OSPF) employ Dijkstra's shortest-path algorithm to construct a complete topology 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.[19] Path-vector protocols, exemplified by Border Gateway Protocol (BGP), 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.[20] 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, Dijkstra's algorithm 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 total cost, the protocol supports equal-cost multipath but does not explicitly use hop count as a tiebreaker.[19] Similarly, RIP's hop-based metric ensures paths are chosen for minimal router traversals, capping feasible paths at 15 hops to bound network diameter.[15] 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 inflation.[15] In link-state protocols, while hop count is not a direct limit, the global topology view from link-state floods enables rapid recomputation via Dijkstra's, though excessive hops in large networks can increase computational overhead.[19] For BGP, AS_PATH loop detection (via prepending the local AS) inherently limits path instability by discarding cyclic routes during selection.[20] As an illustrative example, in RIP, 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 to propagate minimal-hop routes while respecting the 16-hop infinity threshold.[15]Diagnostics and Analysis
Traceroute
Traceroute 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.[21][22] 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.[23][24] The tool operates by exploiting the Time-to-Live (TTL) field in the IP header, which functions as a hop limit to prevent infinite loops.[25] 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).[26] 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 IP address and the first 64 bits of the original packet for identification.[13] Upon reaching the destination, an ICMP Echo Reply (or UDP/TCP response, depending on variant) confirms arrival.[27] This process reveals the sequential hops without altering normal routing. 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.[28][29] TCP-based variants send SYN packets to a specified port, useful for traversing firewalls that block UDP or ICMP.[28] For IPv6 networks, tools like traceroute6 employ similar TTL mechanics with ICMPv6 messages.[30] 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.[31] Output from a traceroute command, such astraceroute example.com, lists hops in order, showing the hop number, resolved hostname or IP address, and three RTT values in milliseconds for redundancy.[22][32] 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)
