Skip to content

feat interference detect

Romain Jacob edited this page Mar 13, 2019 · 6 revisions

Objective

Describe the interference detection feature in Baloo.

Description

Certain protocols try to detect situations of (hopefully sporadic) interference. Baloo caters for such need in a very simple yet efficient way: it "periodically" assess the power level on the radio channel. The implementation of this feature depends on the radio capability, which makes it inherently platform-dependent.

Baloo lets the user select two configuration parameters:

  • a power threshold in dBm,
  • a minimal number of threshold crossing to assess that there is interference.

The assessment is made at the end of the communication slots, before the on_control_post() or on_slot_post() callback is executed.

This feature is disabled by default.

Availability

Available for all supported platforms.

Compatibility

Not compatible with the use of multiple primitives.
Compatible with all other features.

Using the feature

The interference detection feature is implemented in an independent Contiki process called gmw_noise_detection. If the feature is active, the middleware polls the gmw_noise_detection process at the beginning of each slot, after it has started the execution of the communication primitive. The process yields once it detects that the communication has ended.

The activation and configuration of this feature is controlled by the following parameters

#define GMW_CONF_USE_NOISE_DETECTION 
#define GMW_CONF_HIGH_NOISE_THRESHOLD    
#define GMW_CONF_HIGH_NOISE_MIN_COUNT 

When setting these parameters, the user must keep in mind that, in general, every node trasmits during every communication slot (since we are using Glossy). Thus, one must calibrate the parameters such that a node does not falsely assess that there is interference only because it was itself transmiting.

After each slot, the callback function passes to the NET layer an event (of type gmw_pkt_event_t event) to inform on the past slot execution. There are six possible events:

typedef enum {
  GMW_EVT_PKT_OK        = 0,    /* Successful Glossy flood (send or receive) */
  GMW_EVT_PKT_CORRUPTED = 1,    /* A Glossy flood detected but corrupted */
  GMW_EVT_PKT_GARBAGE   = 2,    /* Something received but not a Glossy flood */
  GMW_EVT_PKT_SILENCE   = 3,    /* Nothing received at all */
  GMW_EVT_PKT_MISSED    = 4,    /* Packet missed (bad timing) */
  GMW_EVT_PKT_SKIPPED   = 5     /* Slot skipped */
} gmw_pkt_event_t;
  • For the initiator of a slot, the middleware always returns GMW_EVT_PKT_OK. This is also returned in case of a successful reception.
  • Corrupted packets are identified as receptions where the packet preamble is detected, but either the packet header or CRC is wrong.
  • The interference detection comes in when no packet preamble is detected:
  • If the middleware assesses that there was interference during the slot, it returns GMW_EVT_PKT_GARBAGE.
  • Otherwise, the middleware returns GMW_EVT_PKT_SILENCE.
  • GMW_EVT_PKT_MISSED is returned to the NET layer in case of a timing problem.
  • GMW_EVT_PKT_SKIPPED is returned to the NET layer if the middleware was instructed to skip the communication slot.

Some additional functions are available to the user (depending on the platform). Refer to gmw-noise-detect.h file for more details.

Example

The baloo-test-corrupted application (see \examples) provides an example of how to use this feature.