You are on page 1of 36

Ethernet Switching

www.huawei.com

Author/ Email: Zhushigeng 261992 / zhushigeng@huawei.com


Version: V1.0

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved


Objectives

• Upon completion of this course, you will be able to:

• Describe the function of MAC addressing at the data link layer.

• Describe Ethernet frame forwarding and processing behavior.

• Describe the basic concepts in VLAN and trunking.

• Configure Ethernet LAN switch.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 2


Subjects

Ethernet Switching

VLAN and Trunking


Ethernet Switching

/3
0/0
PC1 PC2

GE
GE0/0/1 GE0/0/2

IP : 192.168.1.1 IP : 192.168.1.2
MAC : 0050-5600-0001 MAC : 0050-5600-0002

SrcMAC 0050-5600-0001 • Address Learning SrcMAC 0050-5600-0001


DstMAC 0050-5600-0002 • Frame Switching DstMAC 0050-5600-0002
and filtering
Src-IP 192.168.1.1 • Loop detecting Src-IP 192.168.1.1
Dst-IP 192.168.1.2 and avoiding Dst-IP 192.168.1.2

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 4


MAC address

• MAC address is a 48-bit hexadecimal address ,usually represents a 12-di


git hexadecimal address .
• Unicast MAC address is unique in world wide, Each address is composed
of two parts, stands for provider and serial number respectively.
• Broadcasts use a MAC address of FF-FF-FF-FF-FF-FF(Broadcast MAC a
ddress).
• If the eighth bit is set to 1, it represents multicast.

00e0.fc39.8034

00000000 11100000 11111100 00111001 1000000 00110100


OUI

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 5


MAC address table

G
/ 1 E0
0 /0 /0
/2
GE

PC1 VLAN1 PC2 VLAN1


192.168.1.1/24 192.168.1.2/24
5489-986D-19CA 5489-98B0-2FEF

<SW>display mac-address
MAC address table of slot 0:
-------------------------------------------------------------------------------------------------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
-------------------------------------------------------------------------------------------------------------------
5489-98b0-2fef 1 - - GE0/0/2 dynamic 0/-
5489-986d-19ca 1 - - GE0/0/1 dynamic 0/-
-------------------------------------------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 2

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 6


How does Layer2 Switch work

• Initially,the MAC address table of switch is empty.

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4

PC2 PC4
8c00-BB01-0002 8c00-BB01-0004
MAC Address Port

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 7


How does Layer2 Switch work

1. PC1 sends a frame to PC4 (suppose PC1 knows the MAC addr of PC4).

Src: 8c00-BB01-0001
Dst: 8c00-BB01-0004

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4

PC2 PC4
8c00-BB01-0002 8c00-BB01-0004
MAC Address Port

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 8


How does Layer2 Switch work

2. Switch looks up the MAC address table based on the destination MAC address of
the frame. But there is no entry matching the destination MAC address of this fra
me , so the switch floods the frame.
Src: 8c00-BB01-0001
Dst: 8c00-BB01-0004

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4
Flooding

PC2 PC4
8c00-BB01-0002 8c00-BB01-0004
MAC Address Port

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 9


How does Layer2 Switch work

3. Then switch learns the source MAC address , creates an entry in its MAC addres
s table to record the MAC and associate with the port GE0/0/1.

Src: 8c00-BB01-0001
Dst: 8c00-BB01-0004

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4

PC2 PC4
8c00-BB01-0002 8c00-BB01-0004
MAC Address Port
8c00-BB01-0001 GE0/0/1

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 10


How does Layer2 Switch work

4. PC2 and PC3 discards the frame which is sent to PC4. PC4 accepts it and proces
ses the frame.

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4

PC2 PC4
8c00-BB01-0002 8c00-BB01-0004
MAC Address Port
8c00-BB01-0001 GE0/0/1

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 11


How does Layer2 Switch work

5. PC4 replies a frame to PC1.Switch search the destination MAC addr. It finds a ma
tching entry in the MAC address table,so sends the frame out port GE0/0/1 to PC
1.

MAC Address Port


8c00-BB01-0001 GE0/0/1
8c00-BB01-0004 GE0/0/4

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4

PC2 Src: 8c00-BB01-0004 PC4


8c00-BB01-0002 Dst: 8c00-BB01-0001 8c00-BB01-0004

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 12


How does Layer2 Switch work

6. Then switch learns the source MAC address and associates it with port GE0/0/4,

MAC Address Port


8c00-BB01-0001 GE0/0/1
8c00-BB01-0004 GE0/0/4

GE0/0/1 GE0/0/3
PC1 PC3
8c00-BB01-0001 8c00-BB01-0003
GE0/0/2 GE0/0/4

PC2 Src: 8c00-BB01-0004 PC4


8c00-BB01-0002 Dst: 8c00-BB01-0001 8c00-BB01-0004

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 13


Ethernet Layer2 Switching

• A Layer 2 switch maintains a MAC address table and forwards Ethernet fr


ames based on destination MAC addresses. 
• When the Layer 2 switch receives an Ethernet frame, it records the sourc
e MAC address and the inbound port of the frame in the MAC address tab
le to guide Layer 2 forwarding.
• The switch looks up the MAC address table based on the destination MA
C address of the Ethernet frame. If no matching entry is found, the switch
forwards the frame to all its ports except the interface that receives the fra
me(Flood). If the destination MAC address of the frame is a broadcast ad
dress, the switch forwards the frame to all its ports except the port that re
ceives the frame. If a matching entry is found in the MAC address table, t
he switch forwards the frame to the port specified in the entry.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 14


Subjects

Ethernet Switching

VLAN and Trunking


Background

Switch

1 2 23 24

192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4

• By default,all the hosts connect to the same switch belongs to the same
broacast domain.
• If there are a large number of hosts on an Ethernet network, collision
becomes a serious problem and can lead to broadcast storms. As a
result, network performance deteriorates.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 16


Virtual LAN

Switch

1 2 23 24

192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4

• The VLAN technology divides a physical LAN into multiple broadcast


domains, each of which is called a VLAN ( Virtual Local Area Network ).
• Hosts within a VLAN can communicate with each other, while hosts in
different VLANs cannot communicate with each other directly. Therefore, the
broadcast packets are limited in each VLAN.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 17


VLAN

Switch

1 2 23 24

PC1 PC2 PC3 PC4


192.168.1.1/24 192.168.1.2/24 192.168.2.1/24 192.168.2.2/24
VLAN10 VLAN20

• PC1 can communicate with PC2 directly,they are in the same broadcast
domain and belong to the same IP subnet.
• PC3 can communicate with PC4 directly,they are in the same broadcast
domain and belong to the same IP subnet.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 18


Advantages of VLAN

• Limits broadcast domains. A broadcast domain is limited in a VLAN. Thi


s saves bandwidth and improves network processing capabilities.
• Enhances network security. Packets from different VLANs are separatel
y transmitted. Hosts in a VLAN cannot directly communicate with hosts in
another VLAN.
• Improves network robustness. A fault in a VLAN does not affect hosts i
n other VLANs.
• Flexibly sets up virtual groups. With the VLAN technology, hosts in diff
erent geographical areas can be grouped together. This facilitates networ
k construction and maintenance.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 19


Linktype of switch’s port: Access

• You can configure an Ethernet interface as an access port.


• An access port transmits packets on only one, untagged VLAN. You specify
which VLAN traffic that the interface carries,by default it is VLAN1.
• Access ports are usually used to connect hosts or Servers.

Switch
1 2 23 24

192.168.1.1 192.168.1.2 192.168.2.1 192.168.2.2

VLAN10 VLAN20

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 20


Linktype of switch’s port: Trunk

Switch1 Trunk link Switch2

VLAN10 VLAN20 VLAN10 VLAN20

• Trunk links provide VLAN identification for frames traveling between switches.
• Trunk links must be configured to allow trunking on each end of the link.
• Trunk ports works with one or multiple VLANs.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 21


Access and Trunk port

• Access ports belong to a single VLAN and do not provide any identifying
marks on the frames that are passed between switches.
• Access ports also carry traffic that comes from only the VLAN assigned to
the port.
• Trunk links are required to pass multiple VLANs data between switches. T
runking is a function that must be enabled on both sides of a link.
• A trunk port is by default a member of VLAN1 ,but can be configured to b
e a member of all the VLANs that exist on the switch and carry traffic for a
ll those VLANs between the switches.
• To distinguish between the traffic flows of different VLANs, a trunk port mu
st mark the frames with special tags as they pass between the switches.
• If two switches are connected together, for example, both switch ports mu
st be configured for trunking, and they must both be configured with the s
ame tagging mechanism (802.1Q).

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 22


Dot1q

Original
Dest Src Len/EType Data FCS
Frame

Insert tag field

Tagged
Dest Src Tag Len/EType Data FCS
Frame

EtherType(0x8100) PRI VLAN ID


16bits 3bits 1bit 12bits

Token Ring Encapsulation Flag

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 23


Deploy VLAN and Trunking in data network

Access ports
SwitchBlade1 SwitchBlade2
Fabric Fabric

Server Server

VLAN10 VLAN11

ATAE Frame

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 24


Deploy VLAN and Trunking in data network

Trunk ports
SwitchBlade1 SwitchBlade2
Fabric Fabric

Server Server

VLAN10 VLAN11

ATAE Frame

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 25


Basic Configuration of VLAN

• Create a VLAN on switch:


[Quidway] vlan 10
• Configure the link-type of a port to access , and add the port to VLAN 10:
[Quidway] interface gigabitEthernet0/0/1
[Quidway-gigabitEthernet0/0/1] port link-type access
[Quidway-gigabitEthernet0/0/1] port default vlan 10

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 26


Lab1

• Create VLAN10 and 20 on SW1.


• Configure GE0/0/1 and GE0/0/2 as access
SW1
port,add port GE0/0/1 to VLAN10 and
Ge0/0/2 to VLAN20.
/1

G
/0

i 0/
i0

0/
G

PC1 PC2
VLAN10 VLAN20
192.168.10.1/24 192.168.20.1/24

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 27


Configuration of SW1

• Create VLAN10 and 20:


[SW1] vlan batch 10 20 #using the keyword “batch” to create multiple VLANs in o
ne time
• Configure Port GE0/0/1 as access port and add it to vlan 10:
[SW1] interface gigabitEthernet0/0/1
[SW1-gigabitEthernet0/0/1] port link-type access
[SW1-gigabitEthernet0/0/1] port default vlan 10
• Configure Port GE0/0/2 as access port and add it to vlan 20:
[SW1] interface gigabitEthernet0/0/2
[SW1-gigabitEthernet0/0/2] port link-type access
[SW1-gigabitEthernet0/0/2] port default vlan 20

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 28


display vlan

The total number of vlans is : 3


……
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:GE0/0/3(D) GE0/0/4(D) GE0/0/5(D) GE0/0/6(D)
GE0/0/7(D) GE0/0/8(D) GE0/0/9(D) GE0/0/10(D)
GE0/0/11(D) GE0/0/12(D) GE0/0/13(D) GE0/0/14(D)
GE0/0/15(D) GE0/0/16(D) GE0/0/17(D) GE0/0/18(D)
GE0/0/19(D) GE0/0/20(D) GE0/0/21(D) GE0/0/22(D)
GE0/0/23(D) GE0/0/24(D)
10 common UT:GE0/0/1(U)
20 common UT:GE0/0/2(U)

VID Status Property MAC-LRN Statistics Description


--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable VLAN 0010
20 enable default enable disable VLAN 0020

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 29


Basic Configuration of trunking

• Configure the link-type of Port GE0/0/24 to trunk:


[SW1] interface gigabitEthernet0/0/24
[SW1-GigabitEthernet0/0/24] port link-type trunk
• Configure the VLANs that allowed to pass through this port:
[SW1-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20
• Specify the default VLAN for a trunk port:
[SW1-GigabitEthernet0/0/24] port trunk pvid vlan 99

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 30


Lab2

SW1 SW2
Gi0/0/24 Trunk Gi0/0/24

/1

1
Gi

Gi
0/
/0

0
i0

0/
/0

/0
G

Gi
/2

2 /
PC1 PC2 PC3 PC4
VLAN10 VLAN20 VLAN10 VLAN20
192.168.10.1/24 192.168.20.1/24 192.168.10.2/24 192.168.20.2/24

• Create VLAN10 and 20 on SW1 、 SW2.


• Configure proper link-type for the ports on switches.
• PCs in the same VLAN MUST be able to communicate with each other.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 31


Configuration of SW1

• Create VLAN10 and 20:


[SW1] vlan batch 10 20
• Configure the link-type of GE0/0/1 :
[SW1] interface gigabitEthernet0/0/1
[SW1-gigabitEthernet0/0/1] port link-type access
[SW1-gigabitEthernet0/0/1] port default vlan 10
• Configure the linktype of GE0/0/2:
[SW1] interface gigabitEthernet0/0/2
[SW1-gigabitEthernet0/0/2] port link-type access
[SW1-gigabitEthernet0/0/2] port default vlan 20

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 32


Configuration of SW1 (cont.)

• Configure the link-type of GE0/0/24 to trunk:


[SW1] interface gigabitEthernet0/0/24
[SW1-GigabitEthernet0/0/24] port link-type trunk
[SW1-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 33


Configuration of SW2

• Create VLAN10 and 20:


[SW2] vlan batch 10 20
• Configure the linktype of GE0/0/1:
[SW2] interface gigabitEthernet0/0/1
[SW2-gigabitEthernet0/0/1] port link-type access
[SW2-gigabitEthernet0/0/1] port default vlan 10
• Configure the linktype of GE0/0/2:
[SW2] interface gigabitEthernet0/0/2
[SW2-gigabitEthernet0/0/2] port link-type access
[SW2-gigabitEthernet0/0/2] port default vlan 20

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 34


Configuration of SW2 (cont.)

• Configure the link-type of GE0/0/24 to trunk:


[SW2] interface gigabitEthernet0/0/24
[SW2-GigabitEthernet0/0/24] port link-type trunk
[SW2-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 35


Thank you
www.huawei.com

You might also like