07 Ethernet Switching Basics
07 Ethernet Switching Basics
Page 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Foreword
Data transmission on networks must comply with certain standards. Ethernet protocols define
how data frames are transmitted over an Ethernet network. Understanding Ethernet protocols is
the basis for fully understanding communication at the data link layer. An Ethernet switch is the
main device for implementing data link layer communication. It is essential to understand how
an Ethernet switch works.
This course describes the concepts related to Ethernet protocols, MAC address types, and
working process and mechanism of Layer 2 switches.
Page 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objectives
On completion of this course, you will be able to:
Describe the basic concepts of an Ethernet network.
Distinguish MAC address types.
Get familiar with the working process of a Layer 2 switch.
Get familiar with the structure and generation process of a MAC address table.
Page 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of Ethernet Protocols
2. Overview of Ethernet Frames
3. Overview of Ethernet Switches
4. Process of Data Communication Within a Network Segment
Page 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Protocols
Ethernet is the most common communication protocol standard used by existing local area networks (LANs). It
defines the cable types and signal processing methods that are used on a LAN.
An Ethernet network is a broadcast network built based on the carrier sense multiple access/collision detection
(CSMA/CD) mechanism.
Switch B
Host A Host B
Host C Host D
Host C Host D
Page 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Collision Domain
A collision domain is a set of nodes connected to the same shared medium. All nodes in a collision domain compete for the same
bandwidth. Packets (unicast, multicast, or broadcast) sent by a node can be received by other nodes.
Separating collision domains
Solution: CSMA/CD
Host A Host B
Switch A
Collision
Switch B
Host A Host B
Host A Host B
On a traditional Ethernet network, multiple nodes on the same medium A switch forwards broadcast packets to all interfaces. Therefore, the
share a link. The broadcast packets sent by a device can be received by all nodes connected to all interfaces of the switch belong to the same
the other devices. broadcast domain.
Page 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet NIC
A network interface card (NIC) is a key component that connects a network device (such as a computer, a switch, or a
router) to an external network.
Computer
• Network Port
Packet Bit Stream
TCP/IP ▫ A network port is also called a network
Network NIC
layer interface, interface, or port.
Computer Packet Bit Stream
• NIC
▫ Each network port corresponds to a NIC.
Switch
Other NICs that
▫ A computer or switch forwards data
Frame Bit Stream
transfer data to the
local host through a NIC.
NIC
Other NICs on the
local host Frame Bit Stream
Page 9 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of Ethernet Protocols
2. Overview of Ethernet Frames
3. Overview of Ethernet Switches
4. Process of Data Communication Within a Network Segment
Page 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
6B 6B 2B 46-1500B 4B
6B 6B 2B 3B 5B 38-1492B 4B
IEEE 802.3 format D.MAC S.MAC Length LLC SNAP User data FCS
3B 2B
Org Code Type
Page 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
Page 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
Ethernet
Characteristics of IP addresses:
Host 1 Host 2
▫ IP addresses are unique.
▫ IP addresses are changeable.
NIC NIC
MAC1 MAC2 ▫ IP addresses are assigned based on network
topology.
IP1 IP2
Can a network device
have either a MAC
IP3 IP4 address or an IP
Characteristics of MAC addresses:
address?
▫ MAC addresses are unique.
NIC NIC ▫ MAC addresses cannot be changed.
MAC3 MAC4
▫ MAC addresses are assigned based on the
Host 3 Host 4 manufacturer.
Page 14 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
23 22 21 20 23 22 21 20
Conversion between
Power
hexadecimal and 8 4 2 1 8 4 2 1
binary digits
Bit 0 0 0 1 1 1 1 0
=1 = 8+4+2=14=E
Page 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
OUI CID
Multicast MAC address XXXXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXXX 01-80-C2-00-00-01
1 X X X X X
Non-OUI
Broadcast MAC address 11111111 11111111 11111111 11111111 11111111 11111111 FF-FF-FF-FF-FF-FF
Page 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
Host A Host B
• A unicast Ethernet frame is also called a unicast
frame.
• The destination MAC address of a unicast frame is a
unicast MAC address. Unicast
Frame
D.MAC:
S.MAC DATA
00-1E-10-DD-DD-02
Host C Host D
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 1 0
00- 1E- 10- DD- DD- 02
Page 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
Host A Host B
• A broadcast Ethernet frame ia also called a broadcast
frame.
• The destination MAC address of a broadcast frame is
a broadcast MAC address.
Broadcast
Frame
D.MAC:
S.MAC DATA
FF-FF-FF-FF-FF-FF
Host C Host D
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FF- FF- FF- FF- FF- FF
Page 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Ethernet Frame Format MAC address Ethernet frame type
Host A Host B
• A multicast Ethernet frame is also called a multicast
frame.
• The destination MAC address of a multicast frame is
a unicast MAC address.
Multicast
Frame
D.MAC:
S.MAC DATA
01-80-C2-00-00-01
Host C Host D
0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
01- 80- C2- 00- 00- 01
Page 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of Ethernet Protocols
2. Overview of Ethernet Frames
3. Overview of Ethernet Switches
4. Process of Data Communication Within a Network Segment
Page 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Typical Architecture of a Campus Network
Internet Internet
Egress layer
Core layer
Aggregation
layer
Access layer
Page 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Layer 2 Ethernet switch
Internet Internet
Layer 2 Ethernet
Switch
Page 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Working Principles of Switches
/3
0/0
Host 1 Host 2
GE
GE 0/0/1 GE 0/0/2
Switch
IP1: 192.168.1.1 IP2: 192.168.1.2
MAC1: 0050-5600-0001 MAC2: 0050-5600-0002
Page 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Table
Each switch has a MAC address table that stores the mapping between MAC addresses and switch
interfaces.
/3
0/0
Host 1 Host 2
GE
GE 0/0/1 GE 0/0/2
MAC1 GE 0/0/1
MAC2 GE 0/0/2
... ...
Page 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Three Frame Processing Behaviors of a Switch
A switch processes the frames entering an interface over a transmission medium in three ways:
Switch
Flooding
Port 1 Port 2 Port 3 Port 4
Switch
Forwarding
Port 1 Port 2 Port 3 Port 4
Switch
Discarding
Port 1 Port 2 Port 3 Port 4
Frame
Page 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Flooding
/3
0/0
Host 1 Host 2
GE
GE 0/0/1 GE 0/0/2
Source MAC: MAC1 The switch directly floods the broadcast frame
without searching the MAC address table.
Destination MAC: FF-FF-FF-FF-FF-FF
Page 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Forwarding
/3
0/0
Host 1 Host 2
GE
GE 0/0/1 GE 0/0/2
Destination MAC: MAC2 MAC1 GE 0/0/1 If the switch finds the destination MAC
address of the frame in the MAC address table
MAC2 GE 0/0/2 and the interface number in the table is not the
number of the interface through which the
frame enters over the transmission medium,
the switch forwards the unicast frame.
Page 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Discarding
IP2: 192.168.1.2
MAC2: 0050-5600-0002
Host 1
Host 2
Switch 1 GE
IP1: 192.168.1.1 0 /0 /
MAC1: 0050-5600-0001 1
Switch 2
MAC address table queried Frame processing behavior
1 Frame sent by host 1 2 by switch 2 3 of the switch
Page 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Learning on a Switch (1)
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
Page 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Learning on a Switch (2)
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
Source MAC: MAC1 MAC Address Interface • Host 1 sends a frame to host 2.
Destination MAC: MAC2 • After the frame is received on the switch's
GE 0/0/1, the switch searches the MAC
address table for the destination MAC
(Assume that host 1 has obtained the address of the frame. If no matching entry is
MAC address of host 2.) found, the switch considers the frame an
unknown unicast frame.
Page 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Learning on a Switch (3)
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
Source MAC: MAC1 MAC Address Interface • If the corresponding entry is not found in the
MAC1 GE 0/0/1 MAC address table, the switch floods the
Destination MAC: MAC2
unicast frame.
• At the same time, the switch learns the
source MAC address of the frame, creates
the corresponding MAC address entry, and
associates the MAC address entry with GE
0/0/1.
Page 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Learning on a Switch (4)
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
Page 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Learning on a Switch (5)
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
5
• If the switch finds the corresponding entry in the MAC address table, the switch forwards the
unicast frame through GE 0/0/1.
• At the same time, the switch learns the source MAC address of the frame, creates the corresponding
MAC address entry, and associates the MAC address entry with GE 0/0/2.
Page 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of Ethernet Protocols
2. Overview of Ethernet Frames
3. Overview of Ethernet Switches
4. Process of Data communication Within a Network Segment
Page 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Process of Data Communication Within a
Network Segment
Scenario description:
Task: Host 1 wants to access host 2.
Host: The host is in the initialized state and only knows its own IP address and MAC address (assume that the IP address of the
peer host has been obtained).
Switch: The switch is just powered on and in the initialized state.
3
0 /0/
Host 1 Host 2
GE
GE 0/0/1 GE 0/0/2
Page 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Data Encapsulation Process
Host 1 Host 2
TCP
Ethernet header IP header User data Ethernet tail
header
Page 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Initialization
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
----------------------------------------------------
Page 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Flooding Frames
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
ARP Request packet sent by host 1 MAC address table of the switch
Page 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address Learning
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
ARP Request packet sent by host 1 MAC address table of the switch
Page 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Reply of the Target Host
/3
0/ 0
GE
Host 1 Host 2
GE 0/0/1 GE 0/0/2
MAC address table of the switch ARP Reply packet sent by host 2
Page 41 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. (Single) A Layer 2 Ethernet switch generates a MAC address table entry based on the ( ) of the packet received by
an interface.
A. Source MAC address
C. Source IP address
D. Destination IP address.
2. (Single) A switch has eight interfaces. A unicast frame enters the switch through one of the eight interfaces, but the
switch cannot find the destination MAC address entry of the frame in the MAC address table. In this case, which of
the following operations is performed by the switch? ( )
A. Discarding
B. Flooding
C. Point-to-point forwarding
Page 42 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summary
This section describes the basic information about the Ethernet protocol, Ethernet frame formats,
MAC address, and working principles of Layer 2 switches. Specifically, after receiving a frame,
a switch learns the source MAC address of the frame and searches the destination MAC address
of the frame in the MAC address table. If the destination MAC address exists in the table, the
switch forwards the frame through the corresponding interface.
This course also describes the whole process of data communication within the same network
segment based on the working principles of switches.
Page 43 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com
Page 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.