0% found this document useful (0 votes)
8 views45 pages

Routing Principles and Metrics Explained

The document provides an overview of routing principles, including distance vector and link state routing, along with their respective algorithms and metrics used for determining optimal paths. It explains static, default, and dynamic routing, detailing their advantages and disadvantages. Additionally, it covers the distance vector routing algorithm, its operation, and the link state routing technique, emphasizing the importance of routing tables and information sharing among routers.

Uploaded by

soxsthxo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views45 pages

Routing Principles and Metrics Explained

The document provides an overview of routing principles, including distance vector and link state routing, along with their respective algorithms and metrics used for determining optimal paths. It explains static, default, and dynamic routing, detailing their advantages and disadvantages. Additionally, it covers the distance vector routing algorithm, its operation, and the link state routing technique, emphasizing the importance of routing tables and information sharing among routers.

Uploaded by

soxsthxo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

VEL TECH HIGH TECH

Dr. RANGARAJAN Dr. SAKUNTHALA ENGINEERING COLLEGE


An Autonomous Institution
Approved by AICTE-New Delhi, Affiliated to Anna University, Chennai
Accredited by NBA, New Delhi & Accredited by NAAC with “A” Grade & CGPA of 3.27

UNIT III ROUTING

Routing Principles – Distance Vector Routing – Link State Routing - Routing (RIP,
OSPF,metrics) – Switch basics – Global Internet (Areas, BGP, IPv6), Multicast –
addresses – multicast routing (DVMRP, PIM).

Routing
o 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.
o A Router works at the network layer in the OSI model and internet layer in TCP/IP model
o A router is a networking device that forwards the packet based on the information available
in the packet header and forwarding table.
o 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.
o 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.
o The routing algorithm initializes and maintains the routing table for the process of path
determination.

Routing Metrics and Costs


Routing metrics and costs are used for determining the best route to the destination. The factors
used by the protocols to determine the shortest path, these factors are known as a metric.

Metrics are the network variables used to determine the best route to the destination. For some
protocols use the static metrics means that their value cannot be changed and for some other routing
protocols use the dynamic metrics means that their value can be assigned by the system
administrator.

The most common metric values are given below:


o 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.
o 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.
o 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.
o 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.
o 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
Routing can be classified into three categories:

o Static Routing
o Default Routing
o Dynamic Routing
Static Routing
o Static Routing is also known as Nonadaptive Routing.
o It is a technique in which the administrator manually adds the routes in a routing table.
o A Router can send the packets for the destination along the route defined by the administrator.
o In this technique, routing decisions are not made based on the condition or topology of the networks

Advantages Of Static Routing


Following are the advantages of Static Routing:
o No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the cheaper router
can be used to obtain static routing.
o Bandwidth: It has not bandwidth usage between the routers.
o Security: It provides security as the system administrator is allowed only to have control over the
routing to a particular network.

Disadvantages of Static Routing:


Following are the disadvantages of Static Routing:
o For a large network, it becomes a very difficult task to add each route manually to the routing table.
o The system administrator should have a good knowledge of a topology as he has to add each route
manually.

Default Routing
o 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.
o Default Routing is used when networks deal with the single exit point.
o It is also useful when the bulk of transmission networks have to transmit the data to the same hp
device.
o 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
o It is also known as Adaptive Routing.
o 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.
o Dynamic protocols are used to discover the new routes to reach the destination.
o In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
o If any route goes down, then the automatic adjustment will be made to reach the destination.

The Dynamic protocol should have the following features:


o All the routers must have the same dynamic routing protocol in order to exchange the routes.
o If the router discovers any change in the condition or topology, then router broadcast this
information to all other routers.

Advantages of Dynamic Routing:


o It is easier to configure.
o It is more effective in selecting the best route in response to the changes in the condition or
topology.

Disadvantages of Dynamic Routing:


o It is more expensive in terms of CPU and bandwidth usage.
o It is less secure as compared to default and static routing.

Distance Vector Routing Algorithm


o The Distance vector algorithm is iterative, asynchronous and distributed.
o Distributed: It is distributed in that each node receives information from one or more of
its directly attached neighbors, performs calculation and then distributes the result back to
its [Link] are some simple points to remember about **static routing**:
o
o 1. **Manually Configured**: You set the routes yourself, no automatic adjustments.
o
o 2. **Fixed Paths**: The routes stay the same unless you change them manually.
o
o 3. **Simple Setup**: Easy to configure for small or simple networks.
o
o 4. **No Automatic Failover**: If a route fails, traffic doesn’t automatically find a new
path—you have to update it manually.
o
o 5. **Low Overhead**: Doesn’t use extra resources like dynamic routing protocols (no
frequent updates).
o
o 6. **Best for Small Networks**: Good for simple, stable networks where routes don’t
change often.
o
o 7. **No Route Discovery**: Unlike dynamic routing, routers don't automatically learn new
routes.
o
o In short, static routing is simple and reliable but lacks flexibility for larger, changing
networks.
o Iterative: It is iterative in that its process continues until no more information is available
to be exchanged between neighbors.
o Asynchronous: It does not require that all of its nodes operate in the lock step with each
other.
o The Distance vector algorithm is a dynamic algorithm.
o It is mainly used in ARPANET, and RIP.
o Each router maintains a distance table known as Vector.

Three Keys to understand the working of Distance Vector


Routing Algorithm:
o Knowledge about the whole network: Each router shares its knowledge through the entire
network. The Router sends its collected knowledge about the network to its neighbors.
o Routing only to neighbors: The router sends its knowledge about the network to only those routers
which have direct links. The router sends whatever it has about the network through the ports. The
information is received by the router and uses the information to update its own routing table.
o Information sharing at regular intervals: Within 30 seconds, the router sends the information to
the neighboring routers.

Distance Vector Routing Algorithm


Let dx(y) be the cost of the least-cost path from node x to node y. The least costs are related by
Bellman-Ford equation,
dx(y) = minv{c(x,v) + dv(y)}
Where the minv is the equation taken for all x neighbors. After traveling from x to v, if we consider
the least-cost path from v to y, the path cost will be c(x,v)+dv(y). The least cost from x to y is the
minimum of c(x,v)+dv(y) taken over all neighbors.
With the Distance Vector Routing algorithm, the node x contains the following routing
information:
o For each neighbor v, the cost c(x,v) is the path cost from x to directly attached neighbor, v.
o The distance vector x, i.e., Dx = [ Dx(y) : y in N ], containing its cost to all destinations, y, in N.
o The distance vector of each of its neighbors, i.e., Dv = [ Dv(y) : y in N ] for each neighbor v of x.

Distance vector routing is an asynchronous algorithm in which node x sends the copy of its distance
vector to all its neighbors. When node x receives the new distance vector from one of its
neighboring vector, v, it saves the distance vector of v and uses the Bellman-Ford equation to
update its own distance vector. The equation is given below:

dx(y) = minv{ c(x,v) + dv(y)} for each node y in N


The node x has updated its own distance vector table by using the above equation and sends its
updated table to all its neighbors so that they can update their own distance vectors.

Algorithm
At each node x,
Initialization

for all destinations y in N:


Dx(y) = c(x,y) // If y is not a neighbor then c(x,y) = ∞
for each neighbor w
Dw(y) = ? for all destination y in N.
for each neighbor w
send distance vector Dx = [ Dx(y) : y in N ] to w
loop
wait(until I receive any distance vector from some neighbor w)
for each y in N:
Dx(y) = minv{c(x,v)+Dv(y)}
If Dx(y) is changed for any destination y
Send distance vector Dx = [ Dx(y) : y in N ] to all neighbors
forever

Sharing Information
o In the above figure, each cloud represents the network, and the number inside the cloud represents
the network ID.
o All the LANs are connected by routers, and they are represented in boxes labeled as A, B, C, D, E,
F.
o Distance vector routing algorithm simplifies the routing process by assuming the cost of every link
is one unit. Therefore, the efficiency of transmission can be measured by the number of links to
reach the destination.
o In Distance vector routing, the cost is based on hop count.
In the above figure, we observe that the router sends the knowledge to the immediate neighbors.
The neighbors add this knowledge to their own knowledge and sends the updated table to their
own neighbors. In this way, routers get its own information plus the new information about the
neighbors.

Routing Table
Two process occurs:
o Creating the Table
o Updating the Table

Creating the Table


Initially, the routing table is created for each router that contains atleast three types of information
such as Network ID, the cost and the next hop.

o NET ID: The Network ID defines the final destination of the packet.
o Cost: The cost is the number of hops that packet must take to get there.
o Next hop: It is the router to which the packet must be delivered.

o In the above figure, the original routing tables are shown of all the routers. In a routing table, the
first column represents the network ID, the second column represents the cost of the link, and the
third column is empty.
o These routing tables are sent to all the neighbors.

For Example:
1. A sends its routing table to B, F & E.
2. B sends its routing table to A & C.
3. C sends its routing table to B & D.
4. D sends its routing table to E & C.
5. E sends its routing table to A & D.
6. F sends its routing table to A.
Updating the Table
o When A receives a routing table from B, then it uses its information to update the table.
o The routing table of B shows how the packets can move to the networks 1 and 4.
o The B is a neighbor to the A router, the packets from A to B can reach in one hop. So, 1 is added
to all the costs given in the B's table and the sum will be the cost to reach a particular network.
o After adjustment, A then combines this table with its own table to create a combined table.

o The combined table may contain some duplicate data. In the above figure, the combined
table of router A contains the duplicate data, so it keeps only those data which has the
lowest cost. For example, A can send the data to network 1 in two ways. The first, which
uses no next router, so it costs one hop. The second requires two hops (A to B, then B to
Network 1). The first option has the lowest cost, therefore it is kept and the second one is
dropped.

o The process of creating the routing table continues for all routers. Every router receives the
information from the neighbors, and update the routing table.
Link State Routing
Link state routing is a technique in which each router shares the knowledge of its neighborhood
with every other router in the internetwork.
The three keys to understand the Link State Routing algorithm:
o Knowledge about the neighborhood: Instead of sending its routing table, a router sends the
information about its neighborhood only. A router broadcast its identities and cost of the directly
attached links to other routers.
o Flooding: Each router sends the information to every other router on the internetwork except its
neighbors. This process is known as Flooding. Every router that receives the packet sends the copies
to all its neighbors. Finally, each and every router receives a copy of the same information.
o Information sharing: A router sends the information to every other router only when the change
occurs in the information.

Link State Routing has two phases:


Reliable Flooding
o Initial state: Each node knows the cost of its neighbors.
o Final state: Each node knows the entire graph.
Route Calculation
Each node uses Dijkstra's algorithm on the graph to calculate the optimal routes to all nodes.
o The Link state routing algorithm is also known as Dijkstra's algorithm which is used to find the
shortest path from one node to every other node in the network.
o The Dijkstra's algorithm is an iterative, and it has the property that after kth iteration of the
algorithm, the least cost paths are well known for k destination nodes.

Let's describe some notations:


o c( i , j): Link cost from node i to node j. If i and j nodes are not directly
linked, then c(i , j) = ∞.
o D(v): It defines the cost of the path from source code to destination v that has the least cost
currently.
o P(v): It defines the previous node (neighbor of v) along with current least cost path from source to
v.
o N: It is the total number of nodes available in the network.

Algorithm
Initialization
N = {A} // A is a root node.
for all nodes v
if v adjacent to A
then D(v) = c(A,v)
else D(v) = infinity
loop
find w not in N such that D(w) is a minimum.
Add w to N
Update D(v) for all v adjacent to w and not in N:
D(v) = min(D(v) , D(w) + c(w,v))
Until all nodes in N
In the above algorithm, an initialization step is followed by the loop. The number of times the loop
is executed is equal to the total number of nodes available in the network.
Step 1:
The first step is an initialization step. The currently known least cost path from A to its directly
attached neighbors, B, C, D are 2,5,1 respectively. The cost from A to B is set to 2, from A to D is
set to 1 and from A to C is set to 5. The cost from A to E and F are set to infinity as they are not
directly linked to A.

Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

Step 2:
In the above table, we observe that vertex D contains the least cost path in step 1. Therefore, it is
added in N. Now, we need to determine a least-cost path through D vertex.
a) Calculating shortest path from A to B
1. v = B, w = D
2. D(B) = min( D(B) , D(D) + c(D,B) )
3. = min( 2, 1+2)>
4. = min( 2, 3)
5. The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
b) Calculating shortest path from A to C
1. v = C, w = D
2. D(B) = min( D(C) , D(D) + c(D,C) )
3. = min( 5, 1+3)
4. = min( 5, 4)
5. The minimum value is 4. Therefore, the currently shortest path from A to C is 4.</p>
c) Calculating shortest path from A to E
1. v = E, w = D
2. D(B) = min( D(E) , D(D) + c(D,E) )

Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞


3. = min( ∞, 1+1)
4. = min(∞, 2)
5. The minimum value is 2. Therefore, the currently shortest path from A to E is 2.

Step 3:
In the above table, we observe that both E and B have the least cost path in step 2. Let's consider
the E vertex. Now, we determine the least cost path of remaining vertices through E.

a) Calculating the shortest path from A to B.

1. v = B, w = E
2. D(B) = min( D(B) , D(E) + c(E,B) )
3. = min( 2 , 2+ ∞ )
4. = min( 2, ∞)
5. The minimum value is 2. Therefore, the currently shortest path from A to B is 2.

b) Calculating the shortest path from A to C.

1. v = C, w = E
2. D(B) = min( D(C) , D(E) + c(E,C) )
3. = min( 4 , 2+1 )
4. = min( 4,3)
5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3.

c) Calculating the shortest path from A to F.

1. v = F, w = E
2. D(B) = min( D(F) , D(E) + c(E,F) )
3. = min( ∞ , 2+2 )
4. = min(∞ ,4)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞

3 ADE 2,A 3,E 4,E

Step 4:
In the above table, we observe that B vertex has the least cost path in step 3. Therefore, it is added
in N. Now, we determine the least cost path of remaining vertices through B.
a) Calculating the shortest path from A to C.
1. v = C, w = B
2. D(B) = min( D(C) , D(B) + c(B,C) )
3. = min( 3 , 2+3 )
4. = min( 3,5)
5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3.

b) Calculating the shortest path from A to F.

1. v = F, w = B
2. D(B) = min( D(F) , D(B) + c(B,F) )
3. = min( 4, ∞)
4. = min(4, ∞)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.

Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞

3 ADE 2,A 3,E 4,E

4 ADEB 3,E 4,E


Step 5:
In the above table, we observe that C vertex has the least cost path in step 4. Therefore, it is added
in N. Now, we determine the least cost path of remaining vertices through C.
a) Calculating the shortest path from A to F.
1. v = F, w = C
2. D(B) = min( D(F) , D(C) + c(C,F) )
3. = min( 4, 3+5)
4. = min(4,8)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.

Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞

3 ADE 2,A 3,E 4,E

4 ADEB 3,E 4,E

5 ADEBC 4,E

Final table:
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞

3 ADE 2,A 3,E 4,E

4 ADEB 3,E 4,E

5 ADEBC 4,E

6 ADEBCF
Disadvantage:
Heavy traffic is created in Line state routing due to Flooding. Flooding can cause an infinite
looping, this problem can be solved by using Time-to-leave field

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:
o 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.
o In a routing table, the first column is the destination, or we can say that it is a network address.
o 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.
o 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.
o The next column contains the address of the router to which the packet is to be sent to reach the
destination.

How is hop count determined?


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.
RIP Message Format
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:
o 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.
o 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.
o Reserved: This is a reserved field, so it is filled with zeroes.
o Family: It is a 16-bit field. As we are using the TCP/IP family, so we put 2 value in this field.
o 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.
o Distance: The distance field specifies the hop count, i.e., the number of hops used to reach the
destination.

How does the RIP work?


I f there are 8 routers in a network where Router 1 wants to send the data to Router 3. If the network is
configured with RIP, it will choose the route which has the least number of hops. There are three routes in
the above network, i.e., Route 1, Route 2, and Route 3. The Route 2 contains the least number of hops, i.e.,
2 where Route 1 contains 3 hops, and Route 3 contains 4 hops, so RIP will choose Route 2.

suppose R1 wants to send the data to R4. There are two possible routes to send data from r1 to r2.
As both the routes contain the same number of hops, i.e., 3, so RIP will send the data to both the
routes simultaneously. This way, it manages the load balancing, and data reach the destination a
bit faster.

Disadvantages of RIP
The following are the disadvantages of RIP:
o In RIP, the route is chosen based on the hop count metric. If another route of better bandwidth is
available, then that route would not be chosen. Let's understand this scenario through an example.
We can observe that Route 2 is chosen in the above figure as it has the least hop count. The Route
1 is free and data can be reached more faster; instead of this, data is sent to the Route 2 that makes
the Route 2 slower due to the heavy traffic. This is one of the biggest disadvantages of RIP.
o The RIP is a classful routing protocol, so it does not support the VLSM (Variable Length Subnet
Mask). The classful routing protocol is a protocol that does not include the subnet mask information
in the routing updates.
o It broadcasts the routing updates to the entire network that creates a lot of traffic. In RIP, the routing
table updates every 30 seconds. Whenever the updates occur, it sends the copy of the update to all
the neighbors except the one that has caused the update. The sending of updates to all the neighbors
creates a lot of traffic. This rule is known as a split-horizon rule.
o It faces a problem of Slow convergence. Whenever the router or link fails, then it often takes
minutes to stabilize or take an alternative route; This problem is known as Slow convergence.
o RIP supports maximum 15 hops which means that the maximum 16 hops can be configured in a
RIP
o The Administrative distance value is 120 (Ad value). If the Ad value is less, then the protocol is
more reliable than the protocol with more Ad value.
o The RIP protocol has the highest Ad value, so it is not as reliable as the other routing protocols.

How RIP updates its Routing table


The following timers are used to update the routing table:
o RIP update timer : 30 sec

The routers configured with RIP send their updates to all the neighboring routers every 30 seconds.
o RIP Invalid timer : 180 sec

The RIP invalid timer is 180 seconds, which means that if the router is disconnected from the
network or some link goes down, then the neighbor router will wait for 180 seconds to take the
update. If it does not receive the update within 180 seconds, then it will mark the particular route
as not reachable.
o RIP Flush timer : 240 sec

The RIP flush timer is 240 second which is almost equal to 4 min means that if the router does not
receive the update within 240 seconds then the neighbor route will remove that particular route
from the routing table which is a very slow process as 4 minutes is a long time to wait.

Advantages of RIP
The following are the advantages of a RIP protocol:
o It is easy to configure
o It has less complexity
o The CPU utilization is less.
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 divides the autonomous systems into areas where the area is a collection of networks, hosts,
and routers. Like internet service providers divide the internet into a different autonomous system
for easy management and OSPF further divides the autonomous systems into Areas.
Routers that exist inside the area flood the area with routing information
In Area, the special router also exists. The special routers are those that are present at the border
of an area, and these special routers are known as Area Border Routers. This router summarizes
the information about an area and shares the information with other areas.
All the areas inside an autonomous system are connected to the backbone routers, and these
backbone routers are part of a primary area. The role of a primary area is to provide communication
between different areas.
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 2: The second step is to exchange database information. After becoming the neighbors, the
two routers exchange the LSDB information with each other.
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.

How a router forms a neighbor relationship?


The first thing is happened before the relationship is formed is that each router chooses
the router ID.
Router ID (RID): The router ID is a number that uniquely identifies each router on a network.
The router ID is in the format of the IPv4 address. There are few ways to set the router ID, the first
way is to set the router ID manually and the other way is to let the router decides itself.
The following is the logic that the router chooses to set the router ID:
o Manually assigned: The router checks whether the router ID is manually set or not. If it manually
set, then it is a router ID. If it is not manually set, then it will choose the highest 'up' status loopback
interface IP address. If there are no loopback interfaces, then it will choose the highest 'up' status
non-loopback interface IP address.

Two routers connected to each other through point to point or multiple routers are connected can
communicate with each other through an OSPF protocol. The two routers are adjacent only when
both the routers send the HELLO packet to each other. When both the routers receive the
acknowledgment of the HELLO packet, then they come in a two-way state. As OSPF is a link state
routing protocol, so it allows to create the neighbor relationship between the routers. The two
routers can be neighbors only when they belong to the same subnet, share the same area id, subnet
mask, timers, and authentication. The OSPF relationship is a relationship formed between the
routers so that they can know each other. The two routers can be neighbors if atleast one of them
is designated router or backup designated router in a network, or connected through a point-to-
point link.

Types of links in OSPF


A link is basically a connection, so the connection between two routers is known as a link.
There are four types of links in OSPF:
1. Point-to-point link: The point-to-point link directly connects the two routers without any host or
router in between.
2. Transient link: When several routers are attached in a network, they are known as a transient link.
The transient link has two different implementations:
Unrealistic topology: When all the routers are connected to each other, it is known as an unrealistic
topology.
Realistic topology: When some designated router exists in a network then it is known as a realistic
topology. Here designated router is a router to which all the routers are connected. All the packets
sent by the routers will be passed through the designated router.
3. Stub link: It is a network that is connected to the single router. Data enters to the network through
the single router and leaves the network through the same router.
4. Virtual link: If the link between the two routers is broken, the administration creates the virtual
path between the routers, and that path could be a long one also.

OSPF Message Format


The following are the fields in an OSPF message format:

o Version: It is an 8-bit field that specifies the OSPF protocol version.


o Type: It is an 8-bit field. It specifies the type of the OSPF packet.
o 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.
o Source IP address: It defines the address from which the packets are sent. It is a sending routing
IP address.
o Area identification: It defines the area within which the routing takes place.
o Checksum: It is used for error correction and error detection.
o 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.
o Authentication: It is a 32-bit field that contains the actual value of the authentication data.
OSPF Packets
There are five different types of packets in OSPF:
o Hello
o Database Description
o Link state request
o Link state update
o Link state Acknowledgment

Let's discuss each packet in detail.

1. Hello packet

The Hello packet is used to create a neighborhood relationship and check the neighbor's
reachability. Therefore, the Hello packet is used when the connection between the routers need to
be established.

2. Database Description

After establishing a connection, if the neighbor router is communicating with the system first time,
it sends the database information about the network topology to the system so that the system can
update or modify accordingly.

3. Link state request

T he link-state request is sent by the router to obtain the information of a specified route. Suppose
there are two routers, i.e., router 1 and router 2, and router 1 wants to know the information about
the router 2, so router 1 sends the link state request to the router 2. When router 2 receives the link
state request, then it sends the link-state information to router 1.
4. Link state update
The link-state update is used by the router to advertise the state of its links. If any router wants to
broadcast the state of its links, it uses the link-state update.
5. Link state acknowledgment
The link-state acknowledgment makes the routing more reliable by forcing each router to send the
acknowledgment on each link state update. For example, router A sends the link state update to
the router B and router C, then in return, the router B and C sends the link- state acknowledgment
to the router A, so that the router A gets to know that both the routers have received the link-state
update.

OSPF States
The device running the OSPF protocol undergoes the following states:
o Down: If the device is in a down state, it has not received the HELLO packet. Here, down does not
mean that the device is physically down; it means that the OSPF process has not been started yet.
o Init: If the device comes in an init state, it means that the device has received the HELLO packet
from the other router.
o 2WAY: If the device is in a 2WAY state, which means that both the routers have received the
HELLO packet from the other router, and the connection gets established between the routers.
o Exstart: Once the exchange between the routers get started, both the routers move to the Exstart
state. In this state, master and slave are selected based on the router's id. The master controls the
sequence of numbers, and starts the exchange process.
o Exchange: In the exchange state, both the routers send a list of LSAs to each other that contain a
database description.
o Loading: On the loading state, the LSR, LSU, and LSA are exchanged.
o Full: Once the exchange of the LSAs is completed, the routers move to the full state.

Router attributes
Before going to the Extract state, OSPF chooses one router as a Designated router and another
router as a backup designated router. These routers are not the type, but they are the attributes of
a router. In the case of broadcast networks, the router selects one router as a designated router and
another router as a backup designated router. The election of designated and the backup designated
router is done to avoid the flooding in a network and to minimize the number of adjacencies. They
serve as a central point for exchanging the routing information among all the routers. Since point-
to-point links are directly connected, so DR and BDR are not elected.
If DR and BDR are not elected, the router will send the update to all the adjacent neighbors, leading
to the flooding in a network. To avoid this problem, DR and BDR are elected. Each non-DR and
non-BDR send the update only to the DR and BDR instead of exchanging it with other routers in
a network segment. DR then distributes the network topology information to other routers in the
same area whereas the BDR serves a substitute for the DR. The BDR also receives the routing
information from all the router but it does not distribute the information. It distributes the
information only when the DR fails.
The multicast address [Link] is used by the non-DR and non-BDR to send the routing
information to the DR and BDR. The DR and BDR send the routing information to the multicast
address [Link].
Based on the following rules, the DR and BDR are elected:
o The router with the highest OSPF priority is chosen as the DR. By default, the highest priority is
set as 1.
o If there is no highest priority, then the router with the highest router Id is chosen as the DR, and the
router with the second-highest priority is chosen as the BDR.

Let's understand this scenario through an example.


In the above figure, R1 is chosen as the DR, while R2 is chosen as the BDR as R1 has the highest router
ID, whereas the R2 has the second-highest router ID. If the link fails between R4 and the system, then R4
updates only R1 and R4 about its link failure. Then, DR updates all the non-DR and non-BDR about the
change, and in this case, except R4, only R3 is available as a non-DR and non-BDR.

network switch
The Switch is a network device that is used to segment the networks into different
subnetworks called subnets or LAN segments. It is responsible for filtering and forwarding
the packets between LAN segments based on MAC address.
Switches have many ports, and when data arrives at any port, the destination address is
examined first and some checks are also done and then it is processed to the devices.
Different types of communication are supported here like unicast, multicast, and broadcast
communication.

Switches are networking devices operating at layer 2 or a data link layer of the
OSI model. They connect devices in a network and use packet switching to send,
receive or forward data packets or data frames over the network.

A switch has many ports, to which computers are plugged in. When a data frame
arrives at any port of a network switch, it examines the destination address,
performs necessary checks and sends the frame to the corresponding device(s).
It supports unicast, multicast as well as broadcast communications.

Features of Network Switches


● It operates in Data Link Layer in OSI Model.
● It performs error checking before forwarding data.
● It transfers the data only to the device that has been addressed.
● It operates in full duplex mode.
● It allocates each LAN segment a limited bandwidth.
● It uses Unicast (one-to-one), multicast (one-to-many), and broadcast (one-to-all)
transmission modes.
● Packet Switching techniques are used to transfer data packets from source to
destination.
● Switches have a more significant number of ports.

Why Are Network Switches Valuable?


Switches are one of the most important things for transferring information between
different endpoints. Some of the benefits are mentioned below.
● Switches are having full-duplex communication which helps in making effective use of
bandwidth.
● Switches help to provide a wired connection to printers, IoT devices, wireless points,
and many more devices.
● IoT Devices send data through Network Switches that help in making smarter
surroundings with the help of Artificial Intelligence.
● Network Devices are made with the help of Switches that carry a large number of traffic
in telecommunication.

Types of Switches
Switches are mainly classified into the following types that are mentioned below.
● Virtual Switches: Virtual Switches are the switches that are inside Virtual Machine
hosting environments.
● Routing Switches: These are the switches that are used to connect [Link] also
have the work of performing functions in the Network Layer of the OSI Model.
● Unmanaged Switches: Unmanaged Switches are the devices that are used to enable
Ethernet devices that help in automatic data passing. These are generally used for home
networks and small businesses. In case of the requirement of more switches, we just
add more switches by plug and play method.
● Managed Switches: Managed Switches are switches having more complex networks.
SNMP (Simple Network Management Protocol) can be used for configuring managed
switches. These types of switches are mostly used in large networks having complex
architecture. They provide better security levels and precision control but they are more
costly than Unmanaged switches.
● LAN Switches: LAN (Local Area Network) Switches are also called ethernet switches
or data switches. LAN switches always try to avoid overlapping of data packets in the
network just by allocating bandwidth in such a manner.
● PoE Switches: Power over Ethernet(PoE) are the switches used in Gigabit Ethernets.
PoE help in combining data and power transmission over the same cable so that it helps
in receiving data and electricity over the same line.
● Smart Switches: Smart Switches are switches having some extra controls on data
transmissions but also have extra limitations over managed Switches. They are also
called partially managed switches.
● Stackable Switches: Stackable switches are connected through a backplane to combine
two logical switches into a single switch.
● Modular Switches: These types of switches help in accommodating two or more cards.
Modular switches help in providing better flexibility.

How Does a Network Switch Works?


When the source wants to send the data packet to the destination, the packet first enters the
switch and the switch reads its header and finds the MAC address of the destination to
identify the device then it sends the packet out through the appropriate ports that lead to
the destination devices.
Switch establishes a temporary connection between the source and destination for
communication and terminates the connection once the conversation is done. Also, it offers
full bandwidth to network traffic going to and from a device simultaneously to reduce
collision.
Switching Techniques
Switching techniques are used to decide the best route for data transmission between source
and destination. These are classified into three categories :
1. Circuit Switching
2. Message Switching
3. Packet Switching

How To Set Up a Network Switch?


There are different kinds of switches that work according to the tasks defined. For a small
network LAN, or for a home network, a network switch is used by plugging into a port of
the router. Below mentioned are the steps which are used in setting up network switches.
Step 1: Switch has to be bought as per the requirement of the network.
Step 2: The switch port has to be connected directly to the router using the cable.
Generally, if there is an uplink port present in the switch, the wire should be connected to
that port, if the uplink power is not present, then the wire has to be connected to any port
of the router.
Step 3: After proper connection, the IP addresses of devices are configured.

Difference between Network Switch and Router


Network Switch Router

Network Switch works on Layer 2 of the OSI The router is primarily a device of
Model. Layer 3 of the OSI Model.

The resource is shared among multiple devices


Data is moved between two or more
with the help of a single LAN using a network
computers with the help of a router.
switch.

Network switches uses data frames. Routers use data packets.

Switches only work in a Wired network Router works with both wired and
connection. wifi networks.

Switches use MAC Addresses for transferring data Routers use IP Addresses for the
to the proper destination. same work.

Uses of Network Switches


Network Switches are an important part of Network communication. Some of the use cases
are mentioned below.
● Network switches help provide automatic link connections that remove time-
consuming settings and provide easy access to network devices.
● Switches provide a better, more secure, reliable network having more control over data.
● Generally, switches work in full duplex mode, which helps in continuous data
transmission and that improves better connectivity.
● As MAC Address is used for the devices connected to it, that helps in the delivery of
messages to only the required destination, not everywhere.
● Network Switches work for home networks or local networks where streaming works
are performed regularly.

Difference between Network Switch and Hub


Network Switch Hub

Network Switch is a device of layer 2 of the OSI Hub is a physical device of Layer 1 of
Model. the OSI Model.

Network Switch is a little more complex than a Hub is a simple device as compared to
Hub. Network Switch.

Network Switch easily manages data in and out, Communication Collisions usually
hence less communication collision. happen in a Hub.

Network Switches transfer data together by The main task of Hub is to connect all
connecting devices. nodes of the network.

Switches prevent collision with the help Hubs cannot help in preventing
of Ethernet frames. collisions.

Advantages of Switches
● Prevents traffic overloading in a network by segmenting the network into smaller
subnets.
● Increases the bandwidth of the network.
● Less frame collision as the switch creates the collision domain for each connection.

Disadvantages of Switches
● It can not stop traffic destined for a different LAN segment from traveling to all other
LAN segments.
● Switches are more expensive.

Border Gateway Protocol(BGP)


BGP stands for Border Gateway Protocol. It is a standardized gateway protocol that exchanges
routing information across autonomous systems (AS). When one network router is linked to other
networks, it cannot decide which network is the best network to share its data to by itself.
Border Gateway Protocol considers all peering partners that a router has and sends traffic to the
router closest to the data’s destination. This communication is possible because, at boot, BGP
allows peers to communicate their routing information and then stores that information in a
Routing Information Base (RIB).
The main goal of BGP is to find any path to the destination that is loop-free. This is different from
intradomain routing protocols’ common goals: finding an optimal route to the destination based
on a specific link metric.
The routers that connect other ASs are called border gateways. The task of the border gateways is
to forward packets between ASs. Each AS has at least one BGP speaker. BGP speakers exchange
reachability information among ASs.

Path-Vector Routing
RIP (Routing Information Protocol) and OSPF (Open Shortest Path First) are not applicable for
interdomain routing protocols. Distance vector routing can send data to each of a router’s
neighbours, and then every router develops up a routing database. Routing is not familiar with the
identity of routers in any specific direction.
Every router sends its connection cost to all various routers and then starts routing computations.
Two problems can emerge in link-state routing. First, different independent systems can use
multiple costs and have multiple drawbacks.
The link-state protocol enables a router to create the topology, and its metrics can be different for
each independent system. In this method, it is impossible to generate a reliable routing algorithm.
Second, when flood routing appears, the use of an interdomain routing protocol across the
independent system can be ambiguous.

Types
The types of BGP are as follows −

Internal BGP
Routes are exchanged, and traffic is transmitted over the Internet using external BGP or eBGP.
Autonomous systems can also use an internal BGP version to route through their internal
networks, known as internal BGP.
It should be noted that using internal BGP is NOT a requirement for using external BGP.
Autonomous systems can choose from several internal protocols to connect the routers on their
internal network.
External BGP
External BGP is like international shipping; some specific standards and guidelines need to be
followed when shipping a piece of mail internationally. Once that piece of mail reaches its
destination country, it has to go through its local mail service to reach its final destination.
Each country has its internal mail service that doesn’t necessarily follow the same guidelines as
other countries. Similarly, each autonomous system can have its internal routing protocol for
routing data within its network.

Internet Protocol version 6 (IPv6)


Read
Discuss
Courses



IPv6 was developed by Internet Engineering Task Force (IETF) to deal with the problem
of IPv4 exhaustion. IPv6 is a 128-bits address having an address space of 2128, which is way
bigger than IPv4. IPv6 use Hexa-Decimal format separated by colon (:) .

Components in Address format :

1. There are 8 groups and each group represents 2 Bytes (16-bits).


2. Each Hex-Digit is of 4 bits (1 nibble)
3. Delimiter used – colon (:)

Need for IPv6:


The Main reason of IPv6 was the address depletion as the need for electronic devices rose
quickly when Internet Of Things (IOT) came into picture after the 1980s & other reasons
are related to the slowness of the process due to some unnecessary processing, the need for
new options, support for multimedia, and the desperate need for security. IPv6 protocol
responds to the above issues using the following main changes in the protocol:
1. Large address space
An IPv6 address is 128 bits long .compared with the 32 bit address of IPv4, this is a huge(2
raised 96 times) increases in the address space.
2. Better header format
IPv6 uses a new header format in which options are separated from the base header and
inserted, when needed, between the base header and the upper layer data . This simplifies
and speeds up the routing process because most of the options do not need to be checked
by routers.
3. New options
IPv6 has new options to allow for additional functionalities.
4. Allowance for extension
IPv6 is designed to allow the extension of the protocol if required by new technologies or
applications.
5. Support for resource allocation
In IPv6,the type of service field has been removed, but two new fields , traffic class and
flow label have been added to enables the source to request special handling of the packet
. this mechanism can be used to support traffic such as real-time audio and video.
6. Support for more security
The encryption and authentication options in IPv6 provide confidentiality and integrity of
the packet.
In IPv6 representation, we have three addressing methods :
● Unicast
● Multicast
● Anycast

Addressing methods
1. Unicast Address
Unicast Address identifies a single network interface. A packet sent to a unicast address is
delivered to the interface identified by that address.
2. Multicast Address
Multicast Address is used by multiple hosts, called as groups, acquires a multicast
destination address. These hosts need not be geographically together. If any packet is sent
to this multicast address, it will be distributed to all interfaces corresponding to that
multicast address. And every node is configured in the same way. In simple words, one
data packet is sent to multiple destinations simultaneously.
3. Anycast Address
Anycast Address is assigned to a group of interfaces. Any packet sent to an anycast address
will be delivered to only one member interface (mostly nearest host possible).
Note: Broadcast is not defined in IPv6.
Types of IPv6 address:
We have 128 bits in IPv6 address but by looking at the first few bits we can identify what
type of address it is.

Prefix Allocation Fraction of Address Space

0000 0000 Reserved 1/256

0000 0001 Unassigned (UA) 1/256

0000 001 Reserved for NSAP 1/128

0000 01 UA 1/64

0000 1 UA 1/32

0001 UA 1/16

001 Global Unicast 1/8

010 UA 1/8

011 UA 1/8

100 UA 1/8

101 UA 1/8
Prefix Allocation Fraction of Address Space

110 UA 1/8

1110 UA 1/16

1111 0 UA 1/32

1111 10 UA 1/64

1111 110 UA 1/128

1111 1110 0 UA 1/512

1111 1110 10 Link-Local Unicast Addresses 1/1024

1111 1110 11 Site-Local Unicast Addresses 1/1024

1111 1111 Multicast Address 1/256

Note: In IPv6, all 0’s and all 1’s can be assigned to any host, there is not any restriction
like IPv4.
Provider-based Unicast address :
These are used for global communication.
The First 3 bits identify it as of this type.
Registry Id (5-bits): Registry Id identifies the region to which it belongs. Out of 32 (i.e.
2^5), only 4 registry IDs are being used.

Provider Id: Depending on the number of service providers that operate under a region,
certain bits will be allocated to the Provider Id field. This field need not be fixed. Let’s say
if Provider Id = 10 bits then Subscriber Id will be 56 – 10 = 46 bits.
Subscriber Id: After Provider Id is fixed, the remaining part can be used by ISP as a
normal IP address.
Intra Subscriber: This part can be modified as per the need of the organization that is
using the service.
Geography based Unicast address :

Global routing prefix: Global routing prefix contains all the details of Latitude and
Longitude. As of now, it is not being used. In Geography-based Unicast address routing
will be based on location.
Interface Id: In IPv6, instead of using Host Id, we use the term Interface Id.
Some special addresses:
Unspecified

Loopback
IPv4 Compatible

IPv4 mapped

Local Unicast Addresses :


These are of two types: Link-local and Site-Local
1. Link-local address:

2. Site local address:

Site local addresses are equivalent to a private IP address in IPv4. Likely, some address
space is reserved, which can only be routed within an organization. The first 10-bits are set
to 1111111011, which is why Site local addresses always begin with FEC0. The following
32 bits are Subnet IDs, which can be used to create a subnet within the organization. The
node address is used to uniquely identify the link; therefore, we use a 48-bits MAC address
here.

Advantages of IPv6:
1. Realtime Data Transmission : Realtime data transmission refers to the process of
transmitting data in a very fast manner or immediately. Example : Live streaming services
such as cricket matches, or other tournament that are streamed on web exactly as soon as
it happens with a maximum delay of 5-6 seconds.
2. IPv6 supports authentication: Verifying that the data received by the receiver from the
sender is exactly what the sender sent and came through the sender only not from any third
party. Example : Matching the hash value of both the messages for verification is also done
by IPv6.
3. IPv6 performs Encryption: Ipv6 can encrypt the message at network layer even if the
protocols of application layer at user level didn’t encrypt the message which is a major
advantage as it takes care of encryption.
4. Faster processing at Router: Routers are able to process data packets of Ipv6 much
faster due to smaller Base header of fixed size – 40 bytes which helps in decreasing
processing time resulting in more efficient packet transmission. Whereas in Ipv4, we have
to calculate the length of header which lies between 20-60 bytes.

MULTICAST ADDRESS:
A multicast address is a specific type of IP address labeling a network location that is used to
multicast data packets within a network. It stands in contrast to other IP addresses that only allow
for unicast models.
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 because at once the data can be received by multiple nodes.
Multicasting is considered as the special case of broadcasting [Link] works in similar to
Broadcasting, but in Multicasting, the information is sent to the targeted or specific
members of the network. This task can be accomplished by transmitting individual copies
to each user or node present in the network, but sending individual copies to each user is
inefficient and might increase the network latency. To overcome these shortcomings,
multicasting allows a single transmission that can be split up among the multiple users,
consequently, this reduces the bandwidth of the signals.
Applications : Multicasting is used in many areas like:
1. Internet protocol (IP)
2. Streaming Media
3. It also supports video conferencing applications and webcasts.
– Multicasting use classful addressing of IP address of class – D which ranges
from [Link] to [Link]
IP Multicast : Multicasting that takes place over the Internet is known as IP Multicasting.
These multicast follow the internet protocol(IP) to transmit data. IP multicasting uses a
mechanism known as ‘Multicast trees’ to transmit to information among the users of the
network. Multicast trees; allows a single transmission to branch

out to the desired receivers. The branches are created at the Internet routers, the branches
are created such that the length of the transmission will be minimum.
IP multicasts also use two other essential protocols to function; Internet Group
Management Protocol (IGMP), Protocol Independent Multicast (PIM). IGMP allows the
recipients to access the data or information i.e if any host wants to receive the message that
is going to be multicasted, they must join the group using this protocol. The network routers
use PIM to create multicast trees. To sum up, Multicasting is an efficient way of
communication; it reduces the bandwidth usage and is used when a message is to be sent
to a large number of selected individuals.

MULTICAST DVMRP:
The Distance Vector Multicast Routing Protocol (DVMRP), defined in RFC
1075, is a routing protocol used to share information between routers to
facilitate the transportation of IP multicast packets among networks.
The distance vector multicast routing protocol is multicast routing protocol that takes the routing
decision based upon the source address of the packet.
• This algorithm constructs the routing tree for a network.
• Whenever a router receives a packet, it forwards it to some of its ports based on the source
address of packet.
. The rest of the routing tree is made by downstream routers.
• routing tree is created from destination to source.
The protocol must achieve the following tasks:
1. It must prevent the formation of loops in the network.
2. It must prevent the formation of duplicate packets.
3. It must ensure that the path traveled by a packet is the shortest from its source to the router.
4. It should provide dynamic membership.
To accomplish this, the DVMR algorithm uses a process based on following decision making
strategies:
● 1. Reverse Path Forwarding (RPF)
● 2. Reverse Path Broadcasting (RPB)
● 3. Reverse Path Multicasting (RPM)
● 4. Multicast Open Shortest Path First (MOSPF)

1. Reverse Path Forwarding (RPF)

• 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
packet has arrived.
• 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.

2. Reverse Path Broadcasting (RPB)

• In order to solve the problem, RPB is used.


• In this method, one parent router is defined for each network.
• The network could accept the multicast packets from this parent router only.
• This router sends packets to those ports for which it is designated as parent.
• Thus, RPB principle’ allows a router to broadcast the packet in the network.
This creates duplicate packets on the network and reduces the network efficiency.

3. Reverse Path Multicasting (RPM)

• To overcome the problem of broadcasting in RPB, Reverse Path Multicasting in used.


• 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).

4. Multicast Open Shortest Path First (MOSPF)

• Multicast open shortest path first is the multicast version of open shortest path first protocol.
• It is an extension of OSPF that uses multicast link state routing method to create source based
trees.
• The method used by MOSPF is different from DVMRP.
• 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.
MULTICAST PIM:
Protocol-Independent Multicast (PIM) is a family of multicast routing
protocols for Internet Protocol (IP) networks that provide one-to-many and
many-to-many distribution of data over a LAN, WAN or the Internet.
Protocol Independent Multicast or PIM is a group of multicast routing protocols designed for
specific network environments. To forward our IP multicast traffic, we need to use a multicast
routing protocol. PIM Multicast is the only multicast routing protocol that Cisco IOS devices fully
support. PIM can determine the path between the source and receivers using a particular unicast
routing protocol.

Distribution Trees
Multicast routers specify the path that IP multicast packet takes through the network to reach the
receivers by creating distribution trees. Source trees, also known as Shortest-Path Tree (SPT), and
Shared Tree are the two basic types of multicast distribution trees.

Source Tree – A source tree is a multicast distribution tree in which the source is the root and
branches extend down the network to the receivers. When this tree is formed, it takes the shortest
path possible through the network from the source to the tree’s leaves; thus, it is also known as
the Shortest-Path Tree (SPT).

Shared Tree – A shared tree is a multicast distribution tree in which the root is the Rendezvous
Point (RP), rather than the source. As a result, a shared tree is sometimes referred to as an RP
Tree (RPT). Regardless of the source address, multicast forwarding is according to the multicast
group address to which the packets are addressed.

Wasted bandwidth is one drawback of Shared Tree since shared trees can allow multiple sources
in an IP multicast group. It is also a potential security risk since unintended sources can send
unwanted packets to receivers.

PIM Multicast Protocols and Messages


Currently, there are five PIM operating modes which are:

● PIM Dense Mode (PIM-DM)


● PIM Sparse Mode (PIM-SM)
● PIM Sparse Dense Mode
● PIM Source Specific Multicast (PIM-SSM)
● PIM Bidirectional Mode (Bidir-PIM)

PIM dense mode (PIM-DM) is a push model where we flood all interfaces with multicast packets
except for routers that have no directly connected members or PIM neighbors.

On the other hand, PIM sparse mode (PIM-SM) is a pull model wherein we only send multicast
traffic when requested. A Rendezvous Point or RP router serves as a point of contact for multicast
senders and receivers.

Below we can see the different PIM Messages:

Message Type Destination PIM Protocol

Hello All PIM routers / [Link] PIM-SM, PIM-DM

Register RP address / unicast PIM-SM

Register stop First hop router / unicast PIM-SM

Join/prune All PIM routers / [Link] PIM-SM


Bootstrap All PIM routers / [Link] PIM-SM

Assert All PIM routers / [Link] PIM-SM, PIM-DM

Candidate RP advertisement Bootstrap router (BSR) address / unicast PIM-SM

State refresh All PIM routers / [Link] PIM-DM

DF election All PIM routers / [Link]

Let’s also discuss other PIM Key Terms:

PIM Join Message – A request sent by a router towards the RP.

Internet Group Management Protocol (IGMP) – The protocol used by receivers to connect to
multicast groups and begin receiving traffic from them.

Prune Message – Message sent to RP to inform other routers in the path that they can disable
multicast traffic forwarding for a particular group.

RPF or Reverse Path Forwarding – PIM will only accept multicast packets on an interface that
we use to reach the source. RPF failure is when we drop multicast packets that we receive on an
interface that we don’t use to reach the source.

RPF Neighbor – The PIM neighbor on the RPF interface.

Upstream Router – A router where we receive multicast traffic from.

Downstream Router – A router where we forward multicast traffic to.

You might also like