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

Chapter 2_CN

Chapter 2 discusses the data link layer, its sub-layers (Logical Link Control and Media Access Control), and the various design issues such as framing, error control, and flow control. It explains the services provided to the network layer, including different types of connection services and error detection and correction techniques. The chapter also covers framing methods, flow control mechanisms, and error types, emphasizing the importance of reliable communication in data transmission.

Uploaded by

gorasiaharshil8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Chapter 2_CN

Chapter 2 discusses the data link layer, its sub-layers (Logical Link Control and Media Access Control), and the various design issues such as framing, error control, and flow control. It explains the services provided to the network layer, including different types of connection services and error detection and correction techniques. The chapter also covers framing methods, flow control mechanisms, and error types, emphasizing the importance of reliable communication in data transmission.

Uploaded by

gorasiaharshil8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 114

CHAPTER 2

PREPARED BY: HINA TANDEL


CONTENTS
 Design issues
 Services provided to network layer,
 Framing,
 Error control,
 Flow control;
 Error detection and correction - Error correcting codes,
 Error detecting codes;
 Elementary data link protocols - Simplex, stop and wait, Sliding
INTRODUCTION OF DATA LINK LAYER
INTRODUCTION OF DATA LINK LAYER

 Data-link layer is the second layer after physical layer. The data link layer is responsible for maintaining the data link
between two hosts or nodes.

 Before going through the design issues in data link layer. Some of its sub-layers and their functions are as following below.

 The data link layer is divided into two sub-layers :

 Logical Link Control Sub-layer (LLC) –


Provides the logic for the data link , Thus it controls the synchronization , flow control , and error checking functions of the
data link layer. Functions are –

 (i) Error Recovery.

 (ii) It performs the flow control operations.

 (iii) User addressing.

 Media Access Control Sub-layer (MAC) –


It is the second sub-layer of data-link layer. It controls the flow and multiplexing for transmission medium. Transmission of
data packets is controlled by this layer. This layer is responsible for sending the data over the network interface card.
DESIGN ISSUES

 Network layer services

 Framing

 Error control

 Flow control
DATA LINK LAYER
 Algorithms for achieving:

 Reliable, +

 Efficient,

communication of a whole units – frames (as opposed to bits – Physical Layer)


between two machines.

 Two machines are connected by a communication channel that acts conceptually like a

wire (e.g., telephone line, coaxial cable, or wireless channel).

 Essential property of a channel that makes it “wire-like” connection is that the bits are

delivered in exactly the same order in which they are sent.


DATA LINK LAYER

 For ideal channel (no distortion, unlimited bandwidth and no delay) the job of data

link layer would be trivial.

 However, limited bandwidth, distortions and delay makes this job very difficult.
DATA LINK LAYER DESIGN ISSUES

• Physical layer delivers bits of information to and from data link layer. The functions of

Data Link Layer are:

1. Providing a well-defined service interface to the network layer.

2. Dealing with transmission errors.

3. Regulating the flow of data so that slow receivers are not swamped by fast senders.

• Data Link layer

– Takes the packets from Network layer, and

– Encapsulates them into frames


DATA LINK LAYER

• Each frame has a

– frame header – a field for holding the packet, and

– frame trailer.

• Frame Management is what Data Link Layer does.

• See figure in the next slide:


PACKETS AND FRAMES

Fig: Relationship between packets and frames.


SERVICES PROVIDED TO NETWORK LAYER

 Principal Service Function of the data link layer is to transfer the data from the

network layer on the source machine to the network layer on the destination
machine.

 Process in the network layer that hands some bits to the data link layer for

transmission.

 Job of data link layer is to transmit the bits to the destination machine so they

can be handed over to the network layer there (see figure in the next slide).
NETWORK LAYER SERVICES

(a) Virtual communication. (b) Actual communication.


POSSIBLE SERVICES OFFERED

1. Unacknowledged connectionless service.

2. Acknowledged connectionless service.

3. Acknowledged connection-oriented service.


UNACKNOWLEDGED CONNECTIONLESS SERVICE

 It consists of having the source machine send independent frames to the

destination machine without having the destination machine acknowledge them.

 Example: Ethernet, Voice over IP, etc. in all the communication channel were real

time operation is more important that quality of transmission.


ACKNOWLEDGED CONNECTIONLESS SERVICE
 Each frame send by the Data Link layer is acknowledged and the sender knows if a specific

frame has been received or lost.

 Typically the protocol uses a specific time period that if has passed without getting

acknowledgment it will re-send the frame.

 This service is useful for commutation when an unreliable channel is being utilized (e.g.,

802.11 WiFi).

 Network layer does not know frame size of the packets and other restriction of the data link

layer. Hence it becomes necessary for data link layer to have some mechanism to optimize
the transmission.
ACKNOWLEDGED CONNECTION ORIENTED SERVICE

 Source and Destination establish a connection first.

 Each frame sent is numbered

 Data link layer guarantees that each frame sent is indeed received.

 It guarantees that each frame is received only once and that all frames are

received in the correct order.

 Examples:

 Satellite channel communication,

 Long-distance telephone communication, etc.


ACKNOWLEDGED CONNECTION ORIENTED SERVICE
(CONTINUE..)

 Three distinct phases:

1. Connection is established by having both side initialize variables and counters


needed to keep track of which frames have been received and which ones have
not.

2. One or more frames are transmitted.

3. Finally, the connection is released – freeing up the variables, buffers, and other
resources used to maintain the connection.
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.

 To provide service to the network layer the data link layer must use the service provided to it by physical

layer.

 Stream of data bits provided to data link layer is not guaranteed to be without errors.

 Errors could be:

 Number of received bits does not match number of transmitted bits (deletion or insertion)

 Bit Value

 It is up to data link layer to correct the errors if necessary.


FRAMING
 Transmission of the data link layer starts with breaking up the bit stream

 into discrete frames

 Computation of a checksum for each frame, and

 Include the checksum into the frame before it is transmitted.

 Receiver computes its checksum error for a receiving frame and if it is different from

the checksum that is being transmitted will have to deal with the error.

 Framing is more difficult than one could think!


FRAMING METHODS

1.Byte/Character count.

2.Flag bytes with byte stuffing.

3.Starting and ending Flags with bit stuffing.

4.Physical layer coding violations.


BYTE COUNT FRAMING METHOD

 It uses a field in the header to specify the number of bytes in the frame.

 Once the header information is being received it will be used to determine end of

the frame.

 See figure in the next slide:

 Trouble with this algorithm is that when the count is incorrectly received the

destination will get out of synch with transmission.

 Destination may be able to detect that the frame is in error but it does not have

a means (in this algorithm) how to correct it.


FRAMING (1)

A byte stream. (a) Without errors. (b) With one error.


FLAG BYTES WITH BYTE STAFFING FRAMING METHOD

 This methods gets around the boundary detection of the frame by having each

appended by the frame start and frame end special bytes.

 If they are the same (beginning and ending byte in the frame) they are called flag

byte.

 In the next slide figure this byte is shown as FLAG.

 If the actual data contains a byte that is identical to the FLAG byte (e.g., picture,

data stream, etc.) the convention that can be used is to have escape character
inserted just before the “FLAG” character.
FRAMING (2)

 A frame delimited by flag bytes.


 Four examples of byte sequences before and after byte stuffing.
FLAG BITS WITH BIT STUFFING FRAMING METHOD

 This methods achieves the same thing as Byte Stuffing method by using Bits (1)

instead of Bytes (8 Bits).

 It was developed for High-level Data Link Control (HDLC) protocol.

 Each frames begins and ends with a special bit patter:

 01111110 or 0x7E <- Flag Byte

 Whenever the sender’s data link layer encounters five consecutive 1s in the data

it automatically stuffs a 0 bit into the outgoing bit stream.

 USB uses bit stuffing.


FRAMING (3)

Bit stuffing. (a) The original data. (b) The data as they appear on
the line. (c) The data as they are stored in the receiver’s memory
after destuffing.
FRAMING

 Many data link protocols use a combination of presented methods for safety.

 For example in Ethernet and 802.11 each frame begin with a well-defined pattern

called a preamble.

 Preamble is typically 72 bits long.

 It is then followed by a length field.


FLOW CONTROL

 It is technique that generally observes proper flow of data from sender to receiver.

 Important Design issue for the cases when the sender is running on a fast powerful

computer and receiver is running on a slow low-end machine.

 Two approaches:

1. Feedback-based flow control

2. Rate-based flow control


FLOW CONTROL

Approaches to Flow Control :


Flow Control is classified into two categories –
FEEDBACK-BASED FLOW CONTROL

 In this control technique, sender simply transmits data or information or frame to receiver,

then receiver transmits data back to sender and also allows sender to transmit more
amount of data or tell sender about how receiver is processing or doing.

 This simply means that sender transmits data or frames after it has received
acknowledgments from user.

 Receiver sends back information to the sender giving it permission to send more data, or

 Telling sender how receiver is doing.


RATE-BASED FLOW CONTROL

 In this control technique, usually when sender sends or transfer data at faster

speed to receiver and receiver is not being able to receive data at the speed, then
mechanism known as built-in mechanism in protocol will just limit or restricts
overall rate at which data or information is being transferred or transmitted by
sender without any feedback or acknowledgment from receiver.
ERROR

 Data transmitted in the network.

 The data can be corrupted during transmission

 Transmission error.

 For reliable communication, errors must be detected and corrected

 Error detection and correction are implemented either at the data link layer or the

transport layer of the OSI model


TYPES OF ERROR

 1. Single-bit error

 2. Burst error
TYPES OF ERROR

1. Single -bit error

 The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.

 In the above figure, the message which is sent is corrupted as

single-bit, i.e., 0 bit is changed to


TYPES OF ERROR

1. Burst error
 The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst Error.
 The Burst Error is determined from the first corrupted bit to the last corrupted bit.

 The duration of noise in Burst Error is more than the duration of noise in Single-Bit.
 Burst Errors are most likely to occur in Serial Data Transmission.
 The number of affected bits depends on the duration of the noise and data rate.
ERROR CONTROL

 After solving the marking of the frame with start and end the data link layer has to

handle eventual errors in transmission or detection.

 Ensuring that all frames are delivered to the network layer at the destination and

in proper order.

 Unacknowledged connectionless service: it is OK for the sender to output frames

regardless of its reception.

 Reliable connection-oriented service: it is NOT OK.


ERROR CONTROL
 In framing method , sender transmits packets in the form of

frame to the receiver. But there is a travel of frame between


sender to the receiver. So there is chances of error to occur
in this travel.

 Now in error control, how error is control in data link layer.

 With positive and negative acknowledgement about a frame.

 If the sender receives a positive acknowledgement about a

frame, the frame has received safely.

 A negative acknowledgement means that something has

gone wrong and the frame must be transmitted again.


ERROR CONTROL

 What if frame not received by receiver?

 Here timer concept is used.

 When the sender transmits a frame, it also starts a timer.

 Before expiry of this timer acknowledgement from receiver must reach to the sender.

 In absent of acknowledgement sender will again transmit the frame.

 What is acknowledgement sent by receiver not reached to sender?

 In this case may possible sender sent multiple frames.

 To prevent from receiving same frames by receiver sender assign a sequence number to the frame.

 By seeing sequence number receiver identifies that its duplicate frame.


ERROR CONTROL

 Reliable connection-oriented service usually will provide a sender with some

feedback about what is happening at the other end of the line.

 Receiver Sends Back Special Control Frames.

 If the Sender Receives positive Acknowledgment it will know that the frame has

arrived safely.

 Timer and Frame Sequence Number for the Sender is Necessary to handle the case

when there is no response (positive or negative) from the Receiver .


ERROR DETECTION AND CORRECTION

 Two basic strategies to deal with errors:

1. Include enough redundant information (duplicated information) to


enable the receiver to deduce what the transmitted data must have
been.

Error correcting codes.

2. Include only enough redundancy to allow the receiver to deduce that an


error has occurred (but not which error).

Error detecting codes.


ERROR DETECTING TECHNIQUES:

1. Parity Checking (VRC)

2. Checksum

3. Cyclic redundancy check(CRC)

4. LRC
PARITY CHECKING(VRC)

 Parity bit means nothing but an additional bit added to the data at the transmitter

before transmitting the data. Before adding the parity bit, number of 1’s or zeros is
calculated in the data. Based on this calculation of data an extra bit is added to the
actual information / data. The addition of parity bit to the data will result in the change
of data string size.

 This means if we have an 8 bit data, then after adding a parity bit to the data binary

string it will become a 9 bit binary data string.

 Parity check is also called as “Vertical Redundancy Check (VRC)”.


PARITY CHECKING(CONTINUE..)
 There is two types of parity bits in error  NOTE: The counting of data bits
detection, they are will include the parity bit also.
 Even parity  The circuit which adds a parity bit
 Odd parity
to the data at transmitter is called
1) Even Parity
“Parity generator”.
 If the data has even number of 1’s, the parity bit
 The parity bits are transmitted and
is 0. Ex: data is 10000001 -> parity bit 0
 Odd number of 1’s, the parity bit is 1. Ex: data is they are checked at the receiver.

10010001 -> parity bit 1  If the parity bits sent at the

2) Odd Parity transmitter and the parity bits


 If the data has odd number of 1’s, the parity bit received at receiver are not equal
is 0. Ex: data is 10011101 -> parity bit 0
then an error is detected.
 Even number of 1’s, the parity bit is 1. Ex: data
 The circuit which checks the parity
SINGLE PARITY CHECK
 Single Parity checking is the simple mechanism and inexpensive to detect the

errors.

 In this technique, a redundant bit is also known as a parity bit which is appended

at the end of the data unit so that the number of 1s becomes even. Therefore, the
total number of transmitted bits would be 9 bits.

 If the number of 1s bits is odd, then parity bit 1 is appended and if the number of

1s bits is even, then parity bit 0 is appended at the end of the data unit.

 At the receiving end, the parity bit is calculated from the received data bits and

compared with the received parity bit.

 This technique generates the total number of 1s even, so it is known as even-


SINGLE PARITY CHECK
SINGLE PARITY CHECK

 Drawbacks Of Single Parity Checking


• It can only detect single-bit errors which are very rare.
• If two bits are interchanged, then it cannot detect the errors.
TWO-DIMENSIONAL PARITY CHECK
 Performance can be improved by using Two-Dimensional Parity Check which

organizes the data in the form of a table.

 Parity check bits are computed for each row, which is equivalent to the single-

parity check.

 In Two-Dimensional Parity check, a block of bits is divided into rows, and the

redundant row of bits is added to the whole block.

 At the receiving end, the parity bits are compared with the parity bits computed

from the received data.


CHECKSUM

 A Checksum is an error detection technique based on the concept of redundancy.

 It is divided into two parts:

1) Checksum generator 2) Checksum checker

1) Checksum Generator

 A Checksum is generated at the sending side.

 Checksum generator subdivides the data into equal segments of n bits each, and all

these segments are added together by using one's complement arithmetic.

 The sum is complemented and appended to the original data, known as checksum field.

The extended data is transmitted across the network.


CHECKSUM GENERATOR

 The Sender follows the given steps:

 The block unit is divided into k sections, a

nd each of n bits.

 All the k sections are added together by u

sing one's complement to get the sum.

 The sum is complemented and it becomes

the checksum field.

 The original data and checksum field are s

ent across the network.


CHECKSUM CHECKER

2) Checksum Checker
 The Receiver follows the given steps:
 A Checksum is verified at the receiving
 The block unit is divided into k sections and e
side.
ach of n bits.
 The receiver subdivides the incoming data
 All the k sections are added together by using
into equal segments of n bits each, and all
one's complement algorithm to get the sum.
these segments are added together, and
then this sum is complemented.  The sum is complemented.

 If the complement of the sum is zero, then  If the result of the sum is zero, then the data i
the data is accepted otherwise data is s accepted otherwise the data is discarded.
rejected.
EXAMPLE
EXAMPLE
CYCLIC REDUNDANCY CHECK (CRC)
 CRC is a redundancy error technique used to determine the error.

 In CRC technique, a string of n 0s is appended to the data unit, and this n number is less than the

number of bits in a predetermined number, known as division which is n+1 bits.

 Secondly, the newly extended data is divided by a divisor using a process is known as binary

division.

 The remainder generated from this division is known as CRC remainder.

 Thirdly, the CRC remainder replaces the appended 0s at the end of the original data.

 This newly generated unit is sent to the receiver.

 The receiver receives the data followed by the CRC remainder. The receiver will treat this whole

unit as a single unit, and it is divided by the same divisor that was used to find the CRC
CYCLIC REDUNDANCY CHECK (CRC)
 If the resultant of this division is zero

which means that it has no error, and


the data is accepted.

 If the resultant of this division is not

zero which means that the data


consists of an error. Therefore, the
data is discarded.
CYCLIC REDUNDANCY CHECK (CRC)
CRC-EXAMPLE

 Let's understand this concept through an example:

 Suppose the original data is 11100 and divisor is 1001.


CRC GENERATOR
 CRC Generator

 A CRC generator uses a modulo-2 division. Firstly, three zeroes are appended at the end of

the data as the length of the divisor is 4 and we know that the length of the string 0s to be
appended is always one less than the length of the divisor.

 Now, the string becomes 11100000, and the resultant string is divided by the divisor

1001.

 The remainder generated from the binary division is known as CRC remainder. The

generated value of the CRC remainder is 111.

 CRC remainder replaces the appended string of 0s at the end of the data unit, and the
CRC GENERATOR-EXAMPLE-1
CRC CHECKER

 CRC Checker

 The functionality of the CRC checker is similar to the CRC generator.

 When the string 11100111 is received at the receiving end, then CRC checker

performs the modulo-2 division.

 A string is divided by the same divisor, i.e., 1001.

 In this case, CRC checker generates the remainder of zero. Therefore, the data is

accepted.
CRC CHECKER – EXAMPLE-1
CRC CHECKER – EXAMPLE-2
ERROR CORRECTING TECHNIQUES

1.Hamming codes.
2. Binary convolutional codes.
3. Reed-Solomon codes.
4. Low-Density Parity Check codes.
ERROR CORRECTING TECHNIQUES

 Hamming Code
 Parity bits: The bit which is appended to the original data of binary bits so that the

total number of 1s is even or odd.

 Even parity: To check for even parity, if the total number of 1s is even, then the

value of the parity bit is 0. If the total number of 1s occurrences is odd, then the
value of the parity bit is 1.

 Odd Parity: To check for odd parity, if the total number of 1s is even, then the value

of parity bit is 1. If the total number of 1s is odd, then the value of parity bit is 0.
HAMMING CODE

Algorithm of Hamming code:


 An information of 'd' bits are added to the redundant bits 'r' to form d+r.

 The location of each of the (d+r) digits is assigned a decimal value.

 The 'r' bits are placed in the positions 1,2,.....2k-1.

 At the receiving end, the parity bits are recalculated. The decimal value of

the parity bits determines the position of an error.

Relationship b/w Error position & binary number.


 Let's understand the concept of Hamming code through an example:

 Suppose the original data is 1010 which is to be sent.


HAMMING CODE

 Codeword: b1 b2 b3 b4 ….
 Check bits: The bits that are powers of 2 (p1, p2, p4, p8, p16, …).
 The rest of bits (m3, m5, m6, m7, m9, …) are filled with m data bits.
 Example of the Hamming code with m = 7 data bits and r = 4 check bits is given in the next
slide.
THE HAMMING CODE

Consider a message having four data bits (D) which is to be transmitted as a


7-bit codeword by adding three error control bits. This would be called a (7,4)
code. The three bits to be added are three EVEN Parity bits (P), where the
parity of each is computed on different subsets of the message bits as shown
below.
7 6 5 4 3 2 1
D D D D
P P P 7-BIT CODEWORD

D - D - D - P (EVEN PARITY)
D D - - D P - (EVEN PARITY)
D D D P - - - (EVEN PARITY)
HAMMING CODE
 Why Those Bits? - The three parity bits (1,2,4) are related to the data bits
(3,5,6,7) as shown at right. In this diagram, each overlapping circle corresponds
to one parity bit and defines the four bits contributing to that parity computation.
For example, data bit 3 contributes to parity bits 1 and 2. Each circle (parity bit)
encompasses a total of four bits, and each circle must have EVEN parity. Given
four data bits, the three parity bits can easily be chosen to ensure this condition.
 It can be observed that changing any one bit numbered 1..7 uniquely affects the
three parity bits. Changing bit 7 affects all three parity bits, while an error in bit 6
affects only parity bits 2 and 4, and an error in a parity bit affects only that bit.
The location of any single bit error is determined directly upon checking the three
parity circles.
HAMMING CODE
HAMMING CODE

 For example, the message 1101 would be sent as 1100110, since:

7 6 5 4 3 2 1
1 1 0 0 1 1 0 7-BIT CODEWORD
1 - 0 - 1 - 0 (EVEN PARITY)
1 1 - - 1 1 - (EVEN PARITY)
1 1 0 0 - - - (EVEN PARITY)
HAMMING CODES

 When these seven bits are entered into the parity circles, it can be confirmed that the
choice of these three parity bits ensures that the parity within each circle is EVEN, as
shown here.
HAMMING CODE

• It may now be observed that if an error occurs in any of the seven bits, that error will
affect different combinations of the three parity bits depending on the bit position.

• For example, suppose the above message 1100110 is sent and a single bit error occurs
such that the codeword 1110110 is received:

transmitted message received message


1100110 ------------> 1110110
BIT: 7 6 5 4 3 2 1 BIT: 7 6 5 4 3 2 1

The above error (in bit 5) can be corrected by examining which of the three parity bits was
affected by the bad bit:
HAMMING CODE
7 6 5 4 3 2 1
1 1 1 0 1 1 0 7-BIT CODEWORD
NOT
1 - 1 - 1 - 0 (EVEN PARITY) 1
!
1 1 - - 1 1 - (EVEN PARITY) OK! 0
NOT
1 1 1 0 - - - (EVEN PARITY) 1
!
HAMMING CODE
• In fact, the bad parity bits labeled 101 point directly to the bad bit since 101
binary equals 5. Examination of the 'parity circles' confirms that any single bit
error could be corrected in this way.
• The value of the Hamming code can be summarized:
1. Detection of 2 bit errors (assuming no correction is attempted);
2. Correction of single bit errors;
3. Cost of 3 bits added to a 4-bit message.
• The ability to correct single bit errors comes at a cost which is less than sending
the entire message twice. (Recall that simply sending a message twice
accomplishes no error correction.)
ERROR DETECTION CODES (2)

Example of an (11, 7) Hamming code


correcting a single-bit error.
FOR 11 DATA BIT

 Follow this link: https://www.youtube.com/watch?v=tEz1KYZy3es


ELEMENTARY DATA LINK PROTOCOLS

1. Simplex,
2. stop and wait,
3. Sliding window protocol
SIMPLEX

 It has no flow or error control.

 It is a unidirectional protocol in which data


frames are traveling in only one direction-from
the sender to receiver.

 The data link layer of the receiver immediately

removes the header from the frame and hands


the data packet to its network layer, which can
also accept the packet immediately.
SIMPLEX

 It is very simple.

 The sender sends a sequence of frames without even thinking about the receiver.

 To send three frames, three events occur at the sender site and three events at

the receiver site.

 Note that the data frames are shown by tilted boxes; the height of the box defines

the transmission time difference between the first bit and the last bit in the frame.
STOP AND WAIT PROTOCOL

 Stop and wait protocol is data link layer protocol for transmission of

frames over noiseless channels.

 It provides unidirectional data transmission with flow control


facilities but without error control facilities.

 The idea of stop and wait protocol is straightforward.

 After transmitting one frame, the sender waits for an


acknowledgement before transmitting the next frame.
STOP AND WAIT PROTOCOL

Primitives of stop and wait protocol

1. Sender side

Rule 1: Send one data packet at a time.

Rule 2: send the next packet only after receiving


ACK the previous.

2. Receiver side

Rule 1: Receive and consume data packet.

Rule 2: After consuming packet, ACK need to be


sent(flow control.
STOP AND WAIT PROTOCOL
Problems of stop and wait protocol

1. Problems due to lost data

 Sender waits for ack for an infinite amount of


time

 Receiver waits for data an infinite amount of


time

2. Problems due to lost ACK

 Sender waits for an infinite amount of time for


ack

2. Problems due to delayed ACK/data.

 After timeout on sender side, a delayed ack might be


wrongly considered as ack of some other data packet.
STOP AND WAIT PROTOCOL ARQ

 Idea of stop and wait protocol is


straightforward.

 After transmitting one frame the sender

waits for an acknowledgement before


transmitting the next frame.

 If the acknowledgement does not arrive

after a certain period of time, the sender


times out and retransmits the original frame.

 Stop and wait ARQ= stop-and-wait + Timeout Timer + sequence number


STOP AND WAIT PROTOCOL ARQ

 A) The ACK is received before timer

expires

 B) The original frame is lost

 C)The ACK is lost

 D) Timeout fires too soon


SLIDING WINDOW PROTOCOL

 The sliding window is a technique for sending multiple frames at a time. It controls

the data packets between the two devices where reliable and gradual delivery of
data frames is needed. It is also used in TCP (Transmission Control Protocol).

 In this technique, each frame has sent from the sequence number. The sequence

numbers are used to find the missing data in the receiver end. The purpose of the
sliding window technique is to avoid duplicate data, so it uses the sequence
number.
SLIDING WINDOW PROTOCOL

A sliding window of size 1, with a 3-bit sequence number.


(a) Initially. (b) After the first frame has been sent.
SLIDING WINDOW PROTOCOL

A sliding window of size 1, with a 3-bit sequence number


(c) After the first frame has been received. (d) After the first
acknowledgement has been received.
SLIDING WINDOW PROTOCOL

 Send multiple frames at a time.

 Number of frames to be sent is based on window size.

 Each Frame is numbered-> Sequence number


ONE-BIT SLIDING WINDOW PROTOCOL (1)

 From receiver side receiver send acknowledgement of frame 0.

 So sender can send next frame , and move little bit of sliding window
ONE-BIT SLIDING WINDOW PROTOCOL (2)

 From receiver side receiver send acknowledgement of frame 1.

 So sender can send next frame , and move little bit of sliding window
ONE-BIT SLIDING WINDOW PROTOCOL (3)

 From receiver side receiver send acknowledgement of frame 2.

 So sender can send next frame , and move little bit of sliding window
SLIDING WINDOW PROTOCOL

 In this figure, Frame 0,1,2 are already sent and acknowledgement, frame 3,4,5,6

are sent but not acknowledged and frame 7,8,9,10 are not yet sent.
SLIDING WINDOW PROTOCOL

Two scenarios for protocol 4. (a) Normal case. (b) Abnormal


case. The notation is (seq, ack, packet number). An asterisk indicates where
a network layer accepts a packet
SLIDING WINDOW PROTOCOL

 Types of Sliding Window Protocol

Sliding window protocol has two types:


1. Go-Back-N ARQ

2. Selective Repeat ARQ


GO-BACK-N ARQ

 Go-Back-N ARQ  Go- Back –N ARQ uses the concept of protocol

pipelining i.e. the sender can send multiple


 Go-Back-N ARQ protocol is also
frames before receiving the
known as Go-Back-N Automatic
acknowledgement for the first frame.
Repeat Request.
 There are are finite number of frames and the
 It is a data link layer protocol that
frames are numbered in a sequential manner
uses a sliding window method.

 In this, if any frame is corrupted or  If the acknowledgement of a frame is not

lost, all subsequent frames have to received within an agreed upon time period ,

be sent again. all frames in the current window are


transmitted
GO-BACK-N ARQ
GO-BACK-N ARQ

Pipelining and error recovery. Effect of an error when


(a) receiver’s window size is 1
SELECTIVE REPEAT ARQ
 The size of the sliding window is always
 Selective Repeat ARQ is also known as the
greater than 1.
Selective Repeat Automatic Repeat Request.
 If the receiver receives a corrupt frame, it
 It is a data link layer protocol that uses a sliding does not directly discard it.
window method.  It sends a negative acknowledgment to the

 The Go-back-N ARQ protocol works well if it has sender.

fewer errors.  The sender sends that frame again as soon as

 But if there is a lot of error in the frame, lots of on the receiving negative acknowledgment.

bandwidth loss in sending the frames again.  There is no waiting for any time-out to send

that frame.
 So, we use the Selective Repeat ARQ protocol. In
 The design of the Selective Repeat ARQ
this protocol, the size of the sender window is
protocol is shown below.
SELECTIVE REPEAT ARQ
SELECTIVE REPEAT ARQ

Pipelining and error recovery. Effect of an error when


(b) receiver’s window size is large.
DIFFERENCE
Go-Back-N ARQ Selective Repeat ARQ
If a frame is corrupted or lost in it,all In this, only the frame is sent again,
subsequent frames have to be sent which is corrupted or lost.
again.
If it has a high error rate,it wastes a There is a loss of low bandwidth.
lot of bandwidth.
It is less complex. It is more complex because it has to
do sorting and searching as well. And
it also requires more storage.

It does not require sorting. In this, sorting is done to get the


frames in the correct order.
It does not require searching. The search operation is performed in
it.
It is used more. It is used less because it is more
complex.
HDLC

 A high-level data link control (HDLC) is a protocol that is a bit-oriented synchronous data

link layer.

 HDLC ensures the error-free transmission of data to the proper destinations and controls

the data transmission speed.

 HDLCs can provide both connection-oriented and connectionless services.

 A high-level data link control defines rules for transmitting data between network points.

 Data in an HDLC is organized into units called frames and is sent across networks to

specified destinations.
HDLC (CONTINUE..)
 HDLC also manages the pace at which data is transmitted.

 HDLC is commonly used in the open systems interconnection (OSI) model's layer 2.

 HDLC frames are transmitted over synchronous links or asynchronous links, which do not

mark the start and end of frames.

 This is done using a frame delimiter or flag, which contains unique sequence of bits that are

not visible inside a frame.


HDLC

 There are three types of HDLC frames:

1. Information frames/User data (I-frames)

2. Supervisory frames/Control data (S-frames)

3. Unnumbered frames (U-frames)

 The common fields within an HDLC frame are:

 Flag

 Address

 Control information

 Frame check sequence


INFORMATION FRAMES/USER DATA (I-FRAMES)
 I-frame stands for Information frames.

 This frame is generally used for transporting user data from network layer.

 These frames actually carry actual data or information of upper layer and some control

information.

 This frame carries data along with both send sequence number and an acknowledgment

number.

 It can also be used to piggyback acknowledgment information in case of ABM (Asynchronous

Balanced Mode).

 The first bit of this frame of control filed is 0.


SUPERVISORY FRAMES/CONTROL DATA (S-FRAMES)
 S-frame stands for Supervisory frames.

 These frames are basically required and essential for error control and flow control.

 They also provide control information. It contains or includes only an Acknowledgment

number.

 First two bit of this frame of control filed is 10.

 S-frame does not have any information fields.

 This frame contains send and receive sequence numbers.


UNNUMBERED FRAMES (U-FRAMES)
 U-frame stands for Unnumbered frames.

 These frames are also required in various functions like link setup and disconnections.

 These frames basically support control purposes and are not sequenced.

 First two bit of this frame of control filed is 11.

 Some of U-frame contain an information field depending upon type.

 These frames are also used for different miscellaneous purposes along with link

management.

 U-frame is required for managing link itself.

 This frame does not include any type of acknowledgment information i.e. in turn it

includes or contained in sequence number.

You might also like