A Switch is a computer networking device that connects network segments. Low-end network switches appear nearly identical to network hubs, but a switch contains more "intelligence" (and comes with a correspondingly slightly higher price tag) than a network hub. Network switches are capable of inspecting data packets as they are received, determining the source and destination device of that packet, and forwarding it appropriately. By delivering each message only to the connected device it was intended for, a network switch conserves network bandwidth and offers generally better performance than a hub.
the past, it
was faster to use Layer 2 techniques to switch, when only
MAC addresses could be looked up in content addressable
memory (CAM). With the advent of ternary CAM (TCAM), it was
equally fast to look up an IP address or a MAC address. TCAM
is expensive, but very appropriate for enterprise switches
that use default routes plus a moderate number of other
routes. For routers that need a full Internet routing table,
TCAM may not be cost-effective.