summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-05-10 17:29:13 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-05-10 17:29:13 -0400
commit521f76730e5879831bea76d9123dc0c2c7354349 (patch)
tree2c63c4fac20de6a82fc4280d68e8ac69f3f37c59
parentc348dbdb04843b452664427c36e666997d0e0dcd (diff)
downloadgpsd-521f76730e5879831bea76d9123dc0c2c7354349.tar.gz
In AIS message types 6 and 8, split app_id into DAC and FID per ITU-1371.
Wire protocol and API minor versions get bumped. All changes are as documented in AIVDM.txt, which now describes known message 6 and 8 subtypes. Involved rebuilding a couple of AIS regression tests. All regression tests pass. Also includes various typo fixes for AIVDM.txt discovered by Baylink while we were reviewing these changes.
-rw-r--r--NEWS4
-rwxr-xr-xdevtools/ais.py8
-rw-r--r--driver_aivdm.c24
-rw-r--r--gps.h12
-rw-r--r--gpsd.h-tail9
-rw-r--r--gpsd_json.c10
-rw-r--r--gpsdecode.c10
-rw-r--r--test/sample.aivdm22
-rw-r--r--test/sample.aivdm.chk8
-rw-r--r--www/AIVDM.txt176
10 files changed, 195 insertions, 88 deletions
diff --git a/NEWS b/NEWS
index 086b2667..eeadb7c3 100644
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,9 @@
Reading packets from UDP datagrams by specifying a listening address
and port is now supported, and the regression-test driver cam now
be told to force this with -u; this enables regression testing in
- chroot jails where access to ptys is locked out.
+ chroot jails where access to ptys is locked out. AIS code now
+ interprets message type 6 and 8 application IDs correctly as a
+ Designated Area Code and Functional ID pair.
* Tue Apr 20 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.94
Error-checking in the 50bps subframe code has been greatly improved.
diff --git a/devtools/ais.py b/devtools/ais.py
index c1ca3704..3afc304d 100755
--- a/devtools/ais.py
+++ b/devtools/ais.py
@@ -316,7 +316,8 @@ type6 = (
bitfield("dest_mmsi", 30, 'unsigned', None, "Destination MMSI"),
bitfield("retransmit", 1, 'unsigned', None, "Retransmit flag"),
spare(1),
- bitfield("application_id", 16, 'unsigned', 0, "Application ID"),
+ bitfield("dac", 10, 'unsigned', 0, "DAC"),
+ bitfield("fid", 6, 'unsigned', 0, "Functional ID"),
bitfield("data", 920, 'raw', None, "Data"),
)
@@ -334,8 +335,9 @@ type7 = (
type8 = (
spare(2),
- bitfield("application_id", 16, 'unsigned', 0, "Application ID"),
- bitfield("data", 952, 'raw', None, "Data"),
+ bitfield("dac", 10, 'unsigned', 0, "DAC"),
+ bitfield("fid", 6, 'unsigned', 0, "Functional ID"),
+ bitfield("data", 952, 'raw', None, "Data"),
)
def type9_alt_format(n):
diff --git a/driver_aivdm.c b/driver_aivdm.c
index b96e631d..e2b91137 100644
--- a/driver_aivdm.c
+++ b/driver_aivdm.c
@@ -189,14 +189,14 @@ bool aivdm_decode(const char *buf, size_t buflen,
ais->type1.status = UBITS(38, 4);
ais->type1.turn = SBITS(42, 8);
ais->type1.speed = UBITS(50, 10);
- ais->type1.accuracy = (bool)UBITS(60, 1);
+ ais->type1.accuracy = (bool)UBITS(60, 1);
ais->type1.lon = SBITS(61, 28);
ais->type1.lat = SBITS(89, 27);
ais->type1.course = UBITS(116, 12);
- ais->type1.heading = UBITS(128, 9);
+ ais->type1.heading = UBITS(128, 9);
ais->type1.second = UBITS(137, 6);
- ais->type1.maneuver = UBITS(143, 2);
- //ais->type1.spare = UBITS(145, 3);
+ ais->type1.maneuver = UBITS(143, 2);
+ //ais->type1.spare = UBITS(145, 3);
ais->type1.raim = UBITS(148, 1)!=0;
ais->type1.radio = UBITS(149, 20);
gpsd_report(LOG_INF,
@@ -289,15 +289,17 @@ bool aivdm_decode(const char *buf, size_t buflen,
ais->type6.dest_mmsi = UBITS(40, 30);
ais->type6.retransmit = (bool)UBITS(70, 1);
//ais->type6.spare = UBITS(71, 1);
- ais->type6.app_id = UBITS(72, 16);
+ ais->type6.dac = UBITS(72, 10);
+ ais->type6.fid = UBITS(82, 6);
ais->type6.bitcount = ais_context->bitlen - 88;
(void)memcpy(ais->type6.bitdata,
(char *)ais_context->bits + (88 / BITS_PER_BYTE),
(ais->type6.bitcount + 7) / 8);
- gpsd_report(LOG_INF, "seqno=%d, dest=%u, id=%u, cnt=%zd\n",
+ gpsd_report(LOG_INF, "seqno=%d, dest=%u, dac=%u, fid=%u, cnt=%zd\n",
ais->type6.seqno,
ais->type6.dest_mmsi,
- ais->type6.app_id,
+ ais->type6.dac,
+ ais->type6.fid,
ais->type6.bitcount);
break;
case 7: /* Binary acknowledge */
@@ -333,13 +335,15 @@ bool aivdm_decode(const char *buf, size_t buflen,
return false;
}
//ais->type8.spare = UBITS(38, 2);
- ais->type8.app_id = UBITS(40, 16);
+ ais->type8.dac = UBITS(40, 10);
+ ais->type8.fid = UBITS(40, 6);
ais->type8.bitcount = ais_context->bitlen - 56;
(void)memcpy(ais->type8.bitdata,
(char *)ais_context->bits + (56 / BITS_PER_BYTE),
(ais->type8.bitcount + 7) / 8);
- gpsd_report(LOG_INF, "id=%u, cnt=%zd\n",
- ais->type8.app_id,
+ gpsd_report(LOG_INF, "dac=%u, fid=%u, cnt=%zd\n",
+ ais->type8.dac,
+ ais->type8.fid,
ais->type8.bitcount);
break;
case 9: /* Standard SAR Aircraft Position Report */
diff --git a/gps.h b/gps.h
index 901365fe..03f38a9a 100644
--- a/gps.h
+++ b/gps.h
@@ -35,8 +35,12 @@ extern "C" {
#include <pthread.h> /* pacifies OpenBSD's compiler */
#endif
+/*
+ * 4.1 - Base version for initial JSON protocol (Dec 2009)
+ * 4.2 - AIS application IDs split into DAC and FID (May 2010)
+ */
#define GPSD_API_MAJOR_VERSION 4 /* bump on incompatible changes */
-#define GPSD_API_MINOR_VERSION 1 /* bump on compatible changes */
+#define GPSD_API_MINOR_VERSION 2 /* bump on compatible changes */
#define MAXTAGLEN 8 /* maximum length of sentence tag name */
#define MAXCHANNELS 20 /* maximum GPS channels (*not* satellites!) */
@@ -565,7 +569,8 @@ struct ais_t
unsigned int dest_mmsi; /* destination MMSI */
bool retransmit; /* retransmit flag */
//unsigned int spare; spare bit(s) */
- unsigned int app_id; /* Application ID */
+ unsigned int dac; /* Application ID */
+ unsigned int fid; /* Functional ID */
#define AIS_TYPE6_BINARY_MAX 920 /* 920 bits */
size_t bitcount; /* bit count of the data */
char bitdata[(AIS_TYPE6_BINARY_MAX + 7) / 8];
@@ -581,7 +586,8 @@ struct ais_t
/* Type 8 - Broadcast Binary Message */
struct {
//unsigned int spare; spare bit(s) */
- unsigned int app_id; /* Application ID */
+ unsigned int dac; /* Designated Area Code */
+ unsigned int fid; /* Functional ID */
#define AIS_TYPE8_BINARY_MAX 952 /* 952 bits */
size_t bitcount; /* bit count of the data */
char bitdata[(AIS_TYPE8_BINARY_MAX + 7) / 8];
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 27072d42..3421497f 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -9,9 +9,14 @@
typedef unsigned int speed_t;
#endif
-/* constants for the VERSION response */
+/*
+ * Constants for the VERSION response
+ * 3.1: Base JSON version
+ * 3.2: Added POLL command and response
+ * 3.3: AIS app_id split into DAC and FID
+ */
#define GPSD_PROTO_MAJOR_VERSION 3 /* bump on incompatible changes */
-#define GPSD_PROTO_MINOR_VERSION 2 /* bump on compatible changes */
+#define GPSD_PROTO_MINOR_VERSION 3 /* bump on compatible changes */
/* Some internal capabilities depend on which drivers we're compiling. */
#ifdef EARTHMATE_ENABLE
diff --git a/gpsd_json.c b/gpsd_json.c
index 1d7be8de..a4347331 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -848,12 +848,13 @@ void aivdm_json_dump(const struct ais_t *ais, bool scaled,
case 6: /* Binary Message */
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"seqno\":%u,\"dest_mmsi\":%u,"
- "\"retransmit\":%s,\"app_id\":%u,"
+ "\"retransmit\":%s,\"dac\":%u,\"fid\":%u,"
"\"data\":\"%zd:%s\"}\r\n",
ais->type6.seqno,
ais->type6.dest_mmsi,
JSON_BOOL(ais->type6.retransmit),
- ais->type6.app_id,
+ ais->type6.dac,
+ ais->type6.fid,
ais->type6.bitcount,
gpsd_hexdump(ais->type6.bitdata,
(ais->type6.bitcount + 7) / 8));
@@ -867,8 +868,9 @@ void aivdm_json_dump(const struct ais_t *ais, bool scaled,
break;
case 8: /* Binary Broadcast Message */
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
- "\"app_id\":%u,\"data\":\"%zd:%s\"}\r\n",
- ais->type8.app_id,
+ "\"dac\":%u,\"fid\":%u,\"data\":\"%zd:%s\"}\r\n",
+ ais->type8.dac,
+ ais->type8.fid,
ais->type8.bitcount,
gpsd_hexdump(ais->type8.bitdata,
(ais->type8.bitcount + 7) / 8));
diff --git a/gpsdecode.c b/gpsdecode.c
index e70c325e..08ef0ad6 100644
--- a/gpsdecode.c
+++ b/gpsdecode.c
@@ -104,11 +104,12 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen)
break;
case 6: /* Binary Message */
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
- "%u,%u,%u,%u,%zd:%s",
+ "%u,%u,%u,%u,%u,%zd:%s",
ais->type6.seqno,
ais->type6.dest_mmsi,
(uint) ais->type6.retransmit,
- ais->type6.app_id,
+ ais->type6.dac,
+ ais->type6.fid,
ais->type6.bitcount,
gpsd_hexdump(ais->type6.bitdata,
(ais->type6.bitcount + 7) / 8));
@@ -122,8 +123,9 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen)
break;
case 8: /* Binary Broadcast Message */
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
- "%u,%zd:%s",
- ais->type8.app_id,
+ "%u,%u,%zd:%s",
+ ais->type8.dac,
+ ais->type8.fid,
ais->type8.bitcount,
gpsd_hexdump(ais->type8.bitdata,
(ais->type8.bitcount + 7) / 8));
diff --git a/test/sample.aivdm b/test/sample.aivdm
index dd9c43cd..b4e7747d 100644
--- a/test/sample.aivdm
+++ b/test/sample.aivdm
@@ -155,7 +155,8 @@
# DestinationID: 313240222
# RetransmitFlag: False
# Spare: 0
-# ApplicationID: 42827
+# DAC 669
+# FID 11
# Data: 48:eb2f118f7ff1
#
# From AISHub. This type 6 has no data. It's paired with the
@@ -167,7 +168,8 @@
# Sequence Number : 0
# Destination MMSI : 2655651
# Retransmit flag : 0
-# Application ID : 104
+# DAC : 1
+# FID : 40
# Data : 16:0000
#
# FIX-ME: We need a type 6 test case that requires more than one AIVDM fragment.
@@ -212,18 +214,22 @@
# RepeatIndicator: 0
# UserID: 366999712
# ApplicationID: 23480
+# DAC 366
+# FID 22
# Data: 256:3a53dbb7be4a773137f87d7b0445f040dea05d93f593783194ae9b9d9dbe05fb
#
# Type 8:
# From Kurt Schwehr. Spans more than one AIVDM fragment. Known good.
-# Analyzed in <4BE6A423.8000007@ccom.unh.edu>, seems to be military traffic.
+# Analyzed in <4BE6A423.8000007@ccom.unh.edu>, seems to be military traffic
+# with a mis-entered MMSI.
!AIVDM,2,1,6,A,8>qc9wiKf>d=Cq5r0mdew:?DLq>1LmhHrsqmBCKnJ50,0*30
!AIVDM,2,2,6,A,3OLc=UCRp,0*4A,b003660465
-Message Type 8
-Repeat Indicator 0
-MMSI 999999999
-Application ID 23480
-Data 256:eb0d4f917a035b2dfca3d4739381735c18ebbe754936f66850037dcacd9538b8
+# Message Type 8
+# Repeat Indicator 0
+# MMSI 999999999
+# DAC 366
+# FID 22
+# Data 256:eb0d4f917a035b2dfca3d4739381735c18ebbe754936f66850037dcacd9538b8
#
# Type 9:
# From AISHub. Checked with the noaadata tools.
diff --git a/test/sample.aivdm.chk b/test/sample.aivdm.chk
index 78c36fda..733b6128 100644
--- a/test/sample.aivdm.chk
+++ b/test/sample.aivdm.chk
@@ -4,13 +4,13 @@
3,0,563808000,5,0,0,1,-45796520,22146000,2520,352,35,0x0,0,0x0
4,0,003669702,2007:05:14T19:57:39Z,1,-45811417,22130260,7,0,0x105df
5,0,351759000,9134270,0,3FOF8,EVER DIADEM,70,225,70,1,31,1,05-15T14:00Z,122,NEW YORK,0
-6,1,150834090,3,313240222,0,42827,48:eb2f118f7ff1
-6,0,265538450,0,2655651,0,104,16:0000
+6,1,150834090,3,313240222,0,669,11,48:eb2f118f7ff1
+6,0,265538450,0,2655651,0,1,40,16:0000
7,0,002655651,265538450,0,0,0
7,1,655901842,158483613,321823389,836359488,0
7,2,537411077,43101326,717096664,76161024,0
-8,0,366999712,23480,256:3a53dbb7be4a773137f87d7b0445f040dea05d93f593783194ae9b9d9dbe05fb
-8,0,999999999,23480,256:eb0d4f917a035b2dfca3d4739381735c18ebbe754936f66850037dcacd9538b8
+8,0,366999712,366,22,256:3a53dbb7be4a773137f87d7b0445f040dea05d93f593783194ae9b9d9dbe05fb
+8,0,999999999,366,22,256:eb0d4f917a035b2dfca3d4739381735c18ebbe754936f66850037dcacd9538b8
9,0,111265591,15,0,0,7128960,34667073,0,28,0x0,0,0,0x6015
10,0,366814480,366832740
10,0,440882000,366972000
diff --git a/www/AIVDM.txt b/www/AIVDM.txt
index 458e5f8e..0e976d9a 100644
--- a/www/AIVDM.txt
+++ b/www/AIVDM.txt
@@ -1,6 +1,6 @@
= AIVDM/AIVDO protocol decoding =
Eric S. Raymond <esr@thyrsus.com>
-v1.23, Mar 2010
+v1.24, May 2010
This document is mastered in asciidoc format. If you are reading it in HTML,
you can find the original at http://gpsd.berlios.de/AIVDM.txt[]
@@ -14,7 +14,7 @@ interpreting these messages.
AIVDM/AIVDO sentences are emitted by receivers for AIS, the marine
Automatic Identification System. AIS transmitters are fitted to
-vessels, navigation markers, and ccertain tyoes of shore station. They
+vessels, navigation markers, and ccertain types of shore station. They
periodically squawk their position and course (if applicable), using
TDMA (Time Division Multiple Access) technology similar to the way
cellphones do to avoid mutual interference. AIS receivers make this data
@@ -23,7 +23,7 @@ available for navigation, anti-collision systems, and other uses.
The International Maritime Organization's (IMO) International
Convention for the Safety of Life at Sea (SOLAS) reqires operating AIS
transmitters on all international cargo vessels of more than 300 tons
-displacement, all cargo vessels of more than 500 tonds displacement,
+displacement, all cargo vessels of more than 500 tons displacement,
and all passenger vessels; see <<SOLAS>> for details. Individual
maritime nations may have stricter and more detailed rules: for those
obtaining in U.S. waters, see <<US-REQUIREMENTS>>.
@@ -100,7 +100,7 @@ you join by contributing your feed and receive all feeds.
AIS Hub (<<<AISHUB>>>) is a free, public AIS feed pool. It provides
exchange of AIS data in raw NMEA format; all AISHub members share
-their own AIS feed and receive the merged feed from all other
+their own received AIS data and receive the merged feed from all other
participating parties. It is open-source friendly, offering a Linux
port in source of its software for collecting and forwarding AIS
data. Peter Stoyanov and the other AIS Hub principals have generously
@@ -439,7 +439,7 @@ such as the St. Lawrence Seaway and PAWSS.
Classes 12 and 14 are used for safety-related text messaging.
In practice, message types other than 1, 3, 4, 5, 18, and 24 are
-unusual or rare; many AIS transponders never emit them. As of
+unusual or rare; many AIS transmitters never emit them. As of
November 2009, an overnight capture of a full feed from <<<AISHUB>>>
shows no type 25 or type 26 messages at all.
@@ -534,8 +534,9 @@ maximum of three hops. A value of 3 indicates "Do not repeat".
Turn rate is encoded as follows:
-* 0...126 = turning right at up to 708 degrees per minute or higher
-* 0...-126 = turning left at up to 708 degrees per minute or higher
+* 0 = not turning
+* 1...126 = turning right at up to 708 degrees per minute or higher
+* 1...-126 = turning left at up to 708 degrees per minute or higher
* 127 = turning right at more than 5deg/30s (No TI available)
* -127 = turning left at more than 5deg/30s (No TI available)
* 128 (80 hex) indicates no turn information available (default)
@@ -785,7 +786,7 @@ the dimensions to port and starboard, the special value 63 indicates
|==============================================================
Note that garbage values greater than 99 are supposed to be unused,
-but are not uncommon in the wild; AIS transponers seem prone to put
+but are not uncommon in the wild; AIS transmitters seem prone to put
garbage in this field when it's not explicitly set. Decoders should
treat these like value 0 rather than throwing an exception until and
unless the controlled vocabulary is extended to include the unknown
@@ -801,20 +802,41 @@ payloads).
[frame="topbot",options="header"]
|==============================================================================
-|Field |Len |Description |Member |Units
-|0-5 | 6 |Message Type |type |Unsigned integer: 6
-|6-7 | 2 |Repeat Indicator |repeat |As in Common Navigation Block
-|8-37 | 30 |Source MMSI |mmsi |Unsigned integer: 9 digits
-|38-39 | 2 |Sequence Number |seqno |Unsigned integer 0-3
-|40-69 | 30 |Destination MMSI |dest_mmsi |Unsigned integer: 9 digits
-|70 | 1 |Retransmit flag |retransmit |0 = no retransmission (default)
-| | | | |1 = retransmitted
-|71 | 1 |Spare | |Not used
-|72-87 | 16 |Application ID |app_id |Unsigned integer
-|88 |920 |Data |data |Binary data
-| | | | |May be shorter than 920 bits.
+|Field |Len |Description |Member |Units
+|0-5 | 6 |Message Type |type |Unsigned integer: 6
+|6-7 | 2 |Repeat Indicator |repeat |As in Common Navigation Block
+|8-37 | 30 |Source MMSI |mmsi |Unsigned integer: 9 digits
+|38-39 | 2 |Sequence Number |seqno |Unsigned integer 0-3
+|40-69 | 30 |Destination MMSI |dest_mmsi |Unsigned integer: 9 digits
+|70 | 1 |Retransmit flag |retransmit |0 = no retransmission (default)
+| | | | |1 = retransmitted
+|71 | 1 |Spare | |Not used
+|72-81 | 10 |Designated Area Code |dac |Unsigned integer
+|82-87 | 6 |Functional ID |fid |Unsigned integer
+|88 |920 |Data |data |Binary data
+| | | | |May be shorter than 920 bits.
|==============================================================================
+Interpretation of the binary payload is controlled by:
+
+* The Designated Area Code, which is a jurisdiction code: 366 for the
+ United States. It uses the same encoding as the area designator in
+ MMMSIs; see <<ITU-MID>>. 1 designates international (ITU) messages.
+
+* The FID, which is the Functional ID for a message subtype.
+
+The following is a non-exhaustive list of DAC-FID pairs in use for
+type 6:
+
+|==============================================================================
+| DAC |FID | Sub | Source | Status | Description
+| 1 | 23 | | <<NAV55>> | Proposed | Area notice
+| 1 | 28 | | <<NAV55>> | Proposed | Route info addressed
+| 1 | 30 | | <<NAV55>> | Proposed | Text description addressed
+|==============================================================================
+
+DAC/FID pairs are assigned separately per message type.
+
=== Type 7: Binary Acknowledge ===
Message type 7 is a receipt acknowledgement to the senders of a
@@ -847,16 +869,58 @@ maximum of 1008 bits (up to 5 AIVDM sentence payloads).
[frame="topbot",options="header"]
|==============================================================================
-|Field |Len |Description |Member |Units
-|0-5 | 6 |Message Type |type |Unsigned integer: 8
-|6-7 | 2 |Repeat Indicator |repeat |As in Common Navigation Block
-|8-37 | 30 |Source MMSI |mmsi |Unsigned integer: 9 digits
-|38-39 | 2 |Spare | |Not used
-|40-55 | 16 |Application ID |app_id |Unsigned integer
-|56 |952 |Data |data |Binary data
-| | | | |May be shorter than 952 bits.
+|Field |Len |Description |Member |Units
+|0-5 | 6 |Message Type |type |Unsigned integer: 8
+|6-7 | 2 |Repeat Indicator |repeat |As in Common Navigation Block
+|8-37 | 30 |Source MMSI |mmsi |Unsigned integer: 9 digits
+|38-39 | 2 |Spare | |Not used
+|40-49 | 10 |Designated Area Code |dac |Unsigned integer
+|50-55 | 6 |Functional ID |fid |Unsigned integer
+|56 |952 |Data |data |Binary data
+| | | | |May be shorter than 952 bits.
+|==============================================================================
+
+Interpretation of the binary payload is controlled by DAC/FID as in
+message type 6. The following is a non-exhaustive list of DAC-FID
+pairs in use for type 8:
+
+[frame="topbot",options="header"]
+|==============================================================================
+| DAC |FID | Sub | Source | Status | Description
+| 1 | 11 | | <<IMO236>> | Deprecated | Meteorological/Hydrological Data
+| 1 | 12 | | <<IMO236>> | Deprecated | Dangerous cargo indication
+| 1 | 13 | | <<IMO236>> | Deprecated | Fairway closed
+| 1 | 14 | | <<IMO236>> | Deprecated | Tidal window
+| 1 | 15 | | <<IMO236>> | Deprecated | Extended ship and voyage
+| 1 | 16 | | <<IMO236>> | In use | Num persons on board
+| 1 | 17 | | <<IMO236>> | In use? | VTS-Generated/Synthetic targets
+| 1 | 18 | | <<NAV55>> | Proposed | Clearance time to enter port
+| 1 | 19 | | <<NAV55>> | Proposed | Marine traffic signals
+| 1 | 20 | | <<NAV55>> | Proposed | Berthing data
+| 1 | 21 | | <<NAV55>> | Proposed | Weather obs from ship
+| 1 | 22 | | <<NAV55>> | Proposed | area notice broadcast
+| 1 | 24 | | <<NAV55>> | Proposed | Extended ship and voyage
+| 1 | 25 | | <<NAV55>> | Proposed | Dangerous cargo
+| 1 | 26 | | <<NAV55>> | Proposed | Environmental
+| 1 | 27 | | <<NAV55>> | Proposed | Route info broadcast
+| 1 | 29 | | <<NAV55>> | Proposed | Text description broadcast
+| 1 | 31 | | <<NAV55>> | Proposed | Meteorological and Hydrological
+| 1 | 32 | | <<NAV55>> | Proposed | Tidal Window
+| 316 | 1 | 2 | <<SEAWAY>> | In use | Wind
+| 316 | 1 | 1 | <<SEAWAY>> | In use | Weather station
+| 316 | 1 | 3 | <<SEAWAY>> | In use | Water level
+| 316 | 1 | 6 | <<SEAWAY>> | In use | Water flow
+| 316 | 2 | 1 | <<SEAWAY>> | In use | Lockage Order
+| 316 | 2 | 2 | <<SEAWAY>> | In use | Est. Lock Times
+| 316 | 32 | 1 | <<SEAWAY>> | In use | Seaway Version Message
+| ? | 1 | 4 | <<SEAWAY>> | ? | PAWS Hydro / Current
|==============================================================================
+DAC/FID pairs are assigned separately per message type.
+FID types 11-15 are being phased out and are not to be used after 1
+Jan 2013. FID types 16 and 17 are in use; there are a proposed updates
+for these in <<NAV55>>.
+
=== Type 9: Standard SAR Aircraft Position Report ===
Tracking information for search-and-rescue aircraft. Total number of
@@ -1027,7 +1091,7 @@ The reason the lengths given here vary by up to two bits is that
<<IALA>> is not consistent about whether it expects trailing spare
bits to be included in the data packet. The shortest message length is
given as 88, implying that in case 1 the trailing spare bits 88-89 are
-not expected to be sent. The longest message length is gven as 160,
+not expected to be sent. The longest message length is given as 160,
implying that in cases 3 and 4 the trailing spare bits 159-160 are
expected to be sent. A robust decoder should check for both possible
lengths in each case.
@@ -1104,10 +1168,10 @@ omitted, as it appears to be tied to the now obsolete RTCM2 protocol.
=== Type 18: Standard Class B CS Position Report ===
A less detailed report than types 1-3 for vessels using Class B
-transponders. Omits navigational status and rate of turn. Fields are
+transmitters. Omits navigational status and rate of turn. Fields are
encoded as in the common navigation block. 168 bits total.
-In <<IALA>> (and ITU 1371-1) bits 141-145 were designated "Spare"; the
+In <<IALA>> (and <<ITU1371>>) bits 141-145 were designated "Spare"; the
bit-flag semantics given here are from ITU-1371-3 and were
communicated by Kurt Schwehr. Kurt warns that "the spec does not do a
good job of explaining these fields... I don't think that I totally
@@ -1153,7 +1217,7 @@ selects whether it should be interpretred as a SOTDMA or ITDMA state.
=== Type 19: Extended Class B CS Position Report ===
A slightly more detailed report than type 18 for vessels using Class B
-transponders. Omits navigational status and rate of turn. Fields are
+transmitters. Omits navigational status and rate of turn. Fields are
encoded as in the common navigation block and the Type 5 message.
Note that until just before the reserved field at bit 139 this is
identical to message 18. 312 bits total.
@@ -1245,7 +1309,7 @@ and 360 bits.
|6-7 | 2 |Repeat Indicator |repeat |As in Common Navigation Block
|8-37 |30 |MMSI |mmsi |Unsigned integer: 9 digits
|38-42 | 5 |Aid type |aid_type |See Below
-|43-162 1|20 |Name |name |Name of the aid to navigation
+|43-162 1|120 |Name |name |Name of the aid to navigation
|163-163 | 1 |Position Accuracy |accuracy |As in Common Navigation Block
|164-191 |28 |Longitude |lon |Minutes/10000 (as in CNB)
|192-218 |27 |Latitude |lat |Minutes/10000 (as in CNB)
@@ -1323,7 +1387,7 @@ to Navigation at indicated position; 1 = virtual Aid to
Navigation simulated by nearby AIS station.
If present, the Name Extension consists of packed six-bit ASCII
-characters followed by 0-6 bytes of padding to an 8-bit boundary. The
+characters followed by 0-6 bits of padding to an 8-bit boundary. The
<<IALA>> description says "This parameter should be omitted when no
more than 20 characters for the name of the A-to-N are needed in
total. Only the required number of characters should be transmitted,
@@ -1374,7 +1438,7 @@ frequencies.
The txrx field encodes the same information as the 2-bit field txrx
field in message type 23; only the two low bits are used.
-The power bit instructs designated recxeivers which power level to use.
+The power bit instructs designated receivers which power level to use.
If the message is broadcast (addressed field is 0), the ne_lon,
ne_lat, sw_lon, and sw_lat fields are the corners of a rectangular
@@ -1389,8 +1453,8 @@ common navigation block and elsewhere.
The band fields control channel bandwidth for channels A and B, and
the zonesize field describes the size of the transition zone around the
-control jurisdiction. The semantics of these fields is complicated,
-controlling transponder behavior as it moves between jurisdictions;
+control jurisdiction. The semantics of these fields are complicated,
+controlling transmitter behavior as it moves between jurisdictions;
see <<IALA>> for full details.
=== Type 23: Group Assignment Command ===
@@ -1557,8 +1621,10 @@ interpreted as a destination MMSI. Otherwise that field span becomes
part of the message payload, with the first 16 bits used as an
Application ID if the 'structured' flag is on.
-If the 'structured' flag is on, a 16-bit application identifier is
-interpreted. Otherwise that field span becomes part of the message payload.
+If the 'structured' flag is on, a 16-bit application identifier is
+extracted; this field is to be interpreted as a 10 bit DAC and 6-bit
+FID as in message types 6 and 8. Otherwise that field span becomes
+part of the message payload.
The data fields is not, in contrast to message type 26, followed by a
radio status block.
@@ -1585,8 +1651,10 @@ Takes up 60-1064 bits (up to 5 slots).
|===============================================================================
The data field may span up to 5 256-bit slots in addition to the tail
-end of the base slot. Documentation says the data length of each slot
-is 224 and adds the note "Allows for 32 bits of bit-stuffing."
+end of the base slot. The application_ID field, if present, is to be
+interpreted as a 10 bit DAC and 6-bit FID as in message types 6 and 8.
+Documentation says the data length of each slot is 224 and adds the
+note "Allows for 32 bits of bit-stuffing."
The 20 radio status bits are always present after end-of-data in the
last slot and are in the format specified by <<IALA>>. The radio
@@ -1603,7 +1671,8 @@ Some regional authorities extend the AIS message set.
The St. Lawrence Seaway broadcasts hydrological and lock-scheduling
messages using special encodings of the binary data of message types 6
and 8 (described in <<SEAWAY>>, freely available), and safety
-information using types 12 and 14.
+information using types 12 and 14. These message types are listed
+under the descriptions of types 6 and 8.
The U.S. Coast Guard has a system called PAWSS (Port and Water Safety
System) which uses extended AIS binary formats. <<SEAWAY>> says it's
@@ -1702,13 +1771,10 @@ The general ground rules for JSON-AIS encoding are as follows:
2. When multiple kinds of JSON objects may occur in a data stream, AIS
objects have the attribute "class":"AIS".
-3. To avoid ambiguity, AIS fields with special values meaning that the
-data is not available are *not* omitted.
-
-4. Collections of fields aggregating to a timestamp are dumped in ISO8601
+3. Collections of fields aggregating to a timestamp are dumped in ISO8601
format. Messages for which this rule is relevant are type 4 and type 5.
-5. There are two variants of the encoding, one scaled and one
+4. There are two variants of the encoding, one scaled and one
unscaled, which differ in the treatment of float and
controlled-vocabulary fields. An AIS-JSON object may have the optional
attribute "scaled":true to signify that the rest of its fields are
@@ -1716,13 +1782,13 @@ scaled; if this attribute has the value 'false' or is omitted, no
scaling has been performed. Message types for which the unscaled and
scaled dumps will differ are 1-5, 9, 11, 17-19, and 21-24.
-6. In unscaled mode, float-valued fields are dumped in their unscaled
+5. In unscaled mode, float-valued fields are dumped in their unscaled
integer form. In scaled mode, division or other specified scaling is
applied and the value dumped as a float, *except* that certain extreme
or data-unavailable value as may be dumped as fixed strings; see the
table below.
-7. In unscaled mode, the values of controlled-vocabulary fields are dumped as
+6. In unscaled mode, the values of controlled-vocabulary fields are dumped as
integer indices. In scaled mode, the values are dumped as strings.
.Special fields
@@ -1780,9 +1846,17 @@ Identification System]
- [[[NMEA]]] http://gpsd.berlios.de/standards/NMEA.txt[NMEA sentences]
+- [[[IMO236] http://www.imo.org/includes/blastData.asp/doc_id=4503/236.pdf[IMO
+ Circular 236: Guidance on the Application of AIS Binary Messages (2004)]
+
- [[[SEAWAY]]] http://www.greatlakes-seaway.com/en/pdf/aisdata.pdf[St. Lawrence
Seaway AIS Data Messaging Formats and Specifications]
+- [[[NAV55]]]
+ http://vislab-ccom.unh.edu/~schwehr/papers/2009-Nav55-CG-AIX-Report-Annex1.pdf[IMO
+ NAV 55 Report Annex 1: Guidance on the Application of AIS Binary
+ Messages (2009)]
+
- [[[Schwehr]]] http://schwehr.org/blog/[Kurt Schwehr's weblog]
- [[[IEC-PAS]]] IEC-PAS 61162-100, "Maritime navigation and
@@ -1883,3 +1957,7 @@ another AIS feed. Corrections and more details on message 22.
Version 1.23 corrects some typos and numbering errors in the
description of message 19 (field widths where correct, though).
Also, AISlive no longer offers free delayed access.
+
+Version 1.24 breaks the Type 6 and 8 application_id field into
+DAC and FID and adds tables for know DAC/FID pairs and their sources.
+Unspecified fields are noow omitted in JSON dumps.