This brief tutorial and demonstration will cover the differences between a hub acting at layer 1, a switch operating at layer 2, and a router operating at layer 3. One of the key elements that you can think of is that a router working with layer 3 is making forwarding decisions based on layer 3 addresses like IP addresses. A switch making forwarding decisions at layer 2 is making those forward information decisions based on layer 2 addresses like Mac addresses, and hubs, they're simply making layer one decisions, meaning they see a bit or a signal, they're simply going to repeat it. They have no intelligence or no knowledge of any intelligent addressing or anything else. They're just simply repeaters. Let's take a look at each of those in order. We'll start with the hub over here first. This hub has four ports in this current diagram anyway. These four ports, it works like this. Let's take PC1. If PC1 sends information down to the hub. Now, you and I both know that the OSI reference model how that works, when we physically send information into the network, we're sending bits. Well, that's what the hub is making forwarding decisions based on. Oh, I see a bit. What is it going to do? It's going to repeat that information off of every single other port. It doesn't matter if it was a broadcast, it doesn't matter if PC1 was trying to detect a PC2, the hub has no knowledge of it. It simply takes the data in and forwards it out every other port. In that sense, we have one VLAN, one broadcast domain and one giant collision domain. Let me explain that for a moment. A VLAN or a broadcast domain is how far a broadcast will go in the network. Well, if this PC sends a broadcast, it's going to go to every single port. That means every device is going to see it that's one giant broadcast domain. The grouping, if you will, of people who would see it broadcast. It also happens to be one giant collision domain because as this PC is sending and if another PC tries to send at the same time, there could be a collision. They're all competing for bandwidth. Only one speaker can be talking at a time successfully with a hub because there's no intelligent separation of conversations. The hub is one giant broadcast domain. The hub is one giant collision domain, and that's enough. That's a great start. It makes these forward decisions based on layer 1 bits coming in. Let's compare and contrast that over to a switch. The switch over here will do in red. The switch over here also has four ports, but it's intelligent, it's memorizing Mac addresses. Just for grins, let's say that PC2 has a Mac address of 2222. and a whole bunch of other 2's, and PC one has a Mac address of 1011. It's 48 bits in a Mac address. What the switch does, it looks at the source Mac address and it memorizes where everybody lives. The switch would know that if it needs to reach the layer 2 address of 222 etc., it would use Fa/03. It would to reach 1011 etc., it would not use Fa/02 Zero. It's intelligent, it's learning, and that's why they cost a little bit more than a hub, by the way. As they're learning, how does that bias anything? Well, check this out. If this PC2 wants to talk to PC1 and is forwarding a frame destined for a 1011, etc., the switch knowing and making forwarding decisions based on layer 2 addresses is going to take that data and do this. Going to come in on Fa/03, and it's going to go out on Fa/02. Guess what? This PC down here on the bottom left and the router never had to see any of that traffic. What's going to happen is that we're going to have additional throughput as a result of this and check out what else happens. The switch gives everybody full bandwidth, full duplex capabilities on the wire. PC0 could be talking to the router and PC2 could be talking to PC1, and there will never ever in a perfect world be a collision. On the back plane of the switch, it keeps all those conversations separate. It uses one pair of wires for sending and another pair of wires for receiving to each device, and it can use those both simultaneously. There is no collisions ever. That means that if I have four ports on a switch, I have four collision domains, or the domains where a collision could happen. I've got collision domain here on Fa/03 and as a result because there's only one PC on it, guess what, there's never going to be a collision. I've got another collision domain Fa/02. Never going to be a collision on it because there's only one host. It's like having your own dedicated road, who are you going to crash into? Well, I guess you could go off the road, but you're not going to crash into another car because you've got your own dedicated road. Comparing that to a hub, this hub up here has four interfaces, but one giant collision domain. This switch has four ports, but because a layer to switch it and it's running full duplex is going to be four individual collision domains. Now, let's take a look at what happens when a broadcast occurs. If this PC2 sends a broadcast, a broadcast is an address that the switch will never memorize where it lives because no one ever sourced a frame using a broadcast. The switch is going to forward broadcast to all other ports in the same VLAN. If these four ports on the screen were all assigned to VLAN 1, as an example, a broadcast sent from PC2 would indeed go out the Fa/02, the Fa/01, and the Fa/04 interface because these ports are all members of the same VLAN or broadcast domain. As a result, over here we have one giant broadcast domain. A broadcast would go to all four devices, and I take that back. A broadcast source from this interface would go to all other interfaces in the VLAN, which would be three others. But that's the same as on the hub. Over here we have one giant broadcast domain. Now, it's one giant. Collision domain 2 for everything else, but from the broadcast domain perspective, this hub and this switch are on the same turf. They're each one giant broadcast domain unless we carve him up into separate VLANs. What's next? Well, let's take a look at the other step that often gets people a little bit crazy, and that is layer 3 addressing. Well, these PCs over here all need to have because they're on the same broadcast domain and they happen in the same collision domain. Normally, we'll assign all of them a logical IP address on the same subnetwork. I'll use blue, I change my colors here. Maybe we give all these guys the address of 10.0.0.0/8, and over here on the left, we give these guys a logical IP network address space of 20.0.0.0/8. Are you with me? We control that. The switch in the hub in this case have no cares. They don't know what the layer 3 addressing is because they're not layer 3 devices, neither one of them. In a purely or two environment, for example, this switch is making layer 2 forwarding decisions, and it doesn't really pay attention to layer 3 until we introduce layer 3 switches, which later discussion. Here's the scoop. These guys can all talk to each other using this logical layer 3 address. Normally, one subnet like the 20 network would go in conjunction with one broadcast domain. You don't have to, but it makes a lot of sense to do it. Over here on the 10 network, we've associated the 10 network with one logical broadcast domain over here. This router, by the way, is the magical device that understands how to make forwarding decisions based on layer 3 addresses. Because he belongs to this broadcast domain and we've given him an IP address of 10.0.0.1 over here and address of 20.0.0.1 over here, if all these PCs used him as a default gateway, and all these PCs use him as a default gateway, and he knows how to forward traffic between those two subnets or those two networks, that would be his job in life. Now, routers never forward broadcast. Broadcast domain ends at the edge of a router. I mean, he'll receive broadcast from this domain, but he'll never propagate them. As a quick review, I want to keep this under 10 minutes which we're almost to that mark, is that hub's make forwarding decisions based on layer 1 bits coming in. Switches make forwarding decisions based on layer 2 information, and routers make forwarding decisions based on logical layer 3, such as IP addressing information. That's the nuts and bolts of it. I hope that helps you and I wish you the best of luck. Thanks everybody.