IENA Documentation

IENA Packet is an AIRBUS packet format that is used in FTI. The packet format is fully described in a technical document issued by Airbus Referemce:RP0701637

This module supports the creating and analysis of IENA-P, IENA-M, IENA-Q, IENA-N and IENA-D packet formats.

Examples and details are available below

IENA Objects

class AcraNetwork.IENA.IENA

Class to IENA.pack() and IENA.unpack() IENA payloads.

IENA is an proprietary payload format developed by Airbus for use in FTI networks. It is usually transmitted in a UDP packet containing parameter data acquired from sensors and buses:

---2B--- ---2B-- -----------6B----------- -1B- -1B- ---2B--- ------0B to 65490B----- ---2B---
| KEY   | SIZE  | TIME SINCE START YR(US)| ST | N2 | SEQNUM |      PARAMETERS       |   END  |
-------- ------- ------------------------ ---- ---- -------- ----------------------- --------

Create an IENA packet and return the packed buffer

>>> i = IENA()
>>> i.key = 0xDC
>>> i.sequence = 1
>>> i.endfield = 0xDEAD
>>> i.keystatus = 0
>>> i.status = 0x0
>>> i.timeusec = int(10e6)
>>> i.payload = struct.pack('H',0x5)
>>> i.pack()
b'\x00\xdc\x00\t\x00\x00\x00\x98\x96\x80\x00\x00\x00\x01\x05\x00\xde\xad'

Read in some data stored in a UDP packet in a pcap file

>>> import AcraNetwork.Pcap as pcap
>>> p = pcap.Pcap("test/iena_test.pcap")
>>> rec_payload = p[0].payload
>>> i = IENA()
>>> i.unpack(rec_payload[0x2a:])  # Offset into the pcap record
True
>>> print("{:#0X}".format(i.key))
0X1A
pack() bytes

Pack the IENA payload into a binary string

Return type:

bytes

setPacketTime(utctimestamp: int, microseconds: int = 0) None

Set the packet timestamp

Parameters:
  • timestamp (int) – The seconds timestamp based on he standard timeformat

  • microseconds (int) – The microseconds part of the timestamp

unpack(buf: bytes) bool

Unpack a raw byte stream to an IENA object Accepts a buffer to unpack as the required argument

Parameters:

buf (bytes) – The string buffer to unpack

Return type:

bool

endfield: int

Trailer field in the IENA packet

property key

The IENA Key. Identifies the IENA packet type

keystatus: int

Key Status. Fully described in the IENA standard

property n2

Alias of the N2 Status.

payload: bytes

Payload of the IENA packet

sequence: int

Sequence Number. Circular counter unique per key. Wraps at 16 bits.

size: int

IENA packet size incl header. This is calculated automatically when packing the message

status: int

N2 Status. Fully described in the IENA standard

property streamid

Alias of the IENA key.

timeusec: int

Time of the first byte in the payload in us since Jan 1st of the current year

IENA-M Objects

class AcraNetwork.IENA.IENAM

Support for IENA-M packets. Message Parameters with delay field

This payload includes a defined parameter ID, a delay and a length field

All this is encapsulated inside an IENA packet as defined above:

---2B--- ---2B-- ---2B--- ------0B to 65490B----------
|PARAM  | DELAY | LENGTH | Dataset with opt 1B pad    |
-------- ------- -------------------------------------

Unpack some received packet from the network

>>> from base64 import b64decode
>>> data = b64decode('ANwADAAAAAAAAAAAAAIAAQACAAEAAN6t')
>>> i = IENAM()
>>> i.unpack(data)
>>> for param in i:
...   print(param.paramid)
1
pack()

Pack the IENA-M payload into a binary string

Return type:

bytes

unpack(buf: bytes) None

Unpack a raw byte stream to an IENA-M object Accepts a buffer to unpack as the required argument

Parameters:

buf (bytes) – The string buffer to unpack

Return type:

bool

parameters: List[MParameter]

The list of all MParameters in thie IENA-M packet Each entry is of class MParameter

MParameter Objects

class AcraNetwork.IENA.MParameter(paramid, delay, dataset)

The MParameter is a object representing each MParameter in an IENA-M packet

Parameters:
  • paramid (int) – The param ID for this parameter

  • delay (int) – The delay for this parameter

  • dataset (bytes) – The dataset payload as a string

IENA-Q Objects

class AcraNetwork.IENA.IENAQ

Support for IENA-Q packets. Message Parameters without delay field

This payload includes a defined parameter ID and a length field

All this is encapsulated inside an IENA packet as defined above:

---2B---  ---2B--- ------0B to 65490B----------
|PARAM   | LENGTH | Dataset with opt 1B pad    |
--------  ------- -----------------------------

Unpack some received packet from the network

>>> from base64 import b64decode
>>> data = b64decode('ANwACwAAAAAAAAAAAAIAAgABAADerQ==')
>>> i = IENAQ()
>>> i.unpack(data)
>>> for param in i:
...   print(param.paramid)
2
pack() bytes

Pack the IENA-Q payload into a binary string

Return type:

bytes

unpack(buf: bytes)

Unpack a raw byte stream to an IENA-Q object Accepts a buffer to unpack as the required argument

Parameters:

buf (bytes) – The string buffer to unpack

Return type:

bool

parameters

The list of all QParameters in thie IENA-Q packet Each entry is of class QParameter

QParameter Objects

class AcraNetwork.IENA.MParameter(paramid, delay, dataset)

The MParameter is a object representing each MParameter in an IENA-M packet

Parameters:
  • paramid (int) – The param ID for this parameter

  • delay (int) – The delay for this parameter

  • dataset (bytes) – The dataset payload as a string

IENA-N Objects

class AcraNetwork.IENA.IENAN

Support for IENA-N packets. Std parameters without delay field

This payload includes a defined parameter ID and payload

All this is encapsulated inside an IENA packet as defined above with this pattern repeated

The number of D-words are defined in the N2 field of the IENA header:

---2B--- ---2B-- ---2B--- ---2B---- ---2B--- ---2B---
|PARAM  | D#N   | D#N-1  |   D#-1  | ...    | D0     |
-------- ------- ------------------------------------

Unpack some received packet from the network

>>> from base64 import b64decode
>>> data = b64decode('ABoAGAAB0QYFQAAAAMX/////AAAAAAAAAAAAAAAAAAABFAAAARQBEAGALpMAAN6t')
>>> i = IENAN()
>>> i.unpack(data)
>>> print(len(i.parameters))
16
>>> print(i.parameters[0].paramid)
65535
unpack(buf: bytes) None

Unpack a raw byte stream to an IENA-M object Accepts a buffer to unpack as the required argument

Parameters:

buf (bytes) – The string buffer to unpack

Return type:

bool

parameters: List[NParameter]

List of all N-type parameters. Each entry is of class NParameter

NParameter Objects

class AcraNetwork.IENA.NParameter(paramid, dwords)

The NParameter is a object representing each NParameter in an IENA-N packet

Parameters:
  • paramid (int) – The param ID for this parameter

  • dwords (list[int]) – List of all the d-words in the parameter

IENA-D Objects

class AcraNetwork.IENA.IENAD

Support for IENA-D packets. Std parameters with delay field

This payload includes a defined parameter ID, a delay and a length field

All this is encapsulated inside an IENA packet as defined above with this pattern repeated

The number of D-words are defined in the N2 field of the IENA header:

---2B--- ---2B-- ---2B--- ---2B---- ---2B--- ---2B---
|PARAM  | DELAY | D#N    | D#-1    | ...    | D0     |
-------- ------- ------------------------------------

Unpack some received packet from the network

>>> from base64 import b64decode
>>> data = b64decode('ABoAGAAB0QYFQAAAAMX/////AAAAAAAAAAAAAAAAAAABFAAAARQBEAGALpMAAN6t')
>>> i = IENAD()
>>> i.unpack(data)
>>> print(len(i.parameters))
8
unpack(buf: bytes)

Unpack a raw byte stream to an IENA-M object Accepts a buffer to unpack as the required argument

Parameters:

buf (bytes) – The string buffer to unpack

Return type:

bool

parameters: List[DParameter]

The list of all DParameters in thie IENA-D packet Each entry is of class DParameter

DParameter Objects

class AcraNetwork.IENA.DParameter(paramid, delay, dwords)

The DParameter is a object representing each DParameter in an IENA-D packet

Parameters:
  • paramid (int) – The param ID for this parameter

  • delay (int) – The delay for this parameter

  • dwords (list[int]) – List of all the d-words in the parameter