0% found this document useful (0 votes)
8 views

Routing Protocols

Routing Protocols

Uploaded by

RASMIYA RASMIYA
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 views

Routing Protocols

Routing Protocols

Uploaded by

RASMIYA RASMIYA
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
You are on page 1/ 58

Network Layer –

Network Layer –
Routing Protocol Routing
Protocol
Popular routing protocols

Routing Information Protocol (RIP)


Open Shortest Path First (OSPF)
Border Gateway Protocol (BGP)

TCP/IP Protocol Suite 2


Graph abstraction: link costs
5
ca,b: cost of direct link connecting a and b
v 3 w e.g., cw,z = 5, cu,z = ∞
2 5
u 2 1 z
3 cost defined by network operator:
1 2
x y could always be 1, or inversely related
1
to bandwidth, or proportionally related
to congestion
graph: G = (N,E)
N: set of routers = { u, v, w, x, y, z }
E: set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

Network Layer: 5-3


Routing algorithm classification
global: all routers have complete
topology, link cost info
• “link state” algorithms
How fast
dynamic: routes change
do routes static: routes change more quickly
change? slowly over time • periodic updates or in
response to link cost
changes
decentralized: iterative process of
computation, exchange of info with neighbors
• routers initially only know link costs to
attached neighbors
• “distance vector” algorithms
global or decentralized information? Network Layer: 5-4
Network layer: “control plane” roadmap
▪ introduction
▪ routing protocols
▪ distance vector
▪ link state
▪ intra-ISP routing: OSPF
▪ routing among ISPs: BGP ▪ network management,
▪ SDN control plane configuration
▪ Internet Control Message • SNMP
Protocol • NETCONF/YANG

Network Layer: 5-5


Distance vector algorithm
• Based on Bellman-Ford (BF) equation (dynamic programming): B-F enables us to
build a new least cost path from previously established least cost paths.
Bellman-Ford equation

Let Dx(y): cost of least-cost path from x to y.


Then:
Dx(y) = min{ cx,v + Dv(y) }

v’s estimated least-cost-path cost to y


min taken over all neighbors v of x direct cost of link from x to v
Network Layer: 5-6
The fact behind Bellman-Ford algorithm

TCP/IP Protocol Suite 7


Bellman-Ford Example
Suppose that u’s neighboring nodes, x,v,w, know that for destination z:
Dv(z) = 5 Dw(z) = 3 Bellman-Ford equation says:
5
Du(z) = min { cu,v + Dv(z),
3 w
v 5 cu,x + Dx(z),
2
u 2 1 z cu,w + Dw(z) }
3
1 2
= min {2 + 5,
x 1
y 1 + 3,
5 + 3} = 4
Dx(z) = 3
node achieving minimum (x) is
next hop on estimated
least-cost path to destination
(z) Network Layer: 5-8
Distance vector algorithm
key idea:
▪ from time-to-time, each node sends its own distance vector estimate
to neighbors
▪ when x receives new DV estimate from any neighbor, it updates its
own DV using B-F equation:
Dx(y) ← minv{cx,v + Dv(y)} for each node y ∊ N

▪ the estimate Dx(y) converge to the actual least cost dx(y)

Network Layer: 5-9


Distance vector algorithm:
each node: iterative, asynchronous: each local
iteration caused by:
wait for (change in local link ▪ local link cost change
cost or msg from neighbor) ▪ DV update message from neighbor

recompute DV estimates using distributed, self-stopping: each


node notifies neighbors only when
DV received from neighbor its DV changes
▪ neighbors then notify their
if DV to any destination has neighbors – only if necessary
changed, notify neighbors ▪ no notification received, no
actions taken!

Network Layer: 5-10


Distance vector: example
DV in a:
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
Da(d) = 1 8 1
Da(e) = ∞
t=0 Da(f) = ∞
1 1
Da(g) = ∞
Da(h) = ∞
▪ All nodes have Da(i) = ∞
distance estimates
to nearest A few asymmetries:
d e f ▪ missing link
neighbors (only) 1 1
▪ larger cost
▪ All nodes send
their local
distance vector to 1 1 1
their neighbors

g h i
1 1

Network Layer: 5-11


Distance vector example: iteration

a b c
8 1

t=1 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1

Network Layer: 5-12


Distance vector example: iteration

a
compute compute
b compute
c
8 1

t=1 1 1
All nodes:
▪ receive distance
vectors from
neighbors d
compute e
compute compute
f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g
compute h
compute i
compute
1 1

Network Layer: 5-13


Distance vector example: iteration

a b c
8 1

t=1 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1

Network Layer: 5-14


Distance vector example: iteration

a b c
8 1

t=2 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1

Network Layer: 5-15


Distance vector example: iteration

compute
a compute
b compute
c
2 1

t=2 1 1
All nodes:
▪ receive distance
vectors from
neighbors d
compute compute
e compute
f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g
compute compute
h compute
i
8 1

Network Layer: 5-16


Distance vector example: iteration

a b c
8 1

t=2 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1

Network Layer: 5-17


Distance vector example: iteration

…. and so on

Let’s next take a look at the iterative computations at nodes

Network Layer: 5-18


DV in b: DV in c:
Distance vector example: computation Db(a) = 8 Db(f) = ∞ Dc(a) = ∞
Dc(b) = 1
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
DV in a: Dc(d) = ∞
Db(e) = 1 Db(i) = ∞
Da(a)=0
Dc(e) = ∞
Da(b) = 8
Dc(f) = ∞
Da(c) = ∞ a b c Dc(g) = ∞
Da(d) = 1 8 1
Dc(h) = ∞
Da(e) = ∞
Dc(i) = ∞
t=1 Da(f) = ∞
1 1
Da(g) = ∞
▪ b receives DVs Da(h) = ∞ DV in e:
from a, c, e Da(i) = ∞ De(a) = ∞
De(b) = 1
d e f De(c) = ∞
1 1 De(d) = 1
De(e) = 0
De(f) = 1
1 1 1 De(g) = ∞
De(h) = 1
De(i) = ∞

g h i
1 1

Network Layer: 5-19


DV in b: DV in c:
Distance vector example: computation Db(a) = 8 Db(f) = ∞ Dc(a) = ∞
Dc(b) = 1
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
DV in a: Dc(d) = ∞
Db(e) = 1 Db(i) = ∞
Da(a)=0
Dc(e) = ∞
Da(b) = 8
Dc(f) = ∞
Da(c) = ∞ a b c Dc(g) = ∞
Da(d) = 1 8 compute 1
Dc(h) = ∞
Da(e) = ∞
Dc(i) = ∞
t=1 Da(f) = ∞
1 1
Da(g) = ∞
▪ b receives DVs Da(h) = ∞ DV in e:
from a, c, e, Da(i) = ∞ De(a) = ∞
computes: e
De(b) = 1
d e f De(c) = ∞
1
Db(a) = min{cb,a+Da(a), cb,c +Dc(a), cb,e+De(a)} = min{8,∞,∞} =8 1 De(d) = 1
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1 De(e) = 0
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2 De(f) = 1
1 1 1 De(g) = ∞
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +De(e)} = min{∞,∞,1} = 1
De(h) = 1
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2
DV in b:
De(i) = ∞
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = ∞ Db(a) = 8 Db(f) =2
g h D (c) = 1 Db(g)
i =∞
1 ∞, 2} = 2
Db(h) = min{cb,a+Da(h), cb,c +Dc(h), c b,e+De(h)} = min{∞, 1Db(d) = 2
b
Db(h) = 2
Db(i) = min{cb,a+Da(i), cb,c +Dc(i), c b,e+De(i)} = min{∞, ∞, ∞} = ∞ Db(e) = 1 Db(i) = ∞
Network Layer: 5-20
DV in b: DV in c:
Distance vector example: computation Db(a) = 8 Db(f) = ∞ Dc(a) = ∞
Dc(b) = 1
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
DV in a: Dc(d) = ∞
Db(e) = 1 Db(i) = ∞
Da(a)=0
Dc(e) = ∞
Da(b) = 8
Dc(f) = ∞
Da(c) = ∞ a b c Dc(g) = ∞
Da(d) = 1 8 1
Dc(h) = ∞
Da(e) = ∞
Dc(i) = ∞
t=1 Da(f) = ∞
1 1
Da(g) = ∞
▪ c receives DVs Da(h) = ∞ DV in e:
from b Da(i) = ∞ De(a) = ∞
De(b) = 1
d e f De(c) = ∞
1 1 De(d) = 1
De(e) = 0
De(f) = 1
1 1 1 De(g) = ∞
De(h) = 1
De(i) = ∞

g h i
1 1

Network Layer: 5-21


DV in b: DV in c:
Distance vector example: computation Db(a) = 8 Db(f) = ∞ Dc(a) = ∞
Dc(b) = 1
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Dc(e) = ∞
Dc(f) = ∞
a b c
compute Dc(g) = ∞
8 1
Dc(h) = ∞
Dc(i) = ∞
t=1 1 1
▪ c receives DVs
from b computes:

d b(a}} = 1 + 8 = 9
Dc(a) = min{cc,b+D e f
DV in c:
Dc(b) = min{cc,b+Db(b)} = 1 + 0 = 1
Dc(a) = 9
Dc(d) = min{cc,b+Db(d)} = 1+ ∞ = ∞ Dc(b) = 1
Dc(e) = min{cc,b+Db(e)} = 1 + 1 = 2 Dc(c) = 0
Dc(d) = 2
Dc(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞
Dc(e) = ∞
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞ * Check out the online interactive
Dc(f) = ∞ exercises for more examples:
Dc(h) = min{cbc,bg+Db(h)} = 1+ ∞ = ∞ h Dc(g) = ∞ i http://gaia.cs.umass.edu/kurose_ross/interactive/
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞ Dc(h) = ∞
Dc(i) = ∞
Network Layer: 5-22
DV in b:
Distance vector example: computation Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ DV in e:
DV in d: Db(e) = 1 Db(i) = ∞
De(a) = ∞
Dc(a) = 1 De(b) = 1
Dc(b) = ∞ a De(c) = ∞
b c
Dc(c) = ∞ 8 1 De(d) = 1
Dc(d) = 0 De(e) = 0
t=1 Dc(e) = 1
Dc(f) = ∞ 1
Q: what is new DV computed in e at
1t=1?
De(f) = 1
De(g) = ∞
▪ e receives DVs Dc(g) = 1 De(h) = 1
from b, d, f, h Dc(h) = ∞ De(i) = ∞
Dc(i) = ∞
d compute
e f DV in f:
DV in h: 1 1
Dc(a) = ∞
Dc(a) = ∞ Dc(b) = ∞
Dc(b) = ∞ Dc(c) = ∞
Dc(c) = ∞ 1 1 1 Dc(d) = ∞
Dc(d) = ∞ Dc(e) = 1
Dc(e) = 1 Dc(f) = 0
Dc(f) = ∞ Dc(g) = ∞
Dc(g) = 1 g h i Dc(h) = ∞
1 1
Dc(h) = 0 Dc(i) = 1
Dc(i) = 1 Network Layer: 5-23
Distance vector: state information diffusion
Iterative communication, computation steps diffuses information through network:
t=0 c’s state at t=0 is at c only
a b c
8 1
c’s state at t=0 has propagated to b, and
t=1 may influence distance vector computations
up to 1 hop away, i.e., at b 1 1 t=1
t=2
c’s state at t=0 may now influence distance
t=2 vector computations up to 2 hops away, i.e.,
d e f
at b and now at a, e as well 1 1
c’s state at t=0 may influence distance vector
t=3 computations up to 3 hops away, i.e., at b,a,e
1 1 1 t=3
and now at c,f,h as well
c’s state at t=0 may influence distance vector
t=4 computations up to 4 hops away, i.e., at b,a,e, g h i
1 1
c, f, h and now at g,i as well t=4
Distance vector: link cost changes
1
link cost changes: y
4 1
▪ node detects local link cost change x z
▪ updates routing info, recalculates local DV 50

▪ if DV changes, notify neighbors

t0 : y detects link-cost change, updates its DV, informs its neighbors.


“good news t1 : z receives update from y, updates its table, computes new least
travels fast” cost to x , sends its neighbors its DV.
t2 : y receives z’s update, updates its distance table. y’s least costs
do not change, so y does not send a message to z.

Network Layer: 5-25


Distance vector: link cost changes
link cost changes: 60
▪ node detects local link cost change 4
y
1
▪ “bad news travels slow” – count-to-infinity problem: x
50
z

• y sees direct link to x has new cost 60, but z has said it has a path at cost of 5. So
y computes “my new cost to x will be 6, via z); notifies z of new cost of 6 to x.
• z learns that path to x via y has new cost 6, so z computes “my new cost to
x will be 7 via y), notifies y of new cost of 7 to x.
• y learns that path to x via z has new cost 7, so y computes “my new cost to
x will be 8 via y), notifies z of new cost of 8 to x.
• z learns that path to x via y has new cost 8, so z computes “my new cost to
x will be 9 via y), notifies y of new cost of 9 to x.

▪ Distributed algorithms are tricky!
Network Layer: 5-26
Split Horizon
• Split horizon is a method used by distance vector protocols
to prevent network routing loops.
• The basic principle is simple: Never send routing information
back in the direction from which it was received.
• Instead of flooding the table through each interface, each
node sends only part of its table through each interface
• E.g. node B thinks that the optimum route to reach X is via A,
it does not need to advertise this piece of information to A.

TCP/IP Protocol Suite 27


RIP
The Routing Information Protocol (RIP) is an
intra-domain (interior) routing protocol used
inside an autonomous system. It is a very simple
protocol based on distance vector routing. RIP
implements distance vector routing directly with
some considerations.

TCP/IP Protocol Suite 28


RIP messages
• 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
(30s or when there is a change in the routing
table)

TCP/IP Protocol Suite 29


Limitations of RIP/DV
• Count to infinity problem. RIP limits the hop count to 15 hops. (Not
suitable in large network where number of routers are more than 15)

• The algorithm is slow to converge, needs information from all the


nodes.

• Signaling overhead – Periodic broadcasting of DV.


Popular routing protocols

TCP/IP Protocol Suite 31


Network Layer –
Network Layer –
Routing Protocol Routing
Protocol

Indian Institute of Technology Bhilai


Popular routing protocols

TCP/IP Protocol Suite 33


Routing algorithm classification
global: all routers have complete
topology, link cost info
• “link state” algorithms

How fast
dynamic: routes change
do routes static: routes change more quickly
change? slowly over time • periodic updates or in
response to link cost
changes
decentralized: iterative process of
computation, exchange of info with neighbors
• routers initially only know link costs to
attached neighbors
• “distance vector” algorithms
global or decentralized information? 34
Link state routing
• Link state routing has a different philosophy from that of
distance vector routing.
• In link state routing, each node in the domain has the entire
topology of the domain—the list of nodes and links, how they
are connected including the type, cost (metric), and the
condition of the links (up or down)—the node can use the
Dijkstra algorithm (single source shortest path) to build a routing
table.
• OSPF (Open Shortest path First)

TCP/IP Protocol Suite


Flooding
Basic Idea – LSR/OSPF
• Discover neighbors and learn their network addresses – Hello Message
• Set the distance or cost metric to each of the neighbors
• Construct a packet telling all it has learned [neighbor link state info]
• Broadcast this packet – every router periodically learns the link state of the
network graph
• Compute the shortest path (using Dijkstra Algo) to every other routers
Link state knowledge and Link state packets

-> Each Node shares the link state packet to all the nodes in the network.
TCP/IP Protocol Suite 38
Concept of Link state routing

TCP/IP Protocol Suite 39


Building Routing Tables
• Creation of the states of the links by each node, called the link state
packets (LSP)
•Spreading of LSPs to every other routers, called flooding
•Formation of a shortest path tree for each node
•Calculation of a routing table based on the shortest path tree

TCP/IP Protocol Suite 40


Creation of LSP
•LSP data: E.g. the node ID, the list of links, a sequence
number, and age.
•LSP Generation
•When there is a change in the topology of the
domain
•On a periodic basis

TCP/IP Protocol Suite 41


OSPF
The Open Shortest Path First (OSPF) protocol is
an intra-domain routing protocol based on link
state routing.

TCP/IP Protocol Suite 42


Making routing scalable
our routing study thus far - idealized

… not true in practice

scale: billions of destinations: administrative autonomy:


▪ can’t store all destinations in ▪ Internet: a network of networks
routing tables! ▪ each network admin may want to
control routing in its own network

43
Interconnected ASs
forwarding table configured by intra-
and inter-AS routing algorithms
▪ intra-AS routing determine entries for
Intra-AS Inter-AS
Routing Routing

forwarding destinations within AS


▪ inter-AS & intra-AS determine entries
table

for external destinations

intra-AS
3
routing
c 3a 2
intra-AS
3b 2a routing
c 2
1
AS3 intra-AS
inter-AS b
crouting1
1a routing AS2
1
b AS1
d
44
Inter-AS routing: a role in intradomain forwarding
▪ suppose router in AS1 receives datagram destined
outside of AS1: AS1 inter-domain routing must:
1. learn which destinations reachable
• router should forward packet to through AS2, which through AS3
gateway router in AS1, but which 2. propagate this reachability info to all
one? routers in AS1

3
3a other
2
3b c 2a networks
c 2
1
AS3 b
other 1a c 1 AS2
networks
1
b AS1
d
45
Hierarchical OSPF
▪ two-level hierarchy: local area, backbone.
• link-state advertisements flooded only in area, or backbone
• each node has detailed area topology; only knows direction to reach
other destinations
area border routers: boundary router:
“summarize” distances to connects to other ASes
backbone
destinations in own area, backbone router:
advertise in backbone runs OSPF limited
to backbone
local routers:
• flood LS in area only area
• compute routing within 3
area
internal
• forward packets to outside routers
area
via area border router
1 area
46
2
Routing Protocol – BGP
Popular routing protocols

IGP EGP

TCP/IP Protocol Suite 48


Types of AS
• Stub AS
– Only one connection to another AS (only a
source or sink for data traffic) – configure
Default route as you have only one path

• Multihomed AS
– More than one connection to other AS, but it is
still only a source or sink for data traffic – BGP
can be used for routing (path manipulation).

• Transit AS (ISPs)
– Multihomed AS that also allows transient
traffic – BGP for routing
TCP/IP Protocol Suite 49
Path Vector Routing
• Distance vector and link state routing are both interior routing protocols. They
can be used inside an autonomous system.

• Both of these routing protocols become unmanageable when the domain of


operation becomes large.

• Distance vector routing is subject to instability if there is more than a few hops
in the domain of operation.

• Link state routing needs a huge amount of resources to calculate routing tables.
It also creates heavy traffic because of flooding.

• There is a need for a third routing protocol which we call path vector routing.

TCP/IP Protocol Suite


Path Vector Routing Cont..

• The difference between the distance vector routing and path


vector routing can be compared to the difference between a
national map and an international map.

• A national map can tell us the road to each city and the distance
to be traveled if we choose a particular route; an international
map can tell us which cities exist in each country and which
countries should be passed before reaching that city.

TCP/IP Protocol Suite 51


Path Vector Routing Cont..

• Path Vector Routing is a routing algorithm in unicast routing protocol of


network layer, and it is useful for interdomain routing.
• The principle of path vector routing is similar to that of distance vector
routing.
• It assumes that there is one node in each autonomous system that acts on
behalf of the entire autonomous system is called Speaker node.
• The speaker node in an AS creates a routing cable and advertises to the
speaker node in the neighbouring ASs.

TCP/IP Protocol Suite 52


● A speaker in an autonomous system shares its table with immediate
neighbours ,here Node A1 share its table with nodes B1 and C1 ,
Node C1 share its table with nodes A1,B1 and D1, Node B1 share
its table with nodes A1 and C1 , Node D1 share its table with node
C1
Reachability

TCP/IP Protocol Suite 55


Stabilized table for three autonomous system

TCP/IP Protocol Suite 56


Routing tables after aggregation

TCP/IP Protocol Suite 57


Check out NIT Calicut AS Interconnections
(BGP)
• What is my IP -> Get the public IP address

• Find out AS number using ASN lookup (from IP address)


• https://mxtoolbox.com/asn.aspx

• Check the AS interconnections (BGP)


• https://rex.apnic.net/as-interconnections?economy=IN&allocationType=ipv4,ipv6

• BGP route update message


• https://stat.ripe.net/widget/looking-glass
• You can search with your public IP.

You might also like