Saturday, March 15, 2008
Network Design
When solving a complex problem, it is often useful to draw a picture of your resources and problems. In this chapter, we will look at how other people have built wireless networks to solve their communication problems, including diagrams of the essential network structure. We will then cover the networking concepts that define TCP/IP, the primary networking language currently spoken on the Internet. We will then demonstrate several common methods for getting your information to flow efficiently through your network and on to the rest of the world.
Physics in the Real World
There is much more to learn about radio physics than we have room for here. For more information about this evolving field, see the resources list in Appendix A. Now that you have an idea of how to predict how radio waves will interact in the real world, you are ready to start using them for communications.
Calculating with dBs
The decibel is a dimensionless unit1, that is, it defines a relationship between two measurements of power. It is defined by:
Why are decibels so handy to use? Many phenomena in nature happen to behave in a way we call exponential. For example, the human ear senses a sound to be twice as loud as another one if it has ten times the physical signal.
Another example, quite close to our field of interest, is absorption. Suppose a wall is in the path of our wireless link, and each meter of wall takes away half of the available signal. The result would be:
Here are some commonly used values that are important to remember:
Power
We will come back to details of transmission power, losses, gains and radio sensitivity in chapter three. Here we will briefly discuss how the power P is defined and measured.
The electric field is measured in V/m (potential difference per meter), the power contained within it is proportional to the square of the electric field,
Fresnel Zone
Figure : The Fresnel zone is partially blocked on this link, although the visual line of sight appears clear.
Note that there are many possible Fresnel zones, but we are chiefly concerned with zone 1. If this area were blocked by an obstruction, e.g. a tree or a building, the signal arriving at the far end would be diminished. When building wireless links, we therefore need to be sure that these zones be kept free of obstructions. Of course, nothing is ever perfect, so usually in wireless networking we should check that that the area containing about 60 percent of the first Fresnel zone should be kept free.
Here is one formula for calculating the first Fresnel zone:
r = 17.31 * sqrt(N(d1*d2)/(f*d))
...where r is the radius of the zone in meters, N is the zone to calculate, d1 and d2 are distances from obstacle to the link end points in meters, d is the total link distance in meters, and f is the frequency in MHz. Note that this gives you the radius of the zone. To calculate the height above ground, you need to subtract the result from a line drawn directly between the tops of the two towers.
For example, let's calculate the size if the first Fresnel zone in the middle of a 2km link, transmitting at 2.437GHz (802.11b channel 6):
r = 17.31 sqrt(1 * (1000 * 1000) / (2437 * 2000))
r = 17.31 sqrt(1000000 / 4874000)
r = 7.84 meters
Assuming both of our towers were ten meters tall, the first Fresnel zone would pass just 2.16 meters above ground level in the middle of the link. But how tall could a structure at that point be to clear 60% of the first zone?
r = 17.31 sqrt(0.6 *(1000 * 1000) / (2437 * 2000))
r = 17.31 sqrt(600000 / 4874000)
r = 6.07 meters
Subtracting the result from 10 meters, we can see that a structure 3.93 meters tall at the center of the link would block up to 60% of the first Fresnel zone. To improve the situation, we would need to position our antennas higher up, or change the direction of the link to avoid the obstacle.
Line of Sight
Things get a bit more complicated when we are dealing with microwaves. Remember that most propagation characteristics of electromagnetic waves scale with their wavelength. This is also the case for the widening of waves as they travel. Light has a wavelength of about 0.5 micrometers, microwaves as used in wireless networking have a wavelength of a few centimeters. Consequently, their beams are a lot wider -they need more space, so to speak.
Note that visible light beams widen just the same, and if you let them travel long enough, you can see the results despite of their short wavelength. When pointing a well focussed laser at the moon, its beam will widen to well over 100 meters in radius by the time it reaches the surface. You can see this effect for yourself using an inexpensive laser pointer and a pair of binoculars on a clear night. Rather than pointing at the moon, point at a distant mountain or unoccupied structure (such as a water tower). The radius of your beam will increase as the distance increases.
The line of sight that we need in order to have an optimal wireless connection from A to B is more than just a thin line -its shape is more like that of a cigar, an ellipse. Its width can be described by the concept of Fresnel zones.
Interference
Figure : Constructive and destructive interference.
This is easy to understand when you draw two sine waves and add up the amplitudes. When peak hits peak, you will have maximum results (1 + 1 = 2). This is called constructive interference. When peak hits valley, you will have complete annihilation ((1 + (-)1 = 0) - destructive interference.
You can actually try this with waves on water and two little sticks to create circular waves -you will see that where two waves cross, there will be areas of higher wave peaks and others that remain almost flat and calm.
In order for whole trains of waves to add up or cancel each other out perfectly, they would have to have the exact same wavelength and a fixed phase relation, this means fixed positions from the peaks of the one wave to the other's.
In wireless technology, the word Interference is typically used in a wider sense, for disturbance through other RF sources, e.g. neighbouring channels. So, when wireless networkers talk about interference they typically talk about all kinds of disturbance by other networks, and other sources of microwave. Interference is one of the main sources of difficulty in building wireless links, especially in urban environments or closed spaces (such as a conference space) where many networks may compete for use of the spectrum.
Whenever waves of equal amplitude and opposite phase cross paths, the wave is annihilated and no signal can be received. The much more common case is that waves will combine to form a completely garbled waveform that cannot be effectively used for communication. The modulation techniques and use of multiple channels help to deal with the problem of interference, but does not completely eliminate it.
Diffraction
Figure : Diffraction through a narrow slit.
The Huygens Principle provides one model for understanding this behavior. Imagine that at any given instant, every point on a wavefront can be considered the starting point for a spherical “wavelet”. This idea was later extended by Fresnel, and whether it adequately describes the phenomenon is still a matter of debate. But for our purposes, the Huygens model describes the effect quite well.
Figure : The Huygens Principle.
Through means of the effect of diffraction, waves will “bend” around corners or through an opening in a barrier. The wavelengths of visible light are far too small for humans to observe this effect directly. Microwaves, with a wavelength of several centimeters, will show the effects of diffraction when waves hit walls, mountain peaks, and other obstacles. It seems as if the obstruction causes the wave to change its direction and go around corners.
Figure : Diffraction over a mountain top.
Note that diffraction comes at the cost of power: the energy of the diffracted wave is significantly less than that of the wavefront that caused it. But in some very specific applications, you can take advantage of the diffraction effect to circumvent obstacles.
Reflection
Figure : Reflection of radio waves. The angle of incidence is always equal to the angle of reflection. A parabolic uses this effect to concentrate radio waves spread out over its surface in a common direction.
We should also add that polarization has an impact: waves of different polarization in general will be reflected differently.
We use reflection to our advantage in antenna building: e.g. we put huge parabolas behind our radio transmitter/receiver to collect and bundle the radio signal into a fine point.
Thursday, March 13, 2008
Absorption
Often, an absorption coefficient is used to describe a material's impact on radiation. For microwaves, the two main absorbent materials are:
- Metal. Electrons can move freely in metals, and are readily able to swing and thus absorb the energy of a passing wave.
- Water. Microwaves cause water molecules to jostle around, thus taking away some of the wave's energy.
For the purpose of practical wireless networking, we may well consider metal and water perfect absorbers: we will not be able to go through them (although thin layers of water will let some power pass). They are to microwave what a brick wall is to light. When talking about water, we have to remember that it comes in different forms: rain, fog and mist, low clouds and so forth all will be in the way of radio links. They have a strong influence, and in many circumstances a change in weather can bring a radio link down.
There are other materials that have a more complex effect on radio absorption.
For trees and wood, the amount of absorption depends on how much water they contain. Old dead dry wood is more or less transparent, wet fresh wood will absorb a lot.
Plastics and similar materials generally do not absorb a lot of radio energy-but this varies depending on the frequency and type of material. Before you build a component from plastic (e.g. weather protection for a radio device and its antennas), it is always a good idea to measure and verify that the material does not absorb radio energy around 2.4GHz. One simple method of measuring the absorption of plastic at 2.4GHz is to put a sample in a microwave oven for a couple of minutes. If the plastic heats up, then it absorbs radio energy and should not be used for weatherproofing.
Lastly, let us talk about ourselves: humans (as well as other animals) are largely made out of water. As far as radio networking is concerned, we may well be described as big bags of water, with the same strong absorption. Orienting an office access point in such a way that its signal must pass through many people is a key mistake when building office networks. The same goes for hotspots, cafe installations, libraries, and outdoor installations.
A commonly held myth is that water “resonates” at 2.4GHz, which is why that frequency is used in microwave ovens. Actually, water doesn't appear to have any particular “resonant” frequency. Water spins and jostles around near radio, and will heat when in the presence of high power radio waves at just about any frequency. 2.4GHz is an unlicensed ISM frequency, and so was a good political choice for use in microwave ovens.
Behaviour of radio waves
There are a few simple rules of thumb that can prove extremely useful when making first plans for a wireless network:
- The longer the wavelength, the further it goes
- The longer the wavelength, the better it travels through and around things
- The shorter the wavelength, the more data it can transport
All of these rules, simplified as they may be, are rather easy to understand by example.
Longer waves travel further
Assuming equal power levels, waves with longer wavelengths tend to travel further than waves with shorter wavelengths. This effect is often seen in FM radio, when comparing the range of an FM transmitter at 88MHz to the range at 108MHz. Lower frequency transmitters tend to reach much greater distances than high frequency transmitters at the same power.
Longer waves pass around obstacles
A wave on water which is 5 meters long will not be stopped by a 5 mm piece of wood sticking out of the water. If instead the piece of wood were 50 meters big (e.g. a ship), it would be well in the way of the wave. The distance a wave can travel depends on the relationship between the wavelength of the wave and the size of obstacles in its path of propagation.
It is harder to visualize waves moving “through” solid objects, but this is the case with electromagnetic waves. Longer wavelength (and therefore lower frequency) waves tend to penetrate objects better than shorter wavelength (and therefore higher frequency) waves. For example, FM radio (88 to 108MHz) can travel through buildings and other obstacles easily, while shorter waves (such as GSM phones operating at 900MHz or 1800MHz) have a harder time penetrating buildings. This effect is partly due to the difference in power levels used for FM radio and GSM, but is also partly due to the shorter wavelength of GSM signals.
Shorter waves can carry more data
The faster the wave swings or beats, the more information it can carry every beat or cycle could for example be used to transport a digital bit, a '0' or a '1', a 'yes' or a 'no'.
There is another principle that can be applied to all kinds of waves, and which is extremely useful for understanding radio wave propagation. This principle is known as the Huygens Principle, named after Christiaan Huy-gens, Dutch mathematician, physicist and astronomer 1629 - 1695.
Imagine you are taking a little stick and dipping it vertically into a still lake's surface, causing the water to swing and dance. Waves will leave the center of the stick -the place where you dip in -in circles. Now, wherever water particles are swinging and dancing, they will cause their neighbour particles to do the same: from every point of disturbance, a new circular wave will start. This is, in simple form, the Huygens principle. In the words of wikipedia.org:
“The Huygens' principle is a method of analysis applied to problems of wave propagation in the far field limit. It recognizes that each point of an advancing wave front is in fact the center of a fresh disturbance and the source of a new train of waves; and that the advancing wave as a whole may be regarded as the sum of all the secondary waves arising from points in the medium already traversed. This view of wave propagation helps better understand a variety of wave phenomena, such as diffraction.”
This principle holds true for radio waves as well as waves on water, for sound as well as light -only for light the wavelength is far too short for human beings to actually see the effects directly.
This principle will help us to understand diffraction as well as Fresnel zones, the need for line of sight as well as the fact that sometimes we seem to be able to go around corners, with no line of sight.
Let us now look into what happens to electromagnetic waves as they travel.
Frequencies and Channels
Figure : Channels and center frequencies for 802.11b. Note that channels 1, 6, and 11 do not overlap.
Bandwidth
It is easy to see that the bandwidth we define here is closely related to the amount of data you can transmit within it -the more room in frequency space, the more data you can fit in at a given moment. The term bandwidth is often used for something we should rather call a data rate, as in “my Internet connection has 1 Mbps of bandwidth”, meaning it can transmit data at 1 megabit per second.
The Electromagnetic Spectrum
Light lies roughly between the frequencies of 7.5*1014 Hz and 3.8*1014 Hz, corresponding to wavelengths from circa 400 nm (violet/blue) to 800 nm (red).
We are also regularly exposed to other regions of the electromagnetic spectrum, including AC (Alternating Current) or grid electricity, at 50/60 Hz, X-Rays / Roentgen radiation, Ultraviolet (on the higher frequencies side of visible light), Infrared (on the lower frequencies side of visible light) and many others. Radio is the term used for the portion of the electromagnetic spectrum in which waves can be generated by applying alternating current to an antenna. This is true for the range from 3 Hz to 300 GHz, but in the more narrow sense of the term, the upper frequency limit would be 1 GHz.
When talking about radio, many people think of FM radio, which uses a frequency around 100 MHz. In between radio and infrared we find the region of microwaves - with frequencies from about 1 GHz to 300 GHz, and wavelengths from 30 cm to 1 mm.
The most popular use of microwaves might be the microwave oven, which in fact works in exactly the same region as the wireless standards we are dealing with. These regions lie within the bands that are being kept open for general unlicensed use. This region is called the ISM band, which stands for Industrial, Scientific, and Medical. Most other parts of the electromagnetic spectrum are tightly controlled by licensing legislation, with license values being a huge economic factor. This goes especially for those parts of the spectrum that are suitable for broadcast (TV, radio) as well as voice and data communication. In most countries, the ISM bands have been reserved for unlicensed use.
The frequencies most interesting to us are 2.412 - 2.484 GHz, which is used by the 802.11b and 802.11g radio standards (corresponding to wavelengths of about 12.5 cm). Other commonly available equipment uses the 802.11a standard, which operates at 5.170 - 5.805 GHz (corresponding to wavelengths of about 5 to 6 cm).
Polarization
If you imagine a vertically aligned dipole antenna (the straight piece of wire), electrons only move up and down, not sideways (because there is no room to move) and thus electrical fields only ever point up or down, vertically. The field leaving the wire and traveling as a wave has a strict linear (and in this case, vertical) polarization. If we put the antenna flat on the ground (horizontal, we would find horizontal linear polarization.
Figure : Electric field and complementary magnetic field components of an electromagnetic wave. Polarization describes the orientation of the electric field.
Linear polarization is just one special case, and is never quite so perfect: in general, we will always have some component of the field pointing other directions too. The most general case is elliptic polarization, with the extremes of linear (only one direction) and circular polarizations (both directions at equal strength).
As one can imagine, polarization becomes important when aligning antennas. If you ignore polarization, you might have very little signal even though you have the strongest antennas. We call this polarization mismatch.
Powers of Ten
Powers of Ten
Nano 10-9 1/1000000000 n
Micro 10-6 1/1000000 μ
Milli 10-3 1/1000 m
Centi 10-2 1/100 c
Kilo 103 1 000 k
Mega 106 1 000 000 M
Giga 109 1 000 000 000 G
f = 2.4 GHz = 2,400,000,000 cycles / second
= 3*108 / 2.4*109
Electromagnetic Forces
Electrons are particles that carry a negative electrical charge. There are other particles too, but electrons are responsible for most of what we need to know about how radio behaves.
Let us look at what is happening in a piece of straight wire, in which we push the electrons from one and to the other and back, periodically. At one moment, the top of the wire is negatively charged -all the negative electrons are gathered there. This creates an electric field from plus to minus along the wire. The next moment, the electrons have all been driven to the other side, and the electric field points the other way. As this happens again and again, the electric field vectors (arrows from plus to minus) are leaving the wire, so to speak, and are radiated out into the space around the wire.
What we have just described is known as a dipole (because of the two poles, plus and minus), or more commonly a dipole antenna. This is the simplest form of omnidirectional antenna. The motion of the electric field is commonly referred to as an electromagnetic wave.
Let us come back to the relation:
What is a Wave?
What they have in common is that something, some medium or object, is swinging in a periodic manner, with a certain number of cycles per unit of time. This kind of wave is sometimes called a mechanical wave, since it is defined by the motion of an object or its propagating medium.
When such oscillations travel (that is, when the swinging does not stay bound to one place) then we speak of waves propagating in space. For example, a singer singing creates periodic oscillations in his or her vocal cords. These oscillations periodically compress and decompress the air, and this periodic change of air pressure then leaves the singers mouth and travels, at the speed of sound. A stone plunging into a lake causes a disturbance, which then travels across the lake as a wave.
For example, if a wave on water travels at one meter per second, and it oscillates five times per second, then each wave will be twenty centimeters long:
Waves in water are easy to visualize. Simply drop a stone into the lake and you can see the waves as they move across the water over time. In the case of electromagnetic waves, the part that might be hardest to understand is: “What is it that is oscillating?”
In order to understand that, we need to understand electromagnetic forces.
Intro to Radio Physics
But how do you know where the waves emanating from your wireless card are going? What happens when these waves bounce off of objects in the room or other buildings in an outdoor link? How can several wireless cards be used in the same area without interfering with each other?
In order to build stable high-speed wireless links, it is important to understand how radio waves behave in the real world.