WiFi Basics
Burton Rosenberg
Last Revised: Feb 2006
Executive Summary
WiFi is the marketing name for the 802.11-b variant of the
IEEE standard 802.11.
802.11 is a wireless data communication protocol standard
covering both the Physical and Datalink networking
leves (levels 1 and 2), with the letter giving variants,
especially in the Physical layer.
At the time of writing, a new variant, 802.11-g is widely deployed.
It differs from the -b varient in the Physical layer, giving higher
transmission rates.
I'm not sure if WiFi will refer to this variant as well.
In these notes I will say WiFi to avoid starting a sentences
with a number.
The 802.11 specifications cover many Datalink variations:
either be Infrastructure, using
Access Points and briding across to other technologies, or Ad Hoc,
where hosts discover each other and can talk if they are nearby.
The contention for the channel (the radio frequency) can be either
distributed using the Distributed Coordination Function, DCF,
or centralized using the Point Coordination Function PCF.
To support wide integation of WiFi into existing network infrastructure,
it is designed to be, as much as possible, ethernet in the air,
at least when used in the Infrastructure mode, and using the
distributed contention model of DCF.
There are two problems that make wireless different then wired.
-
The hidden substation problem.
-
High error rate.
These problems demand that a DCF WiFI be a
CSMA/CA network (Collision Avoidance)
rather than a CSMA/CD network (Collision Detect).
The result are the following protocol elements,
-
Positive Acknowledgement. Every packet sent is positively acknowledged
by the receiver. The next packet is not sent until receiving a positive
acknowledgement for the previous packet.
-
Channel clearning. A transmission begins with a RTS (Request to Send)
and the destination or receiver responds with a CTS (Clear to Send). Then
the data packets flow. For the channel is cleared by these two messages.
All that hear the CTS squelch. This helps with the hidden substation
problem.
-
Channel reservation. Each packet has a NAV (Network Allocation Vector)
containing a number X. The channel is reserved to the correspondents
(the sender and receiver of this packet) for an additonal X milliseconds
after this packet. Once you have the channel, you can hold it with
the NAV. The last ACK contains NAV zero, to immediately release the channel.
-
Packet numbering/Fragment numbering. Each packet has a sequence
number with 4 bits of fragment number and 12 bits of sequence number.
Packets with duplicate sequence or fragment can be discarded by
the receiver. They resulted from a retransmission, and if the receiver
already valid frame, it only needs to forward the frame once. A large
frame can be divided into fragments which are sent and acknowledged
sequentially. These will have the same sequence number but consecutive
fragment numbers. The receiver must reassembly these before resend or
bridgeing.
As for PCF, it is a polling, token-ring type communcation system.
It isn't used for the most popular WiFi configuration.
Physical Characteristics
802.11 defines many Level 1 variants.
802.11g is the new, high-speed Level 1
standard, versus 802.11b, the first generation WiFi.
The radio frequency band is around 3 Gigahertz, same as
a microwave oven. As you can see in your WiFi setup, there
are channels within the band. These channels overlap so that
at most 3 channels can be in use at the same time.
The allocated frequence band for -b is
2.415 GHz up to 2.484 GHz in 14 bands of 5 MHz each.
Spread Spectrum communication is used, called
DS for Direct Sequence, where the signal is
modulated with a 11 bit Barker sequence, a pseudo random noise,
to spread the information over a 22 MHz range (with additional
signal outside the range being partially suppressed).
Therefore, only every 5-th channel is usable, in order to separate WiFi
transmissions. For example, in a single location, use only channels
1, 6 and 11, else there will be interference.
FYI
Complementary Code Keying (CCK) encodes the bits, and the bits
are impressed on the carrier using a phase shifting technology called
orthogonal frequency-division multiplexing (OFDM). The result
is communication in the range of 6 up to 54 Mbps, depending on sunspots
and the like.
Network topologies, bridging
A group of corresponding stations is called a BSS (Basic Service Set).
The BSS can be organized in several ways.
- Independent BSS, or ad hoc. The network is only the members of the BSS,
they talk between themselves directly, they self-organize, there is not
central autority.
- Infrastructure BSS. The BSS is organized around an Access Point which
can bridge traffic out the BSS onto a distribution network. Members
of the BSS talk to the AP only.
You can often understand a domain by answering the question "who will
hear a broadcast". A BSS (data link layer) is defined by who will
hear a broadcast from the AP (but not by a station which is not an AP, because
of the hidden station problem!).
- ESS (Extended Service Set). A bunch of BSS's connected by a distribution
network. The distribution network connects the Access Points. WiFi doesn't
specify the protocol that builds ESS's.
We will skip ad hoc and concentrate on Infrastructure.
Since this is ethernet on the air, each transmitter/receiver
has a 48 bit MAC consistent with the ethernet address.
That is, same address space, OUI's, and so on.
An AP is a bridge between wired and unwired ethernet, so it
has two interfaces.
As the leader of a BSS, it gives names the BSS by the
ethernet address of its air interface. This is called
the BSSID.
An ESS is given a name, called the SSID (Service Set ID).
This is the thing you type into your network configuration to
join a WiFi network.
A packet on the air will have three addresses, source, destination
and BSSID (access point address, essentially). The AP takes
traffic it receives off the air that has its address and drops
it onto its wired interface, eliting its own address. That is,
on the wired side, only the source and destination addresses
are seen. The address of the AP is not used, either its wired
or unwired addresses.
When an AP sends a packet into the air, it uses the source and
destination address of the packet it is bridging as found,
and adds its own wireless address as the BSSID. A
wired station sending to a wireless station uses the wireless stations's
ethernet address just as if it were a wired station. The
AP picks the packet off the wire, carries it across to
its wireless interface, inserting its wireless address as the
extra, third address, and sends it out to the destination.
Association and so on
Definitions:
-
BSS
-
Basic Service Set. A bunch of machines forming a cell.
-
ESS
-
Extended Service Set. Using WiFi beyond a BSS, gluing together
several BSS
-
BSSID
-
A 48 bit identifier for a BSS. If an infrastructure BSS, it is
the MAC of the 802.11 side of the Acess Point. Else the local bit
is set and a 48-bit identifier is randomly selected.
-
SSID
-
Service set Identifier. An character string identifier for a ESS.
-
NAV
-
Network Access Vector. A time slot reservation, in microseconds.
-
RTS/CTS
-
Request To Send, Clear To Send. Reservation mechanism.
Source,
Quick description
-
WiFi is standard 802.11, with various letters added.
The standard includes a large number of physical variants.
-
The link levels can either be an Independent BSS (IBSS) or an
infrastructure BSS.
An infra. BSS can be contention based or coordinated (Point
Coordination Function).
-
Infrastructure BSS uses AP (access points) and a distribution
medium, e.g. ethernet (802.2), either the AP acting as bridges.
In a simple example, the packet has three addresses, the two
"transparent" endpoints and the BBSID, which is the way-point
for the packet between air and wire.
-
In an infra. BSS, the AP either Beacons or responds to a probe
from a node. An association (after possible authentication)
occurs, so that traffic from the host is bridged onto the
distribution by the AP.
-
Gratuitous ARPs open up switches to L2 forward traffic to
associated AP.
-
There are mobility issues, which are not part of the standard.
-
It is a positive acknowledge system. Each packet is positively
acknowledge (an ACK packet) before the next packet is sent.
-
Packets carry NAV's which hold the channel clear for the
time stated in the NAV.
-
RTS/CTS pair with NAV covering up to the end of the ACK
of the data packet are exchanged. The ACK has a NAV of 0.
-
There are not NACKs.