— 50 —
APPENDIX F. Format of Messages in N2K Mode
In N2K mode, messages are encoded in a binary format. This format is based on Data Link Escape encoding
partially compatible with ActiSense NGT format and widely support by modern marine applications.
This format is very similar to Garmin Serial Protocol (see section 3.1 of Garmin Device Interface
Specification 001-00063-00 for details).
All data are transferred in byte-oriented packets. A packet contains a four-byte header (DLE, STX, ID,
and Size), followed by a variable number of data bytes, followed by a three-byte trailer (Checksum, DLE,
and ETX). The following table shows the format of a packet:
Table 1. Packet format
Byte Number Byte Description
Note
0
Data Link Escape
ASCII DLE character (16 decimal)
1
Start of Text
ASCII STX character (02 decimal)
2
Packet ID
Identifies the type of packet
3
Size of Packet Data
Number of bytes of packet data (bytes 4 to n-4)
4 to n—4
Packet Data
0 to 255 bytes, see Table 2
n—3
Checksum
2's complement of the sum of all bytes from byte 1 to byte n-4
n—2
Data Link Escape
ASCII DLE character (16 decimal)
n—1
End of Text
ASCII ETX character (03 decimal)
If any byte in the Size, Packet Data, or Checksum fields is equal to DLE, then a second DLE is inserted
immediately following the byte. This extra DLE is not included in the size or checksum calculation.
This procedure allows the DLE character to be used to delimit the boundaries of a packet.
Packets with NMEA 2000 messages transmitted to the PC application (incoming) have ID 0x93
(147 decimal), packets with NMEA 2000 messages sent by the application to the Device (outgoing)
have ID 0x94 (148 decimal).