0% found this document useful (0 votes)
47 views19 pages

Switching Overview

in simple terms switching in networking is explained.

Uploaded by

iqbal noushad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views19 pages

Switching Overview

in simple terms switching in networking is explained.

Uploaded by

iqbal noushad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

c

Switching Overview
KHAWAR BUTT
CCIE # 12353 [R/S, SECURITY, SP, DC, VOICE, STORAGE & CCDE]
Overview
 Switch functionality
 MAC Address
 MAC Address Table c

 Switching Frames Mechanism


 IP Communications – Switched network
 IP Communication – Routed network
Network Diagram:
PC PC PC

Switch PC PC Switch PC PC Switch

192.168.1.0/24 192.168.2.0/24 192.168.3.0/24


E 0/0 E 0/0 E 0/0
Serial 1/0 Serial 1/0
Serial 1/1 Serial 1/0
R1 192.168.12.0/24 R2 192.168.23.0/24 R3
Switch Functionality
 The switch connects devices on a single network.
 Switch forwards packets by using the Layer 2 address of a Frame and
hence are generally referred to as Layer 2 devices.
c
 The Layer 2 address of a device on a ethernet segment is called the Media
Access Control (MAC) address.
 Based on the diagram on the previous slide, the switches connect the PCs
within the LAN segments to each other. The switch also allows the PCs to
connect to the Router.
 Router connects the PCs to other networks.
MAC Address
24 Bits 24 Bits

OUI Vendor Assigned

6 Hex 6 Hex
Digits c
Digits

 The address that is assigned to the NIC is called the MAC Address.
 It is made up of 2 parts, the OUI and a Unique Vendor assigned address.

 The Organizationally Unique Identifier (OUI) is assigned to the vendor by IEEE. The vendor
assigns each NIC/Interface that it manufactures a unique identifier. It is written in Hex
format.
 Example of a MAC Address is : 0001.AA00.0001 or 00:01:AA:00:00:01 or 00-01-AA-00-00-
01, where the 0001.AA represents the OUI and 00.0001 represents the unique vendor
assigned identifier for the device.
Network Diagram:
PC1 SW1 PC2

E 0/0 E 0/2

E 0/1
MAC: 0001.1111.AAAA MAC: 0001.1111.BBBB
IP : 192.168.1.51 IP : 192.168.1.52

PC3

MAC: 0001.1111.CCCC
IP : 192.168.1.53
MAC Address Table
 The switch builds and maintains a table known as the MAC Address Table using a automatic
process called MAC Learning.

 The MAC Address table associates the Switchport with a specific MAC Address connected to
c
that port.
 The switch learns the MAC address to port assignment by analyzing the Source MAC address of
a Frame. If a frame comes in with a MAC address it is not aware of from a port, it will learn it
and store it in the MAC Address Table. The switch learns the topology of the network using this
methodology.
 The switch will forward the frame by analyzing the destination MAC address.
 It will only forward the frame to the associated port with that MAC address.
 If the MAC Address is not known, it will flood it to all ports of the switch.
 All broadcast and multicast frames are always flooded.
Switching Frames Mechanism
 Let’s assume the switch does not have any MAC Addresses in the MAC Address table.
 PC1 wants to communicate to PC2.
 The switch receives a frame from PC1 on port E 0/0.


c
The switch analyzes the Source MAC address of the frame. It will store the MAC Address and the
associated port in the MAC Address Table.

 The switch will now check the destination MAC Address against the MAC Address table.
 As the MAC address is not in the MAC address table, the switch will flood the frame to all ports.
 PC2 will receive the frame and respond respond back using its MAC Address as the source and PC1’s
MAC address as the destination.
 The switch will learn the new MAC Address and store it in the MAC address table.
 The switch will only forward the frame on Port E 0/0 as it has already learnt the MAC address in the
initial communication.
Switching Frames Mechanism
 The switch will learn all the MAC addresses on the network by using the same mechanism.
 The Switch will use the MAC Address Table to forward frames to the specific destination ports.
PC1 SW1 PC2
c
E 0/2
E 0/0

E 0/1
MAC: 0001.1111.AAAA MAC: 0001.1111.BBBB
IP : 192.168.1.51 IP : 192.168.1.52

MAC Address Table


PC3 MAC-Address Port
0001.1111.AAAA E 0/0

MAC: 0001.1111.CCCC 0001.1111.BBBB E 0/2


IP : 192.168.1.53 0001.1111.CCCC E 0/1
IP Communications –
Switched Network
 In order to communicate within a single network, the PC will need to identify
the destination device by specifying the destination MAC address &
destination IP address.
c
 Let’s take the network in the previous slide as an example and take a look at
the IP communications.

 PC1 wants to communicate to PC2. The Users needs to know the IP Address
of the destination PC, PC2 in our case. Let’s take a look at the process of
communication within the same network.
IP Communications –
Switched Network
 1. PC1 creates an IP Packet at Layer 3 with a source address of 192.168.1.51 and a destination
address of 192.168.1.52.

Source IP : 192.168.1.51 Dest. IP : 192.168.1.52 Data


c
 2. Next, PC1 needs to create a Layer 2 Header that will contain the source and destination MAC
addresses. It does not know the destination MAC address of 192.168.1.52. The PC uses a
protocol called ARP to discover the destination MAC address. PC1, sends an ARP packet as a
broadcast to everyone asking for the MAC address of a device with an IP Address of 192.168.1.52.
ARP is a Layer 2 protocol.

Source MAC : 0001.1111.AAAA Dest. MAC : FFFF.FFFF.FFFF What is the MAC for 192.168.1.52?
IP Communications –
Switched Network
 3. The ARP Broadcast is sent to all the devices on the switched network. PC2 receives the
broadcast and responds back to the ARP Request with its MAC Address.
Source MAC : 0001.1111.BBBB Dest. MAC : 0001.1111.AAAA MAC for 192.168.1.52 is 0001.1111.BBBB
c
 4. PC1 receives the ARP Reply and stores the MAC address for 192.168.1.52 in the local ARP
Cache. The next time it needs to communicate to the same IP, it does not need to send an ARP
request. Instead, it will find the MAC address in the ARP Cache. Similarly, it will also learn the
MAC address of PC3. The other devices will do the same to build the ARP Cache using the ARP
Broadcast.
ARP Cache
IP Address MAC Address
192.168.1.52 0001.1111.BBBB
192.168.1.53 0001.1111.CCCC
IP Communications –
Switched Network
 5. PC1 now completes the original packet by address the Layer 2 information.

Source MAC : Dest. MAC : Source IP : Destination IP : Data


0001.1111.AAAA 0001.1111.BBBB 192.168.1.51 192.168.1.52
c
 6. The Switch compares the Destination MAC address against the MAC Address table and
forwards the packet to the appropriate port.
Network Diagram:
MAC: 0001.1111.AAAA MAC: 0001.1111.BBBB MAC: 0001.1111.CCCC
IP : 192.168.1.50 IP : 192.168.2.50 IP : 192.168.3.50

PC1 PC2 PC3

192.168.1.0/24 192.168.2.0/24 192.168.3.0/24

E0/1 E0/2 E0/1

E0/0 E0/0 E0/1 E0/0

192.168.12.0/24 192.168.23.0/24
R1 R2 R3
IP Communications –
Routed Network
 In order to communicate between different networks, the PC will need to identify
the destination device by specifying the destination MAC address & destination
IP address as well.
c
 As the Source and Destination devices are on different networks, a router will be
used to connect the networks.

 Let’s take the network in the previous slide as an example and take a look at the
IP communications.

 PC1 (192.168.1.50) wants to communicate to PC3 (192.168.3.50). The Users


needs to know the IP Address of the destination PC, PC3 in our case. Let’s take a
look at the process of communication within the same network.
IP Communications –
Routed Network
 1. PC1 checks the Source and Destination address and finds that the device is on a different
network. PC1 will need to use the configured Default Gateway to reach this address. The PC uses
Local addresses in Layer 2 Header and Original Source and Destination IP Addresses in the Layer
3 Header. It will either check the ARP cache or use ARP Request to discover the Default Gateways
c
MAC Address.

Source MAC : Dest. MAC : Source IP : Destination IP : Data


0001.1111.AAAA R1 - MAC 192.168.1.50 192.168.3.50

 2. The Local switch will forward the packet to the Default Gateway (R1). Once R1 receives the
packet, it will strips of the Layer 2 Header.
IP Communications –
Routed Network
 3. The Router will check its routing table to figure out the next hop to reach 192.168.3.0/24
network. The next hop would be R2. R1 will use R2’s MAC address to forward the packet. It will
find the MAC Address of R2 in the ARP cache or use the ARP request to discover R2’s MAC
address. It will recreate the Layer 2 Header with it’s own MAC Address as a source and R2’s MAC
c
address as the destination and forward the packet. The L3 header will remain unchanged.
Source MAC : Dest. MAC : Source IP : Destination IP : Data
R1-MAC R2 - MAC 192.168.1.50 192.168.3.50

 4. R2 will receive the packet. It will also strip off the L2 Header. It will also check it’s routing table
to find the next-hop address for 192.168.3.0/24. The Next hop would be R3. R2 will re-write the
L2 header using it’s MAC address as the source and R3’s MAC address as the destination and
forward the packet towards R3. The L3 header will remain unchanged.
Source MAC : Dest. MAC : Source IP : Destination IP : Data
R2-MAC R3 – MAC 192.168.1.50 192.168.3.50
IP Communications –
Routed Network
 5. R3 will receive the packet. It will also strip off the L2 Header. It will also check it’s routing table
to find that the 192.168.3.0/24 network is directly connected on E 0/1. It will use the ARP Cache
or ARP request to find the MAC Address for 192.168.3.50. R3 will re-write the L2 header using
it’s MAC Address as the source and PC3’s MAC address as the destination. It will forward the
c
packet to the local switch. The Local switch will use the MAC address to forward the packet to
PC3.

Source MAC : Dest. MAC : Source IP : Destination IP : Data


R3-MAC 0001.1111.CCCC 192.168.1.50 192.168.3.50

 6. PC3 receives the packet. It will respond back using the same methodology.
Whiteboard

You might also like