Set up Passthrough rules for a Connector

How to allow some traffic to be routed to the Internet instead of the Connector?

Using a Connector is a smart way for your devices to be able to send less data by removing some logic (e.g. TLS) from the device, and put it onto Onomondo. This can save on battery, traffic, cost, and can increase security because some routing logic is put into the network.

However, when you use a Connector, then all traffic is routed to that Connector, which means that it will not go directly to the Internet. Often it's preferable that some traffic is still routed directly to the Internet, and this article will show you how to do that.

Set up NTP (Network Time Protocol)

Often we see developers forget is that many operating systems will be using NTP to keep the clock updated. And that needs to be able to contact to the NTP servers. NTP uses UDP and runs on port 123, so a passthrough rule for that would look like:

image-png-feb-02-2022-09-57-12-14-am

Set up DNS

Since Onomondo's Connectors work on the network layer it does not have knowledge of hostnames. So if your code would try to access myhostname.com:1234 then that would translate into first doing a DNS request for myhostname.com and then contact that IP address.

That's why another common rule is to allow DNS to be routed to the Internet. Be aware that DNS can run both over TCP and UDP.

After adding both rules your configuration will look like this:

image-png-feb-02-2022-10-03-09-09-am

If you want to save extra traffic and battery you should use IP addresses in your code, instead of hostnames. This can save several DNS requests.

Allow firmware updates

One of the most common questions we hear when it comes to Connectors is how to allow firmware updates. There's of course many way to do this, but often your device will call home in some way and see if there is an update.

As an example let's say your device calls your home server that has IP address 21.32.43.54 and if there is an update it will be fetched from an FTP server somewhere.

After adding both rules your configuration will look like this:

image-png-feb-02-2022-10-16-58-56-am

Use Traffic Monitor to help set up Passthrough rules

In some cases, especially when testing with a larger device, there can be several services running on the device and it can be difficult to be aware of all of them.

By using Traffic Monitor you will have a great way of seeing all the traffic going in and out of your device which can really help setting the correct Passthrough rules 

A good way of doing this is to find the sim you are testing with, then open the Traffic Monitor, and after that turn on the device. Keep doing what you normally do and see what traffic there actually is.

Here is an example of some traffic from a sim:

image-png-nov-23-2021-01-19-50-40-pm