Page 142 - DCAP406_DCAP_207_Computer Networks
P. 142
Unit 9: Network Layer
Notes
Task Differentiate between connection oriented and connectionless service.
9.2 Routing
The routing algorithm that runs on the network layer decides which output line an incoming
packet should be transmitted on. A routing table that is built in every router tells which outgoing
line should be used for each possible destination router. A router looks up the outgoing
communication line to use in the routing table after receiving a datagram that contains the
destination address. Thereafter, it sends the packet on its way to the destination. Thus, the major
role of the network layer is to routing the packets from source to destination machine. The
algorithms that enable to choose the possible routes and the data structures that they use are a
major area of routing algorithm. The desirable properties of the routing algorithms are
correctness, simplicity, robustness, stability, fairness and optimality.
Figure 9.1: Routing Table
Hence, the routing algorithm is defined as the part of the network layer software deciding
which output line an incoming packet should be transmitted on. It all depends upon if the subnet
uses datagrams internally, this decision is made a new for every arriving data packet since the
best route may have changed since last time. If the subnet using virtual circuits such decision is
made ones per session.
Figure 9.1 shows the routing table for router A (address 138.25.10.1). This table lists destination
addresses for each local network, and not for each destination host. This table also includes as
the next hop (the address of next router) to which the packet must be transferred. If no hops are
included, this means that the destination network is directly connected to the router.
When router A receives a packet, it tracks this table to perform routing. For example, if the
packets addressed to the host of network 138.25.40.0, then router A sends the packet to router C
(138.25.30.1). Router C has a similar routing table so that it can perform routing.
Routing plays a major role in the forwarding function.
Next hop routing: A router is used to determine the route of datagrams based on its internal
routing table. The table contains entries indicating to which router datagrams should be transmitted
to reach a particular network. The router receives datagrams from different sources. The role of the
router to check the IP address of the destination and determine what the next hop would be much
LOVELY PROFESSIONAL UNIVERSITY 135