Unit 4
Unit 4
ROUTING
Routing and protocols: Unicast routing - Distance Vector Routing - RIP - Link State
Routing – OSPF– Path-vector routing - BGP - Multicast Routing: DVMRP – PIM
Routing
A Router is a process of selecting path along which the data can be transferred from
source to the destination. Routing is performed by a special device known as a
router.
A Router works at the network layer in the OSI model and internet layer in TCP/IP
model
A router is a networking device that forwards the packet based on the information
available in the packet header and forwarding table.
The routing algorithms are used for routing the packets. The routing algorithm is
nothing but a software responsible for deciding the optimal path through which
packet can be transmitted.
The routing protocols use the metric to determine the best path for the packet
delivery. The metric is the standard of measurement such as hop count, bandwidth,
delay, current load on the path, etc. used by the routing algorithm to determine the
optimal path to the destination.
The routing algorithm initializes and maintains the routing table for the process
of path determination.
Hop count: Hop count is defined as a metric that specifies the number of passes
through internetworking devices such as a router, a packet must travel in a route to
move from source to the destination. If the routing protocol considers the hop as a
primary metric value, then the path with the least hop count will be considered as the
best path to move from source to the destination.
Delay: It is a time taken by the router to process, queue and transmit a datagram to
an interface. The protocols use this metric to determine the delay values for all the
links along the path end-to-end. The path having the lowest delay value will be
considered as the best path.
Bandwidth: The capacity of the link is known as a bandwidth of the link. The
bandwidth is measured in terms of bits per second. The link that has a higher transfer
rate like gigabit is preferred over the link that has the lower capacity like 56 kb. The
protocol will determine the bandwidth capacity for all the links along the path, and
the overall higher bandwidth will be considered as the best route.
Load: Load refers to the degree to which the network resource such as a router or
network link is busy. A Load can be calculated in a variety of ways such as CPU
utilization, packets processed per second. If the traffic increases, then the load value
will also be increased. The load value changes with respect to the change in the
traffic.
Reliability: Reliability is a metric factor may be composed of a fixed value. It
depends on the network links, and its value is measured dynamically. Some networks
go down more often than others. After network failure, some network links repaired
more easily than other network links. Any reliability factor can be considered for the
assignment of reliability ratings, which are generally numeric values assigned by the
system administrator.
Types of Routing
Static Routing
Default Routing
Dynamic Routing
Static Routing
For a large network, it becomes a very difficult task to add each route manually to the
routing table.
The system administrator should have a good knowledge of a topology as he has
to add each route manually.
Default Routing
Default Routing is a technique in which a router is configured to send all the packets
to the same hop device, and it doesn't matter whether it belongs to a particular
network or not. A Packet is transmitted to the device for which it is configured in
default routing.
Default Routing is used when networks deal with the single exit point.
It is also useful when the bulk of transmission networks have to transmit the data to
the same hp device.
When a specific route is mentioned in the routing table, the router will choose the
specific route rather than the default route. The default route is chosen only when a
specific route is not mentioned in the routing table.
Dynamic Routing
All the routers must have the same dynamic routing protocol in order to exchange the
routes.
If the router discovers any change in the condition or topology, then router
broadcast this information to all other routers.
It is easier to configure.
It is more effective in selecting the best route in response to the changes in the
condition or topology.
Unicast routing
Unicast – Unicast means the transmission from a single sender to a single receiver. It is
a point-to-point communication between sender and receiver. There are various unicast
protocols such as TCP, HTTP, etc.
The routing protocol is used to calculate the best route from source to destination based on
the distance or hops as its primary metric to define an optimal path. The distance vector refers
to the distance to the neighbor nodes, where routing defines the routes to the established
node.
The Distance Vector routing algorithm(DVR) shares the information of the routing table
with the other routers in the network and keeps the information up-to-date to select an
optimal path from source to destination.
Step-02:
Each router exchanges its distance vector with its neighboring routers.
Each router prepares a new routing table using the distance vectors it has obtained
from its neighbors.
This step is repeated for (n-2) times if there are n routers in the network.
After this, routing tables converge / become stable.
In the network shown below, there are three routers, A, B, and C, with the following weights
− AB =2, BC =3 and CA =5.
Step 1 − In this DVR network, each router shares its routing table with every neighbor.
For example, A will share its routing table with neighbors B and C and neighbors B and C
will share their routing table with A.
Form A A B C
A 0 2 3
B
C
Form B A B C
A
B 2 0 1
C
Form C A B C
A
B
C 3 1 0
Step 2 − If the path via a neighbor has a lower cost, then the router updates its local table to
forward packets to the neighbor. In this table, the router updates the lower cost for A and C
by updating the new weight from 4 to 3 in router A and from 4 to 3 in router C.
Form A A B C
A 0 2 3
B
C
Form B A B C
A
B 2 0 1
C
Form C A B C
A
B
C 3 1 0
Step 3 − The final updated routing table with lower cost distance vector routing protocol for all routers A, B,
Form AA
Router A B C
A 0 2 3
B 2 0 1
C 3 1 0
Form B A B C
Router B
A 0 2 3
B 2 0 1
C 3 1 0
Router C
Form C A B C
A 0 2 3
B 2 0 1
C 3 1 0
RIP Protocol
RIP stands for Routing Information Protocol. RIP is an intra-domain routing protocol used
within an autonomous system. Here, intra-domain means routing the packets in a defined
domain, for example, web browsing within an institutional area. To understand the RIP
protocol, our main focus is to know the structure of the packet, how many fields it contains,
and how these fields determine the routing table.
Before understanding the structure of the packet, we first look at the following points:
When the router sends the packet to the network segment, then it is counted as a single hop.
In the above figure, when the router 1 forwards the packet to the router 2 then it will count as
1 hop count. Similarly, when the router 2 forwards the packet to the router 3 then it will count
as 2 hop count, and when the router 3 forwards the packet to router 4, it will count as 3 hop
count. In the same way, RIP can support maximum upto 15 hops, which means that the 16
routers can be configured in a RIP.
Now, we look at the structure of the RIP message format. The message format is used to
share information among different routers. The RIP contains the following fields in a
message:
Command: It is an 8-bit field that is used for request or reply. The value of the request
is 1, and the value of the reply is 2.
Version: Here, version means that which version of the protocol we are
using. Suppose we are using the protocol of version1, then we put the 1 in
this field.
Reserved: This is a reserved field, so it is filled with zeroes.
Family: It is a 16-bit field. As we are using the TCP/IP family, so we put 2 value
in this field.
Network Address: It is defined as 14 bytes field. If we use the IPv4 version, then we
use 4 bytes, and the other 10 bytes are all zeroes.
Distance: The distance field specifies the hop count, i.e., the number of hops used to
reach the destination.
Link state routing has a different philosophy from that of distance vector routing. In link state
routing, if each node in the domain has the entire topology of the domain the list of nodes and
links, how they are connected including the type, cost (metric), and condition of the links (up
or down)-the node can use Dijkstra's algorithm to build a routing table.
The figure shows a simple domain with five nodes. Each node uses the same topology to
create a routing table, but the routing table for each node is unique because the calculations
are based on different interpretations of the topology. This is analogous to a city map. While
each person may have the same map, each needs to take a different route to reach her specific
destination
In link state routing, four sets of actions are required to ensure that each node has the routing
table showing the least-cost node to every other node.
a) Creation of the states of the links by each node, called the link state packet (LSP).
b) Dissemination of LSPs to every other router, called flooding, in an efficient and reliable
way.
tree.
d) OSPF header analysis is given below :
3. Packet length: This field specifies the length of OSPF packet in bytes,
4. Router ID: It identifies the sending router.
OSPF Advantages
Distance vector and link state routing are both intradomain routing protocols. They can be
used inside an autonomous system, but not between autonomous systems. These two
protocols are not suitable for interdomain routing mostly because of scalability. Both of these
routing protocols become intractable when the domain of operation becomes large. Distance
vector routing is subject to instability if there are more than a few hops in the domain of
operation. Link state routing needs a huge amount of resources to calculate routing tables. It
also creates heavy traffic because of flooding. There is a need for a third routing protocol
which we call path vector routing.
Path Vector Routing is a routing algorithm in unicast routing protocol of network layer, and it
is useful for interdomain routing. The principle of path vector routing is similar to that of
distance vector routing. It assumes that there is one node in each autonomous system that acts
on behalf of the entire autonomous system is called Speaker node . It is different from the
distance vector routing and link state routing. Each entry in the routing table contains the
destination network, the next router and the path to reach the destination.
1. BGP easily solves the count-to-infinity problem.
Disadvantages of BGP
1. BGP is complex.
2. BGP routes to destination networks, rather than to specific hosts or routers.
Multicast Routing: DVMRP – PIM
Multicast is a method of group communication where the sender sends data to multiple
receivers or nodes present in the network simultaneously. Multicasting is a type of one-to-
many and many-to-many communication as it allows sender or senders to send data
packets to multiple receivers at once across LANs or WANs. This process helps in
minimizing the data frame of the network
There are different Multicast Routing Protocols used for multicst routing
1. A router transmits its distance vector to each of its neighbors in a routing packet.
2. Each router receives and saves the most recently received distance vector from
each of its neighbors.
3. A router recalculates its distance vector when:
o It receives a distance vector from a neighbor containing different
information than before.
o It discovers that a link to a neighbor has gone down.