Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Difference b/w a Router and Switch

Status
Not open for further replies.

Hamidzia

Member level 3
Joined
May 17, 2004
Messages
54
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,288
Activity points
446
differences switch and hub

Assalam O Alekum !

can anyone tell me some differences between router,switch,hub,bridge,repeater.

I know some but i wanna know more.

Thankx
 

hubs and switches just relay traffic from one port to another. Hub is dumb and what it receives on one port, just relays on all others. Switches are smart. They build up an address table gradually and then decide which traffic to send where.

bridge is a dumb link between two LANs. Like a wireless bridge links 2 LANs operating in different buildings into a single LAN. All computers in the super-LAN now think they are the part of a single LAN.

Router is a gateway between networks and works intelligently and decides which packets to send where. In some aspects, hub isto switch as bridge isto router.
 

There are 3 main Ethernet boxes: Hubs, switch and routers.

A hub is a simple packer relayer device. It have multiple ports, and when a device send packets to the hub, the hub copy the packets to all of it's other ports. For example, if you have 4 PC connected to a hub, then, if one PC send data, the hub will relay this data to all other ports, so that all of the other PC see the packet.

The inconvenient of the hub is that if there are too many devices on the network, there will be a lot of packets relayed, to all computers. There will be a lot of collisions. Hubs are usually half-duplex devices, meening that only one device can transmit a packet at a time. If 2 devices send a packet at the same time, this is called a colision, and the packets will need to be re-transmitted. Hubs doesn't look at the packets content, and where it is destined to, it just take the packet as it is, and re-transmit it. This is called Layer-1 hub, layer 1 being the "physical" layer.

A switch is an evolution of a hub. As stated above, if the number of device invrease, the number of packets sent over the network will also increase dramatically, the hub relaying pakets to all other ports. Also, if you look at the way a hub work, if, for example, PC1 send data to PC3, then, the hub will just dumbly relay the packet to PC2, PC3 and PC4. This meen that the hub will send packets uselessly to some of their ports when no target device reside across those ports. A switch go deeper and actually look at the Ethernet packets. It know some bit about Ethernet standard, and the 2nd layer of Ethernet, "Datalink" (Layer II). So, it know where a packet come from (Ethernet SOURCE), and where it is destined (Ethernet DESTINATION). Switch work this way:

At start-up, a switch just act like a hub. When it receive a packet at one port, it doesn't know where the destination is. It know the destination address, but not on which port it is connected. So, it will relay the packet over every other ports. However, during the process, the switch have gained one important information. Since an Ethernet packet always contain a SOURCE and DESTINATION field, it can look at the packet it just received over a specific port, and grap the SOURCE address field. From there, it "know" than a specific device is connected to that port it just received data. The switch goes on, relaying packets, building-up a table of Ethernet SOURCE address vs. ports where the source reside. At the same time, the switch also look at the DESTINATION address of the packets, and if it find the destination address in it's source vs. port table, it then know where the destination is. When that occur, it will send the packet just to that specific port. So, the switch will most of the time send packets to only specific ports instead of relaying the packet to every ports. Switches can also function in full-duplex. So, if there is 4 PC on 4 ports of the switch, it could occur that PC1 send data to PC2, while PC3 send data to PC4 at the same time. This depend on the switches. The important think to remember is that switches only look at layer 2, looking physical MAC address (and not the IP address).

Router go a step deeper, looking at Layer 3, "Network" layer. It usually work internally like a switch, but can also relay packets across different network subnets. A router need configuration, to be told what subnetwork goes on what port. It then route the packets across networks depending on things like destination network, routing tables, ...

There are 2 kinds of routers. Usually, we can see them as 'commercial' routers and 'home-user' routers. The difference is in the application they are used.

Commercial routers, used in companies, is configured with network routes, either by hand-configuration or via special Ethernet protocol, like Routing Information Protocol (RIP). They then know that at one port, for exaple, is segment 192.168.10.0/255.255.255.0, on another port is 10.150.0.0/255.255.0.0, on another port is the rest of the network (0.0.0.0/0.0.0.0). Those routers relay packets across different subnetworks, preserving the source IP address, so that when the destination receive a packet, that it know where it originated from.

Lots of options can be added to routers, like firewalls and NAT (network address translation).

home-user routers is a special 'flavor' of routers in which it is targetted at home-network front-end between a modem (DSL, ADSL, cable, ...) and the home nwtwork LAN. It does NAT and have firewall. The difference between that and a traditional router is that it usually isn't configured with routing tables and doesn't preserve source address across subnetworks. Instead, the router take a packet from the LAN, which is destined to the Internet, and change the source address with it's own internal address. On the other end of the Internet, such a packet look like it is sent by the router itself. That other end will then take to the router, and not the end PC. The router is intelligent enough to then take those packets, and send it to the PC. This is called network address translation (NAT). The main purpose is to protect the PC (or group of PCs) individuality. From the internet, the whole home LAN look like a single box. A device on the internet can not talk directly to a PC across those router, simply because that PC is invisible to the Internet. Though, the router can be configured to direct specific ports to specific computers. So, for example, if you have a server on one PC, a, "IP port" can be open on the router, so the connections initiated on the Internet to that "IP port" is directed to that PC. Still, from the internet, the server still look like it reside on the router box. This is the main difference between the 2 type of routers, where comemrcial routers doesn't hide their source addresses, but simply divide the corporate LAN across different subnetworks, with individual network adresses range, and home-user router, which is more security-targetted, and hide the home LAN behind a box.
 

Switch
In general, a switch can be thought of as the central component of a single network -- it interconnects computers and passes frames among them. The chief difference between a switch and a hub lies in speed. A hub only allows one computer to transmit at a time, but a switch permits simultaneous communication between disjoint pairs of computers.

Router
A router interconnects two or more _networks_, and passes IP traffic among them. The networks can be heterogeneous (i.e., the frame formats and addressing can differ). For example, a router can interconnect an Ethernet and an FDDI ring.
So, if all you need is one large, homogeneous network, a switch will suffice (assuming you can fine one with enough capacity). If you have multiple, heterogeneous networks, a router is required.

hub
A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.
A passive hub serves simply as a conduit for the data, enabling it to go from one device (or segment) to another. So-called intelligent hubs include additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Intelligent hubs are also called manageable hubs.
A third type of hub, called a switching hub, actually reads the destination address of each packet and then forwards the packet to the correct port.

bridge
A device that connects two local-area networks (LANs), or two segments of the same LAN that use the same protocol, such as Ethernet or Token-Ring.
- has the ability to expand beyond single LAN.
- function of a bridge is to read all frames transmitted on one LAN and accept those address to any station on the other LAN. It's more reliable, better performance, provide more security

repeater
A network device used to regenerate or replicate a signal. Repeaters are used in transmission systems to regenerate analog or digital signals distorted by transmission loss. Analog repeaters frequently can only amplify the signal while digital repeaters can reconstruct a signal to near its original quality.
In a data network, a repeater can relay messages between subnetworks that use different protocols or cable types. Hubs can operate as repeaters by relaying messages to all connected computers. A repeater cannot do the intelligent routing performed by bridges and routers.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top