0% found this document useful (0 votes)
11 views

Mac Sublayer Updated

Uploaded by

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

Mac Sublayer Updated

Uploaded by

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

THE MEDIUM ACCESS CONTROL

SUBLAYER

1
THE MEDIUM ACCESS CONTROL
SUBLAYER
• Data Link layer is divided into two sub layers:

• 1. Logical Link Control (LLC)-


• is responsible for error control & flow control.

• 2. Medium Access Control (MAC)-


• MAC is responsible for multiple access resolutions

2
Types of channels
• Channels are of two types

1. Point to point

• Dedicated connection between two communication endpoints or nodes

2. Broadcast
• Also called
• Multiaccess Channels or Random Access Channels
• Single channel is shared by multiple users
• Determining who will use the channel next is a problem
• Medium Access Control (MAC) sublayer solves this problem

3
THE CHANNEL ALLOCATION PROBLEM

• In broadcast networks, single channel is shared by several stations.

• This channel can be allocated to only one transmitting user at a time.

There are two different methods of channel allocations:

• 1. Static Channel

• 2. Dynamic Channel Allocation


4
THE CHANNEL ALLOCATION PROBLEM
• 1. Static Channel Allocation-
• a single channel is divided among various users either on the basis
of frequency (FDM) or on the basis of time (TDM).
• In FDM, fixed frequency is assigned to each user, whereas, in
TDM, fixed time slot is assigned to each user.

5
THE CHANNEL ALLOCATION PROBLEM
2. Dynamic Channel Allocation-

• no user is assigned fixed frequency or fixed time slot.

• All users are dynamically assigned frequency or time slot, depending upon the

requirements of the user

6
MULTIPLE ACCESS PROTOCOLS
• Protocols for dynamic channel allocation

• Determines which stations can use the channel ie when station can
transmit

7
8
Random Access Protocols

• Random access protocols assign uniform priority to all connected


nodes.
• Any node can send data if the transmission channel is idle.

• No fixed time or fixed sequence is given for data transmission.

9
Controlled Access Protocols

• allow only one node to send data at a given time.

• Before initiating transmission, a node seeks information from other


nodes to determine which station has the right to send.

• This avoids collision of messages on the shared channel

10
Channelization

• Channelization are a set of methods by which the available bandwidth


is divided among the different nodes for simultaneous data transfer.

11
ALOHA
• Having the meaning “hello”
• Uses ground based radio broadcasting
• In this method, stations share a common channel.
• When two stations transmit simultaneously, collision occurs which
results in frame loss

12
aloha

13
Pure ALOHA
• In pure ALOHA, stations transmit frames whenever they have data to
send.
• When two stations transmit simultaneously, will be collisions and the
colliding frames will be damaged.
• If the frame was destroyed, the sender just waits a random amount of
time and sends it again.
• To maximize throughput of ALOHA systems all frames have uniform
size

14
Frames in Pure ALOHA

15
Pure ALOHA
• 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
that has almost finished, both frames will be totally destroyed (i.e.,
have incorrect checksums) and both will have to be retransmitted
later

16
THROUGHPUT OF PURE ALOHA

• Throughput ,S=G* P0 Where


• G is the average number of old and new frame submissions
• P0 = probability that a frame does not suffer a collision
• P0 =e-2G
• And S=G*e-2G

17
Vulnerable time:
• vulnerable time is in which there is a possibility of collision.
• We assume that the stations send fixed-length frames with each
frame taking Tfr S to send. The following figure shows the vulnerable
time for station A.
• vulnerable time for pure aloha is 2* Tfr

18
ADVANTAGES OF PURE ALOHA

• Superior to fixed assignment when there is a large no: of


bursty stations

• Adapts to varying number of stations


DISADVANTAGES OF PURE ALOHA

• Theoretically proven output is only 18.4%

• Requires queueing buffers for retransmission of packets


Slotted aloha

21
Slotted aloha

22
Throughput of Slotted ALOHA
• S = G e-G

• S peaks at G = 1
• G is the average number of old and new frame submissions
• Sending of data is allowed only at the beginning of these slots

23
Advantages of slotted Aloha
• Double the efficiency of aloha

• Adaptable to a changing station population

24
Disadvantages of slotted Aloha
• Theoretically proven maximum output is only 36.8%

• Requires queueing buffers for retransmission of packets

• Synchronization required

25
Vulnerable time of slotted aloha
Vulnerable time of slotted aloha is Tfr

26
Differences between pure aloha and slotted
aloha

27
Carrier Sense Multiple Access (CSMA)
Protocols
• ALOHA does not listen to the channel before it transmits, ending up
with poor performance
• Carrier Sense Protocols
• Stations listen the channel if there is any transmission going on before they
transmit

• If channel sensed idle: transmit entire pkt

• If channel sensed busy, deny transmission

28
Carrier Sense Multiple Access (CSMA)
Protocols
CSMA uses electrical activity on cable to determine status.

When no station is sending then the channel doesn’t contain electrical signals.

During transmission the sender transmits electrical signals used to encode bits.

Although signals differ slightly from carrier wave they are informally called
carrier.thus the name carrier sense multiple access protocols

29
CSMA Protocols
• There are different variations of the CSMA protocols:
1. 1-persistent CSMA
2. Nonpersistent CSMA
3. p-persistent CSMA
1-persistent CSMA
• The protocol:
• Listens before transmits
1. If the medium is idle, transmit immediately
2. If the medium is busy, continue to listen until medium
becomes idle, and then transmit immediately
3. If collision occurs, waits a random amount of time and starts
all over again
• It is called 1-persistent because the station transmits with a
probability of 1 whenever it finds the channel idle.
1 persistent CSMA

32
1-persistent CSMA

•Too selfish
• there will always be a collision if two stations want to retransmit
• If two or more stations becomes ready at the same time, collision guaranteed

•Propagation delay has an important effect on the performance of


this protocol

33
34
35
Non-Persistent CSMA Protocol:

▪ A station with frames to be sent, should sense the medium


1. If medium is idle, transmit; otherwise, go to 2

2. If medium is busy, (backoff) wait a random amount of time and repeat 1

▪ Non-persistent Stations are deferential (respect others)

36
Non-Persistent CSMA

37
Performance of Non-Persistent CSMA Protocol:

▪ Random delays reduces probability of collisions because two


stations with data to be transmitted will wait for different amount
of times.

▪ Bandwidth is wasted if waiting time (backoff) is large because


medium will remain idle following end of transmission even if
one or more stations have frames to send

38
P-Persistent CSMA
• Used in slotted systems
• Combines the advantages of non-persistent and 1-persistent CSMA
• In slotted channels every node will send only when it gets its timeslot .
• when a station becomes ready to send it senses the channel and then if it is idle
it will transmit at the probability P.
• If the channel is also free but it has to check for one more condition whether
that timeslot is allotted for that station if that timeslot is for that station then only
it can send.
• Otherwise it has to wait for its timeslot with a probability of 1-P

39
P-persistent CSMA

■ Station wishing to transmit listens to the medium:


1. If medium idle,
▪ transmit with probability (p), OR
▪ wait one time unit (slot) with probability (1 – p), then
repeat 1.
2. If medium busy, continuously listen until idle and repeat
step 1

If a collision occurs, wait a random amount of time and go


to step 1
p-Persistent CSMA Protocol:

41
Performance

Reduces the possibility of collisions like 1-persistent

Reduces channel idle time like nonpersistent

42
Channel Utilization for Random Access
Protocols

43
CSMA with Collision Detection (CSMA/CD)
• Modification of CSMA
• CSMA/CD is used to improve CSMA performance
• It is used in LAN in MAC sub layer
• It is the basis of popular ethernet LAN

44
CSMA/CD (Collision Detection)
▪ CSMA (all previous methods) has an inefficiency:
▪ If a collision has occurred, the channel is unstable (the medium remains
unusable) until colliding packets have been fully transmitted
▪ CSMA/CD (Carrier Sense Multiple Access with Collision Detection) overcomes this
as follows:
▪ While transmitting, the sender is listening to medium for collisions.
▪ Sender stops transmission if collision has occurred reducing channel wastage .

CSMA/CD is Widely used for bus topology LANs (IEEE 802.3, Ethernet).
of its own
signal, it means collision occurred
CSMA/CD Protocol
• Use one of the CSMA persistence algorithm (non-persistent, 1-persistent, p-
persistent) for transmission
• If a collision is detected by a station during its transmission then it should do the
following:
• Abort transmission and Transmit a jam signal (48 bit) to notify other stations
about collision

• After sending the jam signal, backoff (wait) for a random amount of time, then
Transmit the frame again
48
CSMA/CD
CSMA/CA
• CSMA/CA protocol is used in wireless networks because they cannot
detect the collision so the only solution is 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.

50
CSMA/CA-Algorithm
• 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
algorithm. 53
CSMA/CA-
• 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
algorithm. 54
CSMA/CA
• CSMA/CA protocol is used in wireless networks because they cannot
detect the collision so the only solution is collision avoidance.
• CSMA/CA avoids the collisions using three basic techniques.
• (i) Interframe space
• (ii) Contention window
• (iii) Acknowledgements

55
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 to be idle, it may be possible that same
distant station may have already started transmitting and the signal of
that distant station has not yet reached other stations.
• Therefore the purpose of IFS time is to allow this transmitted signal to
reach other stations.
• If after this IFS time, the channel is still idle, the station can send, but
it still needs to wait a time equal to contention time.
• IFS variable can also be used to define the priority of a station or a
frame. 56
Contention Window
• Contention window is an amount of time divided into slots.
• A station that is ready to send chooses a random number of slots as
its wait time.
• The number of slots in the window changes according to the binary
exponential back-off strategy. It means that it is set of one slot 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.
• If the station finds the channel busy, it does not restart the process. It
just stops the timer & restarts it when the channel is sensed as idle.
57
Acknowledgement

•Despite all the precautions, collisions may occur and destroy the data.
•The positive acknowledgment and the time-out timer can help
guarantee that receiver has received the frame.

58
Collision free Protocols
• Bitmap Protocol
• Binary Count down

59
Bitmap Protocol

• each contention period consists of exactly N slots.


• If any station has to send frame, then it transmits a 1 bit in the corresponding
slot.
• For example, if station 2 has a frame to send, it transmits a 1 bit to the 2nd slot.
• each station has complete knowledge of which station wishes to transmit.
• There will never be any collisions because everyone agrees on who goes next.
• Protocols like this in which the desire to transmit is broadcasting for the actual
transmission are called Reservation Protocols.

60
61
Binary countdown protocol
• used to overcome the overhead 1 bit per binary station.
• In binary countdown, binary station addresses are used.
• A station wanting to use the channel broadcast its address as binary
bit string starting with the high order bit.
• All addresses are assumed of the same length.

62
• In this method, different station addresses are read together who
decide the priority of transmitting.
• If these stations 0001, 1001, 1100, 1011 all are trying to seize the
channel for transmission.
• All the station at first broadcast their most significant address bit
that is 0, 1, 1, 1 respectively.
• most significant bits are read together (perform OR
operation,0+1+1+1=1)
• Station 0001 see the 1 MSB in another station address and knows
that a higher numbered station is competing for the channel, so it
gives up for the current round. 63
• Other three stations 1001, 1100, 1011 continue.
• The next station at which next bit is 1 is at station 1100, so station
1011 and 1001 give up because there 2nd bit is 0. Then station 1100
starts transmitting a frame, after which another bidding cycle starts.
• Refer note also.

64
65

You might also like