This page documents the byte-level layout of every command and response in the NAI Ethernet Protocol. It’s the authoritative source for what goes on the wire.
If you’re new to the protocol, start with NAI Ethernet Protocol Overview — it explains what each command category is for and when to reach for it. If you’re writing C code that sends or receives these messages, see NAI Ethernet Protocol APIs — most of this byte layout is built and decoded for you by the SSK.
Note
The protocol described here is shared across current Gen 5 and Gen 6 NAI motherboards. Gen 6 adds a small set of additional command variants — see Gen 6 Extensions at the bottom of this page.
Common Fields
Every command and response is wrapped in this envelope:
Field
Description
Preamble
Always 0xD30F. Marks start of frame.
SequenceNo
Pairs a response with the originating command.
TypeCode
Identifies command or response type.
Length
Total bytes in the frame (Preamble through Postamble).
Payload
Command- or response-specific data.
Postamble
Always 0xF03D. Marks end of frame.
All multibyte fields are big-endian.
Flags
Most register-style commands take a 2-byte Flags field:
Bit 1 — Use SERDES blocks if supported: 0 = do not use, 1 = use. Some module firmware does not advertise SERDES block capability correctly; this bit lets you override.
Bit 4 — Register size: 0 = 32-bit, 1 = 16-bit.
SequenceNo for Unsolicited Responses
TDR and IDR responses are unsolicited — the board generates the SequenceNo so the host can identify the originating TDR or IDR.
Count (2 bytes) — number of registers to read or write. With the 16-bit flag set, Count means 16-bit words; with the 32-bit flag set, 32-bit words.
Stride (2 bytes) — bytes to advance the address per access. Must be a multiple of the register size. Stride 0 reads or writes the same address Count times (useful for FIFOs). Stride equal to the register size walks the addresses contiguously.
MaskValueReg
Name
Value
TypeCode
0x1005
Length (bytes)
16+(8 OR 4)
Flags
XX
Register Address
XXXX
Value
XXXX or XX
Mask
XXXX OR XX
Postamble
0xF03D
MaskValueReg Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9005
Length (bytes)
10
Postamble
0xF03D
Block Commands
A Block is a saved list of register addresses that can be read or written in one round trip. All registers in a block share the same flags.
A block definition consists of:
BlockId (2 bytes).
Flags (2 bytes) — same definition as ReadRegs/WriteRegs. Bit 0 controls onboard/off-board, Bit 4 controls register size.
Register Count (2 bytes).
Register Addresses — (Register Count × 4) bytes.
Block commands don’t support mixed onboard / off-board addressing or mixed register sizes within a single block — use ZBlocks for that.
SetBlockConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1010
Length (bytes)
16+(RegisterCount*4)
BlockId
1→16
Flags
XX
Register Count
1→MaxRegister allowed in Block
Register Addresses
XX…XX
Postamble
0xF03D
SetBlockConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9010
Length (bytes)
10
Postamble
0xF03D
GetBlockConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1011
Length (bytes)
12
BlockId
1→16
Postamble
0xF03D
GetBlockConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9011
Length (bytes)
14+(RegisterCount*4)
Flags
XX
Register Count
1→MaxRegister allowed in Block
Register Addresses
XX…XX
Postamble
0xF03D
ClearBlockConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1012
Length (bytes)
12
BlockId
1→16
Postamble
0xF03D
ClearBlockConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9012
Length (bytes)
10
Postamble
0xF03D
ReadBlock Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1013
Length (bytes)
12
BlockId
1→16
Postamble
0xF03D
ReadBlock Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9013
Length (bytes)
10 + (RegisterCount4 OR RegisterCount2)
Payload
XX…XX
Postamble
0xF03D
WriteBlock Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1014
Length (bytes)
12+(RegisterCount4 OR RegisterCount2)
BlockId
1→16
Register Value(s)
XXXX … XXXX
Postamble
0xF03D
WriteBlock Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9014
Length (bytes)
10
Postamble
0xF03D
ZBlock Commands
A ZBlock is like a Block but each register address carries its own per-address flags, so onboard and off-board addresses can be mixed in the same ZBlock. The register-size flag still has to be consistent.
A ZBlock definition consists of:
ZBlockId (2 bytes).
Flags (2 bytes) — only Bit 4 applies at this level (register size).
Register Count (2 bytes).
Register Address Flags — (Register Count × 2) bytes. Each per-address flag’s Bit 0 controls onboard vs. off-board for that address.
Register Addresses — (Register Count × 4) bytes.
SetZBlockConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1050
Length (bytes)
16+(RegisterCount*6)
ZBlockId
1→16
Flags
XX
Register Count
1→MaxRegister allowed in ZBlock
Register Address Flags
XX…XX
Register Addresses
XX…XX
Postamble
0xF03D
SetZBlockConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9050
Length (bytes)
10
Postamble
0xF03D
GetZBlockConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1051
Length (bytes)
12
ZBlockId
1→16
Postamble
0xF03D
GetZBlockConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9051
Length (bytes)
14+(RegisterCount*6)
Flags
XX
Register Count
1→MaxRegister allowed in ZBlock
Register Address Flags
XX…XX
Register Addresses
XX…XX
Postamble
0xF03D
ClearZBlockConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1052
Length (bytes)
12
ZBlockId
1→16
Postamble
0xF03D
ClearZBlockConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9052
Length (bytes)
10
Postamble
0xF03D
ReadZBlock Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1053
Length (bytes)
12
ZBlockId
1→16
Postamble
0xF03D
ReadZBlock Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9053
Length (bytes)
10 + (RegisterCount4 OR RegisterCount2)
Payload
XX…XX
Postamble
0xF03D
WriteZBlock Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1054
Length (bytes)
12+(RegisterCount4 OR RegisterCount2)
ZBlockId
1→16
Register Value(s)
XXXX … XXXX
Postamble
0xF03D
WriteZBlock Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9054
Length (bytes)
10
Postamble
0xF03D
Timer Driven Response (TDR) Commands
TDRs execute a list of commands on a fixed timer. Up to 16 TDRs can be defined, each with up to 4 commands.
A TDR definition consists of:
TDR Id (2 bytes) — 1 to 16.
Response Protocol (2 bytes) — 0 = TCP, 1 = UDP.
Response IP Address Length (2 bytes) — 4 for IPv4, 16 for IPv6.
Response Address (4 or 16 bytes) — destination IP for responses.
Response Port (2 bytes) — destination port for responses.
Period (2 bytes) — milliseconds, 40 to 65535.
Command Count (2 bytes).
Commands — each a full ReadRegs, WriteRegs, ReadBlock, or WriteBlock frame including its own header and trailer.
SetTDRConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1020
Length (bytes)
22+(4 OR 16) + Commands
TDR Id
1→16
Response Protocol
0-TCP OR 1-UDP
Response IPAddressLength
4-IPv4 OR 16-IPv6
Response IPAddress
XX…XX
Response Port
XX
Period (ms)
40→65535
CommandCount
1→4
Command 1
XX…XX
Command 2
XX…XX
…
XX…XX
Command N
XX…XX
Postamble
0xF03D
SetTDRConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9020
Length (bytes)
10
Postamble
0xF03D
GetTDRConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1021
Length (bytes)
12
TDR Id
1→16
Postamble
0xF03D
GetTDRConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9021
Length (bytes)
20+(4 OR 16) + Commands
Response Protocol
0-TCP OR 1-UDP
Response IPAddressLength
4-IPv4 OR 16-IPv6
Response IPAddress
XX…XX
Response Port
XX
Period (ms)
40→65535
CommandCount
1→4
Command 1
XX…XX
Command 2
XX…XX
…
XX…XX
Command N
XX…XX
Postamble
0xF03D
ClearTDRConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1022
Length (bytes)
12
TDR Id
1→16
Postamble
0xF03D
ClearTDRConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9022
Length (bytes)
10
Postamble
0xF03D
StartTDR Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1023
Length (bytes)
12
TDR Id
1→16
Postamble
0xF03D
StartTDR Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9023
Length (bytes)
10
Postamble
0xF03D
StopTDR Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1024
Length (bytes)
12
TDR Id
1→16
Postamble
0xF03D
StopTDR Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9024
Length (bytes)
10
Postamble
0xF03D
Interrupt Driven Response (IDR) Commands
IDRs execute a list of commands when an interrupt vector fires. Up to 16 IDRs can be defined, each with up to 4 commands.
An IDR definition consists of:
IDR Id (2 bytes) — 1 to 16.
Response Protocol (2 bytes) — 0 = TCP, 1 = UDP.
Response IP Address Length (2 bytes) — 4 for IPv4, 16 for IPv6.
Response Address (4 or 16 bytes) — destination IP for responses.
Response Port (2 bytes) — destination port for responses.
Vector (4 bytes) — 0x00000000 to 0xFFFFFFFF.
Command Count (2 bytes).
Commands — each a full ReadRegs, WriteRegs, ReadBlock, or WriteBlock frame including its own header and trailer.
SetIDRConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1030
Length (bytes)
24+(4 OR 16) + Commands
IDR Id
1→16
Response Protocol
0-TCP OR 1-UDP
Response IPAddressLength
4-IPv4 OR 16-IPv6
Response IPAddress
XX…XX
Response Port
XX
Vector
XXXX
CommandCount
1→4
Command 1
XX…XX
Command 2
XX…XX
…
XX…XX
Command N
XX…XX
Postamble
0xF03D
SetIDRConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9030
Length (bytes)
10
Postamble
0xF03D
GetIDRConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1031
Length (bytes)
12
IDR Id
1→16
Postamble
0xF03D
GetIDRConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9031
Length (bytes)
22+(4 OR 16) + Commands
Response Protocol
0-TCP OR 1-UDP
Response IPAddressLength
4-IPv4 OR 16-IPv6
Response IPAddress
XX…XX
Response Port
XX
Vector
XXXX
CommandCount
1→4
Command 1
XX…XX
Command 2
XX…XX
…
XX…XX
Command N
XX…XX
Postamble
0xF03D
ClearIDRConfig Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1032
Length (bytes)
12
IDR Id
1→16
Postamble
0xF03D
ClearIDRConfig Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9032
Length (bytes)
10
Postamble
0xF03D
EnableIDR Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1033
Length (bytes)
12
IDR Id
1→16
Postamble
0xF03D
EnableIDR Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9033
Length (bytes)
10
Postamble
0xF03D
DisableIDR Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1034
Length (bytes)
12
IDR Id
1→16
Postamble
0xF03D
DisableIDR Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9034
Length (bytes)
10
Postamble
0xF03D
Scripting Commands
Scripts are command sequences stored in the listener’s memory. Up to 16 scripts can be defined, each containing up to 100 commands (subject to a 1500-byte total message limit). Scripts live for the lifetime of the listener process — they are not persisted across resets.
When a script is executed, its commands run serially and each produces its own response, just as if the commands had been sent individually.
Currently scriptable commands: NOP, ReadRegs, WriteRegs, ReadFIFO, MaskReg, MaskValueReg.
A single script can be designated as the SafeState script with SetSafeStateScriptId. The board executes it automatically when SafeState criteria are met (for example, an EtherOpMode communication timeout). Setting a value of 0 clears the SafeState script.
ClearScript Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1040
Length
12
ScriptId
1→16
Postamble
0xF03D
ClearScript Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9040
Length
10
Postamble
0xF03D
WriteScript Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1041
Length
14 + Commands
ScriptId
1→16
CommandCount
1→100
Command 1
XX…XX
Command 2
XX…XX
…
XX…XX
Command N
XX…XX
Postamble
0xF03D
WriteScript Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9041
Length
10
Postamble
0xF03D
ReadScript Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1042
Length
12
ScriptId
1→16
Postamble
0xF03D
ReadScript Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9042
Length
12 + Commands
CommandCount
1→100
Command 1
XX…XX
Command 2
XX…XX
…
XX…XX
Command N
XX…XX
Postamble
0xF03D
ExecuteScript Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1043
Length
12
ScriptId
1→16
Postamble
0xF03D
ExecuteScript Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9043
Length
10
Postamble
0xF03D
SetSafeStateScriptId Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1044
Length
12
ScriptId
1→16
Postamble
0xF03D
SetSafeStateScriptId Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9044
Length
10
Postamble
0xF03D
GetSafeStateScriptId Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1045
Length
10
Postamble
0xF03D
GetSafeStateScriptId Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9045
Length
12
ScriptId
1→16
Postamble
0xF03D
I2C Raw Commands
ReadI2CRaw and WriteI2CRaw forward raw I2C transactions to a device on the board.
An I2C Raw Data definition consists of:
Response Data Length (2 bytes) — bytes returned by the command.
I2C Command Data Length (2 bytes) — bytes in the I2C read command.
I2C Command — the I2C address (command).
I2C Command Data — data sent with the I2C read command.
I2C_RawRead Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1200
Length (bytes)
14 + I2C Command data Length
Response Data Length
Size of data returned (in Bytes)
I2C Command data Length
Size of data in I2C command
I2C Command
I2C Address
I2C Command data
XXXX … XXXX
Postamble
0xF03D
I2C_RawRead Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9200
Length (bytes)
10 + Response Data Length
Payload
XX…XX
Postamble
0xF03D
I2C_RawWrite Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1201
Length (bytes)
11 + Register Count
I2C Command
I2C Address
Register Value(s)
XXXX … XXXX
Postamble
0xF03D
I2C_RawWrite Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9201
Length (bytes)
10
Postamble
0xF03D
System Configuration Commands
Intended for factory test only; may not be available on every platform.
Get System Configuration returns PCI/VME data for installed cards:
Card Number (4 bytes, int32_t).
Base Address (4 bytes, uint32_t).
Size (4 bytes, uint32_t).
Lane (2 bytes, uint16_t) — PCIe lane.
Bus (2 bytes, uint16_t) — PCI bus.
Dev (2 bytes, uint16_t) — PCI device.
Func (2 bytes, uint16_t) — PCI function.
DevId (2 bytes, uint16_t) — card PCI device ID.
Get System Configuration Command
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x1210
Length (bytes)
10 + 2
Number of cards
Number of cards to return data for (1 - NAI_MAX_CARDS)
Postamble
0xF03D
System Configuration Response
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x9210
Length (bytes)
10 + (Number of Cards * 22)
Payload
System configuration data
Postamble
0xF03D
Error Responses
Error responses carry a TypeCode in the range 0x8000–0x8FFF. The payload is an ASCII message describing the failure — not null-terminated. Its size is Length − 10.
Error Response Packet
Name
Value
Preamble
0xD30F
SequenceNo
XX
TypeCode
0x8000 → 0x8FFF
Length (bytes)
X
Message
XX…XX
Postamble
0xF03D
Example Error
An example string that might appear in the Message field is “ReadRegs – wrong number of bytes in payload”. This would arrive with error code 0x8006 — Invalid Payload Size.
Gen 6 boards extend the protocol with additional command variants. These are defined in the SSK 2.x header naiether_typecode.h and include extended IDR (IDR3, IDR3_IPv6), block (BANK3, MREG3, FIFO3), and IPv6 variants of several existing commands.
For the current Gen 6-specific byte layouts, refer to naiether_typecode.h and the SSK 2.x source. The conceptual model is the same as the corresponding Gen 5 command in each case.