Hub, switch, router differences

Source: Internet
Author: User

The hub works on the first layer of the OSI model, the "physical layer". A hub is a hardware-only network underlying device that itself does not recognize the destination address, so it does not target the data when it sends it, but sends it by means of a broadcast. This means that when it sends data to a node in the network, it sends the data to all nodes connected to the hub instead of sending the data directly to the destination node, and receives the packet's node parsing packet header to determine if it is received.

The switch works on the second layer of the OSI model, the "Data Link layer". The switch implements data transfer within the same network. The switch can learn the MAC address and store it in the internal Address table, and when sending data to the destination node, if the destination node MAC address is in the Address table, the packet is routed directly to the destination node. Broadcasts to all ports only if the destination node MAC address is not in the Address table, and the switch logs the new address to the Address table when the receive Port responds. At the same time, each port of the switch has bandwidth alone and will be set up with a 10Mbps Ethernet switch, then the total traffic for the switch equals 2*10=20mbps.     If the 10Mbps hub, the total flow will not exceed 10Mbps. Routers work in the third layer of the OSI model, the "Network layer". Routers provide a path between different networks and store and forward packets. A routing table is maintained at all times in the router, and all messages are sent and forwarded by locating the routing table. The router chooses the best path based on the destination to which the packet is destined to send the packet to the next router that can reach the destination. The next time a router receives the packet, it also looks at its destination address and continues to be routed to the rear router using the appropriate path. Technical notes involved: (1) switch MAC address learning    There is an address table inside the switch that indicates the correspondence between the MAC address and the switch port. When the switch receives a packet from a port, it first reads the source MAC address in the header so that it knows which port the source MAC address is attached to, and then reads the destination MAC address in the header and finds the appropriate port in the Address table, if the table has a port corresponding to that destination MAC address.    The packet is copied directly to the port, if the table can not find the corresponding port to broadcast the packet to all ports, when the destination machine responds to the source machine, the switch may learn the destination MAC address and which port corresponding to the next time the data transfer will not need to broadcast all the ports. (2) Router data forwarding process there is a routing table inside the router, which indicates where the next step should go if you want to go somewhere. The router receives a packet from a port, it first removes the header of the link layer (unpacking), reads the destination IP address, and then looks for the routing table, and if it can determine where to send the next step, add the packet header (package) to the link layer and forward the packet; Returns a message to the source address if the next address is not determined  , and throw this packet away. Reference article: http://blog.csdn.net/maopig/article/details/6854708http://net.it168.com/a2012/0409/1334/000001334772_1.shtml

Hub, switch, router differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.