Repeater, router, hub, and bridge

Source: Internet
Author: User

1: first, these devices all work at different levels, such:

2: physical layer device:

Repeater or repeater: works on the physical layer. It is a simulated device used to connect two cable segments. The attenuation signal of one line is amplified, restored, and placed on another line, A repeater does not care about the concepts of frames, groups, and headers. It only understands the voltage value.

Hub: Working physical layer. The Hub has many input lines. It connects these input lines, and frames that arrive on any line are sent to all other lines. If two frames arrive at the same time, a conflict will occur. In other words, the entire hub forms a conflict domain (the conflict domain: In a LAN consisting of a hub, only one machine can send data at any time. Otherwise, a conflict may occur .) All lines connected to the same hub must run at the same speed. Different from a repeater, a hub does not zoom in on the signal and can accommodate multiple line cards. Each line card has multiple inputs. The difference between the two is not significant for the first time.

3: data link layer device

Bridge: The bridge works on the data link layer to connect two or more LANs. When a frame arrives, the software inside the bridge extracts the address of the target host from the frame header, then, find the address in a forwarding table, and you have determined where the frame should be sent. For Ethernet, the destination host address is a 48-bit MAC address. Like a hub, modern bridges are also wired. Each line card usually supports four or eight input lines of a specific type. Note: line cards for Ethernet cannot process the frames of the ring because they do not know where to find the destination address from the frame header. However, a bridge can have multiple line cards, each of which is applicable to different network types and different speeds. In a bridge, each line has its own conflict domain, which is different from the hub. The bridge also provides the storage and forwarding function.

Vswitch: working data link layer. Similar to bridges, they all route based on the frame address. Or you can think of a switch as a multi-port bridge. The main difference is that a switch is often used to connect to an independent computer, rather than a LAN.

Therefore, when host a in Figure 1 wants to send a frame to host B, after the bridge gets the frame, it only discards it. On the contrary, in Figure 2, the switch must actively send frames from host a to host B, because there is no other way (PATH) to complete Frame Forwarding from host a to host B. Because each port of a switch is usually connected to a computer, the switch must have enough space to accommodate more line cards than the bridge. After all, the bridge is designed to connect to the LAN. At the same time, each line card must provide a buffer space (that is, it has the storage-forwarding function) to cache the frames reached on its port. Because each port has its own conflict domain, the switch will never lose frames due to the conflict. However, if the frame arrival speed exceeds the forwarding speed of these frames, the switch may use up the buffer space and have to start frame drop.

4: network layer devices

Router: when a group enters the network layer, both the frame header and the frame end are stripped. The routing software selects an output line based on the header information of the IP Group.

5: Transmission Gateway

The transport gateway works on the transport layer. It connects two computers that use different connection transmission protocols. For example, assume that one computer uses the connection-oriented TCP/IP protocol, and the other uses the connection-oriented ATM Transport Protocol. Now they need to call, as a result, the transport gateway can copy a group from one connection to another and reformat the group as needed.

6: Application Gateway

The application gateway works at the application layer. It mainly understands the data format and content, and translates messages from one format to another. For example, the email Protocol Gateway translates Internet messages into SMS messages of mobile phones.

Layer-1 device: repeater, Hub)

Network devices are divided by layer, and each layer of devices has the function and characteristics of dropping. Therefore, it is easy to layer the device memory. The next time someone else talks about which device is a layer drop, you will soon be able to know what the device is. However, the function is not limited to the layer where the device is located. For example, there is a ping on the vro, and Ping is an Application Layer Program. Can you say that the router is a layer-7 device? This is not the case. These are only auxiliary functions, and the main functions are concentrated on three layers. The main function of a layer-1 device is to enlarge and shaping signals. We can think that the device is just like a cable. However, this cable is capable of signal drops amplification and shaping drops.

All devices share the same bus. That is to say, all data is sent to this bus. Suppose the machine on the top left needs to send a data to the machine below. The data is transmitted to both ends of the bus, so that all devices on the bus will receive the data. However, only the following machines will process the data. This means that in a bus network, as long as one device occupies the bus, there is no way to transmit the other drops of data. What if other devices transmit data? At this time, it will conflict with the drib data being transmitted on the master line, and the two data will be damaged after the collision.

All the devices that are connected to the same bus are called conflicting regions. Therefore, a mechanism is required to avoid such conflicts and improve the accuracy of data drops. The destination IP address and destination MAC address are included in the network. The content displayed on the top right is different from the IP address and MAC address, and the data is not processed. In a bus-type network, CSMA/CD is used to avoid conflict.

Add: Both of them send data at the same time. Conflicts still occur. What should I do if there is a conflict? This is Cd = conflict detection. All devices that are connected to the Hub may conflict with each other. And these devices can only work in half-duplex mode. The reason why I cannot work in full duplex mode is that there is a two-way transmission method for the drib machine on the bus network.

Carrier Sense Multiple Access with Collision Detection (CSMA/CD)

Ethernet uses the CSMA/CD technology, which is called a carrier listener with conflict detection. this is a friendly session method. for example, you have something to say, but you are very polite to hear whether someone else is talking (Carrier Sense). If someone is talking, you will wait for him to finish speaking, you start to talk. If no one talks, you start to talk. but what if two people talk at the same time? If two people speak at the same time, once both parties hear the words of collision detection, they will stop talking.
I waited for a random period of time, and one of them began to talk again, and the other one continued after he finished speaking. So there will be no conflict? No. Because if two PCs listen to the network at the same time, neither of them transmits data at the same time. Conflicts still occur. What should I do if there is a conflict? At this time, the two data will be rolled back and wait for a random drop time to listen on the network again. Note that it is not a certain time drop. Because if it takes a certain amount of time, the two will send data at the same time, or conflict will occur. So it is waiting for a random drop time.

L2 device: bridge and switch)

Let's talk about the main differences between the two devices. There are three main differences: 1. The bridge is implemented by software, and the switch is implemented by ASIC hardware. Therefore, the efficiency of vswitch drop Forwarding is much faster than that of the bridge. 2. The bridge supports a maximum of 16 ports, and the switch can be supported infinitely in theory. 3. There are many types of bridges, and the switch only implements one function, that is, transparent bridges. For a layer-2 device, the drop-down function is to recognize layer-2 addresses (there are many types of layer-2 addresses, which can be understood as MAC addresses at this stage ). The advantage of Layer 2 address drops is that data is not received from a port like a hub and forwarded to all ports. A layer-2 device can connect to the drop-down device MAC address on a learning port. Therefore, the data will be forwarded based on the drop MAC address information learned from the second-layer device.

It is precisely because of the MAC address table that conflicts are fully avoided because the switch knows the port to which the data should be forwarded through the destination MAC address. Instead of forwarding to all drop ports like the hub. Therefore, a vswitch can divide conflicting domain drops. Because of the conflict, the network transmission efficiency is reduced. Therefore, it is necessary to divide multiple conflicting domains and reduce the scope of conflicting domains.
Each port of a vswitch is a conflict domain. It means that the device that drops on the switch port may conflict in this range. But it will never conflict with other port drop devices on the vswitch.

L3 devices: L3 switches and routers)

Let's talk about the difference between the two drops: 1. There are more layer-3 switch ports than routers. However, layer-3 switches only have fast Ethernet ports and gibit Ethernet ports, which are not as diverse as vro interfaces. 2. The drop-down routing function of a layer-3 switch is completed by adding a routing module on the layer-2 switch. Only one ASIC card. Therefore, the layer-3 processing capability is inferior to that of the router (not the forwarding capability ).

One of the more prominent features of a layer-3 device than a layer-2 device is the ability to isolate broadcast domains. On layer-1 and layer-2 devices, broadcast is sent to all drop ports, except the send broadcast drop ports. This function is implemented by dropping data from a route table. This is similar to the drop MAC address table in the vswitch. However, the drop-down list shows the IP address information. Unlike a vswitch, A vro can be used normally if the vswitch is not configured. Vro must be configured with drops. At least one IP address must be configured for each interface to work properly. Remember, the IP address drop of each interface on the vro cannot be in the same CIDR Block (note the IP address drop first, and you will understand the concept of CIDR block after talking about the IP address ).
Broadcast is not capable of forwarding from one end to the other through the router drop interface (strictly speaking, this is an error, but there are more errors at this stage, so for the time being, the vro can isolate all broadcasts ). In this way, we can isolate broadcast domains by using vrouters. Because many protocols implement drops Based on broadcast (such as ARP and DHCP), the performance of network drops may also be affected if more broadcasts exist in the network. It is also necessary to isolate broadcast domains. Yes, but not forwarded. Because drops are broadcast in the same CIDR block, all drops of devices in This CIDR block must be processed. layer-3 Switch interfaces are divided into two types: switchport and routed port. By default, all drops are switchport. Switchport can only configure VLAN information and trunk information. The IP address cannot be configured.

First, let's talk about connection orientation and no connection. Connection-oriented drop means that a logical drop connection channel is established between the source and destination before data is transmitted. All the data to be transferred later will be transmitted from this logical connection. No connection drops mean yes, A is the source, and E is the purpose. For connection-oriented transmission, a logical drop path will be negotiated before transmission. For example, take the A-C-D-E route. Then all data will be transferred to the destination through this route. If there is no connection, then each packet can take any route. For example, the first packet goes through the A-B-E path, and the second may go through the A-E path.
What is reliability? Reliability means there is a validation mechanism. If the drop data packet is not confirmed, the source will actively resend the packet. In this way, the packet must have reached the peer end. Unreliable is the absence of such validation mechanisms. If a transfer error occurs, some packets do not arrive. Peer, You need to rely on the upper-layer drop protocol or applications to solve the problem of re-transmission.

TCP is designed for reliable connection transmission. Therefore, TCP transmission is highly reliable but inefficient. UDP is non-connection and unreliable transmission, so UDP may have errors, but the efficiency will be relatively high. Now the network line is highly reliable and error-prone. Therefore, UDP is a good choice for applications with high latency requirements. Currently, both video and voice are based on UDP protocol.

Recently, many people are asking what the vswitch, hub, and router are, what are their functions, and what are their differences. I will give some simple answers to these questions.
First, the hub, that is, the hub. Its function can be simply understood as connecting some machines to form a LAN. The switch (also known as the switch-type hub) works basically the same as the hub. However, there is a difference between the two in terms of performance: the hub uses the shared bandwidth method, while the switch is the exclusive bandwidth. In this way, when there are many machines or a large amount of data, the two will be obvious. A vro differs significantly from the preceding two. Its function is to connect different CIDR blocks and find the most suitable path for data transmission in the network. In general, individual users have little need. A vro is generated after a vswitch, just as a vswitch is generated after a hub. Therefore, the vro and vswitch are also associated, and they are not completely independent of each other. Vro mainly overcomes the problem that vswitches cannot route and forward data packets.

In general, the main difference between a vro and a vswitch lies in the following aspects:

(1) different levels of work

The original switch was working on the data link layer of the OSI/RM open architecture, that is, the second layer. At the beginning, the router was designed to work on the network layer of the OSI model. Because the switch operates on the second layer (data link layer) of OSI, its working principle is relatively simple, while the router works on the third layer (Network Layer) of OSI ), more protocol information can be obtained, and routers can make more intelligent forwarding decisions.

(2) Data Forwarding depends on different objects

A vswitch uses a physical address or a MAC address to determine the destination address for data forwarding. A vro uses the idnumber (IP address) of different networks to determine the data forwarding address. IP addresses are implemented in software and describe the network where the device is located. Sometimes these layer-3 addresses are also called protocol addresses or network addresses. The MAC address is usually provided by the hardware and allocated by the NIC manufacturer, and has been fixed to the NIC. Generally, it cannot be changed. The IP address is usually automatically assigned by the network administrator or the system.

(3) Traditional vswitches can only be divided into conflicting domains, but not broadcast domains. vrouters can be divided into broadcast domains.

The CIDR Block connected by the vswitch still belongs to the same broadcast domain. broadcast packets are transmitted across all CIDR blocks connected to the vswitch. In some cases, communication congestion and security vulnerabilities may occur. The CIDR blocks connected to the vro are allocated to different broadcast domains, and the broadcast data does not pass through the vro. Although vswitches above Layer 3 Have VLAN functions and can also be divided into broadcast domains, communication between subbroadcast domains is not allowed, and communication between them still requires routers.

(4) The router provides firewall services.

A vro only forwards data packets of a specific address. It does not support packet transmission through the routing protocol or unknown destination network, thus preventing broadcast storms.

The switch is generally used for the LAN-WAN connection, the switch belongs to the bridge, is the data link layer equipment, some switches can also realize the third layer of the exchange. A vro is used for Wan-WAN connections. It can resolve forwarding groups between different networks and act on the network layer. They only accept the input group from one line and then forward it to another line. These two lines may belong to different networks and adopt different protocols. In comparison, vro features more powerful than vswitches, but the speed is relatively slow and expensive. layer-3 vswitches have both the ability to forward packets at the wire speed of vswitches and the good control function of vrouters, therefore, it is widely used.

At present, I am personally using ADSL for many broadband access methods. Therefore, I will give a brief description of the access to ADSL. Most of the purchased ADSL cats have the routing function (in many cases, the routing function is blocked when the manufacturer leaves the factory, because the routing function is not enabled during Telecom installation and DHCP is enabled. Enable the ADSL routing function). If an individual accesses the Internet or a few computers pass through ADSL, you only need to purchase one or more hubs or switches if the computer is large. Please purchase a vswitch because the price difference between the hub and the vswitch is very small. There is no need to pursue high prices, because product homogeneity is very serious today, and there is no problem with my cheapest switch. We recommend that you purchase an eight-port service to meet the expansion requirements. The general price is about 100 yuan. Connect all the computers to the vswitch. The only thing to do is to insert the network cable of each machine into the interface of the switch and insert the cat network cable into the uplink interface. Then set the routing function, DHCP, and so on,
Then you can share the internet.

After reading the above explanation, you should have some knowledge about vswitches, hubs, and vrouters. The current usage is mainly based on the combination of vswitches and vrouters, the specific combination method can be determined based on the specific network conditions and requirements.

 

A switch is a layer 2 (data link layer) device in the OSI model. It has low-end, middle-end, and high-end products. The low-end products are pure Layer 2 devices, and the middle-end devices have three-layer functions, the main functions of a vswitch are as follows:

1. address learning (MAC address)
2. Information forwarding and filtering

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.