0% found this document useful (0 votes)
24 views

Unit II - PPT Slides

Uploaded by

kandulavijay53
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)
24 views

Unit II - PPT Slides

Uploaded by

kandulavijay53
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/ 126

2-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.

a) Fixed-Size Framing
[ The size itself acts as delimiter or frame boundary ]
b) Variable-Size Framing
[ special character or bit pattern called flag is used as delimiter ]
A frame in a character-oriented protocol

A frame in a bit-oriented protocol


Byte stuffing and unstuffing

Note

Byte stuffing is the process of adding 1 extra byte whenever


there is a flag or escape character in the text.
Bit stuffing and unstuffing

Note

Bit stuffing is the process of adding one extra 0 whenever five


consecutive 1s follow a 0 in the data, so that the receiver does not
mistake the pattern 01111110 for a flag.
11-6 HDLC

High-level Data Link Control (HDLC) is a bit-oriented


protocol for communication over point-to-point and
multipoint links.

Topics discussed in this section:


a) Configurations and Transfer Modes
~ Normal Response Mode [NRM]
~ Asynchronous Balanced Mode [ABM]
b) Frames
c) Control Field
i) Normal Response Mode [ NRM ]
ii) Asynchronous Balanced Mode [ ABM ]
b) HDLC Frames

➢ I-frames are designed to carry user data from the network layer.
➢ Unnumbered frames are used to exchange session management and control
information between connected devices.
➢ Supervisory frames are used for flow and error control
c) Control Field Format ( for the different frame types )

Receive ready (RR)=00


Receive not ready (RNR)=10
Reject (REJ)=01
Selective reject (SREJ)=11
U-frame control command and response
2-2 FLOW AND ERROR CONTROL

The most important responsibilities of the data link


layer are flow control and error control. Collectively,
these functions are known as data link control.

Topics discussed in this section:


a) Flow Control
b) Error Control
Flow control refers to a set of procedures used to restrict the amount of data
that the sender can send before
waiting for acknowledgment.

Error control in the data link layer is based on automatic repeat request (ARQ),
which is the retransmission of data.
Error Detection and Correction
What does accuracy means?

What about corrupted message?

Which layer is responsible for error detection and


correction?

Does all application has the same sensitivity to errors?

Data can be corrupted during transmission.

Some applications require that errors be detected and corrected.


Data Link Layer Duties
Types of Errors
Whenever bits flow from one point to another, they are
subject to unpredictable changes because of
interference.

There are two types of errors:


➢ Single-Bit Error
The term single-bit error means that only 1 bit of a
given data unit (such as a byte, character, or packet) is
changed from 1 to 0 or from 0 to 1
➢ Burst Error
The term burst error means that 2 or more bits in the
data unit have changed from 1 to 0 or from 0 to 1
Single-bit and burst error

NOTE:
Burst error is more likely to occur
than a single-bit error
Redundancy
The central concept in detecting or correcting errors
is redundancy. To be able to detect or correct errors,
we need to send some extra bits with our data. These
redundant bits are added by the sender and removed
by the receiver. Their presence allows the receiver to
detect or correct corrupted bits.
Detection versus Correction

The correction of errors is more difficult than the


detection. WHY?

In error correction, we need to know the exact


number of bits that are corrupted and, more
importantly, their location in the message. However,
in error detection we need only to know is there an
error or not.
Coding
▪ Redundancy is achieved through various coding
schemes.

▪ The sender adds redundant bits through a process


that creates a relationship between the redundant
bits and the actual data bits.

▪ The receiver checks the relationships between the


two sets of bits to detect errors.

▪ The ratio of redundant bits to data bits and the


robustness of the process are important factors in
any coding scheme.
Coding
▪ We can divide coding schemes into two broad
categories:

▪ Block coding

▪ Convolution coding
BLOCK CODING

▪ In block coding, we divide our message into blocks,


each of k bits, called datawords.

▪ We add r redundant bits to each block to make the


length n = k + r. The resulting n-bit blocks are
called codewords.
Error Detection
How can errors be detected by using block coding?
If the following two conditions are met, the receiver
can detect a change in the original codeword.

1. The receiver has (or can find) a list of valid


codewords.

2. The original codeword has changed to an invalid


one.
Figure 10.6: Process of error detection in block coding

• Modulo 2 arithmetic
— Binary addition with no carries
— Binary subtraction with no carries
— The same as XOR operation

1111 + 1010 = 0101

1111 − 0101 = 1010

1010 + 1010 = 0000


Example 10.2

Let us assume that k = 2 and n = 3. Table 10.1 shows the


list of datawords and codewords. Later, we will see how
to derive a codeword from a dataword.
Table 10.1: A code for error detection

10.24
Example
Let us find the Hamming distance between two pairs of
words.

10.25
Example 10.3
Table 10.1: A code for error detection in Example 10.1

The minimum Hamming distance for our first code scheme


(Table 10.1) is 2. This code guarantees detection of only a
single error. For example, if the third codeword (101) is sent
and one error occurs, the received codeword does not match
any valid codeword. If two errors occur, however, the
received codeword may match a valid codeword and the
errors are not detected.
10.26
Table 10.2: Simple parity-check code C(5, 4)
Error Detection Methods
1. Parity Check

▪ The most common and least expensive.


▪ Simple or Two Dimensional.
How does it work?
A k-bit dataword is changed to an n-bit codeword where n = k +
1. The extra bit,called the parity bit, is selected to make the
total number of 1s in the codeword even.
Example:
Assume the sender sends the dataword 1011. Since the number of 1's is odd
then the parity bit is equal to 1 and the codeword for this dataword is
10111.
Four types of redundancy checks are used
in data communications
Vertical Redundancy Check
VRC
Figure 10.4: Encoder and decoder for simple parity-check code

10.32
Performance
It can detect single bit error
It can detect burst errors only if the total number of errors
is odd.

An observation of the
table reveals that to
move from one code
word to another, at least
two data bits should be
changed. Hence these
set of code words are
said to have a minimum
distance ( hamming
distance ) of 2
Error Detection Methods
• Longitudinal Redundancy Check (LRC)
– Organize data into a table and create a parity
for each column
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
10101010

11100111 11011101 00111001 10101001 10101010


Original Data LRC
Performance
➢ LRC increases the likelihood of detecting burst
errors.
➢ If two bits in one data units are damaged and two
bits in exactly the same positions in another data unit
are also damaged, the LRC checker will not detect an
error.
VRC and LRC
Parity Check

NOTE:

Simple parity check can detect all single-bit errors. It


can detect burst errors only if the total number of
errors in each data unit is odd.

A better approach is the two-dimensional parity check


which organizes the data units into table (rows and
columns). The parity bit for each column is Calculated
and added to the table as a new row (column parity)
Two-dimensional parity

➢ Calculate the parity bit for each data unit, then organize
them into table (rows and columns)
➢ Calculate the parity bit for each column and create a new
row (column parity)
➢ A redundant row of bits is added to the whole block.
Two-dimensional Performance
Two-dimensional Performance
➢ Increases the likelihood of detecting burst errors.
➢ A redundancy of n-bits can detect a burst error of n bits.
➢ A burst error of more than n bits is also detected with a
very high probability.
➢ One pattern of errors still elusive:
If 2 bits in one data unit are damaged and two
bits in exactly the same position in another data unit are
also damaged. The error will not be detected.
Cyclic Redundancy Check
• Given a k-bit frame or message, the
transmitter generates an n-bit sequence,
known as a frame check sequence (FCS) ,
so that the resulting frame, consisting of
(k+n) bits, is exactly divisible by some
predetermined number.
• The receiver then divides the incoming
frame by the same number and, if there is
no remainder, assumes that there was no
error.
Cyclic Redundancy Check
• Powerful error detection scheme
• Rather than addition, binary division is
used
• Can be easily implemented with small
amount of hardware
– Shift registers
– XOR (for addition and subtraction)

Winter 2005 ECE 766 -


10 107
Computer Interfacing and Protocols
ECE
Cyclic Redundancy Check
• Let us assume k message bits and
n bits of redundancy
xxxxxxxxxx yyyy Block of length k+n

k bits n bits
• Associate bits with coefficients of a
polynomial
1 0 1 1 0 1 1
1x 6 +0x 5 +1x 4 +1x 3 +0x 2 +1x1+1
= x 6 +x 4 +x 3 +x+1
Cyclic Redundancy Check
• Let M(x) be the message polynomial
• Let P(x) be the generator polynomial
– P(x) is fixed for a given CRC scheme
– P(x) is known both by sender and receiver
• Create a block polynomial F(x) based on
M(x) and P(x) such that F(x) is divisible by
P(x)
Cyclic Redundancy Check
• Sending
1. Multiply M(x) by x n
2. Divide x n M(x) by P(x)
3. Ignore the quotient and keep the reminder C(x)
4. Form and send F(x) = x n M(x)+C(x)

• Receiving
1. Receive F’(x)
2. Divide F’(x) by P(x)
3. Accept if remainder is 0, reject otherwise

Winter 2005 ECE 766 -


10 110
Computer Interfacing and Protocols
ECE
Example
• Send
– M(x) = 110011 → x 5 +x 4 +x+1 (6 bits)
– P(x) = 11001 → x 4 +x 3 +1 (5 bits, n = 4) • Receive
→ 4 bits of redundancy
– Form x n M(x) → 110011 0000 11001 1100111001
→ x 9 +x 8 +x 5 +x 4 11001
11001
– Divide x n M(x) by P(x) to find C(x)
11001
100001 00000
11001 1100110000
11001
No remainder
10000 → Accept
11001
1001 = C(x)
Send the block 110011 1001
Figure 10.5: CRC encoder and decoder

10.50
Figure 10.15 Division in CRC encoder

10.
Figure 10.16 Division in the CRC decoder for two cases

10.
Figure 10.9: CRC division using polynomials

10.53
Advantages of Cyclic Codes
➢ We have seen that cyclic codes have a very good
performance in detecting single-bit errors, double
errors, an odd number of errors, and burst
errors.

➢ They can easily be implemented in hardware and


software.

➢ They are especially fast when implemented in


hardware. This has made cyclic codes a good
candidate for many networks.
10.54
CHECKSUM

The last error detection method we discuss here is


called the checksum. The checksum is used in the
Internet by several protocols although not at the data
link layer. However, we briefly discuss it here to
complete our discussion on error checking

Topics discussed in this section:


Idea
One’s Complement
Internet Checksum

10.
CHECKSUM
Example 10.18

Suppose our data is a list of five 4-bit numbers that we


want to send to a destination. In addition to sending these
numbers, we send the sum of the numbers. For example, if
the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0,
6, 36 ), where 36 is the sum of the original numbers. The
receiver adds the five numbers and compares the result
with the sum. If the two are the same, the receiver assumes
no error, accepts the five numbers, and discards the sum.
Otherwise, there is an error somewhere and the data are
not accepted.

10.
Example

We can make the job of the receiver easier if we send the


negative (complement) of the sum, called the checksum .
In this case, we send (7, 11, 12, 0, 6, − 36 ). The receiver
can add all the numbers received (including the
checksum). If the result is 0, it assumes no error;
otherwise, there is an error.

10.
Example

➢ The sender initializes the checksum to 0 and adds


all data items and the checksum (the
checksum is considered as one data item and is
shown in color). The result is 36.

➢ However, 36 cannot be expressed in 4 bits. The extra


two bits are wrapped and added with the sum to
create the wrapped sum value 6.

➢ The sum is then complemented, resulting in the


checksum value 9 (15 − 6 = 9). The sender now
sends six data items to the receiver including the
checksum 9. 1001

10.
(continued)
➢ The receiver follows the same procedure as the sender. It adds all data items
(including the checksum); the result is 45.
➢ The sum is wrapped and becomes 15. The wrapped sum is complemented and
becomes 0. Since the value of the checksum is 0, this means that the
data is not corrupted.
➢ The receiver drops the checksum and keeps the other data items. If the
checksum is not zero, the entire packet is dropped.

1111
1001 0000
10.
Table 10.5: Procedure to calculate the traditional checksum

10.61
Checksum Performance
➢ Checksum can detect errors in a message of
any size.

➢ Almost detects all errors involving odd


numbers of bits or even.

It is not as strong as CRC. WHY?

➢ Because if the value of one word is


incremented and the value of another word is
decremented by the same amount, the two
errors are not detected.
Figure 10.17: Algorithm to calculate a traditional checksum

10.63
Hamming Code
➢ Developed by R.W.Hamming
➢ It applied to data units of any length uses the data & redundancy bits.
➢ positions of redundancy bits in Hamming code

❖ All bit positions that are powers of two (have only one 1 bit in the
binary form of their position) are parity bits.
• 7 bit data require 4 bit redundancy placed in 1,2,4,8
❖ Parity bit 1 covers all bit positions which have the least significant bit set: bit
1 (the parity bit itself), 3, 5, 7, 9, etc.

❖ Parity bit 2 covers all bit positions which have the second least significant bit
set: bit 2 (the parity bit itself), 3, 6, 7, 10, 11, etc.

❖ Parity bit 4 covers all bit positions which have the third least significant bit
set: bits 4–7, 12–15, 20–23, etc.

❖ Parity bit 8 covers all bit positions which have the fourth least significant bit
set: bits 8–15, 24–31, 40–47, etc.
Example: 8-bit data word 1001101
Include 4 parity bits and the 7-bit word  11 bits
Bit position: 11 10 9 8 7 6 5 4 3 2 1
1 0 0 P 8 1 1 0 P 4 1 P2 P 1
Calculate the parity bits: even parity ⎯ assumption
P1 = XOR of bits (3, 5, 7, 9, 11) = 1  0  1  0  1 = 1
P2 = XOR of bits (3, 6, 7, 10, 11) = 1  1  1  0  1 = 0
P4 = XOR of bits (5, 6, 7) = 0  1  1 = 0
P8 = XOR of bits (9, 10, 11) = 0  0  1 = 1
Error Detection and Correction
• each r bit is the VRC bit for one combination of data bits
r1 = bits 1, 3, 5, 7, 9, 11
r2 = bits 2, 3, 6, 7, 10, 11
r4 = bits 4, 5, 6, 7
r8 = bits 8, 9, 10, 11
Error detection using Hamming Code
r1 = bits 1, 3, 5, 7, 9, 11
r2 = bits 2, 3, 6, 7, 10, 11
r4 = bits 4, 5, 6, 7
r8 = bits 8, 9, 10, 11

➢ Hamming code Can detect and correct only a single error


➢ Multiple errors may not be detected
2-3 PROTOCOLS

➢ The protocols are normally implemented in software by using one of


the common programming languages.
➢To make our discussions language-free, we have written in pseudo
code a version of each protocol that concentrates mostly on the
procedure instead of delving into the details of language rules.
2-3 a) NOISELESS CHANNELS

➢ Let us first assume we have an ideal channel in


which no frames are lost, duplicated, or corrupted.
➢ In other words, the channel is error free and as a
result we don’t require any error control mechanism
in the corresponding protocols.
➢ We introduce two protocols for this type of channel.
Topics discussed in this section:
a) Simplest Protocol
b) Stop-and-Wait Protocol
1. Simplest Protocol

➢ We assume that the receiver can immediately handle any frame it


receives with a processing time that is small enough to be negligible.
➢ In other words, the receiver can never be overwhelmed with
incoming frames.
➢ Hence there is no need for flow control in this scheme.
What is the difference between a
packet and a frame?
a) Design
Reciever Site Sender Site b) Algorithms
c) Flow Diagram [ for Simplest Protocol ]
2. Stop-and-Wait Protocol

➢ If the data frames arrives at the receiver site faster than they can processed,
the frames must be stored until their use.
➢ Normally, the receiver does not have enough storage space, especially if it
is receiving data from many sources.
➢ Hence to prevent the receiver from becoming overwhelmed with incoming
frames, we somehow need to tell the sender to slow down. As such there
must be feedback from the receiver to the sender. In other words we need
to employ a flow control mechanism in the protocol.
➢ Acknowledgement (ACK) frames that are auxiliary frames help in this
regard.

➢ The protocol is called Stop-and-Wait protocol because the sender sends


one frame, stops until it receives confirmation from the receiver (okay to
go ahead ) and then sends the next frame.
a) Design

Note :The regions highlighted with red shade indicate additions to the previous protocol.
b) Algorithms
Sender Site
Receiver Site
c) Flow Diagram [ for Stop & Wait Protocol ]
2-3 b) NOISY CHANNELS

Although the Stop-and-Wait Protocol gives us an idea


of how to add flow control to its predecessor, noiseless
channels are nonexistent. We discuss three protocols in
this section that use error control.

Topics discussed in this section:


a) Stop-and-Wait Automatic Repeat Request
b) Go-Back-N Automatic Repeat Request
c) Selective Repeat Automatic Repeat Request
3. Stop-and-Wait ARQ Protocol

➢ Error correction in Stop-and-Wait ARQ is done by keeping a


copy of the sent frame and retransmitting of the frame when
the timer expires.
➢ In Stop-and-Wait ARQ, we use sequence numbers to
number the frames. The sequence numbers are based on
modulo-2 arithmetic.

➢ In Stop-and-Wait ARQ, the acknowledgment number always


announces in modulo-2 arithmetic the sequence number of
the next frame expected.
a) Design
b) Algorithm
Sender Site

(continued) . . . . .
(continued) . . . . . .
Receiver Site
c) Flow Diagram

Data Frame lost in the


middle of transmission.

Acknowledgement Frame lost


in the middle of transmission.
In networking, we use the term
bandwidth in two contexts.

▪ The first, bandwidth in hertz, refers to the


range of frequencies in a composite signal or
the range of frequencies that a channel can
pass.

▪ The second, bandwidth in bits per second,


refers to the speed of bit transmission in a
channel or link. Often referred to as Capacity.
Propagation & Transmission delay

◼ Propagation speed - speed at which


a bit travels though the medium from
source to destination.
◼ Transmission speed - The speed with
which data can be transmitted from one
device to another.

3.89
Propagation and Transmission Delay

◼ Propagation delay is the amount of time it takes for the head


of the signal to travel from the sender to the receiver. It can be
computed as the ratio between the link length and the
propagation speed over the specific medium.

Propagation Delay = Distance/Propagation speed

◼ The transmission delay is the amount of time required for the router
to push out all the packet in a message

Transmission Delay = Message size/bandwidth bps

◼ Latency = Propagation delay + Transmission delay +


Queueing time + Processing time
Efficiency : 1st Numerical
1) Assume that, in a Stop-and-Wait ARQ system, the bandwidth of the
line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is
the bandwidth-delay product? If the system data frames are 1000 bits
in length, what is the utilization percentage of the link?

Solution
The bandwidth-delay product is

The system can send 20,000 bits during the time it takes for the data
to go from the sender to the receiver and then back again. However,
the system sends only 1000 bits. We can say that the link utilization is
only 1000/20,000, or 5 percent. For this reason, for a link with a
high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes
the capacity of the link.
Efficiency : 2nd Numerical

What is the utilization percentage of the link in previous


numerical example, if we have a protocol that can send
up to 15 frames before stopping and worrying about the
acknowledgments?
Solution
The bandwidth-delay product is still 20,000 bits. The
system can send up to 15 frames or 15,000 bits during a
round trip. This means the utilization is 15,000/20,000, or
75 percent. Of course, if there are damaged frames, the
utilization percentage is much less because frames have to
be resent.
Efficiency & Pipelining
➢ The Stop & Wait ARQ discussed in the previous section is very
inefficient if our channel is thick and long. By this it is meant that
the channel has a large bandwidth; by long, we mean the round-
trip delay is long.
➢ The product of these two is called the bandwidth-delay product.
The bandwidth-delay product is a measure of the number of bits
we can send out of our system while waiting for news from the
receiver.
➢ Pipelining is a technique in which a task is often begun before the
previous task has ended. This is known as pipelining.
➢ If we employ pipelining concept then several frames can be sent
before we receive news about the previous frames.
➢ Pipelining improves efficiency of the transmission if the number of
bits in transition is large with respect to the bandwidth-delay
product.
4. Go-Back-N ARQ Protocol

➢ To improve efficiency of transmission, we should have a


protocol in which multiple frames must be in transition while
waiting for acknowledgement.
➢ In other words, we need to let more than one frame be
outstanding to keep the channel busy while the sender is
waiting for acknowledgement.
➢ Go-Back-N is one such protocol. In this protocol we
can send several frames before receiving
acknowledgements; we keep a copy of these frames until
the acknowledgements arrive.
i) Sequence Numbers

In the Go-Back-N Protocol, the sequence numbers are modulo 2m, where m is
the size of the sequence number field in bits.

For example,
~ if m=2 then the sequence numbers will range from 0 to 3.
( 0, 1, 2, 3 )
~ If m=4 then the sequence numbers will range from 0 to 15.
( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 )
ii) Windows :
a) Send Window :
The send window is an abstract concept defining an imaginary box of size 2m
− 1 with three variables: Sf, Sn, and Ssize.

The send window can slide one


or more slots when a valid acknowledgment arrives.
b) Receive Window :
The receive window is an abstract concept defining an
imaginary box of size 1 with one single variable Rn. The window
slides when a correct frame has arrived; sliding occurs one slot
at a time.
a) Design

Multiple Frames
Window size for Go-Back-N ARQ

Will work
correctly Will work
Note erroneously

In Go-Back-N ARQ, the size of the send window must be less than 2m; the
size of the receiver window is always 1.
b) Algorithm
Sender Site

(continued . . . . . . . . )
(continued . . . . . . . . . )
Receiver Site

No significant changes here compared to previous protocol


c) Flow Diagram [ for Example 1 ]

Acknowledgement
Frame-2 lost.

Note : ACK3 acts as cumulative acknowledgement for both Frames 1 & 2.


Flow Diagram [ for Example 2 ]

Data Frame lost in the


middle of transmission.

Retransmission of
Frames 1, 2 and 3.
Note
Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of
the send window is 1.
5. Selective Repeat ARQ Protocol
➢ Go-Back-N ARQ simplifies the process at the receiver site.
The receiver keeps track of only one variable, and there is no
need to buffer out-of-order frames; they are simply discarded.
➢ However, this protocol is very inefficient for a noisy link. In a
noisy link a frame has higher probability of damage, which
means the resending of multiple frames. This resending uses
up the bandwidth and slows down the transmission.
➢ For noisy links, there is another mechanism that does not
resend N frames when just one frame is damaged; only the
damaged frame is resent. This mechanism is called Selective
Repeat ARQ. It is more efficient for noisy links, but
processing at the receiver is more complex.
Windows
a) Send window for Selective Repeat ARQ

b) Receive window for Selective Repeat ARQ


a) Design
Selective Repeat ARQ, window size

Will work
correctly Will work
erroneously

Note : In Selective Repeat ARQ, the size of the sender and receiver
window must be at most one-half of 2m.
b) Algorithms
Sender Site

(continued . . . . . . . . . )
(continued . . . . . . . . . )
Receiver Site

(continued . . . . . . . . . )
(continued . . . . . . . . . )
Delivery of data in Selective Repeat ARQ
c) Flow diagram

Data Frame lost in the


middle of transmission.

Frame 2 is received and


NAK is sent for Frame 1

Note : ACK4 acts as cumulative acknowledgement for Frames 1, 2 and 3.


Bidirectional Transmission
◼ The previous protocol is unidirectional (data is transmitted
in one direction)
◼ For bidirectional both nodes can send data
◼ To save bandwidth data frame to be sent and control
information (ACK) of the received frame are combined
into one frame (Piggybacking)
◼ If a node receive a frame and does not have data to be sent
then an ACK frame is sent alone

⚫McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004


Piggybacking

A is ready to receive
frame 0

⚫McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004


Design of piggybacking in Go-Back-N ARQ
Numerical 1 on connection & disconnection in HDLC

Figure in the next slide shows how 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 (not shown in the figure). After data transfer, node A
sends a DISC (disconnect) frame to release the connection;
it is confirmed by node B responding with a UA
(unnumbered acknowledgment).
Example of connection and disconnection
Numerical 2 on piggybacking without error in HDLC

Figure in the next slide shows an exchange using piggybacking. Node A


begins the exchange of information with an I-frame numbered 0
followed by another I-frame numbered 1. Node B piggybacks its
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. 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 accepted and that A is
now expecting frame number 3.
Example of piggybacking without error
Numerical 3 on piggybacking with error in HDLC

Figure in the next slide 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.
Example of piggybacking with error

You might also like