How Real-Time Ship Tracking Works

The AIS System

The ship tracks shown on our San Francisco Bay ship tracking page come from a system called AIS (Automatic Identification System). Since 2002, all new commercial ships over 300 gross tons, and all new passenger vessels, have been required to include AIS transponders. The requirement for existing ships has been gradually phased in.

The AIS system transmits information encoded on two VHF channels, at 161.975 MHz 162.025 MHz. Transmissions use 9600 bit per second GMSK FM modulation and HDLC packet protocols. Each ship transmits during one of 2,250 time slots, so all ships can share the two channels. The two channels provide redundancy and some level of protection from interference. Transmission range is basically line-of-sight, like VHF voice traffic. Typical range is 20 nautical miles.

The AIS transponder receives information from the ship's other navigational instruments. Position, course, and speed over ground information is typically provided by a GPS receiver. Additional information can be provided by other instruments. The ship's officers must enter information such as ship name, ship type, ship dimensions, and estimated time of arrival. This information is not always entered correctly and is sometimes out of date, which accounts for the peculiar information occasionally seen in the ship information panel on our ship tracking page.

Ships that are moored or at anchor are required to transmit their position information at least every 3 minutes. Ships moving at up to 14 kts must transmit their position every 10 seconds; at up to 23 kts, every 6 seconds; and at faster speeds, every 2 seconds. In addition, static information (such as the ship's name, destination, and estimated time of arrival) is transmitted separately every 6 minutes.

BoatingSF.com's AIS System

BoatingSF.com's real-time SF bay ship tracking displays information provided by Hi-Def San Francisco, which operates receivers in the hills above Sausalito and Berkeley. They have graciously allowed us to use their data feed.

Our Web server maintains a TCP/IP socket connection to HD-SF's feed. The messages are in a packed-binary format represented as a series of 6-bit ASCII characters; a typical message looks like !AIVDM,1,1,,B,13M@DngP00OlOf8LD3p4H9CH04hl,0*00. Custom PHP software on our Web server decodes the messages and stores the AIS reports in a MySQL database.

Every five minutes, software running on the Web server analyzes the last hour of AIS reports and creates an XML file that summarizes these reports. When you load our San Francisco Bay ship tracking page, a Flash program reads this XML file from the server and displays the animated ship positions. To reduce the amount of data that must be sent, the server provides position reports on a one-minute interval, and the Flash program interpolates from these positions.

You can also view near-real-time positions by clicking the Real Time button below the chart. The positions are updated every 5 seconds, with a 2-3 minute delay.

Resources for More Information on AIS