Skip to content

General architecture#

Overview#

The lab.SCHC FullSDK follows an event-driven and layered-architecture paradigm.

The diagram below depicts the overall architecture of the lab.SCHC FullSDK.

fullsdk-architecture-layers

Lab.SCHC FullSDK is the part with a dashed background and implements the layers with a black background. The layers with a white background must be provided by the integrator.

Datagram and Network layers#

Network and datagram layers provide the communication interface to the customer application. FullSDK may contain only one of the two layers. The choice is performed at build time.

Datagram layer#

The datagram layer provides the communication interface to the application. It provides an API similar to the Berkeley UDP socket API, with functions to create a socket, to send a message and to receive a message.

Network layer#

The Network layer provides an API that allows the application to send and receive raw IP packets.

C/D layer#

When FullSDK is configured with the datagram layer, the compression/decompression layer applies very little processing: it adds/removes the IP address and the UDP port to/from the packet if the socket configuration requires it.

F/R layer#

The fragmentation/reassembly layer is in charge of applying the SCHC fragmentation/reassembly mechanism when required.

The type of fragmentation to be used for downlink sessions and for uplink sessions is defined by a fragmentation profile.

When the above layer requests the F/R layer to send a packet, packet size is compared to the current layer 2 MTU. If the packet size is greater, the message is handed over to the corresponding fragmentation code. Otherwise, it is directly handed over to the MUX layer.

When a packet is received from the layer below, it is provided to the right reassembly code according to the fragmentation type set in the profile, or handed over to the layer above when it is a non fragmented packet. Ultimately, the fragmentation type is preconfigured based on the L2 technology profile.

For downlink ACK-Always and No-ACK fragmentation sessions, the F/R layer provides a polling mechanism.

MUX layer#

The multiplexer layer is in charge of serializing the access to the layer 2, when a packet transmission is required. It provides a simple priority mechanism and a one-stage buffer.

When the MUX layer receives a packet, it checks its rule ID. Depending on the rule ID, the packet is handed over to the F/R layer, using the corresponding callback function: the one for processing a packet part of an uplink fragmentation session, or the one for processing a non fragmented packet or a packet part of a downlink fragmentation session.

L2A layer#

The Layer 2 Adaptation layer is in charge of providing a standardized interface to the MUX layer, regardless of what the layer 2 might be.

Management layer#

The management layer allows the configuration of the different layers. It also maps various FullSDK buffers to the memory block passed by the application layer at initialization time. Additionally, it informs the application layer of specific events:

Flow control#

Flow control can be considered at two levels: for the L2A layer and for the F/R layer. The main principles for flow control are:

  • No new message transmission request should be accepted by the L2A layer while one message is already waiting for its transmission.
  • No new uplink fragmentation session request is started by the F/R layer while an uplink fragmentation session is in progress.

Consequently, it is up to the application layer to perform buffering, if it requires it. This way, the application has total control on message priority handling, when needed.