Cs3591 CN Unit 4 Notes Eduengg
Cs3591 CN Unit 4 Notes Eduengg
Cs3591 CN Unit 4 Notes Eduengg
CONNECT WITH US
WEBSITE: www.eduengineering.net
TELEGRAM: @eduengineering
-
INSTAGRAM: @eduengineering
Routing and protocols: Unicast routing - Distance Vector Routing - RIP - Link State
Routing – OSPF– Path-vector routing - BGP - Multicast Routing: DVMRP – PIM
4.1 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.
Types of Routing
• Static Routing
• Default Routing
• Dynamic Routing
Static Routing
• 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.
• 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.
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 – 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-01:
Each router prepares its routing table. By their local knowledge. each router knows about-
Step-02:
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
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, and C is given below –
Router A
Form A A B C
A 0 2 3
B 2 0 1
C 3 1 0
Router B
Form B A B C
A 0 2 3
B 2 0 1
C 3 1 0
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:
• RIP is based on the distance vector-based strategy, so we consider the entire structure
as a graph where nodes are the routers, and the links are the networks.
• In a routing table, the first column is the destination, or we can say that it is a network
address.
• The cost metric is the number of hops to reach the destination. The number of hops
available in a network would be the cost. The hop count is the number of networks
required to reach the destination.
• In RIP, infinity is defined as 16, which means that the RIP is useful for smaller
networks or small autonomous systems. The maximum number of hops that RIP can
contain is 15 hops, i.e., it should not have more than 15 hops as 16 is infinity.
• The next column contains the address of the router to which the packet is to be sent to
reach the destination.
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
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.
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.
Types of Links
In OSPF terminology, a connection is called a link. Four types of links have been defined:
point-to-point, transient, stub, and virtual.
• As shown in the Fig. routers R1, R2 andR7 are internal routers. Routers R3, R6,
R8are area border routers. Routers R3, R4, R5, R6, R8are backbone routers. Router R4 is
an ASBR
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.
Functions
Prevention Of Loop
Policy Routing
Optimum Path
BGP
Border Gateway Protocol (BGP) is used to Exchange routing information for the internet,
used to route traffic from one autonomous system (AS) to another.
Different Types of Autonomous Systems?
Since the BGP helps in routing between different autonomous systems, it is important to
learn about different types of autonomous systems:
1. Stub AS:
3. Transit AS:
BGP connections inside an autonomous system are called internal BGP (iBGP) and BGP
connections between different autonomous systems are called external BGP(eBGP). Fig.
shows the internal and external BGP
BGP messages : Header of the all BGP messages is fixed size that identifies the message
type. Fig. shows the BGP message header format
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.
Consider router X , X will share it routing table to neighbors and neighbors will share it
routing table to it to X and distance from node X to destination will be calculated using
bellmen- ford equation.
As we can see that distance will be less going from X to Z when Y is intermediate node(hop)
so it will be update in routing table X.
PIM
PIM (Protocol Independent Multicast) is a multicast routing protocol, that is used to send
traffic from a single source to multiple destinations across a network.
PIM is a collection of three protocols - PIM Sparse Mode, PIM Dense Mode and PIM Bi-
directional . PIM is termed protocol-independent because PIM does not include its own
PIM Sparse Mode (PIM-SM) is a multicast routing protocol designed on the assumption that
recipients for any particular multicast group will be sparsely distributed throughout the
network. In other words, it is assumed that most subnets in the network will not want any given
multicast packet. In order to receive multicast data, routers must explicitly tell their upstream
neighbors about their interest in particular groups and sources. Routers use PIM Join and Prune
messages to join and leave multicast distribution trees.
PIM Dense Mode (PIM-DM) is a multicast routing protocol designed with the opposite
assumption to PIM-SM, namely that the receivers for any multicast group are distributed
densely throughout the network. That is, it is assumed that most (or at least many) subnets in
the network will want any given multicast packet. Multicast data is initially sent to all hosts in
the network. Routers that do not have any interested hosts then send PIM Prune messages to
remove themselves from the tree.
Bi-directional PIM
Bi-directional PIM (BIDIR-PIM) is a third PIM protocol, based on PIM-SM. The main way
BIDIR-PIM differs from PIM-SM is in the method used to send data from a source to the RP.
Whereas in PIM-SM data is sent using either encapsulation or a source-based tree, in BIDIR-
PIM the data flows to the RP along the shared tree, which is bi-directional - data flows in both
directions along any given branch.
CONNECT WITH US
WEBSITE: www.eduengineering.net
TELEGRAM: @eduengineering
-
INSTAGRAM: @eduengineering