switch vs router | difference between switch and router
This page compares switch vs router and describes difference between switch and router. It mentions working of switch and router with functions of each in a network.
Switch in a network
Following are the functions of a switch:
• It connects multiple devices and port together in a network.
• It connects two or more nodes in the same network or different network (only wired type).
• As switch deals with MAC addresses, and hence it operates on link layer i.e. layer-2.
• Switch creates and maintains switch table in order to forward the packet.
Let us understand how switch works.
Initially when switch receives data from node-A, it forwards the same to all nodes.
It makes entry of Host-A with its MAC address in the switch table. Later when node-C sends packet to node-A, as now switch has entry of node-A with its MAC address, switch knows on
which port node-A is connected with and hence will forward the packet from node-C to the port where node-A is connected.
This is the way switch works.
Router in a network
Following are the functions of a router:
• It forwards data packets along the networks.
• It directs the data in a network
• It connects two or more networks (wired/wireless)
• As router deals with IP addresses, and hence it operates on network layer i.e. layer-3.
Let us understand how router works. Router checks for IP addresses in the packet and based on this, router makes sure that packet is passed between network to network till it reaches final destination. This way router bridges the gap between home network and ISP's network. ISP network is where connectivity with all the web servers of the search engine provides such as google, yahoo, ask, bing etc. is available.
Unlike switch which works only with wired network. Router works with both wired as well as wireless devices. In order to support wireless connectivity router comes with wifi antenna and built-in wifi protocols. All the network devices having wifi protocols can make use of router to access the internet.
Comparison between Switch and Router
Following table mentions main comparison between switch and router network devices.
|The switch devices determine destination address with the help of hardware configured MAC address and hence transfer data.||The router devices use software configured network address (i.e. IP address) to determine the destination.|
|Switches transfer the data between LAN segments.||Routers transfer the data between LAN and WAN segments.|
|Switch devices operate at the layer-2(data link layer) of the OSI stack.||Router devices operate at layer-3(network layer) of the OSI stack.|
|Switch devices can not share or transfer data using an internet connection.||Router devices are capable of sharing an internet connection.|
|Switch devices offer wired connectivity in the network.||Router devices offer both the wired and wireless connectivity in the network.|
|Supports both half and full duplex transmission modes.||Supports full duplex transmission mode.|
|Supports first broadcast, then unicast and multicast as needed.||Supports broadcast at initial level then unicast and multicast.|
|Take more time for complicated routing decision.||Take faster routing decision.|
|Refer switch basics||Refer router basics|