Outline: Data Link Layer
Outline: Data Link Layer
Framing
Byte vs. bit oriented protocols
Data Link Layer:
3 4
01111110
5 6
1
Flow Control and Error Control Data Link Protocols
Flow control
A set of procedures that tells the sender how
much data can be sent before waiting for
acknowledgment
Error control
Includes both error detection and correction
Allows receiver to inform sender of lost or
duplicate frames
Mostly based on Automatic Repeat Request
(ARQ)
7 8
9 10
Receiver
11 12
2
Stop-and-Wait Mechanism Stop-and-Wait: Overview
Still noiseless channel
Receiver has limited buffer
Requires flow control
Sender sends one frame at a time and
wait for an acknowledgment
13 14
15 16
17 18
3
Stop-and-Wait ARQ Stop-and-Wait ARQ
Sender keeps a copy of sent frame until
successful delivery is ensured
Receiver responds with an ack when it
successfully receives a frame
Both data and ack frames must be
numbered
When sender does not receive an ack
within certain time, it assumes frame is
lost, then retransmits the same frame.
19 20
S=0 R=0
Deliver
S=1 R=1
Deliver
R=0
Time Time
21 22
Deliver
4
Thinking Corner Flow Diagram: Delayed ACK
Sender Receiver
Why ACK frames need to be numbered?
S=0 R=0
Deliver
Timeout
R=1
Frame 0 expected;
discard
S=1
R=1
Timeout
Deliver
R=0
S=0
25 26
27 28
29 30
5
Sequence Numbers Sending Window
Frame header contains m bits for Sending more than one frame at once requires
sequence number sender to buffer multiple frames
Known as "sending window"
That allows up to 2m different frame Any of these frames in the window can be lost
numbers
How big should m be?
31 32
33 34
35 36
6
Go-Back-N: Normal Operation Go-Back-N: Lost Frame
ACKs are
cumulative
37 38
39 40
41 42
7
Selective Repeat ARQ Send and Receive Windows
Go-Back-N always discards out-of-order Sender and receiver share window space
frames equally
Losing one frame may result in retransmission For m-bit sequence numbers
of multiple frames Send window: up to 2m-1
Very inefficient in noisy link Receive window: up to 2m-1
Selective Repeat ARQ allows frames to be
received out of order
Therefore, receive window > 1
43 44
45 46
47 48
8
HDLC
High-level Data Link Control
Bit-oriented protocol
Data Link Control Protocols:
Support both
HDLC and PPP
Point-to-point links
Multipoint links
50
51 52
53 54
9
U-Frame Codes Connection and Disconnection
55 56
57 58
59 60
10
PPP Transition States Multiplexing in PPP
61 62
63 64
65 66
11
CHAP NCP: Network Control Protocol
A set of control protocols to allow data from the
network layer to be encapsulated into a PPP
frame
One common protocol: IPCP
(Internetwork Protocol Control Protocol)
Allow negotiation at the network layer
67 68
69 70
Questions ?
71 72
12