1.2.2.1 How the Library Works

PLC PHY Frames Serialization

PLC Sniffer mission is to provide information about every frame present in the PLC medium. This information includes the frame itself and some parameters related to PLC communications. Sniffer library provides functions which perform the encoding of the frames along with their related parameters and store them in a buffer that can be later sent through a Serial interface. On the other side of this interface, the Microchip PLC Sniffer Tool will receive the encapsulated packets, process and present them on a GUI to ease visualization and further analysis. This allows monitoring the PLC medium in real time.

Library provides separate functions to be called either when frames are transmitted, and when are received by a device. This leads to 2 different modes of operation for the PLC Sniffer:

  • Stand-alone Sniffer. A device which runs an application with the only purpose of acting as a sniffer. In this case, device wil never send any frame, and thus only the received frames serialization will be used.

  • Embedded Sniffer. This mode is used when a regular device embeds sniffer capabilities. In this case, received frames will be serialized (after sending them to upper layers for regular processing), and also transmitted frames will be sent to the sniffer library so they are serialized (to simulate reception of own frames).

Parameters Encoded with Frames for Serialization

The parameters included to provide additional information of the PLC frames depend on the used PLC profile, G3 or PRIME.

G3 parameters

ParameterDescription
Modulation Type/SchemeModulation in which PLC frame is encoded (Fixed to '0' for ACK frames)
Tone MapBitmap indicating which frquencies are used for Payload encoding (Fixed to '0' for ACK frames)
Num SymbolsNumber of OFDM symbols that frame payload consists of (Fixed to '0' for ACK frames)
SNRIndicator of frame reception quality (Fixed to '0xFF' for ACK frames and Transmitted frames)
Delimiter TypeField to indicate frame type (Data with or without ACK request, ACK, NACK)
Time IniTimestamp for the start of frame in line
Time EndTimestamp for the end of frame in line
RSSIReceived Signal Strength Indicator (Fixed to '0xFFFF' for Transmitted frames)
LengthFrame lenght
PDUFrame buffer

Note: Number of symbols have to be provided to sniffer library, by means of a dedicated function, before calling encoding functions.

PRIME parameters

ParameterDescription
Modulation SchemeModulation in which PLC frame is encoded
Num SymbolsNumber of OFDM symbols that frame payload consists of
SNRIndicator of frame reception quality (Fixed to '7' for Transmitted frames)
CINR AverageAuxiliary indicator of frame reception quality (averaged) (Fixed to '60' for Transmitted frames)
CINR MinAuxiliary indicator of frame reception quality (minimum) (Fixed to '0xFF' for Transmitted frames)
ChannelPLC Channel in which device is operating
BER AverageBit Error Rate estimation (averaged) (Fixed to '0' for Transmitted frames)
BER MaxBit Error Rate estimation (maximum) (Fixed to '0' for Transmitted frames)
Time IniTimestamp for the start of frame in line
Time EndTimestamp for the end of frame in line
RSSIReceived Signal Strength Indicator (Fixed to '140' for Transmitted frames)
LengthFrame lenght
PDUFrame buffer

Note: Number of symbols have to be provided to sniffer library, by means of a dedicated function, before calling encoding functions.

PLC PHY Sniffer Configuration

There are some parameters that have to be correctly configured in a device in order to communicate with other peers in the network. These parameters can be configured on the Sniffer library so frames are correctly received and/or parameters correctly computed. Parameter difer depending on the used PLC profile, G3 or PRIME.

G3 configuration params

G3 has one configuration parameter that, if different between 2 devices, blocks communication. This parameter is the Tone Mask and it indicates which tones are used for frame encoding/decoding in the working band and which ones are not. Sniffer library provides a dedicated function SRV_PSNIFFER_ConvertToneMask to convert a Tone Mask configuration received from the Microchip PLC Sniffer Tool and then write it to the corresponding PLC PHY IB to be used for encoding/decoding.

PRIME configuration params

PRIME has one configuration parameter that, if different between 2 devices, blocks communication. This parameter is the PLC Channel and it indicates which subband is being used inside the available band. Sniffer library provides a dedicated function SRV_PSNIFFER_SetPLCChannel to set the configuration received from the Microchip PLC Sniffer Tool and then write it to the corresponding PLC PHY IB.