chapter 7: packet-switching networks · 2012. 12. 10. · packet packet figure 7.17 virtual circuit...
TRANSCRIPT
Chapter 7:Packet-Switching Networks
School of Info. Sci. & Eng.Shandong Univ.
Outlineü 7.1 Network Services and Internal Network
Operationü 7.2 Packet Network Topologyü 7.3 Datagrams and Virtual Circuitsl 7.4 Routing in Packet Networksl 7.5 Shortest Path Algorithmsl 7.6 ATM Networks (Skip)l 7.7 Traffic Management and QOSl 7.8 Congestion Control
Figure 7.1
t0t1
Network
Top level view: a network transfers info among users
The figure simply shows transmission of a single block or a stream of info
Figure 7.2
Physicallayer
Data linklayer
Physicallayer
Data linklayer
End systemα
Networklayer
Networklayer
Physicallayer
Data linklayer
Networklayer
Physicallayer
Data linklayer
Networklayer
Transportlayer
Transportlayer
Messages Messages
Segments
End systemβ
Networkservice
Networkservice
Peer-Peer Protocols Operating End-to-End Across Networks
Protocol Stack View. In C7 we are mostly concerned with the network layer
3 2 11 22
1
3 2 11 22
1
21
Medium
A B
3 2 11 22
1
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
Layer 3 Entities work together to provide services to Layer 4 Entities
Spatial view
Figure 7.4
.
.
.MUX
Network access
Node
Packet Network Topologies:
How do users access a packet-switching network?
One way is shown. Today the MUX might be a shared DSL or Cable Modem. More likely it would be a router that permits a LAN connection between the PCs.
LAN
Bridge
LAN 1
LAN 2
(a) (b)
Figure 7.5
Mostly users at one geographic site are connected with one or more Local Area Networks
(a) Broadcasts frames to all PCs. (b) A bridge usually just connects LANs to make a larger broadcast segment, but a LAN switch isolates traffic to a particular LAN, unless it needs to be sent to another LAN
A large site usually sets up many LANsl LANs are connected usually connect by switches or routers to
isolate traffic to a particular segment if possiblel Such a network of LANs is called a campus networkl The next slide shows a campus network with a backbone internal to
the organizationl It also has a gateway to connect to other networks, usually the
Internetl A site with remote locations might lease lines or share frame relay
interconnections. A multiplexer or router helps share the line by queueing packets to be sent
RR
RRS
SS
s
s s
s
ss
s
ss
s
R
s
R
Backbone
To internet or wide area network
Organization Servers
Gateway
Departmental Server
Figure 7.6
The s = LAN switch. The S is usually a router
More about the typical campus networkl The campus backbone is usually a high speed LAN FDDI at
100Mbps is common, or Gigabit Ethernetl The traffic within an extended LAN segment is delivered
using 48-bit physical addresses; however applications use 36-bit IP addresses. The Address Resolution Protocol ARP automatically builds tables to relate the two.
l To connect the campus network to the larger Internet, we go one more step up the hierarchy. The campus network is then called an autonomous system
Interdomain level
Intradomain level
LAN level
Autonomous systemor domain
Border routers
Border routers
Figure 7.7
Internet service provider
The autonomous system connects to the rest of the internet via border routers at ISP Points of Presence
Role of the National Service Providers
l About 20 in USl See Russ Haynal page on resources
navigators.com/isp.htmll Some of the largest are bankruptl Connections at NAP and MAEs
RA
RB
RC
Route server
NAP
National service provider A
National service provider B
National service provider C
LAN
NAPNAP
(a)
(b)
Figure 7.8
NSPs are connected at Network Access Points
Details
Control
12
3
N
Line Card
Line Card
Line Card
Line Card
Inte
rcon
nect
ion
Fabr
ic
Line Card
Line Card
Line Card
Line Card
12
3
N
Figure 7.10
…… ……
Components of a Generic Switch/Router
CPU
12
3
N
NIC CardNIC CardNIC Card
NIC Card Mai
n M
emor
y
I/OBus
Figure 7.11
……
Building a router from a PC
1
2
N
1
2
N
Figure 7.12
……
Routers perform demultiplexing and multiplexing functions
Networknodes
Message
SubscriberB
SubscriberA
Message
Message
Message
Figure 7.13
Message switching
t
t
t
t
Delay
Source
Destination
T
p
Minimum Delay = 3p + 3T
Switch 1
Switch 2
Figure 7.14
Delays in Message Switching
Packet 2
Packet 1
Packet 1
Packet 2
Packet 2
Figure 7.15
Datagram Packet Switching
t
t
t
t
31 2
31 2
321
3p + 2(T/3) first bit received
3p + 3(T/3) first bit released
3p + 5 (T/3) last bit released
Lp + (L-1)P first bit received
Lp + LP first bit released
Lp + LP + (k-1)P last bit releasedwhere T = k P
3 hops L hops
p
p + P
p + P
Source
Destination
Switch 1
Switch 2
Figure 7.16
Delays in Packet Switching; note that pipelining can speed transfer vs. message switching
Destinationaddress
Outputport
1345 12
2458
70785
6
12
1566
Figure 7.16
Routing table in connectionless packet switching
Packet
Packet
Figure 7.17
Virtual Circuit Packet Switching
A virtual connection is set up for the duration of the call, which simplifies routing. Other streams can use the same physical links, so we still have advantage of sharing resources.
t
t
t
t
31 2
31 2
321
Release
Connect request
CR
CR Connect confirm
CC
CC
Delays in virtual-circuit packet switching
SW 1
SW 2
SW n
Connect request
Connect request
Connect request
Connect confirm
Connect confirm
Figure 7.20
…
Signaling message exchanges in virtual circuit set up
Identifier Outputport
15 15
58
13
13
7
27
12
Nextidentifier
44
23
16
34
Entry for packetswith identifier 15
Figure 7.21
Example of a virtual circuit routing table for an input port. ID is virtual circuit number. Abbreviated headers can be used.
31 2
31 2
321
Minimum Delay = 3p+Tt
t
t
tSource
Destination
Switch 1
Switch 2
Figure 7.22
Standard virtual circuits have same delay to send k packets and the datagram variety, plus the set up phase
"Cut through" packet switching speeds by starting output transmission as soon as header is decoded
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
IP Internet Protocol (Network Layer)
l Actually most information on IP is in Chapter 8 on TCP/IPl Here we should just know that IP is a datagram service,
packets are routed independently of one anotherl It is not connection-oriented at the network layer, but can be
at the transport layer abovel 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.
l The total length of a packet, including info, can be up to 65K bytes, but transit of Ethernet LANs often limits to 1500 bytes
Asynchronous Transfer Mode Definition
l We will skip 7.6 as far as the exam is concerned, but here is a concise definition of ATM (p 483)
l Connection oriented in network layerl Short (48 info bytes) fixed length packets called “cells”l Cells contain short (5 byte) headers that point to connectionsl ATM uses fast hardware switches up to 10,000 ports with up
to 150Mbps eachl ATM has some of the best features of circuit switching and
packet switching. Asychronous = no master clock
Combinations of Service and Subnet Structure
Upper Layer (Transport Layer)
Datagram Virtual Circuit
Connectionless UDP over IP UDP over IP over ATM
Connection-Oriented
TCP over IP ATM AAL1 over ATM
Type of Subnet (Network Layer)
7.4 Routing in Packet Switched Networks
l Net = Routers (or Switches) and linksl Routing involves l Setting up routing tablesl Forwarding packets
l Routing Algorithm tries to set up “best” routesl minimize hops orl minimize delay or l maximize bandwidth or ...
l The Routing Algorithm needs global info about net
Goals of Routing Algorithm
l Rapid and Accurate Delivery of Packetsl Adapt to Failure of Node or Linkl Adapt to Change in Traffic Loadsl Determine Connectivity of Networkl Low Overhead
Classification of Routing Algorithms
l Static vs. Dynamic (Adaptive)l Centralized vs. Distributedl Decisions for each Packet vs. at Connection Time
1
2
3
4
5
6A
B
Switch or router
Host
Figure 7.23
Example of a Packet-Switched Network: Topology for Example
1
2
3
4
5
6AB
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.
Incoming Outgoingnode VC node VC
A 1 3 2A 5 3 33 2 A 13 3 A 5
Incoming Outgoingnode VC node VC
1 2 6 71 3 4 44 2 6 16 7 1 26 1 4 24 4 1 3
Incoming Outgoingnode VC node VC
3 7 B 83 1 B 5B 5 3 1B 8 3 7
Incoming Outgoingnode VC node VC
C 6 4 34 3 C 6
Incoming Outgoingnode VC node VC
2 3 3 23 4 5 53 2 2 35 5 3 4
Incoming Outgoingnode VC node VC
4 5 D 2D 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.
2 23 34 45 26 3
Node 1
Node 2
Node 3
Node 4
Node 6
Node 5
1 12 44 45 66 6
1 32 53 34 35 5
Destination Next node1 13 14 45 56 5
1 42 23 44 46 6
1 12 23 35 56 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.
Hierarchical Addresses in the Internetl Actually the book covers TCP/IP together in Chapter 8l Here (p 488) it points out that routing is simplified if hosts
within a domain have the same prefix (network address).l Then routers outside the domain only have to examine (and
store) the prefixl 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)
l See Fig 7.27
0000 0001 0010 0011
0100 0101 0110 0111
1100 1101 1110 1111
1000 1001 1010 1011
R1 R2
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
R1 R2
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 -
1
2
3
4
5
6
1
1
2
32
35
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.
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.
Shortest Path Routing Approaches
l Distance Vector (original Internet approach, uses only one metric, often hops, uses Bellman-Ford, has count-to-infinity problem, RIP still used in internets)
l Link State (now most common in Internet, uses Dijkstra,canuse multiple cost functions, avoids count-to-infinity)
Other Routing Approaches
l Floodingl Deflection Routingl Source Routing
(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.
1
2
3
4
5
6
(b)
Figure 7.33 - Part 2 of 3
Second Step of Flooding
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
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
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.
1
2
3
4
5
6A
B
Source host
Destination host
1,3,6,B
3,6,B 6,B
B
Figure 7.36
Source Routing
1 2 NN-1
Figure 7.41
…
7.7 Model for Quality of Service Analysis by Traffic Management
Packet buffer
Transmission link
Arrivingpackets
Packet discardwhen full
Packet buffer
Transmissionlink
Arrivingpackets
Class 1discard
when fullClass 2discardwhen thresholdexceeded
(a)
(b)
Figure 7.42
(a) FIFO Queueing. (b) FIFO with 2 classes
Transmission link
Packet discardwhen full
High-prioritypackets
Low-prioritypackets
Packet discardwhen full
When high-priorityqueue empty
Figure 7.43
Priority Queueing
Sorted packet buffer
Transmissionlink
Arrivingpackets
Packet discardwhen full
Taggingunit
Figure 7.44
Sorting packets according to priority tag
48
63
2
1
5 7
Congestion
Figure 7.50
Router 4 is overloaded. Requests for retransmissions compound the problem.
Multitasking computers can have the same type of queueing model, and the same type of saturation.
7.8 Congestion Control
Offered load
Thro
ughp
ut Controlled
Uncontrolled
Figure 7.51
7.8 Congestion Control
Open loop vs. closed loop methods
Due to "thrashing"
Time
Bits
per
seco
nd
Peak rate
Average rate
Figure 7.52
Water drains ata constant rate
Leaky bucket
Water pouredirregularly
Figure 7.53
Open Loop Control depends controlling or shaping entry to the system. One techniques is smoothing the variations in flow with the “leaky bucket” approach
Leaky bucket model for monitoring access controlled traffic and for smoothing bursty traffic
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
I
L+I
Bucketcontent
Time
Time
Packetarrival
Nonconforming
* * * * * * * **
Figure 7.55
Incoming packets are classified as conforming or non-conforming depending on whether they cause the bucket to overflow
Leaky bucket used to identify non-conforming packets. Marked for deletion
Time
MBS
T L I
Figure 7.56
Tagged or dropped
Untagged traffic
Incomingtraffic
Untagged traffic
Leaky bucket 1PCR and CDVT
Leaky bucket 2SCR and MBS
Tagged or dropped
Figure 7.57
Time0 1 2 3
Time0 1 2 3
10 Kbps
Time0 1 2 3
50 Kbps
100 Kbps
(a)
(b)
(c)
Figure 7.58
Traffic shaping. Output of leaky bucket with buffer looks more like (a)
Incomingtraffic
ShapedtrafficSize N
Packet
Server
Figure 7.59
Incomingtraffic
ShapedtrafficSize N
Size K
Tokens arriveperiodically
Server
Packet
Token
Figure 7.60
b bytes instantly
t
r bytes per second
Figure 7.61
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
TCP uses Closed Loop Congestion Control
l TCP provides end-to-end flow control to avoid overunning a slow receiver by a sliding window. Each byte is given a sequence number! The sender cannot send a new byte unless it is in the allowable “advertised window”
l However this advertised window does not prevent intermediate routers from overflowing due to congestion
l To try to optimize speed of transmission TCP establishes a second window called the “congestion window”
l At any time the window used is the smaller of the two.
How Does the Congestion Window Work?
l The size of the congestion window is automatically adjusted depending the experience of the receiver:
l It starts with a small value: one maximum length “segment,” which is the PDU at the transport level
l It then ramps up exponentially, doubling on each transmission until it reaches a congestion threshold--initially "65K bytes." Graph shows 16 x 65K.
l It then goes up linearly until a time out is experienced --assumed to be due to congestion
l The size of the congestion window is then cut back to its initial value and the congestion threshold is cut to half its initial value
Congestionwindow
10
5
15
20
0
Round-trip times
Slowstart
Congestionavoidance
Congestion occurs
Threshold
Figure 7.63
The congestion window seeks the optimum level just before congestion occurs
First threshold
3 2 11 22
1
3 2 11 22
1
21
Medium
A B
3 2 11 22
1
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