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

Data Link Layer

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Data Link Layer

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 62

Data Link Layer

o In the OSI model, the data link layer is a 4 th layer from the top and
2nd layer from the bottom.
o The communication channel that connects the adjacent nodes is
known as links, and in order to move the datagram from source to the
destination, the datagram must be moved across an individual link.
o The main responsibility of the Data Link Layer is to transfer the
datagram across an individual link.
o The Data link layer protocol defines the format of the packet
exchanged across the nodes as well as the actions such as Error
detection, retransmission, flow control, and random access.
o The Data Link Layer protocols are Ethernet, token ring, FDDI and PPP.
o An important characteristic of a Data Link Layer is that datagram can
be handled by different link layer protocols on different links in a path.
For example, the datagram is handled by Ethernet on the first link, PPP
on the second link.

Following services are provided by the Data Link Layer:


o Framing & Link access: Data Link Layer protocols encapsulate each
network frame within a Link layer frame before the transmission across
the link. A frame consists of a data field in which network layer
datagram is inserted and a number of data fields. It specifies the
structure of the frame as well as a channel access protocol by which
frame is to be transmitted over the link.

o Reliable delivery: Data Link Layer provides a reliable delivery


service, i.e., transmits the network layer datagram without any error. A
reliable delivery service is accomplished with transmissions and
acknowledgements. A data link layer mainly provides the reliable
delivery service over the links as they have higher error rates and they
can be corrected locally, link at which an error occurs rather than
forcing to retransmit the data.
o Flow control: A receiving node can receive the frames at a faster rate
than it can process the frame. Without flow control, the receiver's
buffer can overflow, and frames can get lost. To overcome this
problem, the data link layer uses the flow control to prevent the
sending node on one side of the link from overwhelming the receiving
node on another side of the link.
o Error detection: Errors can be introduced by signal attenuation and
noise. Data Link Layer protocol provides a mechanism to detect one or
more errors. This is achieved by adding error detection bits in the
frame and then receiving node can perform an error check.
o Error correction: Error correction is similar to the Error detection,
except that receiving node not only detect the errors but also
determine where the errors have occurred in the frame.
o Half-Duplex & Full-Duplex: In a Full-Duplex mode, both the nodes
can transmit the data at the same time. In a Half-Duplex mode, only
one node can transmit the data at the same time.

Error Detection
When data is transmitted from one device to another device, the system
does not guarantee whether the data received by the device is identical to
the data transmitted by another device. An Error is a situation when the
message received at the receiver end is not identical to the message
transmitted.
Types Of Errors

Errors can be classified into two categories:

o Single-Bit Error
o Burst Error

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

Single-Bit Error does not appear more likely in Serial Data Transmission.
For example, Sender sends the data at 10 Mbps, this means that the bit lasts
only for 1 ?s and for a single-bit error to occurred, a noise must be more than
1 ?s.

Single-Bit Error mainly occurs in Parallel Data Transmission. For example, if


eight wires are used to send the eight bits of a byte, if one of the wire is
noisy, then single-bit is corrupted per byte.
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 occurr in Serial Data Transmission.

The number of affected bits depends on the duration of the noise and data
rate.

Error Detecting Techniques:


The most popular Error Detecting Techniques are:

o Single parity check


o Two-dimensional parity check
o Checksum
o Cyclic redundancy check
Single Parity Check
o Single Parity checking is the simple mechanism and inexpensive to detect the
errors.
o 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.
o 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.
o At the receiving end, the parity bit is calculated from the received data bits
and compared with the received parity bit.
o This technique generates the total number of 1s even, so it is known as even-
parity checking.

Drawbacks Of Single Parity Checking

o It can only detect single-bit errors which are very rare.


o If two bits are interchanged, then it cannot detect the errors.

Two-Dimensional Parity Check


o Performance can be improved by using Two-Dimensional Parity
Check which organizes the data in the form of a table.
o Parity check bits are computed for each row, which is equivalent to the
single-parity check.
o 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.
o At the receiving end, the parity bits are compared with the parity bits
computed from the received data.

Drawbacks Of 2D Parity Check

o If two bits in one data unit are corrupted and two bits exactly the same
position in another data unit are also corrupted, then 2D Parity checker will
not be able to detect the error.
o This technique cannot be used to detect the 4-bit errors or more in some
cases.

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

It is divided into two parts:

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.

Suppose L is the total sum of the data segments, then the checksum would
be ?L
1. The Sender follows the given steps:
2. The block unit is divided into k sections, and each of n bits.
3. All the k sections are added together by using one's complement to get the sum.
4. The sum is complemented and it becomes the checksum field.
5. The original data and checksum field are sent across the network.

Checksum Checker

A Checksum is verified at the receiving side. The receiver subdivides the


incoming data into equal segments of n bits each, and all these segments
are added together, and then this sum is complemented. If the complement
of the sum is zero, then the data is accepted otherwise data is rejected.

1. The Receiver follows the given steps:


2. The block unit is divided into k sections and each of n bits.
3. All the k sections are added together by using one's complement algorithm to get t
he sum.
4. The sum is complemented.
5. If the result of the sum is zero, then the data is accepted otherwise the data is disc
arded.
Cyclic Redundancy Check (CRC)
CRC is a redundancy error technique used to determine the error.

Following are the steps used in CRC for error detection:

o 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.
o 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.
o Thirdly, the CRC remainder replaces the appended 0s at the end of the
original data. This newly generated unit is sent to the receiver.
o 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 remainder.

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.

Let's understand this concept through an example:

Suppose the original data is 11100 and divisor is 1001.

CRC Generator

o 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.
o Now, the string becomes 11100000, and the resultant string is divided by the
divisor 1001.
o The remainder generated from the binary division is known as CRC
remainder. The generated value of the CRC remainder is 111.
o CRC remainder replaces the appended string of 0s at the end of the data unit,
and the final string would be 11100111 which is sent across the network.

CRC Checker

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


o When the string 11100111 is received at the receiving end, then CRC checker
performs the modulo-2 division.
o A string is divided by the same divisor, i.e., 1001.
o In this case, CRC checker generates the remainder of zero. Therefore, the
data is accepted.
Error Correction
Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.

Error Correction can be handled in two ways:

o Backward error correction: Once the error is discovered, the receiver


requests the sender to retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-
correcting code which automatically corrects the errors.

A single additional bit can detect the error, but cannot correct it.

For correcting the errors, one has to know the exact position of the error. For
example, If we want to calculate a single-bit error, the error correction code
will determine which one of seven bits is in error. To achieve this, we have to
add some additional redundant bits.

Suppose r is the number of redundant bits and d is the total number of the
data bits. The number of redundant bits r can be calculated by using the
formula:

2r>=d+r+1

The value of r is calculated by using the above formula. For example, if the
value of d is 4, then the possible smallest value that satisfies the above
relation would be 3.

To determine the position of the bit which is in error, a technique developed


by R.W Hamming is Hamming code which can be applied to any length of the
data unit and uses the relationship between data units and redundant units.
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.

Algorithm of Hamming code:

o An information of 'd' bits are added to the redundant bits 'r' to form d+r.
o The location of each of the (d+r) digits is assigned a decimal value.
o The 'r' bits are placed in the positions 1,2,.....2 k-1.
o 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.

Total number of data bits 'd' = 4


Number of redundant bits r : 2r >= d+r+1
2r>= 4+r+1
Therefore, the value of r is 3 that satisfies the above relation.
Total number of bits = d+r = 4+3 = 7;
Determining the position of the redundant bits
The number of redundant bits is 3. The three bits are represented by r1, r2,
r4. The position of the redundant bits is calculated with corresponds to the
raised power of 2. Therefore, their corresponding positions are 1, 21, 22.

1. The position of r1 = 1
2. The position of r2 = 2
3. The position of r4 = 4

Representation of Data on the addition of parity bits:

Determining the Parity bits


Determining the r1 bit
The r1 bit is calculated by performing a parity check on the bit positions
whose binary representation includes 1 in the first position.

We observe from the above figure that the bit positions that includes 1 in the
first position are 1, 3, 5, 7. Now, we perform the even-parity check at these
bit positions. The total number of 1 at these bit positions corresponding to r1
is even, therefore, the value of the r1 bit is 0.

Determining r2 bit
The r2 bit is calculated by performing a parity check on the bit positions
whose binary representation includes 1 in the second position.

We observe from the above figure that the bit positions that includes 1 in the
second position are 2, 3, 6, 7. Now, we perform the even-parity check at
these bit positions. The total number of 1 at these bit positions
corresponding to r2 is odd, therefore, the value of the r2 bit is 1.

Determining r4 bit
The r4 bit is calculated by performing a parity check on the bit positions
whose binary representation includes 1 in the third position.

We observe from the above figure that the bit positions that includes 1 in the
third position are 4, 5, 6, 7. Now, we perform the even-parity check at these
bit positions. The total number of 1 at these bit positions corresponding to r4
is even, therefore, the value of the r4 bit is 0.

Data transferred is given below:


Suppose the 4th bit is changed from 0 to 1 at the receiving end, then parity
bits are recalculated.

R1 bit
The bit positions of the r1 bit are 1,3,5,7

We observe from the above figure that the binary representation of r1 is


1100. Now, we perform the even-parity check, the total number of 1s
appearing in the r1 bit is an even number. Therefore, the value of r1 is 0.

R2 bit
The bit positions of r2 bit are 2,3,6,7.
We observe from the above figure that the binary representation of r2 is
1001. Now, we perform the even-parity check, the total number of 1s
appearing in the r2 bit is an even number. Therefore, the value of r2 is 0.

R4 bit
The bit positions of r4 bit are 4,5,6,7.

We observe from the above figure that the binary representation of r4 is


1011. Now, we perform the even-parity check, the total number of 1s
appearing in the r4 bit is an odd number. Therefore, the value of r4 is 1.

o The binary representation of redundant bits, i.e., r4r2r1 is 100, and its
corresponding decimal value is 4. Therefore, the error occurs in a 4 th bit
position. The bit value must be changed from 1 to 0 to correct the error.
Data Link Controls
Data Link Control is the service provided by the Data Link Layer to provide
reliable data transfer over the physical medium. For example, In the half-
duplex transmission mode, one device can only transmit the data at a time.
If both the devices at the end of the links transmit the data simultaneously,
they will collide and leads to the loss of the information. The Data link layer
provides the coordination among the devices so that no collision occurs.

The Data link layer provides three functions:

o Line discipline
o Flow Control
o Error Control

Line Discipline
o Line Discipline is a functionality of the Data link layer that provides the
coordination among the link systems. It determines which device can send,
and when it can send the data.

Line Discipline can be achieved in two ways:

o ENQ/ACK
o Poll/select

END/ACK
END/ACK stands for Enquiry/Acknowledgement is used when there is no
wrong receiver available on the link and having a dedicated path between
the two devices so that the device capable of receiving the transmission is
the intended one.

END/ACK coordinates which device will start the transmission and whether
the recipient is ready or not.

Working of END/ACK

The transmitter transmits the frame called an Enquiry (ENQ) asking whether
the receiver is available to receive the data or not.

The receiver responses either with the positive acknowledgement (ACK) or


with the negative acknowledgement (NACK) where positive
acknowledgement means that the receiver is ready to receive the
transmission and negative acknowledgement means that the receiver is
unable to accept the transmission.

Following are the responses of the receiver:

o If the response to the ENQ is positive, the sender will transmit its data, and
once all of its data has been transmitted, the device finishes its transmission
with an EOT (END-of-Transmission) frame.
o If the response to the ENQ is negative, then the sender disconnects and
restarts the transmission at another time.
o If the response is neither negative nor positive, the sender assumes that the
ENQ frame was lost during the transmission and makes three attempts to
establish a link before giving up.
Poll/Select

The Poll/Select method of line discipline works with those topologies where
one device is designated as a primary station, and other devices are
secondary stations.

Working of Poll/Select
o In this, the primary device and multiple secondary devices consist of a single
transmission line, and all the exchanges are made through the primary
device even though the destination is a secondary device.
o The primary device has control over the communication link, and the
secondary device follows the instructions of the primary device.
o The primary device determines which device is allowed to use the
communication channel. Therefore, we can say that it is an initiator of the
session.
o If the primary device wants to receive the data from the secondary device, it
asks the secondary device that they anything to send, this process is known
as polling.
o If the primary device wants to send some data to the secondary device, then
it tells the target secondary to get ready to receive the data, this process is
known as selecting.

Select

o The select mode is used when the primary device has something to send.
o When the primary device wants to send some data, then it alerts the
secondary device for the upcoming transmission by transmitting a Select
(SEL) frame, one field of the frame includes the address of the intended
secondary device.
o When the secondary device receives the SEL frame, it sends an
acknowledgement that indicates the secondary ready status.
o If the secondary device is ready to accept the data, then the primary device
sends two or more data frames to the intended secondary device. Once the
data has been transmitted, the secondary sends an acknowledgement
specifies that the data has been received.
Poll

o The Poll mode is used when the primary device wants to receive some data
from the secondary device.
o When a primary device wants to receive the data, then it asks each device
whether it has anything to send.
o Firstly, the primary asks (poll) the first secondary device, if it responds with
the NACK (Negative Acknowledgement) means that it has nothing to send.
Now, it approaches the second secondary device, it responds with the ACK
means that it has the data to send. The secondary device can send more
than one frame one after another or sometimes it may be required to send
ACK before sending each one, depending on the type of the protocol being
used.
Flow Control
o It is a set of procedures that tells the sender how much data it can transmit
before the data overwhelms the receiver.
o The receiving device has limited speed and limited memory to store the data.
Therefore, the receiving device must be able to inform the sending device to
stop the transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until they
are processed.

Two methods have been developed to control the flow of data:

o Stop-and-wait
o Sliding window

Stop-and-wait
o In the Stop-and-wait method, the sender waits for an acknowledgement after
every frame it sends.
o When acknowledgement is received, then only next frame is sent. The
process of alternately sending and waiting of a frame continues until the
sender transmits the EOT (End of transmission) frame.

Advantage of Stop-and-wait

The Stop-and-wait method is simple as each frame is checked and


acknowledged before the next frame is sent.

Disadvantage of Stop-and-wait

Stop-and-wait technique is inefficient to use as each frame must travel


across all the way to the receiver, and an acknowledgement travels all the
way before the next frame is sent. Each frame sent and received uses the
entire time needed to traverse the link.

Sliding Window

o The Sliding Window is a method of flow control in which a sender can


transmit the several frames before getting an acknowledgement.
o In Sliding Window Control, multiple frames can be sent one after the another
due to which capacity of the communication channel can be utilized
efficiently.
o A single ACK acknowledge multiple frames.
o Sliding Window refers to imaginary boxes at both the sender and receiver
end.
o The window can hold the frames at either end, and it provides the upper limit
on the number of frames that can be transmitted before the
acknowledgement.
o Frames can be acknowledged even when the window is not completely filled.
o The window has a specific size in which they are numbered as modulo-n
means that they are numbered from 0 to n-1. For example, if n = 8, the
frames are numbered from 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........
o The size of the window is represented as n-1. Therefore, maximum n-1
frames can be sent before acknowledgement.
o When the receiver sends the ACK, it includes the number of the next frame
that it wants to receive. For example, to acknowledge the string of frames
ending with frame number 4, the receiver will send the ACK containing the
number 5. When the sender sees the ACK with the number 5, it got to know
that the frames from 0 through 4 have been received.

Sender Window

o At the beginning of a transmission, the sender window contains n-1 frames,


and when
o

o they are sent out, the left boundary moves inward shrinking the size of the
window. For example, if the size of the window is w if three frames are sent
out, then the number of frames left out in the sender window is w-3.
o Once the ACK has arrived, then the sender window expands to the number
which will be equal to the number of frames acknowledged by ACK.
o For example, the size of the window is 7, and if frames 0 through 4 have been
sent out and no acknowledgement has arrived, then the sender window
contains only two frames, i.e., 5 and 6. Now, if ACK has arrived with a number
4 which means that 0 through 3 frames have arrived undamaged and the
sender window is expanded to include the next four frames. Therefore, the
sender window contains six frames (5,6,7,0,1,2).

Channelization Protocols
In this tutorial, we will be covering the Channelization protocols of Multiple
access in detail.

Channelization is basically a method that provides the multiple-access and in


this, the available bandwidth of the link is shared in time, frequency, or
through the code in between the different stations.
Powered By

Channelization Protocols are broadly classified as follows:

 FDMA(Frequency-Division Multiple Access)

 TDMA(Time-Division Multiple Access)

 CDMA(Code-Division Multiple Access)

Let us discuss the above-given techniques one by one:

1. Frequency-Division Multiple Access

With the help of this technique, the available bandwidth is divided into
frequency bands. Each station is allocated a band in order to send its data.
Or in other words, we can say that each band is reserved for a specific
station and it belongs to the station all the time.

 Each station makes use of the bandpass filter in order to confine


the frequencies of the transmitter.

 In order to prevent station interferences, the allocated bands are


separated from one another with the help of small guard bands.
 The Frequency-division multiple access mainly specifies a
predetermined frequency for the entire period of communication.

 Stream of data can be easily used with the help of FDMA.

Advantages of FDMA

Given below are some of the benefits of using the FDMA technique:

 This technique is efficient when the traffic is uniformly constant.

 In case if the channel is not in use then it sits idle.

 FDMA is simple algorithmically and the complexity is less.

 For FDMA there is no restriction regarding the type of baseband or the


type of modulation.

Disadvantages of FDMA

 By using FDMA, the maximum flow rate per channel is fixed and small.
2. Time-Division Multiple Access

Time-Division Multiple access is another method to access the channel for


shared medium networks.

 With the help of this technique, the stations share the bandwidth of the
channel in time.

 A time slot is allocated to each station during which it can send the
data.

 Data is transmitted by each station in the assigned time slot.

 There is a problem in using TDMA and it is due to TDMA the


synchronization cannot be achieved between the different stations.

 When using the TDMA technique then each station needs to know the
beginning of its slot and the location of its slot.

 If the stations are spread over a large area, then there occur
propagation delays; in order to compensate this guard, times are used.

 The data link layer in each station mainly tells its physical layer to use
the allocated time slot.

Figure: Time-Division media access.

Some examples of TDMA are as follows;

 personal digital Cellular(PDC)


 Integrated digital enhanced network.

 Universal terrestrial radio access(UTRA)

3. Code-Division Multiple Access

CDMA (code-division multiple access) is another technique used for


channelization.

 CDMA technique differs from the FDMA because only one channel
occupies the entire bandwidth of the link.

 The CDMA technique differs from the TDMA because all the stations
can send data simultaneously as there is no timesharing.

 The CDMA technique simply means communication with different


codes.

 In the CDMA technique, there is only one channel that carries all the
transmission simultaneously.

 CDMA is mainly based upon the coding theory; where each station is
assigned a code, Code is a sequence of numbers called chips.

 The data from the different stations can be transmitted simultaneously but
using different code languages.

Advantages of CDMA

Given below are some of the advantages of using the CDMA technique:

 Provide high voice quality.

 CDMA operates at low power levels.

 The capacity of the system is higher than the TDMA and FDMA.

 CDMA is better cost-effective.

IEEE 802.11 Mac Frame


Prerequisite – Basics of Wi-fi MAC layer provides functionality for
several tasks like control medium access, can also offer support for
roaming, authentication, and power conservation. The basic services
provided by MAC are the mandatory asynchronous data service and
optional time-bounded service. IEEE 802.11 defines two MAC sub-
layers:-
1. Distributed Coordination Function (DCF) – DCF uses CSMA/CA
as access method as wireless LAN can’t implement CSMA/CD. It only
offers asynchronous service.
2. Point Coordination Function (PCF) – PCP is implemented on top
of DCF and mostly used for time-service transmission. It uses a
centralized, contention-free polling access method. It offers both
asynchronous and time-bounded service.
MAC Frame: The MAC layer frame consists of 9 fields. The following
figure shows the basic structure of an IEEE 802.11 MAC data frame
along with the content of the frame control
field.

 Frame Control(FC) – It is 2 bytes long field which defines type of


frame and some control information. Various fields present in FC
are:
1. Version: It is a 2 bit long field which indicates the current
protocol version which is fixed to be 0 for now.
2. Type: It is a 2 bit long field which determines the function of
frame i.e management(00), control(01) or data(10). The value 11
is reserved.
3. Subtype: It is a 4 bit long field which indicates sub-type of the
frame like 0000 for association request, 1000 for beacon.
4. To DS: It is a 1 bit long field which when set indicates that
destination frame is for DS(distribution system).
5. From DS: It is a 1 bit long field which when set indicates frame
coming from DS.
6. More frag (More fragments): It is 1 bit long field which when
set to 1 means frame is followed by other fragments.
7. Retry: It is 1-bit long field, if the current frame is a
retransmission of an earlier frame, this bit is set to 1.
8. Power Mgmt (Power management): It is 1-bit long field that
indicates the mode of a station after successful transmission of a
frame. Set to 1 the field indicates that the station goes into
power-save mode. If the field is set to 0, the station stays active.
9. More data: It is 1-bit long field that is used to indicate receiver
that a sender has more data to send than the current frame. This
can be used by an access point to indicate to a station in power-
save mode that more packets are buffered or it can be used by a
station to indicate to an access point after being polled that more
polling is necessary as the station has more data ready to
transmit.
10. WEP: It is 1 bit long field which indicates that the standard
security mechanism of 802.11 is applied.
11. Order: It is 1 bit long field, if this bit is set to 1 the received
frames must be processed in strict order.
 Duration/ID – It is 4 bytes long field which contains the value
indicating the period of time in which the medium is occupied(in µs).
 Address 1 to 4 – These are 6 bytes long fields which contain
standard IEEE 802 MAC addresses (48 bit each). The meaning of
each address depends on the DS bits in the frame control field.
 SC (Sequence control) – It is 16 bits long field which consists of 2
sub-fields, i.e., Sequence number (12 bits) and Fragment number (4
bits). Since acknowledgement mechanism frames may be
duplicated hence, a sequence number is used to filter duplicate
frames.
 Data – It is a variable length field which contain information specific
to individual frames which is transferred transparently from a
sender to the receiver(s).
 CRC (Cyclic redundancy check) – It is 4 bytes long field which
contains a 32 bit CRC error detection sequence to ensure error free
frame.

features of the IEEE 802.11 MAC frame:


Frame Control Field: The frame control field contains information
about the type of frame, the data rate, and the power management
status.
Duration Field: The duration field specifies the length of time that the
channel will be occupied by the transmission.
Address Fields: The address fields specify the source and destination
MAC addresses of the Wi-Fi devices involved in the communication.
Sequence Control Field: The sequence control field is used to
identify and manage the transmission sequence of the frames.
Frame Body: The frame body contains the actual data being
transmitted between Wi-Fi devices, such as IP packets, TCP segments,
or UDP datagrams.
Frame Check Sequence: The frame check sequence (FCS) is used to
check the integrity of the data transmitted in the frame and to detect
any transmission errors.
Management, Control, and Data Frames: The IEEE 802.11 MAC
frame defines three types of frames: management frames, control
frames, and data frames. Management frames are used for network
management, control frames are used for coordination between Wi-Fi
devices, and data frames are used for the transmission of actual data.
Fragmentation: The IEEE 802.11 MAC frame supports fragmentation,
which allows large data packets to be divided into smaller fragments
for transmission.
Acknowledgments: The IEEE 802.11 MAC frame uses
acknowledgments to confirm the successful transmission of frames
and to request the retransmission of any frames that were not
successfully received.
Receiver Window

o At the beginning of transmission, the receiver window does not contain n


frames, but it contains n-1 spaces for frames.
o When the new frame arrives, the size of the window shrinks.
o The receiver window does not represent the number of frames received, but
it represents the number of frames that can be received before an ACK is
sent. For example, the size of the window is w, if three frames are received
then the number of spaces available in the window is (w-3).
o Once the acknowledgement is sent, the receiver window expands by the
number equal to the number of frames acknowledged.
o Suppose the size of the window is 7 means that the receiver window contains
seven spaces for seven frames. If the one frame is received, then the
receiver window shrinks and moving the boundary from 0 to 1. In this way,
window shrinks one by one, so window now contains the six spaces. If frames
from 0 through 4 have sent, then the window contains two spaces before an
acknowledgement is sent.

Error Control
Error Control is a technique of error detection and retransmission.

Categories of Error Control:


Stop-and-wait ARQ

Stop-and-wait ARQ is a technique used to retransmit the data in case of


damaged or lost frames.

This technique works on the principle that the sender will not transmit the
next frame until it receives the acknowledgement of the last transmitted
frame.

Four features are required for the retransmission:

o The sending device keeps a copy of the last transmitted frame until the
acknowledgement is received. Keeping the copy allows the sender to
retransmit the data if the frame is not received correctly.
o Both the data frames and the ACK frames are numbered alternately 0 and 1
so that they can be identified individually. Suppose data 1 frame
acknowledges the data 0 frame means that the data 0 frame has been
arrived correctly and expects to receive data 1 frame.
o If an error occurs in the last transmitted frame, then the receiver sends the
NAK frame which is not numbered. On receiving the NAK frame, sender
retransmits the data.
o It works with the timer. If the acknowledgement is not received within the
allotted time, then the sender assumes that the frame is lost during the
transmission, so it will retransmit the frame.

Two possibilities of the retransmission:


o Damaged Frame: When the receiver receives a damaged frame, i.e., the
frame contains an error, then it returns the NAK frame. For example, when
the data 0 frame is sent, and then the receiver sends the ACK 1 frame means
that the data 0 has arrived correctly, and transmits the data 1 frame. The
sender transmits the next frame: data 1. It reaches undamaged, and the
receiver returns ACK 0. The sender transmits the next frame: data 0. The
receiver reports an error and returns the NAK frame. The sender retransmits
the data 0 frame.
o Lost Frame: Sender is equipped with the timer and starts when the frame is
transmitted. Sometimes the frame has not arrived at the receiving end so
that it can be acknowledged neither positively nor negatively. The sender
waits for acknowledgement until the timer goes off. If the timer goes off, it
retransmits the last transmitted frame.

Sliding Window ARQ

SlidingWindow ARQ is a technique used for continuous transmission error


control.

Three Features used for retransmission:

o In this case, the sender keeps the copies of all the transmitted frames until
they have been acknowledged. Suppose the frames from 0 through 4 have
been transmitted, and the last acknowledgement was for frame 2, the sender
has to keep the copies of frames 3 and 4 until they receive correctly.
o The receiver can send either NAK or ACK depending on the conditions. The
NAK frame tells the sender that the data have been received damaged. Since
the sliding window is a continuous trans mission mechanism, both ACK and
NAK must be numbered for the identification of a frame. The ACK frame
consists of a number that represents the next frame which the receiver
expects to receive. The NAK frame consists of a number that represents the
damaged frame.
o The sliding window ARQ is equipped with the timer to handle the lost
acknowledgements. Suppose then n-1 frames have been sent before
receiving any acknowledgement. The sender waits for the acknowledgement,
so it starts the timer and waits before sending any more. If the allotted time
runs out, the sender retransmits one or all the frames depending upon the
protocol used.

Two protocols used in sliding window ARQ:

o Go-Back-n ARQ: In Go-Back-N ARQ protocol, if one frame is lost or


damaged, then it retransmits all the frames after which it does not receive
the positive ACK.

Three possibilities can occur for retransmission:

o Damaged Frame: When the frame is damaged, then the receiver sends a
NAK frame.
In the above figure, three frames have been transmitted before an error
discovered in the third frame. In this case, ACK 2 has been returned telling
that the frames 0,1 have been received successfully without any error. The
receiver discovers the error in data 2 frame, so it returns the NAK 2 frame.
The frame 3 is also discarded as it is transmitted after the damaged frame.
Therefore, the sender retransmits the frames 2,3.

o Lost Data Frame: In Sliding window protocols, data frames are sent
sequentially. If any of the frames is lost, then the next frame arrive at the
receiver is out of sequence. The receiver checks the sequence number of
each of the frame, discovers the frame that has been skipped, and returns
the NAK for the missing frame. The sending device retransmits the frame
indicated by NAK as well as the frames transmitted after the lost frame.
o Lost Acknowledgement: The sender can send as many frames as the
windows allow before waiting for any acknowledgement. Once the limit of the
window is reached, the sender has no more frames to send; it must wait for
the acknowledgement. If the acknowledgement is lost, then the sender could
wait forever. To avoid such situation, the sender is equipped with the timer
that starts counting whenever the window capacity is reached. If the
acknowledgement has not been received within the time limit, then the
sender retransmits the frame since the last ACK.

Selective-Reject ARQ

o Selective-Reject ARQ technique is more efficient than Go-Back-n ARQ.


o In this technique, only those frames are retransmitted for which negative
acknowledgement (NAK) has been received.
o The receiver storage buffer keeps all the damaged frames on hold until the
frame in error is correctly received.
o The receiver must have an appropriate logic for reinserting the frames in a
correct order.
o The sender must consist of a searching mechanism that selects only the
requested frame for retransmission.
What are noiseless and noisy channels?
Computer NetworkInternetMCA

Data link layer protocols are divided into two categories based on whether the
transmission channel is noiseless or noisy.
The data link layer protocol is diagrammatically represented below −

Noiseless Channels
There are two noiseless channels which are as follows −

 Simplex channel
 Stop & wait channel
Let us consider an ideal channel where no frames are lost, duplicated, or corrupted. We
introduce two protocols for this type of channel. These two protocols are as follows −
 Protocol that does not use flow control.
 Protocol that uses the flow control.
Now let us consider the Protocols that do not use flow control −

Simplest Protocol
Step 1 − Simplest protocol that does not have flow or error control.
Step 2 − It is a unidirectional protocol where data frames are traveling in one direction
that is from the sender to receiver.
Step 3 − Let us assume that the receiver can handle any frame it receives with a
processing time that is small enough to be negligible, 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.

Stop-and-Wait Protocol
Step 1 − If the data frames that arrive at the receiver side are faster than they can be
processed, the frames must be stored until their use.
Step 2 − Generally, the receiver does not have enough storage space, especially if it is
receiving data from many sources. This may result in either discarding of frames or
denial of service.
Step 3 − To prevent the receiver from becoming overwhelmed with frames, the sender
must slow down. There must be ACK from the receiver to the sender.
Step 4 − In this protocol the sender sends one frame, stops until it receives
confirmation from the receiver, and then sends the next frame.
Step 5 − We still have unidirectional communication for data frames, but auxiliary ACK
frames travel from the other direction. We add flow control to the previous protocol.

Noisy Channels
There are three types of requests for the noisy channels, which are as follows −

 Stop & wait Automatic Repeat Request.


 Go-Back-N Automatic Repeat Request.
 Selective Repeat Automatic Repeat Request.
Noiseless channels are generally non-existent channels. We can ignore the error or we
need to add error control to our protocols.

Stop and Wait Automatic Repeat Request


Step 1 − In a noisy channel, if a frame is damaged during transmission, the receiver
will detect with the help of the checksum.
Step 2 − If a damaged frame is received, it will be discarded, and the transmitter will
retransmit the same frame after receiving a proper acknowledgement.
Step 3 − If the acknowledgement frame gets lost and the data link layer on 'A'
eventually times out. Not having received an ACK, it assumes that its data frame was
lost or damaged and sends the frame containing packet 1 again. This duplicate frame
also arrives at the data link layer on 'B', thus part of the file will be duplicated and
protocol is said to be failed.
Step 4 − To solve this problem, assign a sequence number in the header of the
message.
Step 5 − The receiver checks the sequence number to determine if the message is a
duplicate since only the message is transmitted at any time.
Step 6 − The sending and receiving station needs only a 1-bit alternating sequence of
'0' or '1' to maintain the relationship of the transmitted message and its ACK/ NAK.
Step 7 − A modulo-2 numbering scheme is used where the frames are alternatively
labelled with '0' or '1' and positive acknowledgements are of the form ACK 0 and ACK
1.
Normal operation of Stop & Wait ARQ is given below −
Stop & Wait ARQ with Lost frame is as follows −

Go-Back-N ARQ
To improve the transmission efficiency, we need more than one frame to be
outstanding to keep the channel busy while the sender is waiting for acknowledgement.
There are two protocols developed for achieving this goal and they are as follows −

 Go – Back - N – Automatic – Repeat Request


 Sliding window protocol
Go-Back-N ARQ
Step 1 − In this protocol we can send several frames before receiving
acknowledgements.
Step 2 − we keep a copy of these frames until the acknowledgment arrives.
Step 3 − Frames from a sending station are numbered sequentially. However, we need
to include the sequence number of each frame in the header; we need to set a limit.
Step 4 − If the header of the frame allows m bits for the sequence number, the
sequence numbers range from 0 to 2m-1. We can also repeat the sequence numbers.

Example
For m = 2, the range of sequence numbers is: 0 to 3, i.e.
0,1,2,3, 0,1,2,3,…
The Go-Back-N ARQ is shown below in diagram format −

Example
Given below is an example problem on noiseless and noisy channel
Problem − Consider a binary signal sent over 4 KHZ wide channel, find out the
maximum data rate for noiseless and a noisy channel whose signal to noise ratio is
20dB.

Solution
Maximum Data Rate for noiseless = 2 * Bandwidth * log2(2)
=> 2 * 4khz * log2(2)
= 2*4000
= 8000 bps
Maximum Data Rate for noisy = Channel Capacity * log2(1 + SNR)
= 4000 * log2(1 + 20)
= 4000 * 4.39 = 17569.269 bps
High-level Data Link Control (HDLC)
Computer EngineeringComputer NetworkMCA

High-level Data Link Control (HDLC) is a group of communication protocols of the data
link layer for transmitting data between network points or nodes. Since it is a data link
protocol, data is organized into frames. A frame is transmitted via the network to the
destination that verifies its successful arrival. It is a bit - oriented protocol that is
applicable for both point - to - point and multipoint communications.

Transfer Modes
HDLC supports two types of transfer modes, normal response mode and asynchronous
balanced mode.
 Normal Response Mode (NRM) − Here, two types of stations are there, a
primary station that send commands and secondary station that can respond to
received commands. It is used for both point - to - point and multipoint
communications.

 Asynchronous Balanced Mode (ABM) − Here, the configuration is balanced,


i.e. each station can both send commands and respond to commands. It is used
for only point - to - point communications.
HDLC Frame
HDLC is a bit - oriented protocol where each frame contains up to six fields. The
structure varies according to the type of frame. The fields of a HDLC frame are −
 Flag − It is an 8-bit sequence that marks the beginning and the end of the frame.
The bit pattern of the flag is 01111110.
 Address − It contains the address of the receiver. If the frame is sent by the
primary station, it contains the address(es) of the secondary station(s). If it is sent
by the secondary station, it contains the address of the primary station. The
address field may be from 1 byte to several bytes.
 Control − It is 1 or 2 bytes containing flow and error control information.
 Payload − This carries the data from the network layer. Its length may vary from
one network to another.
 FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The
standard code used is CRC (cyclic redundancy code)

Types of HDLC Frames


There are three types of HDLC frames. The type of frame is determined by the control
field of the frame −
 I-frame − I-frames or Information frames carry user data from the network layer.
They also include flow and error control information that is piggybacked on user
data. The first bit of control field of I-frame is 0.
 S-frame − S-frames or Supervisory frames do not contain information field. They
are used for flow and error control when piggybacking is not required. The first
two bits of control field of S-frame is 10.
 U-frame − U-frames or Un-numbered frames are used for myriad miscellaneous
functions, like link management. It may contain an information field, if required.
The first two bits of control field of U-frame is 11.
Multiple access protocol- ALOHA, CSMA,
CSMA/CA and CSMA/CD
Data Link Layer
The data link layer is used in a computer network to transmit the data
between two devices or nodes. It divides the layer into parts such as data
link control and the multiple access resolution/protocol. The upper
layer has the responsibility to flow control and the error control in the data
link layer, and hence it is termed as logical of data link control. Whereas
the lower sub-layer is used to handle and reduce the collision or multiple
access on a channel. Hence it is termed as media access control or the
multiple access resolutions.
287.9K

Exception Handling in Java - Javatpoint

Data Link Control


A data link control is a reliable channel for transmitting data over a
dedicated link using various techniques such as framing, error control and
flow control of data packets in the computer network.

What is a multiple access protocol?


When a sender and receiver have a dedicated link to transmit data packets,
the data link control is enough to handle the channel. Suppose there is no
dedicated path to communicate or transfer the data between two devices. In
that case, multiple stations access the channel and simultaneously transmits
the data over the channel. It may create collision and cross talk. Hence, the
multiple access protocol is required to reduce the collision and avoid
crosstalk between the channels.

For example, suppose that there is a classroom full of students. When a


teacher asks a question, all the students (small channels) in the class start
answering the question at the same time (transferring the data
simultaneously). All the students respond at the same time due to which
data is overlap or data lost. Therefore it is the responsibility of a teacher
(multiple access protocol) to manage the students and make them one
answer.

Following are the types of multiple access protocol that is subdivided into the
different process as:
A. Random Access Protocol
In this protocol, all the station has the equal priority to send the data over a
channel. In random access protocol, one or more stations cannot depend on
another station nor any station control another station. Depending on the
channel's state (idle or busy), each station transmits the data frame.
However, if more than one station sends the data over a channel, there may
be a collision or data conflict. Due to the collision, the data frame packets
may be lost or changed. And hence, it does not receive by the receiver end.

Following are the different methods of random-access protocols for


broadcasting frames on the channel.

o Aloha
o CSMA
o CSMA/CD
o CSMA/CA

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used in a
shared medium to transmit data. Using this method, any station can transmit
data across a network simultaneously when a data frameset is available for
transmission.
Aloha Rules

1. Any station can transmit data to a channel at any time.


2. It does not require any carrier sensing.
3. Collision and data frames may be lost during the transmission of data
through multiple stations.
4. Acknowledgment of the frames exists in Aloha. Hence, there is no collision
detection.
5. It requires retransmission of data after some random amount of time.

Pure Aloha

Whenever data is available for sending over a channel at stations, we use


Pure Aloha. In pure Aloha, when each station transmits data to a channel
without checking whether the channel is idle or not, the chances of collision
may occur, and the data frame can be lost. When any station transmits the
data frame to a channel, the pure Aloha waits for the receiver's
acknowledgment. If it does not acknowledge the receiver end within the
specified time, the station waits for a random amount of time, called the
backoff time (Tb). And the station may assume the frame has been lost or
destroyed. Therefore, it retransmits the frame until all the data are
successfully transmitted to the receiver.

1. The total vulnerable time of pure Aloha is 2 * Tfr.


2. Maximum throughput occurs when G = 1/ 2 that is 18.4%.
3. Successful transmission of data frame is S = G * e ^ - 2 G.
As we can see in the figure above, there are four stations for accessing a
shared channel and transmitting data frames. Some frames collide because
most stations send their frames at the same time. Only two frames, frame
1.1 and frame 3.2, are successfully transmitted to the receiver end. At the
same time, other frames are lost or destroyed. Whenever two frames fall on
a shared channel simultaneously, collisions can occur, and both will suffer
damage. If the new frame's first bit enters the channel before finishing the
last bit of the second frame. Both frames are completely finished, and both
stations must retransmit the data frame.

Slotted Aloha

The slotted Aloha is designed to overcome the pure Aloha's efficiency


because pure Aloha has a very high possibility of frame hitting. In slotted
Aloha, the shared channel is divided into a fixed time interval called slots.
So that, if a station wants to send a frame to a shared channel, the frame
can only be sent at the beginning of the slot, and only one frame is allowed
to be sent to each slot. And if the stations are unable to send data to the
beginning of the slot, the station will have to wait until the beginning of the
slot for the next time. However, the possibility of a collision remains when
trying to send a frame at the beginning of two or more station time slot.

1. Maximum throughput occurs in the slotted Aloha when G = 1 that is 37%.


2. The probability of successfully transmitting the data frame in the slotted
Aloha is S = G * e ^ - 2 G.
3. The total vulnerable time required in slotted Aloha is Tfr.

CSMA (Carrier Sense Multiple Access)

It is a carrier sense multiple access based on media access protocol to


sense the traffic on a channel (idle or busy) before transmitting the data. It
means that if the channel is idle, the station can send data to the channel.
Otherwise, it must wait until the channel becomes idle. Hence, it reduces the
chances of a collision on a transmission medium.

CSMA Access Modes

1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first
sense the shared channel and if the channel is idle, it immediately sends the
data. Else it must wait and keep track of the status of the channel to be idle
and broadcast the frame unconditionally as soon as the channel is idle.

Non-Persistent: It is the access mode of CSMA that defines before


transmitting the data, each node must sense the channel, and if the channel
is inactive, it immediately sends the data. Otherwise, the station must wait
for a random time (not continuously), and when the channel is found to be
idle, it transmits the frames.
P-Persistent: It is the combination of 1-Persistent and Non-persistent
modes. The P-Persistent mode defines that each node senses the channel,
and if the channel is inactive, it sends a frame with a P probability. If the
data is not transmitted, it waits for a (q = 1-p probability) random time
and resumes the frame with the next time slot.

O- Persistent: It is an O-persistent method that defines the superiority of


the station before the transmission of the frame on the shared channel. If it
is found that the channel is inactive, each station waits for its turn to
retransmit the data.

CSMA/ CD
It is a carrier sense multiple access/ collision detection network
protocol to transmit data frames. The CSMA/CD protocol works with a
medium access control layer. Therefore, it first senses the shared channel
before broadcasting the frames, and if the channel is idle, it transmits a
frame to check whether the transmission was successful. If the frame is
successfully received, the station sends another frame. If any collision is
detected in the CSMA/CD, the station sends a jam/ stop signal to the shared
channel to terminate data transmission. After that, it waits for a random time
before sending a frame to a channel.

CSMA/ CA

It is a carrier sense multiple access/collision avoidance network


protocol for carrier transmission of data frames. It is a protocol that works
with a medium access control layer. When a data frame is sent to a channel,
it receives an acknowledgment to check whether the channel is clear. If the
station receives only a single (own) acknowledgments, that means the data
frame has been successfully transmitted to the receiver. But if it gets two
signals (its own and one more in which the collision of frames), a collision of
the frame occurs in the shared channel. Detects the collision of the frame
when a sender receives an acknowledgment signal.

Following are the methods used in the CSMA/ CA to avoid the collision:

Interframe space: In this method, the station waits for the channel to
become idle, and if it gets the channel is idle, it does not immediately send
the data. Instead of this, it waits for some time, and this time period is called
the Interframe space or IFS. However, the IFS time is often used to define
the priority of the station.

Contention window: In the Contention window, the total time is divided


into different slots. When the station/ sender is ready to transmit the data
frame, it chooses a random slot number of slots as wait time. If the channel
is still busy, it does not restart the entire process, except that it restarts the
timer only to send data packets when the channel is inactive.

Acknowledgment: In the acknowledgment method, the sender station


sends the data frame to the shared channel if the acknowledgment is not
received ahead of time.

B. Controlled Access Protocol


It is a method of reducing data frame collision on a shared channel. In the
controlled access method, each station interacts and decides to send a data
frame by a particular station approved by all other stations. It means that a
single station cannot send the data frames unless all other stations are not
approved. It has three types of controlled access: Reservation, Polling,
and Token Passing.

C. Channelization Protocols
It is a channelization protocol that allows the total usable bandwidth in a
shared channel to be shared across multiple stations based on their time,
distance and codes. It can access all the stations at the same time to send
the data frames to the channel.

Following are the various methods to access the channel based on their
time, distance and codes:

1. FDMA (Frequency Division Multiple Access)


2. TDMA (Time Division Multiple Access)
3. CDMA (Code Division Multiple Access)

FDMA

It is a frequency division multiple access (FDMA) method used to divide the


available bandwidth into equal bands so that multiple users can send data
through a different frequency to the subchannel. Each station is reserved
with a particular band to prevent the crosstalk between the channels and
interferences of stations.
TDMA

Time Division Multiple Access (TDMA) is a channel access method. It allows


the same frequency bandwidth to be shared across multiple stations. And to
avoid collisions in the shared channel, it divides the channel into different
frequency slots that allocate stations to transmit the data frames. The
same frequency bandwidth into the shared channel by dividing the signal
into various time slots to transmit it. However, TDMA has an overhead of
synchronization that specifies each station's time slot by adding
synchronization bits to each slot.

CDMA

The code division multiple access (CDMA) is a channel access method. In


CDMA, all stations can simultaneously send the data over the same channel.
It means that it allows each station to transmit the data frames with full
frequency on the shared channel at all times. It does not require the division
of bandwidth on a shared channel based on time slots. If multiple stations
send data to a channel simultaneously, their data frames are separated by a
unique code sequence. Each station has a different unique code for
transmitting the data over a shared channel. For example, there are multiple
users in a room that are continuously speaking. Data is received by the users
if only two-person interact with each other using the same language.
Similarly, in the network, if different stations communicate with each other
simultaneously with different code language.

The 802.11 MAC Sublayer Protocol

IEEE 802.11 standard, popularly known as WiFi, lays down the architecture and
specifications of wireless LANs (WLANs). WiFi or WLAN uses high frequency radio
waves instead of cables for connecting the devices in LAN. Users connected by
WLANs can move around within the area of network coverage.
The 802.11 MAC sublayer provides an abstraction of the physical layer to the logical
link control sublayer and upper layers of the OSI network. It is responsible for
encapsulating frames and describing frame formats.

MAC Sublayer frame of IEEE 802.11


The main fields of a frame of wireless LANs as laid down by IEEE 802.11 are −

 Frame Control − It is a 2 bytes starting field composed of 11 subfields. It contains


control information of the frame.
 Duration − It is a 2-byte field that specifies the time period for which the frame and its
acknowledgement occupy the channel.
 Address fields − There are three 6-byte address fields containing addresses of source,
immediate destination and final endpoint respectively.
 Sequence − It a 2 bytes field that stores the frame numbers.
 Data − This is a variable sized field carries the data from the upper layers. The maximum
size of data field is 2312 bytes.
 Check Sequence − It is a 4-byte field containing error detection information.
Avoidance of Collisions by 802.11 MAC Sublayer
In wireless systems, the method of collision detection does not work. It uses a protocol
called carrier sense multiple access with collision avoidance (CSMA/CA).
The method of CSMA/CA is −

 When a frame is ready, the transmitting station checks whether the channel is idle or
busy.
 If the channel is busy, the station waits until the channel becomes idle.
 If the channel is idle, the station waits for an Inter-frame gap (IFG) amount of time and
then sends the frame.
 After sending the frame, it sets a timer.
 The station then waits for acknowledgement from the receiver. If it receives the
acknowledgement before expiry of timer, it marks a successful transmission.
 Otherwise, it waits for a back-off time period and restarts the algorithm.
Co-ordination Functions in 802.11 MAC Sublayer
IEEE 802.11 MAC Sublayer uses two co-ordination functions for collision avoidance
before transmission −

 Distributed Coordination Function (DCF) −


o It is a mandatory function used in CSMA/CA.
o It is used in distributed contention-based channel access.
o It is deployed in both Infrastructure BSS (basic service set) as well as
Independent BSS.
 Point Coordination Function (PCF) −
o It is an optional function used by 802.11 MAC Sublayer.
o It is used in centralized contention-free channel access.
o It is deployed in Infrastructure BSS only.

You might also like