Hologram.io Data Usage Breakdown

Ross Hettel
Aug 31, 2016 · 3 min read

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.

Image for post
Image for post
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.

Image for post
Image for post
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%!

Image for post
Image for post
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.

Image for post
Image for post

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.

Hologram.io

Stories from the Hologram team on all things IoT…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store