NPD Documentation

NPD is a TTC payload format usual encapsulated in UDP payloads. It is commonly known as DARv3

This module supports the creating and analysis of NPD packets

In typical use, a UDP payload is captured from the network or read from a PCAP file. This is then passed to the NPD.unpack() method which converts it into an NPD packet

NPD packets consists of NPD Segments which are handled by NPDSegment

Examples and details are available below

NPD Objects

class AcraNetwork.NPD.NPD

Class to pack and unpack NPD payloads. The segments will be unpacked for specific defined segements

For unknown data types, the class NPDSegment will be used

>>> from base64 import b64decode
>>> import AcraNetwork.iNetX as inetx
>>> data = b64decode('NVAADAMEAAoAAAAB6wAAAQAAAAUAAAADAA0AAQhAAAAA////AAAAAwAMAAEIQQEA')
>>> n = NPD()
>>> n.unpack(data)
True
>>> print(f"{n.datatype:#0X}")
0X50
>>> for segment in n.segments:
...    print(f"{segment}")
RS232 NPD Segment. TimeDelta=3 Segment Len=13 ErrorCode=0X0 Flags=0X1 Block_Status=0X840 DataLen=3
RS232 NPD Segment. TimeDelta=3 Segment Len=12 ErrorCode=0X0 Flags=0X1 Block_Status=0X841 DataLen=1
pack() bytes

Pack the NPD object into a binary buffer

unpack(buffer: bytes) bool

Unpack a string buffer into an NPD object

Parameters:

buffer (bytes) – A string buffer representing an NPD packet

Return type:

None

datasrcid: int

A unique data source identifier for each data source.

datatype: int | None

A unique identifier for the type of data collected in the packet

flags: int

Flags [0]-Unlocked timestamp [1]-Packet fragmentation [2]-Relative Time Count Present

hdrlen: int

Header Length

mcastaddr: str

The 32-bit IP multicast address used as the destination address of the packet.

segments: List[NPDSegment | ACQSegment | PCMPacketizer | RS232Segment | MIL1553Segment]

List of all the data segments

sequence: int

Sequence number

timestamp

The content of this field is based upon the R bit in the flags field of the NPD Packet Protocol header.

version: int

Version

NPDSegment Objects

class AcraNetwork.NPD.NPDSegment

NPD Payloads are split into segments. This class will pack and unpack segments

pack() bytes

Pack the NPD object into a binary buffer

Return type:

str

unpack(buffer: bytes) bytes

Unpack a string buffer into an NPD segment. Return the remaining buffer so that the next segment can iteratively be unpacked

errorcode: int

This field has a zero value if there are no errors

flags: int

[2:1] Fragmentation state flag

property payload: bytes

Payload of segment :return:

segmentlen: int

The length of the segment header and data in bytes excluding padding.

timedelta: int

The R-bit in the Flags field of the packet header dictates the format of this field.

ACQSegment Objects

class AcraNetwork.NPD.ACQSegment

ACQ MPCM segments. Defined as 0xA1 in the NPD specification

unpack(buffer)

Unpack a string buffer into an NPD segment. Return the remaining buffer so that the next segment can iteratively be unpacked

PCMPacketizer Objects

class AcraNetwork.NPD.PCMPacketizer

PCM Packetizer Segments for the ADAU PCM module

A429Segment Objects

class AcraNetwork.NPD.A429Segment

RS232Segment Objects

class AcraNetwork.NPD.RS232Segment

The RS-232 segment header encapsulates data captured by the MBIM-232N-1 acquisition module.

pack() bytes

Pack the RS232 Segment object into a binary buffer

unpack(buffer: bytes)

Unpack a string buffer into an RS232 segment. Return the remaining buffer so that the next segment can iteratively be unpacked

Parameters:

buffer (str) – A string buffer representing an RS232 segment

Return type:

str

MIL1553Segment Objects

class AcraNetwork.NPD.MIL1553Segment

The MIL-STD-1553 segment encapsulates MIL-STD-1553 messages

unpack(buffer: bytes) bytes

Unpack the buffer into the MIL1553Segment object. Return the remaining bytes after unpacking