AIS – Decoder

AIS Receiver at Università Politenica delle Marche

DII – Information Engineering Department – Telecommunication System Team


AIS system (stands for Automatic Identification System ) was developed to increase safety at sea. Ships broadcast their position automatically on a periodical time base and all vessels equipped with an AIS receiver or transponder, are able to plot other ship position, course and other information.

Data are transmitted on VHF Maritime band using GMSK modulation scheme, and are easy to receive using a special pourpose equipment or a common marine RTX with an external data demodulator (a PC and a soundcard will work great).

We are involved in AIS data receiving and analysis in order to carry out some scientific research in the field of electromagnatic wave propagation over sea water. We aim to find a correlation between distance of received ships and propagation in the 2m hamradio band. This is only the first “step” of a biggest project aimed to extract a model of propagation from data provided by the AIS system and from a beacon receiver

If you have an question, please contuct us on: this address

Tecnical Information

AIS Receiver has been provided from Marine Traffic in order to extend coverage of the network on Ancona area.

Atenna system is installed on the top of the “tower” of Faculty of Engineering , at 205 meters above sea level. The location is very good for wireless installation as there are no obstacles for many kilometers all around the tower.

Decoding Engine

Data provided from AIS are in the form of an ASCII string like following: !AIVDM,1,1,,B,13cita001N0uC7\<hva8qqaif0\<0@,0*1f <=”” p=””>

AIS protocol decoder has been developed using php language, in order to make it really “platform independent”. PHP language provides a lot of functions for string manupulation, which are very usefull in the decoding process.

Many different message types are decoded using our engine, out effort is to add even more decodinf function to the software. Information retrived from protocol’s payload are displayed on screen and stored in a mysql database for further “off-line” analysis.

Due to the large number of packets received, data are inserted in mysql tables according to followin rule: we store information about a particural MMSI only if the last update is older than 5 minutes. In this way we can “decimate” information stored on table without loosing too much information: ship speed is so low that we can tolerate a low sampling period

Further processing of data stored is done using a bash/php script which is run every minute. Data processed from the script are fed to MRTG system which takes care of displaying results.

Following graphs are generated (time-window is 1 hour):

  • Max distance of received signal
  • Average distance of ships (as calculated from MRTG)
  • Azimut of the received signal
  • Average bearing of received signals
  • Number of different MMSI received in 1 hour
  • Number of different MMSI received whose distance exceeds eximated “radio horizon”
  • Number of fixed station received

Accessing data

Decoded data can be accessed via AIS web site. Registration is mandatory for statistical pourposes only. Email addresses will not be published. Ocasionally we may send you a newsletter, to inform about site or code improvements.

Some screenshots from the AIS site:




Code will be occasionally updated in order to fix major bugs or reflect some changes in the protocol.  Changelog follows.

22/04/2016: fixed php dispatcher. Avoid replicating outgoing packets.

Obtaining the Code

Please don’t waste your time re-inventing the wheel. Access our code (Released as GPL v3) and use it for your needs. Feel free to help us developing new code, adding more functionalities and making it even faster.

Due to google code shutdown, the project is now hosted at this site.

Code is released under the GNU GPLv3 license and can be obtained for free, please download it from this link, on GITHUB.

Please feel free to contribute to the project, improving code. Contact us for further information!

Some statistics!

02/02/2016 - 1330
Anno Total Rows Distinct MMSI Distinct Type 1-2-3 Distinct Type 4
2012 2663618 3188 2985 31
2013 4466969 4581 3660 69
2014 7190733 4906 4314 43
2015 8532546 5644 4751 61
2016 7826074 5481 4623 61
2017 6401531 5584 4511 60
2018 5225313 5203 4007 70
2019 5398140 5591 4385 134
Totale 47704924