I. Hub
1. What is a hub?
Before you know about hubs, you must know about repeaters. In the network we come into contact with, the simplest thing is that two computers form a "two-computer interconnection" through two network cards, and unshielded twisted pair is generally used as the signal line between the two network cards. Because the signal power of twisted pair will gradually decay when transmitting signals, when the signal decays to a certain extent, it will cause signal distortion, so the maximum transmission distance of twisted pair is 100 meters on the premise of ensuring signal quality. When the distance between two computers exceeds 100 meters, in order to realize the interconnection between the two computers, a "repeater" is installed between the two computers, whose function is to sort out the signals with incomplete attenuation, regenerate the complete signals, and then continue to transmit.
Repeater is the predecessor of ordinary hub, and hub is actually a multi-port repeater. Hubs generally have 4, 8, 16, 24 and 32 RJ45 interfaces. Through these interfaces, hubs can complete the "relay" function for a corresponding number of computers. Because it is in the "center" position in the network, the hub is also called "hub".
2. The working principle of the wheel hub
The working principle of the hub is very simple. Take Figure 2 as an example. In the figure, it is a hub with 8 ports and * * * connects 8 computers. The hub is in the center of the network, and the signal is forwarded through the hub, so that eight computers can be interconnected. The specific communication process is as follows: If 1 computer wants to send a message to No.8 computer, when the network card of 1 computer sends a message to hub through twisted pair, hub will not directly send a message to No.8 computer, but "broadcast" the message to eight ports at the same time. When computers on eight ports receive the broadcast message, they will check the message. If you find that the message is addressed to yourself, because the message was sent to computer 8 by computer 1, eventually computer 8 will receive the message, while the other seven computers will not receive the message because it is not their own.
3. Features of the hub
1)*** Enjoy the bandwidth.
The bandwidth of a hub refers to the maximum speed it can reach when communicating. There are mainly three kinds of hubs used in small and medium-sized LANs in the market: 10Mbps, 100Mbps, 100/ 100 Mbps adaptive.
The maximum transmission speed of a hub with a bandwidth of 10Mb is 10Mbps. Even if the connected computer uses 100Mbps network card, the data transmission speed is still only 10Mbps. 10/ 100Mbps adaptive hub can automatically adjust the bandwidth according to the speed of the network card connected to the port. When connecting 10Mbps network card, its bandwidth is100 MB; When connecting 100Mbps network card, its bandwidth is 100Mb, so this kind of hub is also called "two-speed hub".
Hub is a "* * *" device, and the hub itself cannot recognize the destination address. When host A in the same local area network sends data to host B, the data packet is broadcast on the network based on hub, and each terminal decides whether to receive it by verifying the address information of the data packet header.
Because the hub can only transmit a set of information in a clock cycle, if a hub is connected to a large number of machines, many machines often need to communicate at the same time, which will lead to poor work efficiency of the hub, such as information congestion and collision.
Why is this happening? Take fig. 2 for example. When computer 1 is sending information to computer 8 through hub, if computer 2 also wants to send information to computer 7 through hub at this time, when it tries to contact hub, it finds that hub is busy with computer 1, so computer 2 will "stand in front of hub with data" and keep asking hub to stop the work of computer 1 to help itself. If computer 2 successfully "grabs" the hub (because the hub is "* * *", it is easy to grab), the data of computer 1 in the transmission state will stop, so computer 1 will also "grab" the hub. ...
It can be seen that the real speed of each port on the hub is not only related to the bandwidth of the hub, but also related to the number of devices working at the same time. For example, eight computers are connected to a hub with a bandwidth of 10Mb. When these eight computers work at the same time, the real bandwidth of each computer is 10/8= 1.25Mb!
2 Half duplex
Let's talk about full duplex: when two devices send and receive data, both parties can send or receive at the same time. This transmission mode is full duplex. However, in the half-duplex transmission mode, when one device is sending data, the other device can only receive data, but cannot send its own data at the same time.
Because the hub transmits information by "broadcasting", the hub can only work in half-duplex state when transmitting data. For example, computer 1 and computer 8 need to transmit some data to each other. When computer 1 is transmitting data, computer 8 can only receive the data sent by computer 1. Only when 1 computer stops sending and is ready to receive can it send its own information to.
Second, the switch
1. What is a switch?
Switches, also known as switching hubs, regenerate information after internal processing and forward it to designated ports. They have the ability of automatic addressing and switching. Because the switch sends each packet from the source port to the destination port independently according to the destination address of the transmitted packet, it avoids the conflict with other ports. Generalized switch is a device that completes information exchange function in communication system.
2. The working principle of the switch
In the computer network system, the switch is introduced for the weakness that * * * enjoys the working mode. Hub is the representative of * * * working mode. If the hub is compared to the postman, then the postman is a "fool" who can't read-he doesn't know how to send the letter directly to the recipient according to the address on the letter, but only distributes the letter to all those who have the letter, and then lets the recipient judge whether it is his own according to the address information! The switch is an "intelligent" postman-the switch has a high-bandwidth back bus and an internal switching matrix. All ports of the switch are hung on this back bus. When the control circuit receives the data packet, the processing port will look up the address table in the memory, determine which port the NIC (network card) of the destination MAC (hardware address of the network card) hangs on, and quickly send the data packet to the destination port through the internal switching matrix. If the destination MAC does not exist, the switch will broadcast to all ports. After receiving the port response, the switch will "learn" the new address and add it to the internal address table.
It can be seen that when the switch receives the "letter" from the network card, it will quickly send the letter to the recipient according to the above address information and the "permanent residence book" it has mastered. In case the recipient's address is not in the "account book", the switch will distribute the letter to everyone like a hub and then find the recipient. Once the recipient is found, the Exchange will immediately register his information in the "account book" so that the letter can be delivered quickly when serving customers in the future.
3. Performance characteristics of the switch
1) exclusive bandwidth
Because the switch can intelligently send data to the destination according to the address information, it will not "disturb" those non-receivers when transmitting data like the hub. In this way, the switch can transmit data between multiple port groups at the same time. Moreover, each port can be regarded as an independent network segment, and both communication parties enjoy all the bandwidth independently and do not compete with other devices. For example, when host A sends data to host D, host B can send data to host C at the same time, and both transmissions enjoy the full bandwidth of the network-assuming that the switch of 10Mb is used at this time, the total traffic of the switch at this time is equal to 2× 10Mb=20Mb.
2) Full duplex
When two ports on a switch communicate, because the channels between them are relatively independent, full duplex communication can be realized.
Third, the difference between hubs and switches.
In terms of working principle, switches and hubs are quite different. First of all, from the perspective of OSI architecture, hubs belong to the first layer physical layer equipment of OSI, while switches belong to the second layer data link layer equipment of OSI.
Secondly, in terms of working mode, hub adopts "broadcast" mode, which is prone to "broadcast storm" and its performance will be greatly affected when the network is large. 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 to some extent and effectively suppress the occurrence of "broadcast storm".
In addition, in terms of bandwidth, no matter how many ports the hub has, all ports share a bandwidth, only two ports can transmit data at the same time, and 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.
If you describe the difference between a switch and a hub in the simplest language, it should be the difference between intelligent and non-intelligent. To put it bluntly, a hub is a network device that connects multiple computers. It can only play the role of signal amplification and transmission, and cannot deal with the fragments in the signal, so it is easy to make mistakes in the transmission process. A switch can be regarded as an intelligent hub, which not only has all the characteristics of a hub, but also has the functions of automatic addressing, switching and processing. Moreover, in the process of data transmission, the sender and receiver work independently and have nothing to do with other ports, thus achieving the purpose of preventing data loss and improving throughput.
Fourth, the router
1. The role of the router
Through hubs or switches, we can combine many computers into a larger LAN (Figure 3), but when the number of machines reaches a certain number, the problem comes: for a LAN composed of hubs, due to the "broadcast" working mode, when the network is large, the collision and congestion of information in the transmission process will become more and more serious, even for switches. Secondly, this kind of LAN is not safe and is not conducive to management.
In order to solve these problems, people divide a large network into small subnets and segments, or directly divide it into several VLANs (virtual local area networks). In a VLAN, information sent by one host can only be sent to other hosts with the same VLAN number, and members of other VLANs cannot receive these information or broadcast frames. After using VLAN to divide the network, it can effectively suppress the broadcast storm on the network, increase the security of the network, and centralize management and control (Figure 4).
Since it is a local area network, what should hosts of different VLAN do if they need to communicate with each other? At this time, you have to help through the router (router). Routers can connect computers with different subnets, network segments and VLAN and let them communicate freely. In addition, we all know that there are many types of networks, and different networks use different protocols and speeds. When two networks with different structures need to be interconnected, they can also be realized through routers. Routers can connect two LAN segments with similar or different architectures to form a larger LAN or WAN.
It can be seen that a router is a network device that connects multiple networks or network segments. It can "translate" data information between different networks, network segments or VLAN so that they can "read" each other's data, thus forming a larger network.
2. The working principle of the router
The so-called routing refers to the activity of moving information from the source location to the target location through the Internet. So how does the router translate it? When we study and translate English at ordinary times, we will certainly prepare an English-Chinese dictionary, and realize the co-occurrence conversion between English and Chinese through the dictionary. For routers, it also has this dictionary for converting path tables. The routing table stores relevant data of various transmission paths, such as the identification information of subnets, the number of routers on the network and the name of the next router. The path table can be fixed by the system administrator, dynamically modified by the system, automatically adjusted by the router or controlled by the host.
Different subnets and network segments can be interconnected by routers. Therefore, unlike hubs and switches, routers are generally installed on the "backbone" of the network, rather than working at the grassroots level like hubs and switches. For example, a large-scale enterprise LAN, based on management, security and performance considerations, will generally divide the whole network into multiple VLANs. Therefore, when communicating between VLANs, a router must be used.
For this enterprise network, networking is definitely needed. For enterprises, it is usually through renting DDN lines of telecommunications or using ADSL, Cable and ISDN to access the Internet. At this time, due to the different network systems and protocols used, routers are also needed to complete the interconnection between the enterprise network and the Internet.
Click to enlarge
Generally speaking, in the routing process, information will pass through at least one or more intermediate nodes. Usually, people compare routing and switching, mainly because in the eyes of ordinary users, their functions are exactly the same. In fact, the main difference between routing and switching is that switching takes place at the second layer (data link layer) of the OSI reference model, while routing takes place at the third layer, namely the network layer. This difference determines that routing and switching need to use different control information in the process of moving information, so the ways to realize their respective functions are also different. Routers decide the forwarding of data through routing. The forwarding policy is called routing, which is also the origin of the router name.
Comparison of three musketeers's appearance
We have explained how hubs, switches and routers work, but for many beginners, it is sometimes desirable to distinguish them from each other in appearance. Of course, hubs, switches and routers are definitely different in appearance, but these are often only used as reference information. After all, many hub, switch and router products are very similar in appearance. The most difficult thing to distinguish is the common desktop hub and switch, while the router is relatively easy to identify.
1. Appearance differences between hubs and switches.
1) Appearance of the wheel hub
The structure of the hub is relatively simple, so the hub is generally small: there are generally 8, 16, 24 and 32 RJ45 interfaces on the interface panel.
Since the maximum number of interfaces in a single hub is generally 32, what should I do if I want to connect 50 or even 100 hosts? The appearance of "upstream" cascade ports on hubs solves this problem-through cascade ports, multiple hubs can be connected together, and the number of interfaces and connection distance of hubs can be expanded, but only four hubs can be cascaded at most.
Corresponding to the interface is one or two rows of indicator lights marked with numbers on the panel to indicate the working state of the hub. Among them, "motivation" is the motivation indicator, and the indicators marked with numbers are "link" and "action". When a correct signal is connected to an RJ45 interface, the "Link" light of the interface is always on, and when a signal is sent, the "Action" light flashes. Hub generally combines "link" and "action" indicators into one, and completes the work of "link" and "action" with one indicator.
Click to enlarge
2) Appearance of the switch
According to the application scope, the switch has many appearances. For example, some switches used for trunk lines often adopt a "modular" integration mode, and users can enhance the functions of the switches by purchasing or adding modules. This kind of switch is generally used in large enterprises and has a large volume.
For those desktop switches used in small LAN, their appearance is very similar to that of ordinary hubs. In order to distinguish them in appearance, except the difference between "hub" and "switch" on the nameplate, the key is the indicator light: most of the current switches are 10/ 100Mbps adaptive switches, so their panels are generally used to indicate that the ports are working at 10Mbps. In addition, the switch can work in both full-duplex and half-duplex state, so there is usually a row of "FDX/COL" or "FD/COL" indicator lights on its panel.
Click to enlarge
Where "FDX" or "FD" is the abbreviation of "full duplex", when a port on the switch works at full duplex, its corresponding "FDX" indicator light will be on, otherwise the port works at half duplex; "COL" is an indicator of information conflict. When the data transmitted by this port collides, the indicator light will blink, and the more serious the collision, the more severe the flicker.
For hubs, although some hubs with adaptive 10/ 100Mbps also have indicators to indicate whether they are working at 10Mbps or 100Mbps, there is absolutely no "FDX/COL" indicator. Beginners can distinguish hubs from switches through this.
2. Composition and appearance of the router
1) router.
As an advanced network equipment, router is not accessible to everyone, because its popularity is not as high as that of hubs and switches.
When hubs and switches work, they directly transmit signals through hardware, while routers are different. In fact, the router is a special computer with CPU, storage medium and operating system, but these are a little different from those on the PC. Generally speaking, routers can also be divided into hardware and software. The software part is mainly the operating system. The operating systems of ordinary PC include Windows series, Linux/Unix, etc. , and the operating system of the router is IOS (Internet Working Operating System).
The hardware of the router mainly includes CPU, interface and storage medium. The CPU in the router has the same function as the CPU in the computer. Generally speaking, the CPU processing ability of a computer is better than that of a router, but some high-end routers also use CPUs with a frequency as high as 300MHz. The interface in the router is very important, because it is the most direct medium to connect the network, and its interfaces mainly include Ethernet port, serial port, FDDI, token ring and so on. There is memory and hard disk in the computer, and there is also one in the router, but the name is different; The storage media in the router mainly include ROM (read only memory), Flash (flash memory), NVROM (nonvolatile random access memory), DRAM (dynamic random access memory) and so on.
It is through its special software function that the router completes the routing work. Because this kind of professional router is expensive, people will also use ordinary PC to realize routing function in some application environments with low requirements for routers. For example, as long as Windows2000 Server is installed on a PC and the necessary configuration is made, a "router" will be built.
2) The appearance of the router
Routers mainly run on the backbone network, so the appearance is also varied. For example, Gigabit routers used in some Internet backbone lines are often modular in design and bulky.
Those small and medium-sized enterprises use smaller routers. These routers, which look like hubs and switches, have the biggest appearance that the number of ports is relatively small, but the types are diverse.
In fact, it is easy to understand that routers are mainly used to connect different types of networks. It is located at the highest level of the network. Considering the cost, its ports are definitely few, but at the same time, in order to connect various types of networks, it must have various types of network interfaces.
Buy three musketeers.
The working principle, performance characteristics and price of hubs, switches and routers are different, so when building a network platform, we should choose products scientifically according to actual needs. Of course, the shopping we are discussing here is mainly aimed at some small and medium-sized networks. For campus network and large enterprise network, because there are too many aspects involved, professional network engineers are generally needed for network design and product selection.
I. Suggestions for different users' needs
1. Ordinary home users
Generally, the number of computers in a family is limited, and the purpose of networking is generally to surf the Internet and play online games. Because the number of computers is small and the bandwidth requirement is not high, it is more appropriate to choose a hub with less than 8 ports and a bandwidth of 10Mbps. There are many such products, and the prices are also very cheap, generally between 80~ 100 yuan.
Hub is characterized by its low price, but due to the working mode of "* * * sharing bandwidth", hub is only suitable for users who are price-sensitive, with small network scale and small data transmission.
2. Student dormitory
For student dormitories, there are generally a large number of computers, and the distance between dormitories is very close, so networking is very convenient. Students generally prefer surfing the Internet, playing online games and watching videos. Through networking, the requirements for bandwidth are relatively high. In addition, students have similar schedules, and many computers often surf the Internet at the same time, so the best choice is to use a switch. The working mode of exclusive bandwidth of switches can meet the requirements of students for high bandwidth, and at the same time, it can avoid network congestion caused by simultaneous communication of multiple machines. Considering that students' financial affordability is not high, they can choose the low-end 10/ 100Mbps adaptive desktop switch made by domestic manufacturers. The number of ports should be considered according to the number of computers connected to the network, but it is best to choose the mainstream products with 16 ports. The prices of these low-end products are mostly below 700 yuan, which is affordable for students. If the number of ports is not enough, it can be solved by cascading.
Of course, we are targeting some student dormitories that require high internet speed. If there are not many computers on the Internet (below 10) and you just want to * * enjoy surfing the Internet or play some games that don't require high network speed, you can also consider using the hub of 10Mbps, but it is not recommended to use 100 Mbps. If the requirements are higher, you can look for those mini 10Mbps switches in the market. These products generally have a small number of ports and are very cheap, generally around 200 yuan.
3. Small and medium-sized office networks
For small and medium-sized office networks, if performance, stability and future expansibility are considered, it is best to choose 10/ 100Mbps adaptive switch to build a local area network. For small office networks, hubs can also be considered.
Now the office generally needs * * * to access the Internet, and now * * * enjoys ADSL access. For small and medium-sized office networks, because there is generally no professional server, if you want to enjoy surfing the Internet, you can solve the problem of * * * by configuring an ADSL router, which can save a proxy server. This ADSL router is relatively cheap, and there are many products to choose from.
Second, the hub selection criteria
1. Pay attention to the bandwidth standard.
According to the different bandwidth, the hubs used in local area networks (generally referred to as small local area networks) can be divided into 10Mbps, 100Mbps and 100 Mbps. What kind of hub to choose mainly depends on three factors: a. Bandwidth of the connecting device: If the connecting device supports IEEE802.3U, you can naturally buy a hub with 100Mbps, otherwise you can only choose100 Mbps; B. Number of stations: Since all computers connected to the hub are competing for the same uplink bus and are in the same collision domain, if there are many computers, it is best to choose the one with high bandwidth; C. application requirements.
2. Does it meet the expansion requirements?
Hubs are generally divided into 8 ports, 16 ports and 24 ports according to the number of ports. When the hub cannot provide enough ports, there are usually two ways to expand:
A. Stacking: Stacking is a method to solve the shortage of a single hub port, but since multiple hubs are stacked together and still work in the same environment, it is not advisable to stack too many layers. Some hubs in the market are selling points because they have more stacking layers than other brands. If this happens, we should realize dialectically: on the one hand, the more stackable floors, the higher the stability of the hub; On the other hand, the more stackable layers, the less bandwidth each user actually enjoys.
B. Cascading: Cascading is another method to increase the number of network users, but the use of this function is generally conditional, that is, hubs must provide cascading ports, which are often marked with the words "Uplink" or "MDI" and can be used to cascade with other hubs. If no special port is provided, the twisted pair connecting the two hubs must be connected by mistake when cascading.
3. Do you support the network management function?
According to the different management methods of HUB, it can be divided into dambhub? Sub-hub and intelligent hub? There are two kinds of smart hubs. Intelligent hub improves the shortcomings of ordinary hubs, increases the network switching function, and has the ability of network management and automatic detection of network port speed (similar to a switch). However, the sub-hub only plays the role of simple signal amplification and regeneration, and cannot optimize the network performance. The early * * * enjoyment hubs were generally not intelligent, while the popular 100Mbps hubs and1100 Mbps adaptive hubs are mostly intelligent.
4. Pay attention to the interface type
When selecting the HUB, we should also pay attention to the interface type of the signal input port. RJ-45 interface is needed when connecting with twisted pair. If connected with thin cable, BNC interface is required; AUI interface is needed and connected with thick cable; When LAN is connected over a long distance, it is also necessary to have an optical fiber interface and optical fiber connection. Early 10Mbps hubs usually had three interfaces: RJ-45, BNC and AUI. General 100Mbps hubs and 10/ 100Mbps hubs only have RJ-45 interfaces, and some also have optical fiber interfaces.
5. Pay attention to the brand and price
The high-end HUB market in the market is mainly occupied by American products, such as 3COM and Intel, with unique design. Generally, several ports are equipped with a processor, and of course the price is relatively high. The products of D-Link and Accton in Taiwan Province Province occupy the main share of the low-end market, while some mainland companies, such as Lenovo and Shida, have also launched their own products. Low-end products generally adopt single processor technology, and the design of their peripheral circuits is similar. There is not much difference in quality between brands. Relatively speaking, the prices of mainland products are much cheaper.