Electronic device and flow control method thereof
By transmitting specific pause frames between switches, the switches communicate with each other about flow control capabilities and congestion status, solving the head-of-line blocking problem and improving the efficiency of cascaded or stacked switch systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- REALTEK SEMICON CORP
- Filing Date
- 2022-03-17
- Publication Date
- 2026-07-10
AI Technical Summary
In cascaded or stacked switch systems, the use of pause frames in the IEEE 802.3x specification can cause head-of-line congestion, affecting system efficiency.
By transmitting specific pause frames between switches, which contain local port flow control capabilities and remote port congestion status information, switches can communicate their flow control capabilities and congestion status with each other, avoiding the use of pause frames in the IEEE 802.3x specification.
Effectively avoid head-of-line congestion, improve network system efficiency, and reduce packet loss and latency through reasonable flow control.
Smart Images

Figure CN116805931B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a flow control method for switches. Background Technology
[0002] The IEEE 802.3x standard introduces a pause frame, which the receiving end sends to the transmitting end when network congestion occurs. This notifies the transmitting end to temporarily suspend data packet transmission to alleviate congestion. Furthermore, the transmitting end must wait until the pause time indicated by the pause frame expires, or until the receiving end sends another data packet indicating that data reception can resume, before resuming data packet transmission to the receiving end. However, with the increasing demand for switch capacity, systems with multiple interconnected switches, such as cascade switch systems or stacked switch systems, have emerged. The aforementioned mechanism of using pause frames for flow control can lead to head-of-line blocking (HOL blocking), thus affecting switch efficiency.
[0003] For example, suppose a cascaded switch system includes a first switch and a second switch connected to each other. The first switch has a first port and a second port, and the second switch also has a first port and a second port. The traffic limits for the first and second ports of the second switch are 100Mbps and 1000Mbps, respectively. If an external device transmits multiple data packets with a traffic limit of 1000Mbps to the first and second ports of the second switch through the first and second ports of the first switch, the first port of the second switch needs to process more data than its traffic limit. Therefore, the second switch needs to send a pause frame to the first switch to notify it to stop transmitting data packets. At the same time, the first switch will also send a pause frame to the external device through its own first and second ports to request the external device to stop transmitting data packets. As described above, congestion on the first port of the second switch, which has a lower traffic limit, will prevent both ports of the first switch from receiving data packets, thus affecting the efficiency of the cascaded switch system. Summary of the Invention
[0004] Therefore, one of the objectives of this invention is to propose a flow control method for a switch that avoids using the pause frame flow control mechanism in the IEEE 802.3x specification between two switches, thereby solving the head-of-line blocking problem in the prior art.
[0005] In one embodiment of the present invention, an electronic device is disclosed, comprising a first port, a second port, a processing circuit, and a transceiver circuit. The first port is used to connect to a first external device, the second port is used to connect to a second external device, and the transceiver circuit is used to connect to another electronic device via a connection cable. The processing circuit transmits a specific pause frame to the other electronic device through the transceiver circuit. The specific pause frame includes local port flow control capability and / or remote port congestion status. The local port flow control capability includes whether the first external device and the second external device have flow control capability, and the remote port congestion status includes the congestion status caused to the electronic device by data packets from multiple ports of the other electronic device.
[0006] In another embodiment of the present invention, an electronic device is disclosed, comprising a first port, a second port, a processing circuit, and a transceiver circuit. The first port is used to connect to a first external device, and the second port is used to connect to a second external device. The transceiver circuit is used to connect to another electronic device via a connecting line. The other electronic device includes a third port and a fourth port, the third port being used to connect to a third external device, and the fourth port being used to connect to a fourth external device. The processing circuit receives a specific pause frame from the other electronic device through the transceiver circuit. The specific pause frame includes local port flow control capability and / or remote port congestion status. The local port flow control capability includes whether the third and fourth external devices have flow control capabilities, and the remote port congestion status includes the congestion status caused to the other electronic device by data packets from the first and second ports of the electronic device.
[0007] In another embodiment of the present invention, a flow control method for an electronic device is disclosed, wherein the electronic device includes a first port and a second port, wherein the first port is used to connect to a first external device and the second port is used to connect to a second external device, and the electronic device is connected to another electronic device via a connection cable, wherein the other electronic device includes a third port and a fourth port, wherein the third port is used to connect to a third external device and the fourth port is used to connect to a fourth external device; and the flow control method includes: receiving a specific pause frame from the other electronic device, wherein the specific pause frame includes local port flow control capability and / or remote port congestion status, wherein the local port flow control capability includes whether the third external device and the fourth external device have flow control capability, and the remote port congestion status includes the congestion status caused by data packets from the first port and the second port of the electronic device to the other electronic device. Attached Figure Description
[0008] Figure 1This is a schematic diagram of a network system according to an embodiment of the present invention.
[0009] Figure 2 This is a schematic diagram of a specific pause frame according to an embodiment of the present invention.
[0010] Figure 3 A flowchart illustrating the transmission of a specific pause frame from an electronic device to another electronic device according to an embodiment of the present invention.
[0011] Figure 4 A flowchart illustrating the transmission of a specific pause frame from an electronic device to another electronic device according to another embodiment of the present invention.
[0012] Figure 5 A flowchart illustrating the transmission of a specific pause frame from an electronic device to another electronic device according to another embodiment of the present invention.
[0013] Figure 6 This is a flowchart of a flow control method according to an embodiment of the present invention. Detailed Implementation
[0014] Figure 1 This is a schematic diagram of a network system 100 according to an embodiment of the present invention. Figure 1As shown, the network system includes electronic devices 110 and 120, which are connected by a connection cable 130 for data transmission and reception. In this embodiment, electronic devices 110 and 120 support full-duplex Ethernet and the IEEE 802.3x standard. Electronic device 110 includes a processing circuit 112, a transceiver circuit 114, and multiple ports (described as ports 116 and 118 in this embodiment). The transceiver circuit 114 is used to communicate with electronic device 120 via the connection cable 130, and ports 116 and 118 are used to connect to two external devices 102 and 104, respectively. Electronic device 120 includes processing circuitry 122, transceiver circuitry 124, and multiple ports (described in this embodiment as ports 126 and 128). Transceiver circuitry 124 communicates with electronic device 110 via connection line 130, and ports 126 and 128 are respectively connected to two external devices 106 and 108. Electronic devices 110 and 120 in this embodiment can be any electronic device capable of data transmission and reception using a network, such as a switch, router, or any electronic device that can connect to a network cable. For example, electronic devices 110 and 120 can each be a switch chip mounted on a circuit board, i.e., electronic devices 110 and 120 are cascaded switches, and in this case, connection line 130 is a trace on the circuit board. In another example, electronic devices 110 and 120 can each be a switch, i.e., electronic devices 110 and 120 are stacked switches, and in this case, connection line 130 is an Ethernet cable. In this embodiment, electronic devices 110 and 120 are a connection partner used to assist external devices 102 and 104 in communicating with external devices 106 and 108.
[0015] In the operation of network system 100, external devices 102 and 104 communicate with external devices 106 and 108 through electronic devices 110 and 120. For example, if external device 102 needs to transmit data packets to external device 106, the processing circuit 112 in electronic device 110 can receive data packets from external device 102 through port 116, and transmit the received data packets through transceiver circuit 114, connection line 130 and transceiver circuit 124 to the data packet buffer (not shown) in electronic device 120. Then the processing circuit 122 transmits the data packets in the data packet buffer to external device 106 through port 126. Similarly, if external device 104 needs to transmit data packets to external device 108, the processing circuit 112 in electronic device 110 can receive data packets from external device 104 through port 118, and transmit the received data packets to the data packet buffer in electronic device 120 through transceiver circuit 114, connection line 130 and transceiver circuit 124. Then the processing circuit 122 transmits the data packets in the data packet buffer to external device 108 through port 128.
[0016] In the background art, if the data packet traffic sent by external device 102 exceeds the traffic limit of port 126, causing the data buffer in electronic device 120 to become too full, electronic device 120 will send a pause frame to electronic device 110. This causes electronic device 110 to send a pause frame to external devices 102 and 104 through its own ports 116 and 118, requesting external devices 102 and 104 to stop transmitting data packets to electronic device 110. Therefore, because the network system 100 may experience a situation where the traffic of a single port of electronic device 120 exceeds the traffic limit, all ports of electronic device 110 may be unable to receive data packets from external devices, severely impacting the efficiency of the network system 100. To address this problem, this embodiment proposes a flow control technology for network system 100, which allows electronic devices 110 and 120 to communicate their current flow control capabilities and port congestion status, thereby resolving the problem described in the background art.
[0017] Specifically, refer to Figure 2 The diagram illustrates a specific pause frame 200, which conforms to the IEEE 802.3x specification. Figure 2As shown, a specific pause frame 200 includes multiple fields, including a 6-byte destination address, a 6-byte source address, a 2-byte frame type, a 2-byte opcode, a 42-byte reserved field, and a 4-byte cyclic redundancy check code. The reserved field includes local port flow control capabilities and remote port congestion status. It should be noted that since this embodiment focuses on the information carried by the reserved fields in the specific pause frame 200, and the content and definitions of the other fields can be found in the IEEE 802.3x specification, the following embodiment mainly describes the local port flow control capabilities and remote port congestion status included in the reserved fields.
[0018] Figure 2The specific pause frame 200 shown is used for communication between electronic devices 110 and 120. For example, electronic device 110 can transmit the specific pause frame 200 to electronic device 120. In this case, the local port flow control capability included in the reserved field of the specific pause frame 200 is whether the external devices 102 and 104 connected to ports 116 and 118 support pause frames in the IEEE 802.3x specification. In detail, since the flow control capability of each port is negotiated between electronic device 110 and external devices 102 and 104 respectively, if port 116 has flow control capability, it means that external device 102 can receive pause frames from electronic device 110 that support the IEEE 802.3x specification to pause sending data packets to electronic device 110; while if port 118 does not have flow control capability, it means that external device 104 will not stop sending data packets to electronic device 110 upon receiving a pause frame. In other words, a specific pause frame 200 allows electronic device 120 to know and store whether ports 116 and 118 of electronic device 110 have flow control capabilities. Furthermore, when electronic device 110 transmits a specific pause frame 200 to electronic device 120, the remote port congestion state included in the reserved field of the specific pause frame 200 is the congestion state caused to electronic device 110 by data packets from ports 126 and 128 of electronic device 120. Specifically, since the data packet register within electronic device 110 temporarily stores data packets from ports 126 and 128 of electronic device 120, and each data packet carries source information (i.e., whether the data packet comes from port 126 or port 128), processing circuitry 112 can generate a congestion state corresponding to ports 126 and 128 based on data packet information from ports 126 and 128, such as the number of data packets / throughput, and transmit this congestion state to electronic device 120 via the specific pause frame 200. In other words, a specific pause frame 200 can inform electronic device 120 of the congestion caused to electronic device 110 by data packets from ports 126 and 128.
[0019] Similarly, electronic device 120 can also transmit a specific pause frame 200 to electronic device 110 so that electronic device 110 knows whether ports 126 and 128 of electronic device 120 have flow control capabilities, and so that electronic device 110 knows the congestion state caused by data packets from ports 116 and 118 to electronic device 120.
[0020] Regarding the transmission time of a specific pause frame 200, it can be transmitted periodically, and / or when the port's flow control capability changes, and / or when the remote port's congestion state changes. Specifically, refer to... Figure 3The flowchart shown illustrates the transmission of a specific pause frame 200 from electronic device 110 to electronic device 120. (See flowchart for example.) Figure 3 As shown, in step 300, the process begins, and electronic devices 110 and 120 complete the connection and initialization operations. In step 302, electronic device 110 determines whether the cycle time for transmitting a specific pause frame 200 has been reached. If yes, the process proceeds to step 304; otherwise, the process returns to step 302. In step 304, electronic device 110 transmits a specific pause frame 200, including local port flow control capabilities and remote port congestion status, to electronic device 120.
[0021] In another embodiment, reference Figure 4 The flowchart shown illustrates the transmission of a specific pause frame 200 from electronic device 110 to electronic device 120. (See flowchart for example.) Figure 4 As shown, in step 400, the process begins, and electronic devices 110 and 120 complete the connection and initialization operations. In step 402, electronic device 110 determines whether the flow control capability of port 116 or port 118 has changed. For example, the external device 102 connected to port 116 changes from a pause frame supporting the IEEE 802.3x specification to a pause frame that does not support the IEEE 802.3x specification. If yes, the process proceeds to step 404; if no, the process returns to step 402. In step 404, electronic device 110 transmits a specific pause frame 200, including the updated local port flow control capability and the remote port congestion status, to electronic device 120.
[0022] In another embodiment, reference Figure 5 The flowchart shown illustrates the transmission of a specific pause frame 200 from electronic device 110 to electronic device 120. (See flowchart for example.) Figure 5 As shown, in step 500, the process begins, and electronic devices 110 and 120 complete the connection and initialization operations. In step 502, electronic device 110 determines whether the congestion state caused by data packets from ports 126 and 128 of electronic device 120 has changed. For example, the number of data packets from port 126 of electronic device 120 has increased from below a first threshold to above a second threshold. If yes, the process proceeds to step 504; if no, the process returns to step 502. In step 504, electronic device 110 transmits a specific pause frame 200, including local port flow control capabilities and the updated remote port congestion state, to electronic device 120.
[0023] It should be noted that the above Figures 3-5 The process can also be applied to electronic device 120 transmitting a specific pause frame 200 to electronic device 110, and Figures 3-5 The processes can also be used in combination.
[0024] As described above, by using a specific pause frame 200, electronic devices 110 and 120 can understand each other whether each of their ports has flow control capabilities, and whether the flow of their own ports causes congestion in the other port, so as to carry out further flow control.
[0025] Specifically, suppose external device 102 transmits data packets to external device 106 via electronic devices 110 and 120. When electronic device 120 transmits a specific pause frame 200 to electronic device 110, informing that data packets from port 116 are causing congestion to electronic device 120, the processing circuit 112 in electronic device 110 can send a pause frame to external device 102 to request external device 102 to temporarily stop transmitting data packets. Similarly, suppose external device 106 transmits data packets to external device 102 via electronic devices 120 and 110. When electronic device 110 transmits a specific pause frame 200 to electronic device 120, informing that data packets from port 126 are causing congestion to electronic device 110, the processing circuit 122 in electronic device 120 can send a pause frame to external device 106 to request external device 106 to temporarily stop transmitting data packets.
[0026] In another example, refer to Figure 6 The flowchart illustrates the flow control method. In step 600, the process begins, and electronic devices 110 and 120 complete the connection and initialization operations. In step 602, electronic device 110 receives a specific pause frame 200 from electronic device 120, wherein the specific pause frame 200 includes local port flow control capabilities and remote port congestion status. The local port flow control capabilities indicate whether ports 126 and 128 of electronic device 120 have flow control capabilities, while the remote port congestion status indicates the congestion status caused by data packets from ports 116 and 118 to electronic device 120. In step 604, processing circuit 112 receives the specific pause frame 200 and stores the local port flow control capabilities and remote port congestion status provided by the specific pause frame 200, or updates the previously stored local port flow control capabilities and remote port congestion status based on the currently received pause frame 200.
[0027] In step 606, electronic device 120 receives data packets from external devices 106 and 108 through ports 126 and 128 respectively, and transmits these data packets to electronic device 110. In step 608, electronic device 110 determines whether there is congestion, that is, whether the number of data packets included in the internal data packet buffer is too many or exceeds the threshold. If not, the process proceeds to step 610; if so, the process proceeds to step 612.
[0028] In step 610, the processing circuit 112 directly forwards the data packets from the electronic device 120 to the external device 102 and / or the external device 104.
[0029] In step 612, the processing circuit 112 determines whether ports 126 and 128 of the electronic device 120 have flow control capabilities based on the previously stored local port flow control capabilities. If not, the process proceeds to step 614; if yes, the process proceeds to step 616.
[0030] It should be noted that the operation in step 612 is performed separately for each port 126 and 128 of the electronic device. For example, if port 126 of the electronic device 120 does not have flow control capability, the process proceeds to step 614 to process data packets from port 126 and external device 106; while if port 128 of the electronic device 120 has flow control capability, the process proceeds to step 616 to process data packets from port 128 and external device 108.
[0031] In step 614, processing circuit 112 discards data packets from ports 126 / 128. For example, assuming that port 126 of electronic device 120 does not have flow control capability, processing circuit 112 will directly discard data packets from external device 106 that are currently temporarily stored in the data packet register, instead of forwarding them to external devices 102 and 104.
[0032] In step 616, the processing circuit 112 directly forwards the data packets from the electronic device 120 to the external device 102 and / or the external device 104.
[0033] It should be noted that the above Figure 6 The same process can also be applied to situations where electronic device 120 receives a specific pause frame 200 from electronic device 110 and performs flow control on data packets from electronic device 110. Since those skilled in the art should understand its operation after reading the above embodiments, details will not be repeated.
[0034] As described above, since electronic device 110 can know whether ports 126 and 128 of electronic device 120 have flow control capabilities and the congestion status caused by data packets from ports 116 and 118 to electronic device 120 through specific pause frames 200 from electronic device 120, the processing circuit 112 in electronic device 110 can perform the most appropriate processing on each data packet from electronic device 120 based on this information, and can also selectively send pause frames to one of external devices 102 and 104 based on this information, thus improving the efficiency of network system 100.
[0035] It should be noted that in the above embodiments, the specific pause frame 200 includes local port flow control capabilities and remote port congestion status, but the present invention is not limited thereto. In other embodiments, the specific pause frame 200 may only include one of local port flow control capabilities and remote port congestion status, and the processing circuit 112 within the electronic device 110 may perform the most appropriate processing on each data packet from the electronic device 120 based on the local port flow control capabilities provided by the electronic device 120, or the processing circuit 112 within the electronic device 110 may selectively send pause frames to one of the external devices 102 and 104 based on the remote port congestion status provided by the electronic device 120, which may also improve the efficiency of the network system 100.
[0036] The above description is only a preferred embodiment of the present invention. Any modifications or changes made according to the claims of the present invention are within the scope of the present invention.
[0037] Figure Labels
[0038] 100: Network System
[0039] 102, 104, 106, 108: External devices
[0040] 110: Electronic devices
[0041] 112: Processing Circuit
[0042] 114: Transceiver Circuit
[0043] 116, 118: Ports
[0044] 120: Electronic devices
[0045] 122: Processing Circuit
[0046] 124: Transceiver Circuit
[0047] 126, 128: Ports
[0048] 130: Connecting cable
[0049] 200: Specific pause frame
[0050] 300~304: Steps
[0051] 400~404: Steps
[0052] 500~504: Steps
[0053] 600~616: Steps
Claims
1. An electronic device comprising: A first port and a second port, wherein the first port is used to connect to a first external device and the second port is used to connect to a second external device; Processing circuitry; Transceiver circuitry, used to connect to another electronic device via a connecting wire; The processing circuit transmits a specific pause frame to the other electronic device via the transceiver circuit. The specific pause frame includes local port flow control capability and / or remote port congestion status. The local port flow control capability includes whether the first external device and the second external device have flow control capability, and the remote port congestion status includes the congestion status caused to the electronic device by data packets from multiple ports of the other electronic device.
2. The electronic device according to claim 1, wherein the local port flow control capability includes whether the first external device and the second external device can stop transmitting data packets to the electronic device based on a pause frame, and the remote port congestion status includes whether data packets from the plurality of ports of the other electronic device cause congestion to the electronic device.
3. The electronic device of claim 1, wherein the processing circuit periodically transmits the specific pause frame to the other electronic device via the transceiver circuit, or transmits the specific pause frame to the other electronic device when the local port flow control capability changes, or transmits the specific pause frame to the other electronic device when the remote port congestion state changes.
4. The electronic device according to claim 1, wherein the electronic device and the other electronic device form a cascaded switch or a stacked switch.
5. An electronic device comprising: A first port and a second port, wherein the first port is used to connect to a first external device and the second port is used to connect to a second external device; Processing circuitry; A transceiver circuit for connecting to another electronic device via a connecting line, wherein the other electronic device includes a third port and a fourth port, the third port being used to connect to a third external device and the fourth port being used to connect to a fourth external device; The processing circuit receives a specific pause frame from the other electronic device via the transceiver circuit. The specific pause frame includes local port flow control capability and / or remote port congestion status. The local port flow control capability includes whether the third external device and the fourth external device have flow control capability, and the remote port congestion status includes the congestion status caused to the other electronic device by data packets from the first port and the second port of the electronic device.
6. The electronic device of claim 5, wherein the local port flow control capability includes whether the third external device and the fourth external device can stop transmitting data packets to the other electronic device based on a pause frame, and the remote port congestion status includes whether data packets from the first port and the second port of the electronic device cause congestion to the other electronic device.
7. The electronic device of claim 5, wherein the specific pause frame includes the remote port congestion state; the processing circuit receives a first data packet from the first external device through the first port, the first data packet being prepared for transmission to the third external device through the other electronic device; and the processing circuit determines, based on the remote port congestion state, whether a data packet from the first port of the electronic device causes congestion to the other electronic device, and if a data packet from the first port of the electronic device causes congestion to the other electronic device, the processing circuit sends a pause frame to the first external device through the first port to request the first external device to pause transmitting data packets.
8. The electronic device of claim 5, wherein the specific pause frame includes the local port flow control capability; the processing circuit receives a second data packet from the third external device through the other electronic device, the second data packet being prepared for transmission to the first external device; and the processing circuit first determines whether the electronic device is congested; if the electronic device is congested, the processing circuit determines whether the third port or the third external device has flow control capability based on the local port flow control capability; if the third port or the third external device has flow control capability, the processing circuit directly transmits the second data packet to the first external device; and if the third port or the third external device does not have flow control capability, the processing circuit directly discards the second data packet.
9. A flow control method for an electronic device, wherein the electronic device includes a first port and a second port, wherein the first port is for connecting to a first external device and the second port is for connecting to a second external device, and the electronic device is connected to another electronic device via a connecting cable, wherein the other electronic device includes a third port and a fourth port, wherein the third port is for connecting to a third external device and the fourth port is for connecting to a fourth external device; and the flow control method includes: Receive a specific pause frame from the other electronic device, wherein the specific pause frame includes local port flow control capability and / or remote port congestion status, the local port flow control capability including whether the third external device and the fourth external device have flow control capability, and the remote port congestion status including the congestion status caused by data packets from the first port and the second port of the electronic device to the other electronic device.
10. The flow control method according to claim 9, wherein the specific pause frame includes the local port flow control capability, and the flow control method further includes: The second data packet is received from the third external device via the other electronic device, wherein the second data packet is prepared to be transmitted to the first external device; Determine if the electronic device is experiencing congestion; If the electronic device is congested, the flow control capability of the third port or the third external device is determined based on the flow control capability of the local port. If the third port or the third external device has flow control capability, the second data packet is directly transmitted to the first external device; as well as If the third port or the third external device does not have flow control capabilities, the second data packet will be discarded directly.