Professional Documents
Culture Documents
[FECEg-5201]
CHAPTER THREE:
Routing Algorithms
Network layer
Network layer
application
◼ Transport segment from sending to receiving transport
network
data link
host physical
network network
data link data link
◼ On sending side encapsulates segments into network
data link
physical physical
physical network network
data link data link
datagrams physical physical
network network
◼ On receiving side, delivers segments to data link data link
physical physical
network
transport layer data link
physical application
transport
network network
◼ Network layer protocols in every host, data link network data link
network physical data link physical
data link physical
physical
router examines header fields in all IP datagrams
passing through it
The Internet Network layer
Host, router network layer functions:
IP protocol
Routing protocols
•addressing conventions
•path selection
•datagram format
•RIP, OSPF, BGP,
Network •DSDV,DSR,AODV
•packet handling conventions
layer forwarding
ICMP protocol
table
•error reporting
•router “signaling”
LinkLink layer
Layer
physical layer
Two Key Network-Layer Functions
analogy:
• forwarding: move
packets from router’s forwarding: process of
input to appropriate getting through single
router output interchange
• routing: determine
Passing thru A.A
route taken by packets
from source to dest. routing: process of
• routing algorithms planning trip from
source to dest.
routing algorithm
value in arriving
packet’s header
0111 1
3 2
Network layer connection and connection-less service
12 22 32
1 3
2
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …
• used in ATM
application
6. Receive data application
transport 5. Data flow begins
network 4. Call connected 3. Accept call transport
data link 1. Initiate call 2. incoming call network
data link
physical
physical
Datagram networks
• no call setup at network layer
• routers: no state about end-to-end connections
• no network-level concept of “connection”
• packets forwarded using destination host address
• packets between same source-dest pair may take different
paths
application
application
transport
transport
network
data link 1. Send data 2. Receive data network
data link
physical
physical
Datagram or VC network: why?
Home Networking
or Access Router
Router for Large
Backbone Networks
• Management/billing (statistics)
• Interface statistics—Netflow export
• SNMP, ping, trace route…
Router Architecture Overview
Two key router functions:
• run routing algorithms/protocols (RIP, OSPF, BGP)
• forwarding datagram from incoming to outgoing link
Input Port Functions
Physical layer:
bit-level reception
Data link layer:
e.g., Ethernet framing • given datagram destination, lookup
output port using forwarding table in
input port memory
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
Graph: G = (N,E)
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Graph abstraction: costs
5
• c(x,x’) = cost of link (x,x’)
3
v w 5
2
u 2 z - e.g., c(w,z) = 5
1
3
1 2
x 1
y
Decentralized: Dynamic:
• router knows physically- • routes change more quickly
connected neighbors, link • periodic update
costs to neighbors • in response to link cost
• iterative process of changes
computation, exchange of info • Wireless and mobile
with neighbors networks
• “distance vector” algorithms
A Link-State Routing Algorithm
5
3
B C 5
2
A 2 1 F
3
1 2
D E
1
Dijkstra’s algorithm: example…
Resulting shortest-path tree from A:
B C
A F
D E
Then
recompute estimates
Distributed:
• each node notifies neighbors
only when its DV changes if DV to any dest has
• neighbors then notify their changed, notify neighbors
neighbors if necessary
Distance Vector Algorithm:
At
Each 1 Initialization:
Node 2 for all destinations y:
X: 3 Dx (y) = c(x,y)
4 for all neighbors w:
• for all destinations y: Dw(y) = infinity
6 for all neighbors w:
• send Dx(y)
7
8 loop
9 wait (until I see a link cost change to neighbor w
10 or until I receive update from neighbor w)
11
12 for all destinations y:
13 Dx(y) = minv { c(x,v) + Dv(y) }
14
15 if we have a new Dx(Y) for any destination Y
24 send new values Dx(Y) to all neighbors
25
26 forever
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to
x y z x y z
x 0 2 7 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
y 2 0 1 7
from
z ∞∞ ∞
node z table
cost to
x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 71 0
time
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
y 2 0 1 y 2 0 1 7
from
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 71 0 z 3 1 0 z 3 1 0
time
Hierarchical Routing
Our routing study so far - idealization
all routers identical
network “flat”
… not true in practice
• Two-level routing:
• Intra-AS: administrator responsible for choice of routing
algorithm within network
• Inter-AS: unique standard for inter-AS routing: BGP
Hierarchical Routing…
• aggregate routers into gateway routers
regions, “autonomous • special routers in AS
systems” (AS) • run intra-AS routing
• routers in same AS run protocol with all other
same routing protocol routers in AS
• “intra-AS” routing • also responsible for routing
protocol to destinations outside AS
• routers in different AS can • run inter-AS routing
run different intra-AS protocol with other
routing protocol gateway routers
Hierarchical Routing
Our routing study so far - idealization
◼ all routers identical
◼ network “flat”
Inter-AS
C.b routing
between B.a
A.a A and B Host
b A.c c h2
a C a
b
a B
Host d c Intra-AS routing
h1 b
A within AS B
Intra-AS routing
within AS A
Routing in the Internet: Intra-AS Routing
u Subnets hops
v
u 1
A B w v 2
w 2
x 3
x y 3
z C D z 2
y
RIP advertisements
2b
2a 2c
∂
1b 3b
2d
1a 1c ∂
3a 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
logical iBGP connectivity
1d AS3,
AS2,AS3,X 2a 2c X
2d
2d
1d
2a 2c
2d
▪What is Congestion?
• Traffic-Aware Routing
• Admission Control
• Traffic Throttling
• Load Shedding
What is Congestion?
1Increase resources
2Decrease load
END