Home > Networking Tips > Routing and Switching > Layer 3 switches explained
Networking Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ROUTING AND SWITCHING

Layer 3 switches explained


David Davis
04.04.2006
Rating: -4.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Let's say that the switches in your data center or wiring closet are old. You know that you need to replace them and have heard about Layer 3 switches. But what is a Layer 3 switch, what can it do for you, and how does it differ from a regular switch or router? Here we cover what every network engineer needs to know.

How do switches and routers work?

Before defining what a Layer 3 switch is, let's make sure that we are all on common ground and understand what a regular switch and a router do.

A switch works at Layer 2 of the OSI model (data-link). It is a LAN device that can also be called a multi-port bridge. A switch switches Ethernet frames between Ethernet devices. Switches do not care about IP addresses nor do they even examine IP addresses as the frames flow through the switch. However, unlike a hub that just duplicates data and sends it out all ports, switches keep a bridge forwarding table that shows what MAC addresses have been seen on what port.

In the Cisco world, the bridge forwarding table is called a CAM Table, or Content Addressable Memory table. If a switch receives an Ethernet frame for a destination that it doesn't have in its table, it floods that frame out to all ports (like a hub does all the time). However, the switch learns from the response of that flood and records the response to that frame in its forwarding table for the next time. Switches form collision domains. In other words, the switches "play traffic cop" with the inbound frames by buffering each packet before switching it. This way, there are no collisions and, to each device connected to the switch, it seems like that device has its own Ethernet segment and can talk at full speed, without risk of collisions.

More on this topic

See a diagram of the OSI Model

Layer 3 switches and routers compared

Router FAQs

More tips on routing & switching

A router, on the other hand, works at Layer 3 of the OSI model (Network). It is a WAN device that connects a LAN to a WAN or a subnetted LAN to another subnetted LAN. A router routes IP packets between IP networks. Routers do this using an IP routing table. In that table, they have either static or dynamic routes. When an IP packet comes in, the router looks up the destination IP in the IP routing table. If that destination IP is not found in the table the router drops the packet, unless it has a default route. Routers form broadcast domains because they drop broadcast packets.

How does a Layer 3 switch work?

A Layer 3 switch works much like a router because it has the same IP routing table for lookups and it forms a broadcast domain. However, the "switch" part of "Layer 3 switch" is there because:

  1. The layer 3 switch looks like a switch. It has 24+ Ethernet ports and no WAN interfaces.
  2. The layer 3 switch will act like a switch when it is connecting devices that are on the same network.
  3. The layer 3 switch is the same as a switch with the router's IP routing intelligence built in.
  4. The switch works very quickly to switch or route the packets it is sent.

In other words, the Layer 3 switch is really like a high-speed router without the WAN connectivity.

You might be asking yourself why you would want the routing functionality of a router in your switch if you don't have WAN interfaces. Well, the routing functionality of the Layer 3 switch is there to route between different subnets or VLANs on a campus LAN or any sort of large LAN. This means that the Layer 3 switch is really for large Ethernet networks that need to subnet into smaller networks. Most of the time, this is done using VLANs.

When it comes to Layer 3 switching, there are two kinds: hardware and software. With a hardware-based solution, the device is using an ASIC (a dedicated chip) to perform the function. With the software implementation, the device is using a computer processor and software to perform the function. Generally, Layer 3 switches and high-end routers route packets using hardware (ASICs) and general-purpose routers use software to perform routing functions.

What is a VLAN?

A VLAN is a virtual LAN. This virtual LAN is also an IP subnet. The difference between just subnetting a network and using VLANs is the flexibility that VLANs can provide for your LAN subnetting. Here is an example: Say that you have a single switch port in one VLAN, in one building. One hundred yards away, you can have another switch port, in another building. Both of those switch ports can be in the same VLAN and only those two switch ports can talk, despite the fact that they are separated by multiple buildings and are connected by a 100 yard fiber optic cable. Without a VLAN, this type of organization wouldn't be possible.

In a traditional VLAN, switches tag the VLAN traffic, and only the devices on the same VLAN can communicate with one another. If devices on different VLANs need to communicate, they would talk to each other via a trunk port on a router. That trunk port and the processing power of the router would create a bottleneck for communications. With a Layer 3 switch, routing and trunking are performed at very high speeds.

Besides the functionality mentioned above, a VLAN has a number of other features such as:

  • Performance & broadcast control
  • Segregating departments or project networks
  • Security

This article can't begin to cover all that you need to know about VLANs. What you need to know is that Layer 3 switches are used to make VLANs easier and faster. Layer 3 switches make VLANs easier to configure because you don't need a separate router between VLANs. All the routing can be done right on the switch. Layer 3 switches make VLANs faster because they eliminate the bottleneck that results from a router forming a single link between VLANs.

Do I need a Layer 3 switch?

You should investigate getting a Layer 3 switch if you can answer yes to any of the following questions:

  • Do you have a network with a lot of broadcasts that needs better performance?
  • Do you have subnets and/or VLANs that are currently connected via a router?
  • Do you need higher performance VLANs?
  • Do departments need their own broadcast domains for performance or security?
  • Are you considering implementing VLANs?
Article summary

Here is what we have learned:

  • Routers work at Layer 3 and route IP packets between networks.
  • Switches work at Layer 2 and switch Ethernet frames between Ethernet devices.
  • For some of the higher-end Cisco switches, enabling Layer 3 switching is simply a software upgrade available for a fee.
  • Layer 3 switches are used primarily for inter-VLAN routing.
  • Layer 3 switches don't have WAN connectivity

About the author:
David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been in the IT industry for 15 years. Currently, he manages a group of systems/network administrators for a privately owned retail company and authors IT-related material in his spare time. He has written over fifty articles, eight practice tests and three video courses and has co-authored one book. His website is at www.happyrouter.com.

Rate this Tip
To rate tips, you must be a member of SearchNetworking.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Routing and Switching
Routing with NAT traversal and UPnP
Secure Cisco routers against IOS flaw attack
Configure WAN protocols on a Layer 3 switch
How routers work
Network summarization -- Supernetting and wildcard masks
Routing: Five common, easily avoided errors
Router Expert: Building a WLAN proxy server, implementing ASR
Router Expert: Building a WLAN proxy server, implementing WPAD
Cisco IOS IP routing -- dynamic routing
Cisco IOS IP routing: Static routes

Router and Switch Management
How many more users will 802.11n wireless access points support?
How to connect wireless networks for printing capabilities
How can I prevent collisions on my network?
How to upgrade an Input/Output Supervisor (IOS) router
Inter-VLAN routing with a LAN and WAN on a single router
Troubleshooting IP Routing -- 'CCNA Official Exam Certification Library, 3rd Edition,' Chapter 7
How can I load balance between DSLs and LLs?
How can I configure 10 VLANs with 5 unmanaged switches?
Cisco's ISR inches the company toward openness
How do I configure two leased lines in one router?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
32-bit IP addressing  (SearchNetworking.com)
autotrunking  (SearchNetworking.com)
delay-tolerant network  (SearchNetworking.com)
Internet Routing in Space (IRIS)  (SearchNetworking.com)
logical router  (SearchNetworking.com)
routing table  (SearchNetworking.com)
subnet  (SearchNetworking.com)
subnet mask  (SearchNetworking.com)
virtual routing and forwarding  (SearchNetworking.com)
weighted fair queueing  (SearchNetworking.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Networking Solutions for Business
IT Management Solutions and Services Directory.
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersNetworking Product Trials
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts