1.2.1 G3 Adaptation Layer Description
Adaptation Layer inside G3 Stack
G3 Adaptation Layer comprises everything above the MAC Layer(s) and below the IPv6 Layer, as seen on the figure.
It contains 3 different blocks, according to different functionalities: LBP, LOADng and 6LoWPAN.
LBP
LoWPAN Bootstrapping Protocol. Manages Network Discovery and subsequent Network Starting (for PAN-Coordinators) or Network Joining procedure (for PAN-Devices). It provides an API so upper layers can decide when and in which conditions a G3 Netwok is Started/Joined by a G3 Device.
Provided functionalities are:
Network Discovery: Node sends a Beacon Request frame, and waits for Beacon frames in response. Each received Beacon triggers a BeaconNotifyIndication call to application layer, containing quality information and the PAN Id of the Network where Beacon comes from.
Network Start (for PAN Coordinators): After checking surrounding existing Networks via Network Discovery, a PAN Coordinator Application can Create (start) an new G3 Network (PAN) using this functionality.
Network Join (for PAN Devices): After collecting information from existing Networks via the received Beacons during a Network Discovery, a PAN Device Application can decide which G3 Network (PAN) to Join using this functionality.
Network Leave (for PAN Devices): At any time, a Device Application can decide to leave the Network using this mechanism.
Network Kick (for PAN Coordinators): At any time, a Coordinator Application can decide to kick a Device out of the Network using this mechanism.
Network Rekeying (for PAN Coordinators): At any time, a Coordinator Application can change the GMK (Group Master Key) to be used for secured data exchange in the Network by means of this functionality.
LOADng
It is the Routing Protocol used by G3. It stands for "Lightweight On-demand Ad hoc Distance-vector routing protocol - next generation". As its name states (on-demand) it is a reactive protocol, in which routes are automatically created in case they are not known when data has to be sent to any destination, and which routes are not refreshed if no data is sent through them.
Applications do not need to care about route creation, as previously explained, but anyhow Adaptation layer offers the following primitives related to Routing:
Route Discovery: Triggers a Route creation process towards the target destination and returns the result (success or not) of route creation.
Path Discovery: This functionality provides information about the Route to a certain destination. A frame is build hop by hop containing information about each hop of the Route, in both Forward and Reverse direction. In case a Route is missing/broken, only the available part of the Route is reported (no route is created by this process).
Note: LOADng can be disabled on the G3 Stack. This can be useful in case an upper layer routing mechanism is used.
6LoWPAN
The 6LoWPAN layer serves mainly 2 duties:
Manages IPv6 Data frames transmission and reception.
Extracts and translates IPv6 addressing to/from G3 Addressing.
Compress/Decompress IPv6 Headers (if compression is enabled).
Performs fragmentation and reassemby of fragments to fit MAC layer requirements.
Dispatches other frame types to their corresponding modules (LBP and LOADng) upon reception, and builds the proper header for frames from such modules before transmission.
Management
This is not depicted on the block diagrams, but Adaptation layer provides auxiliary functions, such as:
G3 Stack initialization and start.
G3 State Machine maintenance.
G3 callback functions assignment, to set the functions that handle events coming from the G3 Stack.
Get and Set parameters of Parameter Information Base (PIBs), at both Adaptation and MAC levels.
G3 Stack Reset request.