You are on page 1of 38

Media Access Methods

Media Access Methods


● Media Access Methods are set of rules governing
how the network nodes share transmission
medium.
○ For computers to share the same medium,
they should should ‘agree’ to a pair of
fundamental philosophies.
■ First Come, First Served
■ Token turns
○ These philosophies are the principles defining
the three most important types of media
access methods
Types of Media Access Methods
● Contention: The situation where two or more
nodes attempt to transmit a message across the
same wire at the same time:
○ CSMA/CD: A protocol used in Ethernet
networks to detect and handle collisions on a
network.
■ Cannot be used in WLAN because WLAN
cannot transmit and listen at the same
time.
○ CSMA/CA: A protocol for WLANs
■ Avoids collisions by explicit packet
acknowledgement
Types of Media Access Methods
● Token Passing: A special packet transfer method
used in token ring networks, that gives permission
to a device to transmit data on to the network.
○ A device receiving a token and transmit a
frame, the frame is forwarded around the ring
by all attached devices.
● Demand Priority: An access method used with
the new 100 Mbps 100 VG-Any LAN standard.
○ It differs from basic contention type because it
prioritizes packet based on data types in case
of contention.
Data Link Control

● Data Link COntrol: Are services that insures


reliable network data communication by
managing frame error detection and flow
control.
○ Handles the following tasks:
■ Framing
■ Reliable link packet transmission
■ Error detection and Correction
Framing
● A point to point connection between two devices
consists of a wire in which data is transmitted as a
stream of bits.
○ Data Link layer packs bits into frames so that each
frame is distinguishable from from another.
Parts of a Frame

● Frame Header: Contains source and


destination address of a frame.
● Payload field: Contains message to be
delivered.
● Trailer: Contains error detection and
correction bits.
Types of Framing
Two Types of Framing
● Fixed-sized framing: The size of frame is fixed and
so the length acts as delimiter of the frame.
○ Do not additional boundary bits to identify the
start and end of the frame.
● Variable-sized framing: The size of each frame to
be transmitted may be different.
○ Additional mechanisms are kept to mark the
end of one frame and the beginning of the
next frame.
Types of Variable-sized Framing
● Character Oriented Framing: data is transmitted
as a sequence of bytes, from an 8-bit coding
system like ASCII
● Bit Oriented Framing: data is transmitted as a
sequence of bits that can be interpreted in the
upper layers both as text as well as multimedia
data
Character Count (Oriented) Framing
● A framing method that uses a field in the header
to specify number of characters in the frame.
○ When the data link layer at the destination
sees the character count, it knows how many
characters follow and hence where the end of
the frame is.
Character Count (Oriented) Framing
● Character count framing use reserved characters
to indicate the start and end of frame.
○ Use two character sequence DLE STX to signal
the beginning of a frame, and DLE ETX to flag
the frame’s end.
● A problem with character count is that, a frame
delimiter being part of frame itself.
● To solve that, character(byte) stuffing can be
used.
Byte stuffing
● Byte (character) stuffing: A process of adding an
extra character to the data section of a frame
whenever character with the same pattern as the
flag appear as part of the frame.
○ Helps receiver to remove the stuffed byte and
treat the next character as data, not a flag.
Byte stuffing
Byte Stuffing and unstuffing
Bit Oriented Framing
● Bit Oriented Framing: A process of transmitting
data as sequence of bits that can be interpreted in
the upper layers as text as well as multimedia data.
● Bit frame has the following parts:
○ Frame Header: Contains source and destination
of frame
○ Payload field: Message to be transmitted
○ Trailer: Contains error detection and correction
bits
○ Flags: An 8-bit pattern with six or more
consecutive 1’s (eg 01111110)
Bit Stuffing
● In case a pattern similar to flag (01111110) appear
in the frame data section, the receiver can consider
it as flag and remove it from data section.
● To avoid that, a bit stuffing is implemented.
● Bit Stuffing: Mechanism of inserting one or more
non-information bits into a message to be
transmitted whenever a pattern similar to flag
appear in data frame section.
Bit Stuffing
Flow Control
● Specifies how much data the sender can transmit
before receiving permission or acknowledgement to
continue from the receiver.
○ Receivers have limited speed to process
incoming data.
○ Limited space to store incoming data
○ Receiving device must be able to inform sending
device before the limit is reached
Types of Flow Control
● Two types of Flow control
○ Stop and Wait
○ Sliding Window
Stop and Wait Protocol
● A sender sends one frame at a time, stops until it
receives the confirmation (acknowledgement)
from the receiver and then sends the next frame.
● Acknowledgement: A small control frame (header
only) that a protocol from receiver sends back to
the sender notifying the receipt of an earlier
frame.
How stop and wait works
Advantages and Disadvantages of Simplest
Advantage

● Each frame is checked and acknowledged before the


next frame is sent

Disadvantage

● Inefficient (Slow)
○ Each frame must travel all the way to the receiver
and an ACK must travel all the way back before the
next frame can be sent
○ If the distance between devices is long, the time
spent waiting for ACKs between each frame can be
significantly long
Sliding Window
● A sender can transmit several frames continuously
before need a ACK.
● If ACK received received by the sender before
continuous transmission is finished, sender can
transmit.
● An ACK can acknowledge the correct receipt of multiple
frames at a receiver (cumulative ACK)
○ Sender assigns a frame number to each frame
Sliding Window
Sliding Window
● Sender maintain three (3) state variables
○ Sender Window Size (SWS)
■ The size of the window the sender sent
○ Last ACK Received (LAR)
■ Frame number of the last acknowledgement
received
○ Last Frame Sent (LFS)
■ Frame number of the last frame sent

LSF -LAR <= SWS


Sliding Window
Sliding Window
Sliding Window
● Receiver maintain three (3) state variables
○ Receiver Window Size (RWS)
■ Upper bound on the number of out of order
frames that the receiver is willing to accept
○ Largest Acceptable Frame (LAF)
■ Frame number of the largest acceptable frame
○ Last Frame Received (LFR)
■ Frame number of the last frame received

LAF -LFR <= RWS


Sliding Window
Automatic Repeat Request (ARQ)
● Automatic Repeat Request: Retransmission of
of lost or damaged frame during transmission.
○ Retransmission occurs when:
■ When error occurs in a frame, by receiver
sending NAK explicitly to the sender
■ Sender’s timer expires.
● Timer: The expected delay for sender to receive
ACK for the frame.
Automatic Repeat Request (ARQ)
Stop and Wait ARQ
● An extension of Stop and Wait Protocol
● Receiver sends an ACK if frame is correctly
received.
○ Sender waits for an ACK before transmitting
the next frame.
● Retransmission
○ If the sender does not receive anything before
timeout period expires, it retransmit the frame
○ If the sender receives the NACK, it retransmit
the damaged frame
Stop and Wait ARQ
Sliding Window ARQ

● Has two approaches:


○ Go - Back - N ARQ
○ Selective Repeat ARQ
Go - Back - N ARQ
● Uses sliding window flow control protocol
● If no errors occur, the operations are similar to the sliding
window
● A station may send multiple frames as allowed by the
window

Retransmission

● Receiver sends a NACK ‘i’ if frame ‘i’ contains error or lost


● After that the receiver discards all frames until the error
frame was correctly retransmitted
● If sender receives the NACK for the frame ‘i’ and all the
frames i+1, i+2,... which have been semt but not
acknowledged.
Go - Back - N ARQ
Selective Repeat ARQ
● Sender only retransmits frames which NACK is received.

Advantages over Go-Back-N ARQ

● Fewer, retransmissions

Disadvantages

● More complex at sender and receiver


● Each frame must be acknowledged individually
○ No cumulative acknowledgement
● Frames might be received out of order
Selective Repeat ARQ

You might also like