What is PHY vs MAC | Difference between PHY and MAC layer
This page compares PHY vs MAC layers and mention difference between PHY and MAC layer. This page on PHY vs MAC helps reader understand basics of PHY layer such as what is PHY medium used, frequency, data rate, modulation, code rate and so on. PHY and MAC layers of wlan, wimax, zigbee, zwave, bluetooth are also mentioned.
Both of these are layers reside in OSI stack or OSI 7 layer model. They have their own functions as well as they support each other in order to provide reliable communication between peer network layers of two IP enabled devices. Layer-1 is known as PHY and Layer-2 is known as MAC. Figure depicts positions of these layers in OSI stack.
What is PHY Layer
PHY is the short form of Physical Layer or medium. 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.
Following are the functions of PHY layer:
• It converts MAC layer format suitable to be transported over the medium.
• It adds forward error correction functionality to enable error correction at the receiver.
• It adds modulation and demodulation modules to incorporate modulation and demodulation functionalities. This will convert bits into symbols for long distance transmission as well as to increase bandwidth efficiency.
Following table-1 mentions what 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).
Following are the functions of MAC layer:
• It incorporates MAC header at the start of upper layer IP packet and CRC at the end of IP packet. MAC header includes packet length field which will help receiver know about total length of packet it is going to receive. CRC will help in error detection. It will help receiver know whether received packet is erroneous or not.
• Incorporates ARQ functionality as a means for requesting retransmission in case of errors. This retransmission request is initiated by the receiver to the transmitter.
• Takes care of resource allocation and maintenance for the requesting subscribers or clients of the service.
• Enable flow control by segmentation (at transmit end) and re-assembly (at receive end) of packets. This is also known as fragmentation and reassembly. The size of the segmentation depends on transport payload of the medium. For example, in case of OFDM based systems such as wimax or wlan, the payload size depends on number of data carriers in a symbol or slot.
Following table-2 mentions MAC layers of various standards.
|MAC Layer||RF Wireless World Reference link|
|WLAN MAC as per 11a and 11ac standard||
WLAN MAC Layer-1➤
WLAN MAC Layer-2➤
WLAN 11ac MAC Layer➤
|WiMAX MAC Layer as per IEEE 802.16d standard||WiMAX MAC layer as per OFDM➤|
|Zigbee MAC Layer||Zigbee MAC layer➤|
|Bluetooth MAC||Bluetooth MAC layer➤|
|Zwave MAC||Zwave MAC layer➤|
|WBAN MAC||WBAN MAC layer➤|
Difference between PHY and MAC layer
Following table mentions difference between PHY and MAC layers.
|Parameters||PHY Layer||MAC Layer|
|Position in OSI stack||Layer-1||Layer-2|
|Other name||Baseband or modem||Data link layer or Medium Access Control layer|
|Unit of data exchanged||Bits||Frames|
|Interfaces||It interfaces with medium wired/wireless (RF) through ADC/DAC at one end and MAC layer at the other end||It interfaces with PHY at one end and network layer at the other end|
|Functions||• Error correction, modulation at PHY Tx, demodulation at PHY Rx etc.
• Makes data robust enough to travel across channel and other impairments so that the data can be retrieved errorless at the receiver, etc.
|• Flow control between Transmitter and receiver
• Re-transmission of frames based on error detection using CRC
• Medium Access Control among multiple hosts
• Resource allocation etc.
|Implementation||PHY code which requires low latency and high complexity runs on FPGA||MAC code runs on processor|