Layer 3 switching is very similar to routing. Switches use the same routing algorithms as traditional routers do. The primary difference between a Layer 3 switch and a router depends more on usage than features. Layer 3 switching is more effectively used to segment a LAN than to provide a WAN connection. If you wanted to segment a campus, for instance, you would use a router rather than a switch, because of the faster connections available using a serial connection and the absence of the speed/distance limitations that are inherent when using CAT5e cabling at 100MB. You can, in addition, use an ATM switch to achieve faster connections than a Frame Relay, or a dedicated T1 connection. To further segment a LAN, switches offer VLAN capability. VLANs are virtual LANs within the actual switch. The switch actually does the routing within itself if a node wants to communicate with another node on a different VLAN.
A Layer 3 switch goes beyond the Layer 2 MAC addressing and routing. The Layer 3 switch looks at the incoming packet‘s networking protocol. In this case, I’ll use IP as the network protocol. The switch examines a packet‘s IP address and acts just like a router. The switch compares the destination address to the list of addresses in its routing table and creates the virtual circuit. It then forwards the packet to the recipient’s address.
The line between Layer 3 switching and routing is continually becoming thinner. Layer 3 switching is no more than a different implementation of a component that calculates the efficiency of available routes, and gives you the ability to segment your LAN within itself. When it comes time to implement Layer 3 switching and routing on your LAN, just remember: “Route once, switch many.”
(3)应用实例:Cisco C8540的交换过程:(图4、5、6)
· How the initial packet travels through the switch Layer 3 route processor to set up the network route.
Note When making Layer 3 switching decisions, the route processor does not reference the switch fabric, (that is, the PVC configuration)。 The interface map (where the switch maps an egress interface to a Broute VC) is programmed when the switch is booted up. At that time, the PVCs are automatically configured.
图4
· How the route processor sends the ARP and propagates the updated routing tables to the interfaces.
Note The ARP requests are described only for illustration purposes. In most cases, if you are running a dynamic protocol, the switches will have already sent and received ARP packets, and built the route tables.
图5
· How subsequent packets sent by Host A, to Host B, are switched without the help of the route processor.