Layer-3 switching refers to high-performance routers optimized for the campus LAN or the Internet that provide wire-speed Ethernet routing and switching services. A Layer-3 switch has these three functions:
- Packet Switching
- Route Processing
- Intelligent network services
When comparing Layer-3 switches to other routers, Layer-3 switches process more packets faster by using ASIC hardware instead of CPU(s) (microprocessor-based). Layer-3 switch routers also improve network performance with added functionality like route processing and intelligent network services.
Layer-3 Switching can occur in two different locations on the switch:
- Centralized Switching: Switching decisions are mde on the route processor by a central forwarding table.
- Distributed Switching: Swithcing decisions are made on a port or line-card level.
Layer-3 Switching takes places using one of these two methods:
- Route Caching: A layer-3 route cache is built in hardware as the switch sees traffic flow into the switch.
- Topology-based switching: Information from the routing table is used to populate the route cahce (called the Forward Information Base or FIB), regardless of traffic.
Layer-3 devices can move packets from one port to another in a many different ways. The most basic method is process switching. Process Switching moves packets between interfaces based on the routing table and address resolution protocol (ARP) cahce on a scheduled basis. As packets arrive they will be moved into a queue to wait for further processing. When the scheduler runs, the outbound interfaces will be determined and the packet will be switched. (the queue and scheduler intoduces latency)
CEF uses strategies to speed packet switching on demand as they arrive on an interface and to cache information. CEF cahces information in the FIB and caches layer-2 next-hop addresses for all FIB entries in an adjacency table. because parallel paths can exist this enables CEF to load balance per packet.
CEF operates in two modes:
- Central CEF mode: CEF FIB and adjacency tables reside on the route processor, and the route processor performs the express forwarding. This CEF mode is use when line-card and not available for CEF switching or when features are not compatible with distributed switching.
- Distributed Cisco Express Forwarding (dCEF) mode: dCEF is supported only on the Catalyst 6500 switches. When dCEF is enabled, line cards maintain identical copies of the FIB and adjacency tables. The line cards can performs the express forwarding by themselves. dCEF uses an inter-process communications (IPC) mechanism to ensure synchronization of the FIBs and adjacency tables on the route processor and line card.
Configuration:
CEF is enabled by default on switches that are CEF capable to turn CEF back should it have been disabled for Cisco Catalyst 4000 switches (3560 also) (add no in front to disable) also optionally enable this inside an interface for per port use:
switch(config)#ip cef
For Cisco Catalyst 3550 Series (add no in front to disable) optionally also enable this inside an interface for per port use:
switch(config)#ip route-cace cef
To verify operation (also try adding gigabitethernet 0/1-28 for port based info):
switch#show cef
To verify operation on an interface:
switch#show interface gigabitethernet 0/1-28 | begin l3
To verify operation showing switched packets at layer-2 and layer-3:
switch#show interface gigabitethernet 0/1-28 | include switched
To show the adjacency information:
switch#show adjacency gigabitethernet 0/1 detail / internal / summary
Debug:
To debug CEF use the following commands:
switch#debug ip cef drops / access-list / receive / events / prefix-ipc / table
switch#debug ip cef ipc / interface-ipc
switch#ping ip
Notes and Notices:
This is a part of my personal BCMSN notes and research to assist myself in learning and understanding the concepts and theory for the BCMSN exam. I learn by making notes reading and writing things down and wish to file them where I can’t lose them. These notes are not to be seen, judged or mistaken for replacements to Cisco recognized and authorized training which I personally support and attend and suggest you undertake if you are going for the BCMSN Certification.