# MAC Layer Protocols for Internet of Things: A Survey
## 2 Short Range MAC Layer Protocols
### Bluetooth Low Energy  
Being part of the Bluetooth v4.0 standard adopted in 2010-06-30, Bluetooth Low Energy (BLE) is also known as Smart Bluetooth. BLE is an IEEE 802.15.1 variation with better and more suitable capacities for low power applications than the classic Bluetooth Basic Rate. Devices that demand communication with both standards of Bluetooth are required to implement and support both protocol stacks due the incompatibilities among them. Star is the only topology accepted by BLE due the standard definition that does not permit physical link connections among slave devices. Any data exchanged between two slave devices shall pass through the unique master and a slave device may not be connected to two master units at the same time. These premises define the formation of a BLE star pico-net [30]. Figure 6: Bluetooth data link structure. Using a similar protocol stack as classic Bluetooth, the differences between them starts above the L2 CAP layer. Above the L2 CAP layer, BLE is the application layer that uses a set of functionalities, which are not present in the classic Bluetooth specifications. These functionalities are the Attribute Protocol (ATT), the Generic Attribute Profile (GATT), the Security Manager Protocol (SMP) and the Generic Access Profile (GAP). Figure 7 depicts the BLE protocol stack. The two main roles of BLE are: controller and host. BLE differs from the classical Bluetooth in the controller stack that defines the association methods of the devices. A slave can belong to only one pico-net during an association lifetime, and is synchronized with only one master element. A Host Controller Interface (HCI) is a communication standard applied between the slave and controller. In the Bluetooth Basic Rate, 79 channels are used with a 1 MHz bandwidth to reduce interference with adjacent channels. In Bluetooth Low Energy, the channels are defined in the 2.400-2.4835 GHz band with a 2 MHz guard band. To achieve scalability, the master device controls the number of hosts associated with it by adjusting the value of the connection interval (_ConnInterval_ parameter) between hosts and controllers. Link layer manages events generated by the hosts, at determined time intervals, using the advertising channels. Bidirectional data flow is obtained with a connection between elements, when slaves advertising packets are received by master elements. The energy save handling done at MAC layer can put the slaves in a sleeping mode by default and waking them periodically through a Time Division Multiple Access (TDMA) scheme. In the classic Bluetooth basic protocol, this layer a stop-and-wait flow control mechanism is used to provide error recovery capabilities. At BLE, the L2 CAP is an adaption of the classic Bluetooth basic protocol stack but optimized and simplified to receive the application layers designed for low energy platforms. Data exchange between the application layer and link layer are also done by L2 CAP using no retransmission techniques or flow control mechanisms as used on the classic Bluetooth. Not using retransmission or flow control mechanisms (present in the classic Bluetooth) and segmentation and reassembly capabilities, the Packet Data Units (PDU) (limited to 23 bytes in BLE) received by the application layer is delivered ready to fit the maximum size of the L2 CAP payload. When two devices are connected under a server and client association architecture, the server needs to maintain a set of attributes. The Attribute Protocol (ATT) handles the attributes of this connection like the definition of data structure used to store the information managed by the Generic Attribute Profile (GATT) that works on top of the ATT. GATT defines the client or server functionalities of a connection and this association is independent of the master or slave roles. The attributes of the server need to be accessed by the client through the requests sent, which trigger the response messages of the server.