PHY Vs MAC in IoT networking

In the context of IoT (Internet of Things) networking, the PHY (Physical) layer and MAC (Media Access Control) layer are two fundamental layers of the OSI (Open Systems Interconnection) model that play crucial roles in enabling communication between devices. They represent different layers of the networking stack and serve distinct functions.

The PHY layer occupies the lowest layer-1 of OSI stack and handles the physical aspects of communication. The MAC layer occupies the lowest layer-2 and manages access to the communication medium and ensures efficient and secure data transmission in IoT networks. Let us understand functions of phy and mac layer before we explore difference between physical and mac layer.

What is PHY Layer

PHY is the short form of Physical Layer. It is the layer-1 in OSI stack. It interfaces physical medium with MAC and upper layers. Physical medium can be copper wire, fiber optic cable, twisted pair or even wireless channel.

Function : The PHY layer is the lowest layer in the OSI model and is responsible for the physical transmission of raw bits over the communication medium.

Following are the key responsibilities of PHY layer :
➨It converts MAC layer format suitable to be transported over the medium.
➨Defines the characteristics of the physical medium, such as cables, wireless channels, or optical fibers.
➨Converts digital data into analog signals for transmission and vice versa.
➨Incorporates modulation and demodulation functionalities which transforms bits into symbols and vice versa.
➨Specifies the data transfer rate and the encoding scheme used for transmitting data over the physical medium.
➨Provides error correction capability by using convolutional encoder or turbo encoder at transmit end and suitable decoder at the receive end.
➨Describes the physical connectors, pinouts, and electrical properties required for data transmission.

PHY and MAC in OSI Stack

There are different physical layers as per different wireless and wired standards. The variation in physical layer depends on medium requirement and system performance requirement (i.e. BER, SNR, spectral efficiency or Bandwidth efficiency, power efficiency). Different PHY layers will have different FEC configurations and modulation formats.

What is MAC Layer

MAC is the short form of Medium Access Control Layer. It is the layer-2 in OSI stack. It interfaces PHY layer and Upper layers (i.e. network and above).

Function: The MAC layer operates at a higher level than the PHY layer and is responsible for managing access to the shared communication medium.

Following are the key responsibilities of MAC layer :
➨Addressing: Assigns unique MAC addresses to devices on the network for identification. MAC Header is added at the beginning of IP packet for this purpose.
➨Channel access: Controls how devices on the network gain access to the communication channel, especially in shared or wireless environments. CSMA/CD and CSMA/CA are examples of media access control protocols used in Ethernet networks.
➨Frame formatting: Divides data into frames, adds addressing information, control bits, and error-checking, creating a structured format for transmission. CRC is added at the end of frame for error detection and retransmission (using ARQ protocol).
➨Flow control: Manages the flow of data to ensure efficient communication between devices. This is achieved by segmentation (at transmit end) and re-assembly (at receive end).

Difference between PHY and MAC layer

Following table mentions difference between PHY and MAC layer.

Parameters PHY Layer MAC Layer
Layer position in OSI stack Lowest layer (i.e. Layer-1) Higher layer (i.e. Layer-2)
Major function Physical transmission of raw bits Managing access to the communication medium
Data format Deals with "bits" "Frames" are constructed for transmission including addressing information.
Layer interaction It interfaces with medium wired/wireless (RF) through ADC/DAC at one end and MAC layer at the other end. It interfaces with PHY layer at one end and network layer at the other end.
Addressing Does not involve device addressing Assigns unique MAC addresses for device identification
Implementation perspective PHY code which requires low latency and high complexity runs on FPGA MAC code runs on processor
Other name Baseband or modem Data link layer or Medium Access Control layer

Case study Physical and mac layer implementation

RF PHY and MAC interface diagram

The figure depicts hardware block diagram for PHY/MAC implementation for wireless physical layer. In this example, PHY layer modules have been ported on FPGA where as MAC layer blocks have been ported on Intel Processor. PHY layer interacts with wireless medium using radio frequency with the help of Maxim RF board. Both PHY and RF are interfaced using DAC/ADC. Refer difference between RF versus PHY layer >> and How to interface PHYSICAL and MAC layer >>.

Conclusion : From comparison between PHY vs MAC, we can conclude that PHY layer handles the physical aspects of data transmission, the MAC layer ensures orderly and efficient communication among devices in a network, making both layers indispensable for the seamless functioning of network protocols, especially in the diverse and dynamic landscape of the Internet of Things (IoT) based networking systems.

Physical layers of other standards

MAC layers of other standards

IoT posts

Networking posts

What is Difference between

RF and Wireless Terminologies