Smart, connected things are inherently "connected" and for most connection technologies you would need some analysis to understand how much information is being exchanged between your IoT device and the cloud. To help you sort through this I have created this guide that lays out the data components being exchanged and leads you through some typical connection scenarios.
I am going to assume you are sending text data between your IoT device and the cloud, a smartphone/tablet application or a server you own; for simplicity we will just call these "your application".
So, your device talks to your application and vice-versa.
Text conversations, using JSON format for the exchanged information is typical for IoT. JSON is the predominant format for sending information around and if you for some reason are sending pure binary data, you can pretty much convert your binary data length in bytes to the JSON text string length.
To make it easy for you to visualize the calculations LooUQ has created an online tool, which is free to use.
IoT Bandwidth Estimator
In the simplest scenario you have a direct dialog between your device and your application. This involves no protocol such as HTTP or MQTT. In this situation the bandwidth is simply the size of your data per unit of time, typically one second. This scenario packs everything your system needs in the payload. Even in this simple approach, your project can support multiple devices per application, if you provide some type of device address in your payload like below.
If you remove formatting, we have about 75 characters.
If sent once per minute, this would consume (assuming we can use 1,000 for K and not 1,024):
108 KB/day, or
If you control all aspects of your communications, the above approach is reasonable. But if your IoT project involves 3rd party providers, it is very likely that a transport protocol will be used between your device and the providers such as LooUQ iotQi, Microsoft Azure, or Amazon AWS. The most common protocols for IoT communications are HTTP/HTTPS and MQTT, but AMQP can be found out there as well as a couple others. In all of these protocols additional information is added to your payload data in order to make the whole thing work. The benefits are increased reliability and scalability.
Here at LooUQ we primarily use MQTT; however HTTP, HTTPS, and AMQP all add weight to your messages in the same way. Let see how, there are 2 ways these protocols add up to more bandwidth used:
Headers and Properties
Headers are generally used by a protocol to describe the payload contents, this is also known as metadata. Many of the protocols out there compose a header by stringing together a list of properties. Properties are a key/value pair of data elements; the key describes the purpose of the data and the value is well the value. Let's look at an example from HTTP.
For the Accept header, the key is "Accept" and a typical value for IoT is "application/json".
Other common HTTP headers are Authorization (contains security credentials), Accept (what we would like to get back), and Content-Type (what the other party is actually returning). For a more in-depth look at HTTP header, check out this article on Wikipedia. It would be common for somewhere around 3-6 properties to be in a IoT header for HTTP or MQTT. It should also point out that in some cases the values in header properties, may remove the need for some data in the actual payload. By example a device identifier is not absolutely needed in a payload, if there is a DeviceId property in the header.
For our iotQi platform, we include the properties shown below.
"event-value": "Wind Speed:5.41"
Keepalives are small messages sent between the device and the application (the application then responds):
The first objective is straight forward enough, you would want to know if your device suddenly drops off of the face of the earth. So periodically, usually every couple minutes, the device is going to send a keepalive message. In the case of the MQTT implementation LooUQ uses, the message is 2-bytes (with 2 bytes coming back). This happens every 4 minutes for Microsoft Azure MQTT. Do the math... that adds up to a little more than 43KB over the course of a month. Take note, keephere is a
Note: keepalives are only sent if the conversation has be quite for the period of time known as the keepalive interval. If you are regularly sending data more frequently than the keepalive interval, then no keepalives are needed.
How Can You Conserve Bandwidth