Recently saw a lot of people asking about the switch, hub, router is what, function, what is the difference, the author on these questions to do some simple answers.
First of all said Hub, that is, hubs. Its role can be simply understood to connect some machines to form a local area network. A switch (also known as a switched hub) works roughly the same as a hub. But there is a difference in performance: the way the hub uses shared bandwidth works, and the switch is the exclusive bandwidth.
In this way, when there is a lot of machine or large amount of data, the two will be more obvious. The router and the above two obvious difference, its role is to connect different network segments and find the network data transfer the most appropriate path, can be said that under normal circumstances, individual users need not. Routers are generated after the switch, just as the switch is generated after the hub, so routers and switches are also connected, not completely independent of the two devices. Routers mainly overcome the inability of the switch to route and forward packets.
In general, the main differences between routers and switches are shown in the following areas:
(1) Different levels of work
The initial switch is the data link layer that works in the OSI/RM open architecture, which is the second tier, and the router begins by designing the network layer that works at the OSI model. Since the switch works on the second layer of OSI (data link layer), it works fairly simply, and routers work on the third layer of OSI (the network layer) to get more protocol information, and routers can make more intelligent forwarding decisions.
(2) Data forwarding based on different objects
A switch uses a physical address or a MAC address to determine the destination address of the forwarded data. The router uses the ID number of the different network (that is, the IP address) to determine the address of the data forwarding. IP addresses are implemented in software that describes the network where the devices are located, and sometimes these third-tier addresses are also called Protocol addresses or network addresses. MAC addresses are usually hardware-led, distributed by the manufacturer of the network adapter, and have been cured to the network card, which is generally not to be changed. IP addresses are usually assigned automatically by your network administrator or system.
(3) Traditional switches can only split the conflict domain, can not split the broadcast domain;
The network segments that are connected by the switch still belong to the same broadcast domain, and broadcast packets propagate across all network segments connected to the switch, which in some cases can lead to traffic congestion and security vulnerabilities. The network segments that are connected to the router are assigned to different broadcast domains, and broadcast data does not go through the router. Although the third layer above the switch has VLAN function, can also split broadcast domain, but each sub broadcast domain is unable to communicate the communication, the communication between them still needs the router.
(4) The router provides the service of the firewall
Routers can prevent broadcast storms by forwarding only packets of specific addresses, sending packet transmissions that do not support routing protocols, and sending unknown destination network packets.
Switches are generally used for lan-wan connections, switches to Network Bridge, data link layer equipment, some switches can also achieve the third layer of exchange. Routers are used for connections between Wan-wan, which can be used to resolve the forwarding groupings between opposite-sex networks, and to use the network layer. They just accept the input grouping from one line, and then forward to another line. These two lines may belong to different networks and use different protocols.
Comparatively speaking, the function of the router is more powerful than the switch, but the speed is relatively slow and the price is expensive, the third layer switch has the ability of the switch speed forwarding message and the good control function of the router, so it can be widely used.
At present, the personal comparison of multiple broadband access is ADSL, so the author on the ADSL access to a simple explanation. Now buy most of the ADSL cat has routing function (many times when the factory will be the route of the ship, because most of the telecom installation is not enabled routing function, enable DHCP, open ADSL routing function), if the individual Internet or a few of the few through the ADSL itself can be, If you have more computers you just need to buy one or more hubs or switches.
In view of the fact that the price of hubs and switches is very small and is not a special cause, please purchase a switch. There is no need to pursue high prices, because today's product homogeneity is very serious, my cheapest switch now has no problem.
To give you a reference, I suggest you buy a 8-port to meet the expansion of demand, the general price of about 100 yuan. Connect the switch and all the computers will be connected to the switch. The only thing left to do is to plug each machine's network cable into the switch's interface and plug the cat's network cable into the uplink interface. Then set the routing function, DHCP and so on, you can share the Internet.
Read the above explanation readers should have some understanding of the switches, hubs, routers, the current use of mainly switches, routers, the combination of the use of specific methods can be based on specific network conditions and needs to determine.