Network Manager

Overview

The NetworkManager is responsible for initializing bearers and selecting the appropriate one for external communications.

Configuration

The NetworkManager configuration parameters are listed under the item network in the ConfigStore:

Other settings are bearer specific and in the general form of network.bearer.BEARERNAME.bearersetting

WARNING

If network.retry and network.retryperiod are not specified, specific bearer configuration is mandatory

Architecture

The NetworkManager is composed of two modules:

Functionalities

The following diagram presents the initialization of the NetworkManager (network.activate = true).

Figure 1: NetworkManager init()

- The NetworkManager is started in a disconnected state - When the Agent starts up, if ConfigStore parameter network.activate is true, the NetworkManager is required and the init() function is called - The init function initializes one at a time each bearer declared in the ConfigStore (network.bearer.BEARERNAME) - The connect function searches according to the network.bearerpriority list an available bearer for external communications. - If an appropriate bearer is found the NetworkManager emits the signal (CONNECTED), if not (DISCONNECTED). - The NetworkManager will trigger a reboot when the number of failure equals maxfailure (only if maxfailure is defined in the ConfigStore).

The NetworkManager allow to connect a specific bearer at anytime. The following diagram illustrates this feature.

Figure 2: NetworkManager connect(bearer)

The Mounting and Selecting stages are describes and the two following diagrams

Figure 3: NetworkManager mount()
image
Figure 4: NetworkManager select()

Server connection

The NetworkManager first mission is to ensure connectivity for a communication action (i.e communication to the server).
The following figure illustrates the connection algorithm.

Figure 5: Ensure connectivity for a communication action

NetworkManager API

Functions calls

Events


It raises specifics events on connection / deconnection:

where bearername can be GPRS, ETH...
All those events are raised with "netman" as emitter

Bearers API

Function calls

Bearers are instancied and initialized by the NetworkManager. They must provide following functions:

Linux target specific bearer executables

In order to do the real work the bearer instance call an executable to mount/unmount the Linux network interface. The executable name is the bearer name: BEARERNAME, like: ETH or GPRS.

Those executables are meant to be target specific, while bearer instance logic must be related to embedded system only.
Those executables must use system status code and stdout to sent data to bearer instance within Agent.
As the only constraint is to be executable, those features can be done by a shell script (like those provided in Agent), or using any other language that produces linux executable.

WARNING

The script take a "command" as first parameter. Depending on the command, more parameters may follow.