What is an ad hoc network and how does it work?

A wireless ad hoc network (WANET) is a type of local area network (LAN) that is built spontaneously to enable two or more wireless devices to be connected to each other without requiring typical network infrastructure equipment, such as a wireless router or access point. When Wi-Fi networks are in ad hoc mode, each device in the network forwards data that is not intended for itself to the other devices.

Because the devices in the ad hoc network can access each other’s resources directly through a basic peer-to-peer (P2P) wireless connection, central servers are unnecessary for functions such as file sharing or printing. In a WANET, a collection of devices, or nodes, is responsible for network operations, such as routing, security, addressing and key management.

Devices in the ad hoc network require a wireless network adapter or chip, and they need to be able to act as a wireless router when connected. When setting up a wireless ad hoc network, each wireless adapter must be configured for ad hoc mode instead of infrastructure mode. All wireless adapters need to use the same service set identifier (SSID) and wireless frequency channel number.

Instead of relying on a wireless base station to coordinate the flow of messages to each node in the network, the individual nodes in ad hoc networks forward packets to and from each other. Makeshift by nature, ad hoc wireless networks are useful where there is not a wireless structure built — for example, if there aren’t any access points or routers within range and cabling cannot be extended to reach the location where additional wireless communication is needed.

However, not all Wi-Fi networks are the same. In fact, Wi-Fi access points work in either ad hoc or infrastructure mode. Typically, Wi-Fi networks in infrastructure mode are created and managed using equipment such as Wi-Fi routers, wireless access points (WAPs) and wireless controllers. Ad hoc networks are also often short-lived networks created by a laptop or other device. The use of more sophisticated network protocols and network services found on infrastructure-based wireless networks usually are not suitable for ad hoc networks.

When should you use an ad hoc wireless network?

Deciding when to employ ad hoc versus infrastructure mode depends on the use. A user who wants a wireless router to act as a permanent access point should choose infrastructure mode. But ad hoc mode might be a good option for a user setting up a temporary wireless network between a small number of devices.

components of a wireless ad hoc network
Connecting devices to the internet using an ad hoc network.

Ad hoc networks are used frequently in new types of wireless engineering. They require minimal configuration and can be deployed quickly, which makes them suitable for emergencies, such as natural disasters or military conflicts. Thanks to the presence of dynamic and adaptive routing protocols, these networks can be configured quickly. These impromptu, on-demand networks are useful for putting together a small, inexpensive all-wireless LAN without the need for wireless infrastructure equipment. They also work well as a temporary fallback mechanism if equipment for an infrastructure mode network fails.

The following example shows one of the more popular uses for an ad hoc wireless network: connecting multiple wireless endpoints to the internet using an ad hoc intermediary device. Note that the intermediary device consists of a PC or laptop with a wired connection to the internet and a second wireless chip/antenna to connect other ad hoc wireless-capable devices to it for the purpose of sharing internet access.

Types of ad hoc wireless networks

Types of WANETs vary by application need and use. Choosing a wireless ad hoc network type depends on the wireless equipment capabilities, physical environment and purpose of the communication.

MANET. A mobile ad hoc network involves mobile devices communicating directly with one another. A MANET is a network of wireless mobile devices without an infrastructure that are self-organizing and self-configuring. A MANET is sometimes referred to as an “on-the-fly” or “spontaneous network.”

IMANETs. Internet-based mobile ad hoc networks support internet protocols, such as TCP/IP (Transmission Control Protocol/Internet Protocol) and User Datagram Protocol (UDP). The iMANET employs a network-layer routing protocol on each connected device to link mobile nodes and set up distributed routes automatically. IMANETs may also be used in the collection of sensor data for data mining for a variety of use cases, such as air pollution monitoring.

SPANs. Smartphone ad hoc networks employ existing hardware, such as Wi-Fi and Bluetooth, and software protocols built into a smartphone operating system (OS) to create P2P networks without relying on cellular carrier networks, wireless access points or other traditional network infrastructure equipment. Different from traditional hub-and-spoke networks, such as Wi-Fi Direct, SPANs support multi-hop relays. Multi-hop relay is the process of sending traffic from device A to device C using intermediary device B. Therefore, device A and C do not need to have a direct P2P connection established for traffic to reach its destination. And because SPANs are fully dynamic in nature, there is no notion of a group leader in this type of application and, thus, peers can join or leave without harming the network.

Vehicular ad hoc network. This network type involves devices in vehicles that are used for communicating between them and roadside equipment. An example is the in-vehicle safety and security system, OnStar.

Wireless mesh networks comprised of radio networks set up in a mesh topology, frequently consist of mesh clients, mesh routers and gateways. In mesh networking, the devices — or nodes — are connected so at least some, if not all, have many paths to other nodes. This creates many routes for information between pairs of users, increasing the resilience of the network if a node or connection fails. Wireless mesh networks are useful in situations where a temporary wireless network is required or in more permanent scenarios where network cabling cannot be run to create an infrastructure-based wireless network.

Other types of ad hoc wireless networks include wireless sensor networks, ad hoc smart home lighting, ad hoc streetlight networks, ad hoc networks of robots, disaster rescue ad hoc networks and hospital ad hoc networks. Wireless ad hoc networks also have a number of military applications, such as Army tactical MANETs, Air Force UAV (unmanned aerial vehicle) ad hoc networks and Navy ad hoc networks.

Wireless ad hoc networks have advantages and disadvantages. Although some Wi-Fi networking experts maintain that for small LANs, ad hoc networks don’t require as much hardware and can be less costly to build, others assert that large numbers of devices can be challenging to manage without a larger, more concrete infrastructure.

Advantages of a WANET

Ad hoc mode can be easier to set up than infrastructure mode when just connecting two devices without requiring a centralized access point. For example, if a user has two laptops and is in a hotel room without Wi-Fi, they can be connected directly in ad hoc mode to create a temporary Wi-Fi network without a router. The Wi-Fi Direct standard — a specification that allows devices certified for Wi-Fi Direct to exchange data without an internet connection or a wireless router — also builds on ad hoc mode and enables devices to communicate directly over Wi-Fi signals.

Other benefits of wireless ad hoc networks include the following:

  • Because ad hoc networks do not require infrastructure hardware such as access points or wireless routers, these networks provide a low-cost way of direct client-to-client communication.
  • Ad hoc networks are easy to configure and offer an effective way to communicate with devices nearby when time is of the essence and running cabling is not feasible.
  • Ad hoc networks are often secured to protect against attacks, as their temporary, often impromptu qualities can make them vulnerable to security threats.
  • An ad hoc network linking a small number of devices might be a more practical choice compared to a traditional infrastructure-based network that can connect many more devices.

Disadvantages of ad hoc networks

One major drawback of wireless ad hoc networking is that some Wi-Fi-enabled technology, including certain Android devices, wireless printers and custom IoT sensors, don’t support ad hoc mode because of its limitations and will only connect to networks in infrastructure mode by default. In some cases, third-party software can be installed on endpoint devices to enable ad hoc communications.

Infrastructure mode is a better option than ad hoc mode for setting up a larger and more permanent network that can support far more endpoints. Wireless routers that serve as access points typically have higher-power wireless radios and antennas that provide coverage of a wider area. Ad hoc networks often suffer from poor wireless communication range issues, as antennas built into endpoints were not designed to be as powerful as purpose-built WAPs.

Ad hoc networks also do not scale well. As the number of devices in an ad hoc network increases, it becomes harder to manage because there is not a central device through which all traffic flows. When several devices are connected to the ad hoc network, more wireless interference will occur, as each device must establish a direct P2P connection to each of the other devices, instead of going through a single access point in a hub-and-spoke architecture. When a device is out of range of a device to which it needs to connect, it will pass the data through other devices on the way; this is slower than passing it through a single access point.

Other disadvantages of ad hoc wireless networks include the following:

  • Devices in an ad hoc network cannot disable SSID broadcasting like devices in infrastructure mode can. As a result, attackers can find and connect to an ad hoc device if they are within signal range.
  • Security options are limited due to a lack of network infrastructure services, such as access to a RADIUS (remote authentication dial-in user service) server for authentication purposes.
  • Wireless ad hoc networks cannot bridge wired LANs or to the internet without installing a special-purpose network gateway.
  • Devices can only use the internet if one of them is connected to and sharing it with the others. When internet sharing is enabled, the client performing this function may face performance problems, especially if there are many interconnected devices.
  • Ad hoc mode requires the use of more endpoint system resources, as the physical network layout changes when devices are moved around; in contrast, an access point in infrastructure mode typically remains stationary from an end-device perspective.

Despite the disadvantages, wireless ad hoc networks remain a viable option for many personal and enterprise use cases. As long as network administrators understand the communication capabilities of a WANET — and if those capabilities can fulfil a specific need — building an ad hoc network is a quick and fairly painless way to connect two or more devices.

Need some wireless network troubleshooting tips? Learn how to root out and solve these issues.