2. Logical link layer: bridges and switches. It is used to connect network segments with different physical layer specifications in the same logical network. These network segments can have different topologies and data frame formats. The ports of bridges and switches have physical addresses, but no logical addresses.
3. Network layer: router. Used to connect different logical networks. Each port of the router has a unique physical address and logical address.
4. Application layer: gateway. There is no hardware product for data communication between applications using different protocols on the Internet.
The first two belong to the lowest layer of OSI and TCP/IP models, that is, the physical layer, which plays the role of digital signal amplification and transit.
Repeater, an interconnection device used to extend the network distance. The interconnection length of a local area network is limited, not infinite. For example, in 10M Ethernet, the transmission path allowed by any two data terminal devices consists of at most 5 repeaters and 4 repeaters). Repeater can enhance the attenuated signal on the line. It can connect the same transmission medium at both ends, or different media at both ends, such as coaxial cable at one end and twisted pair at the other end.
HUB is actually a multi-port repeater, which has one port connected to the backbone network and multiple ports connected to a group of workstations. It is used in a star topology network to connect multiple computers or network devices. Hubs are divided into: 1 active, 2 passive and 3 mixed. 1 kinetic energy formula: It can regenerate and amplify the signal on the connected network medium, so that the length of the connected medium reaches the maximum effective length, and it needs power to work. At present, most hubs are of this type. Passive only plays the role of connector, and can work without power supply, which is rare in the market. 3 hybrid: it can connect various types of cables, such as coaxial cable and twisted pair.
HUB is a * * * shared device, and the HUB itself cannot identify the destination address. When host A in the same local area network sends data to host B, the data packet is sent by 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. That is to say, in this working mode, only one set of data frame communication can be transmitted on the network at the same time, and if there is a conflict, it will have to be retried. This way is to enjoy the network bandwidth.
Bridges and switches belong to the second layer of OSI and TCP/IP, namely the data link layer. The functions of data link layer include the establishment, maintenance and deletion of data link, frame encapsulation, frame transmission, frame synchronization, frame error control and flow control.
The bridge works at the data link layer, connects two LANs, and forwards frames according to the MAC address (physical address), which can be regarded as the "bottom router" (the router works at the network layer and forwards according to the network address such as IP address). It can effectively connect two LANs, limit local communication to this network segment, and forward corresponding signals to another network segment. Bridges are usually used to connect a small number of network segments of the same type.
Bridges usually include transparent bridges and source routing bridges.
1, transparent bridge
Simply put, the use of this bridge does not need to change the hardware and software, do not need to set the address switch, and do not need to load the routing table or parameters. As long as the cable is plugged in, the operation of the existing LAN is completely unaffected by the bridge.
2. Source routing bridge
The core idea of source routing is to assume that the sender of each frame knows whether the receiver is on the same local area network (LAN). When sending a frame to another network segment, the source machine sets the high order of the destination address to 1 as a mark. In addition, it will add the actual path that the frame should take in the frame header.
A switch is a general technical term for sending information to the corresponding qualified route through manual or automatic equipment according to the needs of information transmission at both ends of communication. Generalized switch is a device that completes information exchange function in communication system.
In the computer network system, the concept of exchange is an improvement of the working mode of * * *.
The switch has a high bandwidth back-end bus and an internal switching matrix. All ports of the switch are connected to this standby bus. After the control circuit receives the data packet, the processing port will look up the address table in the memory to determine which port the NIC (network card) of the destination MAC (hardware address of the network card) is connected to, and quickly transmit the data packet to the destination port through the internal switching matrix. If the destination MAC does not exist, it will be broadcast to all ports. After receiving the port response, the switch will "learn" the new address and add it to the internal address table.
Switches can also be used to "segment" the network. By referring to the address table, the switch only allows necessary network traffic to pass through the switch. Filtering and forwarding through the switch can effectively isolate the broadcast storm, reduce the occurrence of wrong packets and wrong packets, and avoid sharing conflicts.
In a word, the switch is a network device based on MAC address recognition, which can complete the function of encapsulating and forwarding data packets. Switches can "learn" MAC addresses and store them in the internal address table. By establishing a temporary switching path between the initiator and the target receiver of the data frame, the data frame can reach the destination address directly from the source address.
In fact, the predecessor of SWITCH is the bridge. Switches use hardware to complete the filtering, learning and forwarding tasks that bridges used software to complete in the past. A switch is faster than a hub because the hub doesn't know where the destination address is, and it sends data to all ports. There is a routing table in the switch. If it knows where the destination address is, it sends the data to the designated place, if not, it sends the data to all ports. Such filtering helps to reduce the data transmission of the whole network and improve the efficiency. However, the function of the switch is not limited to this. It can divide the network into network branches, divide the network data flow and isolate the faults in the branches, thus reducing the data flow of each network branch, making each network more effective and improving the efficiency of the whole network. At present, there is a trend to replace hubs with switches.
Routers are located at the network layer and are used to connect multiple logically separated networks and multiple networks with different protocols and architectures. When one subnet transmits data to another subnet, it can be done through a router. It has the functions of judging network address and selecting path, filtering and separating network information flow. On the one hand, it can span different physical network types (DDN, FDDI, Ethernet, etc. ), on the other hand, logically divide the whole internet into logically independent network units, so that the network has a certain logical structure.
Routers play different roles for networks of different sizes:
1. On the backbone network, the main function of the router is routing. Routers on the backbone network must know the path to all subordinate networks. This requires maintaining a huge routing table and responding to changes in connection status as soon as possible. The failure of the router will lead to serious information transmission problems.
2. In the local area network, the main function of the router is network connection and routing, that is, it connects all the grass-roots network units at lower levels-campus network, and is also responsible for data forwarding between lower-level networks.
3. In the campus network, the main function of the router is to separate subnets. In the early days, the basic unit of Internet was local area network (LAN), in which all hosts were in the same logical network. With the continuous expansion of the network scale, the local area network has developed into a campus network consisting of a high-speed backbone and several subnets connected by routers. Among them, each subnet is logically independent, and the router is the only device that can separate them. Responsible for message forwarding and broadcast isolation between subnets, and the router on the border is responsible for connecting with the upper network.