Different between Switch and Router...

CP

Senior member
Oct 12, 1999
229
0
0
Hi,

I know the different between hub and switch. But how about router? If router Vs switch which one better? Any URL that I can learn more about this?

Thanks
 

office boy

Diamond Member
Oct 12, 1999
4,210
0
0
They are so diferent....I don't even know where to start....
a switch is a smart spliter (basicly)....
and a router is more like a smart converter. (WAN to LAN)
 

jmcoreymv

Diamond Member
Oct 9, 1999
4,264
0
0
Its not that a switch is better then a router, or visa versa. They are used for two different tasks. A router will route packets in between different network, and it is a layer 3 device so it can read IP/IPX or some others. A switch is a layer two device, meaning it can only read the MAC hardware address and sends it to the port its supposed to go. Heres how it works, if a switch receives a frame, it will look for the mac address in its filter table to see which port it goes to, if it doesnt have an entry, then it will foward the packet to all ports, and then it will receive a reply and it will enter it into its table so that the next time a frame comes with that MAC address, it will know where to send it. Both of these topics get a lot more complex, but ive got to go take a shower.
 

bhuie

Member
May 30, 2000
35
0
0
A simple way to look at it is to remember that a router is used for connecting two different networks together, while a switch is used to reduce the congestion inside one specific network.

A router works at layer 3, (the layer that IP sits in) and it interacts with other routers to determine where an IP packet should go. It learns where other subnets or networks are based on information sent out by other routers and forwards packets it gets based on that information.

A switch works at layer 2 using MAC or what some people call "ethernet" addresses. It sits inside the network and learns the MAC address and port of different stations in the network. Once it sees a frame (the equivalent of a packet at layer 2) that is supposed to go to a station it knows about, it only sends it to the port that the station exists on. That way, all the other ports don't get the traffic that isn't intended for them.

You could say that switches are (generally) faster than routers in terms of how many packets they can process because they are completely hardware based. A router needs to rewrite part of the packet based on the information it has learned from other routers when it sends it out, something that is done in software. This is changing with things like layer-3 switching, but that's probably more than you wanted to know. The fact is, you can't really compare the two since they don't perform the same function. A router has a much more complicated task to do.