0% found this document useful (0 votes)
2 views101 pages

Medium Access Control

The document discusses the Medium Access Control (MAC) sublayer, which is part of the Data Link Layer in networking, responsible for managing access to shared communication channels. It outlines various channel allocation methods, including static and dynamic allocation, and describes multiple access protocols such as ALOHA, CSMA, and their variations. The document emphasizes the importance of these protocols in minimizing collisions and optimizing channel utilization, particularly in broadcast networks and wireless communications.

Uploaded by

Waste Material
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views101 pages

Medium Access Control

The document discusses the Medium Access Control (MAC) sublayer, which is part of the Data Link Layer in networking, responsible for managing access to shared communication channels. It outlines various channel allocation methods, including static and dynamic allocation, and describes multiple access protocols such as ALOHA, CSMA, and their variations. The document emphasizes the importance of these protocols in minimizing collisions and optimizing channel utilization, particularly in broadcast networks and wireless communications.

Uploaded by

Waste Material
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 101

Medium Access Control

SubLayer

Dr. Kumkum Saxena


Introduction
In broadcast networks, several stations share a single
communication channel.
The major issue in these networks is, which station should
transmit data at a given time.
This process of deciding the turn of different stations is
known as Channel Allocation.
To coordinate the access to the channel, multiple access
protocols are required.
All these protocols belong to the MAC sublayer.

2
Dr. Kumkum Saxena MAC Sub Layer page 2
Introduction
Network Layer
Logical Link Control (LLC)
Data Link Layer
Medium Access Control (MAC)
Physical Layer

• Data Link layer is divided into two sublayers:


• Logical Link Control (LLC)

• Medium Access Control (MAC)

• LCC is responsible for error control & flow control.


• MAC is responsible for multiple access
resolutions.
3
Dr. Kumkum Saxena MAC Sub Layer page 3
Medium Access Control Sublayer
◼ The Open System Interconnections (OSI) model is a layered
networking framework that conceptualizes how communications
should be done between heterogeneous systems.
◼ The data link layer is the second lowest layer. It is divided into two sub
layers:
◼ The logical link control (LLC) sublayer
◼ The medium access control (MAC) sublayer
◼ LLC sublayer is responsible for flow and error control
◼ MAC sublayer is responsible for who goes next on a multiple access
channel.

Dr. Kumkum Saxena MAC Sub Layer page 4


Medium Access Control Sublayer
◼ Shared Channel --→Issue--→ How to determine who gets to use
the channel?
◼ The question that underlies the MAC sublayer is "how do we
share a single physical medium?"
◼ The MAC sublayer is especially important in LANs, particularly
wireless ones because wireless is naturally a broadcast channel.
Static Channel Allocation
◼ If there are N users, the bandwidth is divided into N equal-sized
portions, with each user being assigned one portion. Since each
user has a private frequency band, there is now no interference
among users.

Dr. Kumkum Saxena MAC Sub Layer page 5


Medium Access Control Sublayer
 Disadv :
1. If fewer than N users are communicating a large piece of
valuable spectrum will be wasted.
2. More than N users cannot communicate due to lack of
bandwidth even if some of the users who have been assigned
frequency band hardly ever transmit receive anything.
Hence inefficient way of channel allocation

Dr. Kumkum Saxena MAC Sub Layer page 6


Dynamic channel Allocation
 Dynamic channel allocation are schemes for allotting shared
network channels to competing users in a dynamic manner as per
their requirements.
Assumptions:
1. Station Model:
Model consists of n independent stations and each station
generates frame from transmission.
2. Single Channel:
A single channel is available for all communications.
All stations can transmit on it and all can receive from it.
3. Collision Assumption:
If 2 frames are transmitted simultaneously they overlap and the
resulting signal is garbled. This event is called as collision.
A collided frame must be transmitted later again

Dr. Kumkum Saxena MAC Sub Layer page 7


Dynamic channel Allocation
4 Time can be either: Continuous or slotted.
a . Continuous time :Frame transmission can start at any instant.
b. Slotted time :In slotted time, time is divided into discrete slots.

Transmission can begin only at the start of the slot.

If a slot does not contain any frame, it is called an idle slot; if it


contains a single frame, then the transmission is successful; if it
contains more than one frames, then a collision is said to occur.

Dr. Kumkum Saxena MAC Sub Layer page 8


Dynamic channel Allocation
5. Carrier Sense or No Carrier Sense
◼ The stations may or may not be capable of detecting whether the
channel is in use before sending the frames.
◼ In algorithms which are based upon carrier sense, a station
sends frame only when it senses that the channel is not busy.
◼ On the other hand, in algorithms based upon no carrier sense,
the stations transmit a frame when it is available and later are
informed whether successful transmission had occurred or not.

Dr. Kumkum Saxena MAC Sub Layer page 9


Multiple Access Protocols
Many protocols have been defined to handle the
access to shared link.
These protocols are organized in three different
groups.:
Random Access Protocols
Controlled Access Protocols
Channelization Protocols

10
Dr. Kumkum Saxena MAC Sub Layer page 10
Dr. Kumkum Saxena MAC Sub Layer page 11
Random Access Protocols
It is also called Contention Method.
In this method, there is no control station.
Any station can send the data.
The station can make a decision on whether or not to
send data. This decision depends on the state of the
channel, i.e. channel is busy or idle.
There is no scheduled time for a stations to transmit.
They can transmit in random order.

12
Dr. Kumkum Saxena MAC Sub Layer page 12
Random Access Protocols
There is no rule that decides which station should
send next.
If two stations transmit at the same time, there is
collision and the frames are lost.
The various random access methods are:
ALOHA

CSMA (Carrier Sense Multiple Access)

CSMA/CD (Carrier Sense Multiple Access with Collision Detection)

CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)

13
Dr. Kumkum Saxena MAC Sub Layer page 13
ALOHA
ALOHA was developed at University of Hawaii in early
1970s by Norman Abramson.
It was used for ground based radio broadcasting.
In this method, stations share a common channel.
When two stations transmit simultaneously, collision
occurs and frames are lost.
There are two different versions of ALOHA:
Pure ALOHA
Slotted ALOHA

14
Dr. Kumkum Saxena MAC Sub Layer page 14
Pure Aloha
Assumptions
1. Continuous time
2. No carrier sense.
◼ Stations transmit whenever they have data to send.
◼ There will be collisions and the colliding frames will be destroyed.
◼ No feedback from receiver, hence the sender just waits for a random
amount of time and sends it again.
Note : Waiting time --→Random
(If uniform, then same frames will collide over and over)

Dr. Kumkum Saxena MAC Sub Layer page 15


Pure ALOHA
If the frame is lost, station waits for a random amount
of time and sends it again.
This waiting time must be random, otherwise, same
frames will collide again and again.
Whenever two frames try to occupy the channel at
the same time, there will be collision and both the
frames will be lost.
If first bit of a new frame overlaps with the last bit of a
frame almost finished, both frames will be lost and
both will have to be retransmitted.

16
Dr. Kumkum Saxena MAC Sub Layer page 16
Dr. Kumkum Saxena MAC Sub Layer page 17
Slotted Aloha
◼ Assumptions
Slotted time

◼ No carrier sense
◼ Time is divided into equal size slots (= frame transmission
time)
◼ Stations transmit only at beginning of a time slot.
◼ If collision: retransmit frame in future slots.

Dr. Kumkum Saxena MAC Sub Layer page 18


Slotted ALOHA

▪ Slotted ALOHA was invented to improve the efficiency of


pure ALOHA.
▪ In slotted ALOHA, time of the channel is divided into
intervals called slots.
▪ The station can send a frame only at the beginning of the
▪ slot and only one frame is sent in each slot.
▪ If any station is not able to place the frame onto the channel
at the beginning of the slot, it has to wait until the next time
slot.
▪ There is still a possibility of collision if two stations try to
send at the beginning of the same time slot.

19
Dr. Kumkum Saxena MAC Sub Layer page 19
Slotted Aloha

Success (S), Collision (C), Empty (E) slots

Dr. Kumkum Saxena MAC Sub Layer page 20


Carrier Sense Multiple Access (CSMA)
CSMA was developed to overcome the problems of
ALOHA i.e. to minimize the chances of collision.
CSMA is based on the principle of “carrier sense”.
The station sense the carrier or channel before
transmitting a frame.
It means the station checks whether the channel is
idle or busy.
The chances of collision reduces to a great extent if
a station checks the channel before trying to use it.
21
Dr. Kumkum Saxena MAC Sub Layer page 21
Carrier Sense Multiple Access (CSMA)
The chances of collision still exists because of
propagation delay.
The frame transmitted by one station takes some
time to reach the other station.
In the meantime, other station may sense the
channel to be idle and transmit its frames.
This results in the collision.

22
Dr. Kumkum Saxena MAC Sub Layer page 22
Carrier Sense Multiple Access(CSMA)
◼ Are protocols in which stations listen for a carrier (i.e.
transmission) and act accordingly.
Protocols
◼ 1 persistent CSMA
◼ Non persistent CSMA
◼ p persistent CSMA
◼ CSMA /CD

Dr. Kumkum Saxena MAC Sub Layer page 23


1- persistent
1- persistent
◼ When a station has data to send, it first listens to the channel.
◼ If channel is busy, the station waits until the channel is free.
◼ When it detects an idle channel, it transmits the frame.
◼ Node waits for an ACK.
◼ If no ACK received(collision), node waits a random amount of time
and resumes listening to the channel.
◼ When the channel is again sensed idle, frame is immediately
retransmitted.
◼ The protocol is called 1 persistent, because the station sends with
probability of 1 when it finds the channel idle, meaning that is
continuously listening.

Dr. Kumkum Saxena MAC Sub Layer page 24


1- persistent
Disadvantage
◼ Propagation delays: Node A might sense idle channel even
though node B already began transmitting since the signal
hasn’t reached A due to propagation delay causing collision.
◼ If Node A and Node B are sensing a busy channel at the same
time, as soon as the channel is free, both A and B will begin
transmitting their data.

Dr. Kumkum Saxena MAC Sub Layer page 25


1-persistent CSMA

Dr. Kumkum Saxena MAC Sub Layer page 26


Non-Persistent CSMA
A station that has a frame to send, senses the
channel.
If the channel is idle, it sends immediately.
If the channel is busy, it waits a random amount of
time and then senses the channel again.
It reduces the chance of collision because the
stations wait for a random amount of time .
It is unlikely that two or more stations will wait for the
same amount of time and will retransmit at the same
time.
27
Dr. Kumkum Saxena MAC Sub Layer page 27
Non-persistent CSMA
◼ Less greedy than 1 –persistent.
◼ Node listens to channel.
◼ If channel idle, node transmits data.
◼ If channel busy, node waits a randomly selected
interval of time before sensing again.
◼ Randomized waiting times between channel sensing
eliminate most collisions resulting from multiple users transmitting
simultaneously upon sensing the transition from busy to idle.

Dr. Kumkum Saxena MAC Sub Layer page 28


Non-persistent CSMA
Adv :
◼ Channel utilization better than 1-persistent.

Dr. Kumkum Saxena MAC Sub Layer page 29


p-persistent CSMA
◼ After a station finds the line idle, it may/may not send.
◼ It sends with a probability p and refrains from sending with
a probability (1-p).
◼ Eg: p=0.2
◼ Each station generates a random no. between 0 and 1.
◼ If the random no. is less than 0.2 , then the station will
send, otherwise the station refrains from sending.
◼ In the latter case, the station waits one time slot before
sensing the medium again.
◼ If 2 stations generate no. less than 0.2 . Both will transmit
and collision will take place.
◼ Likelihood of such occurrence can be reduced by reducing
the transmission probability p.
Dr. Kumkum Saxena MAC Sub Layer page 30
P-Persistent CSMA
In this method, the channel has time slots such that
the time slot duration is equal to or greater than the
maximum propagation delay time.
When a station is ready to send, it senses the
channel.
If the channel is busy, station waits until next slot.
If the channel is idle, it transmits the frame.
It reduces the chance of collision and improves the
efficiency of the network.
31
Dr. Kumkum Saxena MAC Sub Layer page 31
p-persistent CSMA
◼ p-persistent

Sense carrier

Y Busy ?
Wait for
a slot N
Generate a Random
number.

number<p
N
Y

Send the frame


Dr. Kumkum Saxena MAC Sub Layer page 32
CSMA with Collision Detection
(CSMA/CD)
In this protocol, the station senses the channel
before transmitting the frame. If the channel is busy,
the station waits.
Additional feature in CSMA/CD is that the stations
can detect collisions.
The stations abort their transmission as soon as they
detect collision.
This feature is not present in CSMA.
The stations continue to transmit even though they
find that collision has occurred.
33
Dr. Kumkum Saxena MAC Sub Layer page 33
CSMA with Collision Detection
(CSMA/CD)

34
Dr. Kumkum Saxena MAC Sub Layer page 34
CSMA with Collision Detection
(CSMA/CD)
In CSMA/CD, the station that sends its data on the
channel, continues to sense the channel even after data
transmission.
If collision is detected, the station aborts its transmission
and waits for a random amount of time & sends its data
again.
As soon as a collision is detected, the transmitting station
release a jam signal.
Jam signal alerts other stations. Stations are not
supposed to transmit immediately after the collision has
occurred.

35
Dr. Kumkum Saxena MAC Sub Layer page 35
CSMA with Collision Avoidance
(CSMA/CA)
This protocol is used in wireless networks because
they cannot detect the collision.
So, the only solution is collision avoidance.
It avoids the collision by using three basic
techniques:
Interframe Space
Contention Window
Acknowledgements

36
Dr. Kumkum Saxena MAC Sub Layer page 36
CSMA with Collision Avoidance
(CSMA/CA)

37
Dr. Kumkum Saxena MAC Sub Layer page 37
Interframe Space
Whenever the channel is found idle, the station does not
transmit immediately.
It waits for a period of time called Interframe Space (IFS).
When channel is sensed idle, it may be possible that
some distant station may have already started
transmitting.
Therefore, the purpose of IFS time is to allow this
transmitted signal to reach its destination.
If after this IFS time, channel is still idle, the station can
send the frames.

38
Dr. Kumkum Saxena MAC Sub Layer page 38
Contention Window
Contention window is the amount of time divided into
slots.
Station that is ready to send chooses a random number
of slots as its waiting time.
The number of slots in the window changes with time.
It means that it is set of one slot for the first time, and
then doubles each time the station cannot detect an idle
channel after the IFS time.
In contention window, the station needs to sense the
channel after each time slot.

39
Dr. Kumkum Saxena MAC Sub Layer page 39
Acknowledgment
Despite all the precautions, collisions may occur and
destroy the data.
Positive acknowledgement and the time-out timer
helps guarantee that the receiver has received the
frame.

40
Dr. Kumkum Saxena MAC Sub Layer page 40
Binary exponential Back off algorithm
◼ CSMA/CD flowchart

Jam signal: A signal that carries a bit pattern sent by a data station to inform the other stations
that they must not transmit. In carrier-sense multiple access with collision detection (CSMA/CD)
networks, the jam signal indicates that a collision has occurred.

Dr. Kumkum Saxena MAC Sub Layer page 41


Controlled Access Protocol
In this method, the stations consult each other to find
which station has a right to send.
A station cannot send unless it has been authorized
by other station.
The different controlled access methods are:
Reservation
Polling
Token Passing

42
Dr. Kumkum Saxena MAC Sub Layer page 42
Reservation

In this method, a station needs to make a reservation before


sending data.
The time is divided into intervals. In each interval, a
reservation frame precedes the data frames sent in that
interval.
If there are N stations, then there are exactly N reservation
slots in the reservation frame.
Each slot belongs to a station.
When a station needs to send a frame, it makes a reservation
in its own slot.
The stations that have made reservations can send their
frames after the reservation frame.
43
Dr. Kumkum Saxena MAC Sub Layer page 43
Polling
Polling method works in those networks where
primary and secondary stations exist.
All data exchanges are made through primary device
even when the final destination is a secondary
device.
Primary device controls the link and secondary
device follow the instructions.

44
Dr. Kumkum Saxena MAC Sub Layer page 44
Token Passing
Token passing method is used in those networks where the
stations are organized in a logical ring.
In such networks, a special packet called token is circulated
through the ring.
Station that possesses the token has the right to access the
channel.
Whenever any station has some data to send, it waits for the
token. It transmits data only after it gets the possession of token.
After transmitting the data, the station releases the token and
passes it to the next station in th ring.
If any station that receives the token has no data to send, it
simply passes the token to the next station in the ring.

45
Dr. Kumkum Saxena MAC Sub Layer page 45
Channelization Protocol
Channelization is a multiple access method in which
the available bandwidth of a link is shared in time,
frequency or code between different stations.
There are three basic channelization protocols:
Frequency Division Multiple Access (FDMA)
Time Division Multiple Access (TDMA)
Code Division Multiple Access (CDMA)

46
Dr. Kumkum Saxena MAC Sub Layer page 46
FDMA
• In FDMA, the available bandwidth is divided into frequency
bands.
• Each station is allocated a band to send its data.
• This band is reserved for that station for all the time.
• The frequency bands of different stations are separated
by small bands of unused frequency.
• These unused bands are called guard bands that prevent
station interferences.
• FDMA is different from FDM (Frequency Division
Multiplexing).
• FDM is a physical layer technique, whereas, FDMA is an
access method in the data link layer.
47
Dr. Kumkum Saxena MAC Sub Layer page 47
48
Dr. Kumkum Saxena MAC Sub Layer page 48
TDMA
In TDMA, the bandwidth of channel is divided among various
stations on the basis of time.
Each station is allocated a time slot during which it can send
its data.
Each station must know the beginning of its time slot.
TDMA requires synchronization between different stations.
Synchronization is achieved by using some synchronization
bits at the beginning of each slot.
TDMA is also different from TDM. TDM is a physical layer
technique, whereas, TDMA is an access method in data link
layer.
49
Dr. Kumkum Saxena MAC Sub Layer page 49
50
Dr. Kumkum Saxena MAC Sub Layer page 50
CDMA
Unlike TDMA, in CDMA all stations can transmit data
simultaneously.
CDMA allows each station to transmit over the entire
frequency spectrum all the time.
Multiple simultaneous transmissions are separated
using coding theory.
In CDMA, each user is given a unique code
sequence.

51
Dr. Kumkum Saxena MAC Sub Layer page 51
Working of CDMA
Let us assume that we have four stations: 1, 2, 3 and 4
that are connected to the same channel.
The data from station 1 is d1, from station 2 is d2 and so
on.
The code assigned to station 1 is c1, station 2 is c2 and so
on.
These assigned codes have two properties:
If we multiply each code by another, we get 0.

If we multiply each code by itself, we get 4, (no. of stations).

52
Dr. Kumkum Saxena MAC Sub Layer page 52
Working of CDMA
When these four stations send data on the same
channel, then station 1 multiplies its data by its code
i.e. d1.c1, station 2 multiplies its data by its code i.e.
d2.c2 and so on.
The data that goes on the channel is the sum of all
these terms:
d1.c1 + d2.c2 + d3.c3 + d4.c4
Any station that wants to receive data from the
channel multiplies the data on the channel by the
code of the sender.

53
Dr. Kumkum Saxena MAC Sub Layer page 53
Working of CDMA
◼ For e.g.: suppose station 2 wants to receive
data from station1.
◼ It multiplies the data on the channel by c1,
(code of station 1).
◼ Because (c1.c1) is 4, but (c2.c1), (c3.c1) and (c4.c1)
are all 0s, station 2 divides the result by 4 to get the
data from station 1.

data = (d1.c1 + d2.c2 + d3.c3 + d4.c4).c1


= d1.c1.c1 + d2.c2.c1+ d3.c3.c1+ d4.c4.c1
= d1.4 + 0 + 0 + 0
= (d1.4) / 4 = d1
54
Dr. Kumkum Saxena MAC Sub Layer page 54
Working of CDMA
The code assigned to each station is a sequence of
numbers called chips.
These chips are called orthogonal sequences.
Each sequence is made of N elements, where N is
the number of stations.

c1 c2 c3 c4
[ +1 +1 +1 +1] [ +1 -1 +1 -1] [ +1 +1 -1 -1] [ +1 -1 -1 +1]

55
Dr. Kumkum Saxena MAC Sub Layer page 55
Working of CDMA
c1 c2 c3 c4
[ +1 +1 +1 +1] [ +1 -1 +1 -1] [ +1 +1 -1 -1] [ +1 -1 -1 +1]

This sequence has following properties:


If we multiply two equal sequences, element by
element, and add the result, we get N, where N is the
number of elements in the sequence.
This is called inner product of two equal sequence.
[+1 +1 -1 -1] . [+1 +1 -1 -1] = 1 + 1 + 1 + 1 = 4

56
Dr. Kumkum Saxena MAC Sub Layer page 56
Working of CDMA
c1 c2 c3 c4
[ +1 +1 +1 +1] [ +1 -1 +1 -1] [ +1 +1 -1 -1] [ +1 -1 -1 +1]

If we multiply two different sequences, element by


element, and add the result, we get 0.
This is called inner product of two different
sequence.
[+1 +1 -1 -1] . [+1 +1 +1 +1] = 1 + 1 - 1 - 1 = 0

57
Dr. Kumkum Saxena MAC Sub Layer page 57
Collision free protocols
1. Bit Map protocols
◼ Time is divided into slots.
◼ If there are N stations, then there have to be N slots in the
contention period.
◼ Station j may announce that it has a frame to send by
inserting a 1-bit into slot j.
◼ After all N slots have passed by each station has a
complete knowledge of which stations wish to transmit.
◼ Now stations begin transmitting in numerical order

Dr. Kumkum Saxena MAC Sub Layer page 58


Collision free protocols
Disadvantage of Bit map Protocol
Overhead of 1-bit per station hence not feasible for
networks with thousands of stations.

2. Binary Countdown protocol


◼ A station wanting to use the channel now broadcasts
its address as a binary bit string, starting with the
high-order bit. The addresses are assumed to be the
same length.
◼ The bits in each address position from different
stations are BOOLEAN OR-ed together.
Dr. Kumkum Saxena MAC Sub Layer page 59
Collision free protocols
Eg
◼ If stations 0010, 0100, 1001, and 1010 are all trying to get the
channel, in the first bit time the stations transmit 0, 0, 1, and
1, respectively.
◼ They are OR-ed together to get 1.
◼ Stations 0010 and 0100 see the 1 and know that higher-
numbered stations is competing for the channel and they give
up for the current round.
◼ Stations 1001 and 1010 continue.
◼ Next bit is 0. Oring gives a 0, hence both continue.
◼ Next bit Ored gives 1, hence 1001 gives up.
◼ Station 1010 gets to use the channel(transmits frames)
◼ Note : Highest numbered station have the highest
priority
Dr. Kumkum Saxena MAC Sub Layer page 60
Dr. Kumkum Saxena MAC Sub Layer page 61
Collision free protocols
Variation of Binary Countdown(Mok and Ward)
◼ Use virtual station numbers –
◼ C,H,D,A,G,B,E,F
7 654 3210
Assuming stations 5,3 and 2 wants to send.
◼ D sends
◼ C,H,A,G,B,E,F,D
7 6 5 4 3 21 0

Dr. Kumkum Saxena MAC Sub Layer page 62


Limited Contention Protocols
◼ Collision based protocols (pure and slotted
ALOHA, CSMA/CD) are good when the network
load is low.
◼ Collision free protocols (bitmap, binary
Countdown) are good when load is high.
Combining their advantages:
◼ Behave like the ALOHA scheme under light load
◼ Behave like the collision free scheme under heavy
load.
Hybrid: limited contention protocols
Dr. Kumkum Saxena MAC Sub Layer page 63
Adaptive tree walk protocol
◼ Consider a simple bus-based linear-topology LAN with N nodes, where
N is a power of 2.
◼ The Adaptive Tree Walk Protocol conceptually arranges these stations
into a complete binary tree configuration. For example, if N = 8, there
are 8 (real) leaf nodes at Level 3, there are 4 virtual nodes (each with 2
children) above them at Level 2, there are 2 virtual nodes above these
at Level 1, and 1 virtual node at Level 0, which is the root of the binary
tree.
◼ Initially all nodes (A, B ……. G, H) are permitted to compete for the
channel.
◼ If a node is successful in acquiring the channel, it transmits its frame.
◼ In case of collision, the nodes are divided into two groups (A, B, C, D
in one group and E, F, G, H in another group).
◼ Nodes belonging to only one of them is permitted for competing. This
process continues until successful transmission occurs.
Dr. Kumkum Saxena MAC Sub Layer page 64
Adaptive tree walk protocol

Dr. Kumkum Saxena MAC Sub Layer page 65


Example: 0

1 2

3 4 5 6

A B C* D E* F* G H*

Slot 0: C*, E*, F*, H* (all nodes under node 0 can try), conflict
slot 1: C* (all nodes under node 1 can try), C sends
slot 2: E*, F*, H*(all nodes under node 2 can try), conflict
slot 3: E*, F* (all nodes under node 5 can try), conflict
slot 4: E* (all nodes under E can try), E sends
slot 5: F* (all nodes under F can try), F sends
slot 6: H* (all nodes under node 6 can try), H sends.

Dr. Kumkum Saxena MAC Sub Layer page 66


IEEE STANDARDS
Ethernet: It is a LAN protocol that is used in Bus and Star
topologies and implements CSMA/CD as the medium access
method

▪Original (traditional) Ethernet developed in 1980 by three


companies: Digital, Intel, Xerox (DIX).

▪In 1985, the Computer Society of the IEEE started a project,


called Project 802, to set standards to enable intercommunication
among equipment from a variety of manufacturers.
▪ Current version is called IEEE Ethernet

Dr. Kumkum Saxena MAC Sub Layer page 67


❑ IEEE 802.3 supports LAN standard Ethernet
❑ IEEE802.3 defines two categories
❑ Baseband
❑ Broadband
❑ Base band has different categories
❑ 10Base5
❑ 10Base2
❑ 10BaseT
❑ 1Base5 .....
❑ Broad band has a category
❑ 10Broad36
Dr. Kumkum Saxena MAC Sub Layer page 68
Ethernet address

❑ Six bytes = 48 bits


❑ Flat address not hierarchical
❑ Burned into the NIC ROM
❑ First three bytes from left specify the vendor. Cisco 00-00- 0C, 3Com 02-60-8C
and the last 24 bit should be created uniquely by the company
❑ DestinationAddress can be:
❑ Unicast: second digit from left is even (one recipient)
❑ Multicast: Second digit from left is odd (group of
stations to receive the frame – conferencing
applications)
❑ Broadcast (ALL ones) (all stations receive the frame)
❑ Source address is always Unicast

Dr. Kumkum Saxena MAC Sub Layer page 69


Ethernet evolution through four generations

Dr. Kumkum Saxena MAC Sub Layer page 70


Categories of traditional Ethernet

Dr. Kumkum Saxena MAC Sub Layer page 71


IEEE 802.3 Cable Types
Name Cable Max. Max Cable Nodes
Toplogy
Segment /segment
Length
10Base5 thick coax 500 meters 100
Bus

10Base2 thin coax 185 meters 30


Bus

10BaseT twisted pair 100 meters 1


Star

10BaseF Fiber Optic 2Km 1


Star

Dr. Kumkum Saxena MAC Sub Layer page 72


10Base5 implementation

Dr. Kumkum Saxena MAC Sub Layer page 73


Connection of stations to the medium using 10Base2

Dr. Kumkum Saxena MAC Sub Layer page 74


10BaseT
• Uses twisted pair Cat3 cable
◼ Star-wire topology

• Ahub functions as a repeater with additional functions


• Fewer cable problems, easier to troubleshoot than coax
• Cable length at most 100 meters

Dr. Kumkum Saxena MAC Sub Layer page 75


10Base-T implementation

Dr. Kumkum Saxena MAC Sub Layer page 76


10Base-F implementation

Dr. Kumkum Saxena MAC Sub Layer page 77


Fast Ethernet
❑ 100 Mbps transmission rate
❑ same frame format, media access, and collision detection
rules as 10 Mbps Ethernet
❑ can combine 10 Mbps Ethernet and Fast Ethernet on same
network using a switch
❑ media: twisted pair (CAT5) or fiber optic cable (no coax)
❑ Star-wire topology
❑ Similar to 10BASE-T

Dr. Kumkum Saxena MAC Sub Layer page 78


Fast Ethernet topology

Dr. Kumkum Saxena MAC Sub Layer page 79


Fast Ethernet implementations

Dr. Kumkum Saxena MAC Sub Layer page 80


Gigabit Ethernet

❑ Speed 1Gpbs
❑ Minimum framelengthis 512 bytes
❑ Operates in full/halfduplex modes
❑ mostly fullduplex

Dr. Kumkum Saxena MAC Sub Layer page 81


In the full-duplex mode of Gigabit Ethernet,
there is no collision;
the maximum length of the cable is
determined by the signal attenuation
in the cable.

Dr. Kumkum Saxena MAC Sub Layer page 82


Gigabit Ethernet implementations

Dr. Kumkum Saxena MAC Sub Layer page 83


10Gbps Ethernet

◼ Maximum link distances cover 300 m to 40 km


◼ Full-duplex mode only

◼ No CSMA/CD

◼ Uses optical fiber only

Dr. Kumkum Saxena MAC Sub Layer page 84


Ethernet 802.3
◼ Very popular LAN standard.
◼ Ethernet and IEEE 802.3 are distinct standards but as they are very
similar to one another these words are used interchangeably.
◼ It covers the physical layer and MAC sublayer protocol.
◼ IEEE 802.3 is otherwise known as the Ethernet standard and defines
the physical layer and the media access control (MAC) of the data link
layer for wired Ethernet networks, generally as a local area network
(LAN) technology.
◼ 1-persistent CSMA/CD LAN.
◼ Before sending data, CSMA/CD stations “listen” to the network to see
if it is already in use. If it is, the station wishing to transmit waits. If the
network is not in use, the station transmits. A collision occurs when two
stations listen for network traffic, “hear” none, and transmit
simultaneously.
◼ In this case, both transmissions are damaged, and the stations must
retransmit at some later time(Exponential Back off Algorithm).
Dr. Kumkum Saxena MAC Sub Layer page 85
Ethernet 802.3
◼ Ethernets are broadcast network.
◼ All stations see all frames, regardless of whether they represent
an intended destination.
◼ Each station must examine received frames to determine if the
station is a destination. If so, the frame is passed to a higher
protocol layer for appropriate processing.

Dr. Kumkum Saxena MAC Sub Layer page 86


Ethernet 802.3
Physical properties
◼ An Ethernet segment is implemented on a coaxial cable.
◼ This cable is similar to the type used for cable TV.
◼ Hosts connect to an Ethernet segment by tapping into it;
◼ Taps(node spacing) must be at least 2.5 m apart.
◼ A transceiver a small device directly attached to the tap detects
when the line is idle and drives the signal when the host is
transmitting.
◼ It also receives incoming signals.
◼ The transceiver is, in turn, connected to an Ethernet adaptor,
which is plugged into the host.

Dr. Kumkum Saxena MAC Sub Layer page 87


Dr. Kumkum Saxena MAC Sub Layer page 88
Ethernet 802.3
Ethernet frame format
◼ Ethernet frame starts with Preamble and SFD, both works at the
physical layer.
◼ Ethernet header contains both Source and Destination MAC
address, after which the payload of the frame is present.
◼ The last field is CRC which is used to detect the error.

Dr. Kumkum Saxena MAC Sub Layer page 89


Ethernet 802.3
◼ PREAMBLE – Ethernet frame starts with 7-Bytes Preamble. The
preamble tells receiving stations that a frame is coming.This is a pattern of
alternative 0’s and 1’s which indicates starting of the frame and allow
sender and receiver to establish bit synchronization.
◼ (Preamble) indicates the receiver that frame is coming and allow the
receiver to lock onto the data stream before the actual frame begins.
◼ Start of frame delimiter (SFD) – This is a 1-Byte field which is always
set to 10101011. SFD indicates that upcoming bits are starting of the
frame, which is the destination address. Sometimes SFD is considered the
part of PRE, this is the reason Preamble is described as 8 Bytes in many
places. The SFD warns station or stations that this is the last chance for
synchronization.
◼ Destination Address – This is 6-Byte field which contains the MAC
address of machine for which data is destined.

Dr. Kumkum Saxena MAC Sub Layer page 90


◼ Source Address – This is a 6-Byte field which contains the MAC address
of source machine.
◼ Length – Length is a 2-Byte field, which indicates the length of entire
Ethernet frame. This 16-bit field can hold the length value between 0 to
65534, but length cannot be larger than 1500 because of some own
limitations of Ethernet.
◼ Data – This is the place where actual data is inserted, also known as
Payload. The maximum data present may be as long as 1500 Bytes. In case
data length is less than minimum length i.e. 46 bytes, then padding 0’s is
added to meet the minimum possible length.
◼ Cyclic Redundancy Check (CRC) – CRC is 4 Byte field. This field
contains a 32-bits hash code of data, which is generated over the
Destination Address, Source Address, Length, and Data field. If the
checksum computed by destination is not the same as sent checksum value,
data received is corrupted.
Note – Size of frame of Ethernet IEEE 802.3 varies 64 bytes to
1518 bytes including data length (46 to 1500 bytes).

Dr. Kumkum Saxena MAC Sub Layer page 91


Binary exponential Back off algorithm

 In CSMA/CD the station wishing to transmit first listens to


make certain that the link is free, then transmits data and
listens again.
 The station checks the line for extremely high voltages
that indicate a collision.
 After a station detects collision, it aborts it’s transmission
waits a random period of time and tries again.
◼ Back-off algorithm is a collision resolution mechanism
which is used in MAC protocols (CSMA/CD).
◼ This algorithm is generally used in Ethernet to
schedule re-transmissions after collisions.

Dr. Kumkum Saxena MAC Sub Layer page 92


Binary exponential Back off algorithm
◼ If a collision takes place between 2 stations, they may restart
transmission as soon as they can after the collision.
◼ This will always lead to another collision and form an infinite
loop of collisions leading to a deadlock.
◼ To prevent such scenario back-off algorithm is used.
◼ Let us consider an scenario of 2 stations A and B transmitting
some data:

Dr. Kumkum Saxena MAC Sub Layer page 93


Binary exponential Back off algorithm

Dr. Kumkum Saxena MAC Sub Layer page 94


Binary exponential Back off algorithm
◼ After a collision, time is divided into discrete slots (Tslot) whose
length is equal to 2t, where t is the maximum propagation delay
in the network.
◼ The stations involved in the collision randomly pick an integer
from the set K i.e {0, 1}.
◼ This set is called the contention window.
◼ If the sources collide again because they picked the same
integer, the contention window size is doubled and it becomes
{0, 1, 2, 3}.
◼ Now the sources involved in the second collision randomly pick
an integer from the set {0, 1, 2, 3} and wait that number of time
slots before trying again.

Dr. Kumkum Saxena MAC Sub Layer page 95


Binary exponential Back off algorithm
◼ Before they try to transmit, they listen to the channel and
transmit only if the channel is idle. This causes the source which
picked the smallest integer in the contention window to succeed
in transmitting its frame.
◼ So, Back-off algorithm defines a waiting time for the stations
involved in collision, i.e. for how much time the station should
wait to re-transmit.
Waiting time = back–off time
Let n = collision number or re-transmission serial number.
Then, Waiting time = K * Tslot where K = [0, 2n – 1 ]

Dr. Kumkum Saxena MAC Sub Layer page 96


Binary exponential Back off algorithm
Example –
◼ Case-1 :
Suppose 2 stations A and B start transmitting data (Packet 1)
at the same time then, collision occurs.
◼ So, the collision number n for both their data (Packet 1) = 1.
◼ Now, both the station randomly pick an integer from the set K
i.e. {0, 1}.

Dr. Kumkum Saxena MAC Sub Layer page 97


Binary exponential Back off algorithm
◼ When both A and B choose K = 0
–> Waiting time for A = 0 * Tslot = 0
Waiting time for B = 0 * Tslot = 0 Therefore, both stations will
transmit at the same time and hence collision occurs.
◼ When A chooses K = 0 and B chooses K = 1
–> Waiting time for A = 0 * Tslot = 0
Waiting time for B = 1 * Tslot = Tslot Therefore, A transmits the
packet and B waits for time Tslot for transmitting and hence A wins.
◼ When A chooses K = 1 and B chooses K = 0
–> Waiting time for A = 1 * Tslot = Tslot
Waiting time for B = 0 * Tslot = 0 Therefore, B transmits the packet
and A waits for time Tslot for transmitting and hence B wins.
◼ When both A and B choose K = 1
–> Waiting time for A = 1 * Tslot = Tslot
Waiting time for B = 1 * Tslot = Tslot Therefore, both will wait for the
same time Tslot and then transmit. Hence, collision occurs

Dr. Kumkum Saxena MAC Sub Layer page 98


Binary exponential Back off algorithm
◼ Probability that A wins = 1/4
◼ Probability that B wins = 1/4
◼ Probability of collision = 2/4
Case-2 :
◼ Assume that A wins in Case 1 and transmitted its data(Packet 1).
◼ Now, as soon as B transmits its packet 1, A transmits its packet
2.
◼ Hence, collision occurs.
◼ Now collision no. n becomes 1 for packet 2 of A and becomes 2
for packet 1 of B.
For packet 2 of A, K = {0, 1}
For packet 1 of B, K = {0, 1, 2, 3}

Dr. Kumkum Saxena MAC Sub Layer page 99


Binary exponential Back off algorithm

◼ Probability that A wins = 5/8


◼ Probability that B wins = 1/8
◼ Probability of collision = 2/8
So, probability of collision decreases as compared to Case 1.page 100
Dr. Kumkum Saxena MAC Sub Layer
Binary exponential Back off
algorithm
Advantage –
◼ Collision probability decreases exponentially.
Disadvantages –
◼ Capture effect: Station who wins once keeps on winning.
◼ Works only for 2 stations or hosts.

Dr. Kumkum Saxena MAC Sub Layer page 101

You might also like