Routing and Switching is the foundation of all networks. Proper IP addressing scheme, technologies used and wise equipment choice would guarantee a stable, scalable and fault tolerant network. Routed and switched networks resemble cities with highways, railways and airlines between them. When you need a package delivered you write an address and leave it at the post office. The post office routes the package further along the most optimal path to another office until eventually the package finds its recipient. The same principle lies within architecture of computer networks. Even now when you are reading these lines means your computer has got the package from my belongings with this very text you are reading. It was delivered to you in milliseconds via a network of routers and switches interconnected with optical fiber links around the world.
Layer 2 Switching :
Switches operating at Layer 2 are very fast because they directly switch data from port to port based on the physical hardware addresses (MAC addresses) that are assigned to network devices during manufacturing. The trade-off for their speed is that they usually are not as intelligent as routers. That is, they do not look at the data packets being transferred to learn anything about where they are going or make any filtering or traffic direction decisions about them. Such decisions require end-to-end knowledge of the network. Switches know only about their locally connected devices.
Layer 3 Switching
Routing used to be the only way to connect internal business networks. However, the advent of wire speed (10, 100, 1000 Mbps) Layer 3 (L3) switches with virtually no delay now lets LAN traffic be connected without the use of traditional routers in the backbone. Standalone routers mostly have been relegated to handle LAN/WAN edge access and WAN connectivity. This is similar to how high-performance Fast Ethernet and Gigabit Ethernet have nudged ATM from the LAN to the WAN. Layer 2/Layer 3 switches dominate in the LAN backbone and in the distribution network and how routers dominate at the network edge for WAN access.