0% found this document useful (0 votes)
43 views12 pages

F07 Lecture10 Routing

The document discusses different methods for intra-domain routing within an autonomous system, including distance-vector routing where each router iteratively shares information about path costs to destinations with neighbors until convergence, and link-state routing where each router has a complete view of the network topology and independently calculates shortest paths. It provides examples of the initialization and iterative updating of routing tables using the distance-vector approach. The document compares centralized and distributed methods for computing shortest paths within an autonomous system.

Uploaded by

akakaka
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)
43 views12 pages

F07 Lecture10 Routing

The document discusses different methods for intra-domain routing within an autonomous system, including distance-vector routing where each router iteratively shares information about path costs to destinations with neighbors until convergence, and link-state routing where each router has a complete view of the network topology and independently calculates shortest paths. It provides examples of the initialization and iterative updating of routing tables using the distance-vector approach. The document compares centralized and distributed methods for computing shortest paths within an autonomous system.

Uploaded by

akakaka
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/ 12

CS 640: Introduction to

Computer Networks
Aditya Akella

Lecture 10 -
Intra-Domain Routing

From previous lecture….


Three Types of Switching Fabrics

Switching Via a Memory


First generation routers  looked like PCs
• Packet copied by system’s (single) CPU
• Speed limited by memory bandwidth (2 bus crossings
per datagram)
Input Memory Output
Port Port

System Bus

Most modern routers switch via memory, but…


• Input port processor performs lookup, copy into
memory
• Cisco Catalyst 8500 3

1
Switching Via a Bus
• Datagram from input port
memory to output port
memory via a shared bus

• Bus contention: switching


speed limited by bus
bandwidth

• 1 Gbps bus, Cisco 1900:


sufficient speed for access
and enterprise routers (not
regional or backbone)

Switching Via an Interconnection


Network
• Overcome bus and memory
bandwidth limitations

• Crossbar provides full NxN


interconnect
– Expensive
– Uses 2N buses

• Cisco 12000: switches Gbps


through the interconnection
network

Routing
• Past two lectures
– IP addresses are structured
– IP packet headers carry these
addresses
– When packet arrives at router
• Examine header for intended
destination Router
• Look up next hop in table
• Send packet out appropriate
port

• This lecture:
– How these forwarding tables
are built?
– Routing algorithms

2
A Model of the Problem
• Network as a Graph:
– Represent each router as node
– Direct link between routers
represented by edge
– Symmetric links ⇒ undirected E 3 C
1
graph
1
2 F
• Edge “cost” c(x,y) denotes
6
measure of difficulty of using link
1
– delay, $ cost, or congestion level 3 D
A 4
• Task B
– Determine least cost path from
every node to every other node
• Path cost d(x,y) = sum of link costs

Ways to Compute Shortest Paths


• Centralized
– Collect graph structure in one place
– Use standard graph algorithm
– Disseminate routing tables

• Distributed
– Routers perform local computation
– Converge to a globally consistent routing state
– “Global”: Link-state
• Every node collects complete graph structure
• Each computes shortest paths from it
• Each generates own routing table
– Local: Distance-vector
• No one has copy of graph
• Nodes construct their own tables iteratively
• Each sends information about its table to neighbors
8

Distance-Vector Method
E 3 C
1
Initial Table for
A F 1
2
Dest Cost Nex 6
t 1
Hop 3 D
A 4
A 0 A B
B 4 B
C –
• Idea

– At any time, have cost/next
D ∞ –
hop of best known path to
E 2 E destination
F 6 F – Use cost ∞ when no path known
• Initially
– Only have entries for directly 9
connected nodes

3
Algorithm
Each node x stores:
– c(x,v) for each neighbor v
– Distance vector of node x: estimate of d(x,y) for all y
– Distance vectors heard from each neighbor

Initialization:
1. d(x,y) = c(x,y) for all y.
2. Send distance vector to each neighbor
Repeat:
Whenever link cost to neighbor changes or distance
vector received from neighbor
For every neighbor z
For every destination y
d(x,y) ← Update(x,y,z)
If d(x,y) changed for any y, send distance vector to all 10
neighbors

Distance-Vector Update
z
d(z,y)
c(x,z)

y
x
d(x,y)

Update(x,y,z)
d ← c(x,z) + d(z,y) /* Cost of path from x to y with first hop z */
if d < d(x,y)
/* Found better path */
return d,z /* Updated cost / next hop */
else
return d(x,y), nexthop(x,y) /* Existing cost / next hop */
11

Start
Optimum 1-hop paths
Table for A Table for B
E 3 C
Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A 1
2 F
B 4 B B 0 B
6
C ∞ – C ∞ – 1
D ∞ – D 3 D 3 D
A 4
E 2 E E ∞ –
B
F 6 F F 1 F
Table for C Table for D Table for E Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A ∞ – A ∞ – A 2 A A 6 A
B ∞ – B 3 B B ∞ – B 1 B
C 0 C C 1 C C ∞ – C 1 C
D 1 D D 0 D D ∞ – D ∞ –
E ∞ – E ∞ – E 0 E E 3 E
F 1 F F ∞ – F 3 F F 0 F 12

4
Iteration #1
Optimum 2-hop paths
Table for A Table for B
E 3 C
Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A 1
2 F
B 4 B B 0 B
6
C 7 F C 2 F 1
D 7 B D 3 D 3 D
A 4
E 2 E E 4 F
B
F 5 E F 1 F
Table for C Table for D Table for E Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A 7 F A 7 B A 2 A A 5 B
B 2 F B 3 B B 4 F B 1 B
C 0 C C 1 C C 4 F C 1 C
D 1 D D 0 D D ∞ – D 2 C
E 4 F E ∞ – E 0 E E 3 E
F 1 F F 2 C F 3 F F 0 F 13

Iteration #2
Optimum 3-hop paths
Table for A Table for B
E 3 C
Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A 1
2 F
B 4 B B 0 B
6
C 6 E C 2 F 1
D 7 B D 3 D 3 D
A 4
E 2 E E 4 F
B
F 5 E F 1 F
Table for C Table for D Table for E Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A 6 F A 7 B A 2 A A 5 B
B 2 F B 3 B B 4 F B 1 B
C 0 C C 1 C C 4 F C 1 C
D 1 D D 0 D D 5 F D 2 C
E 4 F E 5 C E 0 E E 3 E
F 1 F F 2 C F 3 F F 0 F 14

Distance Vector: Link Cost Changes


Link cost changes:
• Bad news travels slow - 60
Y
“count to infinity” problem! 4 1
X Z
50

algorithm
continues
on!

15

5
Distance Vector: Poison Reverse
If Z routes through Y to get to X : 60
• Z tells Y its (Z’s) distance to X is infinite (so Y Y
4 1
won’t route to X via Z)
• Will this completely solve count to infinity X Z
50
problem?

algorithm
terminates

16

Poison Reverse Failures


Table for A Table for B Table for D Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
C 7 F C 8 A C 9 B C 1 C
1

Table for A Table for F F C
Forced Forced 6
Dst Cst Hop Dst Cst Hop
Update Update
C ∞ – C ∞ – A
1
Table for A
Better 4
Dst Cst Hop 1
Route B
C 13 D
D
Table for B
Forced
Update Dst Cst Hop • Iterations don’t converge
C 14 A • “Count to infinity”
Table for D
Forced • Solution
Dst Cst Hop
Update – Make “infinity” smaller
C 15 B
Table for A – What is upper bound on

Dst Cst Hop Forced
• maximum path length?
Update 17
C 19 D •

Routing Information Protocol (RIP)


• Earliest IP routing protocol (1982 BSD)
– Current standard is version 2 (RFC 1723)

• Features
– Every link has cost 1  Hop count
– “Infinity” = 16
• Limits to networks where everything reachable within 15 hops

• Sending Updates
– Every router listens for updates on UDP port 520
– Triggered
• When every entry changes, send copy of entry to neighbors
– Except for one causing update (split horizon rule)
– Periodic
• Every 30 seconds, router sends copy of its table to each neighbor

18

6
Link State Protocol Concept
• Every node gets complete copy of graph
– Every node “floods” network with data about its
outgoing links

• Every node computes routes to every other


node
– Using single-source, shortest-path algorithm

• Process performed whenever needed


– When interconnections die / reappear

19

Sending Link States by “Flooding”


• X wants to send X A X A
information
C B D C B D
– Sends on all outgoing
(a) (b)
links
X A X A
• When node Y receives
C B D C B D
information from Z
(c) (d)
– Resend on all links
other than Z

20

Dijkstra’s Algorithm
• Given
– Graph with source node s and edge costs
c(u,v)
– Determine least cost path from s to every
node v

• Single source shortest Path Algorithm


– Traverse graph in order of least cost from
source

21

7
Dijkstra’s Algorithm

2 E 3 C
5 1
Current Path Costs
F 2
2
6
1
Source 0 ∞
3 3 D
Node A 3
B
Done
Unseen
Horizon
•Node Sets
– Done • Label
• Already have least cost path to it – d(v) = path cost
– Horizon: • From s to v
• Reachable in 1 hop from node in
Done • Path
– Unseen: – Keep track of last link in
• Cannot reach directly from node path 22
in Done

Dijkstra’s Algorithm: Initially



∞ E 3 C
∞ 1
Current Path Costs
F 2
2
6
1
Source 0 ∞
∞ 3 D
Node A 3
Horizon B
Done Unseen

• No nodes “done”
• Source in “horizon”

23

Dijkstra’s Algorithm: Initially



2 E 3 C
6 1
Current Path Costs
F 2
2
6
1
Source 0 ∞
3 3 D
Node A 3
B
Done
Horizon Unseen

• d(v) to node A shown in red


– Only consider links from done nodes

24

8
Dijkstra’s Algorithm

2 E 3 C
5 1
Current Path Costs
F 2
2
6
1
Source 0 ∞
3 3 D
Node A 3
B
Done
Unseen
Horizon

• Select node v in horizon with minimum d(v)


• Add link used to add node to shortest path tree
• Update d(v) information
25

Dijkstra’s Algorithm
Horizon ∞
2 E 3 C
5 1
Current Path Costs
F 2
2
6
1
Source 0 ∞
3 3 D
Node A 3
B
Done
Unseen

• Repeat…

26

Dijkstra’s Algorithm
∞ Unseen
2 E 3 C
4 1
Current Path Costs
F 2
2
6
1
Source 0 6
3 3 D
Node A 3
B Horizon
Done

• Addition of node can add new nodes to horizon

27

9
Dijkstra’s Algorithm
5
2 E 3 C
4 1

F 2
2
6
1
Source 0 6
3 3 D
Node A 3
B

• Final tree shown in green

28

Link State Characteristics


• With consistent
LSDBs*, all nodes
B
compute consistent 1 1
X
loop-free paths A 4
C

6 2
• Can still have D

transient loops Packet from CA


may loop around BDC
if B knows about failure
and C & D do not
*Link State Data Base

29

OSPF Routing Protocol


• Open
– Open standard created by IETF

• More prevalent than RIP

30

10
OSPF Messages
• Transmit link state advertisements
– Originating router
• Typically, IP address for router
– Link ID
• ID of router at other end of link
– Metric
• Cost of link
– Sequence number
• Incremented each time sending new link information

31

OSPF Flooding Operation


• Node X Receives LSA from Node Y
– With Sequence Number q
– Looks for entry with same origin/link ID

• Cases
– No entry present
• Add entry, propagate to all neighbors other than Y
– Entry present with sequence number p < q
• Update entry, propagate to all neighbors other than Y
– Entry present with sequence number p > q
• Send entry back to Y
• To tell Y that it has out-of-date information
– Entry present with sequence number p = q
• Ignore it
32

Flooding Issues
• When should it be performed
– Periodically
– When status of link changes
• Detected by connected node
• Congestion, lack of electric or optical signal

• What happens when router goes down & back up


– Sequence number reset to 0
• Other routers may have entries with higher sequence numbers
– Router will send out LSAs with number 0
– Will get back LSAs with last valid sequence number p
– Router sets sequence number to p+1 & resends

33

11
Adoption of OSPF
• RIP viewed as outmoded
– Good when networks small and routers had
limited memory & computational power

• OSPF Advantages
– Fast convergence when configuration
changes
– Full topology map helps

34

Comparison of LS and DV Algorithms


Message complexity Speed of Convergence
• LS: with n nodes, v • LS: Complex computation
neighbors, O(nv) messages
per node – But…can forward before
computation
• DV: exchange between
neighbors only – may have oscillations
• DV: convergence time varies
– may be routing loops
– count-to-infinity problem
– (faster with triggered
updates)

35

Comparison of LS and DV Algorithms


Robustness: what happens if router malfunctions?
LS:
• node can advertise incorrect link cost
• each node computes only its own table
DV:
• DV node can advertise incorrect path cost
• each node’s table used by others
• errors propagate thru network
• Other tradeoffs
• Making LSP flood reliable difficult
• Prioritize routing packets?

36

12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy