Page 512 - From GMS to LTE
P. 512

498  From GSM to LTE-Advanced Pro and 5G

            Preamble
                   Access
                   Code             Payload                CRC

             1 byte  4 bytes       2–27 bytes             3 bytes

            Figure 7.29  A BLE 4.0/4.1 link layer packet.


            only changed at the beginning of a connection event, which can take between 7.5 ms
            and 4 seconds. As will be described below there is no continuous transmission for the
            entire duration of a connection event and a new channel is only selected at the begin-
            ning of a new connection event, and hence the hopping rate depends on how long the
            connection event is configured for at the beginning of a connection [25].
             Next in the protocol stack comes the Link Layer (LL), which is usually implemented
            in hardware as its tasks are relatively simple but have to be executed very quickly and
            with tight timing constraints. The link layer is responsible for tasks such as preamble
            generation, packet framing, random number generation and encryption. Figure 7.29
            shows how a BLE packet looks at the link layer level. Only one packet format is used and
            it begins with an 8‐bit preamble, followed by a 4‐byte access address that is randomly
            generated for a connection, 2 to 27 bytes of user data and a 3‐byte checksum. The con-
            tent of the user data field is determined by the next higher protocol in the stack.
             The shortest possible BLE packet therefore has 10 bytes or 80 bits and the longest
            possible packet is 35 bytes or 280 bits. In BLE 4.2 the payload size was extended to up to
            257 bytes to accommodate new usage scenarios such as IPv6 transfer over BLE.
             On the link layer a device can have four different roles. When no connection is estab-
            lished a device can either be an advertiser, which means it periodically sends advertising
            packets with a size of up to 31 bytes on the three advertising channels so that remote
            devices can find and connect to them. If a device acts as a non‐connectable beacon it
            also sends advertisement packets which contain the broadcast content and the informa-
            tion that they are only broadcasting information and that connectivity cannot be estab-
            lished. Devices listening for advertisement packets are referred to as ‘scanners’ in the
            specification. If a device wants to connect to an advertising device it acts as a master for
            the connection while the advertising device acts as slave. As slave devices have fewer
            responsibilities than master devices their hardware can potentially be produced more
            cheaply [26].
             Like in ‘classic’ Bluetooth the next layer in the protocol stack is L2CAP (Logical Link
            Control and Adaptation Layer Protocol). Its main task is similar to TCP in the IP world,
            i.e. it allows several applications to communicate simultaneously over a single channel
            by multiplexing and de‐multiplexing their data packets. In BLE, L2CAP multiplexes:

               The exchange of management information that is necessary to configure the link and
            ●
              for devices to detect which services it makes available to the remote device, i.e. the
              variables that can be read and written to. This is part of SMP (Security Manager
              Protocol) and GAP (Generic Access Protocol), which are described in the next section.
               The exchange of user data, for which ATT (Attribute Protocol) and GATT (Generic
            ●
              Attribute Protocol) are used. In practice this means reading and writing values to and
              from remote variables.
   507   508   509   510   511   512   513   514   515   516   517