0% found this document useful (0 votes)
53 views22 pages

Communication Networks Lecture 10 - HDLC (Read-Only)

U-frame with XID Node B accepts with U-frame with XID Node A disconnects with U-frame with DISC Node B acknowledges with U-frame with UA Dr. G. Balamurugan 16 Department of Electronics Engineering, MIT Campus Example 2: Error recovery Node A sends data I-frame 1 Node B detects error and sends S-frame with REJ and N(R)=1 Node A retransmits I-frame 1 Node B acknowledges with S-frame RR and N(R)=2 Node A continues with new data I

Uploaded by

AGILAN I
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)
53 views22 pages

Communication Networks Lecture 10 - HDLC (Read-Only)

U-frame with XID Node B accepts with U-frame with XID Node A disconnects with U-frame with DISC Node B acknowledges with U-frame with UA Dr. G. Balamurugan 16 Department of Electronics Engineering, MIT Campus Example 2: Error recovery Node A sends data I-frame 1 Node B detects error and sends S-frame with REJ and N(R)=1 Node A retransmits I-frame 1 Node B acknowledges with S-frame RR and N(R)=2 Node A continues with new data I

Uploaded by

AGILAN I
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/ 22

Lecture : 10

Communication Networks

Dr. G. Balamurugan
Assistant Professor
Department of Electronics Engineering
MIT Campus, Anna University.

Dr. G. Balamurugan
1
Department of Electronics Engineering, MIT Campus
UNIT II DATA LINK LAYER AND NETWORK
INTERCONNECTION
Logical link control Functions:- Framing, Flow control , Error
control: CRC, LLC protocols:- HDLC, P to P. Medium access
layer:- Random access, Controlled access, Channelization,
IEEE standards:- 802.3, 802.4 and 802.5. Internetworking,
Interconnection issues, Interconnection devices:- Repeaters,
Hubs, Routers/switches and Gateways.

Dr. G. Balamurugan
2
Department of Electronics Engineering, MIT Campus
Logical Link Control protocols

HDLC - High Level Data Link Control Protocol


PPP – Point to Point Protocol

Dr. G. Balamurugan
3
Department of Electronics Engineering, MIT Campus
High-Level Data Link Control
• HDLC is a Layer 2 protocol
• HDLC is a simple protocol used to connect point to point serial
devices.
– For example, you have point to point leased line connecting two
locations, in two different cities. HDLC would be the protocol with the
least amount of configuration required to connect these two locations.
– show running-config on a Cisco router

• Characteristics of HDLC
– It supports full-duplex.
– Bit-oriented Protocol.
– Used primarily in both point-to-point and multipoint (multidrop) data
links.

Dr. G. Balamurugan
4
Department of Electronics Engineering, MIT Campus
Configurations and Transfer Modes
HDLC provides two common transfer modes that can be used in different
configurations
• Normal Response Mode (NRM)
Configuration is unbalanced.
Link is both point to point & multi point.

• Asynchronous Balanced Mode (ABM)


Configuration is balanced.
Link is point to point.
Each station function as a primary and a secondary.

Dr. G. Balamurugan
5
Department of Electronics Engineering, MIT Campus
HDLC Frame Structures

• Flag: 01111110, identifies both the beginning and the end of a frame
• Address: used to identify one of the terminals.
• Control: sequence number , ACK and other purposes.
• Information: contain arbitrary information.
• Frame check sequence: 16- or 32-bit CRC

Dr. G. Balamurugan
6
Department of Electronics Engineering, MIT Campus
HDLC Frame Structures
• HDLC defines three types of frame - Each type of frame serves as an
envelope for the transmission of a different type of message.

– Information [ I Frame ] – used to transport user data and control


information relating to user data (piggybacking).

– Supervisory [ S Frame ] –Used to transport control information


which are used for error and flow control purposes and hence contain
send and receive sequence numbers

– Unnumbered [ U Frame ] – Reserved for system management used in


link setup and disconnection, and hence do not contain ACK

Dr. G. Balamurugan
7
Department of Electronics Engineering, MIT Campus
1. Flag Fields and Bit Stuffing
• The flag field of an HDLC frame is an 8-bit sequence with the bit pattern
01111110 that identifies both the beginning and the end of a frame and
serves as a synchronization pattern for the receiver.

• Bit stuffing used to avoid confusion with data containing flag sequence
01111110
• Transmitter inserts extra 0 after each consecutive five 1s inside the frame
• Receiver checks for five consecutive 1s
– if next bit = 0, it is removed
– if next two bits are 10, then flag is detected
– If next two bits are 11, then frame has errors

Dr. G. Balamurugan
8
Department of Electronics Engineering, MIT Campus
Bit stuffing and removal
Problem: The flag bit pattern could appear in the data portion of the frame.

The problem is solved by bit stuffing (inserting).


Bit stuffing : A zero bit is inserted after 5-consecutive one-bits.

Dr. G. Balamurugan
9
Department of Electronics Engineering, MIT Campus
2. Address Field
If a primary station created the frame, it contains a to address.
If secondary creates the frame, it contains a from address.

An address field can be 1 byte or several bytes long, depending on the needs of
the network.

One byte can identify up to 128 stations (l bit is used for another purpose).

Larger networks require multiple-byte address fields.

If the address field is only 1 byte, the last bit is always a 1.


If the address is more than 1 byte, all bytes but the last one will end with 1.

All ones address 11111111 is broadcast

Dr. G. Balamurugan
10
Department of Electronics Engineering, MIT Campus
3. Control Field Frames
The control field determines the type of frame and defines its functionality.
First 1 or 2 bits of control field identify frame type

The single bit between N(S) and N(R) is called the P/F bit.
P/F - Single bit used for dual purpose.

Poll : when the frame is sent by a primary station to a secondary.


( Inviting the terminal )
When the address field contains the address of the receiver

Final : when the frame is sent by a secondary to a primary


when the address field contains the address of the sender
Dr. G. Balamurugan
11
Department of Electronics Engineering, MIT Campus
3. Control Field [ I –Frame ]

Designed to carry user data from the network layer.


Flow and error control information (piggybacking).
Subfields used to define flow and error control
information .

First Bit: defines the type  ‘0’ I-Frame

The next 3 bits, called N(S), define the sequence


number of the frame
Sequence number between 0 and 7. But it
extendable up to 2 bytes.

The last 3 bits, called N(R), correspond to the


acknowledgment number
when piggybacking is used.
Dr. G. Balamurugan
12
Department of Electronics Engineering, MIT Campus
Piggybacking
More efficient two way communication can be achieved by sending data back with
each acknowledgment. This is called piggybacking.
• Data are transferred both ways
• ACK are "piggybacked" with data
frames

• A method to combine a data frame


with ACK.

• Instead of sending separately,


station A sends a data frame that
includes an ACK.

• Station B does the same thing.

• Piggybacking saves bandwidth. Dr. G. Balamurugan 13


Department of Electronics Engineering, MIT Campus
3. Control Field [ S –Frame ]

Supervisory frames are used for flow and error control whenever piggybacking is either
impossible or inappropriate.

First 2 bits of the control field is 10, this means the frame is an S-frame
The last 3 bits, called N(R), corresponds to the ACK or NAK.
The 2 bits called code is used to define the type of S-frame
Sub- Types Meaning
field
00 Receive ready (RR) acknowledges the receipt of a safe frame

10 Receive not ready (RNR) ACK the Rx frame, & it announces that Rx is busy and cannot Rx more
frames.
01 Reject (REJ) NAK indicating N(R) frame not received correctly. Transmitter must resend
N(R) and later frames
11 Selective reject (SREJ) Negative ACK for N(R) requesting that N(R) be selectively retransmitted
Dr. G. Balamurugan
14
Department of Electronics Engineering, MIT Campus
3. Control Field [ U –Frame ]

RSET: indicates sending station is resetting sequence numbers


XID: exchange station id and characteristics
Dr. G. Balamurugan
15
Department of Electronics Engineering, MIT Campus
Example1: Connection & disconnection
U-frames can be used for
connection establishment and
connection release.

Node A asks for a connection


with a set asynchronous
balanced mode (SABM)
frame; node B gives a positive
response with an unnumbered
acknowledgment (UA) frame.

After these two exchanges,


data can be transferred
between the two nodes.

After data transfer, node A


sends a DISC (disconnect)
frame to release the
connection; it is confirmed by
node B responding with a UA
Dr. G. Balamurugan
(unnumbered ACK). Department of Electronics Engineering, MIT Campus
16
Example 2: Polling

Sub- Types
field
00 Receive ready (RR)

10 Receive not ready (RNR)

01 Reject (REJ)

11 Selective reject (SREJ)

All the frames sent by the terminal, except the final one,
have P/F bit set to 1. Dr. G. Balamurugan
17
Department of Electronics Engineering, MIT Campus
Example 3: Selecting

Dr. G. Balamurugan
18
Department of Electronics Engineering, MIT Campus
Example 4: Peer to Peer
(Piggybacking without error)

Dr. G. Balamurugan
19
Department of Electronics Engineering, MIT Campus
Example 5: Peer to Peer
(Piggybacking without error)

Frame 1 sent from station B to


station A has an error.

Station A informs station B to


resend frames 1 and 2 (the system is
using the Go-Back-N mechanism).

Station A sends a reject supervisory


frame to announce the error in
frame 1.

Dr. G. Balamurugan
20
Department of Electronics Engineering, MIT Campus
Summary

Note:

Bit stuffing is the process of adding one extra 0 whenever


there are five consecutive 1s in the data so that the receiver
does not mistake the data for a flag.

Dr. G. Balamurugan
21
Department of Electronics Engineering, MIT Campus
Dr. G. Balamurugan
22
Department of Electronics Engineering, MIT Campus

You might also like