0% found this document useful (0 votes)
53 views74 pages

Routing Algorithms: Network Layer

Routing algorithms allow routers to determine the best path to send network traffic. Interior routing uses protocols like RIP and OSPF to route within an administrative domain, while exterior routing relies on the path-vector Border Gateway Protocol (BGP) to route between autonomous systems. Distance-vector protocols iteratively share routing tables with neighbors, while link-state protocols flood full topology information to allow each router to independently calculate shortest paths. BGP extends distance-vector routing to support routing policies between autonomous systems by exchanging path vectors that include the full route to each destination.

Uploaded by

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

Routing Algorithms: Network Layer

Routing algorithms allow routers to determine the best path to send network traffic. Interior routing uses protocols like RIP and OSPF to route within an administrative domain, while exterior routing relies on the path-vector Border Gateway Protocol (BGP) to route between autonomous systems. Distance-vector protocols iteratively share routing tables with neighbors, while link-state protocols flood full topology information to allow each router to independently calculate shortest paths. BGP extends distance-vector routing to support routing policies between autonomous systems by exchanging path vectors that include the full route to each destination.

Uploaded by

zollic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 74

1

NETWORK LAYER

ROUTING ALGORITHMS
ICTS 420 - Computer Networks #3
Wantanee Viriyasitavat
Assadarat Khurat
Thitinan Tantidham

*Some slides are borrowed from Aj. Boonsits, Stefan Savages and Peter Steenkistes lectures

What do we know so far?


When a packet arrives at a router, the router looks up in a

routing table to determine next hop

Destination

Next hop

This lecture: How to create a routing table

Cost

Routing protocols
Routing
Protocols
Unicast
Interior

RIP

OSPF

Exterior

BGP

Multicast
Interior

RIP

OSPF

Exterior

BGP

Interior vs Exterior

Interior (or Intra-domain) routing


Routing within a network/organization
A single administrative domain
The administrator can set edge costs
Overall goals
Provide intra-network connectivity
Adapt quickly to failures or topology changes
Optimize use of network resources
Non-goals
Extreme scalability
Lying, and/or disagreements about edge costs
Well deal with these when we talk about inter-domain routing

Internet = Weighted graph


Represent each router as node

Represent link between routers as edge


Cost of an edge represent the difficulty of using that link
Delay, $$, or congestion level
Task: Find a shortest path
2

Routes from node A


Dst

3
D

C
D

Count

4
E

Next hop

D
E
F
G

Properties:
Some of the shortest paths form a tree = Least-cost tree
Solutions may not be unique
A least-cost tree is a tree with the source router as the

root that spans the whole graph (visits all other nodes).
The path between the root and any other node is the shortest.

Least-Cost Trees

Ways to compute shortest paths


Centralized
Collect graph structure in one place
Routes are computed and routing tables are disseminated
Link-State Routing
Every node collects complete graph structure
Each node computers its shortest paths and its own routing table
Distance-Vector Routing
No node knows an entire view of the graph
Routing table are constructed iteratively
Each node sends info about its table to neighbors
Path-Vector Routing

10

Distance-vector method
Idea:
Initially, a node only has entries for
directly-connected nodes
Dst

3
D

4
E

D
F

Next hop

Count

11

Distance Vector Propagation


Each node sends its own DV
when
Local link cost change
Distance vector change

12

Distance Vector Propagation


First event: B receives a copy of As vector.

Min(2,2+0)
Min(0,2+2)
Min(5,2+--)
Min(--,2+3)
Min(4,2+--)
Min(--,2+--)
Min(--,2+--)

13

Distance Vector Propagation (2)


Second event: B receives a copy of Es vector.

Min(2,4+--)
Min(0,4+4)
Min(5,4+--)
Min(5,4+5)
Min(4,4+0)
Min(--,4+2)
Min(--,4+--)

14

Bellman-Ford Algorithm

Current
path

New path if go
through w

15

Until converge

16

Handling link failure


Nodes mark and broadcast its distance vector

17

Distance Vector Limitation


Count to Infinity
Good news travel fast, bad news travel slow (if a link is broken,
other routers will be updated much later).
Two-node Loop
Given that link between A and X is broken.
Problem will happen if news from B (B can reach X) arrives at A before

A updates B.
A will think that it can reach X via B!!!

18

Count to infinity problem

19

Solution (1) Split Horizon


Split Horizon
Never advertise a destination
through its next hop
If node B reaches X via A, B
does not advertise this
information to A (A should
already know).
If Split Horizon is used, A does
not know whether B does not
advertise X because B does
not know how to reach X or B
is using Split Horizon.

20

Solution (2) Poison Reverse


Poison Reverse
Due to the limitation of Split Horizon, B can still advertise X to A
but it has to give A the warning that Do not use this value; what
I know about this route comes from you.
i.e., B advertises to A that it is far from X.

A routes through B to C
so A tells B that it is very
far from C

21

Three-Node Instability
Split Horizon and Poison Reverse can be used to solve

two-node instability, but not three-node instability.


C

22

In practice
RIP: Routing Information Protocol
DV protocol with hop count as metric
Infinity value is 16 hops; limits network size
Includes split horizon with poison reverse
Routers send vectors every 30 seconds
With triggered updates for link failures
Time-out in 180 seconds to detect failures
Rarely used today

23

RIP Example (1)

24

RIP Example (2)

25

RIP Example (3)

26

Routing protocols
Routing
Protocols
Unicast
Interior

Exterior

RIP

OSPF

Distancevector

Linkstate

BGP

Multicast
Interior

RIP

OSPF

Exterior

BGP

27

Distance-vector vs Link-state
Distance-vector routing
Tell only neighbors its distance vector
Link-state routing
Tell every node its neighbor table (link state)
So each node has a complete map of network

28

Link-State Flooding
Each node can send its neighbor table (i.e., local map) to

all nodes in the network

29

Link-State Database (LSDB)


Each node needs to have a complete map of the network!
The collection of the state (weights/costs) of all links is

called link-state database (LSDB) which is depicted as


two-dimensional array (matrix) as shown:

30

Two phases in LS routing


Two phases
1. Reliable flooding:
tell every node what you know about local topology

2. Path calculation (Dijkstras algorithm):


each node computes the best path to all other nodes in the
network

Motivation
Global information allows optimal route computation

31

Dijkstras Algorithm

32

Example: Dijkstras Algorithm

33

In practice Link-state routing


OSPF (Open Shortest Path First)
Most widely used interior routing protocols
Run by almost all ISPs and many large organizations
Added many features:
Authentication of routing messages
Extra hierarchy: partition into routing areas
Load balancing: multiple equal-cost routes

34

Distance Vector vs Link State


Issue

Speed of convergence
Number of message
exchanges
Robustness
Implementation and
maintenance
Scalability
Resource requirement

Distance-vector

Link-state

35

EXTERIOR ROUTING
PROTOCOL
Or Inter-domain routing

36

Routing protocols
Routing
Protocols
Unicast
Interior

Multicast

Exterior

RIP

OSPF

Distancevector

Linkstate

BGP
Pathvector

Interior

RIP

OSPF

Exterior

BGP

37

Interior vs Exterior

38

New Requirement for Exterior protocol


Huge scale: millions of routers
Shortest path does not work
Link cost varies across different networks
Incompatible with commercial relationship - need to express
business realities (policies)

39

A Solution!!
Separate routing inside a domain from routing between

domains
Inside a domain use a traditional interior protocols (RIP, OSPF)
Between domains use exterior gateway protocols

Exterior routing protocols (or Inter-domain)


Only exchange reachability information (not specific metrics)
Decide what to do based on local policy
What is a domain?

40

Domain = Autonomous Systems


Internet is divided into Autonomous Systems
Distinct regions of administrative control
Routers/links managed by a single institution
Service provider, company, university,
Hierarchy of Autonomous Systems
Large, tier-1 provider with a nationwide backbone
Medium-sized regional provider with smaller backbone
Small network run by a single company or university
Interaction between Autonomous Systems
Internal topology is not shared between Ases
but, neighboring ASes interact to coordinate routing
ASs uniquely identified by AS Number
Used for routing, among other things

41

AS Numbers (ASNs)
ASN are 16-bit values and over 15,000 are in use

42

Inter-domain routing
Border routers summarize and

advertise internal routes to


external neighbors and vice
versa
Internal routers can use notion

of default routes
Routers must have a route to
all networks in the world
But what routing protocol?

43

Can we use what we already know?


Link-state
Topology information is

flooded
High bandwidth and storage

overhead
Forces nodes to disseminate
sensitive information
Entire path computed

locally per node


High processing overhead in

Distance-vector
Hides details of the network

topology good
Nodes determine only next

hop toward the destination


Minimizes some notion of total

distance, which is difficult in


an inter-domain setting
Slow convergence due to the

counting-to-infinity problem

a large network
Works only if policy is

shared and uniform

Idea: extend the notion of a


distance vector (to make it
easier to detect loops)

44

Path-Vector Routing
Extension of distance-vector routing
Support flexible routing policies
Avoid count-to-infinity problem
Key idea: advertise the entire path
Distance vector: send distance metric per destination
Path vector: send the entire path for each destination

45

Path-Vectors Setup at Booting Time

46

Path-Vectors Propagation

If the path includes


itself, then ignore (to
avoid loop)

47

Policy Support
Each node can apply local policies
Path selection: Which path to use?
Path export: Which paths to advertise?
Examples
Node 2 may prefer the path 2, 3, 1 over 2, 1
Node 1 may not let node 3 hear the path 1, 2

48

Border Gateway Protocol (BGP)


Only exterior routing protocol that bases on path-vector

routing
A node learns multiple routes

to a destination
Store all of the routes and select

based on some policy

Incremental updates
Announcement of a new route
Withdrawal of a stale route

49

A Simple BGP Route


Destination network

AS path
Next-hop ip address

50

BGP has a lot of problems


Has evolved for 18 years

Instability not guarantee to converge


Scalability ~300,000 destination networks
Performance does not balance load across paths
Business settlement
AS might not want to carry for other ASs or it might want to charge
some $$
Top of Internet Hierarchy consists of ~10 ASs (which is settlementfree)

51

Traditional Tiered Internet

52

New Tiered Internet

Inter-domain routing
remains a big issue

53

Summary: Unicast routing


Distributed algorithm to compute the paths

Routing

through the network


React to changes in the topology
Each node sends list of its shortest distance (DV)

DistanceVector

to each destination to its neighbors


Neighbors update their lists; iterate
Problems include loops and count to infinity
Each node computes shortest path from a

Link-state

Inter-domain
routing

complete map
Transient periods of inconsistency across routers
Exchange reachability information (plus hints)
BGP is based on path vector routing
Traffic exchange policies are a big issue $$$

54

MULTICAST ROUTING

55

Uni-, Multi- and Broadcast


Broadcasting is usually not performed in the Internet

because it may create a huge volume of traffic and use a


huge amount of bandwidth.

https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&docid=IjCOA3i3100CyM&tbnid=ngbkf7AolNpfiM:&ved=0CAUQjRw&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Flearnthat.com%2F2008%2F07%2Fnetwork-2008tutorial%2F7%2F&ei=ZDkMUsHhEMH_rQeN8oHgCQ&bvm=bv.50768961,d.bmk&psig=AFQjCNFgeIqGPpIFDeKz6mxgCm_pDB7pdA&ust=1376619050690431

56

Unicasting versus Multicasting


Multicasting is requires less bandwidth.

Delay in sending out multiple packets in multicasting can

be large in multiple unicasting

57

Multicasting Applications
Access to Distributed Databases
User accesses databases spread out all over the Internet. The
user does not know the exact addresses of databases.
Information dissemination
A business needs to send information to a group of users.

Teleconferencing
All individuals in a conference needs to receive the same
information at the same time.
Distance Learning
One professor can teach many students at the same time.

58

Multicast Group
All users in a multicast group must register to a group

identified by an IP address in Class D or 224.0.0.0/4

Internet Group Management Protocol (IGMP) is used to

manage multicast group.

59

Using Multicast Address


Multicast address is used as group identifier.

60

Internet Group Management Protocol


(IGMP)
IGMP is a protocol defined at the network layer used for

exchanging group information among routers.


There are two types of IGMP messages:
IGMP query:
Sent by a router to all hosts in each interface to collect information

about their membership (224.0.0.1).


IGMP report:
Consists of multicast address identifier and the addresses of all hosts

interested (and not interested) in receiving messages from a specific


source.

61

Unicast versus Multicast Routing


Notice the difference in information advertisement

62

Multicast Routing Algorithms


Since the forwarding depends on the source and

destination, the routing algorithm must involve the source.


There are two major multicast routing algorithms:
Multicast routing using source-based trees
Multicast routing using group-shared trees

63

Source-based vs Group-shared trees


Source-based
Create a separate for

each source-group
Source = Root

Group-shared
Create one tree for all

group
Router = root

Groups = Leaves

Total trees created =

Router = somewhere on the

(# groups)
Packets are first sent to
the router (via unicast
tunneling)

tree

Total trees created =

(# sources) x (# groups)
Multicast Open Shortest Path

First (MOSPF)

E.g., Distance Vector Multicast

Routing Protocol (DVMRP)

64

Distance Vector Multicast Routing Protocol


DVMRP is the extension of the Routing Information

Protocol (RIP) used in unicast routing.


Each router uses three steps before multicast source (S)
can send a message to a group (G).
Reverse Path Forwarding (RPF) operation to simulate the creation

of optimal source-based tree between the source and the router.


Reverse Path Broadcasting (RPB) operation to create a broadcast
(spanning) tree whose root is the router itself and whose leaves are
all networks in the AS.
Reverse Path Multicasting (RPM) operation to create a multicast
tree by pruning (removing unneeded branches out of) the
broadcast tree.

65

3-Step set up
Reverse Path Forwarding (RPF)
Router accepts multicast packets from the multicast source only at
the interface that is on the shortest path.
Reverse Path Broadcasting (RPB)
The router creates a broadcast (spanning) tree to make sure that
each network in the AS receives only one copy of the multicast
packet.
Reverse Path Multicasting (RPM)
The router deletes (make inactive) the interfaces that do not reach
members of the multicast group

66

RPF (receives multiple copies)

RPM (only members


receive one copy)

RPB (all receive one copy)

67

Multicast Open Shortest Path First


MOSPF is an extension of OSPF.

Source-based tree approach is used for multicasting.


Each router needs another database other than LSDB to

show which interface has an active member in a group.


Each router uses 3 steps before multicast source (S) can
send a message to a group (G).
1.
2.
3.

Dijkstra algorithm to create shortest-path tree with S as root


and all destinations in the AS as leaves using LSDB.
Find itself (router) in the shortest-path tree created in 1.
Prune the interfaces of the router for each multicast source
using the method similar to DVMRP. MOSPF can also flood
group member information to all routers.

68

MOSPF Tree Formation

69

Protocol Independent Multicast (PIM)


Multicasting without fixing the unicast protocol because it

does not matter how routing table is created.


PIM works in 2 different modes:
PIM-DM (Dense Mode) - # of members is large
PIM-SM (Sparse Mode) - # of members is small

70

PIM-DM
PIM-DM operates similarly to DVMRP but without RPB.

Using only RPF and RPM, DVMRP broadcasts packets

until the tree is pruned.


Steps: after receiving the first multicast packet from S
1.
2.

3.

The router uses RPF to determine whether it can accept the


packet (from S) arriving at the interface of the router.
The router forwards this first packet to all interfaces except the
incoming interface. All routers in the AS should receive this
packet. If they do not have hosts in the specified group G in
their network, they will send prune message back to the router
upstream.
Subsequent multicasting will only be sent to other routers via
unpruned interface.

71

Example: PIM-DM

72

PIM-SM
Based on group-shared tree. A core router called

rendezvous point (RP) is selected (using a complex


algorithm) and all routers must keep a record of (Group,
RP) pairs.
Steps:
1.

2.

Any router that has a multicast packet to send to a group first


encapsulates the multicast packet in a unicast packet
(tunneling) and sends it to the RP.
The RP then decapsulates the unicast packet and sends the
multicast packet to its subsequent routers in the spanning tree
created by the RP. Each subsequent router must operate RPF
(to know interface to receive) and RPM (to know interfaces to
forward).

73

Example: PIM-SM

74

Interdomain Multicast Protocol


Multicast Border Gateway Protocol (MBGP) is an

extension of Border Gateway Protocol (BGP) for


multicasting among ASs.
Information about multicasting (groups and paths) is exchanged

between border routers in different ASs.


MBPG is a group-shared multicast routing protocol. A router in

each AS is selected to be Rendezvous Point (RP).


Multicast Source Discovery Protocol (MSDP) is responsible for

exchanging information about RP for other groups in other ASs.

You might also like