0% found this document useful (0 votes)
4 views38 pages

Unit 2 - MAC Sublayer

The document provides an overview of the Medium Access Control (MAC) sublayer, which is responsible for managing access to the physical network medium among multiple devices. It discusses various channel allocation methods, including static and dynamic approaches, and details random access protocols like Pure ALOHA and Slotted ALOHA. Additionally, it explains the significance of MAC addresses and their role in network communication.

Uploaded by

gudiyachand103
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)
4 views38 pages

Unit 2 - MAC Sublayer

The document provides an overview of the Medium Access Control (MAC) sublayer, which is responsible for managing access to the physical network medium among multiple devices. It discusses various channel allocation methods, including static and dynamic approaches, and details random access protocols like Pure ALOHA and Slotted ALOHA. Additionally, it explains the significance of MAC addresses and their role in network communication.

Uploaded by

gudiyachand103
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/ 38

Medium Access Control

(MAC) Sub Layer


PAWA N K UM A R
A S S I S TA N T P R O F E S SO R
G J US & T, H I S A R
Contents
 Introduction to MAC Sub layer
 Channel allocation methods
 Multiple Access Communication
 Random Access
 Pure ALOHA
 Slotted-ALOHA
 CSMA
 CSMA-CD

 LAN Standards
 Ethernet
 Fast Ethernet
 Gigabit Ethernet
12/23/2020 NETWORK LAYER 2
Introduction to MAC Sub layer
 Data link layer works between two hosts which are directly connected in some sense.
This direct connection could be point to point or broadcast.
 Systems on broadcast network are said to be on same link.
 The work of data link layer tends to get more complex when it is dealing with multiple
hosts on single collision domain.
 Data link layer is divided into two sublayers −
 Logical link control (LLC) sublayer: It deals with protocols, flow-control, and error control
 Medium access control (MAC) sublayer: It deals with actual control of media/ medium
 Medium Access Control sub layer is concerned with sharing the physical connection to
the network among several computers.

12/23/2020 NETWORK LAYER 3


Introduction to MAC Sub layer
 MAC is responsible for flow control and multiplexing for transmission medium.
 It controls the transmission of data packets via remotely shared channels.
 It sends data over the network interface card (NIC).
 The MAC layer is responsible for moving data packets to and from one Network
Interface Card (NIC) to another across a shared channel.
 MAC sublayer uses MAC protocols to ensure that signals sent from different
stations across the same channel don't collide.
 Each computer has its own unique MAC address. Ethernet is an example of
a protocol that works at the Media Access Control sub layer level.

12/23/2020 NETWORK LAYER 4


MAC Address
 A MAC address is a hardware identification number that uniquely identifies each
device on a network.
 The MAC address is manufactured into every network card, such as
an Ethernet card or Wi-Fi card, and therefore cannot be changed.
 Because there are millions of networkable devices in existence, and each device
needs to have a unique MAC address, there must be a very wide range of possible
addresses.
 MAC addresses are of 48-bits made up of six two-digit hexadecimal numbers,
separated by colons.
 Format of MAC Address:
 MM:MM:MM:SS:SS:SS or
 MM-MM-MM-SS-SS-SS
12/23/2020 NETWORK LAYER 5
MAC Address
 For example, an Ethernet card may have a MAC address of 00:0d:83:b1:c0:8e.
 The first half of a MAC (00:0d:83:b1:c0:8e) address contains the ID number of the
adapter manufacturer OUI (Organizational Unique Identifier). These IDs are
regulated by an Internet standards body.
 Here are the OUI for some well-known manufacturers.
 Dell: 00-14-22
 Nortel: 00-04-DC
 Cisco: 00-40-96
 Belkin: 00-30-BD
 It's common for the larger manufacturers of networking equipment to have more
than one set of OUIs.

12/23/2020 NETWORK LAYER 6


MAC Address
 The second half of a MAC (00:0d:83:b1:c0:8e ) address represents the serial
number assigned to the adapter by the manufacturer.
 Fortunately, you do not need to know this address, since it is automatically
recognized by most networks.
 MAC addressing works at Layer 2 while IP addressing works at Layer 3
(networking and routing).
 One way to remember the difference is that the MAC addresses apply to a physical
or virtual node, whereas IP addresses apply to the software implementation of that
node.
 MAC addresses are typically fixed on a per-node basis, whereas IP addresses
change when the node moves from one part of the network to another.

12/23/2020 NETWORK LAYER 7


Functions of MAC Sub layer
 It provides an abstraction of the physical layer to the LLC and upper layers of the OSI
network.
 It is responsible for encapsulating frames so that they are suitable for transmission via
the physical medium.
 It resolves the addressing of source station as well as the destination station, or groups
of destination stations.
 It performs multiple access resolutions when more than one data frame is to be
transmitted. It determines the channel access methods for transmission.
 It also performs collision resolution and initiating retransmission in case of collisions.
 It generates the frame check sequences and thus contributes to protection against
transmission errors.
12/23/2020 NETWORK LAYER 8
Channel Allocation Method
 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 chaos 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.
 In other words, we need a set of rules (i.e. a protocol) to allow each user to
communicate and avoid interference.
12/23/2020 NETWORK LAYER 9
Channel Allocation Method
 There are a variety of solutions to this problem that are used in practice. These
solutions can be classified as:
 Static Channel Allocation
 Dynamic Channel Allocation
 Static Channel Allocation: With a static approach, the channel's capacity is
essentially divided into fixed portions; each user is then allocated a portion for all
time.
 If the user has no traffic to use in its portion, then it goes unused.
 A static allocation performs better when the traffic is predictable.
 Two common static channel allocation techniques are:
 Time Division Multiple Access (TDMA)
 Frequency Division Multiple Access (FDMA)

12/23/2020 NETWORK LAYER 10


Channel Allocation Method
Time Division Multiple Access (TDMA) – With TDMA the time axis is divided
into time slots of a fixed length.
Each user is allocated a fixed set of time slots at which it can transmit.
TDMA requires that users be synchronized to a common clock. Typically extra
overhead bits are required for synchronization.
Frequency Division Multiple Access (FDMA) – With FDMA the available
frequency bandwidth is divided into disjoint frequency bands.
A fixed band is allocated to each user. FDMA requires a guard band between user
frequency bands to avoid cross-talk.
Another static allocation technique is Code Division Multiple Access (CDMA),
which is used in many wireless networks
12/23/2020 NETWORK LAYER 11
Channel Allocation Method
 To a first approximation, if a channel has a capacity of R bps, and either FDMA or
TDMA is used, then each user will get an effective rate of R/N bps, where N is the
number of users.
 Performance of static channel allocation depends on:
 The variation in the number of users over time
 The nature of the traffic sent by the user
 If the traffic on a shared medium is from a fixed number of sources each
transmitting at a fixed rate, static channel allocation can be very efficient.
 Voice and Video (in their fixed rate forms) have this property and commonly are
placed in a shared channel using a static channel allocation.

12/23/2020 NETWORK LAYER 12


Channel Allocation Method
 Most real-life network situations have a variable number of users, usually large in
number with bursty traffic.
 If the value of N is very large, the bandwidth available for each user will be very
less. This will reduce the throughput if the user needs to send a large volume of
data once in a while.
 It is very unlikely that all the users will be communicating all the time. However,
since all of them are allocated fixed bandwidths, the bandwidth allocated to non-
communicating users lies wasted.
 If the number of users is more than N, then some of them will be denied service,
even if there are unused frequencies.

12/23/2020 NETWORK LAYER 13


Channel Allocation Method
Dynamic Channel Allocation: Dynamic channel allocation encompasses the
channel allocation schemes where channels are allotted to users dynamically as per
their requirements, from a central pool.
In dynamic channel allocation schemes, frequency channels are not permanently
allotted to any user.
Channels are assigned to the user as needed depending upon the network
environment.
The available channels are kept in a queue or a spool.
The allocation of the channels is temporary.
Distribution of the channels to the contending users is based upon distribution of the
users in the network and offered traffic load. The allocation is done so that
transmission interference is minimized.

12/23/2020 NETWORK LAYER 14


Channel Allocation Method
Dynamic channel allocation schemes can be divided into three categories −
 Interference Adaptive Dynamic Channel Allocation (IA-DCA)
 Location Adaptive Dynamic Channel Allocation (LA-DCA)
 Traffic Adaptive Dynamic Channel Allocation (TA-DCA)
Dynamic channel allocation schemes have some benefits as:
 Dynamic channel allocation schemes allots channels as needed.
 This results in optimum utilization of network resources.
 There are less chances of denial of services and call blocking in case of voice transmission.
 These schemes adjust bandwidth allotment according to traffic volume, and so are
particularly suitable for busty traffic.
Dynamic channel allocation schemes have drawback that it increases the
computational as well as storage load on the system.
12/23/2020 NETWORK LAYER 15
Channel Allocation Method
In dynamic channel allocation few assumption are included as below:
Station Model: Assumes that each of N stations/ terminals independently produce
frames. The probability of frame being generated in an interval of length t is λ,
where λ is a constant and defines the arrival rate of new frames.
Once the frame has been generated, the station is blocked and does nothing until the
frame has been successfully transmitted.
Single Channel Assumption: In this allocation all stations are equivalent and can
send and receive on that channel.
Collision Assumption: If two frames overlap in time-wise, then that’s collision.
Any collision is an error, and both frames must re transmitted. Collisions are only
possible error.

12/23/2020 NETWORK LAYER 16


Channel Allocation Method
Time can be divided into Slotted or Continuous.
 For a continuous time assumption we mean, that the frame transmission on the channel can
begin any instant of time. There is no master clock dividing the time into discrete intervals.
 In case of slotted time assumption, the time is divided into discrete slots or intervals. The
frame transmission on the channel begins only at the start of a slot. A slot may contain 0, 1,
or more frames. The 0 frame transmission corresponds to idle slot, 1 frame transmission
corresponds to successful transmission, and more frame transmission corresponds to a
collision.
Stations can sense a channel is busy before they try it.

12/23/2020 NETWORK LAYER 17


Channel Allocation Method
Channel allocation also have some protocol assumptions as below:
 N independent stations.
 A station is blocked until its generated frame is transmitted.
 Probability of a frame being generated in a period of length t is λt where, λ is the arrival rate
of frames.
 Only a single Channel available.
 Time can be either: Continuous or slotted.
 Carrier Sense: A station can sense if a channel is already busy before transmission. If the
channel is sensed as busy, no station will attempt to transmit on the channel unless and until
it goes idle.
 No Carrier Sense: Time out used to sense loss data. Stations cannot tell if the channel is in
use before trying to use it.
12/23/2020 NETWORK LAYER 18
Multiple Access Communication
Multiple access schemes are used to
allow many mobile users to share
simultaneously a finite amount of
radio spectrum.
Multiple access communication
protocols are divided into three
categories as shown in figure:
Here, we are going to discuss Random
Access Protocols.

12/23/2020 NETWORK LAYER 19


Random Access Protocols
In this, all stations have same superiority that is no station has more priority than
another station.
Any station can send data depending on medium’s state( idle or busy).
It has following two features:
 There is no fixed time for sending data
 There is no fixed sequence of stations sending data
Random access protocols are as follows:
 Pure Aloha
 Slotted Aloha
 CSMA/CD
 CSMA/CA

12/23/2020 NETWORK LAYER 20


Random Access Protocol- Aloha
 Aloha was designed for wireless LAN but is also applicable for shared medium.
 In this, multiple stations can transmit data at the same time and can hence lead to
collision and data being garbled.
 There are two versions of Aloha:
 Pure Aloha
 Slotted Aloha
 Pure Aloha: It allows the stations to transmit data at any time whenever they want.
 After transmitting the data packet, station waits for some time.
 There can be two possible cases in pure Aloha:

12/23/2020 NETWORK LAYER 21


Random Access Protocol- Aloha

12/23/2020 NETWORK LAYER 22


Random Access Protocol- Aloha
 Case-1: Transmitting station receives an acknowledgement from the receiving station.
 In this case, transmitting station assumes that the transmission is successful.
 Case-2: Transmitting station does not receive any acknowledgement within specified
time from the receiving station.
 In this case, transmitting station assumes that the transmission is unsuccessful.
 When transmission is unsuccessful, then,
 Transmitting station uses a Back Off Strategy and waits for some random amount of time
(back off time).
 After back off time, it transmits the data packet again.
 It keeps trying until the back off limit is reached after which it aborts the transmission.

12/23/2020 NETWORK LAYER 23


Random Access Protocol- Aloha
Efficiency of Pure Aloha (η) = G x e-2G
 where G = Number of stations willing to transmit
data

For maximum efficiency,


 We put dη / dG = 0
 Maximum value of η occurs at G = 1/2
 Substituting G = 1/2 in the above expression,
we get
Maximum efficiency of Pure Aloha
= 1/2 x e-2 x ½ = 1 / 2e = 0.18 = 18.4%
Maximum efficiency of Pure Aloha is very
less due to large number of collisions.
12/23/2020 NETWORK LAYER 24
Random Access Protocol- Aloha
 Slotted Aloha: Slotted Aloha divides the time of shared channel into discrete intervals called
as time slots.
 Any station can transmit its data in any time slot.
 The only condition is that station must start its transmission from the beginning of the time
slot.
 If the beginning of the slot is missed, then station has to wait until the beginning of the next
time slot.
 A collision may occur if two or more stations try to transmit data at the beginning of the same
time slot.
 Efficiency of Slotted Aloha (η) = G x e-G
 where G = Number of stations willing to transmit data at the beginning of the same time slot

 Maximum efficiency of slotted aloha is =36.8%


12/23/2020 NETWORK LAYER 25
Random Access Protocol- Aloha

12/23/2020 NETWORK LAYER 26


Difference between Pure and Slotted Aloha
Sr. No. Key Pure Aloha Slotted Aloha

Time Slot In Pure Aloha, any station can transmit In Slotted Aloha, any station can transmit data only at
1 data at any time. beginning of any time slot.
Time In Pure Aloha, time is continuous and In Slotted Aloha, time is discrete and is globally
2 is not globally synchronized. syncronized.
Vulnerable Vulnerable time = 2 x Tt. Vulnerable time = T .
3 t
time
Probability Probability of successful transmission Probability of successful transmission of data packet = G
-2G -G
of data packet = G x e xe
4
Where, G is number of participating Where, G is number of participating users
users
Maximum Maximum efficiency = 18.4%. Maximum efficiency = 36.8%.
5 efficiency
Number of Does to reduces the number of Slotted Aloha reduces the number of collisions to half thus
6 collisions collisions. doubles the efficiency.

12/23/2020 NETWORK LAYER 27


Random Access Protocol- CSMA
 In both slotted and pure ALOHA, a node's decision to transmit is made independently of
the activity of the other nodes attached to the broadcast channel.
 In particular, a node neither pays attention to whether another node happens to be
transmitting when it begins to transmit, nor stops transmitting if another node begins to
interfere with its transmission which leads to collision.
 Carrier Sense Multiple Access: CSMA was designed to minimize the chance of
collision, and therefore increase the performance.
 CSMA requires that each station first listen to the medium before sending frames.
 If the medium is idle then it sends data, otherwise it waits till the channel becomes idle.
 However there is still chance of collision in CSMA due to propagation delay.

12/23/2020 NETWORK LAYER 28


Random Access Protocol- CSMA
 For example, if station A wants to send data, it will first sense the medium. If it
finds the channel idle, it will start sending data. However, by the time the first bit of
data is transmitted (delayed due to propagation delay) from station A, if station B
requests to send data and senses the medium it will also find it idle and will also
send data. This will result in collision of data from station A and B.
 There are two important rules for polite human conversation implemented in
CSMA:
 Listen before speaking. If someone else is speaking, wait until they are done.
 In the networking world, this is termed carrier sensing - a node listens to the
channel before transmitting.
 If a frame from another node is currently being transmitted into the channel, a
node then waits ("backs off") a random amount of time and then again senses the
channel.
12/23/2020 NETWORK LAYER 29
Random Access Protocol- CSMA
 If the channel is sensed to be idle, the node then begins frame transmission. Otherwise,
the node waits another random amount of time and repeats this process.
 If someone else begins talking at the same time, stop talking.
 In the networking world, this is termed collision detection - a transmitting node listens to
the channel while it is transmitting.
 If it detects that another node is transmitting an interfering frame, it stops transmitting and
uses some protocol to determine when it should next attempt to transmit.
 These two rules are embodied in the family of CSMA (Carrier Sense Multiple Access)
and CSMA/CD (CSMA with Collision Detection) protocols.
 Many variations on CSMA and CSMA/CD have been proposed, with the differences being
primarily in the manner in which nodes perform backoff.
12/23/2020 NETWORK LAYER 30
Random Access Protocol- CSMA
 CSMA have following access modes-
 1-Persistent
 Non- Persistent
 P- Persistent
 O- Persistent
 1-Persistent: In 1-persistent, node senses the channel, if idle it sends the data,
otherwise it continuously keeps on checking the medium for being idle and
transmits unconditionally(with 1 probability) as soon as the channel gets idle.
 Non- Persistent: It is same as 1-persistent with the only difference that it checks
the medium (idle or busy) after a random amount of time (not continuously) and
transmits when found idle.

12/23/2020 NETWORK LAYER 31


Random Access Protocol- CSMA
 P- Persistent: The node senses the medium, if idle it sends the data with p
probability. If the data is not transmitted ((1-p) probability) then it waits for some
time and checks the medium again, now if it is found idle then it send with p
probability. This repeat continues until the frame is sent. It is used in Wi-fi and
packet radio systems.
 O-persistent: Superiority of nodes is decided beforehand and transmission occurs
in that order. If the medium is idle, node waits for its time slot to send data.
 Throughput & Efficiency of CSMA: It is comparatively much greater than the
throughput of pure and slotted ALOHA.
 Here, for the 1-persistent mode, the throughput is 50% when G=1 and for Non-
persistent mode, the throughput can reach up to 90%.

12/23/2020 NETWORK LAYER 32


Random Access Protocol- CSMA/ CD
 Carrier Sense Multiple Access / Collision Detection (CSMA/ CD): whenever
station transmits data-frame it then monitors the channel or the medium to
acknowledge the state of the transmission i.e. successfully transmitted or failed.
 If the transmission succeeds, then it prepares for the next frame otherwise it resends
the previously failed data-frame otherwise it resend the data frame.
 The point to remember here is, that the frame transmission time should be at least
twice the maximum propagation time, which can be deduced when the distance
between the two stations involved in a collision is maximum.
 CSMA/CD create an efficiency gain compared to other techniques random access
because there are immediate collision detection and interruption of current
transmission.

12/23/2020 NETWORK LAYER 33


Random Access Protocol- CSMA/ CA
 Carrier Sense Multiple Access / Collision Avoidance (CSMA/ CA): To detect the
possible collisions, the sender receives the acknowledgement and if there is only one
acknowledgment present (it's own) then this means that the data-frame has been sent
successfully. But, if there are 2 or more acknowledgment signals then this indicates that
the collision has occurred.
 Methods for avoiding collisions:
 Interframe space: in this case, assume that your station waits for the channel to
become idle and found that the channel is idle, then it will not send the data-frame
immediately (in order to avoid collision due to propagation delay).
 It rather waits for some time called interframe space or IFS, and after this time the
station again checks the medium for being idle.
 But it should be kept in mind that the IFS duration depends on the priority of the station.
12/23/2020 NETWORK LAYER 34
Random Access Protocol- CSMA/ CA
 Contention Window: here, the time is divided into slots.
 Say, if the sender is ready for transmission of the data, it then chooses a random
number of slots as waiting time which doubles every time whenever the channel is
busy.
 But, if the channel is not idle at that moment, then it does not restart the entire
process but restarts the timer when the channel is found idle again.
 Acknowledgment: as we discussed above that the sender station will re-transmits
the data if acknowledgment is not received before the timer expires

12/23/2020 NETWORK LAYER 35


12/23/2020 NETWORK LAYER 36
References
1. Forouzan, B. A., & Mosharraf, F. (2012). Computer networks: a top-down
approach, McGraw-Hill.
2. https://www.tutorialspoint.com/
3. https://www.slideshare.net/
4. https://www.gatevidyalay.com/
5. https://www.computernetworkingnotes.com/

12/23/2020 NETWORK LAYER 37


Thank You!

12/23/2020 NETWORK LAYER 38

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy