Академический Документы
Профессиональный Документы
Культура Документы
Layer 3 switching
(References and graphics: Kurose, James. Computer Networks, 5th Ed)
A layer 2 switch filters the frames using layer 2 (link layer) addresses: the MAC addresses. They use the MAC
table in order to decide which exit interface a frame must be forwarded. Thus, the layer 2 switch is transparent
regarding the routing processes and end user applications.
A layer 3 switch can work as a layer 2 switch, forwarding the frames based on the MAC addresses, and also
has the capacity of using the layer 3 information, the network addresses, in order to route the packets
contained inside the frames. Thus the layer 3 switch besides using the MAC table uses a routing table in order
to be able to route packets avoiding the use of routers inside the LAN. The main advantage of the layer 3
switch in comparison with a router is the use of wirespeed routing (it is, the layer 3 switch routes a packet
much faster than a router is able to), and the main disadvantage is the fact that it do not support the use of
advanced routing protocols and WAN interfaces.
MAC table (layer 2)
Layer 2
switch
MAC
Puerto
ZYX
YZY
XZZ
3
2
1
Routing table(layer 3)
Layer 3
switch
3
1
IP
Puerto
192.168.1.3
192.168.1.2
192.168.1.1
3
2
1
3
1
PC 1
PC 2
PC 3
PC 1
MAC: XZZ
MAC: YZY
MAC: ZYX
192.168.1.1
PC 2
192.168.1.2
PC 3
192.168.1.3
Layer 3 switch
Router
Layer 3 routing
Supported
Supported
Supported
Supported
WAN interfaces
Supported
Supported
Supported
Inside a LAN, a layer 3 switch has two major advantages over a router:
Faster switching speed (less latency in the network).
Greater LAN port density so to permit higher link bandwidth through port aggregation.
F0/1
F0/2
IP:
10.10.1.2
Mask:
255.255.255.0
Gateway: 10.10.1.1
IP:
10.10.1.3
Mask:
255.255.255.0
Gateway: 10.10.1.1
IP:
10.20.1.2
Mask:
255.255.255.0
Gateway: 10.20.1.1
IP:
10.20.1.3
Mask:
255.255.255.0
Gateway: 10.20.1.1
NOTE: Notice the ports in the layer two switches can be configured as access ports, in the case of
single VLAN routing, or as trunk ports, in the case of multi VLAN routing.
Routing configuration using SVIs:
In order to configure Inter-VLAN routing using SVIs first it must be configured the set of VLANs to be used in
the network. For instance, lets say we have 3 VLANs: VLAN 10, 20 and 30, the VLAN 10 in the layer 3 switch
will work as SVI for any device belonging to VLAN 10 (the hosts in VLAN 10 will declare as gateway the IP
address assigned to this VLAN). As well, VLAN 20 in layer 3 switch will work as SVI for hosts belonging to
VLAN 20 and VLAN 30 will work as SVI for hosts belonging to VLAN 30.
Example:
Switch# configure terminal
Switch(config)# ip routing
Switch(config)# interface vlan 10
Switch(config-if)# ip address 10.10.1.1 255.0.0.0
Switch(config-if)# no shutdown
Switch(config-if)# interface vlan 20
Switch(config-if)# ip address 10.20.1.1 255.255.255.0
Switch(config-if)# no shutdown
vlan 10
vlan 20
vlan 10
vlan 20
IP:
10.10.1.2
Mask:
255.255.255.0
Gateway: 10.10.1.1
IP:
10.20.1.2
Mask:
255.255.255.0
Gateway: 10.20.1.1
IP:
10.10.1.3
Mask:
255.255.255.0
Gateway: 10.10.1.1
IP:
10.20.1.3
Mask:
255.255.255.0
Gateway: 10.20.1.1
NOTE: Do not forget that previously you must have configured the VLANs 10 and 20 in the layer 2
switches (Switch 0 and Switch 1). Remember also the configuration of the correspondent trunk
ports.