So the OSI model stands for the Open Systems Interconnected Model. We'll go over this briefly. It's very similar to the TCP IP model, which is mainly what we'll be using in this class. They're both very similar and they are both what we call conceptual models of how the internet was originally designed to work. Essentially, the OSI itself turned into the TCP IP model for the most part.
Okay. Okay. So, both of these models were built around the notion of layering. And so the OSI model. has seven layers and the tcp ip model has five layers in fact the five layers that the tcp ip model has um are inside of the seven layers that the osi model has okay so two of these layers essentially were not really used on an independent level, and then they essentially melded into what we call the application layer today.
Okay, so the layers themselves are the physical layer on the bottom, the data link layer, one above that. the network layer, the transport layer, the presentation, the session layer, presentation layer, and application layer is on the top. Move this slightly, application layer.
So this is the OSI. model and then the essentially the um the tcp ip model essentially just groups these into the application layer but there weren't and there weren't that many protocols that were um just presentation or just session so they were As the internet evolved, we just combined these three. Okay, so the goal of layering is to provide abstraction. So higher layer protocols, like the application layer, they essentially can function. under the assumption that all the other layers are doing their own specialized job.
So each layer has a specified job. For instance, the data link layer. Okay, so in fact, we'll... So data link layer is in charge of delivering messages across a single device. So for instance, if you have a computer that's directly connected, to another computer that would be a single hop okay or a computer connected to a router that would be a single hop and so the daily declare facilitates delivery across a single hop facilitates delivery across a single hop Yeah, so this, again, the key difference between OSI and TCP IP is this OSI has these three layers separated and TCP IP has them combined, the application, presentation, and session.
Everything else, for the most part, is unchanged, at least with the TCP IP model version that we're talking about, the five-layer version. Okay, so if you need to deliver, so the actual internet itself requires many of these single hops. That is, your computer has to go to your home router, your home router has to go to your ISP, your ISP probably has a hundred different routers connecting different other ISPs, and all of these need to be...
String together and essentially that is what the network there provides it provides what we call end-to-end delivery. So provides End-to-end delivery. Okay by stringing together Many single hops. Okay, so essentially the network layer it operates under the assumption that the data link layer works.
And the higher layer protocols also continue with that assumption. The transport layer, for instance, the transport layer, makes sure that once you get to the correct computer, once you get to the correct machine that you try to communicate with, that computer might be running 100 different programs. So it ensures that it gets to the correct application, ensures delivery to the correct program. Okay, but that basically assumes that it gets to the correct machine, of course. Okay, but the network layer...
is what provides the service to getting to the correct machine. And to get to the correct machine, you have to jump through many different links. That's what the data link layer provides. It provides you the ability to hop through a single link successfully. So we have this layering.
So this is what we talk about when we talk about layering. Each layer facilitates a very specific job. And then once that job is complete, the layer above it no longer cares, no longer needs to worry about it.
Essentially that task has been abstracted away. So how we're going to go through this class is we're going to work our way from the physical layer up to the application layer, spending one or two sessions on each one. For you guys, since you have double sessions, we'll be spending one day on each topic essentially. Okay, so higher layer protocols can just assume that the lower layer protocols work. And another benefit of layering is that you can hot swap out different protocols and everything else stays the same.
Meaning, for instance, if I'm writing application layer code, so some networking application, I don't really care whether or not the person is using... wireless, or whether they're using a copper cable, a twisted pair, or they're using an optical light cable, they're using something like fiber, that itself is handled by the data link layer and the physical layer, okay? So those who's encoding and decoding information.
And so if I'm just building some web app or something, it's completely hidden from me. That is, even if I wanted to give it specific behavior. that's only available to people with copper cables or something, I can't because on that specific layer I don't have that functionality.
Okay so specifically the layers themselves allow you to separate separate tasks. So each layer itself has a very specific task. We'll go into these tasks as we talk about each layer and independently we'll learn their task.
Okay so in this class we'll be looking at a lot of protocols. So for instance we'll be looking at the ethernet protocol. we'll look at The 802.11, which is the Wi-Fi protocol.
We'll look at the Internet protocol. We'll look at the TCP protocol. We'll look at the UDP protocol.
We'll look at the HTTP protocol. What else will we look at? We'll look at the ARP protocol.
So we have all these protocols and when we're talking about conceptual models, usually we want to place these protocols in specific buckets, typically that's closest related to them. So for instance, Ethernet and 802.11, this is typically used for cables, so physical cables, and this is typically used for wireless. These are two ways to sort of encode data and so these typically rest in the data link layer protocol.
The internet protocol is used to facilitate end-to-end delivery so even this one has IPv4 and IPv6 variants so this one is on the network layer. TCP and UDP are on the transport. and HTTP and many others. So the most protocols typically reside on the application layer.
That's where the most interesting components. And generally, the reason for this is because the lower layer protocols themselves, we want to have a unified standard. We don't want to have some people using, let's say we had two competing standards for the network layer.
protocol, it complicates things. So generally we want to minimize the number of competing standards there are. So there needs to be a real reason for other lower layer protocols to exist. Now this rigid bucketing system where we place certain protocols into specific layers is not always ideal.
There are certain protocols like ARP. We'll talk more about ARP when we get to the network layer. But ARP itself, its job is to convert an IP address, which is on the network layer, to a MAC address and vice versa, which is on the DayLink layer.
So there are some protocols out there like ARP that could technically fit in either one. They sort of bridge this gap. So it wouldn't be ideal to put them in the network there.
It's probably closer to put them somewhere in between. And there are a lot of protocols like that that might fit somewhere in between these two protocols. So in this class, it's not important to know where a protocol fits.
Because again, this rigid system was just a way to think about the internet. And it's really not important to know does this fit here, does this fit here? Rather, it's more important to understand how layering works.
Essentially, if I'm on the TCP UDP layer, I don't have to worry about whether that connection is using a wired connection or a wireless connection. So don't worry too much about what specific layer a protocol falls into. It's more important to understand that the layering allows us to essentially black box things that we previously So essentially we'll go from physical to data link layer to network layer.
And as we go up the stack, essentially what you can do is you can take everything that you learned previously, black box it, and then just assume it works. Okay. So let's talk about what are communication protocols.
Okay. So communications protocols for our purposes. protocols. Essentially, if we want to send data across long distances, the sender and the receiver must first agree upon a set of rules that dictate the exchange of data. These rules determine all aspects of data communication.
So there's essentially a set of rules. for data communication. In fact, strict rules that allow two or more entities Set of strict rules that allow two or more entities to transmit or receive information.
Okay, so there are key properties. that communications protocols determine. So they determine the syntax, okay? So that is how you structure your message, how messages are structured, semantics, which is the meaning, okay?
So the underlying meaning. underlying meaning of the message. The synchronization, this deals with all timing aspects. timing and rate of transmission. And finally we have, optionally, this one's not required always, error recovery methods.
Okay, so this involves both detecting and possibly correcting error states. And of course this one is optional because you can always just say that there is no error recovery and that technically is a type of error recovery in which you just refuse to correct it. Okay, so communications protocols actually predate computers. The earliest communication protocol that traveled long distances, some people can argue that like speaking is a communications protocol, but if we're talking about actual long distance data transmission, Okay, the first one was in 776 BC.
This year might be slightly off. We had homing pigeons. And so these were used in the first Olympics. So the Olympics actually didn't take place in the modern city of Athens, they took place in a city called Olympia and so that was very far away from Athens, okay? But essentially and essentially even like the fastest runner couldn't get from Olympia to Athens in a day.
So what they did was they had these pigeons that they would tie a message to. and the bird would fly back to the city of Athens to deliver the message. So the interesting thing about the homing pigeons is they have a very interesting property.
Let's say that this was Athens and this was Olympia. Okay, so the interesting property of the homing pigeons is that they can only fly home. Okay, so meaning that their home was in some building in Athens and so they knew how to always get home. So what would happen would they would take the bird to Olympia, tied the message to the bird when the games were finished, and the bird would fly back to its home in Athens. But if let's say there was some reply that needed to be sent back to Olympia, this was not possible.
So this is what we call a unidirectional property. And so this message can only go in one way. So we have some modern day application unidirectional transmission protocols.
For instance, your monitor. Well, I think like the monitors nowadays are much more sophisticated, but if we just take like a very old monitor, then that is a unidirectional protocol in that you're essentially sending bits out. which are then displayed on the monitor screen.
But for the most part, the monitor itself doesn't communicate back to your computer. Okay, so we still do have these unidirectional protocols even nowadays. But what we'll see is that we'll look at some of the other sort of ancient protocols and we'll see that they also have some interesting properties.
that modern day protocols also contain. Okay, so that they share with modern day protocols. The next one that we'll look at is the hydraulic semaphore. Okay, so the Greek hydraulic semaphore was used in 400 BC. And so this one is important to us because this is the first case where we have a clear distinction between a...
So we have a clear distinction between a transmission medium and a communications protocol. Okay, and the previous one with the homing pigeon, it's much less obvious. But in this example, it's... there's a clear distinction.
So how this worked was essentially there was two hilltops and then on top of each hilltop there was a manned station, okay, and then on and inside that station, okay, contained one on each hilltop contained one of these devices, okay. And these devices over here were these large cylindrical containers that had this... So these large cylindrical containers had this line of messages in the middle of it. And what would happen is that this tank over here would be filled with water.
to that. Okay, so this so each of the tanks would be filled with water. And there were specifically predefined messages on each one of these.
So for instance, there might be something that said something like one of these messages was attack at midnight or something. And then another one of these messages might be something like retreat or something. Okay, so these tanks were filled with water and there was a some maybe I can draw it slightly better.
So there's a small spout at the bottom of each tank to release the water. Okay and so What would happen is that there would be a person at each station and essentially when one side wanted to send a message they would first raise a torch okay and then Once the other party sees that a torch has been raised, they will get to the hydraulic semaphore and they will also raise their torch. Okay, so when both parties see that the torch is raised, they open the spout and the water starts to flow out.
Okay, so once... Both parties see that the torch has been lit. They release the spout. And the water will start to flow out until it gets to the level where the message that they want to send gets reached.
So if they wanted to send attack at midnight, they would essentially stop the flow of water once it reaches that specific level. Okay, so they would turn off the spout. And then they would extinguish their fire. Okay, once the other person sees that the fire has been extinguished, they will do the same.
So they will extinguish their fire and they'll close the spouts, which will stop the water from flowing. So in that fashion, as long as these two sort of tanks had the same messages and were designed to be as identical as possible, the flow of water itself would be about the same, which would mean that the message that's delivered, so the water level would be about the same, and then they would be able to get the correct message. Okay, so right, so this was how they sort of sent messages very long distances in 400 BC.
Okay, so the transmission medium, okay, so the transmission medium in this case, is just the torch, the light from the torch. Okay, so that is the transmission medium. But just having the light from the torch is not enough for the protocol.
The protocol includes all the other contraptions. So including includes the physical hydraulic semaphore and it also includes the rules that both the people working at the station, they both understand the rules. That is, in order to use this, we have to lift the torch and then you have to lift your torch also and then we have to both open the spouts.
roughly right after we see both torches are lit and then when the message is finished we have to extinguish the torch and close the spouts. So all those specific rules dictate the protocol. Okay so the the rules dictate the protocol. Okay, so let's move to learn more about protocols. Okay, so computer protocols, so computer protocols are rigidly defined.
There needs to be no ambiguity. So no ambiguity is allowed. No ambiguity is allowed. Okay, so for instance, consider the following sentences. My favorite color is blue.
And blue is my favorite color. Okay. So in this case, we as people know that this is essentially the same sentence. But this would not be good as a computer protocol.
Okay. Because essentially there are... the rules themselves need to be strictly defined. Okay, so typically if there are these documents on the web, let me see if I can pull one up.
So there's these documents on the web called RFCs and all major protocols, for instance, HTTP, RFC. have one or more RFCs associated with them. Okay, so the RFC stands for a request for comments. And essentially this is a document that defines all aspects of the communication. So the syntax, semantics, the timing and synchronization and error recovery, all of that is defined inside of this RFC.
Now you don't need to specifically know like in detail about a specific protocol's RFC unless you're building tools related to that protocol. For instance, for HTTP maybe you're building a web browser or something. If you're building a web browser then you need to then you need to support the HTTP protocol.
In order to support the HTTP protocol, there is a very strict set of rules. There's hundreds and hundreds of these rules that deal with all specific cases of the protocol and how you must follow those rules. And the reason why you must follow those rules is because all the other web servers all the other web servers and web browsers on the web are following those rules.
So that brings us back to sort of this example over here. So you can imagine like you can imagine that the protocol, okay, forces you to phrase your messages like this. And if you phrase it any other way, for instance, like this, then it will be rejected. or it won't understand your message.
So essentially protocols are very rigidly defined and there are very there are a very strict set of rules and essentially any protocol that we we cover in this class will have an associated RFC that dictates those rules. All right, so for instance, even one of the early topics like Ethernet will have specific RFCs associated with them. Okay, so this one's actually IP using Ethernet.
Let's see... That one's less important. I think I'd skip the optical telegraph. I think it's actually a bit interesting. So optical telegraph looks like this.
So this one was more modern, well compared to the 400 BC. I think this one was 1600s, 1700s. So the optical telegraph is interesting because it was one of the first examples where we have where we have a string of sort of towers. that facilitated long distance communication. And so the optical telegraph worked in a fashion that essentially had these long arms on top of a tower.
And there were levers that a person working inside could pull to essentially make the arms move. And so what they would do is they would, each tower would be chained together. So there would be these long chains of towers that spanned from, so I think they went from Russia to India.
And essentially how it would work, it would be if a operator. saw that another tower started moving its arms, it would look at the position that the arms would finally lock in place into, and then it would mimic that position for its own tower. And then there would be another tower down the line that would be looking at it, that would mimic that position, and that effect cascaded down, okay, until the message was delivered. So messages were encoded. using different arm positions.
Now the interesting thing about this is that, so not only was this able to sort of send messages very long distances, this has a very interesting property in that essentially at the messages themselves were only encoded and decoded at the end of major cities. And the encoding and decoding book was sort of top secret. It was held by people, by high ranking officials.
Okay, so the interesting thing about that is that if you were an operator in the middle, okay, if you were an operator in the middle, you had no idea what that message actually was. Because all you were doing, all your job was, was to copy that arm position. But you had no idea the meaning of that arm position. So this was really helpful because if, let's say, you're... your tower, which was probably staffed with just one or two people, got attacked, then you actually didn't have any information that you can give away.
So this was interesting because it was one of the arguably one of the systems that we could say was the support of what we call end-to-end encryption, in that your message is encrypted between the start and the end of delivery. And that's even if there was someone who attacked the middle of your connection, they wouldn't be able to get anything useful because they didn't have those decoding books. Let's see.
Electric telegraphs. Electric telegraphs are slightly less interesting. We'll talk about them when we get to physical air, I guess.
So we cover most of it. days Yeah, okay, so let's jump to the physical layer actually. And we can start talking about specific types of transmission mediums.
Okay, so we already covered like that one transmission medium, which was the light from the torch. But more modern applications of transmission mediums are what we're going to be covering next. So this is topic three which is the physical error okay so the physical error deals with the bit by bit delivery of data and how that data itself is encoded on a transmission medium So it's concerned with the actual hardware devices and the transmission mediums, whether they be copper, optical, or light. Copper, optical, or radio waves, and how data is encoded on them.
There we go. Okay, so the first one that we'll talk about. are cables which are point-to-point connections.
And the limitation for being a point-to-point connection is that Without any additional hardware, they can only connect two devices. Okay, so in modern applications, there are two types of cables. We have copper cables.
In fact, let me... So there are two types of... Let's just do it. So there's copper cables and we have optical cables, which are also called fiber.
Okay, so we'll talk about copper first. So copper cables. So copper cables use what we call voltage modulation to encode data. So they carry electricity on them, to be short.
And essentially, they have ways to encode data. It's called line coding and so there's many different systems for line coding, but the the simplest one Essentially that that that all we need to know is that if there's no electricity That's a zero and if there is electricity, that's a that's a one. Okay, so you might see something like this Okay to encode data.
So there's this one is generally not used because it's There are much better ways to encode data, but this is the easiest one to understand. And that's really all we need to know, that if there's electricity on the line, that means some data is being sent. And there exists a network interface card, also called a NIC. that sits between your connection and your computer.
And so this actually, the network interface card is not unique to copper cables, but it's used to translate signals. signals into usable bits, into bits, which can then be arranged into bits, which can then be arranged into frames that are usable by the daily unclear. Then be organized. into data link layer frames. All right.
So every type of medium will have its associated network interface card. And each of those would be unique. So for instance, if you want, let's say that you had a desktop computer and you wanted to add the ability to use Wi-Fi to that desktop computer.
I think if you buy like a pre-built computer nowadays, it doesn't come with Wi-Fi. But you can buy a specialized network interface card to add Wi-Fi capabilities to your desktop computer. Okay, and essentially you're adding a network interface card. Or if you wanted support for optical, for fiber cables, there's probably a network interface cable that is able to translate the light signals from the fiber cables into bits that it understands. Let's see.
Okay, so copper cables, they have some challenges. They have some technical challenges inside of them. In that, if you have a copper cable, okay, and data is flowing through it, because this data itself is encoded as electricity, it emits a magnetic field.
so it emits a magnetic field around that cable and if there are other cables okay if other cables that are nearby that magnetic field could cause interference okay it might have affect the signal of the other cable. Okay, so it might have some influence on the other cable. And so this has a special name, this is called crosstalk, where a single cable may influence, may corrupt some of the other bits on a different cable. And, this is something that we want to avoid.
And there are many techniques to... Yeah, so each cable has its own magnetic field and it might interfere with other cables. Okay, so we want to minimize this crosstalk. Okay, and... Essentially one way to minimize it is a direct relationship to the cable itself.
In that when you're using a copper cable, essentially you're sending an electrical signal, and that electrical signal needs a loop, okay? So it needs some type of loop. back to the other side. Okay, so you might have some connected device over here.
And so this loop, the signal on The second cable, the looped cable, is going to be, it's going to have a opposites. So it's gonna have a opposite magnetic field to the first cable, okay? Because it's flowing in the other direction, but it's essentially the same data.
Now, as these cables get closer and closer, the magnetic. field that they exert cancel each other out because they have essentially the inverse um essentially they're emitting the inverse signal to each other okay so if you get these two cables close enough then that signal should be very tiny okay now there might be other cables over here okay there might be other cables that can still cause crosstalk but essentially we want to keep these two pairs of cables that have they're essentially sending the same data because we need we need to have this sort of closed loop when we're sending electricity we want them as close as possible to each other such that the magnetic field that's emitted from them cancel each other out okay So theoretically, on a theoretical level, if they were on top of each other, okay, if these two cables were on top of each other, that signal would be completely cancelled out. Okay, but we know that's not possible because on the sort of physical plane, two objects cannot possess the same space.
Okay, so they can't be on the same space. But there is an interesting property about magnetic fields, in that the magnetic fields themselves are not something that we can touch. Okay, and so we can use that to our advantage, in that the actual cables that we use for copper, they look more like this.
look like strands of DNA. Okay, and they're always this is called a twisted pair. Okay, and so in this twisted pair, the data flows in the reverse direction. Okay. but it's so they have the these inverse signals and so the magnetic fields okay that is emitted from each of these it has essentially the average the average signal itself would be somewhere in the middle of this okay So essentially, we don't have the same exact physical, the cables don't share the exact same physical space, but if you take the averages of their magnetic fields, the averages is actually on top of each other.
And so this is sort of why copper cables are twisted. It's to have each of the magnetic fields that it emits. cancel each other out.
So if you ever sort of buy some copper cables or something you'll see that it can typically contain tons of these sort of twisted pairs inside of them and the reason why they're twisted is because they emit this magnetic signal and if you if you uh that magnetic signal can cause interference and to minimize interference we twist them so that the magnetic signal itself cancels itself out. Okay, so let's go to fiber next. Okay, so next is fiber, fiber cables. And so fiber cables use light modulation.
Usually there's this sending device. That will send light. out and then there's typically a receiver that will detect the light and fiber itself is transmitted using glass tubes so there's a glass tube Okay, and so essentially the one bit is sent as a pulse of light, and the zero bit is no light.
Okay, so it's essentially just flickering a light down a glass tube that gets picked up by some receiver. So that's the sort of simplest way to describe it to like a young child, but there are a lot of nuances. OK, so first, the theoretical maximum speed of optical optical cables is bound by the speed of light. OK, so you would imagine that we build to sort of send data infinitely fast because we can just send it at the speed of light.
But there are many problems that prevent us from getting to this theoretical limit. So the first problem is called attenuation loss, or also called smearing. So attenuation loss. 10. Okay so again we have our transmitter, we have our cable, and we have our receiver.
Okay, so in a perfect world, I'm sending beams of light and when I don't want the data being sent, there will be sort of a gap in the transmission. Okay, so we'll just make it look like this as the line. So if the message itself goes perfectly straight, perfectly parallel to the tubes, then the message is sent and received perfectly. But the reality is that it's not going to travel completely parallel to the tube.
So what What might happen is that when we're initially transmitting, it goes, it angles a bit. Okay? Now, it's not going to escape the tube because it's made of complete glass, and it's going to essentially, but it's going to bounce. Okay? And it's going to bounce and ricochet back and forth, and eventually it'll hit the receiver.
Okay, but we can see that during this time, okay, it bounced a few times. And the question is, what arrives first, a perfectly straight path or one where we're bouncing a bunch of times beforehand? So obviously, the perfectly straight path would have a shorter distance, okay?
and the one that bounces back and forth would be slower. So you have some signals that are faster than others. And because of that, on the receiving end, you get this smearing effect. And essentially to compensate for this, you have two components. First, you have to use the slowest transmission.
So use the slowest transmission. So if it bounces like five times or so to get to results, to get to the next amplifier, that's the one that you're going to be using. Not the one that... goes in a straight line. Okay, and the second component is you're going to need many amplifiers along the way.
Okay, so what is the amplifier? It's just another system of this. So it would catch the message and then re-emit it to the next pipe. which would then catch the message and emit it to the next pipe.
So the idea itself is the smearing problem goes away if the cable is very small, because it doesn't have time to bounce that many times. But if it's a very long cable, then smearing becomes a bigger issue. So you essentially have amplifiers along the way to limit how much smearing that you get.
Now the other issue with optical and the kind of bigger issue to why we don't use optical inside of our house or like for everything why don't we use because optical is much faster it's like it can be thousands of times faster than cables. One second. Sorry about that. So the other problem with optical cables and why we don't use them for, let's say, our gaming mouses and other things where speed is very important, is optical doesn't send power.
So it doesn't send power. okay versus copper cables. Copper cables have you know they encode information using electricity so so we can't really use this to power our mouses and stuff.
Now, there do exist like composite cables that might have like optical and power cables. Okay, so it's combined the two and those work pretty well. So the internet backbone is predominantly made of fiber because of the increased bandwidth requirements.
Companies like Google Fiber and Verizon Fios are entering the consumer space, but even then, typically they stop as soon as they get to, they stop as soon as they reach your house. They don't actually, it's very difficult to actually wire your entire home with anything besides copper cables. Okay, so next let's talk about channel types. Okay, so channel types.
Okay. So before we go into wireless, we're going to identify the three types of transmission methods. Oh yeah okay so the first one is the simplex communication and so this is also called unidirectional okay so we saw this with the homing pigeons so this is one-way delivery data So we can think about this like TVs and monitors, secure feeds. Okay, so you have a home security system or something that is only one way.
You can't send a message to your cameras. Any type of sound system is typically one way. And baby monitors are also one way.
anything that's a one-way where data flows in a single direction is a simple communication and so the opposite of that would be a duplex communication okay so this is bi-directional okay so data can flow in either direction but for this we're going to need to break it down into two more categories subcategories so the first subcategory is going to be half duplex okay and half duplex means only one party can send at a time so you you can both send data but only one party can send at a time. So you can think about like a walkie-talkie. So I don't know if you guys still know what a walkie-talkie is, but when I was a child we had these devices where you hold a button and then you can talk to the other person, but they couldn't talk back unless they were holding the button.
So only one person can send a message at a time with a walkie-talkie. And that was the limitations of the technology back then. So the other one is going to be full duplex or fully duplex, which means that both parties can send at the same time.
Both parties can send. at the same time. OK, so cables typically operate in fully duplex. OK, so that OK. OK, so cables typically operate in fully duplex.
There are some exceptions of course, if you have one of the above devices, like a baby monitor or a sound system, that are designed for only one-way communication, then those cables themselves will operate in simplex mode. But that's mainly because the other end doesn't have... Any way to transmit that's not really the cables faults.
I'm pretty sure that a lot if we're just using like standard cables or something Then it's probably cheaper to just use a a fully duplex cable than to design a simplex cable Okay But we'll see that even though cables operate in full full-duplex mode, there are ways to degrade a connection to half-duplex. Okay, and how that is done is because we may have... So the next thing is going to be the hub.
So this is a historical device. Okay, so the limitation for all cables is that cables are point-to-point connections. So the question is, what if you have... three computers okay you have three computers well i could connect a and b with a computer and a and c with a computer and b and c with a computer but if i add another computer over here then you can see that we're essentially exponentially growing the number of cables that we need every time we add a device to our network. So, not the best solution.
Instead, there was this old device called the hub, in which you would connect all your computers to the hub. And the hub itself is a physical layer device. so this is a physical layer device and it is it is dumb that is it does not have no cpu so it has no cpu inside of it so what did the hub provide so the goal of the hub was to act as a virtual cable and so essentially how it worked was if a signal was received on the hub it would duplicate that signal to everyone else except for the receiving component. So it would duplicate that signal. So duplicate, okay.
Duplicates any receive signal. on all ports, all physical ports, except for the one that it arrived on. Okay, so if A sends a signal, that signal is duplicated to both B and C. Okay? And if B sent a signal to the hub, that message is delivered both to A and C.
Yeah. So the hub itself does not care about... Well, it doesn't have a CPU, so it's not able to look at the data.
Okay, so it's not able, so unable to, what we'll see later on is the invention of the switch, which is a much better hub, but the hub itself is dumb. So it has no ability to look at the data and decide, oh, this message is for B or this message is for C. It just, any signal that it receives, it duplicates that signal and sends it out. So cable splitters, that's probably advanced, yeah.
Those are probably hardware devices that just duplicate the signal into two or more outputs. So I think a hub would be slightly more advanced than that in that it's able to, so it doesn't. So the component with the hub is it doesn't have a direction, whereas a cable splitter usually has a direction.
There's like something very clearly labeled input and something very clearly labeled output. That is not the case with the hub. Each of the cables that are attached to the hub is point to point and duplex. So similar but probably not exactly the same as a cable splitter. Okay, so what's the problem with this?
Well, the problem with the hub is it creates what we call a collision domain. Okay, so this creates a collision domain. So collision domain and so a collision domain essentially is When a network Connection is downgraded to half duplex connection.
Is downgrade to have duplex because of corruption. Okay, so let's see the problem Okay, so let's say that a is sending a message So a is sending message goes to the hub the hub duplicates the message to all other parties okay to b and c and so this is fine okay no problem so far then c decides to send a message let me change the color here so c decides to send a message and this is where the problem occurs Okay, so we already mentioned that cables themselves are fully duplex. So fully duplex.
But what does fully duplex mean? Fully duplex means that you can send and receive at the same time. So this is okay. And this is okay too.
Fully duplex. Okay, because I can send and receive at the same time. It does not however Let you send two signals at the same time So it's not able to support two signals at the same time.
So these two signals What's going to happen is they are going to mix together and then it gets corrupted. Okay So collision domain occurs when you're using a hub, okay? And essentially what happens is the connection itself is degraded to being half-duplex.
So even though each of these cables themselves are fully duplexed, when you introduce the hub, the entire connection gets degraded to half-duplex, meaning that only one party whether it be A, B, or C, can transmit at a time. If anyone else starts transmitting, that signal itself will become corrupted and unusable. Okay, so we cannot combine multiple signals.
Okay, so this was a major problem. And so the first thing that we tried to do was we tried to solve it using algorithms. So the first algorithm that arrived to fix it was called CarrierSense Multiple Access.
And the goal of CarrierSense Multiple Access is to sort of live with this collision domain, but to make sure that corruption... that corruption didn't occur, okay, that the messages weren't corrupted. Okay, and so carrier sense multiple access is pretty straightforward.
Most of the algorithms in this class are going to be very simple and typically the first thing that you would think about. There might be one or two algorithms when we get to the later half of the course that are more complex, but especially for the networking theory they are not that. difficult.
Let's see. So the first step is to verify that there is no signal being received. Okay, so if you're using a copper cable or your connection, all you gotta do is just detect to see if there's any electricity flowing in from the from Uh from where you're about to send out.
Okay, so if there's no signal being received That means nobody's using the connection. Okay, so that means the connection is free step two send okay again very simple uh it's just similar to what dial up was um not really um dial up was just very slow cable it was still bi-directional okay so verify that so there were some problems with this original algorithm, so problems. So this works if everyone follows this protocol.
Okay, so everyone follows this protocol, then this works. But the problem was that there were growing pains. And, well, actually let's not call it growing pains, let's call it, there were difficulties with adoption. So slow adoption. slow adoption because it did not play well with existing protocols So it didn't work well with vices that didn't have that specific csma update yet.
So let me show you what happened. And so let's say that C is not using csma. Okay, so C is not using CSMA.
Let's say that it's transmitting. Okay, the other two are using CSMA. And let's say that A wants to send. A wants to send. But because it's using CSMA, it will wait.
Okay, so it waits. Okay, so eventually C is going to finish. Okay, and then A is going to see that, hey, there's no more data being sent, so I can start to use the network. And so it's going to start transmitting. Okay.
So 10%, 20%, 40%. And then all of a sudden, C starts transmitting again. And so this gets corrupted because C is not following the rules, is not following the CSMA rules. And because A is transmitting and C is transmitting, then this gets corrupted.
Okay, so the transmission fails. Okay, so there was an addition, an amendment made to CSMA. So CSMA, so the first sort of upgrade was CD.
Okay, so collision detection, which says at any point if you detect data, stop transmitting. Okay, and that fixed the slow adoption problem, because what it did was essentially gave priority to the new device, to the person not following the rules. Okay, so let's look at this again. Okay, so A is transmitting.
Let's use blue. So A is transmitting to B, let's say it goes from 10% to 40% again, and then C starts transmitting. As soon as A detects that C is transmitting, it's going to stop transmitting entirely.
Okay, so it's going to stop transmitting entirely and it's going to allow C to finish transmitting. It's going to give C priority because it's not upgraded to CSMA yet. Now, what's the difference between this and previous? Previously, okay, so previously, A...
was still transmitting when C started transmitting because it didn't have the stop transmitting if you detect any data at any point in time. And C itself, all it sees that is none of its data is being received by the receiver, so I guess I'll just send it again. It'll just keep on sending it until all the data is received.
And so instead of essentially A sending its data and it's getting corrupted and C sending its data and it's getting corrupted, it'll just retransmit every time, A will stop sending. Let C finish. When C finishes, it'll detect that on the wire.
There'll be no more data. And then A can restart to finish its transfer. Okay, so that's CSMA CD. So the collision detection just checks to see if there's any new data. If there's new data being received, that means somebody is not following the CSMA rules.
and I'm going to give them priority. Okay, I'm going to give them priority. And then when they finish transferring, then inside the next window, I'm going to start sending again. So in fact, the person who has an update gets the benefits. But the alternative is that nobody is able to transfer, which is much worse.
Okay, let's see. Finally, there was an upgrade called CSMA-CA for collision avoidance. And this upgrade, okay, so this upgrade itself prevented... Live locks, prevented live lock.
It's mainly used for wireless. So essentially, the hub itself eventually gets replaced with a new hardware device called the switch that solves this problem entirely. But the algorithms were repurposed. So the algorithms that we used in the 1970s with the hubs were repurposed when we got...
Wi-Fi because Wi-Fi itself operates in half duplex. Okay, so this prevented the issue of Livelock where Essentially the issue of Livelock worked like this you have two people sending Okay, so let's say that A was sending to C, okay? But of course, B also gets it. And then B starts sending.
Actually, let's... So before the connection gets to B, let's say that B starts sending, because it hasn't received the message from A yet. And then it receives the message from A, but it's too late, it already sent its own message out. And so in this case, since everyone is operating using CSMA, both A and B will stop their transmissions.
Okay, so both A and B will stop their transmissions and then they'll wait until there's no more signal being sent and then they'll restart. Okay, this should be blue. But you can see that essentially if they start sending at roughly the same time, then essentially they'll get each other's messages and then csma says that csma with collision detection says that if you receive any data from somewhere else immediately stop sending so they'll both essentially start sending see that someone else is sending uh stop sending because of collision detection and then um start sending again, okay, when there's no more connection. So essentially you can sort of think about like two people trying to get out of each other's way. But, so you can imagine like two people trying to get out of, like two people are blocking each other, and they both take a left step at the same time, and then they take a right step at the same time, and they still are blocking each other.
Right, so that is the issue of LiveLock. And so the solution to this, essentially, there's a randomized timer. So randomized timer that's, okay, if you hit a scenario where someone is sending data, then you're going to sleep for some random amount of time before you start. sending again.
And so this fixes the issue. There's still a chance that you pick the the same random number over and over again. So you might still have a few steps of LiveLock, but it's not the case where you'll get it every time because you're trying to send it as fast as possible. Okay, that might happen once or twice, but it's not going to happen. As the time period extends, the chance of it occurring more and more are infinitesimally small.