Data Link Control
Data Link Control
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Why Data Link Control?
The data link layer is the connection between a user workstation and the network.
How does the data get from this workstation on the desk here to a server in, say, New York?
11.2
11-1 FRAMING
The data link layer needs to pack bits into frames, so that each frame is distinguishable from
another. Our postal system practices a type of framing. The simple act of inserting a letter into
an envelope separates one piece of information from another; the envelope serves as the
delimiter.
Fixed-Size Framing
Variable-Size Framing
11.3
Figure 11.1 A frame in a character-oriented protocol
11.4
Figure 11.2 Byte stuffing and unstuffing
11.5
Figure 11.3 A frame in a bit-oriented protocol
11.6
Figure 11.4 Bit stuffing and unstuffing
11.7
11-2 FLOW AND ERROR CONTROL
The most important responsibilities of the data link layer are flow control and error control.
Flow Control
Error Control
11.8
Note
data
11.9
Note
11.10
Error Control
1. Do nothing
11.11
Error Control - Do Nothing
Seems like a strange way to control errors but some lower layer protocols such as frame relay perform this
For example, if frame relay detects an error, it simply tosses the frame. No message is returned.
Frame relay assumes a higher protocol (such as TCP/IP) will detect the tossed frame and ask for
retransmission
11.12
Error Control - Return an Error Message
11.13
Stop-and-Wait Error Control
11.14
11.15
Stop and Wait Link
Utilization
11.16
Stop and Wait Link
Utilization
11.17
Stop and Wait Link
Utilization Example
Consider a WAN using ATM, 2 stations
1000 km apart, ATM frame size = 424 bits,
standard data rate = 155.52 Mbps
Frame Transmission Time (L/R)
=424/155.52 x 106 = 2.7 x 10-6 seconds
Assume optical link:
Propagation Time (D/V) = 106 m / 3 x 108
m/sec
= 0.33 x 10-2 seconds
11.18
Stop and Wait Link
Utilization Example
Thus, a = 0.33 x 10-2 / 2.7 x 10-6 =
1222
U = 1/(1+2a) = 1/(1+2x1222) =
0.0004 ouch!
Another example: A LAN
V = 2 x 108 m/s
L = 1000 bits
R = 10 Mbps
11.19
D = 0.1 km = 100 m
Stop and Wait Link
Utilization Example
Thus, a = (D/V) / (L/R) = 0.005
11.20
Sliding Window Error Control
These techniques assume that multiple frames are in transmission at one time
A sliding window protocol allows the transmitter to send up to the window size frames before receiving any
acknowledgments.
When a receiver does acknowledge receipt, the returned ACK contains the number of the frame expected
next.
11.21
11.22
Sliding Window Error Control
Older sliding window protocols numbered each frame or packet that was transmitted
More modern sliding window protocols number each byte within a frame
11.23
11.24
This example shows each byte numbered
11.25
Sliding Window Error Control
Notice that an ACK is not always sent after each frame is received. It is more efficient to wait for a few
11.26
Sliding Window Error Control
Rule 1: If a receiver just received data and wants to send its own data, piggyback an ACK along with that
data
Rule 2: If a receiver has no data to return and has just ACKed the last packet, receiver waits 500 ms for
another packet. If while waiting, another packet arrives, send the ACK immediately
Rule 3: If a receiver has no data to return and has just ACKed the last packet, receiver waits 500 ms. No
11.27
11.28
Sliding Window Error Control
As shown in the next slide, if a frame is lost, the following frame will be “out of sequence”. The receiver
will hold the out of sequence bytes in a buffer and request the sender to retransmit the missing frame.
11.29
11.30
Sliding Window Error Control
As shown in the next slide, if an ACK is lost, the sender will wait for the ACK to arrive and eventually
time-out. When the time-out occurs, the sender will resend the last frame.
11.31
11.32
Sliding Window Performance
U = 1 if W >= 2a + 1 where W =
window size
Thus, Utilization = 1 (100%) where
ACK for frame 1 reaches A before A
has exhausted its window
U = W / (2a+1) if W < 2a + 1 (A’s
window closes)
11.33
Sliding Window Performance
11.34
High Level Data Link Control
11.35
HDLC Station Types
11.36
HDLC Link Configurations
11.37
HDLC Transfer Modes (1)
11.38
HDLC Transfer Modes (2)
11.39
HDLC Transfer Modes (3)
11.40
Frame Structure
11.41
Frame Structure Diagram
11.42
HDLC frame types
11.43
Address Field
Identifies secondary station that sent or
will receive frame
Usually 8 bits long
May be extended to multiples of 7 bits
LSB of each octet indicates that it is the last
octet (1) or not (0)
All ones (11111111) is broadcast
11.44
Control Field
11.45
Control Field Diagram
11.46
HDLC Commands and
Responses
Supervisory
Reject (REJ)
Unnumbered
Disconnect (DISC)
Reset (RSET)
Test (TEST)
11.48
Poll/Final Bit
11.49
Information Field
11.50
Frame Check Sequence
Field
11.51
HDLC Operation
11.52
Examples of Operation (1)
11.53
Examples of Operation (2)
11.54
Figure 11.29 Example of connection and disconnection
11.55
Example 11.10
Figure 11.30 shows an exchange using piggybacking. Node A begins the exchange of information
with an
acknowledgment of both frames onto an I-frame of its own. Node B’s first
I-frame is also numbered 0 [N(S) field] and contains a 2 in its N(R) field, acknowledging the receipt
of A’s frames 1 and 0 and indicating that it expects frame 2 to arrive next. Node B transmits its
second and third I-frames (numbered 1 and 2) before accepting further frames from node A.
11.56
Example 11.10 (continued)
Its N(R) information, therefore, has not changed: B frames 1 and 2 indicate that node B is still
expecting A’s frame 2 to arrive next. Node A has sent all its data. Therefore, it cannot piggyback an
acknowledgment onto an I-frame and sends an S-frame instead. The RR code indicates that A is
still ready to receive. The number 3 in the N(R) field tells B that frames 0, 1, and 2 have all been
11.57
Figure 11.30 Example of piggybacking without error
11.58
Example 11.11
Figure 11.31 shows an exchange in which a frame is lost. Node B sends three data frames (0, 1, and
2), but frame 1 is lost. When node A receives frame 2, it discards it and sends a REJ frame for
frame 1. Note that the protocol being used is Go-Back-N with the special use of an REJ frame as a
NAK frame. The NAK frame does two things here: It confirms the receipt of frame 0 and declares
that frame 1 and any following frames must be resent. Node B, after receiving the REJ frame,
resends frames 1 and 2. Node A acknowledges the receipt by sending an RR frame (ACK) with
acknowledgment number 3.
11.59
Figure 11.31 Example of piggybacking with error
11.60
Other DLC Protocols
(LAPB,LAPD)
Link Access Procedure, Balanced (LAPB)
Part of X.25 (ITU-T)
Subset of HDLC - ABM
Point to point link between system and packet
switching network node
Link Access Procedure, D-Channel
ISDN (ITU-D)
ABM
Always 7-bit sequence numbers (no 3-bit)
16 bit address field contains two sub-
addresses
One for device and one for user (next layer up)
11.61
Other DLC Protocols (LLC)
11.62
Other DLC Protocols
(Frame Relay) (1)
Streamlined capability over high
speed packet witched networks
Used in place of X.25
Uses Link Access Procedure for
Frame-Mode Bearer Services (LAPF)
Two protocols
Control - similar to HDLC
Core - subset of control
11.63
Other DLC Protocols
(Frame Relay) (2)
ABM
7-bit sequence numbers
16 bit CRC
2, 3 or 4 octet address field
Data link connection identifier (DLCI)
Identifies logical connection
More on frame relay later
11.64
Other DLC Protocols (ATM)
11.65
Data Communications
66
McGraw-Hill
© The McGraw-Hill Companies, Inc., 2000
Basics of PPP
Used on point-to-point links such
as modem dialup, DSL, and cable
modem
SLIP (serial line Internet protocol)
was first but could only support IP
and only static IP address
assignment
PPP solves both above problems
11.67
PPP States
Idle state – link is not being used
Establishing state – one endpoint
starts a dialog; options are
exchanged between endpoints;
several packets may be exchanged
Authenticating state – optional,
two sides agree to authenticate
(described later)
11.68
PPP States
Networking state – primary state,
exchange of user control and data
packets can now be performed
Terminate state – one side wishes
to tear down connection; several
packets exchanged (housekeeping)
(See figure next slide)
11.69
Figure 12-2
Transition States
11.70
PPP Layers
PPP has only two layers – physical
and data link
Physical layer is not defined – it is
whatever the user uses
Data link layer looks like HDLC,
except address field = 11111111
(broadcast), control field =
11000000 (a HDLC U-frame)
11.71
Figure 12-1
PPP Frames
11.72
PPP Layers
The Data field carries the packets
from one of three other protocols -
Link Control Protocol,
authentication protocols, and
Network Control Protocol, all
described shortly
11.73
12.3 Protocol stack
11.74
Link Control Protocol (LCP)
Responsible for establishing,
maintaining, configuring,
terminating link, and negotiation
All LCP packets are carried in
payload field of PPP frame – PPP
field Protocol = hex C021
11.75
Figure 15-5
11.76
Table 12.1 LCP packets and their codes
Option Default
11.78
Authentication
Potentially important since this is
dial-up communication
Two possible protocols for
authentication:
Password Authentication Protocol (PAP
Challenge Handshake Authentication
Protocol (CHAP)
11.79
Authentication – PAP
Two-step process
User sends ID and password
System verifies
PAP packets are encapsulate in a
PPP frame
There are 3 types of PAP packets
(see the next two slides)
11.80
Figure 12-5
PAP
11.81
Figure 12-6
PAP Packets
11.82
Authentication – CHAP
Three-way handshake
System sends a challenge packet
User applies a predefined function
that takes the challenge value and
the user’s own password and creates
a result
System does the same; then
compares its result to user’s result
11.83
Figure 12-7
CHAP
11.84
Figure 12-8
CHAP Packets
11.85
IPCP (An NCP Protocol)
Now that a link has been
established and optional security
has been established, we need to
establish a network layer
connection
IPCP, or Internetwork Protocol
Control Protocol, is an NCP
(Network Control Protocol)
11.86
IPCP
Seven packet types:
Configure-request (01)
Configure-ACK (02)
Configure-NAK (03)
Configure-reject (04)
Terminate-request (05)
Terminate-ACK (06)
Code-reject (07)
11.87
Figure 12-9
11.88
12.10 An example
11.89
An Example
11.90
Review Questions
11.91
Review Questions
11.92