Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Chapter 5 Leon-Garcia
Peer-to-Peer Protocols
We will cover most of chapter.
Homework problems are posted on new schedule
on class website.
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Outline
• 5.1 Peer-to-peer protocols and service models
• 5.2 ARQ Protocols
• 5.3 Other Adaptation Functions
– Sliding Window Flow Control
– Synchronization
• 5.4 Data Link Layer
– HDLC
– PPP
• 5.5 Statistical Multiplexing
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
n+1
entity
n+1
entity
n-SDU
n-SDU
SAP2
SAP1
n-SDU
H
n entity
n entity
H
n-SDU
n-PDU
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.1
Peer-to-peer protocol across a single hop.
(a)
A
Protocol stack
view
Packets
Packets
Data link
Layer
Data link
Layer
Frames
Physical
Layer
Physical
Layer
B
(b)
Spatial view.
1 2
3
2 1
Medium
A
1
Copyright ©2000 The McGraw Hill Companies
3
B
2
1
2 1
Physical layer entity
3
2
1 2
Network layer entity
Data link layer entity
Leon-Garcia & Widjaja: Communication Networks
Figure 5.2
Peer-to-peer protocols, end-to-end across a network
Protocol stack view
Messages
Messages
Segments
Transport
Layer
Transport
Layer
Network
Layer
Network
Layer
Network
Layer
Network
Layer
Data link
Layer
Data link
Layer
Data link
Layer
Data link
Layer
Layer
Physical
Layer
Physical
Layer
Physical
Layer
End system
Physical
a
End system
B
Network
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.3
Peer-to-peer
protocols end-to-end
across a network.
C
1 2
3
Spatial view.
2 1
End System
a
4 3 2 1
1 2
3
2 1
1 2
3
B
2
1
Medium
A
2 1
End System
b
1 2 3 4
Network
1
Physical layer entity
2
Data link layer entity
Copyright ©2000 The McGraw Hill Companies
3
3
Network layer entity
4
Transport layer entity
Network layer entity
Leon-Garcia & Widjaja: Communication Networks
Figure 5.4
Service Models
Main division is between connection-oriented and
connectionless models
• Connection-oriented (Similar to circuit-switched POTS)
1. Need to first set up connection
2. Then conduct dialog. Packets take same route on
“virtual circuit”...
3. Need to release connection for others to use
• Connectionless (Similar to old telegram system)
– No set up or take down required.
– Packets (“datagrams”) flow to destination
independently. Might take different routes.
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Other Aspects of Service Model
•
•
•
•
Acknowledged vs. unacknowledged service
Packets organized into blocks or streams of bits or bytes
Constant bit rate (attempt) or variable bit rate
Quality of Service (QoS)
– probability of error
– probability of loss
– transfer delay
– “Best Effort” service -- no guarantees
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Network service
Application
Network
Application
Adaptation
Function
Adaptation
Function
End-to-end application requirements
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.5
End-to-End Requirements and Adaptation Functions
• The adaptation function that tries to overcome deficiencies
in underlying network service
• Adaptation functions can help deal with:
– arbitrary message size
– reliability and sequencing
– pacing and flow control
– timing
– addressing
– privacy, integrity, and authentication
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Messages of arbitrary size must be sent, but networks have a limit on
block sizes. An adaptation function might change size of blocks.
1 call = 1 message = entire sequence of speech samples
(a)
A voice conversation might be viewed as a humongous message or a stream of bytes
1 call = sequence of 1-byte messages
(b)
1 long message
2 or more short messages
(c)
2 or more blocks
Copyright ©2000 The McGraw Hill Companies
1 block
Leon-Garcia & Widjaja: Communication Networks
Figure 5.6
More on adaptation functions
• The next slide shows how adaptation functions can be
applied end-to-end or on a hop-by-hop basis
• The example shows how error controls can be applied
using ARQ. That is, ACKs or NACKs are sent back to
sender to report success of block reception.
• The end-to-end approach is simpler, but takes longer to
respond to errors.
• Hybrids of both approaches are common. Both HDLC at
data link layer and TCP at transport layer do error
checking.
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
End-to-end
ACK/NAK
1
2
Data
3
Data
4
5
Data
Data
Data
Data
Hop-by-hop
Data
1
Data
2
ACK/
NAK
Copyright ©2000 The McGraw Hill Companies
3
ACK/
NAK
4
ACK/
NAK
Leon-Garcia & Widjaja: Communication Networks
5
ACK/
NAK
Figure 5.7
5.2 ARQ Protocols
• Automatic Repeat Request (ARQ) can ensure that data is
delivered accurately, despite occasional errors at lower
layers.
• Stop and Wait
• Go-back-N
• Selective Repeat
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Error-free
packet
sequence
Information
frames
Packet
sequence
Transmitter
Station A
Receiver
Control
frames
CRC
Station B
CRC
Information
packet
Header
Header
Control frame
Information Frame
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.8
(a) Frame 1 lost
A
Time-out
time
frame
0
frame
1
ACK
B
(b) ACK lost
A
frame
1
frame
2
ACK
Time-out
time
frame
0
B
frame
1
ACK
frame
1
ACK
frame
2
ACK
In parts (a) and (b) transmitting station A acts the same way, but part (b)
receiving station B accepts frame 1 twice.
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.9
time-out
A
time
frame
0
ACK
B
frame
0
ACK
frame
1
frame
2
Transmitting station A misinterprets duplicate ACKs
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.10
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
Rnext
Slast
Timer
Slast
Transmitter
Rnext
Station A
(0,0)
Global State:
(Slast, Rnext)
Receiver
Station B
Error-free frame 0
arrives at receiver
ACK for
frame 1
arrives at
transmitter
Error-free frame 1
arrives at receiver
(1,0)
Copyright ©2000 The McGraw Hill Companies
(0,1)
ACK for
frame 0
arrives at
transmitter
(1,1)
Leon-Garcia & Widjaja: Communication Networks
Figure 5.11
Time-out
(a) Frame 1 lost
A
time
frame
0
B
(b) ACK for frame 1 lost
A
frame
1
ACK
1
ENQ
frame
1
ACK
1
Time-out
time
frame
0
B
Copyright ©2000 The McGraw Hill Companies
frame
1
ACK
1
ENQ
ACK
0
frame
0
ACK
0
Leon-Garcia & Widjaja: Communication Networks
Figure 5.12
4 frames are outstanding; so go back 4
Go-Back-4:
fr
0
fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
3
fr
4
fr
5
fr
6
fr
7
A
B
A
C
K
1
A
C
K
2
Copyright ©2000 The McGraw Hill Companies
A
C
K
3
Out-of-sequence frames A
C
K
4
error
A
C
K
5
fr
8
A
C
K
6
time
fr
9
A
C
K
7
Leon-Garcia & Widjaja: Communication Networks
A
C
K
8
A
C
K
9
Figure 5.13
Time-out expires
Stop-and-Wait
fr
0
fr
0
A
time
fr
1
B
A
C
K
1
error
4 frames are outstanding; so go back 4
Go-Back-N
A
B
fr
0
fr
1
fr
2
fr
3
fr
1
fr
2
fr
3
Out-of-sequence framesA
error
Copyright ©2000 The McGraw Hill Companies
fr
0
C
K
1
fr
4
A
C
K
2
fr
5
A
C
K
3
time
fr
6
A
C
K
4
Leon-Garcia & Widjaja: Communication Networks
A
C
K
5
A
C
K
6
Figure 5.14
Transmitter
Receiver
Send Window
...
Frames
transmitted S
last
and ACKed
Srecent
Buffers
Timer
Slast
Timer
Slast+1
...
Timer
Srecent
Receive Window
Slast+Ws-1
frames
received
Rnext
The receiver will only accept
a frame that is error-free and
that has sequence number Rnext
...
Slast+Ws-1
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.15
M =22 = 4, Go-Back - 4:
fr
0
fr
2
fr
1
fr
3
Transmitter goes back 4
fr
0
fr
1
fr
2
fr
3
time
A
B
A
C
K
2
A
C
K
1
M=22=4, Go-Back-3:
fr
0
A
C
K
4
Receiver has Rnext=0, but it does not
know whether its ACK for frame 0
was received, so it does not know
whether this is the old frame 0 or a
new frame 0
Transmitter goes back 3
fr
2
fr
1
A
C
K
3
fr
0
fr
1
fr
2
time
A
B
A
C
K
1
Copyright ©2000 The McGraw Hill Companies
A
C
K
2
A
C
K
3
Receiver has Rnext=3 , so it rejects the old
frame 0
Leon-Garcia & Widjaja: Communication Networks
Figure 5.16
Transmitter goes back to frame 1
Go-Back-7:
fr
0
fr
1
fr
2
A
fr
3
fr
4
fr
5
fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
7
time
fr
0
B
A
C
K
1
N
A
K
1
Out-of-sequence
frames
A
C
K
2
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
A
C
K
7
error
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.17
Station B
Station A
SArecent RA next
Transmitter
Receiver
Transmitter
Receiver
SBrecent RB next
ACKs are piggybacked in headers
“A” Receive Window
“B” Receive Window
RA next
RB next
“A” Send Window
...
SA last
“B” Send Window
...
SB last
SA last+WA s-1
Buffers
Timer
SA last
Timer
SA last+1
...
SArecent
...
Timer
Timer
SA last+WA s-1
Copyright ©2000 The McGraw Hill Companies
SB last+WB s-1
Buffers
Timer
SB last
Timer
SBlast+1
...
SBrecent
...
Timer
Timer
Leon-Garcia & Widjaja: Communication Networks
SB last+WB s-1
Figure 5.18
Tout
Tproc
Tprop
Tf
Copyright ©2000 The McGraw Hill Companies
Tf
Tprop
Leon-Garcia & Widjaja: Communication Networks
Figure 5.19
Transmitter
Receiver
Receive Window
Send Window
...
Frames
transmitted S
last
and ACKed
Srecent
Slast+Ws-1
Frames
received
Rnext
Buffers
Timer
Slast
Timer
Slast+1
Rnext +Wr-1
Buffers
Rnext+1
Rnext+2
...
Timer
...
Srecent
Rnext+Wr-1
...
Slast+Ws-1
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.20
fr
0
A
fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
2
fr
7
A
C
K
2
A
C
K
2
fr
8
fr
9
fr
10
fr
11
time
fr
12
B
A
C
K
1
A
C
K
2
Copyright ©2000 The McGraw Hill Companies
error
N
A
K
2
A
C
K
2
A
C
K
7
A
C
K
8
A
C
K
9
A
C
K
1
0
Leon-Garcia & Widjaja: Communication Networks
A
C
K
1
1
A
C
K
1
2
Figure 5.21
M=22=4, Selective Repeat: Send Window = Receive Window = 3
Frame 0 resent
fr
0
fr
2
fr
1
time
fr
0
A
A
C
K
2
A
C
K
1
B
A
C
K
3
Receive Window {3,0,1}
Send Window = Receive Window = 2
fr
0
fr
0
fr
1
Frame 0 resent
time
A
B
A
C
K
1
Copyright ©2000 The McGraw Hill Companies
A
C
K
2
frame 0 rejected
Receive Window
{2,3}
Leon-Garcia & Widjaja: Communication Networks
Figure 5.22
t0
A
tproc
B
tprop
Copyright ©2000 The McGraw Hill Companies
frame
tf time
tproc
tack
tprop
Leon-Garcia & Widjaja: Communication Networks
Figure 5.23
1
0.8
Selective Repeat
Go-Back-N
0.6
0.4
0.2
Stop & Wait
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
1.E-07
5.E-07
1.E-06
5.E-06
1.E-05
5.E-05
1.E-04
5.E-04
1.E-03
5.E-03
1.E-02
5.E-02
1.E-01
0
p
Figure 5.24
0.9
0.8
Selective Repeat
0.7
0.6
Go-Back-N
0.5
0.4
62
32
17
10
0.3
6
3
0.2
3
Stop &Wait
0.1
3
nf
0
32
64
Copyright ©2000 The McGraw Hill Companies
128
256
512
1024
Leon-Garcia & Widjaja: Communication Networks
1536
2048
Figure 5.25
A
transmit
transmit
time
on
off
on
off
time
B
2Tprop
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.26
return of permits
tcycle
A
time
B
time
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.27
Synchronous source sends
periodic information blocks
Network output not periodic
Networ
k
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.28
arrival
times
time
send
times
Receiver too slow
buffer overflow
playout
times
Tplayout
time
Receiver too fast
buffer starvation
time
time
Receiver speed
just right
Many late
packets
Tplayout
Copyright ©2000 The McGraw Hill Companies
time
Tplayout
Leon-Garcia & Widjaja: Communication Networks
time
Figure 5.29
Buffer for information blocks
Error
signal
+
Add
t4
t3
t2
t1
Playout
command
Smoothing
filter
Adjust
frequency
-
Recovered
clock
Timestamps
Counter
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.30
Receiver
Transmitter
f
f
fs
Network
fr
fn
Network clock
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.31
Application
Application
byte stream
byte stream
Segments
Transmitter
Receiver
Receive buffer
Send buffer
ACKs
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.32
Network
Layer
NLPDU
Network
Layer
“packet”
DLSDU
DLSAP
DLSAP
Data Link
Layer
DLSDU
DLPDU
Data Link
Layer
“frame”
Physical
Layer
Copyright ©2000 The McGraw Hill Companies
Physical
Layer
Leon-Garcia & Widjaja: Communication Networks
Figure 5.32
Unbalanced Point-to-point link
Commands
Primary
Secondary
Responses
Unbalanced Multipoint link
Commands
Primary
Responses
Secondary
Secondary
Secondary
Balanced Point-to-point link between Combined Stations
Primary
Commands
Secondary
Copyright ©2000 The McGraw Hill Companies
Responses
Responses
Secondary
Commands
Primary
Leon-Garcia & Widjaja: Communication Networks
Figure 5.33
Flag
Address
Copyright ©2000 The McGraw Hill Companies
Control
Information
Leon-Garcia & Widjaja: Communication Networks
FCS
Flag
Figure 5.35
Information Frame
1
2-4
0
5
N(S)
6-8
P/F
N(R)
N(R)
Supervisory Frame
1
0
S
S
P/F
M
M
P/F
Unnumbered Frame
1
1
Copyright ©2000 The McGraw Hill Companies
M
Leon-Garcia & Widjaja: Communication Networks
M
M
Figure 5.36
SABM
UA
Copyright ©2000 The McGraw Hill Companies
Data
transfer
DISC
Leon-Garcia & Widjaja: Communication Networks
UA
Figure 5.37
Secondaries B, C
Primary A
B, RR, 0, P
X
B, I, 0, 0
B, I, 1, 0
B, I, 2, 0,F
B, SREJ, 1
C, RR, 0, P
C, RR, 0, F
B, SREJ, 1,P
B, I, 1, 0
B, I, 3, 0
B, I, 4, 0, F
B, I, 0, 5
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.38
Combined Station A
Combined Station B
B, I, 0, 0
B, I, 1, 0
A, I, 0, 0
X
A, I, 1, 1
B, I, 2, 1
A, I, 2, 1
B, I, 3, 2
B, REJ, 1
B, I, 4, 3
A, I, 3, 1
B, I, 1, 3
B, I, 2, 4
B, I, 3, 4
Copyright ©2000 The McGraw Hill Companies
B, RR, 2
B, RR, 3
Leon-Garcia & Widjaja: Communication Networks
Figure 5.39
Flag
Address
Control
01111110 1111111
All stations are to
accept the frame
Protocol
00000011
Unnumbered
frame
Copyright ©2000 The McGraw Hill Companies
Information
CRC
flag
01111110
Specifies what kind of packet is contained in the
payload, e.g., LCP, NCP, IP, OSI CLNP, IPX
Leon-Garcia & Widjaja: Communication Networks
Figure 5.40
A Typical Scenario
1. Carrier
Detected
Dead
7. Carrier
Dropped
failed
Establish
Terminate
6. Done
2. Options
Negotiated
failed
Authenticate
5. Open
4. NCP
Configuration
3. Authentication
Completed
Network
Copyright ©2000 The McGraw Hill Companies
Home PC to Internet Service Provider
1. PC calls router via modem.
2. PC and router exchange LCP packets to
negotiate PPP parameters.
3. Check on identities.
4. NCP packets exchanged to configure the
network layer, e.g., TCP/IP ( requires IP
address assignment).
5. Data transport, e.g. send/receive IP
packets.
6. NCP used to tear down the network layer
connection (free up IP address); LCP
used to shut down data link layer
connection.
7. Modem hangs up.
Leon-Garcia & Widjaja: Communication Networks
Figure 5.41
Input lines
A
Output line
B
Buffer
C
Header
Copyright ©2000 The McGraw Hill Companies
Data payload
Leon-Garcia & Widjaja: Communication Networks
Figure 5.42
(a)
Dedicated Lines
A1
A2
B1
B2
C1
(b)
Shared Line
Copyright ©2000 The McGraw Hill Companies
A1
C2
C1
B1
A2
Leon-Garcia & Widjaja: Communication Networks
B2
C2
Figure 5.43
(a)
Dedicated Lines
A1
A2
B1
B2
C1
(b)
Shared Line
(c)
N(t)
Copyright ©2000 The McGraw Hill Companies
A1
C2
C1
B1
A2
Leon-Garcia & Widjaja: Communication Networks
B2
C2
Figure 5.44
e-t
0
Copyright ©2000 The McGraw Hill Companies
t
Leon-Garcia & Widjaja: Communication Networks
Figure 5.45
Finite buffer multiplexer
Normalized average delay
10
8
6
4
2
3
2.8
2.6
2.4
2.2
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0
Load
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.46
1
Loss probability
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
3
2.8
2.6
2.4
2.2
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0
Load
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.47
10
Normalized average delay
9
8
7
6
M/M/1
5
4
M/D/1
3
2
1
0.99
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
Load
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.48
Average Delay (seconds)
0.6
0.5
L=1200
0.4
0.3
L=800
L=400
0.2
0.1
L=200
0
0
8000
16000
24000
32000
40000
48000
56000
64000
Goodput (bits/second)
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.49
Many
Voice
Calls
Fewer
Trunks
Part of this burst is lost
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.50
Trunks
10
12
14
16
20
18
24
22
Speech loss
1
0.1
48
0.01
24
32
40
0.001
# connections
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.51
Many voice terminals
generating voice packets
A3
B3
C3
D3
A1
A2
B1
B2
C2
D2
C1
Buffer
B3 C3 A2 D2 C2 B1 C1 D1 A1
D1
buffer overflow
B2
Copyright ©2000 The McGraw Hill Companies
Leon-Garcia & Widjaja: Communication Networks
Figure 5.52
Sent
Received
Copyright ©2000 The McGraw Hill Companies
1
2
1
3
t
2
Leon-Garcia & Widjaja: Communication Networks
3
t
Figure 5.53