1 ECE453 – Introduction to Computer Networks Lecture 9 - The Network Layer (I) - Routing
Jan 21, 2016
1
ECE453 – Introduction to Computer Networks
Lecture 9 - The Network Layer (I) - Routing
2
RecapFramingError detection and correctionReliable or unreliable data transferChannel allocation protocol
3
Network Core and Network Edge
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical
networkdata linkphysical
logical end-end transportNetworkedge
Network core
4
Network Core – Information Transmission
Circuit switching Telephone system
Message switching Mail delivery The message travels as a complete unit. At any
one time, it completely exists in one place.
Packet switching The Internet
5
Design Issues
Store-and-forward packet switchingServices to the transport layer Connection-oriented vs.
Connectionless Quality of service (QoS)
6
Network Layer Services
Connectionless Best-effort No guarantee The Internet No advance setup
is needed Datagram subnet
Connection-oriented Guaranteed delivery ATM A path from the
source router to the destination router is established before any data packets can be sent
Virtual circuit
7
The Internet Network Layer
routingtable
Routing protocols•path selection•RIP, OSPF, BGP
IP protocol•addressing conventions•datagram format•packet handling conventions
ICMP protocol•error reporting•router “signaling”
Transport layer: TCP, UDP
Link layer
physical layer
Networklayer
8
Routing - In the Middle of Intersection …
9
Different Strategies
Nonadaptive algorithms (or static routing)
Adaptive algorithms (or dynamic routing) Global algorithm
(have a global knowledge – a map)
Decentralized algorithm (get information only from neighbor)
10
Graph Abstraction for Routing Algorithms
Graph nodes RoutersGraph edge Physical linksEdge weight Link costLink cost Delay, power consumption, congestion
level, $cost, etc.
Good path or optimal path Minimum link cost
A
ED
CB
F
2
2
13
1
1
2
53
5
11
Two Fundamental Routing Algorithms
Link state routing A global algorithm
Distance vector routing (or Bellman-Ford routing, Ford-Fulkerson routing) A decentralized algorithm The original ARPANET routing algorithm,
replaced by LS routing in 1979
12
A Link State Routing Algorithm
Net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have the same info
computes least cost paths from the source to all other nodesIterative algorithm
Dijkstra’s algorithm
13
Dijkstra’s Algorithm: An Example
Step012345
start NA
ADADE
ADEBADEBC
ADEBCF
D(B),p(B)2,A2,A2,A
D(C),p(C)5,A4,D3,E3,E
D(D),p(D)1,A
D(E),p(E)infinity
2,D
D(F),p(F)infinityinfinity
4,E4,E4,E
A
ED
CB
F
2
2
13
1
1
2
53
5
14
Dijkstra’s Algorithm: DiscussionAlgorithm complexity: n nodes each iteration: need to check all nodes, not in N n*(n+1)/2 comparisons: O(n**2) more efficient implementations possible:
O(nlogn)
Oscillations possible: e.g., link cost = amount of carried trafficA
D
C
B1 1+e
e0
e
1 1
0 0
A
D
C
B2+e 0
001+e1
A
D
C
B0 2+e
1+e10 0
A
D
C
B2+e 0
e01+e1
initially… recompute
routing… recompute … recompute
15
DV RoutingEach router maintains a distance table Initialization
0 for itself Infinity for non-neighbor Link cost for neighbor
Message exchange between neighbors
When a neighbor first comes up When information changes
(e.g. change in link cost)
Distance vector calculation Minimize cost to each
destination
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
dest
inat
ion
D (Y,Z)X
distance from X toY, via Z as next hop
c(X,Z) + min {D (Y,w)}Z
w
=
=
Iterative routingDistributed routing
16
DV: Example
X Z12
7
Y
X
Y
Z
17
DV: Link Cost Changes
X Z14
50
Y1
algorithmterminates
“good news travels fast”
X
Y
Z
18
DV: Link Cost Changes
X Z14
50
Y60
algorithmcontinues
on!
“bad news travels slow”
Count to infinity problem
19
Distance Table: An Example
A
E D
CB7
8
1
2
1
2
D (C,D)E
c(E,D) + min {D (C,w)}D
w== 2+2 = 4
D (A,D)E
c(E,D) + min {D (A,w)}D
w== 2+3 = 5
D (A,B)E
c(E,B) + min {D (A,w)}B
w== 8+6 = 14
loop!
loop!
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
dest
inat
ion