0% found this document useful (0 votes)
14 views15 pages

Lecture 7 - 8

Chapter 4 discusses the link layer's role in ensuring reliable communication between adjacent nodes through functions such as framing, error detection, and flow control. It introduces HDLC as a key protocol at this layer, detailing its configurations, frame formats, and operations. Additionally, it briefly mentions other link layer protocols like LAPB, LLC, and Frame Relay.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views15 pages

Lecture 7 - 8

Chapter 4 discusses the link layer's role in ensuring reliable communication between adjacent nodes through functions such as framing, error detection, and flow control. It introduces HDLC as a key protocol at this layer, detailing its configurations, frame formats, and operations. Additionally, it briefly mentions other link layer protocols like LAPB, LLC, and Frame Relay.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Chap.

4: Link Layer

Corresponds partly to Chapter 7 in the textbook by


Stallings and Section 9.2 in the textbook by Shay.

1. Introduction

Node A ß 101010101010101100 Node B


1111000001111110000111 à

Data is sent in blocks

At the link layer these blocks are called frames

The role of the link layer is to achieve a reliable


communication between two adjacent nodes.

The data link layer performs a number of functions:

• Framing
• Error detection
• Error control
• Flow control
• Link Management
• Addressing

1
2. Link Layer Functions

Framing

Link layer handles a frame at a time.

It breaks the bit stream into discrete frames and computes


the CRC for each frame.

Commonly used methods to form/delimit frames:

1. Character count
2. Starting and ending characters.
3. Starting and ending flags, with bit stuffing. Each
frame begins and ends with a special bit pattern,
namely 0 111111 0.

Frames are delimited by 0 111111 0.

Data to send:
00101010110111100000111011001010

After Framing:

011111100010101011011110000011101100101001111110

2
However, this bit pattern may appear inside the frames (in
the data).

What will happen if this happens?

We need to avoid breaking frames into pieces …

How?

Bit Stuffing

• Whenever the sender data link layer encounters 5


consecutive ones in the data, it automatically stuffs a ‘0’
bit into the outgoing bit stream.

• When the receiver sees five consecutive incoming 1 bits,


followed by a ‘0’ bit, it automatically destuffs the ‘0’ bit.

Data to send:
00101010110111111000111011001010

After bit stuffing:


001010101101111101000111011001010

Frame sent:
0111111000101010110111110100011101100101001111110

3
Examples:

4
Link Configuration

When there are only two stations à the link is called point-
to-point.

If there are more than two stations à it is called multipoint.

A multipoint line is usually used to provide a way for multiple


terminals to share a single communication line to a server.
Typically the case with dummy terminals (like VT100)
connected to a server.

A station can be Primary, Secondary or Balanced… (We will


see the concrete example of HDLC)

Error Detection

As seen in Chapter 3.

Flow Control

As seen in Chapter 3.

Error Control

As seen in Chapter 3.

5
3. HDLC (High-level Data Link Control )
HDLC is developed by ISO as the protocol of Layer 2.

3.1 Link Configurations

Command

Primary
Response

Secondary Secondary

(a) Unbalanced configuration

Commands

Combined Combined
Responses

(b) Balanced configuration

6
3.2 Characteristics of HDLC

The standard defines:

Three types of stations


o Primary station
o Secondary station
o Combined Station

Two link configurations


o Unbalanced
o Balanced

Three data transfer modes of operation

1. Normal Response Mode (NRM) (multidrop and point


– to point). This is an unbalanced configuration.

2. Asynchronous Balance Mode (ABM) (Point- to point


link). This is a balanced configuration.

3. Asynchronous Response Mode (ARM). This is an


unbalanced configuration. But, in this mode, the
secondary may send a response without waiting for a
command. However, the primary still retains
responsibility for the line, including initialization, error
recovery, and logical disconnection.

7
3.3 Frame Format

Flag: Flag field delimits the frame at both ends with the
unique pattern 01111110.

Address: The address field is of importance in multipoint


lines where it is used to identify one of the
terminals.

Control: The control field is used for sequence numbers,


acknowledgments and other purposes. This is
really where the HDLC protocol is …

Data: The data field may contain arbitrary information (a


packet from the network layer …).

Frame Check Sequence (FCS): The FCS field is a minor


variation on the CRC seen in Chapter 3.
The variation is to allow lost flag bytes to be
detected.

There are three kinds of frames:


- Information
- Supervisory
- Unnumbered

8
The contents of the control field for these three kinds of
frames are shown below:

The protocol uses a sliding window with k = 3 and a Window


Size (N) of 7 as seen in Chapter 3.

In the extended mode, we have 16-bit control field.


Accordingly, all the fields are extended.

9
3.4 Operations

Information Frames

The basic operations involve exchange of I-frames.

Each I-frame contains its sequence number as well as a


piggybacked positive - acknowledgement.

The I-frame also contains a Poll/final (P/F) bit. A Poll bit for
commands and a Final bit (from secondary) for response.

This is the same bit, which has 2 different meanings.

P set to 1 indicates a command that solicits a response from


a peer. F set to 1 indicates a response to the soliciting
command.

Supervisory Frames

Used for Flow Control and Error Control.

The supervisory frames are defined by the " S" field.

RECEIVE READY (00): this frame is used to


acknowledge the last I-frame and what is expected
next. This frame is used when there is no reverse traffic
to use for Piggybacking.

REJECT (01): It is a negative acknowledgement frame


N - field indicates the first frame not received correctly.
Used with Go-Back - N.

RECEIVER NOT READY (10): RNR acknowledges last


I-frame and tells the sender to stop sending. To allow

10
the sender to send again, this RNR should be cleared
and this is done when the receiver sends RR after
RNR.

SELECTIVE REJECT (11): It calls for retransmission of


only the frame specified. Used in Selective – Repeat
ARQ. Some protocols do not allow for this, and this
frame is undefined.

Unnumbered Frames

Unnumbered frames are used for the link control functions:


• Mode - Setting commands & responses.
• Information transfer commands & responses
• Recovery commands and responses
• Miscellaneous commands and responses.

Mode - setting commands and responses


SNRM/SNRME/SARM/SARME/SABM/SABME/UA/DM/
DIS/SIM/RIM

Information transfer command and response


UI/ UP

Recovery Command & Response


It is used when the normal ARQ mechanism does not
apply. FRMR response is used to report an error in a
received frame. The reset (RSET) command is used to
clear the FRMR condition.

Miscellaneous Commands and responses


XID/ TEST

11
Examples of Operations

12
More seen in class …

13
3.5 HDLC Commands and Responses

Name Function Description

Information (I) C/R Exchange user data

Supervisory (S)
Receive Ready (RR) C/R Positive Acknowledgment;
ready to receive I-frame
Receiver Not Ready (RNR) C/R Positive Acknowledgment; not ready to
receive I-frame
Reject (REJ) C/R Negative Acknowledgment; Go-Back N
Selective Reject (SREJ) C/R Negative Acknowledgment;
Selective-Repeat

Unnumbered (U)
Set Normal Response/ C Set mode; extended = 2 octet control
Extended mode (SNRM/SNRME) field
Set Asynchronous Response/ C Set mode; extended = 2 octet control
Extended mode (SARM/SARME) field
Set Asynchronous Balanced/ C Set mode; extended = 2 octet control
Extended mode (SABM/SABME) field

Set Initialization Mode (SIM) C


Initialize link control functions in addressed
station
Disconnect (DISC) C Terminate logical link connection
Unnumbered Ack (UA) R Acknowledges acceptance of one of the
above set mode commands
Disconnected Mode (DM) R Secondary is logically disconnected
Request Disconnect (RD) R Request DISC command
Request Initialization Mode (RIM) R Initialization needed; request for SIM
command
Unnumbered Information (UI) C/R Used to exchange control information
Unnumbered Poll (UP) C Used to solicit control information
Reset (RSET) C Used for recovery; resets N(R), N(S)
Exchange Identification (XID) C/R Used to request/report identity and status
Test (TEST) C/R Exchange identical information fields for
testing
Frame Reject (FRMR) R Reports receipt of unacceptable frame

14
4. Other Link layer protocols
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

Logical Link Control (LLC)


• IEEE 802
• Different frame format
• Link control split between Medium Access Layer (MAC)
and LLC (on top of MAC)
• No primary and secondary - all stations are peers
• Two addresses needed: Sender and receiver
• Error detection at MAC layer: 32-bit CRC
• Destination and source access points (DSAP, SSAP)
(Will see more of this with LANs)

Frame Relay
• Streamlined capability over high-speed packet switched
networks
• Used in place of X.25
• Uses Link Access Procedure for Frame-Mode Bearer
Services (LAPF)
• Two protocols: Control - similar to HDLC and Core -
subset of control
• ABM
• 7-bit sequence numbers
• 16-bit CRC
• 2, 3 or 4 octet address field
o Data link connection identifier (DLCI)
o Identifies logical connection

15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy