View
5
Download
0
Category
Preview:
Citation preview
1
Two key network-layer functions
• forwarding: move packets from router’s input to appropriate router output
• routing: determine route taken by packets from source to dest.
– routing algorithms
analogy:
routing: process of planning trip from source to dest
forwarding: process of getting through single interchange 1
23
0111
value in arriving
packet’s header
routing algorithm
local forwarding table
header value output link
0100
0101
0111
1001
3
2
2
1
Interplay between routing and forwarding
routing algorithm determines
end-end-path through network
forwarding table determines
local forwarding at this router
2
Network vs Transport Layer
• network vs transport layer connection service:– network: between two hosts
– transport: between two processes
Network service model
Q: What service model for “channel” transporting
datagrams from sender to receiver?
example services for individual datagrams:
guaranteed delivery
guaranteed delivery with less than 40 msec delay
example services for a flow of datagrams:
• in-order datagram delivery
• guaranteed minimum bandwidth to flow
• restrictions on changes in inter-packet spacing
3
Network layer service models:
Network
Architecture
Internet
ATM
ATM
ATM
ATM
Service
Model
best effort
CBR
VBR
ABR
UBR
Bandwidth
none
constant
rate
guaranteed
rate
guaranteed
minimum
none
Loss
no
yes
yes
no
no
Order
no
yes
yes
yes
yes
Timing
no
yes
yes
no
no
Congestion
feedback
no (inferred
via loss)
no
congestion
no
congestion
yes
no
Guarantees ? Destination Address Range
11001000 00010111 00010000 00000000
through11001000 00010111 00010111 11111111
11001000 00010111 00011000 00000000
through11001000 00010111 00011000 11111111
11001000 00010111 00011001 00000000
through11001000 00010111 00011111 11111111
otherwise
Link Interface
0
1
2
3
Q: but what happens if ranges don’t divide up so nicely?
Datagram forwarding table
4
Longest prefix matching
Destination Address Range
11001000 00010111 00010*** *********
11001000 00010111 00011000 *********
11001000 00010111 00011*** *********
otherwise
DA: 11001000 00010111 00011000 10101010
examples:
DA: 11001000 00010111 00010110 10100001 which interface?
which interface?
when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.
longest prefix matching
Link interface
0
1
2
3
Router architecture overviewtwo key router functions: run routing algorithms/protocol (RIP, OSPF, BGP)
forwarding datagrams from incoming to outgoing link
high-speed switching
fabric
routing processor
router input ports router output ports
forwarding data
plane (hardware)
routing, management
control plane (software)
forwarding tables computed,
pushed to input ports
5
line
termination
link layer
protocol(receive)
lookup,
forwarding
queueing
Input port functions
decentralized switching:• given datagram dest., lookup output
port using forwarding table in input port memory (“match plus action”)
• goal: complete input port processing at ‘line speed’
• queuing: if datagrams arrive faster than forwarding rate into switch fabric
physical layer:
bit-level reception
data link layer:
e.g., Ethernet
see chapter 5
switchfabric
Switching fabrics
transfer packet from input buffer to appropriate output buffer
switching rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate
N inputs: switching rate N times line rate desirable
three types of switching fabrics
memory
memory
bus crossbar
6
Switching via memory
first generation routers:• traditional computers with switching under direct
control of CPU
• packet copied to system’s memory
• speed limited by memory bandwidth (2 bus crossings per datagram)
inputport(e.g.,
Ethernet)
memory
outputport(e.g.,
Ethernet)
system bus
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
32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers
bus
7
Switching via interconnection network
overcome bus bandwidth limitations
banyan networks, crossbar, other interconnection nets initially developed to connect processors in multiprocessor
advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric.
Cisco 12000: switches 60 Gbps through the interconnection network
crossbar
Output ports
buffering required when datagrams arrive from fabric faster than the transmission rate
scheduling discipline chooses among queued datagrams for transmission
linetermination
link layer
protocol(send)
switchfabric
datagram
buffer
queueing
This slide in HUGELY important!
Datagram (packets) can be lost due to congestion, lack of buffers
Priority scheduling – who gets best performance, network neutrality
8
Output port queueing
• buffering when arrival rate via switch exceeds output line speed
• queueing (delay) and loss due to output port buffer overflow!
at t, packets more
from input to output
one packet time later
switch
fabric
switch
fabric
How much buffering?• RFC 3439 rule of thumb: average buffering
equal to “typical” RTT (say 250 msec) times link capacity C– e.g., C = 10 Gpbs link: 2.5 Gbit buffer
• recent recommendation: with N flows, buffering equal to
RTT C.
N
9
17
Routing & IP Routing Protocols
18
Routing: Problem Definition• You are a router in a packet switched network and you receive a
packet destined to some remote node– E.g., router A below receives a packet destined to node F
• Question: How does A know where to send this packet?– Does A send it to B? C? or D?
• Answer: Recall from our earlier discussion in IP that router A consults a forwarding table to make this decision
• Routing Problem: How does router A build this forwarding table?– Built by a routing algorithm (protocol): The job of the routing algorithm
is to determine the next hop router for ALL destinations in the network
A
ED
CB
F
2
2
13
1
1
2
53
5
Dest. Next Hop CostB B 2D D 1C D 3E D 2F D 4
Forwarding Table in A
10
19
End-to-End Path Determination: Routing principles
Graph abstraction for routing algorithms:
• graph nodes are routers
• graph edges are physical links– link cost: delay, $ cost, or
congestion level (amount of traffic carried on the link)
Goal: determine “good” path(sequence of routers) thru
network from source to dest.
Routing protocol
A
ED
CB
F
2
2
13
1
1
2
53
5
• “good” path:– typically means minimum
cost path
20
Forwarding vs Routing
• Distinction between “Forwarding” and “Routing”– Forwarding consists of taking a packet, looking at its destination
address, consulting the forwarding table, and sending the packet in a direction determined by the table
• Very easy once the forwarding table has been built
– Routing is the process by which the forwarding table is built• Need a routing protocol to dynamically build and maintain the table
A
ED
CB
F
2
2
13
1
1
2
53
5
Dest. Next Hop Cost
B B 2D D 1C D 3E D 2F D 4
Forwarding table in A
11
21
Routing Algorithm classification
Global or decentralized information?Global:
• all routers have complete topology, link cost info
• “link state” algorithms
Decentralized:
• router knows physically-connected neighbors, link costs to neighbors
• iterative process of computation, exchange of info with neighbors
• “distance vector” algorithms
22
Link-State Algorithms: General Idea
• Have each router build the complete topology of the network
• Once the complete topology is built, have each router run an algorithm to compute the shortest path from itself to all other routers (nodes) in the network
A
ED
CB
F
2
2
13
1
1
2
53
5
2 Issues
• How does a router build the complete topology of the network?
• How does a router compute the shortest path to all other nodes in the network using this topology information?– Dijkstra’s Shortest Path Algorithm
12
23
Building the Network Topology• At the heart of a link state algorithm is the discovery
of a node’s links’ states– Each node is assumed to capable of finding out the state of
the link to its neighbors (up or down) and the cost of each link
– Each node creates an update packet, also called a link-state packet (LSP) and periodically sends this information to all of its neighbors
– Node’s neighbors send the packet to their neighbors and so on until the LSP is received by all nodes in the network
A
ED
CB
F
2
2
13
1
1
2
53
5LSP Contents• ID of the node -- A
• List of neighbors and the cost to each neighbor – (B, 2), (C, 5), (D, 1)
• A sequence number
• A time-to-live (TTL) 24
Reliable Flooding• Reliable flooding is the process of making sure that all nodes get a
copy of LSP from all other nodes in the network
• When a node X receives a copy of an LSP that originated at some other node Y, it checks to see if it has already stored a copy of an LSP from Y.
• If not, it stores the LSP.
• If it already has a copy, it compares the SeqNos; if the new LSP has a larger SeqNo, it is assumed to be more recent, and the last LSP is stored replacing the old one. Otherwise the new LSP is discarded
A
ED
CB
F
2
2
13
1
1
2
53
5• The new LSP is then forwarded on all neighbors of X except the neighbor from which the LSP was just received
13
25
Computing the Shortest Path: Dijkstra’s Algorithm
Notation:• Cost(i,j): link cost from node i to j.
– Cost(A, B) = 2– Cost(A, C) = 5– Cost(A, F) = infinity
• Distance(v): current value of cost of path from source to destination V– Distance(D) = 1
• Pred(v): predecessor node of v along path from source to v– Pred(D) = A
• N: set of nodes whose least cost path definitively known
A
ED
CB
F
2
2
13
1
1
2
53
5
26
Dijsktra’s Algorithm – where A is the source node
1 Initialization:
2 N = {A}
3 for all nodes v
4 if v adjacent to A
5 then Distance (v) = cost(A,v)
6 else Distance (v) = infinity
7
8 Loop
9 find w not in N such that Distance(w) is a minimum
10 add w to N
11 update Distance(v) for all v adjacent to w and not in N:
12 Distance(v) = min( Distance(v), Distance(w) + cost(w,v) )
13 /* new distance to v is either old distance to v or known
14 shortest path distance to w plus cost from w to v */
15 until all nodes in N
14
27
Dijkstra’s algorithm: example
Step
0
1
2
3
4
5
N
A
AD
ADE
ADEB
ADEBC
ADEBCF
D(B),p(B)
2,A
2,A
2,A
D(C),p(C)
5,A
4,D
3,E
3,E
D(D),p(D)
1,A
D(E),p(E)
infinity
2,D
D(F),p(F)
infinity
infinity
4,E
4,E
4,E
A
ED
CB
F
2
2
13
1
1
2
53
5
Algorithm complexity: n nodes• each iteration: need to check all nodes, w, not in N• n*(n+1)/2 comparisons: O(n2) – O(nlogn) algorithm possible 28
Distance Vector Algos: General Idea
• We do NOT need to know the complete topology of the network to build the forwarding table!
• If a node X simply tells its neighbor Y the cost of reaching another node Z via itself (X), then– neighbor Y can compute the cost of reaching Z via X by
simply adding the cost of reaching X from Y and the cost of reaching Z from X, which was advertised by X
A
ED
CB
F
2
2
13
1
1
2
53
5Example
• If D tells A that it can reach E with a cost of 1, then A knows it can reach E via D with a cost of 1+1 = 2
• If D tells A that it can reach F with a cost of 3, then A knows it can reach F via D with a cost of 1+3 = 4
15
29
Distance Vector Routing Algorithm• Each node tells its
neighbors the cost of reaching every other node via itself
• A node computes its cost of reaching a destination via each of its neighbors and picks the best one
distributed:• each node communicates
only with directly-attached neighbors
iterative:• continues until no nodes
exchange new information• self-terminating: no
“signal” to stop
D (Y,Z)X
distance from X to
Y via Z as next hop
c(X,Z) + D (Z)Y
=
=
D (Y)X
min {D (Y,w)}X
w=
X Y ZC(X,Y)
D (Z)Y
T
D (Z)T
30
Distance Table StructureDistance Table Data Structure• each node has its own distance table• row for each possible destination• column for each directly-attached
neighbor to node• example: in node X, for dest. Y via
neighbor Z:
A
E D
CB7
8
1
2
1
2
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
16
31
Distance Table gives Forwarding Table
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
A
B
C
D
A,1
D,5
D,4
D,4
Outgoing link
to use, cost
Distance Table Forwarding (Routing) Table
32
Distance Vector Routing: overviewEach node:
wait for (msg from neighbor)
recompute distance table
if least cost path to any dest
has changed, notifyneighbors
Initialize the Distance Table Structure
17
33
Initialization
1 Initialization:
2 for all adjacent nodes v:
3 D (*,v) = infinity /* the * operator means "for all rows" */
4 D (v,v) = c(X,v)
5 for all destinations, y
6 send D (y) to each neighbor /* Cost of reaching Y via X */
X
X
X
At all nodes, X:
34
Distance Vector Algorithm: Example
X Z
12
7
Y
This columnshows theInit. results
InitInfo sent
We need to adjustvalues
if necessary
18
35
Distance Vector Algorithm (cont.):8 loop
9 wait (until I receive update from neighbor V)
10 if (update received from neighbor V wrt destination Y)
11 /* shortest path from V to some Y has changed */
12 /* V has sent a new value for its DV(Y) */
13 /* call this received new value is "newval" */
14 for the single destination Y: D (Y,V) = c(X,V) + newval
15
16 if we have a new D (Y) for any destination Y
17 send new value of D (Y) to all neighbors
18
19 forever
X
X
X
36
X Z
12
7
Y
D (Y,Z)X
c(X,Z) + D (Y)=
= 7+1 = 8
Z
D (Z,Y)X
c(X,Y) + D (Z)=
= 2+1 = 3
Y
Distance Vector Algorithm: Exampleinfo sent
Initial values Adjusted new value
19
37
Distance Vector Algorithm: Example
X Z
12
7
Y
This columnShows theInit. results
InitInfo sent
Adjusted new
values
NewInfo sent
Adjustvalues
if necessary
38
Hierarchical RoutingOur routing study thus far assumed
• all routers to be “identical” and the network to be “flat”
• 2 Problems exist with such a model:
1. scale: with 200 million destinations:– can’t store all destinations in routing tables!
– routing table exchange would swamp links!
2. administrative autonomy– Can’t assume that a network with the scale of Internet will be
administered by a single authority
• Solution?– Internet is NOT flat, but is a network of networks
– each network admin controls routing in its own network – next
– http://www.ilkertemir.com/backbone-map/• Turkey’s past and current Internet backbone map
20
39
Hierarchical Routing
a
b
b
aaC
A
Bd
A.a
A.c
C.bB.a
c
b
c
• aggregate routers into regions, “autonomous systems” (AS)
• routers in same AS run same routing protocol– “intra-AS” routing protocol
– routers in different AS can run different intra-AS routing protocol
gateway routers• special routers in AS
• run intra-AS routing protocol with all other routers in AS
• also responsible for routing to destinations outside AS
– run inter-AS routingprotocol with other gateway routers 40
Intra-AS Routing
• Also known as Interior Gateway Protocols (IGP)
• Most common Intra-AS routing protocols:
– OSPF: Open Shortest Path First
– RIP: Routing Information Protocol
– IGRP: Interior Gateway Routing Protocol (Cisco proprietary)
21
41
OSPF (Open Shortest Path First)
• “open”: publicly available
• Uses Link State algorithm – LS advertisement dissemination to entire AS via flooding
– Topology map at each node
– Route computation using Dijkstra’s algorithm
– Carried in OSPF messages directly over IP • OSPF has its own network layer protocol number like IP!
42
RIP (Routing Information Protocol)
• Distance vector algorithm
• Included in BSD-UNIX Distribution in 1982
• Distance metric: # of hops (max = 15 hops)– 16 is the infinity to eliminate routing loops
• Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement)
• Each advertisement: list of up to 25 destination nets within AS– If more destinations, send multiple advertisements
22
43
RIP: Example
Destination Network Next Router Num. of hops to dest.
w A 2y B 2z B 7x -- 1…. …. ....
w x y
z
A
C
D B
Routing table in D
44
RIP: Example
Destination Network Next Router Num. of hops to dest.
w A 2y B 2z B A 7 5x -- 1…. …. ....
Routing table in D
w x y
z
A
C
D B
Dest Next hopsw - -x - -z C 4…. … ...
Advertisementfrom A to D
23
45
RIP Table processing
• RIP routing tables managed by application-levelprocess called route-d (daemon)
• advertisements sent in UDP packets, periodically repeated
physical
link
network forwarding(IP) table
Transprt(UDP)
routed
physical
link
network(IP)
Transprt(UDP)
routed
forwardingtable
46
Inter-AS routing in the Internet: BGP
Figure 4.5.2-new2: BGP use for inter-domain routing
AS2 (OSPF
intra-AS
routing)
AS1 (RIP intra-AS
routing) BGP
AS3 (OSPF intra-AS
routing)
BGP
R1 R2
R3
R4
R5
• Each BGP router communicates only with its neighbors– R1 with R2, R3 with R4
– Global info about routes to destination networkspropagates in an AS-by-AS manner via the exchange of BGP messages
24
47
Why different Intra- and Inter-AS routing ?
Policy:
• Intra-AS: single admin, so no policy decisions needed
• Inter-AS: admin wants control over how its traffic routed, who routes through its net.
Performance:
• Intra-AS: can focus on performance
• Inter-AS: policy may dominate over performance
Recommended