You are on page 1of 29

HDLC

ISO's High-level Data Link Control (HDLC) This standard corresponds to Layer 2 (the Data Link Layer) of the ISO 7-layered architecture. It is responsible for the errorfree movement of data between network nodes. The job of the HDLC layer is to ensure that data passed up to the next layer has been received exactly as transmitted (i.e error free, without loss and in the correct order). Another important job is flow control, which ensures that data is transmitted only as fast as the receiver can receive it.

MAC and LLC


In any broadcast network, the stations must ensure that only one station transmits at a time on the shared communication channel The protocol that determines who can transmit on a broadcast channel are called Medium Access Control (MAC) protocol to Network Layer The MAC protocol are implemented Logical Link in the MAC sublayer which is the Control lower sublayer of the data link layer Medium Access The higher portion of the data link Control layer is often called Logical Link to Physical Layer Control (LLC)
3

Data Link Layer

IEEE 802 Standards


IEEE 802 is a family of standards for LANs, which defines an LLC and several MAC sublayers
IEEE 802 standard 802.1 802.2
802.11 802.3 802.4 802.5

IEEE Reference Model


Logical Link Control Medium Access Control Physical Layer

Higher Layer

Data Link Layer

Physical Layer

Point-to-Point (serial) links


Many data link connections are pointto-point serial links:
Dial-in or DSL access connects hosts to access routers Routers are connected by high-speed point-to-point links
Access Router Modems

Here, IP hosts and routers are connected by a serial cable


Data link layer protocols for point-topoint links are simple:
Main role is encapsulation of IP datagrams No media access control needed
Router

Dial-Up Access

Router Router

Router

Point-to-Point Links

DATA LINK LAYER IN INTERNET

SLIP (Serial Line IP)

Data Link Protocols for Point-to-Point links


First protocol for sending IP datagrams over dial-up links (from 1988) Encapsulation, not much else

PPP (Point-to-Point Protocol):


Successor to SLIP (1992), with added functionality Used for dial-in and for high-speed routers

HDLC (High-Level Data Link) :


Widely used and influential standard (1979) Default protocol for serial links on Cisco routers Actually, PPP is based on a variant of HDLC

High-Level Data Link Control (HDLC)


HDLC is the mother of LAN and WAN Protocols HDLC was defined by ISO for use on both point-topoint and multipoint data links. It supports full-duplex communication Other similar protocols are
Synchronous Data Link Control (SDLC) by IBM Advanced Data Communication Control Procedure (ADCCP) by ANSI Link Access Procedure, Balanced (LAP-B) by CCITT, as part of its X.25 packet-switched network standard

Hdlc
Broadcast Networks: All stations share a single communication channel Point-to-Point Networks: Pairs of hosts (or routers) are directly connected

Broadcast Network

Point-to-Point Network

Typically, local area networks (LANs) are broadcast and wide area networks (WANs) are point-to-point

HDLC Overview
Broadly HDLC features are as follows:
Reliable protocol
selective repeat or go-back-N

Full-duplex communication
receive and transmit at the same time

Bit-oriented protocol
use bits to stuff flags occurring in data

Flow control
adjust window size based on receiver capability

Uses physical layer clocking and synchronization to send and receive frames

HDLC Overview
Defines three types of stations
Primary Secondary Combined

Defines three types of data transfer mode


Normal Response mode Asynchronous Response mode Asynchronous Balanced mode

Three types of frames


Unnumbered information Supervisory

HDLC-Types of stations
The three stations are :
Primary station
Has the responsibility of controlling the operation of data flow the link. Handles error recovery Frames issued by the primary station are called commands.

Secondary station,

Operates under the control of the primary station.


Responds to command issued by control stations (one at a time) Can send data but does NOT issue commands

Combined station,

Frames issued by a secondary station are called responses. The primary station maintains a separate logical link with each secondary station. Acts as both as primary and secondary station. Does not rely on other for sending data

Balanced and Unbalanced Configurations

HDLC- types of data transfer mode


Normal Response Mode (NRM) Secondary station can send ONLY when the primary station instruct it to do so in response to a polling
Unbalanced configuration, good for multi-point links Asynchronous Response Mode (ARM) More independent secondary station Can send data or control information without explicit permission to do so (note that it is still can not send commands) Transmission proceeds when channel is detected idle , used mostly in point-to-point-links

Asynchronous balanced Mode (ABM) Used in configuring connections Either stations can send data, control information and commands

HDLC
Unbalanced Mode

Commands
Primary Responses Secondary Secondary

Balanced mode

Combined commands/Responses

Combined

FRAME FORMAT-3 frames

1)Flag
Flag field Marks the beginning and end of frames (01111110) If the flag value exists in other fields, bit stuffingis used (if the sending station detects five consecutive 1s in other field, it stuffs (inserts) an extra 0 after the fifth 1. Whenever a 0 follows five consecutive 1 s, the receiver assumes the 0 was stuffed and remove it). Note that the flag field itself is not subject to bit stuffing and it is the only place where the flag pattern can appear

Bit stuffing

2)Address and FCS


Address field When a primary station is sending a frame, the address field contains the receiver identity If a secondary station is sending the frame, the address field contains the sender identity In some cases, it contains a group or broadcast address Frame Check Sequence (FCS) Contains CRC check

3)Control field for different frames


Used to send status information or issue commands

HDLC
There are three different classes of frames used in HDLC
Unnumbered frames, used in link setup and disconnection, and hence do not contain ACK. Information frames, which carry actual information. Such frames can piggyback ACK in case of ABM Supervisory frames, which are used for error and flow control purposes and hence contain send and receive sequence numbers

a)Information frames
Information frames Used to send data using either the go-back-n or selective repeat protocols N(R): piggyback acknowledgment indicating that all frames up to N(R)-1 has been received N(S): the number of the frame being sent P/F (poll/final) bit A primary station can request a response from a secondary station by sending a frame with P=1 (e.g., do you, secondary station, have data to send?) When a secondary station sends its last frame it sets F=1 in this frame

b) Supervisory frame
There are four different supervisory frames
SS=10, Receiver Not Ready (RNR), and N(R) has the same meaning as above SS=00, Receiver Ready (RR), and N(R) ACKs all frames received up to and including the one with sequence number N(R) - 1 SS=01, Reject; all frames with sequence number N(R) or higher are rejected, which in turns ACKs frames with sequence number N(R) -1 or lower. SS=11, Selective Reject; the receive rejects the frame with sequence number N(R)

c)Unnumbered Frame
Establish how the protocol will proceed. For example, Decide on which communication mode will be used (NRM, ARM, or ABM) Initialize the DLC function Manage disconnection requests Allow devices to exchange identities Run a test link

NR NS A Frame type

Sample Two-Way Data Exchange


B

I,0,1

I,1,3

NR Sequence numbers: next message expected

Frame type Message NR


25

Go-Back-N ARQ
A B

S,REJ,1

26

Selective Reject ARQ


A B

S,SREJ,1

27

Timeout
A B

S,RR,2

28

Review of Link Layer


Services
Framing Error control Reliability Connection management Medium access control Switching Ethernet Token Ring FDDI Wireless PPP HDLC

Protocols, Standards