Back to Basics : Router vs Switch

I have been asked a lot of times about the router and the switch and the difference between them. I knew most of you guys knew about the difference and this is one of the article which i am going to write for the beginners in networking.

Before I write about the router and the switch you guys should always remember about the collision and the broadcast domain and i am assuming that you guys know about it.

Switch -- Datalink Layer Device : 
Switch is a Layer 2 device which works in a Local Area Network and transport the data in form of frames from source to destination. Switch generally understand the MAC address which is also called as hardware address of the Switch. So if you are going to talk a host within a Local Area Network, it can send and receive information through the Switch.

In Short you can say that Switch is the device which helps to communicate the two hosts within a same Local Area Network.

Fig 1.1- Router and Switch in a single Topology

Router -- Network Layer Device : 
Router is a Layer 3 device which works between two different Local Area Networks where Wide Area network exists. It transport the data in form of packets from source to destination. Router generally understand the IP addresses within the network. IP address is the Virtual addresses assigned to the devices so that they can be recognised in the Wide Area Network.

So both these devices are different and works in different layer of OSI model or TCP/IP model. Let's have a look on the difference between these

Fig 1.2- Router vs Switch