Thursday, June 18, 2020

How Wi-Fi Works: From Electricity to Information

What is Wi-Fi? Where did it come from?

Wi-Fi is a brand name for wireless networking standards. Wi-Fi lets devices communicate by sending and receiving radio waves.

In 1971, the University of Hawaii demonstrated the first wireless data network, known as ALOHAnet. In 1985, the US FCC opened the ISM radio bands for unlicensed transmissions. After 1985, other countries followed, and more people started experimenting. In 1997 and 1999, the IEEE ratified the first international wireless networking standards. They were called 802.11-1997, 802.11b, and 802.11a. The technology was amazing, but the names were not.

In 1999, the brand-consulting firm Interbrand created the logo and suggested Wi-Fi as the name. Wi-Fi was a pun on hi-fi, referring to high-fidelity audio. Wi-Fi was easier to remember than 802.11, and we've been stuck with the name since. The official name is Wi-Fi, but most people don’t capitalize it or include the hyphen. Wi-Fi, WiFi, Wifi, wifi, and 802.11 all refer to the same thing. In the early days, Wi-Fi was used as shorthand for Wireless Fidelity, but it isn’t officially short for anything. According to the Wi-Fi Alliance, Wi-Fi is Wi-Fi.

What does Wi-Fi do? How does Wi-Fi work?

Wi-Fi transmits data using microwaves, which are high-energy radio waves. Wi-Fi is more complicated than FM radio, but the basic underlying technology is the same. They both encode information into radio waves, which are received and decoded. FM radio does this for sound, Wi-Fi does this for computer data. So how can we use radio waves to send sound, or information?

At a basic level, you can think of two people holding a jump rope. One person raises and lowers their arm quickly, creating a wave. With Wi-Fi, this person would represent your Wi-Fi router, or wireless access point. Keeping the same up and down motion is known as a carrier wave. The person on the other end is the client device, such as a laptop or cell phone. When a wireless client joins the network and senses the carrier wave, it starts listening and waits for small differences in the signal.

In our example, you can imagine feeling the jump rope going up and down, and then receiving a single motion to the right. That single motion to the right can be interpreted as a binary number 1. A motion to the left would be a binary 0. Chain enough 1’s and 0’s together and you can represent complicated things, like all the data on this webpage.

It sounds like magic, but it’s not only Wi-Fi that works this way. Bluetooth, 4G, 5G, and most wireless transmissions work by manipulating waves to transfer electrical signals through the air. A deeper, better question than “How does Wi-Fi work?” is “How do wireless transmissions work?”

If you want a better answer, you need to have a basic understanding of a few things:

  • Fundamental physics of electricity and magnetism
  • Electromagnetic radiation, radio waves, and antennas
  • How wired networks transmit data

I tried my best to keep this understandable, and laid out in a way that makes sense. This stuff is complicated, and hard to explain. That is why there are so many bad explanations of how Wi-Fi works out there.

This isn't going to be a light and breezy discussion. Each of these topics could be an entire college course, so forgive me for simplifying where possible. Use Wikipedia and other resources to fill in the gaps, or to clarify something I glossed over. As always, corrections and feedback are welcomed.

Let’s dive in the deep end and cover the physics first. If you’re not familiar with fundamental physics, Wikipedia is an amazing resource. The key terms highlighted in blue are links to Wikipedia articles which explain further.

Wi-Fi Physics 101: Electricity and Magnetism

  • Matter is made up of atoms.
  • Atoms are made up of smaller particles: Negatively charged electrons, positively charged protons, and neutral neutrons.
  • A positively or negatively charged particle creates an electric field.
  • An electric field exerts force on other charges around it, attracting or repelling them.
  • Magnetic fields and electric fields are related. They are both results of the electromagnetic force, one of the four fundamental forces of nature.
  • Electrical current is a flow of negatively charged electrons through a conductive material, like a wire.
  • Electrical current flowing through a wire creates a magnetic field. This is how electromagnets work.
  • In 1867, James Clerk Maxwell discovered that light, magnetism, and electricity are related.
  • He predicted the existence of electromagnetic waves.
  • His equations describe how electric and magnetic fields are generated by charges, currents, and other field changes.
  • This is known as the 2nd great unification) of physics, behind Sir Issac Newton.
  • In 1887, Heinrich Hertz was the first to prove the existence of electromagnetic waves. People thought that was so cool, they used his last name as the unit for a wave’s frequency.
  • Electromagnetic waves don’t need a medium. They can move through the vacuum of space, for example.
  • Since visible light is an electromagnetic wave, this is how we can see the sun, or distant stars.
  • This is also how we heard Neil Armstrong say “One small step for man…” live from the moon.
  • The warmth you feel from sunlight is due to the radiant energy sunlight contains. All electromagnetic waves have radiant energy.
  • Examples of electromagnetic waves: Visible light, radio waves, microwaves, infrared, ultraviolet, X-rays, and gamma rays.
  • Wi-Fi is an example of a radio wave, specifically a microwave. Microwaves are high-energy radio waves.

Electromagnetic Waves

Electromagnetic waves come in a wide range of forms. The type of wave is categorized by wavelength and frequency.

Wavelength is a measure of the distance over which the wave's shape repeats. In a typical continuous sine wave like Wi-Fi, every time a wave goes from peak to valley to peak, we call that a cycle. The distance it takes to complete one cycle is its wavelength.

Frequency is a measure of how many cycles the wave makes per second. We use Hertz (Hz) as the measure of frequency, 1 Hz is one cycle per second. The more common MHz and GHz are for millions, or billions, of cycles per second.

Imagine waves on a beach. On calm days the waves are small, and come in slowly. On a windy day the waves have more energy, come in faster, and have less distance between them. Higher energy, higher frequency, shorter wavelength. Unlike ocean waves, electromagnetic waves move at the speed of light. Since their speed is constant, their wavelength and frequency are inverse. As wavelength goes up, frequency does down. If you multiply the wavelength and frequency, you will always get the same value — the speed of light, the speed limit of the universe.

You can graph all the various kinds of electromagnetic waves, with the lowest energy on the left, and the highest energy on the right. We call this the electromagnetic spectrum. I’m not going to cover the entire electromagnetic spectrum, since we are mainly interested in Wi-Fi’s microwaves, and how we can use them to send data wirelessly.

Starting from the left, we have the low-energy waves we call radio. Opinions vary, but I’m going with Wikipedia’s definition that radio waves cover from 30 Hz, up to 300 GHz. Compared to the rest of the spectrum, radio’s wavelengths are long, their frequency is slow, and energy is low. Moving up in energy from radio waves, we have microwaves.

Microwaves fall within the broader radio wave category, and are anywhere from 300 MHz up to 300 GHz. At a minimum, microwaves cover 3 GHz to 30 GHz. The specific range depends on who you ask, but generally you can think of Microwaves as high-energy radio waves.

Microwaves are used in microwave ovens, Bluetooth, Wi-Fi, your cell phone’s 4G or 5G connection, and lots of other wireless data transmissions. Their higher energy, shorter wavelength, and other properties make them better for high-bandwidth transfers than traditional, lower-powered radio waves.

All waves can be modulated by varying either the amplitude (strength), frequency or phase) of the wave. This is what allows Wi-Fi, and any other wireless technology, to encode data in a wireless signal.

Wired Networking Transmissions

Before we cover how wireless data transmission works, we need to understand how wired data transmission works. In wired Ethernet networks, we use the copper inside Ethernet cables to transmit electrical signals. The conductive copper transfers the electrical current applied at one end, through the wire, to the other side.

A typical example would be a PC plugged into an Ethernet switch. If the PC wants to transfer information, it converts binary digits to electrical impulses. On, off, on, off. It sends a specific pattern of 1’s and 0’s across the wire, which is received on the other end. Ethernet is the neighborhood street of the networking world. It's great for getting around the local area, but you’ll need to jump on the highway if you want to go further.

The highway of the networking world is fiber optic cabling. Just like how Ethernet transfers electrical current, we can do the same thing with lasers and fiber optic cables. Fiber optic cables are made of bendable glass, and they provide a path for light to be transmitted. Since fiber optics require lasers, special transceivers are required at each end. Compared to Ethernet, Fiber optic cables have the advantage of having a longer range, and generally a higher capacity.

Fiber optic cabling carries a big portion of global Internet traffic. We have a wide array of fiber optic cabling over land, and sea. Those connections are what allow you to communicate with someone on the other side of the country, or the other side of the world. This is possible because these transmissions happen at the speed of light.

Here’s where things get fun. Just like how Ethernet and fiber optic cabling take an electrical impulse or beam of light from A to B, we can do the same thing with radios, antennas, and radio waves.

Radios, Antennas, and Wireless Networking

Now that we have a rough common understanding of electromagnetic waves and wired data transmission, how can we transmit data wirelessly? The key is an antenna. Antennas30 convert electricity into radio waves, and radio waves into electricity. A basic antenna consists of two metal rods connected to a receiver or transmitter.

When transmitting, a radio supplies an alternating electric current to the antenna, and the antenna radiates the energy as electromagnetic waves. When receiving, an antenna reverses this process. It intercepts some of the power of a radio wave to produce an electrical current, which is applied to a receiver, and amplified. Receiving antennas capture a fraction of the original signal, which is why distance, antenna design, and amplification are important for a successful wireless transmission.

If you have a properly tuned, powerful antenna, you can send a signal 1000s of kilometers away, or even into space. It's not just Wi-Fi, this is what makes satellites, radar, radio, and broadcast TV transmissions work too. Pretty cool, right?

How Wi-Fi Works: From Electricity to Information

  • An intricate pattern of electrons representing computer data flow into your Wi-Fi router, or wireless access point.
  • The access point sends that pattern of electrons to an antenna, generating an electromagnetic wave.
  • By alternating between a positive to negative charge, the wire inside of an antenna creates an oscillating electric and magnetic field. These oscillating fields propagate out into space as electromagnetic waves, and are able to be received by anyone in range.
  • Typical Wi-Fi access points have omnidirectional antennas, which make the wave propagate in all horizontal directions.
  • This wave travels through the air and hits a receiving antenna which reverses the process, converting the radiant energy in the radio wave back into electricity.
  • The electric field of the incoming wave pushes electrons back and forth in the antenna, creating an alternating positive and negative charge. The oscillating field induces voltage and current, which flows to the receiver.
  • The signal is amplified and received, either to the client device or to an Ethernet connection for further routing.
  • A lot of the wave’s energy is lost along the way.
  • If the transmission was successful, the electrical impulses should be a good copy of what was sent.
  • If the transmission wasn’t successful, the data is resent.
  • When the information is received on the other end, it is treated the same as any other data on the network.

More Fun Wi-Fi Facts

  • Wi-Fi has redundancy built-in. If you wanted to send “Hello” your access point wouldn't send an H, an E, an L, an L and a O. It sends multiple characters for each one, just like you would on a static-filled radio or phone call. It will use its equivalent of the phonetic alphabet to send “Hotel”, “Echo”, “Lima”, “Lima”, “Oscar”.
  • That way, even if you didn’t hear the entire transmission, you are still likely to be able to know that “Hello” was being sent. The level of redundancy varies on signal strength and interference on the channel.
  • If the signal strength is high, the access point and receiver are able to use a complicated modulation scheme, and encode a lot of data.
  • If you think about our jump rope analogy from earlier, rather than just left and right, it can divide into 1/4s, 1/8ths, or further. It can also combine the direction of the modulation with strength, or phase of modulation.
  • The most complex modulation in Wi-Fi 6 is 256-QAM, which uses 16 directions and 16 strengths to have 256 unique combinations. This results in high throughput, but requires a very strong wireless signal and minimal interference to work effectively.
  • As your wireless signal weakens, complex modulation can’t be understood. Both devices will step down to a less complex modulation scheme. This is why Wi-Fi slows down as you move away from the access point.


No comments:

Post a Comment