Everything Switches do - Part 1 - Networking Fundamentals - Lesson 4

Practical Networking
28 Jan 202111:37

Summary

TLDRIn this lesson, we delve into the intricacies of network switches, exploring their role in facilitating data communication within networks. We learn that switches, as layer 2 devices, rely on MAC addresses and operate based on a MAC address table. The video explains the three fundamental actions of switches: learning, flooding, and forwarding. These actions ensure efficient data transfer between devices on the same network. The lesson also touches on how switches handle communication with routers and the role of switch MAC and IP addresses in network management. This foundational knowledge is crucial for understanding network operations and is set to be expanded upon in subsequent lessons.

Takeaways

  • πŸ”Œ A switch is a networking device that facilitates communication within a network by moving data.
  • πŸ“ Switches operate based on MAC addresses and are not concerned with IP addresses when making forwarding decisions.
  • πŸ“ The MAC address table is crucial for switches as it maps switch ports to MAC addresses, helping them to direct traffic efficiently.
  • πŸ’‘ The process of a switch learning the MAC addresses is automatic and begins with an empty table, which gets populated as data flows through the network.
  • πŸ”„ Switches perform three primary actions: learning, flooding, and forwarding, which are fundamental to understanding how they operate.
  • πŸš€ The learning action occurs when a switch updates its MAC address table with the source MAC address of incoming frames.
  • 🌐 Flooding is the process where a switch sends a frame out all ports except the one it came in on, when it doesn't know the destination MAC address.
  • πŸ”„ Forwarding is when a switch sends a frame directly to the port associated with the destination MAC address in its table.
  • πŸ”„ Understanding unicast, broadcast, and multicast are essential for grasping how switches handle different types of network traffic.
  • 🌐 VLANs (Virtual Local Area Networks) can affect how switches operate, and understanding them is important for managing network traffic.
  • πŸ”— The MAC and IP addresses of a switch itself are only used for traffic directed to or from the switch, not for traffic passing through it.

Q & A

  • What is the primary function of a switch in a network?

    -The primary function of a switch in a network is to facilitate communication by moving data within the network.

  • What are the two types of addresses required for hosts to communicate through a switch?

    -For hosts to communicate through a switch, they each need IP addresses and MAC addresses.

  • What is the IP network that all devices connected to a switch must belong to?

    -All devices connected to a switch must belong to the same IP network, in this case, it is the 10.11.x network.

  • How does a switch determine where to send a frame when it first receives it?

    -When a switch first receives a frame, it does not know the destination MAC address, so it uses the flooding action to send the frame out all ports except the one it came in on.

  • What is the purpose of a MAC address table in a switch?

    -A MAC address table in a switch is a mapping of switch ports to MAC addresses, which helps the switch to learn and forward frames to the correct destination.

  • What are the three actions a switch performs to facilitate communication?

    -The three actions a switch performs are learning, flooding, and forwarding. Learning updates the MAC address table, flooding sends a frame out all ports except the incoming one, and forwarding sends a frame directly to the destination port.

  • Why does a switch not forward a frame back out the port it arrived on?

    -A switch does not forward a frame back out the port it arrived on because it assumes that if the frame arrived on a particular port, the destination is unlikely to be on the same port.

  • How does a switch update its MAC address table?

    -A switch updates its MAC address table by learning the source MAC address of each frame it receives and associating it with the port on which the frame arrived.

  • What happens when a switch receives a frame with a destination MAC address it knows?

    -When a switch receives a frame with a destination MAC address it knows, it performs the forwarding action, sending the frame directly out the port associated with that MAC address.

  • How does the process of a switch facilitating communication apply to a router?

    -The process of a switch facilitating communication applies to a router in the same way it does to hosts. The switch does not look at the Layer 3 header, so whether the destination is a host or a router, the process remains the same.

  • Why might a switch's own MAC and IP addresses be involved in network communication?

    -A switch's own MAC and IP addresses would be involved if you are trying to send traffic directly to or from the switch, such as for management purposes using Telnet or SSH.

Outlines

00:00

🌐 Introduction to Switching and MAC Addressing

This paragraph introduces the fourth lesson of a networking fundamentals course, focusing on switches and their role in facilitating communication within networks. The instructor explains that switches are devices designed to move data and that they operate based on rules of switching. It's emphasized that for hosts to communicate through a switch, they must be on the same IP network. The lesson aims to illustrate how a switch enables communication between two hosts, detailing the process of data transmission and the importance of IP and MAC addresses. The switch's operation is described as being based on a MAC address table, which it uses to learn, flood, and forward frames, which are the three fundamental actions of a switch.

05:01

πŸ”„ The Learning, Flooding, and Forwarding Actions of a Switch

The second paragraph delves into the mechanics of how a switch operates through learning, flooding, and forwarding actions. The learning action involves the switch updating its MAC address table with the source MAC address of incoming frames. Flooding occurs when the switch does not know the destination MAC address and sends the frame out all ports except the one it came in on, ensuring the frame reaches its intended recipient. Forwarding is the process where the switch, now aware of the destination MAC address from its table, sends the frame directly to the appropriate port. The paragraph also discusses how responses are handled once the MAC address table is populated, allowing direct communication between hosts without unnecessary flooding.

10:03

πŸ”— Switch Communication and MAC Address Table Utilization

The final paragraph wraps up the discussion on switches by emphasizing that they use and maintain a MAC address table for mapping switch ports to MAC addresses. It reiterates that switches perform only three actions: learning, flooding, and forwarding. The paragraph also touches on the applicability of these principles to different network devices, including routers, and explains that the switch's MAC and IP addresses are only relevant when directly communicating with the switch itself, such as for management purposes. The instructor concludes by summarizing the key takeaways and previews the topics for the next lesson, which will cover unicast flooding, VLANs, and communication across multiple switches.

Mindmap

Keywords

πŸ’‘Switching

Switching refers to the process of moving data within networks. In the context of the video, it is the primary function of a switch, which is a device that facilitates communication between devices on the same network. The script explains that a switch operates based on rules that are common across all switches, regardless of the vendor or platform, making it a foundational concept for understanding network communication.

πŸ’‘MAC Address

A MAC (Media Access Control) address is a unique identifier assigned to network interfaces for communications on the physical network segment. The video script uses MAC addresses to illustrate how switches recognize and communicate with devices on a network. Each device connected to a switch has a unique MAC address, which the switch uses to forward data to the correct destination.

πŸ’‘IP Address

An IP (Internet Protocol) address is a numerical label assigned to devices participating in a computer network that uses the Internet Protocol for communication. In the video, IP addresses are mentioned as part of the data packet structure that hosts use to communicate. While switches do not use IP addresses for their operation, they are essential for devices to identify each other across networks.

πŸ’‘Layer 2 Header

The Layer 2 header is part of the data packet structure used in networking, specifically referring to the data link layer in the OSI model. The video explains that switches operate at this layer, using the information in the Layer 2 header, such as MAC addresses, to make decisions about where to forward data packets. This is a key concept in understanding how switches facilitate communication within a network.

πŸ’‘ARP (Address Resolution Protocol)

ARP is a protocol used for mapping an IP address to a MAC address on a local network. The video script describes how a host uses ARP to discover the MAC address associated with an IP address before it can communicate with another host. Although ARP is not the focus of the video, it is an essential process that supports the switching actions described.

πŸ’‘MAC Address Table

A MAC address table is a database used by a switch to keep track of the MAC addresses of devices and their corresponding switch ports. The video script explains that the switch starts with an empty table and populates it as data flows through the network. This table is crucial for the switch to perform its functions of learning, flooding, and forwarding.

πŸ’‘Learning

In the context of the video, learning refers to the process by which a switch updates its MAC address table with the source MAC address of each frame it receives. This is the first action a switch takes when it encounters new data, allowing it to 'learn' which devices are connected to which ports. The script uses this concept to explain how switches build their knowledge of the network.

πŸ’‘Flooding

Flooding is an action a switch takes when it receives a frame with a destination MAC address that is not in its MAC address table. The switch sends a copy of the frame out of all ports except the one it came in on. The video script uses flooding to illustrate how switches ensure that frames reach their intended recipients when the destination is initially unknown.

πŸ’‘Forwarding

Forwarding is the action a switch takes to send a frame directly to the port associated with the destination MAC address in the frame. Once the switch has learned the location of a MAC address through its MAC address table, it can forward frames directly to that port, avoiding unnecessary network traffic. The video script explains forwarding as the final step in the switch's process after learning and flooding.

πŸ’‘VLANs (Virtual Local Area Networks)

VLANs are not explicitly detailed in the provided script, but they are mentioned as a topic for a future lesson. VLANs are used to divide a physical network into separate broadcast domains, allowing for better organization and security. The script hints that understanding VLANs will provide insight into how switches handle traffic differently when they are used.

Highlights

Introduction to Lesson Four on networking fundamentals focusing on switches.

Switches facilitate communication within networks by moving data.

A switch is a device whose primary purpose is switching.

Devices connected to a switch must belong to the same IP network.

Hosts require IP and MAC addresses to communicate through a switch.

Switches operate based on Layer 2 headers, ignoring Layer 3 headers.

Illustration of how a switch enables communication between Host A and Host D.

Switches use MAC address tables to map switch ports to MAC addresses.

MAC address table starts empty and is populated as data flows through the switch.

Switches perform three actions: learning, flooding, and forwarding.

Learning action updates the MAC address table with the source MAC address of received frames.

Flooding action duplicates frames and sends them out all ports except the receiving port.

Forwarding action delivers frames directly to the appropriate switch port based on the MAC address table.

Once the MAC address table is populated, communication between hosts is direct, bypassing flooding.

The process is the same whether Host A is speaking to another host or sending to a router for external communication.

Switches have MAC and IP addresses, but these are only used for direct communication with the switch itself.

Summary of key takeaways: understanding MAC address tables and the three actions of switches.

Anticipatory teaser for the next lesson covering unicast flooding, VLANs, and communication through multiple switches.

Transcripts

play00:01

hello welcome to lesson four

play00:03

of module one of my new course on

play00:05

networking fundamentals

play00:07

in this lesson we're going to be picking

play00:08

apart switches and we're going to show

play00:10

you

play00:10

everything a switch does to facilitate

play00:12

communication

play00:14

as we discussed in the first lesson

play00:16

switching is the process of moving data

play00:19

within networks and a switch is simply a

play00:22

device whose primary purpose

play00:24

is switching we're about to show you an

play00:27

illustration of a switch

play00:28

and everything it does to funnel

play00:29

communication between these hosts

play00:31

but it's important to understand

play00:33

anything that claims to do switching is

play00:35

going to operate the way we describe a

play00:36

switch to operate

play00:37

we are simply going to be describing the

play00:39

rules of switching

play00:41

for these hosts to communicate with one

play00:43

another they each need ip addresses and

play00:45

mac addresses

play00:46

now since a switch only facilitates

play00:48

communication within a network

play00:50

this tells us that all of these devices

play00:51

that are speaking through the switch

play00:53

must belong to the same ip network in

play00:55

this case that ip network is the 1011.x

play00:58

network

play00:59

in this lesson we can illustrate

play01:01

everything that the switch does to

play01:02

enable communication between host a

play01:05

and host d now in the last lesson we

play01:07

described the host

play01:09

role in all this we described that the

play01:10

host is going to generate some data

play01:12

to send a host d and then add a layer 3

play01:14

header to that data which includes the

play01:16

source of host a

play01:17

and a destination of hostd's ip address

play01:20

then host a is going to perform arp

play01:22

to figure out the mac address which

play01:23

correlates to that destination ip

play01:25

address

play01:26

then host a is going to add a layer 2

play01:28

header which indicates host a's mac

play01:29

address and host d's mac address

play01:31

all of that we described in the last

play01:33

lesson and all of that still applies

play01:36

in this lesson we're just going to be

play01:37

focusing on the switch

play01:39

and if you recall a switch is a layer 2

play01:41

device which means they're only going to

play01:43

be using the layer 2 header to make

play01:45

their decisions

play01:46

which means the switch doesn't look at

play01:48

the layer 3 header at all

play01:49

in fact everything after the layer 2

play01:52

header from the perspective of the

play01:53

switch

play01:53

is simply considered data you and i know

play01:56

there's a layer 3 header in here but

play01:58

from the switches perspective

play01:59

it doesn't care about that layer 3

play02:01

header it's just going to make the

play02:02

decision

play02:02

based upon the layer 2 header in fact we

play02:06

can actually get rid of

play02:07

anything ip related on this topology

play02:09

because if all we're doing is focusing

play02:11

on the switch

play02:12

we don't actually need to consider the

play02:13

ip addresses that are communicating

play02:16

we're going to show you everything that

play02:17

happens to get this data to host d

play02:19

through the switch now i want to point

play02:22

out that we are starting from the

play02:23

position that host

play02:24

a already knows the mac address it's

play02:25

trying to speak to normally host a would

play02:27

have to discover this using arp

play02:29

but for our illustration we're going to

play02:31

assume host a

play02:32

already knows the mac address it's

play02:33

trying to speak to so we can leave arp

play02:35

out of this illustration entirely

play02:37

with that said let's go ahead and

play02:39

explain how switches facilitate

play02:40

communication

play02:41

within networks switches use and

play02:44

maintain

play02:45

a mac address table a mac address table

play02:48

is a mapping of switchboards to mac

play02:50

addresses

play02:51

each of the hosts in our topology are

play02:53

plugged into this switch in a particular

play02:54

port

play02:55

for instance host c is plugged into port

play02:57

6. now every different switch out there

play02:59

uses different numbering schemes for

play03:01

their ports for the sake of

play03:02

illustrations i'm just going to use

play03:03

these numbers

play03:04

5 6 7 and 8. a mac address table then is

play03:07

going to include

play03:08

the mapping of a particular switch port

play03:10

and the device that's connected to that

play03:12

port

play03:13

meaning it's going to know that out port

play03:15

7 exists a device with the mac address

play03:17

b2b2

play03:19

now this mac address table doesn't start

play03:21

out populated in fact it starts out

play03:23

empty and as data is flowing through

play03:25

this topology the switch will populate

play03:27

this mac address table

play03:29

beyond this mac address table the switch

play03:31

is only ever going to perform

play03:33

three actions learning flooding

play03:36

and forwarding if you understand these

play03:39

three actions

play03:40

then you'll understand how switching

play03:41

works every switch you come across

play03:44

regardless of the platform regardless of

play03:46

the vendor regardless of the code

play03:47

version is only going to do

play03:49

three actions these are actually the

play03:50

rules of switching in general

play03:54

so let me show you how they work so host

play03:56

a is going to start

play03:57

by putting this information on the wire

play04:01

that will arrive on the switch on port 5

play04:03

and this is going to allow the switch to

play04:05

perform its first

play04:06

action which is to learn the learning

play04:09

action

play04:09

has the switch update its mac address

play04:11

table with a mapping of the switch port

play04:13

and the source mac address of the

play04:15

received frame

play04:16

meaning on port 5 this switch just

play04:19

received a frame

play04:20

with a source mac address of a1a1 which

play04:23

allows the switch to update its mac

play04:25

address table

play04:26

indicating that the device on port 5

play04:28

owns the mac address a181

play04:31

that is the learning action and the

play04:33

switch is going to try to learn

play04:35

the source mac address for every frame

play04:37

the switch receives

play04:39

now the switch has to figure out what

play04:41

it's going to do with this frame

play04:44

it's going to look at the destination

play04:45

address of that frame to determine that

play04:47

this is meant to be delivered

play04:48

to the device that has the mac address

play04:50

d4 d4

play04:52

you and i know that that device exists

play04:54

over here but this mac address table

play04:57

lists everything that the switch knows

play04:59

so at this point in time the switch does

play05:01

not know

play05:02

what port the mac address d4 d4 exists

play05:04

out of

play05:05

which means the switch's only option is

play05:08

to duplicate that frame

play05:09

and send it out all ports this is the

play05:12

only way the switch can ensure

play05:14

that whatever owns that mac address does

play05:16

get this frame

play05:18

and notice that the switch did not

play05:20

forward the frame back out port 5.

play05:23

when it duplicates the frame and sends

play05:24

it out all ports it's going to set it

play05:26

about all ports

play05:27

except the port that received the frame

play05:28

initially the idea there is that if this

play05:31

frame

play05:31

arrived on port 5 there's a good chance

play05:34

that the destination does not exist back

play05:36

out port 5.

play05:38

so that is the flooding action and all

play05:40

other hosts in this network are going to

play05:41

receive a copy

play05:43

of this frame and when host b and host c

play05:46

receive this frame

play05:47

they're going to look at the destination

play05:48

mac address to determine that they are

play05:50

not the intended recipient for that

play05:52

frame they are therefore simply going to

play05:54

silently discard that frame

play05:56

host d however will be looking at the

play05:58

destination mac address to realize it

play06:00

is destined to host d and host d will

play06:02

accept that frame for processing

play06:04

and that is how data will get from host

play06:06

a to host d

play06:09

now inevitably host d is going to

play06:11

generate a response to send back to host

play06:13

a

play06:14

this response is going to have a source

play06:16

mac address of hostd's mac address and a

play06:18

destination mac address host a's mac

play06:20

address

play06:21

host d is going to put this response on

play06:23

the wire where it'll arrive on the

play06:24

switch on port 8.

play06:26

this will allow the switch to once again

play06:28

perform its learning action

play06:30

it's going to update its mac address

play06:32

table indicating that something just

play06:34

arrived on port 8

play06:35

with a source mac address of d4 d4 this

play06:38

allows the switch to create this

play06:40

mapping now the switch is going to try

play06:43

and figure out what it's going to do

play06:44

with this frame

play06:45

and once again it's going to look at the

play06:47

destination mac address a1a1 to

play06:50

determine

play06:50

where to send this frame next the

play06:53

difference however

play06:54

is that now the switch knows how to

play06:56

deliver a frame

play06:57

to a1a1 it knows that a1a1

play07:00

exists out port 5 this will allow the

play07:03

switch to simply forward

play07:04

that frame out the appropriate switch

play07:06

port

play07:08

that is the third action of the switch

play07:10

the forwarding action

play07:11

the forwarding action allows the switch

play07:13

to deliver a frame directly to the

play07:15

appropriate switchboard

play07:16

because the destination mac address

play07:18

exists in the mac address table

play07:20

this will allow the switch to send that

play07:22

frame directly to host a

play07:24

and that is how the response data will

play07:26

go from host d

play07:27

to host a now at this point

play07:31

anything else that a and d need to send

play07:32

to each other will simply go

play07:34

directly to each other now that the mac

play07:36

address table is populated with either

play07:38

of those host's mac address

play07:40

anything a and d send to each other is

play07:42

going to go directly to each other

play07:43

without having to do the flooding action

play07:45

which means host c

play07:46

and host b will not get a copy of any of

play07:49

that data

play07:51

and that wraps up our discussion of how

play07:53

switches work

play07:55

again switches use and maintain a mac

play07:57

address table which is a mapping of a

play07:59

switchboard to a mac address

play08:00

and switches perform only these three

play08:03

actions if you understand these three

play08:06

actions

play08:06

you now understand how any switch for

play08:09

any vendor

play08:10

on any platform facilitates

play08:12

communication within

play08:13

a network but before i let you go

play08:16

there are two more ideas i want to leave

play08:18

you with

play08:19

our illustration involved host a sending

play08:22

a packet to another host

play08:24

but everything we just showed you would

play08:25

still apply if this wasn't actually a

play08:28

host and it was instead

play08:29

a router and host a was trying to send

play08:31

something to the router

play08:32

in order to speak to something else out

play08:34

on the internet

play08:36

the only thing that would be different

play08:37

would be the layer 3 header and as we

play08:39

discussed the switch doesn't even look

play08:40

at the layer 3 header to do its job

play08:43

which means this process is exactly the

play08:46

same whether host a is speaking to

play08:48

a host on the local network or trying to

play08:50

send something to a router in order to

play08:52

speak to something on a foreign network

play08:55

the second idea i want to leave you with

play08:56

is that we showed you how traffic flows

play08:59

through the switch we illustrated host a

play09:02

sending something through the switch

play09:04

initially to host d

play09:07

understand that switches have mac

play09:09

addresses again any nic

play09:10

has a mac address but you'll notice that

play09:13

this mac address was completely

play09:14

uninvolved

play09:15

for any communication going through the

play09:18

switch

play09:19

but what if you wanted to send something

play09:21

to the switch

play09:23

well if you're trying to send something

play09:25

to the switch then this mac address

play09:27

would be involved

play09:28

but not only would the switch need a mac

play09:30

address it would also need an ip address

play09:32

and at this point if you've configured

play09:34

an ip address on the switch

play09:36

and you're trying to send traffic to the

play09:38

switch the switch is essentially acting

play09:41

as a host on the local network it's

play09:44

going to follow

play09:45

all the rules that we described in the

play09:46

prior lessons that hosts follow

play09:49

in order to communicate on a network the

play09:51

switch's mac address

play09:53

and also its ip address will only be

play09:55

used if you're sending traffic to

play09:56

or receiving traffic from the switch

play09:59

perhaps you're trying to log into the

play10:00

switch using telnet or ssh in order to

play10:03

manage the switch but for any traffic

play10:06

going

play10:06

through the switch the switch mac

play10:09

address and

play10:10

ip address will be completely uninvolved

play10:12

in the process

play10:13

the switch is merely going to perform

play10:15

these actions over here

play10:17

in order to facilitate communication

play10:19

within the network

play10:22

and that wraps up part one of our lesson

play10:24

on switches

play10:26

in the next lesson we're going to unpack

play10:28

three more ideas

play10:30

we're going to describe unicast flooding

play10:32

and explain how that's different from a

play10:34

broadcast

play10:35

we're going to briefly define vlans and

play10:37

show you how these actions are different

play10:39

or not if vlans are being used and

play10:42

finally we're going to show you

play10:43

how communication flows through multiple

play10:45

switches showing you

play10:46

how these actions are still the same

play10:49

regardless of how many switches

play10:50

data is flowing through either way your

play10:53

key takeaways from this lesson are

play10:55

understanding these first two bullets up

play10:56

here

play10:57

i hope you enjoyed this video i want to

play10:59

thank you for watching and we'll see you

play11:01

in the next one

play11:04

hey youtube i hope you enjoyed that free

play11:05

lesson for my new course on networking

play11:07

fundamentals

play11:08

i'll be releasing the entire first

play11:09

module for free here on youtube

play11:12

i want this course to be the ultimate

play11:13

networking fundamentals course and since

play11:15

i'm still scoping out the outline you

play11:16

could have a say in what topics will be

play11:18

covered

play11:19

let me know in the comments below what

play11:20

subjects you want included in this

play11:21

course

play11:22

otherwise remember to like and subscribe

play11:24

and of course if you learned something

play11:26

from this video the best way to thank me

play11:27

is to share this video

play11:29

it's a small act of gratitude but one i

play11:31

appreciate greatly

play11:32

i hope you enjoyed this lesson i want to

play11:34

thank you for watching and we'll see you

play11:36

in the next one

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
NetworkingSwitchesData CommunicationMAC AddressesIP AddressesLayer 2Layer 3ARPLearningFloodingForwarding