In most networks, multiple nodes share a communication medium for transmitting their data packets. The medium access control (MAC) protocol is primarily responsible for regulating access to the shared medium. The choice of MAC protocol has a direct bearing on the reliability and efficiency of network transmissions due to errors and interference in wireless communications and to other challenges. Energy efficiency also affects the design of the MAC protocol. A trade energy efficiency for increased latency or a reduction in throughput. Responsibilities of MAC layer include: l decide when a node accesses a shared medium, resolve any potential conflicts between competing nodes, correct communication errors occurring at the physical layer, perform other activities such as framing, addressing, and flow control The data link layer is a second layer of the OSI reference model or the IEEE 802 reference model (which divides the data link layer into logical link control and medium access control layer). The choice of a medium access protocol has a substantial impact on the performance and energy efficiency of a WSN. MAC protocols should also be designed to accommodate changes in network topology and traffic characteristics like Latency, throughput, and fairness among competing nodes determined or affected by the characteristics of the MAC layer.
Related Article - https://www.geeksforgeeks.org/multiple-access-protocols-in-computer-network/