Computer Communication and Networking
Computer Communication and Networking
Networking
20CSE
DATALINK LAYER
ENGR.UNZELA TALPUR
[email protected]
The Data Link Layer (Layer 2) of the OSI model is divided into two sublayers:
1.Logical Link Control (LLC) Sublayer: This sublayer is responsible for error checking and flow control.
It ensures that data is reliably delivered between devices.
While transmitting data, if LLC detects any frame loss, immediately it sends back to the source to
transmit over again. The LLC layer comes above the MAC layer and acts as an interface between
the upper layers and the MAC layer.
2.Media Access Control (MAC) Sublayer: This sublayer is responsible for controlling how devices on the
network access the network medium and how data is placed on the medium
Multiple Access Control
• Multiple access protocols are a set of protocols operating in the
Medium Access Control sublayer (MAC sublayer) of the Open Systems
Interconnection (OSI) model.
• These protocols allow a number of nodes or users to access a shared
network channel.
• If there is a dedicated link between the sender and the receiver then
data link control layer is sufficient, however if there is no dedicated
link present then multiple stations can access the channel
simultaneously. Hence multiple access protocols are required to
decrease collision and avoid crosstalk
• 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 disturbance 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.
• Thus, protocols are required for sharing data on non dedicated
channels. Multiple access protocols can be subdivided further as –
Multiple Access protocols
Random Access Protocol
CSMA/CD is one such technique where different stations that follow this protocol agree on some
terms and collision detection measures for effective transmission. This protocol decides which
station will transmit when so that data reaches the destination without corruption
• Step 1: Check if the sender is ready for transmitting data packets.
• Step 2: Check if the transmission link is idle.
Sender has to keep on checking if the transmission link/medium is idle. For this, it continuously
senses transmissions from other nodes. Sender sends dummy data on the link. If it does not
receive any collision signal, this means the link is idle at the moment. If it senses that the carrier is
free and there are no collisions, it sends the data. Otherwise, it refrains from sending data.
• Step 3: Transmit the data & check for collisions.
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 resends the frame. After
some random time, it again attempts to transfer the data and repeats the above process.
• Step 4: If no collision was detected in propagation, the sender completes its frame transmission.
Collision detection in CSMA/CD involves the following
features:
• Carrier sense: Before transmitting data, a device listens to the network to check if the
transmission medium is free. If the medium is busy, the device waits until it becomes
free before transmitting data.
• Multiple Access: In a CSMA/CD network, multiple devices share the same
transmission medium. Each device has equal access to the medium, and any device
can transmit data when the medium is free.
• The collision detection technology detects collisions by sensing transmissions from
other stations. On detection of a collision, the station stops transmitting, sends a jam
signal, and then waits for a random time interval before retransmission.
• Backoff algorithm: In CSMA/CD, a backoff algorithm is used to determine when a
device can retransmit data after a collision. The algorithm uses a random delay before
a device retransmits data, to reduce the likelihood of another collision occurring.
Other scenario
CSMA/CA TASK