Documente Academic
Documente Profesional
Documente Cultură
CS457
Introduction
Main Task of the network layer is to move packets from the source host to the destination host Lowest layer to deal with end-to-end issues!
Node (Router) Network Data Link Physical Application
Presentation
Application
Presentation
Station (Host)
CS457
CS457
CS457
Connection-oriented Service
Sender and receiver see data as traveling on a logical connection Receiver receives data in the same order in which they are transmitted
Jrg Liebeherr, 1998,1999
CS457
CS457
Datagram Packet-Switching
Each packet is routed independently
B
2 1
1 2
4
Jrg Liebeherr, 1998,1999
CS457
VC #2
Jrg Liebeherr, 1998,1999
CS457
Connectionless Service
Each packet is transmitted independently
1 B.
2 B.
B.3
A
C.3 C.2 C.1
Packet-switched network
C. 1
C. 2
C.3
C
Jrg Liebeherr, 1998,1999
CS457
Connection-oriented Service
Logical connection is established
1. 1
1.3
1.2
1.3 1.2
1.1 2.1
A
2.3 2.2
Packet-switched network
2. 3
2.2
2.1
C
Jrg Liebeherr, 1998,1999
CS457
Summary
The following implementations are feasible:
Virtual Circuit
CS457
Packet Routing
There are two parts to the routing problem: 1. How to pass a packet from an input interface to the output interface of a router (packet forwarding)? 2. How to calculate routes ? Packet forwarding is done differently in datagram and virtualcircuit packet networks Route calculation is done in a similar fashion
CS457
v x
CS457
CS457
v x
CS457
CS457
Comparison
Datagram Network Not needed Each packet contains the full source and destination address Network does not hold state information on flows Each packet is routed independently
Virtual Circuit Network Required Each packet contains only a VC number Each VC is stored in the network
Route chosen when VC is setup. All packets follow same route Some packets are lost All VCs at crashed router are terminated Difficult Easier (but not simple)
CS457
Routing Algorithms
Objective of routing algorithms is to calculate `good routes Routing algorithms for both datagrams and virtual circuits should satisfy: - Correctness - Simplicity - Simplicity - Robustness - Stability - Fairness - Optimality Impossible to satisfy everything at the same time
CS457
A D A
Jrg Liebeherr, 1998,1999
C D B
CS457
CS457
10
CS457
Shortest-Path Routing
Adaptive routing algorithms use a shortest path algorithm to calculate the route with the least cost Three components: 1. Measurement Component Nodes (routers) measure the current characteristics such as delay, throughput, and cost 2. Protocol Nodes disseminate the measured information to other nodes 3. Calculation Nodes run a least-cost routing algorithm to recalculate their routes
Jrg Liebeherr, 1998,1999
CS457
11
CS457
CS457
12
CS457
CS457
13
Dijkstras Algorithm
Finds the shortest path from a source node to all other nodes s source node Dn cost of the least-cost path from node s to node n
n M = dsn;
while (M all nodes) do Find w M for which Dw = min{Dj ; j M}; Add w to M; for each n M Dn = minw [ Dn, Dw + dwn ]; Update route; enddo
CS457
Example Network
5 2 1 1 1
2 2
3 3 5 3 1 6 6 2
4 4
5 5
CS457
14
Example
Example: Calculate the shortest paths for node 1.
Iteration M Init
D1
D2
D3
D4
D5
D6
CS457
Example
Result is a routing tree:
CS457
15
CS457
CS457
16
Distance Vector
Each node maintains two tables: Distance Table: Cost to each node via each outgoing link Routing Table: Minimum cost to each node and next hop node Nodes exchange messages that contain information on the cost of a route Reception of messages triggers recalculation of routing table
CS457
RoutingTable to via
(next hop)
cost
Cd(v,w) Cd(v,n)
Dd(v)
17
Messages
Nodes exchange messages to their neighbors. If node v sends a messages to node x of the form, [m , D m (v)], this means I can go to node m with minimum cost D m (v)
v v
[m , D m (v)]
x x
CS457
m l(m,v)
w n
Distance Table
via to
Cm(v,p)
l(m,v)
Dm(v)
New row
New column
Jrg Liebeherr, 1998,1999
CS457
18
CS457
m l(m,v)+ m
x y
d e
Distance Table
via to
m Ce(v,m)+ m Cd(v,m)+ m
e d
e d
y m
De(v) Dd(v)
CS457
19
CS457
[d,Dd(w)]
Distance Table
via to
Cd(v,w)
Dd(v)
CS457
20
CS457
Example
Assume that Node 1 comes up at time t=0 Show how the entries for destination 1 are updated at all other nodes 5 2 1 1 1 4 4
Jrg Liebeherr, 1998,1999
2 2 2
3 3
3 3 5 1 5 5 2 6 6
CS457
21
Example
Node 2 Distance via 1 3 4 Routing via cost Node 3 Distance via 1 2 4 5 6 Routing via cost
1 1 2 2 4 5 3 1 2 1 6 5 2 3 3 5
via 1 Node 4
via cost
Node 6 Distance Routing via 3 4 6 via cost Node 5 Distance Routing via cost via 5 6
CS457
CS457
22
CS457
Traffic Control
Traffic control at the network layers attempts to control the number of packets that are in the network at a time Goal of traffic control: Prevent the network from becoming a bottleneck Different types of traffic control: Flow Control Congestion Control Routing
CS457
23
CS457
What is Congestion ?
Congestion occurs if the number of queued packets at the output buffers of a router grows large Effect of long queues in output buffers: increased delays, buffer overflows, timeouts at sender, etc
Output buffer
Router
Jrg Liebeherr, 1998,1999
CS457
24
CS457
Effects of Congestion
Congestion occurs if Load 1
uncontrolled 1 Delay ideal controlled Load 1 1 Throughput ideal controlled uncontrolled Load 1
Jrg Liebeherr, 1998,1999
CS457
25
CS457
Loss of Efficiency
Throughput may decrease if offered load is increased
Throughput
CS457
26
Unfairness
Packet streams with low load are penalized by high traffic load from other packet streams
low load
Node
output queue
CS457
Node A
Node D
Node B
Jrg Liebeherr, 1998,1999
Node C
27
Station
Jrg Liebeherr, 1998,1999
Station
Preallocation of Buffers Packet Discarding Choke Packets Sliding Window Flow Control Leaky Bucket
CS457
28
Preallocation of Buffers
Approach: Reserve sufficient buffer space at each node for each virtual circuit during the virtual circuit setup phase Requires admission control: If sufficient buffers are not available, reject the virtual circuit Caveat: Overallocation of buffer space will limit the utilization of the network.
CS457
Packet Discarding
Drop packets if they arrive at a node with almost full buffers Heuristics should be used to decide when to drop a packet For example, ACK packets should not be dropped
CS457
29
Choke Packets
If a packet enters a node and the queue length of the outgoing buffer exceeds a threshold, the node sends a choke packet to the source node If the source node receives a choke packet it reduces the traffic by a certain amount. For example, the window size could be reduced. If a (throttled) source node does not receive a choke packet within a given time interval, it is allowed to increase the traffic. Example: IP (Internet Protocol) uses choke packets
Jrg Liebeherr, 1998,1999
CS457
CS457
30
Leaky Bucket
A Leaky Bucket is used to control the maximum rate at which a sender can transmit traffic Leaky buckets operate at the station/node interface Two parameters: token rate r and bucket size B
new tokens
r
Network
CS457
CS457
31