Chapter 3
Chapter 3
Framing
Error Control
Error Correction
Error Detection
Flow Control
Retransmission with Sliding Window
Protocols
Protocol Specification and Verification
Example Data Link Protocols
Computer Networks Fall 2002
Page 1
Page 2
no out-of-order
Page 3
Page 4
Framing
To break the bit stream up into discrete
Page 5
Data Framing
Character count
Starting and ending characters with
character stuffing
Starting and ending flags with bit stuffing
Physical layer coding violations
Page 6
Character Count
character count
5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3
frame 1
5 characters
frame 2
5 characters
frame 3
8 characters
frame 4
8 characters
one-bit error
5 1 2 3 4 7 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3
frame 1
5 characters
frame 2
(wrong)
Even if the checksum is incorrect so the destination knows that the frame is
bad, it still has no way of telling where the next frame starts.
Computer Networks Fall 2002
Page 7
user data
DLE ETX
beginning
of frame
end of
frame
B DLE ETX
Page 8
flag
user data 01111110
beginning
of frame
011011111111111111110010
end of
frame
original data
bits stuffed at the sender
011011111011111011111010010
bits destuffed at the receiver
011011111111111111110010
Computer Networks Fall 2002
Page 9
Starting
Delimiter
VV1VV000
beginning of frame
Ending
Delimiter
user
data
VV0VV000
end of frame
V: Violation bit
Computer Networks Fall 2002
Page 10
Error Control
Three types of frames at a receivers end
Damaged frame : Negative acknowledgment /
retransmission
Lost frame : Time-out mechanism
Valid frame : Sequence numbering / discarding
for valid but duplicate frames
Page 11
Flow Control
A technique for assuring that a transmitting
Page 12
Page 13
Codeword
Page 14
Hamming Distance
The number of bit positions in which two
Page 15
Codeword Space
To detect
needed.
To correct d-bit errors, a distance 2d +1 code is
needed.
Page 17
Page 18
Page 19
Hamming Code
The bits that are powers of 2 (1, 2, 4, 8, 16,
Page 20
Page 21
Page 22
Page 23
Page 24
B1 : B3 B5 B7 B9 B11
B2 : B3 B6 B7 B10 B11
B4 : B5 B6 B7
B8 : B9 B10 B11
1 2
3 4
5 6
7 8 9 10 11 column
011 001 111 110 011 000 101 010 001 000 011
burst error
011 001 111 111 101 000 101 010 001 000
Codeword
B1(011100)+B4(1101) => B5
00111010000
10110001001 B1(110001)+B4(1000) => B5
11111010101
B4(1101) => B4
Computer Networks Fall 2002
011
Codeword
00110010000
10111001001
11101010101
Page 25
Error Detection
Parity bit
low error rate
Longitudinal redundancy check (LRC) and
Page 26
Parity Bit
block size: 1000 bits
Hamming code: 1000+10 bits (m+r+1 <= 2n)
parity bit: 1000+1 bits
a message: 106 bits
without no error
Hamming code: 106+10000 bits
parity bit: 106+1000 bits
Page 27
LRC
Page 28
10011011
+ 11001010
= 01010001
Computer Networks Fall 2002
11110000
-10100110
=01010110
Page 29
Page 30
CRC Example
Page 31
Page 32
E(x)= xj
If G(x) contains tow or more terms, it will never
divided E(x)
.. i>j
Assume G(x) is not divisible by x
Page 33
Page 34
Page 35
Well-Known Generator
Polynomials
x12+x11+x3+x2+x+1
CRC-16: x16+x15+x2+1
CRC-CCITT: x16+x12+x5+1
CRC-32: x32+x26+x23+x22+x16+x12+x11+x10+ x8+
x7+x5+x4+x2+x+1
CRC-16 and CRC-CCITT
CRC-12:
Page 36
Page 37
Page 38
timer
When an acknowledgement is lost
Page 39
Page 40
Page 41
Page 42
Page 43
Piggybacking
Page 44
Acknowledgement
Techniques
Control Frame
Data Frame: Piggybacking
The technique of temporarily delaying outgoing
acknowledgements so that they can be hooked onto the
next outgoing data frame is known as piggybacking.
Types
Page 45
Flow Control
Flow control is a technique for assuring that
Page 46
Sliding Windows
Each outbound frame contain a sequence
Receiving window
Maintained by the receiver
Corresponds the set of frames the receiver is
permitted to accept
Computer Networks Fall 2002
Page 47
Receiving window
Any received frame the sequence number
outside the window is discarded
When a frame whose sequence number is equal
to lower edge of the window is received, the
window is rotated by one
Computer Networks Fall 2002
Page 48
Page 49
Wait)
Go-back-N Protocol
Selective Repeat Protocol
Page 50
window size = 1
Page 51
Efficiency of Stop-and-Wait
Stop-and-Wait
time (msec)
t=0
start sending
t=20 completely sent
t=250 frame arrival
t=270 completely received
t=270 acknowledge without delay
t=520 acknowledgement arrival
Page 52
Efficiency of Stop-and-Wait
Page 53
Pipelining
time (msec)
t=0
start sending the first frame
t=20 the first completely sent
t=250 frame arrival
t=270 the first completely received
t=270 acknowledge without delay
t=520 acknowledgement arrival
Page 54
Pipelining
Page 55
Capacity :
Page 56
Go-back-N
Senders window size is n (n >1)
Page 57
Go-back-N : An Example
Page 58
Selective Repeat
Receivers window size is n ( n >1 )
Page 59
Page 60
protocols.
Both Go-back-N and Selective-repeat ARQs
uses the pipelining technique.
Computer Networks Fall 2002
Page 61
ARQ
Instead of using positive or negative
Page 62
Page 63
Window Size
1+
(round-trip delay / transmission time)
Maximum window size of Go-back-N ARQ is
MaxSeq, where the sequence number are 0,
1, ... , MaxSeq.
Maximum window size of Selective-repeat
ARQ is (MaxSeq+1)/2.
The optimal senders windows size is
Page 64
Page 65
Transitions
Occur when some event occurs
Change form some state to another
Page 66
input/output
0/11110
0/110
1/
S
0/0
1/
1
0/10
1/
2
0/1110
1/
3
bit destuffed
0/11111
1/
1/
5
0/
6
end of
E frame
1/
T
beginning
error
of the next
frame
Page 67
Page 68
character oriented
character stuffing
multiprotocol framing
Page 69
Page 70
>=0
16
8
Data Checksum 01111110
Page 71
DCE PDN
address=0xC0, command
Address A
address=0xC0, response
address=0x80, command
Address B
address=0x80, response
Page 72
Command
I
RR
REJ
RNR
SR
Unnumbered
SABM
DISC
Response 1 2 3 4
0 N(S)
RR
1000
REJ
1001
RNR
1010
SR
1011*
DM
1111
1111
1100
UA
1100
FRMR
1110
5
P
P/F
P/F
P/F
P/F
F
P
P
F
F
678
N(R)
N(R)
N(R)
N(R)
N(R)
000
100
010
110
001
Page 73
Page 74
Page 75
Link Termination
SABM
DISC
accept
UA
UA
SABM
reject
DM
Computer Networks Fall 2002
UA
SABM
DISC
DM
Unnumbered/Acknowledgement
Set Asynchronous Balanced Mode
Disconnect
Disconnected Mode
Page 76
Serial Line IP
SLIP (Serial Line IP): to connect SUN
Page 77
Point-to-Point Protocol
PPP: RFC 1661, RFC 1662, RFC 1663
A multiprotocol framing mechanism suitable
Page 78
Homework
#2, #3, #6, #9,#11
Page 79