CN-UNIT-2 - Data Link Layer
CN-UNIT-2 - Data Link Layer
Syllabus Syllabus
The Data Link Layer:
● The Media Access Sub Layer
● Design issues
● Error detection and correction ○ Channel allocation problem
● In the OSI model, the data link layer is a 6th layer from the top and 2nd layer from the
bottom.
● The data link layer is responsible for maintaining the data link between two hosts or nodes.
● The main functions and the design issues of this layer are
● The data link layer uses the services offered by the physical layer.
● The primary function of this layer is to provide a well defined service interface to network
Framing
B SAI BABA,VIT,BVRM
● To provide service to the network layer, the data link layer must use the service provided to it
● What the physical layer does is accept a raw bit stream and attempt to deliver it to the
destination.
● Physical layers only just accept and transfer stream of bits without any regard to meaning or
structure. Therefore it is up to data link layer to simply develop and recognize frame
boundaries.
● Framing purpose is to divide the stream of data from the network layer into manageable
● The data link layer encapsulates Network Layer Packets into Frames by adding header and
trailer information.
B SAI BABA,VIT,BVRM
1. Frame Header: It contains the source and the destination addresses of the frame and
the control bytes.
3. Trailer: It contains the error detection and error correction bits. It is also called a
Frame Check Sequence (FCS)
B SAI BABA,VIT,BVRM
Framing Methods
1. Byte count
2. Flag bytes with byte stuffing
3. Flag bits with bit stuffing
B SAI BABA,VIT,BVRM
1. Byte count
● This method is rarely used and is generally required to count total number of Bytes that are
● Byte count method ensures data link layer at the receiver about total number of Bytes that
: Without errors:
B SAI BABA,VIT,BVRM
1. Byte count:
: With errors:
● There is disadvantage also of using this method i.e., if anyhow Byte count is disturbed or
distorted by an error occurring during transmission, then destination or receiver might lose
synchronization.
● The destination or receiver might also be not able to locate or identify beginning of next
frame.
B SAI BABA,VIT,BVRM
● Often the same byte, called a flag byte, is used as both the starting and ending delimiter.
● Two consecutive flag bytes indicate the end of one frame and the start of the next. Thus, if
the receiver ever loses synchronization it can just search for two flag bytes to find the end
● It may happen that the flag byte occurs in the data .One way to solve this problem is to
have the sender’s data link layer insert a special escape byte (ESC) just before each
● Thus, a framing flag byte can be distinguished from one in the data by the absence or
● The data link layer on the receiving end removes the escape bytes before giving the data to
● It was developed for the once very popular HDLC (Highlevel Data Link Control) protocol.
● Each frame begins and ends with a special bit pattern, 01111110
01111110 01111110
● Whenever the sender’s data link layer encounters five consecutive 1s in the data, it
● When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it
automatically destuffs (i.e., deletes) the 0 bit.
● Just as byte stuffing is completely transparent to the network layer in both computers, so is
bit stuffing.
● If the user data contain the flag pattern, 01111110, this flag is transmitted as 011111010 but
stored in the receiver’s memory as 01111110. Figure 3-5 gives an example of bit stuffing.
B SAI BABA,VIT,BVRM
● In the data link layer of the network protocol stack, addressing is used to identify network
nodes (devices) within a local network or a LAN (Local Area Network).
● There are two main types of a the data link layer:
■ Media Access Control (MAC) Layer
■ Logical Link Control (LLC) Layer
Switch
B SAI BABA,VIT,BVRM
the factory.
● They consist of 6 bytes (48 bits) and are usually represented in 12-digit hexadecimal
● MAC addresses are globally unique, allowing each network device to have a unique
identifier.
● The source and destination MAC addresses are included in the frame header of data
Error Control
● The data link layer ensures error free link for data transmission. The issues it caters to with
Flow Control
● The data link layer regulates flow control so that a fast sender does not drown a slow
receiver.
● When the sender sends frames at very high speeds, a slow receiver may not be able to
handle it. There will be frame losses even if the transmission is error-free.
● Error is a condition when the receiver’s information does not match the sender’s
information.
● During transmission, digital signals suffer from noise that can introduce errors in the
binary bits traveling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit
may change to 0.
● Data (Implemented either at the Data link layer or Transport Layer of the OSI Model) may
get scrambled by noise or get corrupted whenever a message is transmitted.
● To prevent such errors, error-detection codes are added as extra data to digital messages.
● This helps in detecting any errors that may have occurred during message transmission.
● Types of Errors
○ Single Bit Error
○ Multiple Bit Error
○ Burst Error
B SAI BABA,VIT,BVRM
● A single-bit error refers to a type of data transmission error that occurs when one bit (i.e., a
single binary digit) of a transmitted data unit is altered during transmission, resulting in an
Multiple-Bit Error
● A multiple-bit error is an error type that arises when more than one bit in a data
transmission is affected.
● Although multiple-bit errors are relatively rare when compared to single-bit errors, they
can still occur, particularly in high-noise or high-interference digital environments.
B SAI BABA,VIT,BVRM
Burst Error
● More than one consecutive bit is corrupted in the received frame.
B SAI BABA,VIT,BVRM
Error Control
● Error control can be done in two ways
○ Error detection − Error detection involves checking whether any error has occurred or
not. The number of error bits and the type of error does not matter.
○ Error correction − Error correction involves ascertaining the exact number of bits that
has been corrupted and the location of the corrupted bits.
Disadvantage:
● Only single-bit error is detected by this method, it fails in multi-bit error detection .
● It can not detect an error in case of an error in two bits.
● For each column, parity check bits are computed and transmitted together with the data.
● These are compared with the parity bits calculated on the received data at the receiving end.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
2. Checksum:
Checksum is a error detection which detects the error by dividing the data into the segments of equal
size and then use 1's complement to find the sum of the segments and then sum is transmitted with
the data to the receiver and same process is done by the receiver and at the receiver side, all zeros in
the sum indicates the correctness of the data.
➔ First of all data is divided into k segments in a checksum error detection scheme and each
segment has m bits.
➔ For finding out the sum at the sender’s side, all segments are added through 1's complement
arithmetic. And for determining the checksum we complement the sum.
➔ Along with data segments, the checksum segments are also transferred.
➔ All the segments that are received on the receiver's side are added through 1’s complement
arithmetic to determine the sum. Then complement the sum also.
➔ The received data is accepted only on the condition that the result is found to be 0. And if the
result is not 0 then it will be discarded.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
11011010
Check Sum
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
Sum = ? Sum = ?
CheckSum = ? CheckSum = ?
B SAI BABA,VIT,BVRM
3. Cyclic Redundancy Checks (CRCs) or polynomial code:
● Unlike the checksum scheme, which is based on addition, CRC is based on binary division.
● In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the
end of the data unit so that the resulting data unit becomes exactly divisible by a second,
predetermined binary number.
● The sender divides the bits that are being transferred and calculates the remainder.
● The sender inserts the remainder at the end of the original bits before sending the actual
bits.
● A codeword is made up of the actual data bits plus the remainder. The transmitter sends data
bits in the form of codewords.
● The receiver, on the other hand, divides the codewords using the same CRC divisor.
● If the remainder consists entirely of zeros, the data bits are validated; otherwise, it is assumed
that some data corruption happened during transmission.
B SAI BABA,VIT,BVRM
Eg:
A bit stream 1010000 is transmitted using the standard CRC
method. The generator polynomial is x^3+1. What is the actual
bit string transmitted? Conclude whether the receiver receive
original message or error message.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
Examples:
1. A bit stream 1101011011 is transmitted using the standard CRC method. The generator
polynomial is x4+x+1. What is the actual bit string transmitted?
Examples:
1. A bit stream 1101011011 is transmitted using the standard CRC method. The generator
polynomial is x4+x+1. What is the actual bit string transmitted?
Solution:
★ Hamming codes
★ Binary convolutional codes
★ Reed-Solomon codes
★ Low-Density Parity Check codes
B SAI BABA,VIT,BVRM
★ Error Correction codes are used to detect and correct errors that occur during data
transmission from the transmitter to the receiver.
★ There are two approaches to error correction:
1. Backward Error Correction:
When a backward mistake is detected, the receiver requests that the sender retransmit the
complete data unit.
2. Forward Error Correction:
In this scenario, the error-correcting code is used by the receiver, which automatically corrects
the mistakes.
★ A single extra bit can identify but not correct the errors.
★ To correct the mistakes, the specific location of the error must be known.
★ If we wish to compute a single-bit mistake, for example, the error correcting algorithm will
identify which one of seven bits is incorrect. We will need to add some more redundant bits to
do this.
★ The number of redundant bits is calculated using the following formula:
★ The above formula is used to compute the value of r. For example, if the value of d is 4, the
least possible number that fulfils the above relation is 3.
B SAI BABA,VIT,BVRM
Hamming codes
★ It is a block code that is capable of detecting up to two simultaneous bit errors and
correcting single-bit errors.
★ Parity bits: A bit that is added to the original binary data to make sure the total number of
1s is even or odd (in case of even or odd parity respectively).
○ Even parity: To check for even parity, if the total number of 1s is even, the parity bit
value is 0. If the total number of occurrences of 1s is odd, the parity bit value is 1.
○ Odd Parity: To test for odd parity, if the total number of 1s is even, the parity bit value
is 1. If the total number of 1s is odd, the parity bit value is 0.
B SAI BABA,VIT,BVRM
Hamming codes
Algorithm of Hamming code:
1. An information of 'd' bits are added to the redundant bits 'r' to form d+r.
2. The location of each of the (d+r) digits is assigned a decimal value.
3. The 'r' bits are placed in the positions 1,2,.....2k-1.
4. At the receiving end, the parity bits are recalculated. The decimal value of the parity bits
determines the position of an error.
● 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.
B SAI BABA,VIT,BVRM
● 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.
B SAI BABA,VIT,BVRM
● 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:
B SAI BABA,VIT,BVRM
Flow Control
Flow control
What is Protocol?
★ In computer networks, a protocol refers to a set of rules and procedures that govern the
communication and interaction between devices or systems.
★ It defines how data is transmitted, formatted, addressed, routed, and processed in a network.
★ Protocols ensure that devices can understand and interpret the information exchanged,
allowing for reliable and standardized communication.
Sliding
Window
Protocol
B SAI BABA,VIT,BVRM
Sender: Receiver:
● The sender sends a frame to the receiver. ● The receiver receives a frame from the
After sending the frame, it starts a timer. sender.
● If the sender receives an acknowledgment ● If the frame contains errors or is damaged,
(ACK) from the receiver within the timeout the receiver discards the frame and does not
period, it assumes that the frame was send an ACK.
● If the frame is error-free and successfully
successfully received and proceeds to send
received, the receiver sends an ACK back to
the next frame. the sender indicating successful reception.
● If the timer expires before receiving the ● The receiver waits for the sender to
ACK, the sender assumes that the frame was retransmit the frame if it does not receive a
lost or damaged and retransmits the same valid frame.
frame.
B SAI BABA,VIT,BVRM
● Stop and wait ARQ = Stop and wait + Timeout Timer + Sequence NUmber
B SAI BABA,VIT,BVRM
[1] The Ack is received before the timer Expires [2] The Ack is lost
B SAI BABA,VIT,BVRM
All possible scenarios of this protocol are explain under
★ Go-Back-N ARQ
★ Selective Repeat ARQ
B SAI BABA,VIT,BVRM
★ Receiver:
○ The receiver maintains a corresponding "window" that represents the range of acceptable
sequence numbers for the frames it expects to receive.
○ The receiver acknowledges the frames it successfully receives, indicating the next expected
sequence number.
○ If a frame is received out of order or contains errors, the receiver discards the frame and does not
send an acknowledgment.
○ The receiver can accept frames within its window and slides the window forward as it receives
valid frames.
B SAI BABA,VIT,BVRM
Example :
For example, suppose there are 11 frames required transmitting and sender window size is 4
then the sequence number will be 0,1,2,3, 0,1,2,3, 0, 1 and 2.
Step 1: 11 frames (0-10), window size, sender and receiver are shown below
B SAI BABA,VIT,BVRM
Step 2:After sending all frames equal to window size, Sender wait for ACK from receiver of
first frame (i.e. 0).
B SAI BABA,VIT,BVRM
Step 3:After receiving the ACK the Sliding window moves one position next and transmit
frame 4 and frame No.4 is transmitted.
B SAI BABA,VIT,BVRM
Step 4:After transmission of frame No.4, Sender waits for ACK from receiver of Second
frame (i.e. 1).
B SAI BABA,VIT,BVRM
Step 5:After receiving ACK for Frame No.1 Sender transmit the Next frame No.5 by moving
the sliding window one position next and so on.
B SAI BABA,VIT,BVRM
★ Go-Back-N ARQ
★ Selective Repeat ARQ
B SAI BABA,VIT,BVRM
Go-Back-N ARQ
● In Go-Back-N ARQ, N is the sender's window size. Suppose we say that Go-Back-3,
which means that the three frames can be sent at a time before expecting the
acknowledgment from the receiver.
● It uses the principle of protocol pipelining in which the multiple frames can be sent before
receiving the acknowledgment of the first frame. If we have five frames and the concept is
Go-Back-3, which means that the three frames can be sent, i.e., frame no 1, frame no 2,
frame no 3 can be sent before expecting the acknowledgment of frame no 1.
● In Go-Back-N ARQ, the frames are numbered sequentially as Go-Back-N ARQ sends the
multiple frames at a time that requires the numbering approach to distinguish the frame
from another frame, and these numbers are known as the sequential numbers.
B SAI BABA,VIT,BVRM
● The number of frames that can be sent at a time totally depends on the size of the sender's
window.
● So, we can say that 'N' is the number of frames that can be sent at a time before receiving
● If the acknowledgment of a frame is not received within an agreed-upon time period, then
○ Suppose we have sent the frame no 5, but we didn't receive the acknowledgment of
frame no 5, and the current window is holding three frames, then these three frames
will be retransmitted.
B SAI BABA,VIT,BVRM
Working of Go-Back-N ARQ
Example : For example, suppose there are 11 frames required transmitting and sender
window size is 4
Step 1: Step 1: Firstly, the sender will send the first four frames to the receiver, i.e., 0,1,2,3,
and now the sender is expected to receive the acknowledgment of the 0th frame.
B SAI BABA,VIT,BVRM
Working of Go-Back-N ARQ
Step 2: Let's assume that the receiver has sent the acknowledgment for the 0 frame, and the
receiver has successfully received it.
B SAI BABA,VIT,BVRM
Working of Go-Back-N ARQ
Step 3: The sender will then send the next frame, i.e., 4, and the window slides containing
four frames (1,2,3,4).
B SAI BABA,VIT,BVRM
Working of Go-Back-N ARQ
Step 4: The receiver will then send the acknowledgment for the frame no 1. After receiving
the acknowledgment, the sender will send the next frame, i.e., frame no 5, and the window
will slide having four frames (2,3,4,5).
B SAI BABA,VIT,BVRM
Step 5: Now, let's assume that the receiver is not acknowledging the frame no 2, either the
frame is lost, or the acknowledgment is lost. Instead of sending the frame no 6, the sender
Go-Back to 2, which is the first frame of the current window, retransmits all the frames in the
current window, i.e., 2,3,4,5.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
● In selective repeat, both the sender and receiver maintain a window. The sender can transmit
multiple packets within the window, and the receiver acknowledges each correctly received
packet.
● If the sender does not receive an acknowledgment for a specific packet within a
timeout period, it retransmits only that packet, instead of retransmitting the entire
window.
Step 1: Step 1: Firstly, the sender will send the first four frames to the receiver, i.e., 0,1,2,3, and now
the sender is expected to receive the acknowledgment of the 0th frame.
B SAI BABA,VIT,BVRM
Step 2: Let's assume that the receiver has sent the acknowledgment for the 0 frame, and the receiver
has successfully received it.
B SAI BABA,VIT,BVRM
Step 3: The sender will then send the next frame, i.e., 4, and the window slides containing four
frames (1,2,3,4).
B SAI BABA,VIT,BVRM
Step 4: The receiver will then send the acknowledgment for the frame no 1. After receiving the
acknowledgment, the sender will send the next frame, i.e., frame no 5, and the window will slide
having four frames (2,3,4,5).
B SAI BABA,VIT,BVRM
Step 5: Now, let's assume that the receiver is not acknowledging the frame no 2, either the frame is
lost, or the acknowledgment is lost. In Selective Repeat ARQ only the lost or error frames are
retransmitted, whereas correct frames are received and buffered.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
Sender will retransmit frame 2 alone and as usual other frames are transmitted.
B SAI BABA,VIT,BVRM
If it has a high error rate,it wastes a lot of There is a loss of low bandwidth.
bandwidth.
It does not require sorting. In this, sorting is done to get the frames in the correct order.
Outcomes:
● Importance of HDLC.
S-Frame In the control field if the first bit is 10 Used for Error Control and Flow Control
U-Frame In the control field if the first bit is 11 Used for Link Management
B SAI BABA,VIT,BVRM
I. In the Internet, the data link layer is responsible for the reliable transmission of data over a
physical network link.
II. It sits above the physical layer and below the network layer in the networking protocol stack.
While the Internet Protocol (IP) primarily operates at the network layer, the data link layer is
essential for the proper functioning of IP-based communication.
III. The data link layer in the Internet encompasses various protocols and technologies, including:
A. Ethernet: Ethernet is the most commonly used technology at the data link layer in local
area networks (LANs). It defines the standards for wired communication, specifying the
physical and data link layer protocols for transmitting data between devices connected to
the same LAN.
B. Wi-Fi (Wireless LAN): Wi-Fi is a wireless data link layer technology that enables
devices to connect to a network wirelessly. It uses protocols such as IEEE 802.11 to
establish wireless connections and handle data transmission over the air.
B SAI BABA,VIT,BVRM
C. Point-to-Point Protocol (PPP): PPP is a data link layer protocol used for establishing direct
point-to-point connections over various physical links, including dial-up connections and dedicated
serial links. It provides authentication, error detection, and framing capabilities.
D. Asynchronous Transfer Mode (ATM): Although less commonly used in modern networks,
ATM was a data link layer technology that provided high-speed transmission of fixed-size cells. It
was used in wide area networks (WANs) and for certain specialized applications.
E. MPLS (Multi-Protocol Label Switching): MPLS is a protocol that operates at both the network
and data link layers. It adds a label to IP packets at the data link layer, allowing routers to make
forwarding decisions based on the label rather than examining the entire IP header.
B SAI BABA,VIT,BVRM
Syllabus
● Channel allocation is a process in which a single channel is divided and allotted to multiple
users in order to carry user specific tasks.
● There are user’s quantity may vary every time the process takes place.
● If there are N number of users and channel is divided into N equal-sized sub channels, Each
user is assigned one portion.
● If the number of users are small and don’t vary at times, then Frequency Division Multiplexing
can be used as it is a simple and efficient channel bandwidth allocating technique.
● Solved by two schemes:
.
B SAI BABA,VIT,BVRM
● The Data Link Layer is responsible for transmission of data between two nodes. Its main
functions are-
Analogy:
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
Example:
● [1] For example, in a classroom full of students, when a teacher asks a question and
all the students (or stations) start answering simultaneously (send data at same time)
then a lot of chaos is created( data overlap or data lost) then it is the job of the
teacher (multiple access protocols) to manage the students and make them answer
one at a time.
● [2] A Real-time example of a Medium Access Control (MAC) protocol is the Wi-Fi
protocol (IEEE 802.11 standard). Wi-Fi is a widely used wireless communication
technology that allows devices to connect to the internet or a local network. Within
the Wi-Fi protocol, the MAC layer is responsible for controlling access to the shared
wireless medium.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
ALOHA
B SAI BABA,VIT,BVRM
PURE ALOHA
● Pure Aloha allows stations to transmit whenever they have data to be sent.
● In pure Aloha, when each station transmits data to a channel without checking whether
the channel is idle or busy, 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.
● Since different stations wait for different amount of time, the probability of further collision
decreases.
● The throughput of pure aloha is maximized when frames are of uniform length.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
● Whenever two frames try to occupy the channel at the same time, there will be a collision and
both will be garbled.
● If the first bit of a new frame overlaps with just the last bit of a frame almost finished, both
frames will be totally destroyed and both will have to be retransmitted later.
B SAI BABA,VIT,BVRM
● The time required to send a frame is called Frame Transmission Time( Tfr ).
● Vulnerable time (the length of time in which there is a possibility of collision) for pure
ALOHA is:
Where G is the average number of transmission attempts per unit of time and e is the mathematical
constant approximately equal to 2.71828. The maximum throughput occurs when G = 0.5,
SLOTTED ALOHA
● Slotted ALOHA is an improvement over ALOHA and Pure ALOHA, introducing a
● Devices are allowed to transmit only at the beginning of each time slot.
● If a collision occurs, the devices involved wait for the next time slot to retransmit.
● If a station misses out the allowed time, it must wait for the next slot, This reduces the
probability of collision.
B SAI BABA,VIT,BVRM
Slotted Aloha
B SAI BABA,VIT,BVRM
Vulnerable Time
CSMA
B SAI BABA,VIT,BVRM
Types of CSMA
B SAI BABA,VIT,BVRM
1-Persistent CSMA
● In this, if the station wants to transmit the
data. Then the station first senses the
medium.
● If the medium is busy then the station waits
until the channel becomes idle. And the
station continuously senses the channel
until the medium becomes idle.
● If the station detected the channel as idle then
the station will immediately send the data
frame with 1 probability that’s why the name
of this method is 1-persistent.
● Refer to the below image to show the flow
diagram of the 1-persistent method of CSMA
B SAI BABA,VIT,BVRM
Problems :
● In this method there is a high possibility of collision as two or more station sense the channel
idle at the same time and transmits data simultaneously which may lead to a collision.
● In this method, once the station finds that the medium is idle then it immediately sends the
frame.
● By using this method there are higher chances for collision because it is possible that two or
more stations find the shared medium idle at the same time and then they send their frames
immediately.
B SAI BABA,VIT,BVRM
Non-Persistent CSMA
● If the station wants to transmit the data then
first of all it will sense the medium.
● If the medium is idle then the station will
immediately send the data.
● Otherwise, if the medium is busy then the
Busy
station waits for a random amount of time
and then again senses the channel after
waiting for a random amount of time.
● In Non-persistent there is less chance of
collision in comparison to the 1-persistent
method as this station will not continuously
sense the channel but the channel waiting for a
random amount of time.
B SAI BABA,VIT,BVRM
Advantage of non-persistent
● It reduces the chance of collision because the stations wait a random amount of time.
● It is unlikely that two or more stations will wait for same amount of time and will retransmit at
the same time.
Disadvantage of non-persistent
● It reduces the efficiency of network because the channel remains idle when there may be
stations with frames to send.
● This is due to the fact that the stations wait a random amount of time after the collision.
B SAI BABA,VIT,BVRM
P-Persistent
● It is the combination of 1-Persistent and Non-persistent modes.
● This method is used when channel has time slots such that the time slot duration is equal
to or greater than the maximum propagation delay time.
● Whenever a station becomes ready to send, it senses the channel.
● If channel is busy, station waits until next slot.
● If channel is idle, it transmits with a probability p.
● With the probability q=l-p, the station then waits for the beginning of the next time slot.
● If the next slot is also idle, it either transmits or waits again with probabilities p and q.
● This process is repeated till either frame has been transmitted or another station has
begun transmitting.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection.
It is a protocol used in Ethernet networks to control access to the shared transmission medium
and manage collisions when multiple devices attempt to transmit data simultaneously.
Carrier Sense:
Before a device starts transmitting data, it listens to the network to check if the medium is
idle. If it detects other devices transmitting, it waits for the network to become idle.
Multiple Access:
If the medium is idle, the device can start transmitting its data.
B SAI BABA,VIT,BVRM
Collision Detection:
★ Sender transmits its data on the link. CSMA/CD does not use an ‘acknowledgment’ system.
★ It checks for successful and unsuccessful transmissions through collision signals.
★ During transmission, if a collision signal is received by the node, transmission is stopped.
★ The station then transmits a jam signal onto the link and waits for random time intervals
before it re-sends the frame.
★ After some random time, it again attempts to transfer the data and repeats the above process.
★ The station’s hardware must listen to the channel while it is transmitting.
★ If the signal it reads back is different from the signal it is putting out, it knows that a
collision is occurring.
B SAI BABA,VIT,BVRM
attempting to retransmit the data. The random backoff helps to reduce the probability of another
collision. The device retransmits the data once the backoff time elapses and the medium is idle.
➔ CSMA/CD was widely used in early Ethernet networks based on coaxial or twisted-pair
cables.
➔ However, with the advent of faster Ethernet technologies and the prevalence of switched
networks, CSMA/CD has become less common.
B SAI BABA,VIT,BVRM
B SAI BABA,VIT,BVRM
★ CSMA/CD, as well as many other LAN protocols, uses the conceptual model of Fig. 4-5.
★ At the point marked t 0, a station has finished transmitting its frame.
★ Any other station having a frame to send may now attempt to do so. If two or more stations
decide to transmit simultaneously, there will be a collision.
★ If a station detects a collision, it aborts its transmission, waits a random period of time, and
then tries again (assuming that no other station has started transmitting in the meantime).
★ Therefore, our model for CSMA/CD will consist of alternating contention and transmission
periods, with idle periods occurring when all stations are quiet (e.g., for lack of work).
Contention Periods:
Contending devices (those wanting to transmit) use contention periods, These contention periods
are time intervals during which a device listens to the network to determine if it's clear for
transmission.
B SAI BABA,VIT,BVRM
➔ CSMA/CA stands for Carrier Sense Multiple Access with Collision Avoidance.
➔ It is a protocol used in wireless networks, particularly Wi-Fi networks, to manage access to
the shared wireless medium and prevent collisions.
➔ In wired networks, if a collision has occurred then the energy of the received signal almost
doubles, and the station can sense the possibility of collision.
➔ In the case of wireless networks, most of the energy is used for transmission, and the energy of
the received signal increases by only 5-10% if a collision occurs. It can’t be used by the station
to sense collision. Therefore CSMA/CA has been specially designed for wireless networks.
2. Collision Avoidance:
Rather than relying on collision detection, CSMA/CA uses a technique called collision avoidance.
The device sends a Request to Send (RTS) frame to the Wireless Access Point(WAP), indicating
its intention to transmit data. The RTS frame includes information about the duration of the
transmission.
3. Clear to Send (CTS): Upon receiving the RTS frame, the access point responds with a Clear to
Send (CTS) frame, granting permission to the device to transmit data. The CTS frame also
includes the duration of the transmission.
4.Transmission: Once the device receives the CTS frame, it can start transmitting its data. Other
devices within range of the access point listen to the CTS frame and defer their own transmissions
to avoid collisions.
B SAI BABA,VIT,BVRM