Menu

Protocols

Protocols

A protocol is an agreed set of rules that governs how data is exchanged between devices. Every device taking part follows the same rules, so each side knows exactly what to expect and when.

The point of sharing these rules is compatibility. A tablet, a smart speaker and a printer built by three different companies can all work on the same home network, because each one follows the same agreed rules, whatever company made it. It is the rules that are shared, not the equipment: two completely different machines can swap data perfectly as long as the sender and receiver use the same protocol.

What the rules cover

  • How communication starts and ends, so both devices know when to begin sending and when the exchange is finished.
  • How data is formatted and organised, such as the order of the parts of a message and how big each chunk may be.
  • How devices are addressed, so the data arrives at the intended recipient rather than any device on the network.
  • How errors are detected and handled, including requesting that damaged or missing data is sent again.

For example, a tablet sending a photo to a wireless printer might follow a protocol where both devices first agree to begin, the tablet sends the image in numbered chunks of an agreed size, the printer checks the numbers and asks for any chunk that never arrived, and the link is closed once the last chunk is confirmed. Change the tablet for a phone from another brand and the transfer still works, because the protocol has not changed.

Sequence diagram between a tablet and a laptop: a header, 1 KB pieces each answered by a reply, a damaged piece that is sent again, and a final reply.

Different jobs need different protocols

No single protocol suits every task, so a range of protocols exists. Each one is built around a particular job, such as requesting a page from a website, copying a document from one machine to another, handing a message to a mail server, collecting messages from a mailbox, or breaking data into packets and steering those packets towards their destination. Because each design is tailored to its own task, the protocol you pick should depend on the job you need doing.

Practise this