LLC (Logical Link Control) and MAC (Media Access Control) are two sublayers of logical link service. The difference between MAC and LLC will be clear to you after reading this article.
The functions of the data link layer are generally divided into logical sub-layers, the upper sub-layer, called LLC, interacts with the upper network layer, and the lower sub-layer, called MAC, and interacts with the lower physical layer. LLC and MAC both work together in order to give maximum output.
Although LLC is responsible for handling multiple Layer 3 protocols (multiplexing/demultiplexing) and link services such as reliability and flow control, MAC is responsible for the broadcast media fabric and media access control. The difference between MAC and LLC sublayer roles is described in this article.
Role of LLC and MAC:
LLC’s primary responsibilities are:
The network layer protocol multiplexing/demultiplexing:
LLC is multiplexed/demultiplexed by running the L3 protocol. LLC verifies the L3 protocol when receives the frames from the lower layer and delivers the datagram to the correct L3 protocol (demultiplexing) of the upper network layer.
At the sending end, LLC gets data packets from different L3 protocols (such as IP, IPX, ARP, etc.), populates the LLC header part of the frame with the L3 protocol type (multiplexed), and then transfers it to the MAC layer.
Logical link service:
LLC may choose to use the sending node to number each transmitted frame (sequence number), the receiving node to confirm each received frame (acknowledgment number), and the sending node to retransmit lost frames to provide reliable frame transmission.
It can also selectively provide flow control, allowing the receiver to control the sender’s frequency through control boxes (such as RECEIVE READY and RECEIVE NOT READY, etc.).
Depending on whether a logical connection is established between Layer 2 peers and depending on whether the frame is confirmed by the peer, LLC can be classified to provide the following types of service modes:
Service without unconfirmed connection:
This is the best-effort service, such as an IP datagram service. There is no connection establishment between L2 peers and no confirmation of peer data frames. Whenever there is data to transmit to the peer, it is sent directly without establishing any connection.
Connectionless Confirmation Service:
In this mode, data collection is sent directly between Layer 2 peers without any logical link establishment. However, each frame is numbered with a sequence number and the peer uses the confirmation number field to confirm each received frame.
This mode of service is used in scenarios where the cost of establishing the connection is higher due to additional delays, but data reliability is required.
In this mode, procedures are organized for the establishment and disconnection of logical links. Before data transmission, a logical peer-to-peer connection is established before data transmission starts by exchanging control frames (called supervisory frames). The logical connection is closed after the end of the data exchange phase.
The MAC sublayer interacts with the physical layer and is mainly responsible for framing/reframing and conflict resolution. In this regard, the MAC sublayer is responsible for creating frames from network-layer data packets and adding frame headers and frame trailers.
The frame header is composed of the layer 2 address (called MAC address) and some other fields used for control purposes, while the frame tail is composed of the CRC/checksum of the entire frame. MAC becomes responsible for transmitting the frames for interacting with the PHY (physical layer processor), after creating the frame.
At the receiving end, the MAC sublayer receives frames from the PHY and is responsible for receiving each frame and checking the frame header. It is also responsible for verifying the checksum to determine whether the frame is not damaged on the link without bit errors.
Since the calculation and verification of the checksum are computationally intensive tasks, the pan/out function is completed with dedicated hardware (such as the NIC card in the PC).
On a shared or streaming link, where multiple end nodes are connected to the same link, there must be a conflict resolution protocol running on each node to coordinate the use of the link.
The MAC sublayer is responsible for this task, it is the MAC sub-block that implements the standard conflict resolution protocols (such as CSMA / CD, CSMA, etc.).
For half-duplex links, the MAC sublayer ensures that the node only sends data on the link and it is its turn. For full-duplex point-to-point links, the conflict resolution function of the MAC sublayer is not required.
Both LLC and MAC have different functions. In terminal nodes and intermediate devices, such as L2 switches and routers, LLC functions are implemented in the network device driver software as part of the operating system, while MAC functions are implemented in dedicated hardware. This is the big difference between LLC and MAC sublayers.