2. Switch: a device with exclusive bandwidth, which enables multiple computers to access the Internet or form a local area network by using one access interface at the same time.
Basic functions of the switch:
1. Like hubs, switches provide a large number of ports for cable connections, so a star topology can be used for wiring.
2. Like repeaters, hubs and bridges, when it forwards a frame, the switch will regenerate an undistorted square wave electric signal.
3. Like a bridge, a switch uses the same forwarding or filtering logic on each port.
4. The switch is like a bridge, which divides the local area network into multiple conflict domains, and each conflict domain has an independent broadband, thus greatly improving the bandwidth of the local area network.
In addition to the functions of bridges, hubs and repeaters, switches also provide more advanced functions, such as virtual local area network (VLAN) and higher performance. [3]
3. Router: Without any settings, it is just a switch. If set up, it can have many functions, such as routing, dialing, firewall, DHCP server and so on.
The difference between a switch and a hub is 1. From the perspective of OSI architecture, hubs belong to the first physical layer equipment of OSI, while switches belong to the second data link layer equipment of OSI. That is to say, the hub only plays the role of synchronization, amplification and shaping in data transmission, and cannot effectively deal with short frames = fragments in data transmission, and cannot guarantee the integrity and correctness of data transmission; The switch can not only synchronize, amplify and shape data transmission, but also filter short frames and fragments.
2. In terms of working mode, hub is a broadcast mode, that is to say, when one port of hub works, all other ports can receive information, which is prone to broadcast storm, and the network performance will be greatly affected when the network is large; Switch can avoid this phenomenon. When the switch works, only the request port and the destination port respond to each other without affecting other ports, so the switch can isolate the collision domain and effectively suppress the broadcast storm.
3. From the bandwidth point of view, no matter how many ports the hub has, all ports * * * enjoy a bandwidth, only two ports can transmit data at the same time, other ports can only wait, and the hub can only work in half-duplex mode; For the switch, each port has its own bandwidth, and when two ports work, it will not affect the work of other ports. At the same time, the switch can work not only in half-duplex mode, but also in full-duplex mode.
The difference between switch and router The traditional switch is developed from the bridge and belongs to the second layer of OSI, that is, the data link layer equipment. It addresses according to the MAC address, selects the route through the station table, and the establishment and maintenance of the station table is automatically carried out by the switch. Routers belong to the third layer of OSI, that is, network layer devices. It is addressed according to IP address and generated by routing table routing protocol. The biggest advantage of the switch is its high speed. Because the switch only needs to identify the MAC address in the frame and directly generate and select the forwarding port according to the MAC address, the algorithm is simple and easy to implement in ASIC, so the forwarding speed is extremely high.