networks//network protocols//MAVLink

MAVLink is a lightweight binary messaging protocol for drones and other unmanned vehicles, used between the autopilot and ground stations, companion computers, cameras and gimbals, and it is the telemetry and command language of the open autopilots PX4 and ArduPilot. A ground station such as QGroundControl or Mission Planner speaks it; so do the libraries that let a companion computer command the vehicle.


MAVLink is a lightweight binary messaging protocol for drones and other unmanned vehicles, used between the autopilot and ground stations, companion computers, cameras and gimbals, and it is the telemetry and command language of the open autopilots PX4 and ArduPilot. A ground station such as QGroundControl or Mission Planner speaks it; so do the libraries that let a companion computer command the vehicle.

It is designed for slow, lossy radio links. Messages are small (a header of a few bytes, a payload and a checksum), defined in XML files from which code is generated for many languages, and sent at rates chosen per message: a heartbeat once per second announcing that each component is alive, attitude at tens of Hz, position at a few Hz, parameters and mission items on request with acknowledgement. Most streams are fire-and-forget state, so a lost packet is replaced by the next; commands and mission uploads use explicit acknowledgements and retries.

The heartbeat is also the basis of link-loss detection. When the ground station stops hearing it, or the vehicle stops receiving it, each side knows the link is gone, and the vehicle's link-loss failsafe takes over (hold, return or land). Telemetry and setpoints travel by radio; the fast loops never do (radio link).

Plain MAVLink trusts any packet with the right format: a message saying it comes from system 7 proves nothing. MAVLink 2 adds message signing, a tag computed with a shared secret key over the message and a timestamp, so the vehicle can reject forged commands; key management is the operator's job (cyber-physical security).

On board, MAVLink runs over a serial port to a telemetry radio or over UDP on a network, and within a vehicle it is one of several layers: sensors hang from SPI and I2C, ESCs from PWM or DShot, peripherals from DroneCAN, and a ROS 2 system on the companion computer bridges to MAVLink (middleware).