Example Data Link Protocols
Savera Tanwir
Bit-Oriented & Character-Oriented
Protocols
Bit Oriented Protocol
Basic unit: Bit
Frame length is not a multiple of character size
Example: HDLC (High-level Data Link Control)
Character Oriented Protocol
Basic unit: character
Frame length is a multiple of character size
Example: PPP
1
HDLC
High Level Data-link Control
ISO 13239
Bit-oriented data link layer protocol
Provides both connectionless and connection-oriented
services to Network Layer
Can be used for point-point as well as point-multipoint
(usually for wireless) connections
Framing
HDLC can operate on both synchronous & asynchronous
links
Each frame begins and ends with a frame delimiter bit-
pattern – 01111110
When no frames are being transmitted on a synchronous link,
the frame delimiter is continuously transmitted
It generates a continuous bit pattern used by modems to train and
synchronize their clocks
Bit-stuffing is used to avoid the flag pattern from occurring in the
data
2
Types of Stations
Primary terminal
Responsible for operation control over the link
It issues the frames which are called commands
Secondary terminal
operates under the control of the primary
Frames issues, are responses only
Primary is linked with secondaries by multiple logical links
Combined terminal
Has the features of both primary and secondary terminals
It issues both commands and responses
High-Level Data Link Control
Address Field
Contains address of the Slave/Secondary station
Control Field
Used for Seq #, ACKs and other control features etc.
Data Field
Variable length, but has an upper limit depending on the network
Checksum Field
CRC-16 of Address, Control and Data fields (x16 + x12 + x5 + 1)
Minimum frame contains three fields and total 32 bits,
excluding the flags on either side
3
Frame Types
Three kinds of frames in HDLC
Information Frames
To transport user data (both normal data & piggybacked control
data)
Supervisory Frames
To transport control data only
used whenever piggybacking is impossible or inappropriate
Unnumbered Frames
To transport link management and control information
High-Level Data Link Control (2)
Control field of
(a) An information frame.
(b) A supervisory frame.
(c) An unnumbered frame.
4
I-Frame Format
Seq Field
Three bits to denote the seq # of the frame
Poll/Final Flag
It is used to signal which side is ‘talking’
When a primary station has finished transmitting a series of frames, it
sets the Poll bit to obtain a response from a secondary station, thus
giving control to the secondary station
At this time the secondary station may reply to the primary station
When the secondary station finishes transmitting its frames, it sets the
Final bit and control returns to the primary station
Next Field
Three bits to denote the seq # of the piggybacked +ve ACK
S-Frame Format
Type Field
Used to distinguish the 4 types of S-Frames
Receive Ready (RR)
00 – +ve ACK and cancels a previous RNR
Receive Not Ready (RNR)
10 – +ve ACK plus receiver cannot receive more I-frames
Reject (REJ)
01 – Signals NAK for Go-Back-N protocol
Selective Reject (SREJ)
11 – Signals NAK for Selective Repeat protocol
Next Field
Three bits to denote the Seq # of the ACK or NAK
5
U-Frame Format
First 2 bits are for identification
The 5 bits of Type and Modifier fields are used in
combination to indicate the U-Frame type
Command/response Meaning
SNRM Set normal response mode
SNRME Set normal response mode (extended)
SABM Set asynchronous balanced mode
Set asynchronous balanced mode
SABME
(extended)
UI Unnumbered information
UA Unnumbered acknowledgment
DISC Disconnect
FRMR Frame reject
HDLC Modes of Operation
Three modes of operation according to the strength of
Primary/Slave relationship
1. Normal Response Mode (NRM)
Primary station initiates the session and full polling is used for all frame
transmissions
The P/F Flag is used in this mode only
Signified by the SNRM(E) frame
2. Asynchronous Response Mode (ARM)
Slave terminals may transmit without permission from the Primary
terminal
However, the primary terminal still retains responsibility for line
initialization, error recovery, and logical disconnect
3. Asynchronous Balanced Mode (ABM)
Either station may initiate the transmission and send frames at any
time
Signified by the SABM(E) frame
6
The Data Link Layer in the
Internet
A home personal computer acting as an internet host.
PPP – Point to Point Protocol
RFCs 1661, 1662, 1663
More of a protocol suite than a particular protocol
PPP is a connection-oriented protocol
Character-oriented with byte-stuffing
Can operate in half-duplex or full-duplex mode
Designed to carry IP traffic but is general enough to allow any
type of network layer datagram to be sent over a PPP
connection
Frames are sent and received in the same order
Doesn’t provide reliable data transfer using sequence numbers
and acknowledgments as the default
Reliable data transfer can be requested as an option
One of the most popular Layer 2 WAN technologies in the
networking world, esp. for dial-up access
An encapsulated form of PPP, called PPP over Ethernet (PPPoE),
is commonly used with DSL Internet service
7
PPP Advantages and Benefits
1. Specification of the encapsulated protocol, to
allow multiple Layer 3 protocols to be
multiplexed on a single link
2. Error detection for each transmitted frame
through the use of a CRC code in each frame
header
3. A robust mechanism for negotiating link
parameters, including the maximum frame size
permitted
PPP Advantages and Benefits
4. A method for testing links before datagram
transmission takes place, and monitoring link
quality
5. Support for authentication of the connection
using multiple authentication protocols
6. Support for additional optional features,
including compression, encryption and link
aggregation (allowing two devices to use
multiple physical links as if they were a single,
higher-performance link)
8
PPP Components
The PPP standard itself describes three “main”
components of PPP:
1. PPP Encapsulation Method
2. Link Control Protocol (LCP)
3. Network Control Protocols (NCPs)
PPP Encapsulation
The primary job of PPP is to take higher-layer messages
such as IP datagrams and encapsulate them for
transmission over the underlying physical layer link
PPP defines a special frame format for encapsulating
data for transmission, based on the framing used in the
HDLC protocol
PPP frame has been specially designed to be small in
size and contain only simple fields, to maximize
bandwidth efficiency and speed in processing
9
Link Control Protocol (LCP)
LCP is responsible for setting up, maintaining, testing,
negotiating and terminating the data-link connection
between devices
Optional support protocols
Authentication Protocols – PAP, CHAP etc.
PPP Compression Control Protocol (CCP) allows compression of
PPP data
PPP Encryption Control Protocol (ECP) enables datagrams to be
encrypted for security
PPP Multilink Protocol (PPP MP) allows a single PPP link to be
operated over multiple physical links
Network Control Protocols (NCPs)
PPP supports the encapsulation of many different Layer
3 protocol packets
After the general link setup is completed with LCP,
control is passed to the Network Control Protocol (NCP)
specific to the Layer 3 protocol being carried on the PPP
link
For example, when IP is carried over PPP the NCP used is the
PPP IP Control Protocol (IPCP)
Other NCPs are defined for supporting the IPX protocol,
the NetBIOS Frames (NBF) protocol, and so forth
10
Connection Establishment
“A host machine (PC) calling ISP for internet connectivity”
1. PC calls ISP’s Access
Server/Router via modem 2. AS’s modem answers the
phone and a physical
connection is established
3. PC sends a series of LCP
packets in one or more PPP frame
payload 4. Responses to establish PPP
parameters
Time
Connection Establishment & Data Transfer
“Once PPP parameters have been agreed upon”
5. A series of NCP packets sent
to configure network layer (e.g., 6. ISP dynamically assigns IP
IP address request in TCP/IP address
suite)
7. PC is now a proper host on the
Internet and can send and
receive IP packets 8. Transmission and reception of
IP packets (encapsulated in PPP
frame) takes place
Time
11
Connection Release
“When data transfer is over”
1. NCP tears down internet
connectivity and frees IP address
2. LCP shuts down data link
layer connection
3. Modem hangs up the phone to
release physical line
Time
Line Up & Down phases
12
Frame Format of PPP
Control field
Controls services offered to the network layer
Protocol field
Kind of packet in the payload e.g. LCP, NCP, IP, IPX, AppleTalk etc.
0 — Refers to Network layer protocols like IP, IPX etc.
1 — Refers to negotiation protocols e.g., LCP, NCP
Payload field
Variable length, up to some max. size negotiated by LCP at setup time
Default is 1500 bytes
CRC Checksum
13
LCP Overview
LCP is used to negotiate data link protocol options
during ESTABLISH phase
Deals with the way for the initialization process to make a
proposal and for the responding process to accept or
reject it
Allows testing of line quality
Network Layer protocol configuration negotiation (NCP
comes in here)
Handles connection termination
Encapsulated LCP frame
For LCP, value of Protocol field is 1100000000100001 or
0xC021
Code
Defines type of LCP frame
ID
To match a request with a corresponding reply
Length
Defines the length of entire frame
Information
Extra information needed for some frames
14
LCP frame types
11 types defined in RFC 1661
LCP Information field
Contains options that are to be negotiated
1. Maximum-Receive-Unit (MRU)
The maximum size datagram it wants the link to be able to carry
2. Authentication-Protocol
Indicate the type of authentication protocol it wishes to use (if any)
3. Quality-Protocol
To enable quality monitoring on the link and what protocol to use (if any)
4. Magic-Number
Used to detect looped back links or other anomalies in the connection
5. Protocol-Field-Compression
To specify use of “compressed” (8 bit) Protocol fields in PPP data frames
instead of the normal 16 bit Protocol field
6. Address-and-Control-Field-Compression (ACFC)
Used to compress the Address and Control fields, again for bandwidth
savings
15
Authentication Protocols
Password Authentication Protocol (PAP)
A simple authentication protocol with a two-step process
16
Challenge Handshake Authentication
Protocol (CHAP)
It is a three-way hand-shaking authentication
protocol that provides more security than PAP
Password is kept secret and never sent online
Network Control Protocol (NCP)
Is a set of control protocols for negotiation at the network
layer
Each is specific to some network layer protocol and allows
protocol-specific configuration requests to be made
For example dynamic address assignment of IP address
Each of the common network layer technologies has a PPP
NCP defined for it in a separate RFC
The most common ones are:-
The PPP Internet Protocol Control Protocol (IPCP)
The PPP Internetworking Packet Exchange Control Protocol (IPXCP)
The PPP NetBIOS Frames Control Protocol (NBFCP)
Te PPP IP Version 6 Control Protocol (IPv6CP)
17
Acknowledgements
Ali Sajjad’s lecture slides
18