3 - 7 - 3-7 LAN Switches (1952)

download 3 - 7 - 3-7 LAN Switches (1952)

of 10

Transcript of 3 - 7 - 3-7 LAN Switches (1952)

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    1/10

    [MUSIC].Good day, viewers.In this segment, we're going to talkabout switchers, which are a very widelyused technology to connect computertogether into small networks insidebuildings.Okay, so we've talked about multipleaccess schemes a lot.Now, they are very widely used forwireless networks.80211 was the popular example.But when we're using wires, rather thanhave the host run a multiple accesscontrol protocol, the method which isused today.Which is vastly more popular, is toconnect all the hosts to a switch devicein the middle.You can see in this figure, at the bottomhere I have four different boxes, whichare all wired to one switch.The switch will provide connectivity

    between all of these different devices.This architecture is the basis ofswitched Ethernet, or modern Ethernet.And it's used ubiquitously to tietogether computer equipment in all mannerof buildings.Let's just drill down into a little moredetail.So, the scenario is like this.Inside your building, your home, youroffice, the campus, you have differenthosts.And these hosts are connected via a

    twisted wire cable, a twisted pair cabletypically to a box called a switch.This switch has many ports so you canconnect many different hosts to it.Somehow this switch is going to provideconnectivity between all of the hosts sothat when they send frames.Because we're still operating in the linklayer, when they send frames the frameswill go from one host to the right otherhost.Typically, the wiring is done so that theswitch will be in some kind of central

    location.And all the wires in your building willbe run to a wiring closet in a convenientlocation.So the big question for us is, what'sgoing on inside this box to provide allof the connectivity?That's a pretty interesting question.If you remember back to our diagrams onprotocol layers, I said something like

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    2/10

    this.That all of these different kinds ofboxes.There are, there are many boxes.That have cables attached to them.They're distinguished by thefunctionality of what goes inside.And we can draw a different kinds ofprotocol diagrams to describe theprocessing that goes inside.In a hub box or a repeater box, theswitches, sorry, the devices operated thephysical layout.So they're really just connecting bitsaround, moving bits around.In a switch device that we're looking atnow, the functionality inside the boxruns our link layer.So, it's connecting frames from one portto another port.And in a device called a router thefunctionality inside the box works at thenetwork layer.So, it looks at the details of IP packets

    in the case of the internet, to work outwhich way to send them.We'll get to routers later on.So, we're not going to look at IP packetsand routers now.Instead, we're just looking at switches.Operating at the link layer, sendingaround ethernet frames.Well, to understand that we'll go overboth hubs and switches because this willshow 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 forwhat could be going on inside this box.We have all of the different lines comingin.These lines come from some host.They attach to the ports inside the box.If this is a hub, a physical layereddevice, you could simply imagine that allof the ports are wired together.This will provided physical layerconnectivity, and that's all we need.So for instance, if a frame comes in, onthis port from some host and it's all

    wired together, that same frame will goout, on all of the other lines.Functionally this is equivalent to thesetting on the right, where, where if onehost sends on to the wire, the frame willbe delivered to all of the other hosts.It's just another way of wiring it.It's generally more convenient thanwinding one long wire through all of thedifferent offices.

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    3/10

    Because now we can run twisted pair to acentral wiring closet.It's also more reliable because if welose one particular y here, well, somehost is out of luck.But chances are that the rest of thehosts are still able to communicate.However, if we break this y here you, yougenerally 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 differentis going on even though it looks like thesame box.Switches operate at the link layer.So as the frame comes in now, the switchwill look at the link layer information,that's the source and destinationEthernet addresses.To be able to forward this frame, out theright output port.This means for instance, let's say I justnumbered these hosts, 1, 2, 3, 4.

    If I send a frame in here, it might go,it might be destined to the host on port4.I would then send it through the switchfabric and out port four.At the same time, the host on port twomight be sending a frame to the host onport 3 using a different path through theswitch fabric.The switch fabric here is shown as agrid, you could just imagine this as youknow, almost a street map and trafficlights.

    Depending on the addresses that are onthe frame, different kinds of trafficlights or switches here are being turnedon or off.To connect different input ports todifferent output ports.And so, that is how we can use differentparts of this switch-fabric to connectdifferent input hosts to different outputhosts at the same time.Here's just a cleanup of that figurewhere one is sending to four and two issending to three at the same time.

    I'll note a couple of other things.First of all, I just sort of draw a linebetween a host and a port here torepresent a link.Typically, for all switches you gettoday, this is a full duplex link.So, even though I draw one line, reallyyou might think of this as having twohalves inside the cable.There's usually a wire going one way and

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    4/10

    a wire going another way to make a fullduplex.Then, this port really has an input andan output structure.yesterday four duplex also what thatmeans is that I can use because I can dothis sending in parallel there is nomultiple access control protocol for aswitch.The host just sent the frame into theswitch when they are ready.And the switch will deal with making allof the right connections to sendinformation at the same time.this is quite different than a hub forinstance.With a hub, when one host sent, themessage was received on the wire, at allof the other hosts.This means the two hosts couldn't send atthe same time.Those hosts need to use a multiple accesscontrol protocol to coordinate theiractions, with a switch there is no Mac

    protocol.The watt lines are full duplex, they sendinto the switch, the switch works it out.This new method of working however, doespose some problems.There is a lot going on inside a switch,in particular, you might wonder whathappens if two different inputs send tothe same output.So let's say that the first host here issending a packet through the fabric tothe 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 switchfabric to this one output.This can't happen at the same time if thelines are the same speed.Only one frame could be going in or outof a given port.Maybe in and out if we can use itbidirectionally at the same time.The other frames, which are coming infrom other ports, which are destined tothis 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 orthe output side or both.You can see I've shown the buffering hereas the, the pink here.This is a little bit of storage memory totemporarily store frames until they canbe sent on an output port, the rightoutput port.

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    5/10

    The issue here however, is that thisbuffering is fine if there are very shortterm mismatches.Two hosts sent to one given output, andwell it took two frame times to send itout, so a frame had to be buffered forone frame time.But it's not going to work.Even buffering won't solve the problem ifthese hosts are sending to a, if multiplehosts are sending to one output in asustained manner.If that's the case, the, the frames willbuild up inside the buffers, eventuallythe buffers will be fought, and we willhave lost.Now, this, this is an example of somekind of conventional congestion happeninginside the network.Because of this loss, as you send packetsor frames across the network, it canalmost disappear inside the network.They can be thrown away because thenetwork could not support the traffic

    patterns.We're going to look at this issue muchmore later on when we get to TCP/IP.Because the same sort of informationhappens as you send packets across thenetwork.They can be lost due to lack of bufferinginside switches.For now, we're not going to worry aboutit too much, and we're going to say ifthe switch is well engineered.This can happen, but we'll hope it won'thappen very often.

    So switches, and also hubs, have somesignificant advantages over.Just connecting all the host to a singleshared wire, as was the case with classicEthernet.Hubs and then switches became a, possiblereally due to Moore's law as electronicssped up greatly, and also became a lotcheaper.And nowadays, they are prevalent theywhat you find everywhere.They're not just, you know, possiblebecause of technology.

    But they have definite advantages.It's more convenient generally to runwires to one central location rather thanto snake it through the offices.Imagine what you have to do to change itif you want to add another host and youjust got this one wire.They're also more reliable, as we saidbefore, in that if the wire fails.You you might lose a host, but you

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    6/10

    probably have connectivity for all of theother hosts in the network.This is different than a classicEthernet.If there's a break in the Ethernet,actually it doesn't work for all hostsfor logical reasons.you may wonder if the switch itself is aproblem for reliability, it is after alla single point of failure.You blow out the switch, you loseconnectivity to all hosts.That's true, but if you lose connectivityto all hosts you know exactly what to do.Go find the switch, take it out and putanother one in there.So, it can be repaired fairly easily.It's not hard to find where the problemis the other key advantage for switchesis this.Switches off a scalable performance andthis is a real win.With our single shade cable, maybe youhave a hundred megabit per second cable,

    you attach ten hosts to it.You know, each host's fair share is maybeten megabits per second of bandwidth.With a switch, because we can send framesin parallel, you might provide 100megabits of bandwidth per port.So, every host then is able to send andreceive 100 megabits per second.Performance is much more scaleable forthose switches.Okay, so I'd like to go into oneparticular issue for making switcheswork.

    You might have wondered as I talkedthrough there, how switches if they dealwith Ethernet frames find the rightoutput port to witch to send a frame.This would be easy if frames carried portaddresses.Send me out, output port number 7.But they don't.The addresses, which are on these framesare Ethernet addresses, they, theyindicate a host.Either the source host, or thedestination host.

    Now, that destination host might beplugged into any port on the ethernetswitch.we, we could imagine having someonemanually configure a big table.This would be a terrible job to have.You know, we don't want, that's exactlywhat we want computers to do.So, let's try and solve it with analgorithm, and we also want an algorithm

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    7/10

    which will allow hosts to move around.You might move your computer to anotheroffice and connect it to a differentswitch and that should be okay, too.So, we need to find some way when framescome in and we just have a source ordestination address to work out.What output port to send that frame to.The algorithm we use to solve thisproblem with switches is called backwardslearning.it works as follows, so the switch needsto build up its own table that mapsbetween addresses and ports so it knowswhat port to use.It does so at follows, step one, firstthing we do is we build up this table.And inside, to allow us to fill in thistable without having a human configureris to note that the internet frames carryboth source and destination addresses.So, if you see a frame on a port, you canlook at the source address and say, oh.And now I see a certain source address,

    so this port is where this source, thisaddress is.If I ever see a frame which is destinedto be the same address now I know whatport send it on.So, we look at the source address of theframes to find out what port, that's thebackward [UNKNOWN] and backward learning.Usually, you might think you just look atthe destination to work out where to sendthe frame.But by looking at the source, we can alsowork out where people live.

    The second step is what you do to forwardthese frames.You've just got a frame on an input portdestined for a particular destination,what do you do?You look up your table, if you know theport where it lives, because you'velearned it earlier somehow.Then, you just send it to that port andyou're done.What if you don't know, what do you do?In that case, you broadcast it by sendingit out all ports.

    You say I don't know its attached to someport, I'll send the message out all portsthat way it's going to get to the rightport destination.It'll also get to a lot of other portsand they'll just have to ignore it.Let's see how that works in action.So, the very first time the network'sused after it's powered up, A is going tosend to D.

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    8/10

    No one knows anything at this stage.So, A's frame comes in, it just says, heyI'm a frame from A.I'm trying to reach D, is the destinationaddress.This switch, it's clueless, it's justbeen turned on, says I don't know,there's nothing in my table.So therefore, I'm going to forward thisframe.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 ofbandwidth.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 mostcommunication involves requests and thenreplies, sometime later D is going tosend a frame back to A.

    What will happen?Here's D, it sends it's frame in destinedfor A.This stage the switch can look up it'stable here and say yup.I'm just going to send it directly outthat port.Wonderful.We did not have to broadcast it out theother ports.Here we are.Cleaned it up.I just changed the colors so you can see

    them.Oh, I should have said we also learnedsomething.We also learned that D's on port 4 bylooking at the source addresses the framecame in.This is the normal situation.Now, everyone's sent a little bit oftraffic and we've learned because, youknow, if they're using the network,they're going to send some traffic.Of course, then we learn what portthey're on.

    Now, we're fine.let's imagine now that A happens to sendanother 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 theport one and port four, between A and D.Fine, without broadcasting and sending

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    9/10

    extra traffic to other hosts.And this mechanism is fully automaticwe've learned.How how to get from one port to another,with no configuration from a human, andin a way which is fairly efficient.So, that's pretty cool.There's something actually that's evencooler about this.This same mechanism works if you run itindependently in the the differentswitch.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 thetopology.This is, this is a crucial assumption,we're going to want loops in thetopology, or at least we're going to wantto allow them.So, in the next segment, we'll handle acase where there are loops in thetopology.

    For now, we'll assume there are no loops.Then, the mechanism I've shown you willsolve the problem.Let's see what would happen when a sendsto d.And then later, D's going to send to A.Okay, a sends to d.Here, the frame comes in the beginning ofthe world.Everyone's just woken up.This switch, B1, has no clue.This switch says, okay, I will broadcastit out all of my ports because I don't

    know.I'll also remember that if I ever want toget to A I use this port, port one.Okay, so this frame is going to go tohost B and C.It will also go to this link and enterswitch B2 through this input port.B2 actually doesnt know that its comefrom another switch.As far as B2 is concerned, A could bedirectly connected here.It really doesnt know.It cant see the overall topology.

    B2 runs exactly the same algorithm.You get something in from A destined toD.Its 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 wedon't know.It'll go to G, it'll go to D, yes that's

  • 7/28/2019 3 - 7 - 3-7 LAN Switches (1952)

    10/10

    what we wanted.It'll also go out here to the hub.The hub, by definition, wires everythingtogether so it will go out the otherports so it'll reach E and F.Wow, so A's frame went everywhere but atleast it got to D.Here's that again and now let's look atthe what happens next.Now D is going to send to A.Here's D's frame comes in on port 1 onthis switch.It wants to get to A.Well, switch B2 actually remembered thatthe way you get to A is you send out thisport, so it'll simply send it out thatport.There's no need to broadcast.It'll come in this port.Switch B1, as far as switch B1'sconcerned, this could have come indirectly 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 efficientway for d to send to a.And, of course, you know where I'm goinghere.You can work through yourself the case ofhow a send back to d and you'll see thatwere using the switch very efficiently.So, this algorithm extends naturally totopologies with multiple switches andhubs.

    That's pretty cool.Now you know a lot about how switcheswork.This is how a modern switch ethernetworks.We've just not handled one condition, andthat's there might be loops in thetopology.We'll get to that in the next segment.