Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
CS490Chapter 7b, Leon-Garcia
Packet Switching Networks
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Today’s Outline• 7.3 Datagrams vs. Virtual Circuits (a little more)
• Plus Definition of ATM
• 7.4 Routing in Packet Networks
– Distance Vector, Link State, Flooding, Deflection Routing, Source Routing
• 7.5 Shortest Path Algorithms
– Bellman Ford Algorithm
– Construction of Routing Table and Updates
– (On the blackboard)
– We will not cover Dijkstra's algorithm in detail
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies Figure 7.2
Physicallayer
Data linklayer
Physicallayer
Data linklayer
End system
Networklayer
Networklayer
Physicallayer
Data linklayer
Networklayer
Physicallayer
Data linklayer
Networklayer
Transportlayer
Transportlayer
MessagesMessages
Segments
End system
Networkservice
Networkservice
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
3 2 11 2
21
3 2 11 2
21
21
Medium
A B
3 2 11 2
21
C
21
21
2 134 1 2 3 4
End system
End system
Network
1
2
Physical layer entity
Data link layer entity3 Network layer entity
3 Network layer entity
Transport layer entity4
Figure 7.3
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Comparison of Virtual Circuit and Datagram Subnets
Issue Datagram Subnet VC Subnet
Addressing Each packet has source and dest address
Packets contain short VC number
State Info Subnet does not hold state info
Each VC requires subnet table space
Routing Packets routed independently
Route chosen on set up. All packets follow this route
Effect of Router Crashes
None, except packets lost during crash
All VCs that pass through this router are terminated
Congestion Control Difficult Easy if enough buffers can be allocated for each VC
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
IP Internet Protocol (Network Layer)• Actually most information on IP is in Chapter 8 on TCP/IP
• Here we should just know that IP is a datagram service, packets are routed independently of one another
• It is not connection-oriented at the network layer, but can be at the transport layer above
• The IP packet has a header of 20-60 bytes including source and destination addresses, CRC, and various option and control fields. Details in 8.2.
• The total length of a packet, including info, can be up to 65K bytes, but transit of Ethernet LANs often limits to 1500 bytes
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Asynchronous Transfer Mode Definition
• We will skip 7.6 as far as the exam is concerned, but here is a concise definition of ATM (p 483)
• Connection oriented in network layer
• Short (48 info bytes) fixed length packets called “cells”
• Cells contain short (5 byte) headers that point to connections
• ATM uses fast hardware switches up to 10,000 ports with up to 150Mbps each
• ATM has some of the best features of circuit switching and packet switching. Asychronous = no master clock
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Combinations of Service and Subnet Structure
Upper Layer(Transport Layer)
Datagram Virtual Circuit
Connectionless UDP over IP UDP over IP overATM
Connection-Oriented
TCP over IP ATM AAL1 overATM
Type of Subnet (Network Layer)
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
7.4 Routing in Packet Switched Networks
• Net = Routers (or Switches) and links
• Routing involves
– Setting up routing tables
– Forwarding packets
• Routing Algorithm tries to set up “best” routes
– minimize hops or
– minimize delay or
– maximize bandwidth or ...
• The Routing Algorithm needs global info about net
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Goals of Routing Algorithm
• Rapid and Accurate Delivery of Packets
• Adapt to Failure of Node or Link
• Adapt to Change in Traffic Loads
• Determine Connectivity of Network
• Low Overhead
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Classification of Routing Algorithms
• Static vs. Dynamic (Adaptive)
• Centralized vs. Distributed
• Decisions for each Packet vs. at Connection Time
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6
A
B
Switch or router
Host
Figure 7.23
Example of a Packet-Switched Network: Topology for Example
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6A
B
CD
1
5
2
37
1
8
54 2
3
6
5
2
Figure 7.24
Virtual Circuit Packet Switching
Note: VC numbers change at each router. Route on top (thin line) changes from 1 to 2 to 7 to 8. Next slide has routing tables.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Incoming Outgoingnode VC node VC A 1 3 2 A 5 3 3 3 2 A 1 3 3 A 5
Incoming Outgoingnode VC node VC 1 2 6 7 1 3 4 4 4 2 6 1 6 7 1 2 6 1 4 2 4 4 1 3
Incoming Outgoingnode VC node VC 3 7 B 8 3 1 B 5 B 5 3 1 B 8 3 7
Incoming Outgoingnode VC node VC C 6 4 3 4 3 C 6
Incoming Outgoingnode VC node VC 2 3 3 2 3 4 5 5 3 2 2 3 5 5 3 4
Incoming Outgoingnode VC node VC 4 5 D 2 D 2 4 5
Node 1
Node 2
Node 3
Node 4
Node 6
Node 5
Figure 7.25
Follow that circuit from A via VC Nos. 1, 2, 7,8 to B in Routers 1, 3, and 6.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
2 2 3 3 4 4 5 2 6 3
Node 1
Node 2
Node 3
Node 4
Node 6
Node 5
1 1 2 4 4 4 5 6 6 6
1 3 2 5 3 3 4 3 5 5
Destination Next node
1 1 3 1 4 4 5 5 6 5
1 4 2 2 3 4 4 4 6 6
1 1 2 2 3 3 5 5 6 3
Destination Next node
Destination Next node
Destination Next node
Destination Next nodeDestination Next node
Figure 7.26
Routing Tables for a Datagram Network. Same Topology.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Hierarchical Addresses in the Internet
• Actually the book covers TCP/IP together in Chapter 8
• Here (p 488) it points out that routing is simplified if hosts within a domain have the same prefix (network address).
• Then routers outside the domain only have to examine (and store) the prefix
• Thus IP addresses are always divided into a network address and a host address. (Usually there are three levels, often: network address, LAN address, host address)
• See Fig 7.27
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
0000 0001 0010 0011
0100 0101 0110 0111
1100 1101 1110 1111
1000 1001 1010 1011
R1R2
1
2 5
4
3
00 1 01 3 10 2 11 3
00 3 01 4 10 3 11 5
(a)
0000 0111 1010 1101
0001 0100 1011 1110
0011 0101 1000 1111
0011 0110 1001 1100
R1R2
1
2 5
4
3
0000 1 0111 1 1010 1 … …
0001 4 0100 4 1011 4 … …
(b)
Figure 7.27
Fig. 7.27 Advantage of Hierarchical Routing
b. Non - Hier.
a. Hierarchical -
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6
1
1
2
32
3
5
2
4
Figure 7.28
Fig. 7.28 Sample net with costs. We will use this net for a detailed example on the blackboard
But, first let's finish talking about different types of routing.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6
1
1
2
2
2
Figure 7.29
Results of Bellman-Ford Algorithm: Shortest path tree for this network.
Our bird's eye view of the net allows us to easily see that this is the lowest cost solution, but it's not so easy for the routers to do this automatically. They only have information measured by other routers to use.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Shortest Path Routing Approaches
• Distance Vector (original Internet approach, uses only one metric, often hops, uses Bellman-Ford, has count-to-infinity problem, RIP still used in internets)
• Link State (now most common in Internet, uses Dijkstra,can use multiple cost functions, avoids count-to-infinity)
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Other Routing Approaches
• Flooding
• Deflection Routing
• Source Routing
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
(a)
1
2
3
4
5
6
Figure 7.33 - Part 1 of 3
Flooding Routing Algorithm
Send incoming packets on all output ports, except the one it came in on. First step.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6
(b)
Figure 7.33 - Part 2 of 3
Second Step of Flooding
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6
(c)
Figure 7.33 - Part 3 of 3
Third step of Flooding. Need control to prevent saturation of network. Use "time-to-live" field
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3
3,0 3,1 3,2 3,3
Figure 7.34
Hot Potato or Deflection Routing
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3
3,0 3,1 3,2 3,3
busy
Figure 7.35
Routers can do without buffers. Pure switch can be used.
(0,2) wants to send to (1,0), but (0,1) is busy. Deflect to right.
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
1
2
3
4
5
6
A
B
Source host
Destination host
1,3,6,B
3,6,B 6,B
B
Figure 7.36
Source Routing
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
48
63
2
1
5 7
Congestion
Figure 7.50
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Offered load
Thr
ough
put
Controlled
Uncontrolled
Figure 7.51
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Time
Bit
s pe
r se
cond
Peak rate
Average rate
Figure 7.52
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Water drains ata constant rate
Leaky bucket
Water pouredirregularly
Figure 7.53
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Arrival of a packet at time ta
X’ = X - (ta - LCT)
X’ < 0?
X’ > L?
X = X’ + ILCT = ta
conforming packet
X’ = 0
Nonconformingpacket
X = value of the leaky bucket counterX’ = auxiliary variableLCT = last conformance time
Yes
No
Yes
No
Figure 7.54
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
I
L+I
Bucketcontent
Time
Time
Packetarrival
Nonconforming
* * * * * * * **
Figure 7.55
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Time
MBS
T L I
Figure 7.56
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Tagged or dropped
Untagged traffic
Incomingtraffic
Untagged traffic
Leaky bucket 1PCR and CDVT
Leaky bucket 2SCR and MBS
Tagged or dropped
Figure 7.57
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Time0 1 2 3
Time0 1 2 3
10 Kbps
Time0 1 2 3
50 Kbps
100 Kbps
(a)
(b)
(c)
Figure 7.58
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Incoming
traffic
Shaped
trafficSize N
Packet
Server
Figure 7.59
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Incomingtraffic
Shapedtraffic
Size N
Size K
Tokens arriveperiodically
Server
Packet
Token
Figure 7.60
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
b bytes instantly
t
r bytes per second
Figure 7.61
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
A(t) = b+rt
R(t) R(t)
No backlog of packets
bR
b R - r
(a)
(b) Buffer occupancy @ 1
0
empty
tt
Figure 7.62
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
Congestionwindow
10
5
15
20
0
Round-trip times
Slowstart
Congestionavoidance
Congestion occurs
Threshold
Figure 7.63
Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies
3 2 11 2
21
3 2 11 2
21
21
Medium
A B
3 2 11 2
21
C
21
21
2 134 1 2 3 4
End system
End system
Network
1
2
Physical layer entity
Data link layer entity3 Network layer entity
3 Network layer entity
Transport layer entity4
Figure 7.3