CS 100 (Learn)CS 100 (Web)Module 03


Physical Layer

(direct YouTube link)

NOTE: If your internet access is restricted and you do not have access to YouTube, we have provided alternate video links.

TRANSCRIPT

Note: This video transcript has been slightly modified. Significant corrections are marked with strikethrough, and alternative wording has been placed in [square brackets] to correct some of the awkward or confusing phrasing in the videos.

In this video we're going to describe the lowest layer of communication over the internet, [which is] going to be called the physical layer.

If this was a course for communication majors or computer scientists who want to understand how communication works [in detail], we would represent all [seven of] the communication layers:

  1. Physical
  2. Data-Link
  3. Network
  4. Transport
  5. Session
  6. Presentation
  7. Application

[These seven layers are] a standard model: you can look at this on your own if you wish, but you [are not required to know it].

What I'm going to do is present a very simplified model of how communication on the internet works with just three layers:

  1. low layer
  2. middle layer, and
  3. high layer

[In this section] we explore the physical layer (or the lowest layer).

There are four different physical layers that I want to discuss in this video:

Ethernet

First, we're going to discuss ethernet. Ethernet is a pretty standard way to communicate over a physical wire or cable. There are other standards out there but ethernet is by far the most popular in today's world.

To communicate over ethernet, you need a device that can actually transmit information over the physical wire. Each physical device that connects to an ethernet cable needs a unique identifier. The fancy term for that is a Media Access Control address or a MAC address.

Your computer right now (if it has an ethernet port) has a MAC address. Every device that connects on the internet through ethernet has a MAC address.

How ethernet actually works is way beyond the scope of this course, but it's interesting to point out that what happens over the wire with different devices communicating is closer to a dinner party than you might think.

Multiple devices might start talking at the same time, just as you might during dinner. For example, you [might] say "hello" just as someone else says "what did you do today?".

What happens in normal speech is you might both stop [and] wait a small amount of time [to] allow [for] the other person to speak again.

The same thing happens over ethernet wires. Devices may start talking at the same time and start "talking" over each other. They detect this, and then back off for a random amount of time and allow other [devices] to communicate. If [another device] is talking, a device won't start talking until it sees a gap and then it will try to jump in. This is what happens over an ethernet wire. There's a very sophisticated protocol in place so that the [communication] can happen.

The last interesting thing I want to point out about ethernet is that there [are] different speed ratings, and these speed ratings apply to both the cable and the devices that the cables plug into. What happens is just like congestion on a highway... there might be a small section of a highway where all the cars slow down for construction (for example) and that slows down the entire duration of your trip.

[The] same thing can happen with ethernet... if you have one device that's slower or one cable that [is] slower it may slow down your entire communication chain. When you're buying devices or cables you may want to pay attention to the speed rating of that device or cable. The slowest speed might be perfectly fine for your application, but what you don't want to do is buy a whole bunch of expensive cables if your devices are slow (or vice-versa).

Phone, ADSL & Cable Modems

The next way of communicating at the lowest level is used over phones, ADSL, or cable modems. If you're old enough (or you watch old movies and television shows) you may remember a time when to connect over the internet you would connect over a regular phone line. [You would] hook your computer up to something called a modem and then you would call a phone number and then there would be a bunch of squawks talking over that phone line and then that would be your connection to the internet. It sounded something like this: [phone dialing and squawking noises]. If you've never heard a sound like that, many years ago [it was] very common sound.

What is interesting is [that] there [are] actually a whole bunch of protocols and handshakes happening right at the beginning... all of the different tones [were] actually [the] two devices [using] a handshake protocol.

All [of] those squawks had to happen in a vocal range that was actually designed for human voice, because the earlier phone systems were only designed to transmit voices.

Phone modems were always two device communication. You always communicated from your modem to another [modem hooked up to a different] computer. There wasn't the same idea that happens over ethernet [where] multiple devices can be speaking at the same time. In [some] ways, this is a cleaner way of communicating between two devices.

Modems have evolved into something called ADSL or Asymmetric Digital Subscriber Lines. I'm sure many of you have an ADSL connection in your home that you use to communicate to the internet [over a phone line].

What's interesting is the word [letter] "A" for asymmetric: these devices are usually designed so that your download speeds are actually much faster than your upload speeds... that's what the "A" means. When you download a movie (or whatever it is you want to download) it can [download] much faster, but if you want to upload a movie to a website it will go much slower. That's why it's called asymmetric: the "up" speed is not the same as the "down" speed.

These devices, while way more sophisticated than modems, are basically the same thing. The technology and the ideas involved in the communication are very similar.

The last one to discuss is a cable modem, and many of you use a cable modem to connect to the internet. A cable modem again uses the same sort of ideas as an ADSL (or a phone). The difference for the cable modem is that it actually communicates over frequencies designed to transmit television signals instead of voice, so often they can get a higher bandwidth [(more data throughput)] through a cable modem because of that. But, at the end of the day these are all devices designed to communicate from one point (one computer) to another one, usually at some head office of a telecommunications company (such as Rogers).

WiFi

I'm going to bet that many of you are watching this video right now over a WiFi connection.

What is WiFi? There is a lot of misinformation out there. The first thing I want to talk about is electromagnetic radiation. The most common form of electromagnetic radiation we're familiar with is just visible light. If you have a light bulb it transmits electromagnetic radiation at a certain frequency and those frequencies determine the color of the light. For example, red light is transmitted at a lower frequency than blue light and your eyes just detect these different frequencies and interpret them as colors. We [can] see a wonderful spectrum of colors.

The electromagnetic spectrum is way wider than the actual visible light that we can see. You may have heard about animals that can see in the infrared spectrum or the ultraviolet spectrum. [There are] other frequencies out there... we just can't see them as light.

On one end [are] x-rays and beyond that is even gamma rays and if you're a comic book nerd gamma rays are what turned the Hulk into the Hulk. At the other end of the spectrum we have infrared and then microwaves and then radio waves and then really long radio waves.

The entire spectrum is used by humans in different ways and each of these waves have different abilities to pass through other physical objects.

For example, light is easily blocked: if you put your hand in front of your eyes, you're going to block the light coming into your eyes. Radio waves can be transmitted over much larger distances and can pass through walls. X-rays (I'm sure you've seen what an x-ray looks like) can actually pass through your body and "see" things that your physical eyes cannot.

What I want to point out is that WiFi is really just a fancy radio wave, and if you want to think about Wifi signals as just a radio wave, that's a perfectly valid way of thinking about it.

Just like radio waves, WiFi can bend [bounce] around corners and go through walls and your devices can still connect to a WiFi signal. For WiFi the range is actually about two hundred [20 / twenty] to 100 meters. That's just a specification of the WiFi [standard] and [is related to] how much power is used to transmit the signal.

Radio waves can be broadcast for kilometers and kilometers, but they use a lot of power at the transmission station. WiFi uses a similar technology but the frequencies and power are a little bit different. Conceptually, they're the same. Of course, with WiFi your computer (or your device communicating over WiFi) also broadcasts instead of just receiving like you would for a radio wave.

[Next we will describe] a few more pieces of information about how WiFi works. In order for WiFi communication to happen, you need an access point, [which] is often a wireless router (what people [typically] have at home). If you're on campus here at the University of Waterloo, they have specifically dedicated access points.

What these [access points] are designed to do is broadcast [to], and receive from devices. In order to communicate over WiFi you need an access point.

There [are] also other things involved in the protocol for WiFi. For example, when you connect to a WiFi access point there's often a name associated to it. There doesn't have to be, but there often is. There's also additional security that can be set up: you can set up a username or a password and [also] encryption. All of this is built into the protocol of WiFi.

On campus, the WiFi is done through something called eduroam. This is a fun fact that you may not be aware of: eduroam is actually at hundreds of different universities and educational institutions. Your Waterloo eduroam username and password can be used at any of those access points. That's important to know if you're traveling or going on co-op to different areas of the world.

[There are] a few more details [regarding] WiFi [to discuss]. There's a lot of jargon related to the different [WiFi] standards. For example, you may see something called 802.11g. Basically, these are just different standards and protocols for communicating over WiFi and they use slightly different frequencies and can have slightly different speeds.

I'm not going to educate [you] about all of those [different standards]. You should be aware that they exist if you're going to be buying a WiFi device, but I just want to draw your attention to it.

The other thing that's interesting is about WiFi: it is [conceptually] closer to ethernet than a cable modem. WiFi devices do the same thing [as ethernet,] where they can all be "shouting" at the same time and when they detect that they're "shouting" at the same time, then they back off and allow other [devices] to "speak".

When you're in a library and you have a whole bunch of people using their WiFi devices at the same time, "talking" to a communications port [an access point], this protocol is actually happening very fast... all your devices are "shouting" and then backing off and communicating over these frequencies... "talking" to the access point. It's not really important: you don't need to understand [the protocols], but it's kind of interesting to [learn about] what's going on behind the scenes.

Cellular (3G / LTE)

The final type of low layer communication I want to discuss is cellular or 3G or LTE communication.

These also use electromagnetic radiation in a very similar way to WiFi. The big difference is [that] the protocols are very different [regarding] how the communication is established. The frequencies and the energy levels involved are also very different. But at their core, they both [Wifi and cellular signals] use electromagnetic radiation to send and receive signals.

Now, 3G stands for "third-generation". This is a bit of a marketing term that was used by cellular companies to get you to buy their phones. There was first generation, second generation and now third generation and then a committee got together [to] decide "well, what is actually 3G communication?".

They tried to regulate these terms, but the simple fact of the matter is... cell phone companies can sell you whatever they want. LTE is not quite 4G, although many companies will advertise it as 4G. LTE (or Long Term Evolution) is really more [like] 3.5G. These are [all] terms commonly used by cell phone companies to get you to buy their products.

With cellulars, the range is much higher than WiFi. The range can actually be kilometers. And, you're often communicating with a cell tower, which are big large towers that exist for your devices to communicate [with].

[Because] cellular signals [have] large kilometer ranges, they have to exist in a much noisier environment. That is [part of their] protocols: they have more error correction and detect different [changes in the] signal, so that your phone [still] works in a noisier environment.

The other important thing to consider is that they require more power because the actual power required to get your signal from your phone to the tower is much greater. That is why (in general) you should often prefer WiFi to 3G if you have the option.

WiFi in general is more cost-effective [than 3G] and saves your battery power [more]. A cellular carrier may charge you more [for data]. [Alos, 3G] requires more power and will drain your device battery faster.

Cell phone devices and devices that communicate over cellular need an IMEI which is an International Mobile Station Equipment Identity and every phone has a unique IMEI.

When you watch the cop shows (or movies) they talk about people "spoofing" other people's phones... that's often what's involved: they are copying other people's IMEIs and trying to get the signals targeted for someone else's device onto their device. In theory, every cellular device should have its own unique IMEI.

The other thing that happens with IMEIs and devices that work over cellular networks is that devices can be locked into a particular cellphone carrier. This was designed as a mechanism for cellular companies to make money and to lock you into their cell phone plan for multiple years. There has been more regulation lately [requiring] cell phone companies to allow you to unlock your device so you can move it to other networks. This is part of the protocols and the hardware involved in cellular technology.

And that concludes our discussion of the physical layer.

There were four different types we discussed.

We talked about: