pete > courses > CS 431 Spring 25 > Lecture 02: the physical layer


Lecture 02: the physical layer

Goals


ultimately, we want to permit processes to send data to each other

processes are the unit of computation

and the entire course can kind of be summed up as considering all the complications that arise from this desire, given that the two communicating processes could be running on computers that are continents apart, and that there may be bazillions of processes running on bazillions of computers that might want to talk to each other

this has implications on protocols (the rules for carrying out tasks involving multiple entities) and software (that implements the protocols) and hardware (that runs the software)


futhermore, there are different kinds of communication we might want to support

sometimes, Process A might want to send a message to Process B and there is no response needed or expected: it’s a one-and-done operation

think like sending a text message saying "I’m on my way"

other times, Process A might want a response from Process B, or it might want to have a longer conversation where both processes send back and forth

think like a phone call


the latter would be an instance of a "connection", which (in this context, at least) is a semi-imaginary relationship between these two processes that permit the sending of data, usually both directions

I say semi-imaginary because there won’t be any tangible THING we can point at or touch that represents the connection: there won’t be a copper wire between the two processes, to which the processes are physically connected

instead, while there will definitely be physical wires involved, many of which are copper, all the infrastructure we’ll discuss will use these physical connections to give the processes an illusion of connection

another way to say this is that the processes will have a logical connection (as opposed to physical)


the former case, in which a message is sent and no response is needed or expected, would be called "connection-less"

it might surprise you to learn that there are actually meaningful uses for this kind of sending and receiving

so we will look at both connection-less and connection-based communication in this course

and indeed many of the lower-level protocols will be entirely connection-less

and the purpose of the higher-level protocols (TCP in particular) will be to take the connection-less building blocks and create a connection-oriented abstraction on top of them


ultimately, however, for data to be sent between processes running on different machines, that data must escape into the real, physical world

which involves hardware

so while almost all the rest of the course will deal with software, I think it’s worth talking about the hardware at least a bit

we will also, not at all coincidentally, talk about Layer I, The Physical Layer: what are its responsibilities, dependencies, etc

we’re going to start very far away from computers, though we’ll get there by the end of the day


tin-can radio: https://4.bp.blogspot.com/-3w3Tqe5qbyI/TysM-HfRNuI/AAAAAAAAAGQ/KM1rUHJqD6w/s1600/Tin-Cans.jpg

three components:

(note that this technology permits a connection, because the communication channel exists as long as the three components are intact, and it’s not limited to just sending a single message one time)

this technology has a limited range, however, and it’s not particularly flexible: you can only talk to the one person who has the other can stuck up to their ear

HOWEVER

it demonstrates all three components of the physical layer: a transmitter, a receiver, and a communication medium

we will shortly see these exact same roles filled by different technologies in different contexts


we could examine many other ancient communication technologies and identify the transmitter, the receiver, and the communication medium, but we’ll move next to the telephone (not the cell phone, mind you: we’re still old school for the time being)

POTS (plain old telephone service): https://www.lunarmobiscuit.com/wp-content/uploads/2014/08/3045244218_b335c432fd_b.jpg

we’ve got a transmitter (the mouthpiece), the receiver (the handset on the left), and presumably there’s a wire that goes out the back of this thing to… somewhere


this setup is still pretty limiting in an important way: for two phones to talk to each other, there must already exist a copper wire between them

a couple potential solutions:

  1. everybody could connect to the same copper wire… except there can only be one conversation at once and it’s trivial for others to eavesdrop
  1. wires could be laid between every pair of phones that might want to talk to each other… except the cost and engineering effort would be astronomical and also much of the system would go unused at any given point in time

both of these are unacceptable at scale


which leads us to…

https://www.dinnerpartydownload.org/wp-content/uploads/2014/09/2664712.jpg

this is a telephone switchboard, with switchboard operators

each hole on the wall ("port") is directly connected to a different phone by a physical wire, usually copper

pick up your phone, a light goes on at the switchboard, the switchboard operator plugs in the wire from their headset to your port, and asks who you want to call

you tell them the name of the phone you want to talk to, they plug into that phone’s port, the phone rings, the person picks up, the switchboard operator tells them they have an incoming call, then the operator takes a separate cable and connects together the caller’s port with the callee’s port

and now electrons can flow from your phone, through the wire to the switchboard, over the cable between your port and your friend’s port, and through the copper wire to your friend’s phone


that copper wire is the medium

the transmitter is the physical phone that translates the sound of your voice into electrons

the receiver is the physical phone on the other end that translates the electrons back into the sound of your voice

note also that there was a protocol here: the caller, the switchboard operator, and the callee follow a distinct sequence of steps to make the call happen

less-visible aspects of the protocol are things like how the sound is translated into an electrical signal and back again


side note: deviations from the protocol can cause confusion

in this case, where the operator is a human, that confusion can often be resolved somewhat directly

but as these systems become computer-operated, deviating from protocols can potentially become much more difficult to recover from


one of those payoffs is that we can use the same infrastructure to call multiple people: we just need the operator to connect our phone’s port to a different callee’s port

not only that, but it supports multiple calls simultaneously

Port 1 and Port 12 could be talking to each other while Ports 37 and 92 are having their own conversation


extrapolate to long-distance with multiple switchboards/operators


rotary telephone: https://nbailey.ca/images/nt500.jpg

the advance here is that the job of the switchboard operator has been automated: dialing a particular number causes a particular sound ("tone") to be sent over the wire, which the machine at the switchboard can interpret and cause the correct connection to be made

the connection is no longer made by physically moving a cable, but we’ll get there

homes would have copper wires from the phone company office directly into the building, emerging at ports on the wall that look very similar to what you would probably identify as a network jack

Category 3 (Cat3) cable: https://www.3starinc.com/temp/images/CAT3_2PR_GY_800x600_.png


one interesting aspect of the preceding description of the phone network is that, when a call is in progress, there is an unbroken electrical circuit between the two phones

a connection!

what’s also perhaps interesting is that this is not the way modern phone or data networks work: it’s too rigid and inefficient

we’ll return to this idea a few times over the semester


note a meaningful difference between the tin-can example and the phone example:

two people can construct a tin-can communication network pretty much anywhere, just by dragging the string to the desired place

but the phone network works because a lot of time and money has been spent building the infrastructure

this has payoffs, in terms of supporting way more communication endpoints, in many cases simultaneously, but to participate, you’ve got to be where they’ve chosen to build


all of the preceding has also focused on more or less analog data: transmitting sounds

the medium is also analog: string, copper wire

but computers work with digital data: zeroes and ones

(even when we use computers to transmit, eg, sound, that sound is first translated into zeroes and ones; why though? because computers might want to send all sorts of data, and binary is the most fundamental—and therefore multipurpose—foundation for that)

in the context of computers, then, the physical layer transmitter is also responsible for translating from zeroes and ones to whatever analog format the medium supports

so the transmitter: the kernel gives it digital (binary) data, which the transmitter translates to an analog signal and sends along the medium

and the receiver: gets the analog signal from the medium, translates it to digital (binary) data, and hands it to the kernel


the receiver and the transmitter are physically connected to the computer

and the medium is connected between the receiver and transmitter

there are several different media in use today for this purpose

the biggies are copper wire (most of what you think of when you hear "Ethernet"), fiber (glass filament), and The Air (wireless: Wifi, Bluetooth, cell phones, etc)

these all have different requirements for transmitters and receivers:

copper needs to send and receive electrons over the wire

fiber needs to send and receive photons over the glass filament

wireless needs to send and receive radio signals over the ether


the component that translates between digital (zeroes and ones) and analog (electrons, photons, or radio waves on the medium) is usually called a PHY, short for "physical" (abbreviation, not acronym)

it usually exists as a dedicated chip inside a computer

I have also known the term "PHY" to refer to the physical connector into which the wire/cable (medium) is plugged

so if you encounter this term in the wild, be sure to be clear how the speaker is using it


as we will see in the coming weeks, the things we think of as computers (eg, laptops, desktops, and now phones and tablets) definitely have PHYs

but so do lots of other devices, and also we will discover new devices whose purpose is to make networks operate—all of these have PHYs as well

a common term for "a generic device connected to a network" is host

I’m introducing this because a) you’ll see it a lot in documents we read and b) it will hopefully help you to start thinking of "network devices" as more than just machines that humans use directly


choice of physical layer affects the speed of data

there are actually two facets to speed in this context

latency refers to the time it takes for a single unit of data to get from sender to receiver

bandwidth refers to the amount of data that can be sent during a unit of time

these may sound like the same thing, but they are not

if Host A sends a single bit of data to Host B, and it arrives 50 milliseconds after sending, that is latency

Host A might not, however, be able to send a second bit to Host B for a while

due to characteristics of the physical layer, Host A might have to wait until sending the next bit to Host B

so perhaps Host A sends the second bit 1 second later, and that second bit takes 50 milliseconds to arrive at Host B

Host A has now sent 2 bits over the course of 1.1 seconds, because the time elapsed from when Host A began sending the first bit to when Host B received the second bit was 1.1 seconds

the latency is 50 milliseconds

the bandwidth is 2/1.1 bits per second

not to abuse the "network as a series of pipes" analogy, but you can think of latency as the time it takes for a single water molecule to travel from point A to point B

and you can think of bandwidth as how many water molecules flow through the pipe per second


another characteristic of the physical layer is whether the same medium can be used to send in both directions

we use the term simplex to refer to a medium that permits transmission in one direction only

half-duplex describes a medium that can be used to send either direction, but only one direction at any one time—it does not support both sides transmitted simultaneously

a full-duplex medium does, however: data can be transmitted both directions at the same time

one way this might be achieved is to put two simplex media in the same wire: one going one direction, and the other going the other direction

this is more accurately termed dual-simplex, though the distinction disappears at the higher levels of abstraction

Last modified: