
In wired
computer networking
A computer network is a collection of communicating computers and other devices, such as printers and smart phones. In order to communicate, the computers and devices must be connected by wired media like copper cables, optical fibers, or b ...
a hop occurs when a packet is passed from one
network segment
A network segment is a portion of a computer network. The nature and extent of a segment depends on the nature of the network and the device or devices used to interconnect end stations.
Ethernet
According to the defining IEEE 802.3 standards ...
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
).
Since
store and forward
Store and forward is a telecommunications technique in which information is sent to an intermediate station where it is kept and sent at a later time to the final destination or to another intermediate station. The intermediate station, or node in ...
and other
latencies are incurred through each hop, a large number of hops between source and destination implies lower
real-time performance.
Hop count
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
). Thus, hop count is a rough measure of distance between two hosts. For a routing protocol using 1-origin hop counts
(such as RIP), a hop count of ''n'' means that ''n'' networks separate the source host from the destination host.
Other protocols such as DHCP use the term "hop" to refer to the number of times a message has been forwarded.
On a
layer 3 network such as
Internet Protocol
The Internet Protocol (IP) is the network layer communications protocol in the Internet protocol suite for relaying datagrams across network boundaries. Its routing function enables internetworking, and essentially establishes the Internet.
IP ...
(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
In kinematics, the speed (commonly referred to as ''v'') of an object is the magnitude of the change of its position over time or the magnitude of the change of its position per unit of time; it is thus a non-negative scalar quantity. Intro ...
, load, reliability, or latency of any particular hop, but merely the total count. Nevertheless, some
routing protocol
A routing protocol specifies how routers communicate with each other to distribute information that enables them to select paths between nodes on a computer network. Routers perform the traffic directing functions on the Internet; data packet ...
s, such as
Routing Information Protocol
The Routing Information Protocol (RIP) is one of the oldest distance-vector routing protocols which employs the hop count as a routing metric. RIP prevents routing loops by implementing a limit on the number of hops allowed in a path from so ...
(RIP), use hop count as their sole
metric
Metric or metrical may refer to:
Measuring
* Metric system, an internationally adopted decimal system of measurement
* An adjective indicating relation to measurement in general, or a noun describing a specific type of measurement
Mathematics
...
.
Each time a router receives a packet, it modifies the packet, decrementing the
time to live
Time to live (TTL) or hop limit is a mechanism which limits the lifespan or lifetime of data in a computer or network. TTL may be implemented as a counter (digital), counter or timestamp attached to or embedded in the data. Once the prescribed ev ...
(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
Routing is the process of selecting a path for traffic in a Network theory, network or between or across multiple networks. Broadly, routing is performed in many types of networks, including circuit-switched networks, such as the public switched ...
errors. Routers are capable of managing hop counts, but other types of network devices (e.g.
Ethernet hub
An Ethernet hub, active hub, network hub, repeater hub, multiport repeater, or simply hub is a network hardware device for connecting multiple Ethernet devices together and making them act as a single network segment. It has multiple input/out ...
s and
bridges
A bridge is a structure built to span a physical obstacle (such as a body of water, valley, road, or railway) without blocking the path underneath. It is constructed for the purpose of providing passage over the obstacle, which is usually somet ...
) are not.
Hop limit
Known as ''
time to live
Time to live (TTL) or hop limit is a mechanism which limits the lifespan or lifetime of data in a computer or network. TTL may be implemented as a counter (digital), counter or timestamp attached to or embedded in the data. Once the prescribed ev ...
'' (TTL) in
IPv4
Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. ...
, and ''
hop limit'' in
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
, 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
When configuring network devices the ''hop'' may refer to ''next hop''. 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
In computer networking, a routing table, or routing information base (RIB), is a data table stored in a router or a network host that lists the routes to particular network destinations, and in some cases, metrics (distances) associated wi ...
usually consists of a list of possible destination networks or
IP address
An Internet Protocol address (IP address) is a numerical label such as that is assigned to a device connected to a computer network that uses the Internet Protocol for communication. IP addresses serve two main functions: network interface i ...
es 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
A default gateway is the node in a computer network using the Internet protocol suite that serves as the forwarding host ( router) to other networks when no other route specification matches the destination IP address of a packet.
Role
A gatew ...
as the traffic can only ever reach the local network or be forwarded to the
internet service provider
An Internet service provider (ISP) is an organization that provides a myriad of services related to accessing, using, managing, or participating in the Internet. ISPs can be organized in various forms, such as commercial, community-owned, no ...
. Routers require multiple routes to be able to forward traffic between different networks. 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
The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a clie ...
or
routing protocol
A routing protocol specifies how routers communicate with each other to distribute information that enables them to select paths between nodes on a computer network. Routers perform the traffic directing functions on the Internet; data packet ...
s.
In
TCP/IP
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
networks using
Ethernet
Ethernet ( ) is a family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was commercially introduced in 1980 and first standardized in 198 ...
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
A MAC address (short for medium access control address or media access control address) is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment. This use i ...
. On
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
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
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
and
IPv4
Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. ...
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
Virtual private network (VPN) is a network architecture for virtually extending a private network (i.e. any computer network which is not the public Internet) across one or multiple other networks which are either untrusted (as they are not con ...
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
A tunnel is an underground or undersea passageway. It is dug through surrounding soil, earth or rock, or laid under water, and is usually completely enclosed except for the two portals common at each end, though there may be access and ve ...
.
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.
This allows for advanced
teletraffic engineering
Teletraffic engineering, or telecommunications traffic engineering is the application of transportation traffic engineering theory to telecommunications. Teletraffic engineers use their knowledge of statistics including queuing theory, the natu ...
used to improve
network delay
Network delay is a design and performance characteristic of a telecommunications network. It specifies the latency for a bit of data to travel across the network from one communication endpoint to another. It is typically measured in multiple ...
, decrease
network congestion
Network congestion in data networking and queueing theory is the reduced quality of service that occurs when a network node or link is carrying more data than it can handle. Typical effects include queueing delay, packet loss or the blocking of ...
, or meet other requirements.
Diagnostics
The
traceroute
In computing, traceroute and tracert are diagnostic command-line interface commands for displaying possible routes (paths) and transit delays of packets across an Internet Protocol (IP) network.
The command reports the round-trip times of ...
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
In a
wireless ad hoc network
A wireless ad hoc network (WANET) or mobile ad hoc network (MANET) is a decentralized type of wireless network. The network is ad hoc because it does not rely on a pre-existing infrastructure, such as routers or wireless access points. Instead, ...
, 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
*
Internet Control Message Protocol
The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating success or failure when com ...
*
Ping (networking utility)
ping is a computer network administration software utility used to test the reachability of a host (network), host on an Internet Protocol (IP) network. It is available in a wide range of operating systems including most embedded network admi ...
References
{{DEFAULTSORT:Hop (Networking)
Computer networking
Routing
de:Hop (Netzwerktechnologie)