Challenges with Wi-Fi Provisioning for Embedded Systems

Getting Wi-Fi Products Connected

Imagine yourself for a second a customer that just bought a laptop. They arrive home and want to connect to the internet. The customer wants to do so wirelessly so what do they do? Windows, Linux and Mac OS X each provide a list of Wireless Networks available. Once selected,the customer can provide a password and login. This process is used for hundreds of millions of devices and despite some issues with interoperability, signal strength, and other factors, usually works well.

Consider the same scenario for a customer who just bought a new Wi-Fi enabled Garage Door opener. This device has no native need for an LCD, and will have very few buttons, so connecting it to the network is not straightforward. Most manufacturers prefer to avoid adding unneeded interfaces due to the cost in terms of Bill of Materials, development, time to market and customer support. A Wi-Fi enabled Crock-Pot will have at most a few buttons and LEDs, not more

The initial step of connecting the product to the access point. Simply put, you only have once to make a good impression. IoT devices are inherently designed to help make our lives easier, and making a customer jump through hoops to get their device connected to the internet and running runs against that. Don’t believe me? Looking at Amazon reviews you can see several products returned by customers because of their bad experience installing it and using it. Worse, some customers get turned off to the idea of using these devices.

Making the connection between the device and the router is usually never considered until the user purchases the product. As a developer of consumer goods, its important to understand all the ways the initial connection to the router can be made, their advantages and disadvantages. When looking to implement provisioning, we generally look for the following characteristics:

  • Ease of Use – Its important to ensure that the method can be performed by anyone without a technical background. This factor should not be underestimated. Users expect Wi-Fi connection that is seamless and quick.
  • Interoperability – Given the wide range of Access Points used by customers, its important to ensure interoperability of the method if it depends on the Access Point.
  • Security – The mechanism for association should not leak the key or passphrase.
  • Ease of Implementation – The mechanism should avoid requiring the manufacturer to create a significant infrastructure to support

We can categorize mechanisms for associating the device to the network into two main bins: Specification mechanisms and Vendor mechanisms. Specification mechanisms are typically those specified by the 802.11 or Wi-Fi standards themselves, either mechanisms already built into 802.11 or building on top of existing protocols to make the process of association a breeze. Aside from these mechanisms we cover some of the more popular methods created by vendors, both Wi-Fi chipset and OEMs. There are many many ways to give the Wi-Fi controller the SSID and passphrase or key.

Specification Mechanisms

Wi-Fi Protected Setup [2]

Wi-Fi Protected Setup configuring with Wireless Router

Lets start with Specification mechanisms, especially those built in to 802.11 and Wi-Fi. The first of which is WiFi Protected Setup. Long ago, the Wi-Fi alliance realized that the initial step of connecting the device to the network could be difficult. The passphrase for Wi-Fi can be up to 63 characters long. Most customers don’t readily know it and it can be frustrating to type it into a system with a limited interface.In 2006, the Wi-Fi Alliance released the WPS spec. WPS actually consists of several mechanisms, most optional and some required which need to be implemented if a product wishes to be WPS certified

  • USB – A USB Flash drive is configured with the association information when connected to a router or another device. It is then connected to the product that needs to associate. This method is rare and deprecated since it requires a USB port and a full USB stack on the device. The Wi-Fi Alliance does not even mention it on their site online.
  • PIN Method – Another method by which the PIN number from the product is input to an interface provided by the Access Point. Typically the user goes into the router webpage located at the router IP address and uses the PIN to allow the device to associate.
  • Push Button – This is probably the most popular mechanism. A user presses the WPS button on the AP, which opens a time window. During this time (a few minutes typically), the customer presses the WPS button on the product. The product and the AP manage all the underlying communications, which allows the product to completely connect to the Wi-Fi network.
  • NFC – Uses RFIC tags to transmit information, thus avoiding having the customer input information, either with a tag supplied to the product or a mobile phone using NFC

Only the PIN method is required for WPS certification. In 2011, security researchers found major flaws that allowed an attacked to connect to the Access Point by attacking the PIN method and the implementation of WPS done by some vendors. Using brute force it is possible to recover the PIN of the router and with that the actual key. Although many vendors have released firmware updates that make the attack impractical, the vulnerability itself remains. Some customers have disabled WPS on their routers to avoid the vulnerability. Another issue with WPS Pushbutton method is that an attacker could easily abuse the Pushbutton method by using WPS on another device during the time window that the AP WPS is enabled by a legitimate customer installing a product. This is as simple as pressing a button at the right time.

With all this said, WPS is supported in most if not all Access Points sold today, but has rapidly fallen out of favor due to security vulnerabilities. In fact, reports are that Android P - the latest release of Android - will not support it. We suggest you avoid relying on WPS for your product.

Using Access Point (AP) Mode

Another popular mechanism for provisioning is making the product begin as an Access Point. WLAN chipsets are very flexible, and many can operate as an Access Point. When the customer starts the product for the first time, the product starts as an Access Point. The customer can then use a laptop or mobile phone to enter the access point and input the information of the actual Access Point to which the product should connect. The product then turns off the AP functionality. Using the credentials given by the user, the products connects to the Access Point. Given that the initial connection uses security such as WPA or WPA2, the transfer of the SSID and key to the product is secure, although it is possible to attack. WPA and WPA2 are vulnerable to dictionary attacks under certain conditions. Since most manufacturers provide short passwords for the product when in AP mode to avoid having the user type a long passphrase, a dictionary attack is possible. There are, however,ways to improve on this mechanism by using a 2D barcode with the information so the customer avoids typing and the passphrase and key can be longer and random.

This method is secure, but has the disadvantage that support for AP mode varies among chipset vendors, and it also requires having a webserver with which the user can interact to input the data. It also adds another step that can confuse some customers.

On of the issues with this approach is that often chipsets support only AP or Station mode. So after the user provides the credentials, the user is disconnected so the device can form the access point connection. This is a problem if, for example, the credentials are wrong. In that case, the system will go back to an access point, but the user doesn't know this has happened.

This approach is low cost because it uses the same Wi-Fi capabilities using a SoftAP, but the lack of real time feedback from the user can result in provisioning issues, as many companies discover when they get support calls from users.

Using Ad-Hoc Mode

Although Ad-hoc Mode has largely fallen out of favor,due to AP mode, it could be used in the past for provisioning. Basically, when a product is in Ad-hoc mode it can connect directly to another device such as a laptop without using an Access Point as an intermediary. The user connects to the product using Ad-hoc mode via a computer with wireless capabilities, inputs the settings for the credentials of the actual Access Point. The product then connects to the actual AP. Ad-hoc mode is difficult for customers to use, usually counterintuitive and has lost support from WLAN vendors.

Vendor and Custom Mechanisms

Because the 802.11 and Wi-Fi provisioning mechanisms have their issues, product developers are still looking for reliable, secure and commonly available methods to provide credentials to the product to connect. Because of this, various chipset vendors and companies have developed mechanisms that work better. We'll review some of the most common ones and whether you should choose them for your product.

BlinkUp  [3]

BlinkUp Provisioning using Smartphone and simple circuit

Blink Up is a custom and novel provisioning mechanism created by Electric Imp that works using technology that has long been used. It uses a phototransistor in the product to receive bits from the smartphone screen. The smartphone screen blinks white or black to generate a stream of bits, which the phototransistor can sense. These bits contain the Wi-Fi information and allow the product to communicate. This provisioning method is very low cost, and requires only a simple phototransistor and potentially some LEDs. The downside is that it's mostly one-directional and custom. The user has to place the smartphone screen against the product for it to work. This can be inconvenient in some cases.

TI Smart Config  [4]

Texas Instruments has developed its own Wi-Fi based mechanism called SmartConfig. Technically it is in-band, but since it is vendor specific so we will cover it here. The TI CC3000 is currently the only device known to support the mechanism. At product startup, the Wi-Fi chipset is listening in a special mode that can receive packets from a mobile phone. A special application provided by TI runs on the phone and it can send the SSID and passphrase encrypted by AES. The CC3000 receives the data and forwards it to the microcontroller. The microcontroller, having the AES key decodes the credentials and configures the CC3000 to use them to associate. One issue to consider is key management. If the same AES key is used for all products, attackers could sniff the exchange between the mobile phone and the CC3000 to decode the credentials. Using AES keys for each product requires careful consideration in choosing the key.

USB

Some devices such as printers that support USB allow for provisioning the printer via USB by using a configuration software. This software runs on a PC with Wi-Fi, which finds the nearby Access Points, allowing the user to easily select the AP they want the printer to connect to. The user then provides the passphrase. The printer verifies the connection while USB is connected and can be moved afterwards without any USB connection. The advantage of this approach is that it is reliable and the Wi-Fi connection can be verified before the printer is moved, but it can be a hassle the first time it is setup.

Apple MFI

Apple's MFI program is a certification process for your device to become interoperable with Apple Devices. One of the benefits of MFI is that it allows your product to access functionality not normally accessible which requires secure authentication. One of these features is the ability of an Apple device to share its Access point information (including passphrase) with another MFI device to allow for quick provisioning. You can see this feature working in Apple devices themselves when an iPhone detects a nearby Apple watch that is being configured and provides it with configuration information. If your product is made MFI compatible, your product could take advantage of this feature.

This method works nicely but is limited to Apple devices and users, and requires your product to obtain MFI certification which can be challenging to obtain (and requires an addition of an authentication chipset). We typically see this methods used when MFI is required for some other reasons and is already available on the system.

Bluetooth Low Energy

Bluetooth is another mechanism that is already supported by combo Wi-Fi + Bluetooth devices. It is one we highly recommend to use in case you're looking for a reliable solution. In particular, we'll talk about Bluetooth Low Energy. Bluetooth has long been integrated with Wi-Fi since mobile phones typically have to support both to allow connecting to Bluetooth headsets. Bluetooth integrates security that allows a Bluetooth enabled product to connect to a mobile phone and exchange information, such as the association credentials for the Wi-Fi connection. Once the product gets the credentials using BLE, it can connect to the Access Point and the internet. The exchange of information is usually quite secure. Bluetooth Low Energy has quite a few advantages when used for provisioning:

  • Easy Pairing - Connecting a Smartphone to a BLE enabled product is relatively simple and requires no user interference unless you wish to add further security. Even then, it is much quicker than Wi-Fi
  • App Remains connected to Internet - Because the credentials are sent over BLE, it leaves Wi-Fi radio on the phone connected to the internet, which means your product can connect and start working immediately. There's no need to have the user switch between Wi-Fi networks, a manual step in iOS which is confusing and problematic.
  • Security - BLE has built in mechanisms for security that protect the credentials being sent
  • Secondary Communications - BLE can be used for diagnostics when Wi-Fi fails, and for backup communications if the router is having issues.

Many devices, especially those that already have a Bluetooth radio, use BLE for provisioning. Examples include the Nest Cam, Amazon Echo, Google Hub and many others. However, your own product will need to have BLE capability integrated to enabled this, which adds cost and development effort. You will also need to integrate Bluetooth LE in your mobile apps.

Conclusion

Product developers have many options to help the initial provision. The right choice is always a balance between cost, speed and security. You should understand how your product will be used and find the right approach to make sure end users get the behavior they expect.

References

  1. “How does Wi-Fi Protected Setup work?”. http://www.wi-fi.org/knowledge-center/faq/how-does-wi-fi-protected-setup-work. Wi-Fi Alliance. Retrieved 2014-1-29.
  2. “Wi-Fi Protected Setup”. http://en.wikipedia.org/wiki/Wifi_Protected_Setup . Wikipedia Retrieved 2014-1-29.
  3. “BlinkUp”. http://electricimp.com/docs/gettingstarted/1-blinkup/. Electric Imp. Retrieved 2014-1-29.
  4. “CC3100 Smart Config”. http://processors.wiki.ti.com/index.php/CC3100_Provisioning_Smart_Config. Texas Instruments. Retrieved 2014-2-1.
SUBSCRIBE

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Related Articles