Вы находитесь на странице: 1из 3

UNIVERSIDAD POLITECNICA SALESIANA

ELECTRONICS ENGINEERING CAREER


COMPUTER NETWORKS II

READING MATERIAL III

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

Figure 1. Layer 2 and layer 3 switches operation.

Layer 3 switch vs. router


A layer 3 switch can perform an inter LAN or inter VLAN routing in a similar way a router does. However, a
layer 3 switch do not completely replaces a router in every feature, provided that a router has features that a
layer 3 switch is unable to perform. In table 1 there is a detail of the features supported by each device.
Feature

Layer 3 switch

Router

Layer 3 routing

Supported

Supported

Network traffic management

Supported

Supported

WAN interfaces

Supported

Advanced routing protocols


Wirespeed routing

Supported
Supported

Table 1. Comparison between a layer 3 switch and a router

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.

Configuration of routing processes in layer 3 switches (CISCO devices):


A layer 3 switch may use three different types of routable interfaces:
Routable ports: These are layer 3 physical interfaces, similar to the routers Ethernet interfaces. A
routable layer 3 Ethernet interface permit the configuration of network parameters on it, like an IP
address, and may be recognized by the layer 3 switch as gateway interface for its routes. This is
different than a layer 2 Ethernet interface since you cannot configure an IP address on such interface.
Switched Virtual Interfaces SVI: These are VLAN interfaces (VLANs threated as virtual interfaces)
which can be used as routable interfaces.
Bridge Virtual Interfaces BVI: Layer 3 virtual bridging Interfaces.
In order to configure a layer 3 switch as a routing device it can be used Routable ports or SVIs. Usually in a
layer 3 switch (like in a CISCOs layer 3 switch) the interfaces work as default as layer 2 ports and the routing
capability is disabled. In order to enable the routing capability in the switch, it must be issued the command IP
routing.

Routing configuration using routable ports:


In order to configure routable ports in a layer 3 ciscos router, it must be disabled as layer 2 port (so to become
a layer 3 port) using the command no switchport in interface configuration mode. Then it can be assigned an
IP address to the port. The behavior of these interfaces is the same than an Ethernet interface on a router.
Example:
Switch# configure terminal
Switch(config)# ip routing
Switch(config)# interface fe0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.10.1.1 255. 255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# interface fe0/2
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.20.1.1 255.255.255.0
Switch(config-if)# no shutdown

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.

Вам также может понравиться