Data link layer is divided into two sub layers:
Logical link control (LLC) layer: The upper sub layer is responsible for data link control i.e. for flow and error control.
Media access control (MAC) layer: The lower sub layer is responsible for resolving access to the shared media. If the channel is dedicated, we do not need the lower sub layer.
2. INTRODUCTION
• Data link layer is divided into two sub layers:
• Logical link control (LLC) layer: The upper sub
layer is responsible for data link control i.e. for
flow and error control.
• Media access control (MAC) layer: The lower
sub layer is responsible for resolving access to
the shared media. If the channel is dedicated, we
do not need the lower sub layer.
4. RANDOM ACCESS PROTOCOLS
• First, there is no scheduled time for a station to
transmit. Transmission is random among the
stations. That is why these methods are called
random access.
• Second, no rules specify which station should
send next. Stations compete with one another to
access the medium. That is why these methods
are also called contention methods.
5. ALOHA
• ALOHA, the earliest random access method was
developed at the University of Hawaii in early
1970.
• It was designed for a radio (wireless) LAN, but it
can be used on any shared medium.
• It is obvious that there are potential collisions in
this arrangement
6. Variations of ALOHA protocol
Pure ALOHA :
• The original ALOHA protocol is called pure
ALOHA.
• This is a simple, but elegant protocol.
• The idea is that each station sends a frame
whenever it has a frame to send.
• However, since there is only one channel to
share, there is the possibility of collision between
frames from different stations.
8. • The pure ALOHA relies on acknowledgments
• If ACK does not arrive after a time-out period,
resends the frame.
• If all stations try to resend their frames after the
time-out, the frames will collide again.
• Each station waits a random amount of time before
resending its frame.
• The randomness will help avoid more collisions.
• This time is the back-off time TB.
• After a maximum number of retransmission
attempts Kmax a station must give up and try later.
Procedure for pure ALOHA protocol
10. • Vulnerable time is the Length of time, in which
there is a possibility of collision.
• Propagation time Tp is the time needed for a
signal to propagate from one end of the medium to
the other.
• The waiting time for which the station waits before
retransmitting the data is called as back off time.
• Ethernet is defined as a networking technology
that includes the protocol, port, cable, and computer
chip needed to plug a desktop or laptop into a local
area network (LAN) for speedy data transmission
via coaxial or fiber optic cables.
11. Slotted ALOHA
• Slotted ALOHA was invented to improve the
efficiency of pure ALOHA.
• In slotted ALOHA the time is divided into slots
(time to send each fixed size frame) and force the
station to send only at the beginning of the time
slot.
• If a station misses this moment, it must wait until
the beginning of the next time slot.
• Still the possibility of collision is present if two
stations try to send frame at the beginning of the
same time slot .
13. Carrier Sense Multiple Access
(CSMA)
• CSMA is based on the principle "sense before
transmit" or "listen before talk." CSMA can
reduce the possibility of collision, but it cannot
eliminate it.
Persistence Methods:
• 1-persistent method,
• Non-persistent method, and
• P-persistent method.
14. 1-Persistent Method:
• In this method, after the station finds the line idle, it
sends its frame immediately.
• This method has the highest chance of collision
because two or more stations may find the line idle
and send their frames immediately.
• Ethernet, a LAN standard uses this method
Non-persistent Method :
• If the line is idle, it sends immediately.
• If the line is not idle, it waits a random amount of
time.
• Two or more stations will not wait the same amount
of time.
• This method reduces the efficiency.
17. CSMA/CD (Collision Detection)
• It was widely used in Early Ethernet
technology/LANs when there used to be shared Bus
Topology and each node were connected By Coaxial
Cables.
• 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.
18. • 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 and
resets the counters
20. CSMA/CA (Collision Avoidance)
• In contrast to CSMA/CD (Carrier Sense Multiple
Access/Collision Detection) that deals with collisions after
their occurrence, CSMA/CA prevents collisions prior to their
occurrence.
• 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 process.
21. • 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.
Methods used in the CSMA/ CA
22. CONTROLLED ACCESS
METHODS
• In controlled access, the stations consult one
another to find which station has the right to send.
A station cannot send unless it has been
authorized by other stations. There are three
popular controlled-access methods:
• Reservation
• Polling
• Token passing
23. Reservation
• In the reservation method, a station needs to make a reservation
before sending data. Time is divided into intervals.
• In each interval, a reservation frame precedes the data frames sent
in that interval.
• If there are N stations in the system, there are exactly N
reservation mini-slots in the reservation frame.
• When a station needs to send a data frame, it makes a reservation in
its own mini-slot.
• The stations that have made reservations can send their data frames
after the reservation frame.
24. Polling
• One device is designated as a primary station and
the other devices are secondary stations.
• All data exchanges must be made through the
primary device.
• The primary device controls the link; the secondary
devices follow its instructions.
• If the primary wants to receive data, it asks the
secondary if they have anything to send; this is
called poll function.
• If the primary wants to send data, it tells the
secondary to get ready to receive; this is called
select function.
26. Token Passing
• In token passing scheme, the stations are connected logically to
each other in form of ring and access to stations is governed by
tokens.
• A token is a special bit pattern or a small message, which
circulate from one station to the next in some predefined order.
• In Token ring, token is passed from one station to another
adjacent station in the ring whereas incase of Token bus, each
station uses the bus to send the token to the next station in some
predefined order.
27. • In both cases, token represents permission to
send. If a station has a frame queued for
transmission when it receives the token, it can
send that frame before it passes the token to the
next station. If it has no queued frame, it passes the
token simply.
• After sending a frame, each station must wait for
all N stations (including itself) to send the token to
their neighbors and the other N – 1 stations to send
a frame, if they have one.
• There exists problems like duplication of token or
token is lost or insertion of new station, removal of
a station, which need be tackled for correct and
reliable operation of this scheme.