FREE “INTRO TO BLE” BOOK [HARDCOVER] →

Communications Protocols And Why We Need Them

A communications protocol is a “set of rules that must be obeyed by all users in a device network.”

This is a very grand definition, but it is also very dry. It does not tell us very much.

What do protocols exactly do? Why do we need them?

In this article, we will explore the answers to these two questions.


What is a Protocol?

The communication between any two devices can take place only if they are compatible in their connectivity, in terms of hardware and software. This compatibility is achieved through the use of a protocol.

Communication protocols are in short, a set of rules that communication entities must follow in order to exchange information.

Protocols are just agreed-upon ways to ensure that two/more communication entities connected together can recognize, and talk to each other.

Come to think of it, protocols used in any network technology, including Bluetooth LE, are a lot like traffic rules we all observe in our daily lives.

For example, when driving a car toward a busy intersection, we know what to do by observing the protocol displayed by the traffic light. If the light is green, we go. And if it’s red, we stop.

In rare instances when we encounter an intersection with no traffic lights or signs, there is general confusion among drivers about which car should go next because there is no protocol/consensus to follow.

Any driver might just go, and then another driver might think he has the right of way and go as well, leading to a collision.

Without generally accepted protocols, a network would not work properly because hardware manufacturers and software developers would all be doing things their own way.

This would result in proprietary products being unable to communicate with each when connected together.


Protocols Can Be Open or Proprietary

Open Protocols are protocols that are available for any system to use, and anyone to implement without having to pay a license fee.

They are usually developed through a collaborative process such as a standards body or an open-source project. They aim to create interoperability to allow diverse devices to work together.

Notable examples of open protocols are the TCP/IP suite and Bluetooth LE.

In contrast, proprietary protocols are owned by a particular company and can only be used by licensing from that company.

They are vendor lock-in, typically closed and tightly controlled. This gives the owner of the protocol an advantage in the market, as they can control who has access to the technology and how it is used.

However, it also means proprietary protocols are often less flexible and adaptable than open protocols. In addition, because they are not publicly available, it can be difficult for independent researchers to assess their security and privacy implications.


Main Points That Protocols Address

Adding networking capabilities to an embedded system is not a trivial task.

Why?

Because it entails sending data from a protected environment (a device) over a hostile medium (the outside world), and interacting with a hostile remote system that may not care what condition your device is in, and may be running at a different clock or time frame.

Now, protocols come to the rescue by providing a set of ground rules or common denominators that both systems can agree upon and use to communicate with each other.


Here are some of the main points that a protocol addresses:


1. Line Level Compatibility

One of the challenges in data communications is that different pieces of equipment use different voltages to represent 1s and 0s.

For example, some devices use -5 volts to represent a 1, while others use +5 volts. This can create potential problems when connecting devices together, as a -5 volt signal may be interpreted as a 0 by a device that is expecting a +5 volt signal.

To avoid these conflicts, devices must be designed to be line-level compatible, which means that they can translate between the various voltage levels, in order to communicate with other devices.

While this may seem like a relatively simple concept, it is one of the biggest headaches in ensuring smooth and reliable data communication.

Without proper standards, it is almost impossible to meet.


2. Timing Relationships

A second important aspect that protocols must take into account is the timing relationships between devices.

The data level transitions are determined by a clock at the sender ( source). The receiver usually has no access to this clock.

As a result, the relative timing of the signals has to be recovered/ regenerated at the receiver to accurately determine the beginning and the end of the message.

Protocols must, therefore, define how the receiver can reconstruct the original clock signal from the data signal in order to correctly interpret the timing relationships.

This process is called Clock Recovery.


3. Time Management of Multiple Users

Another big issue that protocols must contend with is the time management of multiple users.

Remember, in a network, there can be many devices sending and receiving data at the same time.

The protocols have to ensure that all these devices have fair access to the medium through which they are communicating and that no individual user dominates the medium for an excessively long period of time.


4. Error Control or Effects of Noise on the line

A fourth important consideration is the effects of noise on the line.

In any practical communication system, there will always be some background noise present on the line, which can potentially corrupt or destroy the data being transmitted.

The job of the protocols is to provide mechanisms to detect and/or correct these errors so that the data is received in its original form.


5. Security

With the increase in IoT hacking, security has become a major concern for embedded systems.

A protocol must have provisions for security so that the data being transmitted cannot be accessed by unauthorized persons.


6. Power Control

If everyone were to transmit at the power above the maximum required for a satisfactory level of performance, it would create a lot of interference in the shared RF spectrum, and no one would be able to communicate properly.

It is the task of a communication protocol that uses the RF spectrum to make sure that each transmitter only transmits at the power required to cover the desired distance and no more. This allows others to use the same or nearby frequencies without interference.


7. RF Band Planning (Channel Spacing & Bandwidth)

For a protocol that uses the RF spectrum( e.g Bluetooth LE), two important things are considered: how much space there is between channels, and how much bandwidth each channel can use.

Every communication protocol must use the correct amount of channel spacing and bandwidth for the RF Frequency band it will use.

If it does not, then the systems that rely on the protocol will not work properly and could cause interference for other users of the RF spectrum.


8. Message Formatting

Another thing that a protocol must define is the message format. This includes the message structure and the sequencing of messages.

The message structure is the way in which the data is arranged within the message.

For example, a message may have a header followed by a payload and then a checksum.

The sequencing of messages is the order in which they are sent.

For example, one message may need to be sent before another message in order to establish a connection.

Take a look at how Bluetooth LE structures its packets and how it sequences them.


9. Techniques to Combat Reliability Issues

Communication is said to be reliable if the information sent is information received. But since the mediums used are often not 100% reliable, techniques must be used to combat the unreliability.

In the case of Bluetooth LE, some techniques include using a spread spectrum, RSSI as a link quality estimator, and a good modulation scheme (GFSK), among others.


Let’s Recap!

In this article, we learned about:

  • What communication protocols are
  • The importance of protocols

There are many different communication protocols, but they are all striving to accomplish the same thing – to be a common language between devices.

And though the goal is the same, they may go about it in different ways, with different priorities.

“Learn The Basics of Bluetooth Low Energy EVEN If You Have No Coding Or Wireless Experience!"

Don't miss out on the latest articles & tutorials. Sign-up for our newsletter today!

Take your BLE knowledge to the next level.

If you’re looking to get access to full video courses covering more topics, then check out the Bluetooth Developer Academy.

As part of all the courses within the Academy, you’ll also be able to download the full source code to use as a reference or use within your own application.

By joining the Bluetooth Developer Academy, you will get access to a growing library of video courses.

The Academy also features access to a private community of Bluetooth experts, developers, and innovators. You’ll get to connect and interact with me and other experts in the Bluetooth space, learn from others’ experiences and knowledge, and share yours as well.

So, what are you waiting for?? Join today!

You may also be interested in these articles.

Get the new "Intro to Bluetooth Low Energy" hardcover book for FREE

This new & updated edition of my best-selling book is specially crafted to help you learn everything you need to get started with BLE development.

Grab your copy for FREE today!