Hologram.io Data Usage Breakdown

In the IoT space, every byte counts — especially when you’re sending data over cellular. We’ll compare two ways of sending data to our cloud platform to see the data savings benefits. In this comparison both the request and response will be included in our data usage calculation, as all bytes sent over the wire (or air) get counted in the billing of data usage.

The Hologram Dash, ready to send some data

The first method of sending data we’ll examine is the most common transmission protocol on the Internet: a JSON payload over an HTTP call. We’ll start with 10 bytes of data, ‘hologramio’, and send it with cURL:

curl -X POST -H "Authorization: Basic xxfakepasswordxx" -H "Content-Type: application/json" -d '{\n "data": "hologramio",\n "deviceid": "37539"\n}' "https://dashboard.hologram.io/api/1/csr/rdm"

Using tcpdump and Wireshark, we can visualize the packet breakdown and see the full data usage of this request and response.

Wireshark capture of the HTTP request

A large majority of the data usage comes from the SSL certificate handshake — this is required so all of your messages can’t be read from prying eyes. Unfortunately the way SSL works, this handshake needs to happen with every request.

So in total, that’s 6981 bytes used in this request. Now let’s compare that against the SerialCloud.println() method on the Dash firmware. Since the Dash communicates over cellular, we don’t quite have a way of grabbing the raw packets. But looking up the data usage report we can see that the same payload ended up using only 506 bytes! That’s a savings of almost 93%!

Sending data over Hologram’s cloud

A major factor for the difference in data usage is that SerialCloud.println() transmits over a socket connection instead of the HTTP protocol, thus avoiding a lot of overhead like HTTP headers and the like. And instead of JSON, which isn’t very efficient byte wise, we use a simple string with single character delimiters for the payload.

This chart that can help estimate data usage for a payload size. The numbers won’t always be exact as various factors can change the total usage, such as TCP retransmission on a spotty cellular signal. A good rough estimate is to expect around a 90% data savings over the HTTP call, with the percentage decreasing as the payload gets larger.

Like what you read? Give Ross Hettel a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.