Você está na página 1de 10

[MUSIC]. Good day, viewers.

In this segment, we're going to talk about switchers, which are a very widely used technology to connect computer together into small networks inside buildings. Okay, so we've talked about multiple access schemes a lot. Now, they are very widely used for wireless networks. 80211 was the popular example. But when we're using wires, rather than have the host run a multiple access control protocol, the method which is used today. Which is vastly more popular, is to connect all the hosts to a switch device in the middle. You can see in this figure, at the bottom here I have four different boxes, which are all wired to one switch. The switch will provide connectivity between all of these different devices. This architecture is the basis of switched Ethernet, or modern Ethernet. And it's used ubiquitously to tie together computer equipment in all manner of buildings. Let's just drill down into a little more detail. So, the scenario is like this. Inside your building, your home, your office, the campus, you have different hosts. And these hosts are connected via a twisted wire cable, a twisted pair cable typically to a box called a switch. This switch has many ports so you can connect many different hosts to it. Somehow this switch is going to provide connectivity between all of the hosts so that when they send frames. Because we're still operating in the link layer, when they send frames the frames will go from one host to the right other host. Typically, the wiring is done so that the switch will be in some kind of central location. And all the wires in your building will be run to a wiring closet in a convenient location. So the big question for us is, what's going on inside this box to provide all of the connectivity? That's a pretty interesting question. If you remember back to our diagrams on protocol layers, I said something like

this. That all of these different kinds of boxes. There are, there are many boxes. That have cables attached to them. They're distinguished by the functionality of what goes inside. And we can draw a different kinds of protocol diagrams to describe the processing that goes inside. In a hub box or a repeater box, the switches, sorry, the devices operated the physical layout. So they're really just connecting bits around, moving bits around. In a switch device that we're looking at now, the functionality inside the box runs our link layer. So, it's connecting frames from one port to another port. And in a device called a router the functionality inside the box works at the network layer. So, it looks at the details of IP packets in the case of the internet, to work out which way to send them. We'll get to routers later on. So, we're not going to look at IP packets and routers now. Instead, we're just looking at switches. Operating at the link layer, sending around ethernet frames. Well, to understand that we'll go over both hubs and switches because this will show us the difference between the two. We'll start with hubs. These are physical load device. In a hub, here's a a, a inside view for what could be going on inside this box. We have all of the different lines coming in. These lines come from some host. They attach to the ports inside the box. If this is a hub, a physical layered device, you could simply imagine that all of the ports are wired together. This will provided physical layer connectivity, and that's all we need. So for instance, if a frame comes in, on this port from some host and it's all wired together, that same frame will go out, on all of the other lines. Functionally this is equivalent to the setting on the right, where, where if one host sends on to the wire, the frame will be delivered to all of the other hosts. It's just another way of wiring it. It's generally more convenient than winding one long wire through all of the different offices.

Because now we can run twisted pair to a central wiring closet. It's also more reliable because if we lose one particular y here, well, some host is out of luck. But chances are that the rest of the hosts are still able to communicate. However, if we break this y here you, you generally do more damage. You might've broken your LAN in half. It just doesn't work anymore. The signals get messed up, too. Inside a switch, something very different is going on even though it looks like the same box. Switches operate at the link layer. So as the frame comes in now, the switch will look at the link layer information, that's the source and destination Ethernet addresses. To be able to forward this frame, out the right output port. This means for instance, let's say I just numbered these hosts, 1, 2, 3, 4. If I send a frame in here, it might go, it might be destined to the host on port 4. I would then send it through the switch fabric and out port four. At the same time, the host on port two might be sending a frame to the host on port 3 using a different path through the switch fabric. The switch fabric here is shown as a grid, you could just imagine this as you know, almost a street map and traffic lights. Depending on the addresses that are on the frame, different kinds of traffic lights or switches here are being turned on or off. To connect different input ports to different output ports. And so, that is how we can use different parts of this switch-fabric to connect different input hosts to different output hosts at the same time. Here's just a cleanup of that figure where one is sending to four and two is sending to three at the same time. I'll note a couple of other things. First of all, I just sort of draw a line between a host and a port here to represent a link. Typically, for all switches you get today, this is a full duplex link. So, even though I draw one line, really you might think of this as having two halves inside the cable. There's usually a wire going one way and

a wire going another way to make a full duplex. Then, this port really has an input and an output structure. yesterday four duplex also what that means is that I can use because I can do this sending in parallel there is no multiple access control protocol for a switch. The host just sent the frame into the switch when they are ready. And the switch will deal with making all of the right connections to send information at the same time. this is quite different than a hub for instance. With a hub, when one host sent, the message was received on the wire, at all of the other hosts. This means the two hosts couldn't send at the same time. Those hosts need to use a multiple access control protocol to coordinate their actions, with a switch there is no Mac protocol. The watt lines are full duplex, they send into the switch, the switch works it out. This new method of working however, does pose some problems. There is a lot going on inside a switch, in particular, you might wonder what happens if two different inputs send to the same output. So let's say that the first host here is sending a packet through the fabric to the same host on the output side. Well, what happens if all of the other hosts are also sending there. It's just a very popular destination. So, we're all sending through the switch fabric to this one output. This can't happen at the same time if the lines are the same speed. Only one frame could be going in or out of a given port. Maybe in and out if we can use it bidirectionally at the same time. The other frames, which are coming in from other ports, which are destined to this one port over here, will need to be stored somewhere temporarily. For this reason a switch has buffering, either on the input side of the switch or the output side or both. You can see I've shown the buffering here as the, the pink here. This is a little bit of storage memory to temporarily store frames until they can be sent on an output port, the right output port.

The issue here however, is that this buffering is fine if there are very short term mismatches. Two hosts sent to one given output, and well it took two frame times to send it out, so a frame had to be buffered for one frame time. But it's not going to work. Even buffering won't solve the problem if these hosts are sending to a, if multiple hosts are sending to one output in a sustained manner. If that's the case, the, the frames will build up inside the buffers, eventually the buffers will be fought, and we will have lost. Now, this, this is an example of some kind of conventional congestion happening inside the network. Because of this loss, as you send packets or frames across the network, it can almost disappear inside the network. They can be thrown away because the network could not support the traffic patterns. We're going to look at this issue much more later on when we get to TCP/IP. Because the same sort of information happens as you send packets across the network. They can be lost due to lack of buffering inside switches. For now, we're not going to worry about it too much, and we're going to say if the switch is well engineered. This can happen, but we'll hope it won't happen very often. So switches, and also hubs, have some significant advantages over. Just connecting all the host to a single shared wire, as was the case with classic Ethernet. Hubs and then switches became a, possible really due to Moore's law as electronics sped up greatly, and also became a lot cheaper. And nowadays, they are prevalent they what you find everywhere. They're not just, you know, possible because of technology. But they have definite advantages. It's more convenient generally to run wires to one central location rather than to snake it through the offices. Imagine what you have to do to change it if you want to add another host and you just got this one wire. They're also more reliable, as we said before, in that if the wire fails. You you might lose a host, but you

probably have connectivity for all of the other hosts in the network. This is different than a classic Ethernet. If there's a break in the Ethernet, actually it doesn't work for all hosts for logical reasons. you may wonder if the switch itself is a problem for reliability, it is after all a single point of failure. You blow out the switch, you lose connectivity to all hosts. That's true, but if you lose connectivity to all hosts you know exactly what to do. Go find the switch, take it out and put another one in there. So, it can be repaired fairly easily. It's not hard to find where the problem is the other key advantage for switches is this. Switches off a scalable performance and this is a real win. With our single shade cable, maybe you have a hundred megabit per second cable, you attach ten hosts to it. You know, each host's fair share is maybe ten megabits per second of bandwidth. With a switch, because we can send frames in parallel, you might provide 100 megabits of bandwidth per port. So, every host then is able to send and receive 100 megabits per second. Performance is much more scaleable for those switches. Okay, so I'd like to go into one particular issue for making switches work. You might have wondered as I talked through there, how switches if they deal with Ethernet frames find the right output port to witch to send a frame. This would be easy if frames carried port addresses. Send me out, output port number 7. But they don't. The addresses, which are on these frames are Ethernet addresses, they, they indicate a host. Either the source host, or the destination host. Now, that destination host might be plugged into any port on the ethernet switch. we, we could imagine having someone manually configure a big table. This would be a terrible job to have. You know, we don't want, that's exactly what we want computers to do. So, let's try and solve it with an algorithm, and we also want an algorithm

which will allow hosts to move around. You might move your computer to another office and connect it to a different switch and that should be okay, too. So, we need to find some way when frames come in and we just have a source or destination address to work out. What output port to send that frame to. The algorithm we use to solve this problem with switches is called backwards learning. it works as follows, so the switch needs to build up its own table that maps between addresses and ports so it knows what port to use. It does so at follows, step one, first thing we do is we build up this table. And inside, to allow us to fill in this table without having a human configurer is to note that the internet frames carry both source and destination addresses. So, if you see a frame on a port, you can look at the source address and say, oh. And now I see a certain source address, so this port is where this source, this address is. If I ever see a frame which is destined to be the same address now I know what port send it on. So, we look at the source address of the frames to find out what port, that's the backward [UNKNOWN] and backward learning. Usually, you might think you just look at the destination to work out where to send the frame. But by looking at the source, we can also work out where people live. The second step is what you do to forward these frames. You've just got a frame on an input port destined for a particular destination, what do you do? You look up your table, if you know the port where it lives, because you've learned it earlier somehow. Then, you just send it to that port and you're done. What if you don't know, what do you do? In that case, you broadcast it by sending it out all ports. You say I don't know its attached to some port, I'll send the message out all ports that way it's going to get to the right port destination. It'll also get to a lot of other ports and they'll just have to ignore it. Let's see how that works in action. So, the very first time the network's used after it's powered up, A is going to send to D.

No one knows anything at this stage. So, A's frame comes in, it just says, hey I'm a frame from A. I'm trying to reach D, is the destination address. This switch, it's clueless, it's just been turned on, says I don't know, there's nothing in my table. So therefore, I'm going to forward this frame. I'm going to broadcast this frame. I'm going to send it out all ports. Well phew, it reads D, that's very good. it also reads B and C. Oh well, not a very efficient use of bandwidth. We also learned something here. We learned that A is on port 1. That's a valuable bit of information. Okay, so this is what happened. Now, step 2, let's assume because most communication involves requests and then replies, sometime later D is going to send a frame back to A. What will happen? Here's D, it sends it's frame in destined for A. This stage the switch can look up it's table here and say yup. I'm just going to send it directly out that port. Wonderful. We did not have to broadcast it out the other ports. Here we are. Cleaned it up. I just changed the colors so you can see them. Oh, I should have said we also learned something. We also learned that D's on port 4 by looking at the source addresses the frame came in. This is the normal situation. Now, everyone's sent a little bit of traffic and we've learned because, you know, if they're using the network, they're going to send some traffic. Of course, then we learn what port they're on. Now, we're fine. let's imagine now that A happens to send another frame to D. The frame will go into the switch. It'll come in port one. The switch will know, yup, D port 4. It will just send it there. Now, we're sending frames between the port one and port four, between A and D. Fine, without broadcasting and sending

extra traffic to other hosts. And this mechanism is fully automatic we've learned. How how to get from one port to another, with no configuration from a human, and in a way which is fairly efficient. So, that's pretty cool. There's something actually that's even cooler about this. This same mechanism works if you run it independently in the the different switch. They're shown here as B1 and B2. Even if you have some hubs in the here 2, by the way, there's a hub in here, H1. Assuming there are no loops in the topology. This is, this is a crucial assumption, we're going to want loops in the topology, or at least we're going to want to allow them. So, in the next segment, we'll handle a case where there are loops in the topology. For now, we'll assume there are no loops. Then, the mechanism I've shown you will solve the problem. Let's see what would happen when a sends to d. And then later, D's going to send to A. Okay, a sends to d. Here, the frame comes in the beginning of the world. Everyone's just woken up. This switch, B1, has no clue. This switch says, okay, I will broadcast it out all of my ports because I don't know. I'll also remember that if I ever want to get to A I use this port, port one. Okay, so this frame is going to go to host B and C. It will also go to this link and enter switch B2 through this input port. B2 actually doesn t know that it s come from another switch. As far as B2 is concerned, A could be directly connected here. It really doesn t know. It can t see the overall topology. B2 runs exactly the same algorithm. You get something in from A destined to D. It s clueless also. It learns hey, A is here. D, no idea. Well, we'll just send out all the ports, that's what we do, we broadcast if we don't know. It'll go to G, it'll go to D, yes that's

what we wanted. It'll also go out here to the hub. The hub, by definition, wires everything together so it will go out the other ports so it'll reach E and F. Wow, so A's frame went everywhere but at least it got to D. Here's that again and now let's look at the what happens next. Now D is going to send to A. Here's D's frame comes in on port 1 on this switch. It wants to get to A. Well, switch B2 actually remembered that the way you get to A is you send out this port, so it'll simply send it out that port. There's no need to broadcast. It'll come in this port. Switch B1, as far as switch B1's concerned, this could have come in directly from D. D could be plugged here, it doesn't know. Switch B1 Looks at the destination that's a, looks at it's table and goes up yup, that just goes out port here, no worries, done. Now broadcast, we now have an efficient way for d to send to a. And, of course, you know where I'm going here. You can work through yourself the case of how a send back to d and you'll see that were using the switch very efficiently. So, this algorithm extends naturally to topologies with multiple switches and hubs. That's pretty cool. Now you know a lot about how switches work. This is how a modern switch ethernet works. We've just not handled one condition, and that's there might be loops in the topology. We'll get to that in the next segment.

Você também pode gostar