Introduction to Computer Networking Guy Leduc Chapter 5 ... · 5 Network Layer Control Plane 5-9 Chapter 5: outline 5.1 Introduction 5.2 ICMP: The Internet Control Message Protocol
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Network Layer Control Plane 5-1
Introduction to Computer Networking
Guy Leduc
Chapter 5 Network Layer: The Control Plane
Computer Networking: A Top Down Approach, 7th edition. Jim Kurose, Keith RossAddison-Wesley, April 2016.
❒ routing: determine route taken by packets from source to destination
data plane
control plane
Two approaches to structuring network control plane:! per-router control (traditional)! logically centralized control (software defined networking)(Only the first one will be studied in this course)
3
Per-router control plane
RoutingAlgorithm
Individual routing algorithm components in each and every router interact in the control plane
dataplane
controlplane
4.1 • OVERVIEW OF NETWORK LAYER 309
tables. In this example, a routing algorithm runs in each and every router and both forwarding and routing functions are contained within a router. As we’ll see in Sec-tions 5.3 and 5.4, the routing algorithm function in one router communicates with the routing algorithm function in other routers to compute the values for its forward-ing table. How is this communication performed? By exchanging routing messages containing routing information according to a routing protocol! We’ll cover routing algorithms and protocols in Sections 5.2 through 5.4.
The distinct and different purposes of the forwarding and routing functions can be further illustrated by considering the hypothetical (and unrealistic, but technically feasible) case of a network in which all forwarding tables are configured directly by human network operators physically present at the routers. In this case, no routing protocols would be required! Of course, the human operators would need to interact with each other to ensure that the forwarding tables were configured in such a way that packets reached their intended destinations. It’s also likely that human configu-ration would be more error-prone and much slower to respond to changes in the net-work topology than a routing protocol. We’re thus fortunate that all networks have both a forwarding and a routing function!
Values in arrivingpacket’s header
1
23
Local forwardingtable
header
0100011001111001
1101
3221
output
Control plane
Data plane
Routing algorithm
Figure 4.2 ♦ Routing algorithms determine values in forward tables
segments to dest❍ first set has TTL=1❍ second set has TTL=2, etc.❍ unlikely port number
❒ when nth set of datagrams arrives to nth router:❍ router discards datagrams❍ and sends source ICMP
messages (type 11, code 0)❍ ICMP messages include name
of router & IP address
❒ when ICMP messages arrive, source records RTTs
stopping criterion:" UDP segment eventually
arrives at destination host" destination returns ICMP “port
unreachable” message (type 3, code 3)
" source stops
3 probes
3 probes
3 probes
5
Network Layer Control Plane 5-9
Chapter 5: outline
❒ 5.1 Introduction❒ 5.2 ICMP: The Internet Control Message Protocol❒ 5.3 Intra-domain routing algorithms
❍ Graph abstraction and routing metrics❍ Link state routing
• OSPF❍ Distance Vector routing
• RIP
❒ 5.4 Inter-domain routing❍ BGP
Routing protocolsRouting protocol goal: determine “good” paths (equivalently, routes), from sending hosts to receiving host, through network of routers
# path: sequence of routers packets will traverse in going from given initial source host to given final destination host
# “good”: least “cost”, “fastest”, “least congested”# routing: a “top-10” networking challenge!
Question: What’s the least-cost path between u and z ?
Routing algorithm: algorithm that finds least-cost path
7
Network Layer Control Plane 5-13
How to set link costs?❒ Many possible ways to define routing metrics,
i.e. to set link costs❒ To achieve minimum hop routing:
❍ Set all link costs to 1❍ Will also minimize (average) link load (and node processing)
• See next slide❍ Does not necessarily minimize delay, nor congestion!
❒ Changing link costs will surely change the least-cost paths!❒ Link costs can be engineered to optimize the network to
some extent❍ But this usually requires to know the traffic matrix (TM)❍ What is a TM?
• For every pair of nodes (i,j), TM(i,j) is the amount of traffic entering the network at node i and exiting the network at node j
Network Layer Control Plane 5-14
Minimum hop routing minimises the average link load (for any TM)
❒ Minimizing the average link load (in bps) is equivalent to minimizing the sum of all the link loads. So, remove denominator N from the score.
❒ Routing a new flow of rate R along a given path P will increase the score:
❒ Therefore, minimizing the average link load is equivalent to setting the path P so as to minimize the number of hops
❒ So to achieve this, each link will simply get the static cost = 1❒ Does not depend on Traffic Matrix (why?)
€
Score = Avg _link _ load =
loadii∈links
∑
N
€
Score _ increase =i∈P
∑ R = R ×nb _hops(P )
8
Network Layer Control Plane 5-15
InvCap routing minimises the average link utilisation (for any TM)
❒ Equivalent to minimizing the sum of all the link utilisations❒ Routing a new flow of rate R along a given path P will increase the
score:
❒ Therefore, minimizing the average link utilisation is equivalent to setting the path P so as to minimize
(for all P)
❒ So, to achieve this, each link will simply get the static cost = 1/Ci❒ InvCap routing = link cost is proportional to the inverse of its capacity❒ Does not depend on Traffic Matrix (why?)
€
Score = Avg _link _util =
utilii∈links
∑
N=
loadi
capacity ii∈links
∑
N
€
Score _ increase =i∈P
∑ RCi
= R ×i∈P
∑ 1Ci
€
i∈P
∑ 1Ci
Network Layer Control Plane 5-16
❒ Link delay metric❍ Minimizes delay❍ But delay has several components:
• Propagation delay• Transmission delay (= packet_size / link_capacity)• Queuing delay (variable, depends on the load, difficult to take into
account)❒ Administrative link cost
❍ Any link cost computed so as to optimise a given network score❍ For example to better balance the network load
• but is traffic matrix dependent in general!❒ Basically any summable quantity
❍ Summable = cost of a path is the sum of the costs of all the links composing this path
Other possible routing metrics
9
Network Layer Control Plane 5-17
B
A CD E
FG
HI
J
KL
M
N
O
B
A CD E
FG
HI
J
KL
M
N
O
A network A sink tree for router B based onthe hop count metric
❒ If a router J is on the optimal path from router I to router K, then the optimal path from J to K also falls along the same route
❒ Consequence: the set of optimal routes from all sources to a destination form a tree rooted at the destination
❒ Similarly: the set of optimal routes from one source to all destinations form a tree rooted at the source
❒ iterative process of computation, exchange of info with neighbors
❒ “distance vector” algorithms
Q: Static or dynamic?Static: ❒ routes change slowly over
timeDynamic: ❒ routes change more
quickly❍ periodic update❍ in response to link cost
changes
10
Network Layer Control Plane 5-19
Chapter 5: outline
❒ 5.1 Introduction❒ 5.2 ICMP: The Internet Control Message Protocol❒ 5.3 Intra-domain routing algorithms
❍ Graph abstraction and routing metrics❍ Link state routing
• OSPF❍ Distance Vector routing
• RIP
❒ 5.4 Inter-domain routing❍ BGP
Network Layer Control Plane 5-20
A Link-State Routing Algorithm
Principle❒ Graph topology discovery:
❍ “link state broadcast”, see next slides❍ So, all nodes have the same complete topological info
❒ Least-cost path computation❍ Every node computes least-cost paths to all other nodes❍ It uses Dijkstra’s algorithm (see later)❍ This gives forwarding table for that node
The packet buffer for router BSend flags ACK flags
Source Seq. Age A C F A C F DataA 21 60 0 1 1 1 0 0F 21 60 1 1 0 0 0 1E 21 59 0 1 0 1 0 1C 20 60 1 0 1 0 1 0D 21 59 1 0 0 0 1 1
2
875
34
1 6A
B C
D
E F
❒ Packets are flooded selectively❍ Packets are not forwarded on the links they arrived on❍ Duplicate (or older) packets are detected by the sequence number
❒ Packets are acknowledged
Packet received from D via C and F
Clearly, routers do not forward the received Link State packets immediately but put them for a short while in a packet buffer (holding area). Why?
Dijkstra’s Algorithm1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'
Dijkstra’s algorithm, discussionAlgorithm complexity: n nodes❒ each iteration: need to check all nodes, w, not in N❒ n(n+1)/2 comparisons: O(n2)❒ more efficient implementations possible: O(nlogn)Oscillations possible when link cost are traffic dependent:❒ e.g., suppose link cost = amount of carried traffic
AD
CB
1 1+ε
ε0
ε
1 1
0 0
initially
AD
CB
given these costs,find new routing….
resulting in new costs
2+ε 0
001+ε 1
AD
CB
given these costs,find new routing….
resulting in new costs
0 2+ε
1+ε10 0
AD
CB
given these costs,find new routing….
resulting in new costs
2+ε 0
001+ε 1
2+ε
15
Network Layer Control Plane 5-29
Chapter 5: outline
❒ 5.1 Introduction❒ 5.2 ICMP: The Internet Control Message Protocol❒ 5.3 Intra-domain routing algorithms
❍ Graph abstraction and routing metrics❍ Link state routing
Evolution of the routing tables in A, B and C for destination D:A B C
(2,C) (2,C) (1,D) Initially(2,C) (2,C) (∞, –) After C’s recomputation, C will notify A and B (3,B) (3,A) (∞, –) After A and B’s recomputations(∞, –) (∞, –) (4,A) After 3 exchanges(∞, –) (5,C) (∞, –) After 4 exchanges(6,B) (∞, –) (∞, –) After 5 exchanges
! when AS3 gateway router 3a advertises path AS3,X to AS2 gateway router 2c:❍ AS3 promises to AS2 it will forward datagrams towards subnet X
! BGP session: two BGP routers (“peers”) exchange BGP messages over semi-permanent TCP connection:• advertising paths to different destination network prefixes (BGP is a “path vector” protocol)
• Prefix = IP address prefix = range of IP addresses
❒ router may learn about more than one route to some destination prefix, selects route based on (in decreasing preference order):
1. Local preference value attribute: policy decisionprefer routes through “Customer AS” over routes through “Peer AS” over routes through “Provider AS” (economical viewpoint)