Unit 4 Routing and Protocols
Unit 4 Routing and Protocols
Unit 4
CS3591 Computer Networks
Routing and Protocols
• Routing refers to the process of selecting a
path for traffic in a network, based on certain
criteria such as cost, available bandwidth, and
network topology.
– Path determination: Routing determines the best path for data to travel from the source
to the destination based on factors such as network topology, available bandwidth, and
network congestion.
– Traffic prioritization: Routing can prioritize different types of traffic based on their
importance or urgency. For example, voice or video traffic may be given higher priority
than email or file transfers.
– Load balancing: Routing can distribute traffic across multiple paths to balance the load on
different network links. This can help prevent network congestion and ensure that all
traffic reaches its destination in a timely manner.
– Redundancy: Routing can provide redundant paths for data to travel, which can increase
network availability and reliability. If one path fails, data can be rerouted through another
path.
Routing and Protocols
• Two key tables used in routing:
– the routing table and the forwarding table.
• Routing table:
– This table contains the routing information used by a router to determine
the best path for forwarding packets to their destination.
– The routing table typically includes information such as network addresses,
next-hop addresses, and the interface used to reach a particular network.
• Shortest Path First (SPF): This algorithm is used by the Open Shortest Path First (OSPF)
protocol and calculates the shortest path between the source and destination based on a
metric, such as the number of hops or the bandwidth available on each link.
• Distance Vector: This algorithm is used by Routing Information Protocol (RIP) and calculates
the distance or cost between the source and destination based on the number of hops. The
routing table is updated periodically based on information exchanged between routers.
• Link State: This algorithm is used by the OSPF protocol and calculates the shortest path
between the source and destination based on the entire network topology. Each router
maintains a database of all the network links and periodically exchanges information with
other routers to build a complete network topology.
• Border Gateway Protocol (BGP): This algorithm is used for routing between different
autonomous systems on the Internet. It selects the best path based on policy rules such as AS
path length and preference for certain providers.
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
• In a distance vector protocol(Bellman Ford
Routing Algorithm), each router maintains a
table of the distances to all possible
destinations, as well as the next hop router
that packets should be sent to. The router
then periodically broadcasts its routing table
to its neighbors, and receives updates from its
neighbors' routing tables.
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
• Link-state routing is a type of routing algorithm used
in computer networks that builds a complete map of
the network topology.
• Each node in the network independently calculates
the shortest path to every other node, based on the
information gathered about the network topology.
• This information is distributed to all the nodes in the
network using a routing protocol such as OSPF (Open
Shortest Path First) or IS-IS (Intermediate System to
Intermediate System).
Routing and Protocols
• The main advantage of link-state routing is
that it enables each node to have a complete
understanding of the network topology, which
allows for more efficient and accurate routing
decisions.
• Additionally, link-state routing protocols are
typically more robust and stable than other
routing algorithms, as they can quickly adapt
to changes in the network topology.
Routing and Protocols
• OSPF (Open Shortest Path First) is a type of Link State
routing protocol. It is used to determine the shortest path
for routing data packets through a network.
• OSPF is commonly used in large enterprise networks, as it
provides scalability and fast convergence times.
• In OSPF, each router maintains a database of information
about the network topology, which is known as the Link
State Database (LSDB).
• This information includes the status and cost of each link in
the network. Routers use this information to calculate the
shortest path to a destination.
Routing and Protocols
Routing and Protocols
• Let's consider an example of a large enterprise network with multiple
routers and switches. OSPF would be used to determine the shortest path
for routing data packets through this network.
• In this network, there are three areas, Area 0 (backbone area), Area 1,
and Area 2. The backbone area (Area 0) connects all other areas, and
routers in different areas communicate with each other through Area
Border Routers (ABRs).
• In OSPF, each router maintains a Link State Database (LSDB) that stores
information about the network topology. Each router sends link state
updates to its neighboring routers, which then use this information to
update their own LSDBs. This process ensures that all routers in the
network have the same information about the network topology.
Routing and Protocols
• For example, let's say Router A in Area 0 has a link to Router B in Area 1, and
Router C in Area 2 wants to send a data packet to a host in Area 1. Router C will
send the data packet to its default gateway, which is Router D in Area 2. Router D
will then forward the packet to Router E, which is an ABR between Area 1 and
Area 2.
• Router E will then use OSPF to determine the shortest path to the destination
host. It will consult its LSDB, which contains information about the cost and status
of each link in the network. Based on this information, Router E will determine
that the shortest path to the destination host is through Router B in Area 1.
• Router E will then forward the data packet to Router B, which will forward it to the
destination host. This process of using OSPF to determine the shortest path for
routing data packets ensures efficient and reliable routing in large enterprise
networks.
Routing and Protocols
• To understand the working of OSPF with an
example, let's consider a simple network
topology consisting of four routers, as shown
below:
Routing and Protocols
• In this example, each router is connected to two other routers, and
each link has a cost associated with it, represented by the numbers next
to the links.
• When OSPF is enabled on these routers, they will begin exchanging
information about their links using OSPF packets. Each router will send
information about its own links to its neighbors, who will in turn send
their information to their own neighbors, and so on, until all routers
have a complete picture of the network topology.
• Once the topology map is constructed, each router will use Dijkstra's
shortest path algorithm to calculate the shortest path to all other
routers in the network.
• For example, Router A will calculate the shortest path to Router B as 2
(the cost of the link between them), and the shortest path to Router D
as 3 (the sum of the costs of the links from A to C and from C to D).
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols
Routing and Protocols