CN Module-4
CN Module-4
CN Module-4
MODULE - 4
DISTANCE VECTOR ROUTING ALGORITHM, LINK STATE ROUTING
ALGORITHM AND Hierarchical Routing concept explained in
class REFER THEORY FROM (FOROUZAN) BOOK.
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.
TYPES OF ROUTING
TYPES OF ROUTING
Static Routing
● Static Routing is also known as Nonadaptive Routing.
● It is a technique in which the administrator manually adds the routes in a routing table.
● A Router can send the packets for the destination along the route defined by the administrator.
● In this technique, routing decisions are not made based on the condition or topology of the networks
● No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the cheaper router
can be used to obtain static routing.
● Bandwidth: It has not bandwidth usage between the routers.
● Security: It provides security as the system administrator is allowed only to have control over the
routing to a particular network.
TYPES OF ROUTING
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.
TYPES OF ROUTING
Dynamic Routing
● It is also known as Adaptive Routing.
● It is a technique in which a router adds a new route in the routing table for each packet
in response to the changes in the condition or topology of the network.
● Dynamic protocols are used to discover the new routes to reach the destination.
● In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
● If any route goes down, then the automatic adjustment will be made to reach the
destination.
● 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.
TYPES OF ROUTING
2. Non-Adaptive Algorithms
These are the algorithms that do not change their routing decisions
once they have been selected. This is also known as static routing
as a route to be taken is computed in advance and downloaded to
routers when a router is booted.
CLASSIFICATION OF ROUTING ALGORITHMS
Further, these are classified as follows:
3. Hybrid Algorithms
As the name suggests, these algorithms are a combination of both adaptive and
non-adaptive algorithms. In this approach, the network is divided into several
regions, and each region uses a different algorithm.
Further, these are classified as follows:
● Link-state: In this method, each router creates a detailed and complete map
of the network which is then shared with all other routers. This allows for more
accurate and efficient routing decisions to be made.
● Distance vector: In this method, each router maintains a table that contains
information about the distance and direction to every other node in the
network. This table is then shared with other routers in the network. The
disadvantage of this method is that it may lead to routing loops.
Difference between Adaptive and Non-Adaptive Routing Algorithms
Delivery
Forwarding
Forwarding Techniques
Hop count is the number of routers occurring in between the source and
destination network. The path with the lowest hop count is considered as the
best route to reach a network and therefore placed in the routing table. RIP
prevents routing loops by limiting the number of hops allowed in a path from
source and destination. The maximum hop count allowed for RIP is 15 and a
hop count of 16 is considered as network unreachable.
What is Routing Information Protocol (RIP)?
If a router receives an update on a route, and the new path is shorter, it will update its table
entry with the length and next-hop address of the shorter path. If the new path is longer, it
will wait through a "hold-down" period to see if later updates reflect the higher value as well.
It will only update the table entry if the new, longer path has been determined to be stable.
If a router crashes or a network connection is severed, the network discovers this because
that router stops sending updates to its neighbors, or stops sending and receiving updates
along the severed connection. If a given route in the routing table isn't updated across six
successive update cycles (that is, for 180 seconds) a RIP router will drop that route and let
the rest of the network know about the problem through its own periodic updates.
Versions of RIP
There are three versions of the Routing Information Protocol:
1. RIPv1.
2. RIPv2.
3. RIPng
OSPF Protocol
The OSPF stands for Open Shortest Path First. It is a widely used and
supported routing protocol. It is an intradomain protocol, which means that it is
used within an area or a network. It is an interior gateway protocol that has been
designed within a single autonomous system. It is based on a link-state routing
algorithm in which each router contains the information of every domain, and
based on this information, it determines the shortest path. The goal of routing is to
learn routes. The OSPF achieves by learning about every router and subnet within
the entire network. Every router contains the same information about the network.
The way the router learns this information by sending LSA (Link State
Advertisements). These LSAs contain information about every router, subnet, and
other networking information. Once the LSAs have been flooded, the OSPF stores
the information in a link-state database known as LSDB. The main goal is to have
the same information about every router in an LSDBs.
OSPF Protocol
How does OSPF work?
There are three steps that can explain the working of OSPF:
Step 1: The first step is to become OSPF neighbors. The two connecting
routers running OSPF on the same link creates a neighbor relationship.
Step 3: The third step is to choose the best route. Once the LSDB information
has been exchanged with each other, the router chooses the best route to be
added to a routing table based on the calculation of SPF.
OSPF Protocol
OSPF Message Format
OSPF Protocol
● Version: It is an 8-bit field that specifies the OSPF protocol version.
● Type: It is an 8-bit field. It specifies the type of the OSPF packet.
● Message: It is a 16-bit field that defines the total length of the message, including
the header. Therefore, the total length is equal to the sum of the length of the
message and header.
● Source IP address: It defines the address from which the packets are sent. It is a
sending routing IP address.
● Area identification: It defines the area within which the routing takes place.
● Checksum: It is used for error correction and error detection.
● Authentication type: There are two types of authentication, i.e., 0 and 1. Here, 0
means for none that specifies no authentication is available and 1 means for pwd
that specifies the password-based authentication.
● Authentication: It is a 32-bit field that contains the actual value of the
authentication data.
BGP Protocol
What is BGP? Border Gateway Protocol (BGP) refers to a gateway protocol that
enables the internet to exchange routing information between autonomous systems
(AS). As networks interact with each other, they need a way to communicate. This is
accomplished through peering. BGP makes peering possible. Without it, networks
would not be able to send and receive information with each other.
Unicasting :
Difference Between Broadcast and Multicast
Difference Between Broadcast and Multicast
DVMRP
Distance vector multicast routing protocol (DVMRP) is a protocol used for routing multicast
data packets. It is based on the distance vector algorithm, similar to the routing information
protocol (RIP), but the DVMRP is specifically adapted for multicast, or sending data packets
to multiple destinations simultaneously, rather than unicast routing. It can be used in video
conferencing, live streaming events, company communications, online education, and
real-time data distribution.
To send the packets, DVMRP creates a routing table with the shortest path from each node
in the network to a multicast group. Then, it uses reverse path forwarding (RPF) to ensure
efficient delivery of multicast packets.
DVMRP is not universally supported across all network equipment, so you should always
check if it’s compatible with your system. It is most effective in scenarios where multicast
data needs to be efficiently distributed to multiple recipients. (refer book for diagram and
theory)
DVMRP
3. It must ensure that the path traveled by a packet is the shortest from its source to the router.
To accomplish this, the DVMR algorithm uses a process based on following decision making
strategies:
• In this strategy, the router only forwards those packets that have traveled the shortest path from
source to destination.
• To achieve this, the router pretends that it has a packet to send to the source from where the
DVMRP
• In this way, the shortest path to the sender of the packet is computed.
• If the same route is followed by the received packet, it is forwarded to the next
router and it is discarded otherwise.
• The reverse path forwarding ensures that the network receives a copy of the
packet without formation of loops. A loop occurs when a packet that has left the
router may come back again from another interface or the same interface and be
forwarded again.
• RPF does not guarantee that there would be no duplicate packets in the network
i.e. the network may receive two or more copies.
• The reason for this is that the routing is based on the source address and not on
the destination address.
DVMRP
• In this the desired multicast network tree is created by using two different methods: Pruning
and grafting.
• A router can send a prune message to its upstream router whenever it finds that its network
is not interested in a multicast packet. In this way a router prunes (cuts) its network from
multicasting.
• If a router receives prune message from all the downstream routers, it in turn, sends a
prune message to its upstream router.
• A router can also send a graft message to its upstream router if it finds that its network is
again interested in receiving the multicast packet. In this way, graft message forces the
upstream router to resume sending the multicast message. The network is again grafted
(joined).
DVMRP
• Multicast open shortest path first is the multicast version of open shortest
path first protocol.
• The first difference is· that in this method, the tree is least cost tree instead
of shortest path tree.
• The second .difference is that the tree is not made gradually. It is made
immediately it is prepruned and ready to use.
DVMRP
DISTANCE VECTOR ROUTING
DISTANCE VECTOR ROUTING
DISTANCE VECTOR ROUTING
DISTANCE VECTOR ROUTING
DISTANCE VECTOR ROUTING
DISTANCE VECTOR ROUTING
DISTANCE VECTOR ROUTING
TWO NODE INSTABILITY
TWO NODE INSTABILITY
SPLIT HORIZON AND POISON REVERSE
THREE NODE INSTABILITY
THREE NODE INSTABILITY
NOTE- YOU CAN DRAW DIAGRAMS FOR 2 AND 3 NODE
INSTABILITY WHICH I EXPLAINED IN CLASS.
Count to Infinity problem
The main issue with Distance Vector Routing (DVR) protocols is Routing Loops since
Bellman-Ford Algorithm cannot prevent loops. This routing loop in the DVR network causes
the Count to Infinity Problem. Routing loops usually occur when an interface goes down or
two routers send updates at the same time.
If the link between B and C is disconnected, then B will know that it can no longer
get to C via that link and will remove it from its table. Before it can send any
updates it’s possible that it will receive an update from A which will be advertising
that it can get to C at a cost of 2. B can get to A at a cost of 1, so it will update a
route to C via A at a cost of 3. A will then receive updates from B later and update
its cost to 4. They will then go on feeding each other bad information toward
infinity which is called as Count to Infinity problem.
Solution for Count to Infinity problem:-
Split horizon:
If the link between B and C goes down, and B had received a route from A, B could end
up using that route via A. A would send the packet right back to B, creating a loop. But
according to the Split horizon Rule, Node A does not advertise its route for C (namely A
to B to C) back to B. On the surface, this seems redundant since B will never route via
node A because the route costs more than the direct route from B to C.
Poison Revert:
When a route fails, distance vector protocols spread the bad news about a route failure by
poisoning the route. Route poisoning refers to the practice of advertising a route, but with a special
metric value called Infinity. Routers consider routes advertised with an infinite metric to have failed.
Each distance vector routing protocol uses the concept of an actual metric value that represents
infinity. RIP defines infinity as 16. The main disadvantage of poison reverse is that it can
significantly increase the size of routing announcements in certain fairly common network
topologies.