Computer Networks · M2 · read
Routing, forwarding, distance and next hop
Routing: build the shortest path one step at a time
Unit 4 · shortest paths and routing tables
Definition. Routing discovers or computes paths through a network; forwarding uses a table to send an individual packet toward the selected next hop.
Simple meaning. Routing table banata hai; forwarding us table ko use karta hai.
Understand it step by step
- A route contains a destination prefix and an outgoing interface or next hop. A metric measures the desirability/cost of that route.
- A path is a sequence of permitted edges. Its weighted cost is the sum of the edge weights, not merely the number of vertices drawn.
- A shortest-path algorithm maintains a tentative distance from the source to each vertex. Start the source at 0 and all others at ∞.
- A predecessor records the vertex just before a destination on the chosen path. Trace predecessors backward, then reverse the list to obtain the path in forward order.
- A next hop is the first router after the source on that path. It is different from a final destination’s immediate predecessor.
Practice question. Differentiate routing and forwarding, with an example. [3 practice marks]
Answer
Routing determines suitable network paths and produces routing/forwarding information. Forwarding applies that information to a particular packet. If A has learned that network X is reached through B, computing that choice is routing and sending a packet to B is forwarding.
Yaad rakho: Predecessor = pichhla node; next hop = source ke baad pehla node.