WiFi has freed the computer from being tied to a network connection by wires. If you think your tablet or smartphone is fun, imagine if you needed a wire to connect it to the Internet. But WiFi isn’t just a dumb radio transmitter and receiver, it is a sophisticated computer in its own right and it deserves to be better understood.

The idea of connecting everything up using radio links isn’t a difficult one to think up and to a certain extent the real question is why did it take so long?

The answer is quite simple – because it’s a difficult thing to do!

The WiFi networks that we now take for granted are both complex and sophisticated and would be virtually impossible without the use of the computer technology they are designed to connect.

So how does it all work?

Standards

Although there were early attempts at wireless networking, the big breakthrough was the family of wireless networking devices based on the 802.11 standard.

The standard was thrashed out by the Institute of Electrical and Electronic Engineers (IEEE) and should really be called the IEEE 802.11 specification.

One of the big problems for users, and for anyone trying to understand how it all works, is that 802.11 isn’t a single specification but an evolving set of specifications with names like 802.11a, 802.11b, 802.11g and so on.

Each specification uses slightly different technology to create a better solution to the problem and each one increases the confusion. To cap it all, the term WiFi used to refer only to systems based on 802.11b but now it has been decided that any 802.11 device can be called WiFi – even if they are incompatible.

For a summary of the most common standards see the table below:

Standard date
802.11

1997

The original specification that defined two transmission rates 1 or 2Mbps working on the 2.4GHz band. It achieves its data rate by using frequency hopping or direct spread spectrum.
802.11a

1999

A relatively recent addition to the standards, it defines a 54Mbps data rate using the 5GHz band by using an advanced transmission technique called Orthogonal Frequency Division Multiplexing, OFDM.
802.11b

1999

Currently the most popular and the one most often referred to as WiFi. It operates at 11Mbps but can fall back to lower speeds if conditions are poor. It uses direct spread spectrum transmission in the 2.4GHz band.
802.11g

2003

An upgrade to 802.11a. It uses the same advanced techniques (OFDM) but in the 2.4GHz band to achieve data rates of 54Mbps.
802.16

2001

Also known as WiMax because of its ability to work over much larger distances. It uses the 10-66GHz band to achieve data rates of 70Mbps and greater.
802.11n

2009

Currently the fastest standard using 2.4GHz capable of using double the bandwidth (40MHz) using multiple streams – still an OFDM coding scheme, however.

Spread spectrum

The big problem with wireless networking, or indeed any wireless technology, is in using the available range of radio frequencies effectively. Although each of the wireless networking standards uses slightly different techniques to achieve this they all share a common approach – spread spectrum.

The basic radio technique is to have a transmitter and receiver working on a set frequency providing a single communication channel between two machines. However a network doesn’t need a dedicated channel between each pair of machines because each machine only needs to transmit when it has a packet of data ready for another machine.

This makes it possible to share a single communications channel in the same way that a group of people can take turns in talking. Wired and wireless networks use Carrier Sense Multiple Access (CSMA), which means that each machine listens to see if another machine is transmitting before sending a data packet. It is more or less what we do to share the “channel” when talking in a group. Each potential speaker listens to see if someone is talking and anyone with anything to say takes advantage of a silence to start talking. If there is a collision e.g. two people start talking at the same time, then there is a backoff rule which tells them both to be silent for a short random time. That way the first to speak gets the channel. It is a very simple algorithm for sharing a channel but it works well unless the channel is congested and then things start to become inefficient.

It is a strange twist of fate that the first Ethernet implementation, Alohanet, used CSMA to share radio channels connecting computers on different Hawaiian islands.

CSMA would be all that was required if it wasn’t for the additional problem inherent in using radio – interference from other users. Radio waves aren’t like signals in a network cable. They spread out, they are reflected from surfaces and they are generated by other sources.

For example, WiFi networks often use the 2.4GHz band which is also used by microwave ovens, cordless phones, Bluetooth devices, wireless video cameras, audio/visual wireless links, burglar alarms, garage door remote controls, and so on.

The low-tech solution is to allocate a frequency channel to each device but this is inefficient as most of the frequency space would be unused for most of the time. A better way of sharing the frequency range is to spread the transmission over all the frequencies – spread spectrum. By spreading the data across a range of frequencies, interference on selected frequencies only disrupts part of the communication and this can be detected and the lost data can be repeated.

 

wifi1

If the data is concentrated a single frequency then interference can cause complete loss.

By spreading the data over a range of frequencies something usually gets through.

The most primitive method of spread spectrum is Frequency Hopping (FH) where the transmitter and receiver change frequencies in a predetermined sequence.

The original 802.11 specification used FH or, as an alternative, a slightly more advanced method called Direct Sequence (DS) which uses mathematical functions to spread the data over a range of frequencies. In theory DS should be able to achieve a better use of the bandwidth and hence a higher data rate but it’s difficult to get it right.

The 802.11b WiFi specification uses DS in the 2.4 GHz band and achieves 11Mbps compared to the 2Mbps of the original 802.11 DS mode.

The 802.11a specification uses a higher frequency range, the 5GHz band, and it uses an even more advanced spread spectrum technique called Orthogonal Frequency Division Multiplexing (OFDM).

In principle a higher frequency should mean a higher bit rate and indeed an 802.11a radio can work at 54Mbps, but there are disadvantages. A higher frequency doesn’t travel as far and needs more power.

Now we have the best of both worlds because 802.11g introduces OFDM to the 2.4GHz band without any loss of speed. And 802.11n adds multiple aerials to improve signal management and reduce interference.

Channels

The most popular wireless networking standards use the 2.4GHz band and they divide it up in the same way and use one of the spread spectrum methods to share it.

Exactly how this is done can help understand how to set up a network and what can go wrong. The 2.4GHz band is divided into 14 channels separated by 5Mhz. Only 11 channels are available in the US and 13 in the UK with Japan allowing all 14.

When a wireless network is established you set the channel it will operate on. The channels may only be separated by 5MHz but the spread spectrum uses 25MHz centred on each channel.

 

channel

The channel spacing is smaller than the range of frequencies used!

 

What this means is that if two wireless networks are close, in the same building say, and set to channels 1 and 2 they will both be trying to use the overlapping frequencies. Without spread spectrum techniques this would be a disaster with neither network able to operate. However, in many cases the two can share the frequency range but with a reduction in data rate.

To avoid this problem wireless networks that are within each other’s range should optimally be set to non-overlapping channels, e.g. channel 1, 6 and 11. By repeating the pattern you can cover large areas with non-interfering wireless networks.

 

overlap Non-overlapping channels give trouble free coverage

 

overlap2

By repeating the pattern channel 1, 6 and 11 you can cover any area without interference.

Ad-hoc and infrastructure modes

As well as the radio link part of wireless networking there is also the problem of how to integrate a wireless network with a wired network. There are two basic modes of operation – ad-hoc and structured. A group of computers that can communicate using a wireless link are called a Basic Service Set, or BSS.

An ad-hoc network also known as an Independent Basic Service Set (IBSS) is the simplest because all of the machines communicate with one another in a peer-to-peer or workgroup network. When two or more IBSS operate as a single workgroup the result is called an Extended Service Set, ESS.

The alternative is Infrastructure mode, which makes use of special Access Point (AP) wireless device. This is a stand-alone box that only needs a network connection and not a PC to operate. The AP acts as a master and controls all transmission within a BSS. It has management algorithms and transmits special control packets to its clients to make best use of the available bandwidth. The AP also connects to a wired network and acts as a wireless/wired bridge passing data packets in both directions. Two APs never talk to each other via the wireless link and always transfer data between themselves via the wired network.

As well as allowing wireless connected machines to integrate with a wired network, an AP also provides extra facilities such as broadcasting the network identifier, the Service Set Identifier (SSI), allowing users to discover that a network is available. An AP also enables “roaming”. That is, if a user moves around from one BSS to another, as long as the access points are using the same SSI then the user will be automatically handed over as one AP goes out of range and another comes into range.

Infrastructure mode is so much better than ad-hoc that some wireless networking cards can act as APs, even though they aren’t standalone and need a PC to operate.

 

Security

A wireless network has all of the security problems of a wired network plus the additional drawback that it broadcasts the data packets rather than keeping them safe inside the wires.

Extra security in the form of Wired Equivalent Privacy (WEP) was designed into all of the standards to, as its name suggests, make a wireless network as secure as a wired network. Unfortunately this is one area where the standards got it wrong. The first problem is that WEP is turned off by default and even though it’s flawed it’s better than nothing.

The second problem is that it is often based on using a very short cryptographic key and the RC4 cipher algorithm. It works by using a secret key, a 64-bit number, and using it to create a seemingly random stream of bits – the key stream. The key stream is combined (Exclusive ORed) with the data before it is transmitted. When it is received the same key is used to generate the same key stream and this is used to recover the data.

 

wep

 

How WEP works

The 64-bit key is obtained by combining a 40-bit WEP key with a random 24-bit initialisation value. The initialisation value is transmitted with the packet and is unencrypted. As long as the receiver has access to the same 40-bit WEP key then the initialisation value can be used a second time to recover the 64-bit key and decode the data.

What is wrong with WEP?

The fact that it uses only a 40-bit key makes it possible to decrypt using brute force. Most modern wireless cards and software supports larger keys but this doesn’t help with the next two problems. The initialisation value is only 24 bits long and this means that is reused too often, giving an attacker samples of packets encrypted using the same value. When you add to this the fact that some values are particularly easy to crack you can see why it isn’t a good method. Finally the WEP key is a “shared secret”. That is, it has to be distributed to each network user by some method or other. Distributing keys is a weakness in itself.

WPA, WPA 2 and 802.11i

The only way around the problem is to use additional security. A collection of stopgap measures called Wi-Fi Protected Access (WPA) is currently the best we have.

Add to it TKIP, which uses dynamic WEP keys, to stop eavesdroppers guessing the key and public key cryptography to distribute the WEP keys over the wireless network an it works quite well.

However another standard – 802.11i or WPA 2 – is an even better solution.

Clearly WPA is better than WEP but surveys have revealed that the majority of wireless networks don’t even use WEP and it’s important to realise that in this case the data is being transmitted unencrypted and can be read by anyone with a portable computer, a wireless network card and some purpose-built software.

What is more open networks can be used by anyone and you could find yourself liable for what they download with no way to prove it wasn’t you.

overlap2

Source : i-programmer

Leave a Reply

Your email address will not be published. Required fields are marked *