Routing Protocols Overview
Routing Protocols Overview
Sankhayan Choudhury
Routing: Overview
• Routing is the most crucial design issue in layer 3.
• Routing is the process of establishing the routes (Via
intermediate nodes) that data packets must follow to reach the
destination.
• Each node must contain a routing table that holds the path to
reach all possible destinations with the assigned cost.
• In a simplest form, the attributes could be Destination, Next
hop and the cost for reaching the destination. The following
could be the routing table of a node A.
Destination Next Hop Cost (in hops)
A - -
B C 5
D B 4
08/09/2024 2
Routing: Classification
• Static: Contents of the routing table is fixed and entered manually
• Adaptive: The routing decision changes with the
– Changes in topology
– Changes in traffic density
08/09/2024 4
Flooding
• Duplications.....Major problem
• Solution:
• One such measure is to have a hop counter contained in
the header of each packet that is decremented at each hop,
The packet is discarded when the counter reaches zero.
• Ideally, the hop counter could be initialized by the full
diameter of the network i.e. the worst-case.
08/09/2024 5
Unicast Routing
A network can be modelled by a Graph; Minimum Spanning Tree
of a graph is a sub-graph having all the vertices and those vertices
are connected by a route having minimum cost. One of the these
algos is Dijkstra algorithm and can be used as a unicast routing
algorithm.
08/09/2024 6
Distance Vector (Bellman-Ford) Algorithm
Adaptive; Distributed Routing
Each node is exchanging information with their neighbours
Information to be exchanged is the information about the entire
network as captured by the specific neighbour node (Routing table)
Periodic updates; accordingly the routing tables are updated
Compute new route JG; JG = JA +AG/ JI+IG/ JH+HG/ JK+KG; 8+18/ 10+31/
12+6/ 6+31; Minimum cost is 18, Next hop to reach G from J will be H.
08/09/2024 7
Count-to-Infinity Problem
Good news propagate within a network in a satisfactory way
Bad news are propagating slowly; which is not desirable
08/09/2024 8
Link-State Routing
• Adaptive; Distributed Routing
• Each node is generating a packet that contains the local
information i.e. Information about the neighbours
• Each node floods the packet to all the nodes within the
network
• Each node have an accurate perception about the changed
topology of the network; thus the decision will be more
accurate compared to Distance Vector.
• Demands huge bandwidth due to flooding
• In general No Periodic updates; triggers whenever needed
08/09/2024 9
Link-State Routing
Age: Counter that ensures that a packet must exist a finite time within
network; Chances of congestion will be reduced
:
08/09/2024 10
Link-State Routing
• Discover its neighbours and learn their network
addresses.
• Set the distance or cost metric to each of its
neighbours.
• Construct a packet telling all it has just learned.
• Send this packet to and receive packets from all other
routers.
• Compute the shortest path to every other router.
08/09/2024 11
Hierarchical Routing
Routing table becomes large (more entries); More CPU time will be
needed to scan them and for subsequent routing decision; chances of
congestion will be more.......Solution : Hierarchical routing; No of
entries are less
08/09/2024 13
Broadcast : Reverse Path Forwarding
• When a broadcast packet arrives at a router, the router
checks to see if the packet arrived on the link that is
normally used (link within Sink Tree) for sending packets
toward the source of the broadcast. (Unicast Routing table
can be used for this purpose)
• There is an excellent chance that the broadcast packet itself
followed the best route from the router and is therefore the
first copy to arrive at the router. This being the case, the
router forwards copies of it onto all links except the one it
arrived on. If, however, the broadcast packet arrived on a
link other than the preferred one for reaching the source,
the packet is discarded as a likely duplicate.
08/09/2024 14
Broadcast Routing
08/09/2024 15
08/09/2024 16
IP (Logical) Addressing
• Identifier used to uniquely identify each device
connected to the Internet
• Two devices in Internet never have one IP at a time
instant; but one device may have more than one IP
addresses (Multi-homed devices) provided the device
has two connections in the Internet via two networks
• 32 bit address expressed in dotted decimal format e.g.
241.132.40.19
• Universal means all the nodes, interested to connect
in Internet, must accept it
08/09/2024 17
Classful IP Addressing
“class-full” addressing:
class
1.0.0.0 to
A 0 network host 127.255.255.255
B network 128.0.0.0 to
10 host
191.255.255.255
192.0.0.0 to
C 110 network host
223.255.255.255
224.0.0.0 to
D 1110 multicast address
239.255.255.255
32 bits
Classful Addressing
08/09/2024 19
Classful Addressing
08/09/2024 20
Masking
Masking is a process to find the netid from the given IP address.
For example, the mask for a class A address has eight 1s, which
means the first 8 bits of any address in class A define the netid; the
next 24 bits define the hostid.
Mask address of class A will be 11111111.0.0.0 and execute the bit
by bit AND ing with the given IP; you will get the network address.
08/09/2024 21
Classless Addressing
• The no of devices on Internet are still less than 2 32 but we
have run out of class A and B add, class C block is too small
for most midsize organizations.
• If an organization was granted a large block in class A or B, it
could divide the addresses into several contiguous groups and
assign each group to smaller networks, called subnets.
• The size of a class C block with a maximum number of 256
addresses did not satisfy the needs of most organizations. Even
a midsize organization needed more addresses. One solution is
to combine several class C blocks to create a largerrange of
addresses, called supernetting.
• Classless addressing addresses all the above said issues and
provides a single solution.
08/09/2024 22
Why Classless?
• What about a small Business House that requires only 16
address or a household that needed only 2 addresses?
• Suppose the mask for the first subnet is n1, then 232- n1 must be
32, which means that n1 =27.
• Suppose the mask for the second subnet is n2, then 232- n2 must be
16, whichmeans that n2 = 28.
• Suppose the mask for the third subnet is n3, then 232- n3 must be
16, which means that n3 =28.
• This means that we have the masks 27, 28, 28 with the
organization mask being 26.
08/09/2024 26
08/09/2024 27
An Example
• An ISP is granted a block of addresses starting with
190.100.0.0/16 (65,536 addresses). The ISP needs to distribute
these addresses to three groups of customers as follows:
• a. The first group has 64 customers; each needs 256 addresses.
• b. The second group has 128 customers; each needs 128
addresses.
• c. The third group has 128 customers; each needs 64
addresses.
Design the sub-blocks and find out how many addresses are
still available after these allocations.
08/09/2024 28
An Example
08/09/2024 29
An Example
08/09/2024 30
NAT
• Consumers want to create small networks with several
hosts and need an IP address for each host. With the
shortage of addresses, this is a serious problem.
• NAT (Network Address Translation) enables a user to have a
large set of addresses internally and one address, or a small set
of addresses, externally.
• Private IP (e.g. 172.16.0.0 to 172.31.255.255) and Public IP
concepts help to offer a solution.
• The site must have only one single connection to the global
Internet through a router that runs the NAT software. The
private network is transparent to the rest of the Internet; the rest
of the Internet sees only the NAT router
08/09/2024 31
NAT
08/09/2024 32
NAT
08/09/2024 33
NAT
• The NAT router may use a pool of global addresses.
• For example, instead of using only one global
address (200.24.5.8), the NAT router can use four
addresses (200.24.5.8, 200.24.5.9, 200.24.5.10, and
200.24.5.11) i.e. Four private network hosts can
communicate with the same external host at the same
time because each pair of addresses defines a
connection.
• No private-network host can access two external
server programs (e.g., HTTP and FTP) at the same
time.
08/09/2024 34
NAT
Suppose two hosts with addresses 172.18.3.1 and
172.18.3.2 inside a private network need to access the
HTTP server on external host 25.8.3.2.
08/09/2024 35
Intra & Inter Domain Routing
Internetwork is divided into smaller regions, called
Autonomous Systems (AS, as suggested in Hierarchical
Routing) for better scalability
08/09/2024 36
Routing Information Protocol
• Interior , Intra-AS routing; Working principle is Distance vector
Routing (Bellman–Ford Routing)
• In an AS, Only routers and networks (links) are considered. The
routers have routing tables; networks do not.
• The destination in a routing table is a network
• The metric used by RIP is very simple; the distance is defined as the
number of links (networks) to reach the destination. Thus the metric
is hop count.
• Infinity is defined as 16, which means that any route in an
autonomous system using RIP cannot have more than 15 hops.
• The next-node column defines the address of the router to which the
packet is to be sent to reach its destination.
08/09/2024 37
Open Shortest Path First - OSPF
08/09/2024 39
Transient Link
08/09/2024 42
Link State Advertisement
08/09/2024 43
Shortest Path Routing
08/09/2024 44
Path Vector Routing
• Inter AS routing
• Distance Vector & Link State are not used for Inter AS
routing
• The principle of path vector routing is similar to that of
distance vector routing.
• Speaker node is a special node within each AS that acts
on behalf of the entire autonomous system.
• The speaker node in an AS creates a routing table and
advertises it to speaker nodes in the neighbouring ASs.
• A speaker node advertises the path, not the metric of the
nodes.
08/09/2024 45
Path Vector Routing: Initialization
08/09/2024 46
Path Vector Routing: Sharing
08/09/2024 48
Multicasting vs. Multiple Unicasting
08/09/2024 50
Group Shared Tree Approach
08/09/2024 51
DVMRP
• Multicast distance vector algorithm uses a process based
on four decision-making strategies.
• Flooding
• Reverse Path Forwarding: RPF eliminates the loop in the
flooding process. RPF guarantees that each network
receives a copy of the multicast packet without
formation of loops.
• RPF does not guarantee that each network receives only
one copy; a network may receive two or more copies.
• The reason is that RPF is not based on the destination
address (a group address); forwarding is based on the
source address.
08/09/2024 52
DVMRP
08/09/2024 53
Reverse Path Broadcasting
Preventing duplication, only one parent router for each network is needed.
A network can receive a multicast packet from a particular source only
through a designated parent router.
RPB guarantees that the packet reaches every network and that every
network receives only one copy.
08/09/2024 54
Reverse Path Multicasting
08/09/2024 55