# The Physical Layer

## Overview

All information in a computer can be viewed as a string of bits: just 1s and 0s. Different types of information are represented in bits in different ways:

• Numbers are most easily dealt with. Integers are stored in binary, using 2's complement. Floating point numbers are stored according to the IEEE 754 standard. This essentially represents them in scientific notation with some bits reserved for the value (called the mantissa), and some for the exponent.
• Text historically used the ASCII code which maps different characters to one of 256 different binary numbers, with one byte for each. Now this has been superseded by more capable encodings such as UTF-8, which is backwards compatible with UTF-8, but uses up to 4 bytes and is capable of representing many more symbols for non-Western languages.
• Images can be represented by storing the color information of each pixel as a binary number. One common way of doing this is to store one byte for the red, green, and blue component of each pixel. This way, each pixel can be stored as just three binary numbers. Image data is usually compressed to reduce the amount of space they require.
• Sounds are caused by waves travelling through air. To store them in a computer, we store the height of these waves for the duration of the sound. These are called samples, and each sample is a binary number. The greater the size of the number (such as 8-bit vs. 16-bit), and the number of samples per second determine the quality.
• Video is a combination of sound data and image data. The two are represented separately in most video formats, but interleaved together.

Whatever the type of data, the goal of the physical layer is to take a string of bits and transmit them to a receiver across some medium. There are lots of ways that this can be done, today we will look at some of the most common techniques and issues.

## Modulation

To be transmitted across some medium, the digital data must be transformed into an analog signal. This is called modulation. The receiver must then convert the analog signal back into digital data, which is called demodulation. This is done by a modem (which is short for modulator-demodulator).

All analog signals can be viewed as waves:

Properties of waves

In order to represent data in a signal, some part of it must be modulated, or changed. Basic modulation techniques include amplitude modulation (AM) and frequency modulation (FM). These are used for radio signals.

Frequency modulation (top) vs. amplitude modulation

Modern modems use much more complex modulation schemes in order to maximize the efficiency of transmission. The most widely used method is quadrature amplitude modulation (QAM). QAM is an amplitude modulation, like AM, but essentially combines two signals together as one. The two signals are out of phase with each other by 90°. The frequency is kept constant, and because the two signals are also out of phase by a fixed amount, they can be separated mathematically by the receiver.

## Bandwidth and Throughput

Bandwidth in network terms refers to the width of the band that a signal is transmitted at. Here a band is a range of allowable frequencies. So bandwidth is measured in Hz and refers to the frequency of a signal.

The Bandwidth determines the theoretical speed of a channel, because a modulated signal must be modulated at a certain frequency. However, there are other factors such as the modulation scheme being used, as well as the signal-to-noise ratio of the transmission.

Throughput is the actual transmission rate of a channel. Throughput is measured in bits per second, or Mbit/s for millions of bits per second.

What has higher throughput, a 10 Mbit/s Internet connection, or a person driving a terabyte hard drive to his friend's house two hours away?

## Wired Transmissions

Wired transmissions involve sending a signal across a physical cable from one location to another. There are a few commonly used sorts of cables. One of which is twisted pair Ethernet cables.

A twisted pair Ethernet cable (stock image)

These cables are formed by a set of twisted pairs of wires. Each wire in a pair transmits the same signal, but reversed. When the wires are twisted around each other, radiation from them cancels out, so there is less interference with other wires.

There are different versions of standard Ethernet cables with different qualities. These are called "categories" or "cat" for short:

CategoryMax Transmission SpeedMax Bandwidth
310 Mbit/s16 MHz
416 Mbit/s20 MHz
51000 Mbit/s100 MHz
610000 Mbit/s500 MHz
710000 Mbit/s600 MHz

Cat3 and Cat4 cables are older and not used any longer. Cat5 cables are still somewhat used, but becoming obsolete. Cat6 and Cat7 are still very widely used. Cat8 is being developed currently.

Another widely used guided transmission is coaxial cable, often just called "coax". Coax cables have better shielding than twisted pair cables, so they can span longer distances without losing their signal.

A coaxial cable (from Wikipedia)

Coax cables consist of one copper wire surrounded by insulation, and then metal shielding, surrounded by more insulation. The bandwidth of coax depends on the length and construction, but can reach 1000 MHz.

A very different sort of wired connection is a fiber optic one. Fiber optic cables do not transmit an electrical signal at all, instead they carry light from the sender to the receiver. A burst of light signifies a '1', and the absence of light signifies a 0. The sender contains a light source. The receiver has a light sensor which reproduces the original electrical signal.

Optical fibers (from Wikipedia)

The above picture shows bare optical fibers. When used for transmission, these optical fibers are insulated and grouped together in a sleeve.

Fiber optic cables are extremely fast - the limiting factor is the conversion to and from light, not the transmission of the light itself. They are generally not used for individual network connections, but form a large part of the Internet backbone. The backbone is the part of the Internet that contains large amounts of traffic between many different parties.

## Wireless Transmissions

Wireless transmissions are broadcast as electro-magnetic waves through the air. WiFi is governed by the IEEE 802.11 standard. Currently WiFi uses 2.4 GHz or 5.8 GHz frequencies. For comparison, below are other parts of the electromagnetic spectrum:

WaveFrequency
Microwave Ovens2.45 GHz
WiFi2.4 - 5.8 GHz
Infrared300 GHz - 430 THz
Visible Light430 - 750 THz
Ultraviolet Light750 THz - 30 PHz
X-Rays30 PHz - 30 EHz
Gamma Rays30 - 300 EHz

The higher a frequency, the shorter the range of the signal. That is why AM radio carries further than FM (though FM has better quality). This means that, while 5.8 GHz WiFi is faster, 2.4 GHz WiFi is still used: it has better range.

Broadcasts over frequencies is governed in the United States by the Federal Communications Commission (FCC). By federal law no broadcasts can be sent without approval. The FCC divides the electromagnetic spectrum into bands which are set aside for certain uses. Since 1994, the FCC has auctioned off bands to the highest bidder. Other nations have similar agencies governing the broadcast of radio waves.

## Bluetooth

Bluetooth is another wireless transmission. It transmits at 2.4 to 2.485 GHz, similar to WiFi. The main technical difference between WiFi and Bluetooth at the physical layer is that Bluetooth transmits less wattage, which decreases the effective range of broadcast. The range depends on the Bluetooth class:

ClassApproximate Range
1100 meters
210 meters
31 meter

There are more major differences between Bluetooth and WiFi at the higher levels of the network. Bluetooth is for point-to-point, "ad-hoc" networking, while WiFi is part of the larger Internet.

## Mobile Networks

Older generations of mobile phones (3G and prior) used GSM or CDMA as the underlying broadcast scheme. Both of these provide support for data and voice separately, with packet switching and circuit switching respectively. These standards operated in different frequencies, typically from 800 MHz to 2 GHz.

Newer phones use the LTE (Long-Term Evolution) standard, which is an evolution of GSM. LTE also works across multiple frequencies, according to the location and carrier, from 600 MHz to 2.6 GHz. Unlike GSM and CDMA, LTE mobile phones use packet-switching for all communications, including voice.

Cell phone networks use cell towers to relay data between phones and between other parts of the Internet. Sometimes they are disguised as trees.

A cell phone tower on Route 3 near Fredericksburg

## Conclusion

The physical layer deals with the actual transmission of bits from one location to another directly connected to it by some medium. There are many questions the physical layer does not answer:

• Did the data arrive correctly?
• Is the data being sent too fast for the receiver?
• Where is the data going next?

The first two questions are addressed by the data link layer. The third by the network layer.