What is the Next-Hop in Networking?

The next-hop is a routing term used for the following neighboring router a data packet can go through. The next hop is along with the series of routers connected simultaneously in a network and is the next possible destination for a data packet.

Each router maintains its routing table with a next-hop address, calculated based on the routing protocol and associated metric. The routers are the most critical network devices among many devices because routers manage the information about their surrounding routers and their related network and subnetwork.

To maintain information about other routers and networks in its routing table, the lowest metric in the routing table is known as the next-hop or the next optimal router. When a packet passes a router, the hop count increases by one.

For example, if a destination is 10 hops away from the source, the packet has to pass 10 different routers to reach it. Also, for every router, the next router connected to it with the best metric will be placed as the next hop in its routing table. Examine the following topology and then examine the routing table in Figures 2,3, and 4 there routing tables.

Next-Hop

In this example, the three figures below display Router1, Router2, and Router3 routing tables. Each router has entries for its directly connected networks and their local addresses.

Each router does not know about any network beyond its directly connected interfaces. For example, Router0 does not know networks:

  •         172.16.0.0/30 – Network Between Router1 and Router2
  •         168.20.0/24 – Local Network for Router1
  •         168.30.0/24 – Local Network for Router2

Figure 5 displays a ping result from Router0 to Router1 using IP address 10.10.10.2; you can see that the ping is successful because network 10.0.0.0 is available in the routing table as a directly connected router.

Figure 6 displays a ping result from Router0 to IP addresses 172.16.0.2, the IP address of the same Router1, but the result is not successful, and 192.168.20.1, also the IP address of the same Router, but the result is not successful.

This is because Router0 does not have an entry in its routing table for Router1’s above networks. So, Router0 doesn’t know where to send the ping request, resulting in an unsuccessful ping.

We can identify the next-hop router by IP address and exit interface, or maybe we can use both. The following are the three types of routing table entries for the router’s next hop.

Next-hop route – We specify only the IP address of the next-hop router in the routing table.

Directly connected static route – We only specify the router exit interface connected to the next-hop router.

Fully specified static route – We specify the next-hop IP address and exit interface.