Advance Computer Networking
Advance Computer Networking
Routing Protocols
Lecturer : Mrs. Mrinali R. Bhalerao
Department of Computer Engineering
Pimpri Chinchwad Polytechnic College
Lecturer : Mrs. Mrinali R. Bhalerao
Table of Contents
m r
2.2 : Routing Protocols – Intra Domain Routing – Distance Vector Routing - Creating
o
a l e ra
Distance Vector Routing Tables, Initialization, Sharing, Updating – Routing
Information Protocol (RIPv2), Link State Routing – Open Shortest Path First
@ b h
(OSPF) –Types of Links, Graphical Representation, Interdomain Routing – Path
Vector Routing – Broader Gateway Protocol ( BGPv4)
2.3 : Internet Control Message Protocol (ICMP) – Types of messages, Message
Format, Error Reporting Messages
2
Lecturer : Mrs. Mrinali R. Bhalerao
What is Routing ?
• Network routing is the process of selecting a path across one or more networks.
• In packet-switching networks, such as the Internet, routing selects the paths for Internet Protocol (IP)
packets to travel from their origin to their destination. These Internet routing decisions are made by
specialized pieces of network hardware called routers.
o m r
ra
Consider this image
h a l e
• For a data packet to get from Computer A to Computer
B, should it pass through networks 1, 3, and 5 or
b
networks 2 and 4?
@
• The packet will take a shorter path through networks 2
and 4, but networks 1, 3, and 5 might be faster at
forwarding packets than 2 and 4.
• These are the kinds of choices network routers
constantly make.
3
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
▪ when a router receives a packet, it reads the headers of the packet to see its intended destination, like the way a
train conductor may check a passenger's tickets to determine which train they should go on. It then determines
l e ra
where to route the packet based on information in its routing tables.
▪ Routers do this millions of times a second with millions of packets. As a packet travels to its destination, it may be
a
h
routed several times by different routers.
@
What is a router?
b
• A router is a piece of network hardware responsible for forwarding packets to their destinations.
• Routers connect to two or more IP networks or subnetworks and pass data packets between them as needed.
• Routers are used in homes and offices for setting up local network connections.
• More powerful routers operate all over the Internet, helping data packets reach their destinations.
4
Lecturer : Mrs. Mrinali R. Bhalerao
Routing Protocols
In networking, a protocol is a standardized way of formatting data so that any connected computer can understand the
data. A routing protocol is a protocol used for identifying or announcing network paths.
• IP: The Internet Protocol (IP) specifies the origin and destination for each data packet. Routers inspect each packet's IP
header to identify where to send them.
o m r
• BGP: The Border Gateway Protocol (BGP) routing protocol is used to announce which networks control which IP
a l e ra
addresses, and which networks connect to each other. (The large networks that make these BGP announcements are
called autonomous systems.) BGP is a dynamic routing protocol.
@ h
• OSPF: The Open Shortest Path First (OSPF) protocol is commonly used by network routers to dynamically identify the
b
fastest and shortest available routes for sending packets to their destination.
• RIP: The Routing Information Protocol (RIP) uses "hop count" to find the shortest path from one network to another,
where "hop count" means number of routers a packet must pass through on the way. (When a packet goes from one
network to another, this is known as a "hop.")
• Other interior routing protocols include EIGRP (Enhanced Interior Gateway Routing Protocol), mainly for use with Cisco
routers) and IS-IS (Intermediate System to Intermediate System). 5
Lecturer : Mrs. Mrinali R. Bhalerao
Router Architecture
Main job of a router is to implement forwarding
plane functions and the control plane functions.
o m r
a
from an input link interface to the appropriate
output link interface. Forwarding takes place at
very short timescales (typically a few nanoseconds)
a l e r
b h
and is typically implemented in hardware.
@
Router's control plane functions:
Control plane functions refer to implementing the
routing protocols, maintaining the routing tables,
The main components of a router are
• input/output ports
• Switching fabric
computing the forwarding table. All these
• Routing processor.
functions are implemented in software in the
routing processor 6
Lecturer : Mrs. Mrinali R. Bhalerao
Router Components
Input ports:
Functionalities performed by the input ports
1. Physically terminate the incoming links to the router
2. Data link processing unit decapsulates the packets
o m r
l e ra
3. Input ports perform the lookup function. At this point, the input ports consult the forwarding table to ensure that
each packet is forwarded to the appropriate output port through the switch fabric.
a
@ b h Output ports:
An important function of the output ports is
1. receive and queue the packets which come
from the switching fabric
2. then send them over to the outgoing link.
7
Lecturer : Mrs. Mrinali R. Bhalerao
• switching fabric moves the packets from input to output ports • Enables implementing the routing protocols,
• makes the connections between the input and the output ports. • Maintaining the routing tables
o r
• Ccomputing the forwarding table
m
• All these functions are implemented in software
a
crossbar.
r
in the routing processor,
h a l e
@ b
8
Lecturer : Mrs. Mrinali R. Bhalerao
Router Types
1. Edge Router 3. Virtual Router
• Location: At the boundary of a network. • Location: In cloud or virtualized environments.
• Function: Connects internal networks to external networks • Function: Software-based router running on virtual m/c
r
• Features: • Features:
ra
• Often supports security features like firewalls & VPNs.
o m
• Flexible and scalable.
• Can be dynamically created or removed.
2. Wireless Router
h a l e
• Use Case: ISPs, enterprise networks connecting to internet. • Use Case: Cloud services, virtual data centers.
4. Distribution Router
b
• Location: Typically, in homes or small offices.
@
• Function: Provides wireless (Wi-Fi) access to devices.
• Features:
• Combines routing and wireless access point.
• Location: Between core and access layers in a network.
• Function: Aggregates data from access routers and forwards
it to core routers.
• Features: Handles routing between different subnets or
• May include firewall, DHCP, and NAT. VLANs. Often supports advanced routing protocols.
• Use Case: Home networks, small businesses. • Use Case: Enterprise networks with multiple departments or
9
floors..
Lecturer : Mrs. Mrinali R. Bhalerao
r
(e.g., for WAN, LAN, voice).
• Features:
m
• Features: Highly flexible and scalable.
o
• High-speed and high-capacity.
a
• Use Case: Large enterprises with diverse networking
• Does not typically connect directly to end-user
devices.
a l e r needs.
h
8. Branch Routers
b
• Use Case: ISPs, large enterprise networks.
• Purpose: Used in branch offices to connect to the main
@
6. Broadband Routers
corporate network.
• Purpose: Connect home networks to the internet via
• Features: Typically support VPNs, security features, and
DSL, cable, or fiber.
WAN connectivity.
• Features: Often include firewall and NAT capabilities.
• Use Case: Distributed businesses with multiple locations.
• Use Case: Residential internet access.
10
Lecturer : Mrs. Mrinali R. Bhalerao
Routing Table
o m r
a
Access Memory of forwarding devices, such as routers
and network switches.
a l
• It stores source and destination IP addresses of the
e r
information.
@ b h
routing devices in the form of prefixes along with the
default gateway addresses and corresponding routing
r
• Subnet mask. Also known as the netmask, this is a 32-bit network address that identifies whether a host belongs to the local or remote
m
network. To enhance routing efficiency and reduce the size of the broadcast domain, administrators can apply a custom subnet mask
e a o
through the process of subnetting, which can divide a network into two or smaller connected networks.
r
Gateway. This is the next hop, or the neighboring device's IP address to which the packet is forwarded.
l
a
• Interface. Routers typically use Ethernet interfaces to connect to other devices on the same network, such as eth0 or eth1, and serial
•
b h
interfaces to connect to outside wide area networks (WANs). The routing table lists the inbound network interface, also known as the
@
outgoing interface, that the device should use when forwarding the packet to the next hop.
Metric. This entry assigns a value to each available route to a specific network. The value ensures that the router can choose the most
effective path. In some cases, the metric is the number of routers that a data packet must cross before it gets to the destination address.
If multiple routes exist to the same destination network, the path with the lowest metric is given precedence.
• Routes. This includes directly attached subnets, indirect subnets that aren't attached to the device but can be accessed through one or
more hops, and default routes to use for certain types of traffic or when information is lacking.
12
Lecturer : Mrs. Mrinali R. Bhalerao
How does network routing work?
• A computer sends a packet to a router. Similar to the address on a postal package, a sending device -- such as a computer --
attaches IP addresses to data packets and sends them to a router. This helps the router determine the best routes to transport the
packets to their destinations. A computer typically connects to a local area network (LAN) to send packets while a router can send
packets between different LANs and WANs.
o m r
• The router receives the packet. Once the router receives the packet, it analyzes it against its internal routing tables to determine
the most efficient path to send the packet through. The goal of the router is to forward the packet to the router closest to its
ultimate destination.
a l e ra
• The router routes the packets. It's unlikely that the initial router will get the packet directly to its destination. It looks at the
h
routing table to get the packet to the next hop. The routing table keeps the hop count low by providing the router with the most
b
effective route. The final hop count is the number of times a packet goes from one router to another until it reaches its
destination.
@
• The process is repeated. At the next hop, another router takes over and repeats the same process of determining where to send
the packet by looking at its internal routing tables. This process repeats several times before the packet reaches its destination.
The routing process might sound lengthy, but it's extremely quick due to the routing protocols involved.
• The packet reaches its destination. Once a packet has finally reached a router that resides on the same network as the
13
destination IP address, it's directly routed to the device or server that it was intended for.
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
a l e ra
@ b h
14
Lecturer : Mrs. Mrinali R. Bhalerao
Static Routing
- Granular control over routing
- Saves bandwidth and overhead (no route sharing)
o m r
- Not fault tolerant
- No automatic updates for network changes
a l e ra
- AD of 1 gives preference over dynamic routes - Impractical for large networks
- No auto failover
Dynamic Routing
@ b h
- Automatically builds and maintains routing tables
- Responds to network changes (failures, congestion)
- Easier for large networks
- Supports load balancing
- Consumes more bandwidth and overhead
- Routing decisions made by protocols, not
admins
- Can dynamically choose better paths
15
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
a
• In such a situation, new packets are ignored, or older packets are dropped.
l e r
• As part of the resource allocation mechanisms, routers must implement some queuing discipline that
a
h
governs how packets are buffered or dropped when required
@ b
16
Lecturer : Mrs. Mrinali R. Bhalerao
r
queuing method called FIFO (First In, First Out). FIFO means
m
that the packets are processed in the order of their arrival
in the queue
l e ra o
a
❑ Priority Queueing (PQ) :
@ b h
Priority Queuing (PQ) is a simple scheduling algorithm
that supports differentiated services. The logic is that
each queue has a priority, with queue 0 having the
highest priority. The scheduler always processes
packets from the highest-priority queue first. Once the
highest-priority queue is empty, it moves to the next
lower-priority queue 17
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
than those with lower weights.
a l e ra
@ b h
❑ Low Latency Queueing (LLQ)
Low-latency queuing (LLQ) combines strict priority
queueing (PQ) and class-based weighted fair queuing
(CBWFQ). The scheduler treats one or more queues as
priority queues and always services them first. The other
queues are serviced in a round-robin fashion based on
the configured weight values. 18
Lecturer : Mrs. Mrinali R. Bhalerao
Switching in Router
Switching is the process of moving packets from the input interface to the appropriate output interface.
The router follows a switching fabric to interconnect input and output ports efficiently.
r
Switching Type Description Advantages Disadvantages
Memory-Based
Packets are stored in memory before being
ra
forwarded. CPU reads from input and writes
Simple design
o m
Cost-effective for low-speed
High latency
Limited throughput
l e
Switching
to output. networks Not scalable
b h a Bus contention
@
Bus-Based All ports share a common bus. Packets are Efficient for small-scale systems Limited bandwidth
Switching transferred via this shared pathway. Lower cost Not suitable for high-speed
networks
Uses a matrix of switches to connect inputs to High performance Complex and expensive
Crossbar-Based
outputs directly. Multiple simultaneous Scalable Requires more hardware
Switching
transfers possible. Supports parallel transfers resources
19
Lecturer : Mrs. Mrinali R. Bhalerao
Routing Protocols
❑ Routing protocols are sets of rules that routers use to exchange information and determine the best path for
forwarding data packets across a network.
❑ They enable efficient and reliable communication by allowing routers to discover network destinations, maintain up-to-
date routing tables, and make routing decisions.
o m r
a
❑ Purpose of Routing Protocols: Routing protocols are essential for enabling data packets to travel efficiently and reliably
l e r
across interconnected networks, ensuring they reach their intended destinations through the most optimal paths.
a
h
❑ Function of Routing Protocols: They determine how routers communicate with each other to share information about
@ b
network topology, allowing routers to dynamically adapt to changes like link failures or network congestion.
▪ Internet consists of a number of domains and each domain is called an Autonomous System (AS) managed
independently.
▪ Routing inside an autonomous system is referred to as intra-domain routing or Interior Gateway Protocol (Interior
Gateway Protocol, IGP)
20
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
▪ Routing between two or more autonomous
a l e ra
h
systems is referred to as inter-domain routing or
▪
Protocol, EGP)
b
Exterior Gateway Protocol (Exterior Gateway
@
Only one inter-domain routing protocol is usually
used between ASs. Path vector is an example of
inter-domain routing.
21
Lecturer : Mrs. Mrinali R. Bhalerao
Routing takes place within an autonomous network. Routing takes place between two autonomous networks.
r
This protocol ignores the internet outside the autonomous This protocol assumes the internet consists of a collection of
m
system. interconnected autonomous systems.
l e ra o
Protocols for inter-domain routing are called exterior
gateway protocols.
b h
the border router connected to the next domain.
a
Determines the route for a packet within a domain to reach Determines the AS path each packet will travel through to its
destination.
within a domain.
@
Intra-domain multicast routing protocols multicast packets
Routing algorithm works within and between domains. Routing algorithm works only within domains. 22
Lecturer : Mrs. Mrinali R. Bhalerao
▪
Protocol (Exterior Gateway Protocol, EGP)
o m r
Only one inter-domain routing protocol is usually used between ASs. Path vector is an example of inter-domain
routing.
a l e ra
@ b h
23
Lecturer : Mrs. Mrinali R. Bhalerao
Configuration Manually configured by network administrators. Automatically configured using routing protocols.
Does not adapt to network changes unless manually Automatically adapts to changes like link failures or
r
Adaptability
updated. congestion.
Complexity
ra
Simple to implement and manage in small networks.
o
calculations.
m
More complex due to protocol operations and route
Scalability
a l e
Not scalable for large networks due to manual
h
Highly scalable and suitable for large, dynamic networks.
b
configuration.
Bandwidth Usage
Fault Tolerance
Security
@
Minimal, as no routing information is exchanged.
• Also known as the Bellman-Ford routing algorithm (also called Ford-Fulkerson algorithm)
• Used to find the shortest path between nodes in a graph given the distance between nodes.
o m r
a
• Distance Vector Routing (DVR) method views an Autonomous System (AS), with all routers and networks, as a
l e r
graph—a set of nodes and edges connecting the nodes.
a
h
• A router is typically represented by a node, and a network by a link connecting two nodes
@ b
• Each router constructs a table containing the distance (total cost of path) to all other nodes and distributes that
vector to its immediate neighbors.
• It is assumed that each node knows the cost of the link to each of its directly connected neighbors.
• A link, which is 'down' (which is not working) is assigned as an infinite cost. Every node sends a message to its
directly connected neighbors.
25
• After communicating to each directly connected node the shortest path can be easy to compute
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
a l e ra
❑ Initialization
•
@ b h
At the beginning, however - each node can know only the distance between itself and its immediate neighbors, those
directly connected to it.
• So, for the moment, we assume that each node can send a message to the immediate neighbors and find the distance
between itself and these neighbors. The distance for any entry that is not a neighbor is marked as infinite (unreachable).
26
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
a l e ra
❑ Sharing:
▪
▪
▪ @ b h
The whole idea of distance vector routing is the sharing of information between neighbors.
Although node A does not know about node E, node C does.
So, if node C shares its routing table with A, node A can also know how to reach node E.
▪ On the other hand, node C does not know how to reach node D, but node A does. If node A shares its routing table with
node C, node C also knows how to reach node D.
▪ In other words, nodes A and C, as immediate neighbors, can improve their routing tables if they help each other. 27
Lecturer : Mrs. Mrinali R. Bhalerao
m r
(ii) If the next-node entry is the same, the receiving node
o
chooses the new row. For example, suppose node C has
ra
clear. If node C claims that its distance to a destination is x mi, and
e
previously advertised a route to node X with distance 2.
l
the distance between A and C is y mi, then the distance between A
h
and that destination, via C, is x + y mi.
b a
Step 2: The receiving node needs to add the name of the sending
@
node to each row as the third column if the receiving node uses
information from any row. The sending node is the next node in the
route.
Step 3: The receiving node needs to compare each row of its old
table with the corresponding row of the modified version of the
received table 28
Lecturer : Mrs. Mrinali R. Bhalerao
r
• is a distance vector routing protocol that helps routers determine the best path to transfer data packets
m
• RIP works on the Network layer of the OSI model. It uses hop count as its metric for determining the best path, but
the maximum hop count allowed in the RIP is 15.
l e ra o
• In RIP, Each router maintains a routing table where the distance to each destination is mentioned. RIP sharesits routing
h a
tables to neighbouring routers at an interval of 30 seconds through broadcasting. Upon receiving the data, each router
b
updates the table according to that.
@
• If an router receives a route and it is shorter than the previous one, then router simply updates the data in the table.
• What is Hop Count? : is the number of routers occurring between the source and destination network. The path with the
lowest hop count is considered the best route to reach a network and therefore placed in the routing table.
• The maximum hop count allowed for RIP is 15 and a hop count of 16 is considered as network unreachable. It helps in
limiting the size of network that a router can handle. In case, if a route is not updated in six successful cycles ( 180 seconds)
29
in the routing table, the RIP will drop that route and inform rest of the network about the same.
Lecturer : Mrs. Mrinali R. Bhalerao
r
• Routers always trust routing information received from neighbor routers. This is also known as Routing on rumors.
ra o m
• RIP v1 is known as Classful Routing Protocol because it doesn't send information of subnet mask in its routing update.
• RIP v2 is known as Classless Routing Protocol because it sends information of subnet mask in its routing update.
h a l e
❑ RIP has two types of messages namely, request and response as below :
b
• Request: A request message is sent by a router that has just come up or by a router that has some time-out entries. A
@
request can ask about specific entries or all entries.
• Response: A response can be either solicited or unsolicited. A solicited response is sent only in answer to a request. It
contains information about the destination specified in the corresponding request. An unsolicited response is sent
periodically, every 20 seconds or when there is a change in the routing table. The response is sometimes called an
update packet.
30
Lecturer : Mrs. Mrinali R. Bhalerao
r
• Invalid timer: If no update comes until 180 seconds, then the destination router considers it invalid. In this scenario, the
m
destination router mark hop counts as 16 for that router.
l e ra o
• Hold down timer: This is the time for which the router waits for a neighbor router to respond. If the router isn't able to
respond within a given time, then it is declared dead. It is 180 seconds by default.
h a
• Flush time: It is the time after which the entry of the route will be flushed if it doesn't respond within the flush time. It is
b
60 seconds by default. This timer starts after the route has been declared invalid and after 60 seconds i.e time will be 180
@
+ 60 = 240 seconds.
❑ Where are Routing Information Protocols Used?
• Small to medium-sized networks:
• Legacy Organizations:
• Lab Conditions: RIP is much of the time utilized in lab conditions for testing and learning purposes.
• Backup or Repetitive Steering: 31
Lecturer : Mrs. Mrinali R. Bhalerao
• Simplicity: relatively simple protocol to configure and • Limited scalability: having limited scalability may not be the best
manage, making it an ideal choice for small & medium- choice for larger networks with complex topologies. It can only
r
sized Networks support up to 15 hops, which may not be sufficient for large NW
m
• Easy implementation: easy to implement, as it does • Slow convergence: While RIP is known for its fast convergence
l e ra o
time, it can be slower to converge than other routing protocols.
This can lead to delays & inefficiencies in network performance.
h a
• Convergence: known for its fast convergence time, it
b
can quickly adapt to changes in network topology
• Routing loops: RIP can sometimes create routing loops, which
can cause network congestion & reduce overall performance.
@
• Automatic updates: RIP automatically updates routing
tables at regular intervals
• Low bandwidth overhead: uses a relatively low
amount of bandwidth making
• Limited support for load balancing: RIP does not support
sophisticated load balancing, which can result in suboptimal
routing paths and uneven network traffic distribution.
• Security vulnerabilities: RIP does not provide any native security
• Compatibility: compatible with many different types of features, making it vulnerable to attacks such as spoofing and
32
routers and network devices tampering.
Lecturer : Mrs. Mrinali R. Bhalerao
❑ Limitations of RIP
• Increase in Network Traffic: RIP increases traffic to the neighbouring routers as it regularly performs
r
updates on them.
m
• Limitation of Hop Count: Since, RIP has a maximum hop count of 15, therefore it is not suitable for large
networks.
l e ra o
• Difference in Closest Path and Shortest Path: Since, RIP does not consider all factors while calculating
h a
shortest path, therefore, it creates a difference between closest path and shortest path.
b
@
33
Lecturer : Mrs. Mrinali R. Bhalerao
r
Subnet Information Does not support subnet masks (classful) Supports subnet masks (classless)
Authentication
Distance Vector
ra m
Supported (plain text or MD5)
o
Distance Vector
Metric Used
h
Hop count
a l e Hop count
b
Maximum Hop Count 15 hops 15 hops
@
VLSM Support No Yes
o m r
a
• Unlike distance vector routing protocols, which
l e
rely on neighbors' information to determine the
a r
h
best path, link state protocols enable each router
topology.
b
to have a complete overview of the network
@
• This allows for more efficient and reliable route
calculation.
• Link state routing protocols typically fall under the
grouping of Interior Gateway Protocols (IGPs) 35
Lecturer : Mrs. Mrinali R. Bhalerao
m r
the network, ensuring that every router obtains a copy of the same network topology data.
o
a
2. Topology Database: Each router uses the received LSAs to construct a complete map of the network's topology.
l e r
This map is stored in a database known as the link state database, which is identical on all routers within the same
a
h
routing area.
b
3. Shortest Path First (SPF) Algorithm: To determine the best path through the network, link state protocols use the
@
Dijkstra Shortest Path First (SPF) algorithm. This algorithm calculates the shortest path from the router to all
possible destinations in the network by using the information stored in the link state database.
4. Periodic and Triggered Updates: While LSAs are periodically sent to ensure all routers have up-to-date
information, significant changes in the network topology (like a link going up or down) trigger immediate LSAs to
quickly propagate the new information.
36
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
6. Hierarchical Structure: Many link state protocols support hierarchical network design, dividing the larger
internetwork into areas to optimize routing. This hierarchical structure reduces the size of the topology database
e ra
on each router and decreases the routing update traffic.
a l
•
•
@ b h
Examples of link state routing protocols include Open Shortest Path First (OSPF) and Intermediate System to
Intermediate System (IS-IS).
These protocols are well-suited for large and complex network environments, offering faster convergence, more
efficient bandwidth usage, and improved route calculation accuracy compared to distance vector routing
protocols.
37
Lecturer : Mrs. Mrinali R. Bhalerao
Determines direction (vector) and distance (link cost or hops) to Uses Shortest Path First (SPF) algorithm to create an abstract of the
1
any link in the network. entire network topology.
o m r
Has a complete map of the network topology.
ra
3 Based on number of hops between source and destination.
network.
b
Routers exchange vectors containing distance and direction Each node creates a connectivity graph and calculates shortest paths
5
@
information. independently.
7 Updates the full routing table. Updates only the link state.
8 Example: RIP (Routing Information Protocol). Example: OSPF (Open Shortest Path First).
9 Lower CPU and memory utilization. Higher CPU and memory utilization.
• OSPF is a new alternative to RIP as an interior routing protocol. It overcomes all the limitations of RIP.
• OSPF uses link state routing to update the routing tables in an area, unlike RIP which is a distance vector protocol.
r
• OSPF is an intra-domain routing protocol based on link state routing. Its domain is also an autonomous system.
• OSPF is used to determine the best route for delivering packets within IP networks.
ra o m
• OSPF uses the Dijkstra algorithm to initially construct a shortest path tree and then populates the routing table with the
best route.
h a l e
• In 1998, the current version of OSPF for IPv4 is OSPFv2, introduced in RFC 1247 and updated in RFC 2228 by John Moy.
@ b
• In 1999, OSPFv2 for IPv6 was published in RFC 2740.
• OSPF divides an autonomous system into areas. An area is a collection of networks, hosts, and routers within an
autonomous system.
• At the border of an area, special routers called area border routers summarize the information and send it to other areas.
39
Lecturer : Mrs. Mrinali R. Bhalerao
Open Shortest Path First (OSPF) …contd..
• OSPF is a new alternative to RIP as an interior routing protocol. It overcomes all the limitations of RIP.
• OSPF uses link state routing to update the routing tables in an area, unlike RIP which is a distance vector protocol.
r
• OSPF is an intra-domain routing protocol based on link state routing. Its domain is also an autonomous system.
• OSPF is used to determine the best route for delivering packets within IP networks.
ra o m
• OSPF uses the Dijkstra algorithm to initially construct a shortest path tree and then populates the routing table with the
best route.
h a l e
• In 1998, the current version of OSPF for IPv4 is OSPFv2, introduced in RFC 1247 and updated in RFC 2228 by John Moy.
@ b
• In 1999, OSPFv2 for IPv6 was published in RFC 2740.
• OSPF divides an autonomous system into areas. An area is a collection of networks, hosts, and routers within an
autonomous system.
• At the border of an area, special routers called area border routers summarize the information and send it to other areas.
40
Lecturer : Mrs. Mrinali R. Bhalerao
• The backbone serves as a primary area, and the other areas are secondary areas.
o m r
• If the connectivity between a backbone and an area is broken, a virtual link between routers must be created by the
e ra
administration to maintain the backbone's functionality.
a l
b h
• The area identification of the backbone is zero.
@
41
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
2. Transient
a l
This occurs when many routers are attached to a single
e ra
h
network, such as a LAN or Wi-Fi. It is often represented in
two ways:
@ b
Realistic Topology: A network layout that closely represents
actual physical connections and configurations.
Unrealistic Topology: A simplified or abstract representation
used for easier understanding or simulation, not reflecting
physical reality.
42
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
4. Virtual Link: This link connects two routers if the link between the two routers is broken. Network administrator
between two routers creates this type of link.
a l e ra
@ b h
43
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
3.Link State Request: Requests pieces of the
a l e ra
h
topological database from neighbor routers. These
b
messages are exchanged after a router discovers (by
@
examining database-description packets) that parts of
its topological database are out of date.
4. Link State Update: Responds to a link state request packet. These messages are also used for the regular dispersal of
Link State Acknowledgments (LSA). Several LSAs can be included within a single link-state update packet.
o m r
a l e ra
@ b h
45
Lecturer : Mrs. Mrinali R. Bhalerao
OSPF Tables
1.Neighbor Tables
o m r
a
3. Used in troubleshooting when there is no communication between two routers.
l e r
4. Checked first to verify if two routers are neighbors.
a
@ h
2.Database Table
b
1. Also referred to as LSDB (Link State Database).
3.Routing Table
1. Used to find the best possible path to any router in the network.
46
Lecturer : Mrs. Mrinali R. Bhalerao
OSPF States
1. Down State : known as the initial stage of neighbor in which
no data (Hellos) have been received from the neighbor, but you
can still send them hello packets.
r
OSPF neighbor state changes from Full to Down occur under
two conditions. Firstly, if an adjacent router fails to receive a
r
hello packet from a neighboring router within the specified
a o m
h a l e
Router Dead Interval time, which is typically set to 4* the
Hello Interval. Secondly, if a manually configured neighbor is
b
removed from the configuration.
@
2. Attempt State : is the second stage in which the building of
the neighborship process starts. It is only for manually
configured neighbors on NBMA (Non-Broadcast Multi-Access)
networks. One such example of NBMA networks is frame relay.
At this stage, the router is attempting to connect with its
47
neighbors via OSPF, but it hasn’t been successful so far
Lecturer : Mrs. Mrinali R. Bhalerao
r
packet as an acknowledgment that it received a valid hello packet. But at this stage, only the hello packet is received from
the neighbor, but 2-way communication has yet to be established.
ra o m
4. 2-Way State : This state signifies that bi-directional communication has been established between two routers. Bi-
h a l e
directional means that each router has seen the other router’s hello packet and acknowledged it by listing its router ID in
b
At this state, a router decides whether to become adjacent to the neighbor or not. On broadcast networks (such as
@
Ethernet) and NBMA networks, a router becomes fully adjacent only with the designated router (DR) and the backup
designated router (BDR); it stays in the 2-Way state with all other neighbors. On point-to-point networks (such as serial
links) and point-to-multipoint networks (such as MPLS), a router becomes fully adjacent to every neighbor.
5. Exstart State
The Exstart state acts as the initial stage in the process of forming adjacencies. During this state, the local router and its
48
neighboring router work together to determine which router will be responsible for synchronizing the database.
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
Also, the master-slave relationship is established at this stage. The master router is the one that starts the DBD exchange
and assigns the sequence numbers to the DBDs. The slave router is the one that follows the master’s sequence numbers
and acknowledges the received DBDs.
a l e ra
Note: The router with the highest router ID becomes the master and the one with the lower router ID becomes a slave.
h
6. Exchange State : This state is where the actual DBD exchange takes place. The routers send and receive DBDs that
b
contain summaries of their LSAs. Each DBD has a sequence number that is incremented by one for each new packet. The
@
routers must keep track of the sequence numbers and acknowledge each received DBD.
Further, the router checks for updated or extra link-state information from its neighbor by comparing the contents of the
Database Descriptor (DBD) it receives with the contents of its own Link State Database (LSD). After this, the state changes to
loading..
49
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
Advertisements (LSAs) that have been transmitted to OSPF neighbors, transmitting recent updates or newly discovered
network information. The Loading state is complete when both routers have received all the requested LSAs from their
a l e ra
neighbors. At this point, both routers have identical link-state databases and can calculate their shortest paths using the SPF
h
8. Full State “ The full state is the operational state of OSPF, indicating that the network is functioning as expected. The
b
databases of all routers are in perfect sync, and periodic Link State Advertisements (LSAs) are sent and received by all
@
routers in the network.
It is noteworthy that in the case of Broadcast networks and NBMA media, routers will only achieve Full State with their
designated router (DR) and backup designated router (BDR) routers. In the context of point-to-point and point-to-
multipoint networks, a router must maintain its full state with respect to each neighboring router.
These are the OSPF neighbor States that a network engineer must be familiar with.
50
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
3. Efficient Routing : Uses Dijkstra’s algorithm to calculate the shortest path, ensuring optimal routing.
4. Support for VLSM and CIDR : Allows for efficient IP address allocation and route summarization.
a l e ra
5. Authentication Support : Provides security through route authentication.
6. Multivendor Compatibility : As an open standard, OSPF works across different vendors’ devices.
h
7. Load Balancing : Supports equal-cost multi-path (ECMP) routing for better bandwidth utilization.
b
Disadvantages of OSPF
@
1. Complex Configuration : More difficult to configure and manage compared to simpler protocols like RIP.
2. High Resource Usage : Requires more CPU and memory due to frequent updates and complex calculations.
3. Bandwidth Consumption : Flooding of link-state advertisements can consume significant bandwidth in large networks.
4. Initial Learning Curve : Requires deeper understanding of networking concepts for effective deployment.
5. Sensitive to Misconfiguration : Errors in area design or router settings can lead to routing issues.
51
Lecturer : Mrs. Mrinali R. Bhalerao
Metric Used
o m r
Cost (based on bandwidth, delay, etc.)
Convergence Speed
Scalability
Slow
a l e ra Fast
Update Method
Bandwidth Usage
Authentication Support
Hierarchical Design @ b h
Periodic full table updates
Low
Basic
Not supported
Event-driven updates with link-state advertisements
Protocol Type Interior Gateway Protocol (IGP) Interior Gateway Protocol (IGP)
Examples of Use Small office or simple LAN setups Enterprise networks, ISPs, large-scale infrastructure
Standardization Defined in RFC 1058 Defined in RFC 2328 (OSPFv2), RFC 5340 (OSPFv3 for IPv6) 52
Lecturer : Mrs. Mrinali R. Bhalerao
r
• The principle of path vector routing is similar to
that of distance vector routing.
• It assumes that there is one node in each
rao m
autonomous system that acts on behalf of the
h
entire autonomous system is called Speaker
a l e
node .
@ b
• The speaker node in an AS creates a routing
cable and advertises to the speaker node in the
neighboring ASs
• .A speaker node advertises the path, not the
metrics of the nodes, in its autonomous system
or other autonomous systems 53
Lecturer : Mrs. Mrinali R. Bhalerao
• It is the initial table for each speaker node in a system made four ASs. Here Node A1 is the speaker node
for AS1, B1 for AS2, C1 for AS3 and D1 for AS4, Node A1 creates an initial table that shows A1 to A5 and
r
these are located in AS1, it can be reached through it
ra m
• A speaker in an autonomous system shares its table with immediate neighbours ,here Node A1 share its
o
table with nodes B1 and C1 , Node C1 share its table with nodes A1,B1 and D1 , Node B1 share its table
a l e
with nodes A1 and C1 , Node D1 share its table with node C1
h
b
• If router A1 receives a packet for nodes A3 , it knows that the path is in AS1,but if it receives a packet for
@
D1,it knows that the packet should go from AS1,to AS2 and then to AS3 ,then the routing table shows
that path completely on the other hand if the node D1 in AS4 receives a packet for node A2,it knows it
should go through AS4,AS3,and AS1,
• Border Gateway Protocol (BGP) is an example of a path vector protocol.
54
Lecturer : Mrs. Mrinali R. Bhalerao
Disadvantages of Path Vector Routing
1. Complex Configuration : Requires detailed setup and policy definitions, which can be error-prone and time-
consuming.
2. Slow Convergence : Compared to protocols like OSPF, BGP (which uses path vector routing) converges more slowly
r
after network changes.
networks.
ra o m
3. High Resource Usage : Needs more CPU and memory to process and store path information, especially in large-scale
h
not carefully managed.
a l e
4. Policy Conflicts : Routing decisions are based on policies, which can lead to inconsistent behavior or routing loops if
b
5. Security Vulnerabilities : Susceptible to route hijacking and misconfigurations unless additional security measures
@
(like RPKI) are implemented.
6. Limited Loop Prevention : While AS path helps prevent loops, it’s not foolproof and can be bypassed in certain
attack scenarios.
7. Scalability Challenges : Although designed for large networks, managing thousands of routes and policies can
become complex and difficult to maintain.
55
Lecturer : Mrs. Mrinali R. Bhalerao
r
routing.
• The current version of BGP is version 4 (BGP4).
• BGP4 allows two routers in different routing domains
ra o m
h a l
facilitate data forwarding across domain borders.
e
(Autonomous Systems) to exchange routing information to
BGP Session
@ b
• In BGP, routing information exchange between two routers occurs in a session.
• A session is a connection established between two BGP routers solely for exchanging routing information.
• BGP uses TCP to create a reliable environment.
• A BGP session at the application level is a TCP connection, but it differs from other applications because:
• A TCP connection for BGP can last a long time unless something unusual occurs.
56
• BGP sessions are often referred to as semi-permanent connections.
Lecturer : Mrs. Mrinali R. Bhalerao
r
• Internal BGP (I-BGP): (Mentioned but not elaborated in the image)
ra m
• The I-BGP session in BGP is used to exchange routing information between two routers inside an autonomous system.
o
• The session established between AS1 and AS2 is an E-BGP session. The two speaker routers exchange information they
know about networks in the Internet
h a l e
• However, these two routers need to collect information from other routers in the autonomous systems.
b
• This is done using I-BGP sessions.
@
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
header.
a l e ra
message type, a data portion might or might not follow the
@ b h
• Marker is a 16-octet field that is used to detect loss of synchronization between BGP peers and to authenticate messages
when authentication is supported. If the message type is Open or if the Open message contains no authentication
information, the Marker field is set to all 1s. Otherwise, the value of the marker can be predicted by some computation as
part of the authentication process.
• Length is a 0-octet field that indicates the total length of the message, including the header, in octets.
• Type is a 0-octet field specifying the message type. Possible type codes – 1 (Open), 2 (Update), 3 (notification), 4
(Keepalive). 58
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
The BGP Open message contains the following fields:
a l e ra
• Version ” A 1-octet field specifying the BGP version running
h
BGP Open Message Format
b
on the originator.
@
• My Autonomous System ” A 2-octet field specifying the AS number of the originator.
• Hold Time ” A 2-octet number indicating the number of seconds the sender proposes for the hold time. A receiver
compares the value of the Hold Time field and the value of its configured hold time and accepts the smaller value or
rejects the connection. The hold time must be either 0 or at least 3 seconds.
• BGP Identifier ” The router ID of the originator. A Cisco router sets its router ID as either the highest IP address of any of
its loopback interfaces or, if no loopback interface is configured, the highest IP address of any of its physical interfaces. 59
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
octet type field, a 1-octet length field, and a variable-length field containing the parameter value.
l
The BGP Update message contains the following fields:
a e ra
h
• Unfeasible Routes Length ” A 2-octet field indicating the total length of the following
b
Withdrawn Routes field, in octets. A value of zero indicates that no routes are being
@
withdrawn and that no Withdrawn Routes field is included in the message.
• Withdrawn Routes ” A variable-length field containing a list of routes to be
withdrawn from service. Each route in the list is described with a (Length, Prefix)
tuple in which the Length is the length of the prefix and the Prefix is the IP address
prefix of the withdrawn route. If the Length part of the tuple is zero, the Prefix
60
Update Message Format
matches all routes.
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
attribute is a variable-length triple of (Attribute Type, Attribute Length, Attribute Value). The Attribute Type part of the
triple is a 2-octet field consisting of four flag bits, four unused bits, and an Attribute Type code
a l e ra
❑ Keepalive Message are exchanged on a period one-third the hold time, but not less than 1 second. If the negotiated
hold time is 0, Keepalives are not sent. The Keepalive message consists of only the 19-octet BGP message header, with
@ b h
no additional data.
❑ Notification Message : are sent when an error condition is detected . The BGP connection is closed immediately
after the message is sent
61
Lecturer : Mrs. Mrinali R. Bhalerao
r
codes and associated error subcodes.
ra m
▪ Data ” A variable-length field used to diagnose the reason for the error. The contents of the Data field depend on the
o
h a l e
@ b
62
Lecturer : Mrs. Mrinali R. Bhalerao
r
Error
3 Bad message type 3 Missing well-known attribute
1
2
Unsupported version number
Bad peer AS
ra Update
o m 4
5
Attribute flags error
Attribute length error
e
Open Message 3 Bad BGP identifier 3 6 Invalid ORIGIN attribute
l
2 Message Error
a
Error 4 Unsupported optional parameter 7 AS routing loop
h
5 Authentication failure 8 Invalid NEXT_HOP attribute
b
6 Unacceptable hold time 9 Optional attribute error
@
10 Invalid network field
11 Malformed AS_PATH
Hold Timer
BGP Notification Message Error Codes and 4 ”
Expired
Error Subcodes Finite State
5 ”
Machine Error
6 Cease ”
63
Lecturer : Mrs. Mrinali R. Bhalerao
Internet Control Message Protocol (ICMP)
• Internet Control Message Protocol is at the network layer and mostly utilized on network equipment like
routers and is utilized for error handling at the network layer.
• Since IP does not have an inbuilt mechanism for sending error and control messages. It depends on Internet
Control Message Protocol(ICMP) to provide error control.
o m r
• For instance, when a message is sent to its intended recipient, it may be intercepted along the route from the
sender.
a l e ra
h
• The sender may believe that the communication has reached its destination if no one reports the problem.
@ b
If a middleman reports the mistake, ICMP helps in notifying the sender about the issue.
• For example, if a message can't reach its destination, if there's network congestion, or if packets are lost, ICMP
sends back feedback about these issues.
• This feedback is essential for diagnosing and fixing network problems, making sure that communication can be
adjusted or rerouted to keep everything running smoothly
64
Lecturer : Mrs. Mrinali R. Bhalerao
Types of ICMP Messages
Type Code Description Type Code Description
0 - Echo Reply 0 Echo reply 9 - Router
0
0 Destination network unreachable Advertisement Use to discover the addresses of
10 - Router operational routers
r
1 Destination host unreachable 0
Solicitation
2 Destination protocol unreachable
m
3 - Destination 0 Time to live exceeded in transit
o
3 Destination port unreachable 11 - Time
Unreachable
a
Exceeded 1 Fragment reassembly time exceeded.
r
Fragmentation is needed and the DF
4
e
0 The pointer indicates an error.
l
flag set
12 - Parameter
a
5 Source route failed 1 Missing required option
h
Problem
2 Bad length
b
Redirect the datagram for the
0
network 13 -
@
0 Used for time synchronization
1 Redirect datagram for the host Timestamp
5 - Redirect 14 -
Message Redirect the datagram for the Type of
2 Timestamp 0 Reply to Timestamp message
Service and Network
Reply
Redirect datagram for the Service
3
and Host
8 - Echo
0 Echo request
Request
65
Lecturer : Mrs. Mrinali R. Bhalerao
ICMP Packet Format
• Type (8-bit): The initial 8-bit of the packet is for
message type, it provides a brief description of the
message so that receiving network would know what
r
kind of message it is receiving and how to respond to
m
it. Some common message types are as follows:
• Type 0 - Echo reply
• Type 3 - Destination unreachable
l ra o
• Checksum (16-bit): Last 16 bits are for the checksum field in the ICMP
e
a
• Type 5 - Redirect Message packet header. The checksum is used to check the number of bits of
@ b
• Type 11 - Time Exceeded
h
• Type 12 - Parameter problem
• Code (8-bit): Code is the next 8 bits of the ICMP packet
the complete message and enable the ICMP tool to ensure that
complete data is delivered.
• The next 32 bits of the ICMP Header are Extended Header which has
the work of pointing out the problem in IP Message. Byte locations are
format, this field carries some additional information identified by pointer which causes problem message and receiving
about the error message and type. device looks here for pointing to the problem.
• The last part of the ICMP packet is Data or Payload of variable length.
66
The bytes included in IPv4 are 576 bytes and in IPv6, 1280 bytes.
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
e
•Unused: Reserved for future use and is set to zero. The
a l
computer that receives an ICMP message must not use the
ra
value in this field.
@ b h
•Data: Includes the IP header of the datagram that was
received and also the first eight bytes of data in the IP
datagram. This will be used by the sender to get more details
about the error that has occurred.
67
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
Sample Questions
a l e ra
@ b h
68
Lecturer : Mrs. Mrinali R. Bhalerao
Sample Questions
1. What is Routing ? 14. Describe BGP packet format?
2. Explain Inter-domain and Intra-domain in detail. 15. Explain types of messages of ICMP?
3. Explain Distance Vector Routing Protocol with Example 16. Explain message format of ICMP?
4. What is Link state routing?
5. With the help of example, explain Bellman-Ford routing
o m r
17. Explain message format of ICMP-error reporting message?
18. Define Inter-domain routing?
Algorithm?
6. What is RIP?
b h
7. Describe OSPF in detail
@
8. Explain BGP in detail
9. What is Internet?
10. Explain Routing Table?
21. List all four routing algorithms
22. Differentiate between distance vector routing and link
stake routing?
23. Describe RIP message format in detail
11. Describe Path Vector Routing with example 24. Explain distance vector routing and open shortest path
12. Explain RIP messages with diagram first routing protocol in detail
13. With the help of diagram describe OSPF frame format? 25. Explain ICMP protocol with its Header format? 69
Lecturer : Mrs. Mrinali R. Bhalerao
Sample Questions
26. Compare link state routing and distance vector routing
27. Compare Dynamic and Static Routing
28. Explain any three Intra-Domain routing protocol
29. Enlist any four feature of OSPF. Explain any two OSPF feature in brief?
30. Compare distance vector routing and link state routing w.r.t
o m r
e ra
i) concept ii) Information sharing iii) Algorithm used iv) Convergence v) Problem in Protocol vi) Example protocol
a l
@ b h
70
Lecturer : Mrs. Mrinali R. Bhalerao
o m r
Thank You….!!!
a l e ra
@ b h
71