Switch device
Patent Information
- Application Number
- TW113150739
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2024-10-11
- Filing Date
- 2024-12-25
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Network switches face congestion issues due to bandwidth mismatches and uneven traffic distribution, leading to inefficiencies and unfairness in packet transmission.
A switching device with local and cascaded connection ports, a processing unit, and buffer memory that manages packet flow by statistically analyzing input counts to identify and manage congestion, sending pause notifications or discarding packets as needed to prevent severe congestion and ensure fairness.
The solution effectively prevents severe congestion, improves switching efficiency, and ensures fair transmission by managing traffic based on input counts, maintaining optimal buffer space and minimizing packet loss.
Smart Images

Figure TWG2TB001910300_001 
Figure TWG2TB001910300_002 
Figure TWG2TB001910300_003
Abstract
Description
[Technical Field]
[0001] This disclosure relates to a switching device and a flow control method, and more particularly to a switching device and a flow control method for managing packet traffic based on a source connection port. [Previous Technology]
[0002] A network switch is one of the key devices in network communication technology, used to connect multiple terminal devices and transmit data between them. A switch can forward packets from a source port to the correct destination port based on the destination address.
[0003] In some situations, such as when network traffic exceeds the switch's bandwidth capacity, when the transmission rate of a certain port does not match that of other ports, or when there is a specific transmission bottleneck, network switches may encounter congestion problems. To avoid congestion problems, switches typically perform packet flow control.
[0004] Packet flow control in a switch is a crucial function for ensuring effective network traffic management and performance optimization. Switches manage packet transmission rates, priorities, and queuing to ensure smooth network traffic flow and fairness. Packet flow control plays a key role in network switches, helping to maintain network stability, efficiency, and performance. [Summary of the Invention]
[0005] One embodiment of this disclosure discloses a switching device comprising a plurality of local connection ports, a plurality of cascaded connection ports, a buffer memory, and a processing unit. The plurality of cascaded connection ports are used to connect to a plurality of external switching devices. The processing unit is coupled to the buffer memory, the local connection ports, and the cascaded connection ports. The processing unit is used to identify the source connection port of an input packet transmitted to the switching device. The processing unit is used to obtain a plurality of input counts for each of the local connection ports, each of the cascaded connection ports, the switching device, and the external switching devices. The processing unit is used to determine whether the source connection port is congested based on the input counts. When the source connection port is determined not to be congested, the processing unit is used to store the input packet in the buffer memory and update the input counts. When the source connection port is determined to be congested, the processing unit is used to send a pause notification to the source connection port or discard the input packet.
[0006] Another aspect of this disclosure discloses a flow control method for a switching device including a plurality of local connection ports and a plurality of cascaded connection ports for connecting to a plurality of external switching devices. The flow control method includes: identifying a source connection port of an input packet transmitted to the switching device; obtaining a plurality of input counts for each of the local connection ports, each of the cascaded connection ports, the switching device, and the external switching devices; determining whether the source connection port is congested based on the input counts; when the source connection port is determined not to be congested, storing the input packet in the buffer memory and updating the input counts; and when the source connection port is determined to be congested, sending a pause notification to the source connection port or discarding the input packet.
[0007] It should be noted that the above description and the following detailed description are illustrative of this case by way of embodiments, and are used to assist in the explanation and understanding of the invention content claimed in this case.
Implementation Method
[0009] The following disclosure provides numerous different embodiments or examples for implementing various features of this disclosure. Elements and configurations in the specific examples are used in the following discussion to simplify this disclosure. Any examples discussed are for illustrative purposes only and do not in any way limit the scope or meaning of this disclosure or its examples. Where appropriate, the same reference numerals are used between figures and in corresponding text descriptions to represent the same or similar elements.
[0010] Please refer to Figure 1A, which illustrates a schematic diagram of a network switch system 100 according to some embodiments of this disclosure. As shown in Figure 1A, the network switch system 100 is illustrated by way of example, comprising four switch devices Sw, Sx, Sy, and Sz. This disclosure is not limited to four switch devices; in practical applications, switch devices Sw, Sx, Sy, and Sz can each be used independently or in conjunction with different numbers of switch devices.
[0011] In the embodiment shown in Figure 1A, the four switch devices Sw, Sx, Sy, and Sz are connected in a cascade manner, that is, switch device Sw is connected to switch device Sx, switch device Sx is connected to switch device Sy, and switch device Sy is connected to switch device Sz. Each of the four switch devices Sw, Sx, Sy, and Sz has a connection port, such as Pw0~Pw19, Px0~Px19, Py0~Py19, and Pz0~Pz19, which can be connected to different communication terminal devices (not shown in the figure). Packets input through one connection port can be relayed 100 times through the network switch system to another connection port and output.
[0012] For the sake of simplicity, the following paragraphs will be explained primarily from the perspective of the switching device Sx. However, the same or similar functions can be performed on other switching devices Sw, Sy, and Sz. As shown in Figure 1A, the switching device Sx includes a plurality of local connection ports Px0, Px1, Px2…Px19 and a plurality of cascade connection ports CPx0 and CPx1. Each local connection port Px0, Px1, Px2…Px19 on the switching device Sx is used to connect to a communication terminal device (e.g., a mobile phone, computer, network server, file server, or other switch).
[0013] The cascading ports CPx0 and CPx1 of the switch device Sx are used to cascade to external switch devices Sw, Sy, and Sz. For switch device Sx, cascading port CPx1 is used to connect to the cascading port CPw0 of external switch device Sw. Cascading port CPx0 is used to connect to the cascading port CPy1 of external switch device Sy, and switch device Sx is indirectly connected to external switch device Sz through external switch device Sy.
[0014] It should be noted that the number of local connection ports / cascade connection ports included in the switch device Sx is not limited to this embodiment and can be adjusted according to actual application requirements.
[0015] Please also refer to Figure 1B, which shows the internal functional block diagram of the switch device Sx in Figure 1A. As shown in Figure 1B, the switch device Sx further includes a processing unit 120 and a buffer memory 140. The processing unit 120 is coupled to the buffer memory 140, local connection ports Px0~Px19 and cascade connection ports CPx0~CPx1.
[0016] In one embodiment, the processing unit 120 may be implemented by a microcontroller (MCU), system-on-a-chip (SoC), field-programmable gate array (FPGA), central processing unit (CPU), application-specific integrated circuit (ASIC), or other similar processing circuitry. The buffer memory 140 may be implemented by random access memory (RAM), cache, register, or other memory circuitry with caching functionality.
[0017] The buffer memory 140 has multiple packet buffer spaces. When an input packet arrives at the switch device Sx, under normal circumstances, the processing unit 120 will first temporarily store the input packet in the packet buffer space of the buffer memory 140, confirm whether the target port to which the input packet is to be sent can be transmitted, and then send the packet to the appropriate target port.
[0018] Under normal circumstances, packets are only temporarily stored in buffer memory 140 for a period of time. After being transmitted to the target port, the corresponding packet buffer space in buffer memory 140 can be released. In actual application scenarios, if a large number of packets are transmitted to a specific target port, or if the bandwidth of the port is mismatched (for example, the input port bandwidth of 1000Mbps is greater than the output port bandwidth of 100Mbps), congestion may occur. When the target port cannot output so many packets in time, a large number of packets may accumulate in buffer memory 140. Since the packet buffer space of buffer memory 140 is limited, if packets are congested for a long time, packet loss or loss of timeliness may occur, reducing the efficiency of the switch device Sx.
[0019] Therefore, switching devices generally employ various methods for packet traffic management. One common method is to count the number of packets at the target port (the port from which the packet is intended to be output). When the number of packets yet to be transmitted at a target port reaches a certain threshold, the source is notified to pause the transmission of subsequent packets to avoid congestion. While this avoids congestion at specific target ports, it still has shortcomings in terms of transmission fairness.
[0020] Suppose that multiple source ports are simultaneously transmitting traffic to the same target port at different speeds (for example, local ports Px10, Px11, and Px12 are transmitting at 1000Mbps, 5Mbps, and 10Mbps respectively to local port Px0 with a bandwidth of 200Mbps). If the target port becomes congested, packet transmission from local ports Px10, Px11, and Px12 will stop simultaneously. In this case, the congestion is mainly caused by the traffic from local port Px10, but it also causes the input packets from local ports Px11 and Px12 to be unable to be transmitted normally, thus penalizing ports that are not the main cause of the congestion.
[0021] In some embodiments of this disclosure, the switching device Sx performs statistics on input packets from the source connection port and then manages subsequent packet traffic, thereby avoiding the aforementioned congestion or related fairness issues. Furthermore, in addition to performing statistics and management on input packets from its local connection port, the switching device Sx can also effectively manage traffic from input packets from remote connection ports of external switching devices (e.g., switching devices Sw, Sy, and Sz). Please refer to Figure 2, which illustrates a flowchart of a flow control method 200 according to some embodiments of this disclosure. The flow control method 200 in Figure 2 can be executed by the processing unit 120 of the switching device Sx.
[0022] As shown in Figure 2, step S210 is executed to identify the source port of the input packets of the switching device Sx. As shown in Figure 1A, the source port may be one of the local ports Px0 to Px19 of the switching device Sx itself, or it may be one of the remote ports Pw0 to Pw19, Py0 to Py19, or Pz0 to Pz19 on an external switching device Sw, Sy, or Sz cascaded with the switching device Sx.
[0023] It should be further explained that, from the perspective of the switch device Sx, the connection ports on the external switch devices Sw, Sy, or Sz are referred to as remote connection ports Pw0~Pw19, Py0~Py19, and Pz0~Pz19, while the connection ports of the switch device Sx itself are referred to as local connection ports Px0~Px19. The hardware components of the so-called local / remote connection ports are identical; the difference lies only in the device's perspective.
[0024] Execute step S230, corresponding to the local connection ports Px0~Px19 of the switch device Sx, the cascade connection ports CPx0~CPx1 of the switch device Sx, the switch device Sx and the external switch devices Sw, Sy and Sz obtain a plurality of input counts.
[0025] In some embodiments of this disclosure, the input count represents the cumulative number of packets input from a specific port (or a specific switch unit as a whole, or across different switch unit units). The input count can be incremented when a new input packet is received. When a packet is output from a target port, the corresponding input count can be decremented. These input counts can represent the distribution of packets input from various ports.
[0026] Next, step S250 is executed to determine whether the source port of the current input packet is congested based on the above plurality of input counts.
[0027] If it is determined that no input congestion has occurred, step S270 can be executed. The processing unit 120 accepts the current input packet and temporarily stores it in the buffer memory 140. The processing unit 120 can also update the input count related to the current input packet.
[0028] On the other hand, if it is determined that input congestion has occurred, step S290 can be executed. The processing unit 120 can send a pause notification to the source port, or the processing unit 120 can discard the current input packet (that is, not store the input packet in the buffer memory 140), thereby preventing the congestion from worsening. In some embodiments, by sending a pause notification to the source port, the communication terminal device connected to the source port can temporarily stop sending subsequent packets, waiting for the congestion to improve before resuming transmission.
[0029] The above embodiments are described from the perspective of switch device Sx. Similarly, switch device Sw, switch device Sy or switch device Sz can also execute the flow control method 200 in Figure 2 respectively.
[0030] In the above embodiments, the flow control method 200 performs flow control based on the input count of the input packets, rather than based on the target connection port. This can prevent a large flow transmission path from occupying most of the resources leading to a specific target connection port, thereby affecting input packets from other connection ports.
[0031] To further illustrate the details of steps S230, S250, S270 and S290 in the flow control method 200 more clearly, more specific examples will be used in the following paragraphs.
[0032] First, assume that the packet transmission states of the switching devices Sw, Sx, Sy and Sz of the network switch system 100 in Figure 1A are as shown in Table 1 below: Source switch Source connection port Target port Traffic (MBps) Sw Pw10 Px0 1 Pw11 Px0 1 Pw12 Px0 1 Pw13 Px0 1 Pw14 Px0 1000 Sx Px10 Px1 100 Px11 Px2 300 Px12 Px3 900 Px13 Px4 10 Px14 Px4 1000 Sy Py10 Px5 100 Py11 Px6 300 Py12 Px7 900 Py13 Px8 10 Py14 Px8 1000 Sz Pz10 Px9 100 Pz11 Px9 300 Pz12 Px9 900 Pz13 Px9 10 Pz14 Px9 1000 Table 1
[0033] As shown in Table 1, for the switch device Sx, there are many input traffic from different source ports, which are directed to different target ports on the switch device Sx.
[0034] The processing unit 120 of the switching device Sx can continuously accumulate various input counts based on the source port of the input packet. Please refer to Figures 3A and 3B together. Figure 3A shows a schematic diagram of the various input counts accumulated by the switching device Sx for its own port, and Figure 3B shows a schematic diagram of the various input counts accumulated by the switching device Sx for the ports of external switching devices Sw, Sy, and Sz.
[0035] As shown in Figure 3A, the input count calculated by the processing unit 120 of the switch device Sx includes the port input guarantee count Cport_rx_grt for each of the local ports Px10~Px14 and the cascade ports CPx0~CPx1, the port input count Cport_rx for each of the local ports Px10~Px14 and the cascade ports CPx0~CPx1, the switch input count Cswitch_rx[Sx] for the switch device Sx, and the global input count Cglobal_rx.
[0036] As shown in Figure 3B, the input count calculated by the processing unit 120 of the switching device Sx further includes the remote port input guarantee count Cr_port_rx_grt for each of the remote ports Pw10~Pw14, Py10~Py14 and Pz10~Pz14, the remote port input count Cr_port_rx for each of the remote ports Pw10~Pw14, Py10~Py14 and Pz10~Pz14, the remote switch input count Cswitch_rx[Sw] for the external switching device Sw, the remote switch input count Cswitch_rx[Sy] for the external switching device Sy, the remote switch input count Cswitch_rx[Sz] for the external switching device Sz, and the remote global input count Cr_global_rx.
[0037] Please refer to Figures 4A and 4B together. Figures 4A and 4B illustrate a flowchart of a flow control method 400 of this disclosure. The flow control method 400 shown in Figures 4A and 4B is used to specifically illustrate the detailed steps of the flow control method 200 in Figure 2.
[0038] From the perspective of the switching device Sx, as shown in Figures 1B and 4A, the processing unit 120 of the switching device Sx performs step S410 to determine the source port of the input packet transmitted to the switching device Sx. The source port of the input packet may be one of the local ports Px0 to Px19 of the switching device Sx, or it may be one of the remote ports Pw10 to Pw14, Py10 to Py14, or Pz10 to Pz14 of the external switching devices Sw, Sy, or Sz.
[0039] The processing unit 120 of the switching device Sx executes step S420 to determine whether the source port of the input packet is a local port or a remote port. If the source port is one of the local ports Px0 to Px19, then the subsequent step S430 in Figure 4A is executed. If the source port is one of the remote ports Pw10 to Pw14, Py10 to Py14, or Pz10 to Pz14, then the subsequent step S431 in Figure 4B is executed.
[0040] First, let’s discuss the case where the source port is one of the local ports Px10 of the switch device Sx, in conjunction with Figure 4A. Step S430 is executed to obtain the input count related to one of the local ports Px10. In this example, the input count related to the local port Px10 includes the port input guarantee count Cport_rx_grt corresponding to the local port Px10, the port input count Cport_rx corresponding to the local port Px10, the switch input count Cswitch_rx[Sx] of the switch device Sx, and the global input count Cglobal_rx.
[0041] As shown in Figure 3A, the port input guarantee count Cport_rx_grt corresponding to local port Px10 is "3", the port input count Cport_rx corresponding to local port Px10 is "0", the switch input count Cswitch_rx[Sx] of switch device Sx is "180" and the global input count Cglobal_rx is "560".
[0042] Step S450 is executed, determining whether the port input guarantee count Cport_rx_grt corresponding to one of the local connection ports Px10 has reached the guarantee threshold TPort_grt (assumed to be "5" in Figure 3A). In this example, since the port input guarantee count Cport_rx_grt corresponding to the local connection port Px10 is "3", it has not reached the guarantee threshold TPort_grt. Processing unit 120 executes step S451 to determine that the source port (i.e., local connection port Px10 in this example) is not congested, and then executes step S470 to store the input packet from the local connection port Px10 into the buffer memory 140, and update the port input guarantee count Cport_rx_grt corresponding to the local connection port Px10 from "3" to "4".
[0043] In the above example, the port input guarantee count Cport_rx_grt represents the minimum guaranteed buffer space allocated to each port (for example, in this case, each port is guaranteed to have at least 5 available buffer spaces). When the local port Px10 has not exhausted the port input guarantee count Cport_rx_grt, the port input count Cport_rx of the local port Px10 will not start accumulating, and this local port Px10 can be directly determined to be uncongested. The switch device Sx will then receive the input packets of the local port Px10 and store them in the buffer memory 140 (and perform subsequent communication transmission), thereby ensuring that each port can have at least the minimum guaranteed amount of buffer space available, improving the fairness of transmission.
[0044] In another example, assuming that the source port of the input packet is another local port Px11 of the switch device Sx, step S430 is executed to obtain the input count related to one of the local ports Px11, as shown in Figure 3A. The obtained input counts are as follows: the port input guarantee count Cport_rx_grt corresponding to the local port Px11 is "5", the port input count Cport_rx corresponding to the local port Px11 is "30", the switch input count Cswitch_rx[Sx] of the switch device Sx is "180", and the global input count Cglobal_rx is "560".
[0045] Execute step S450 to determine whether the port input guarantee count Cport_rx_grt corresponding to the local connection port Px11 has reached the guarantee threshold value TPort_grt.
[0046] In this example, the port input guarantee count Cport_rx_grt corresponding to the local port Px11 has reached the guarantee threshold value TPort_grt. Therefore, step S452 is executed to determine the port buffer occupancy status, switch buffer occupancy status and global buffer occupancy status based on the comparison results of the port input count Cport_rx, switch input count Cswitch_rx[Sx] and global input count Cglobal_rx corresponding to the local port Px11 with their respective threshold ranges.
[0047] In the example of Figure 3A, the port input count Cport_rx corresponding to local port Px11 is "30", which is higher than the low threshold TPort_L ("20") and lower than the high threshold TPort_H ("50"), indicating that the port buffer occupancy status is "yellow" or moderately occupied. The switch input count Cswitch_rx[Sx] of switch device Sx is "180", which is higher than the low threshold TSwitch_L ("150") and lower than the high threshold TSwitch_H ("200"), indicating that the switch buffer occupancy status is "yellow" or moderately occupied. The global input count Cglobal_rx is "560", which is higher than the high threshold TGlobal_H ("500"), indicating that the global buffer occupancy status is "red" or highly occupied. In this example, assume that the global input count high threshold T Global_H is "500" and the global input count low threshold T Global_L is "250".
[0048] Next, step S453 is executed to determine whether the source connection port (i.e., local connection port Px11 in this example) is experiencing input congestion based on the port cache occupancy status "yellow" of local connection port Px11, the switch cache occupancy status "yellow," and the global cache occupancy status "red." In some embodiments, step S453 determines that the source connection port is experiencing input congestion only when two or more of the three occupancy statuses are "red"; conversely, if less than two of the three occupancy statuses are "red," step S453 can determine that the source connection port is not experiencing input congestion. In this case, step S453 determines that the source connection port (i.e., local connection port Px11 in this example) is not experiencing input congestion because only one global cache occupancy status is "red."
[0049] It should be noted that the above judgment rule (when two or more occupancy states are "red", it is judged as input congestion) is only an example. In actual application, it can be adjusted according to the detection sensitivity that the flow control method 400 wants to achieve.
[0050] Since no input congestion is determined to have occurred, step S471 can be executed. The processing unit 120 of the switch device Sx stores the input packets from the local connection port Px11 into the buffer memory 140, and the processing unit 120 updates the port input count Cport_rx (30+1=31), the switch input count Cswitch_rx[Sx] (180+1=181), and the global input count Cglobal_rx (560+1=561) corresponding to the local connection port Px11. That is to say, step S471 is used to accumulate the relevant input parameters. If input packets from the local connection port Px11 are continuously received, and the relevant input count is found to exceed the threshold at a later time point, input congestion can be detected.
[0051] In another example, assuming the source port of the input packet is another local port Px12 of the switch device Sx, step S430 is executed to obtain the input counts related to one of the local ports Px12 as follows: the port input guarantee count Cport_rx_grt corresponding to the local port Px12 is "5", the port input count Cport_rx corresponding to the local port Px12 is "60", the switch input count Cswitch_rx[Sx] of the switch device Sx is "180", and the global input count Cglobal_rx is "560".
[0052] Similarly, in step S450, it is determined that the port input guarantee count Cport_rx_grt corresponding to the local port Px12 has reached the guarantee threshold value TPort_grt. Next, step S452 is executed, and the port buffer occupancy status, switch buffer occupancy status, and global buffer occupancy status are determined based on the comparison results between the port input count Cport_rx, the switch input count Cswitch_rx[Sx], and the global input count Cglobal_rx corresponding to the local port Px12 and their respective threshold ranges.
[0053] In the example of Figure 3A, the port cache occupancy status corresponding to local connection port Px12 can be determined as "red" or highly occupied. The switch cache occupancy status can be determined as "yellow" or moderately occupied. The global cache occupancy status can be determined as "red" or highly occupied.
[0054] Next, step S453 is executed. Based on the port buffer occupancy status of local port Px12 ("red"), the switch buffer occupancy status ("yellow"), and the global buffer occupancy status ("red"), it is determined whether the source port (i.e., local port Px12 in this example) is experiencing input congestion. At this time, in step S453, since both the port buffer occupancy status and the global buffer occupancy status are "red", it is determined that the source port (i.e., local port Px12 in this example) is experiencing input congestion.
[0055] If input congestion is detected, flow control can be applied to the source port (i.e., local port Px12 in this example), such as sending a pause notification to local port Px12 or discarding input packets from local port Px12. As shown in Figure 4A, step S490 is executed first, and the processing unit 120 determines whether the source port (i.e., local port Px12 in this example) supports flow control. In some embodiments, the processing unit 120 can determine whether flow control is supported based on the header information or packet format of the input packet. If flow control is supported, step S491 is executed, and the processing unit 120 sends a pause notification to the source port (i.e., local port Px12 in this example). If flow control is not supported, step S492 is executed, the target port of the input packet transmitted to the switching device Sx is identified, and it is determined whether the target port of the input packet is congested.
[0056] In some embodiments, the processing unit 120 may additionally accumulate the port output count of the target port to evaluate the total number of packets that each port still needs to output, thereby distinguishing whether the target port is congested. At this time, step S492 can determine whether the target port is congested based on the comparison result between the port output count and the threshold value.
[0057] In the example of Figure 4A, if it is determined that the target port of the input packet is also congested, then step S493 is executed to discard the input packet.
[0058] In one embodiment, if step S492 determines that the target connection port of the input packet is not blocked, it means that the target connection port of the packet output is relatively unobstructed. At this time, even if the input packet is received, it will not stay in the switch device Sx for too long. Then the flow control method 400 can also receive the input packet (not shown in Figure 4A) and store it in the buffer memory 140.
[0059] Similarly, input packets from other local connection ports Px13 and Px14 can also be determined to be congested according to the above steps. Following similar steps, the flow control method 400 will determine that local connection port Px13 is not congested (similar to the example of local connection port Px11) and perform corresponding processing. The flow control method 400 will determine that local connection port Px14 is congested (similar to the example of local connection port Px12) and perform corresponding processing.
[0060] The following paragraphs will discuss the case where the source port is one of the remote ports of external switching devices Sw, Sy, or Sz, in conjunction with Figure 4B. As shown in Figures 1A and 4B, for the case of switching device Sx, assume that the source port of the input packet received by switching device Sx is via one of the cascaded ports CPx0 of switching device Sx and comes from one of the remote ports Py10 of external switching device Sy.
[0061] At this time, the flow control method 400 executes step S431 to obtain the input count associated with one of the remote connection ports Py10 and the input count associated with one of the cascaded connection ports CPx0. In this example, as shown in Figure 3B, the input count associated with one of the remote connection ports Py10 includes the remote connection port input guarantee count Cr_port_rx_grt corresponding to the remote connection port Py10, the remote connection port input count Cr_port_rx corresponding to the remote connection port Py10, the remote switch input count Cswitch_rx[Sy] corresponding to the external switch device Sy, and the remote global input count Cr_global_rx. As shown in Figure 3A, the input count associated with one of the cascaded connection ports CPx0 includes the port input count Cport_rx corresponding to the cascaded connection port CPx0 and the global input count Cglobal_rx.
[0062] Step S454 is executed to determine whether the remote port input guarantee count Cr_port_rx_grt corresponding to the remote port Py10 has reached the remote guarantee threshold TPort_grt (assumed to be "5" in Figure 3B). In this example, since the value of the remote port input guarantee count Cr_port_rx_grt corresponding to the remote port Py10 is "3", it has not reached the remote guarantee threshold TPort_grt. Processing unit 120 executes step S455 to determine that the source port (i.e., the remote port Py10 in this example) is not congested. Then, step S472 is executed to store the input packet from the remote port Py10 into the buffer memory 140 and update the remote port input guarantee count Cr_port_rx_grt corresponding to the remote port Py10 from "3" to "4".
[0063] In another example, assuming the source port of the input packet is another remote port Py11 of the external switch device Sy, step S431 is executed to obtain the input count related to one of the remote ports Py11 and the input count related to one of the cascaded ports CPx0. As shown in Figures 3A and 3B, the relevant input counts obtained are as follows: the remote port input guarantee count Cr_port_rx_grt corresponding to the remote port Py11 is "5", the remote port input count Cr_port_rx corresponding to the remote port Py11 is "25", the remote switch input count Cswitch_rx[Sy] of the external switch device Sy is "180", and the remote global input count Cr_global_rx is "380".
[0064] The value of the remote global input count Cr_global_rx is the sum of the input counts of multiple remote switches, which is used to represent the total number of input buffers occupied by all remote switches.
[0065] Execute step S454 to determine whether the remote connection port input guarantee count Cr_port_rx_grt corresponding to the remote connection port Py11 has reached the guarantee threshold value T Port_grt.
[0066] In this example, the remote port input guarantee count Cr_port_rx_grt corresponding to the remote port Py11 has reached the guarantee threshold value T Port_grt, and then the flow control method 400 executes steps S456 and S457.
[0067] In step S456, the remote connection port input count Cr_port_rx, the remote switch input count Cswitch_rx[Sy], and the remote global input count Cr_global_rx corresponding to the remote connection port Py11 are compared with their respective threshold ranges to determine the remote connection port buffer occupancy status, the remote switch buffer occupancy status, and the remote global buffer occupancy status.
[0068] In the example of Figure 3B, the remote port input count Cr_port_rx value corresponding to remote port Py11 is "25", which is higher than the low threshold TRPort_L value of "10" and lower than the high threshold TRPort_H value of "30". The remote port buffer occupancy status can be judged as "yellow" or moderate occupancy. The remote switch input count Cswitch_rx[Sy] value of external switch device Sy is "180", which is higher than the high threshold TRSwitch_H value of "150". The remote switch buffer occupancy status can be judged as "red" or high occupancy. The remote global input count Cr_global_rx value is "380", which is higher than the high threshold TRGlobal_H value of "300". The remote global buffer occupancy status can be judged as "red" or high occupancy. In this example, assume that the remote switch input count high threshold TRSwitch_H value is "150", the remote switch input count low threshold TRSwitch_L value is "100", the remote global input count high threshold TRGlobal_H value is "300" and the remote global input count low threshold TRGlobal_L value is "200".
[0069] In step S456, based on the remote connection port buffer occupancy status "yellow" of the remote connection port Py11, the remote switch buffer occupancy status "red" and the remote global input count "red", since there are more than two occupancy statuses as "red", it is determined that one of the remote connection ports Py11 has experienced remote input congestion.
[0070] In step S457, based on the comparison results of the port input count Cport_rx and global input count Cglobal_rx (as shown in Figure 3A) corresponding to one of the cascaded ports CPx0 with their respective threshold ranges, the port buffer occupancy status and global buffer occupancy status of the cascaded port CPx0 are determined. Based on the port buffer occupancy status and global buffer occupancy status, it is determined whether one of the cascaded ports CPx0 has experienced local input congestion. In this example, in step S457, the port input count Cport_rx corresponding to the cascaded port CPx0 is higher than both the high threshold TCPort_H and the low threshold TCPort_L of the cascaded port input count, so the port buffer occupancy status of the cascaded port CPx0 can be determined to be "red". The global input count Cglobal_rx is higher than the high threshold TGlobal_H of the global input count, so the global buffer occupancy status can be determined to be "red", thus determining that one of the cascaded ports CPx0 has experienced local input congestion.
[0071] Next, step S458 is performed to determine whether remote input congestion and local input congestion have occurred, and then to determine whether input congestion has occurred at the source connection port (i.e., remote connection port Py11 in this example). Following the example above, since steps S456 and S457 have already determined that both remote and local input congestion have occurred, step S458 can determine that input congestion has occurred at the source connection port (i.e., remote connection port Py11 in this example). Since input congestion has been determined, steps S494-S497 can be executed on the source connection port (i.e., remote connection port Py11 in this example) to perform flow control processing, such as sending a pause notification to the remote connection port Py11, or discarding input packets from the remote connection port Py11. The details of steps S494-S497 are similar to steps S490-S493 in the previous embodiment, and will not be repeated here.
[0072] In another example, assuming the source port of the input packet is another remote port Pz10 of the external switch device Sz via the cascaded port CPx0, step S431 is executed to obtain the input count related to one of the remote ports Pz10 and the input count related to one of the cascaded ports CPx0. As shown in Figures 3A and 3B, the obtained input counts are as follows: the remote port input guarantee count Cr_port_rx_grt corresponding to the remote port Pz10 is "5", the remote port input count Cr_port_rx corresponding to the remote port Pz10 is "10", the remote switch input count Cswitch_rx[Sz] of the external switch device Sz is "120", and the remote global input count Cr_global_rx is "380".
[0073] Similarly, the flow control method 400 executes steps S454, S456, and S457. In step S454, the remote connection port input guarantees that the count Cr_port_rx_grt has reached the guarantee threshold value TPort_grt.
[0074] In step S456, based on the remote connection port buffer occupancy status "yellow" of the remote connection port Pz10, the remote switch buffer occupancy status "yellow" and the remote global input count "red", since only one of them has an occupancy status of "red", it can be determined that one of the remote connection ports Pz10 has not experienced remote input congestion.
[0075] In step S457, it can be determined that the connection port cache occupancy status is "red" and the global cache occupancy status is "red", thereby determining that one of the cascaded connection ports CPx0 has experienced local input congestion.
[0076] Next, in step S458, since no remote input congestion has occurred, it can be determined that no input congestion has occurred at the source port (i.e., remote port Pz10 in this example). Next, the flow control method 400 can execute step S473, whereby the processing unit 120 stores the input packets from the remote port Pz10 into the buffer memory 140, and the processing unit 120 can update the input count associated with one of the remote ports Pz10 and obtain the input count associated with one of the cascaded ports CPx0. That is, the remote port input count Cr_port_rx value corresponding to the remote port Pz10 is updated to "10+1=11", the remote switch input count Cswitch_rx[Sz] value of the external switch device Sz is "120+1=121", and the remote global input count Cr_global_rx value is "380+1=381".
[0077] Through the above embodiments, it has been explained that when the switch device Sx processes input packets, if the input connection port is a local connection port of the switch device Sx or a remote connection port from other switch devices Sw, Sy or Sz, the input counting accumulation and judgment can be performed respectively. Through the above input counting judgment, the source connection port that generates a large number of input packets can be controlled in a targeted manner.
[0078] When congestion is detected, a pause notification (or packet drop) is first sent to the source port generating a large number of input packets. Simultaneously, other source ports are allowed to maintain normal packet transmission as much as possible, preventing all traffic destined for a specific target port from stopping due to congestion. Furthermore, a basic port input guarantee count is calculated for each source port to ensure that each source port maintains a basic low-bandwidth flow. In this way, the switching device and flow control method disclosed in this document can prevent severe congestion in the switching device, improve the switching efficiency of the switching device, and ensure transmission fairness between different ports.
[0079] Although specific embodiments of this disclosure have been disclosed in relation to the above embodiments, these embodiments are not intended to limit this disclosure. Various alternatives and modifications can be made by those skilled in the art in accordance with this disclosure without departing from the principles and spirit of this disclosure. Therefore, the scope of protection of this disclosure is determined by the appended claims. [Simplified Explanation of the Diagram]
[0008] To make the above and other objects, features and embodiments of this disclosure more apparent and understandable, the accompanying drawings are described as follows: Figure 1A illustrates a schematic diagram of a network switch system according to some embodiments of this disclosure; Figure 1B illustrates an internal functional block diagram of one of the switch devices in Figure 1A; Figure 2 illustrates a flowchart of a flow control method according to some embodiments of this disclosure; Figure 3A illustrates a schematic diagram of the various input counts accumulated by the switch device for its own connection port; Figure 3B illustrates a schematic diagram of the various input counts accumulated by the switch device for the connection port of an external switch device; and Figures 4A and 4B illustrate a flowchart of a flow control method according to this disclosure. [Biomaterial Storage]
[0081] Domestic storage information (please note in order of storage institution, date, and number): None. International storage information (please note in order of storage country, institution, date, and number): None.
Claims
1. A switching device, comprising: a plurality of local connection ports; a plurality of cascaded connection ports for connecting to a plurality of external switching devices; a buffer memory; and a processing unit coupled to the buffer memory, the local connection ports, and the cascaded connection ports, the processing unit being configured to: identify a source connection port of an input packet transmitted to the switching device; acquire a plurality of input counts for each of the local connection ports, each of the cascaded connection ports, the switching device, and the external switching devices; determine whether input congestion has occurred at the source connection port based on the input counts; when the source connection port is determined not to be congested, store the input packet in the buffer memory and update the input counts; and when the source connection port is determined to be congested, send a pause notification to the source connection port or discard the input packet.
2. The switching device as claimed in claim 1, wherein the processing unit is configured to: determine whether the source port of the input packet is from the local ports or from a plurality of remote ports of the external switching devices via the cascaded ports.
3. The switching device as claimed in claim 2, wherein the input counts include a port input guarantee count corresponding to one of the local ports, and when the source port is from the one of the local ports, the processing unit is configured to: determine that the source port is not congested when the port input guarantee count does not reach a guarantee threshold, store the input packet in the buffer memory and update the port input guarantee count corresponding to the one of the local ports.
4. The switching device as described in claim 3, wherein the input counts include a port input count corresponding to one of the local ports, a switch input count corresponding to the switching device, and a global input count, and when the port input guarantee count has reached the guarantee threshold, and when the source port is from one of the local ports, the processing unit is configured to: determine a port buffer occupancy status, a switch buffer occupancy status, and a global buffer occupancy status based on the comparison results of the port input count, the switch input count, and the global input count with their respective threshold ranges; determine whether the source port is experiencing input congestion based on the port buffer occupancy status, the switch buffer occupancy status, and the global buffer occupancy status; when the source port is determined to be congested, send the pause notification to the source port or discard the input packet; and when the source port is determined not to be congested, store the input packet in the buffer memory and increment the port input count, the switch input count, and the global input count.
5. The switching device as claimed in claim 2, wherein the input counts include a remote port input guarantee count corresponding to a remote port of one of the external switching devices, and when the source port of the input packet is from the remote port of one of the external switching devices via one of the cascaded ports, the processing unit is configured to: determine that the source port is not congested when the remote port input guarantee count does not reach a guarantee threshold, store the input packet in the buffer memory, and update the remote port input guarantee count corresponding to the remote port.
6. The switching device as described in claim 5, wherein the input counts include a port input count corresponding to one of the cascaded ports and a global input count, and when the source port of the input packet is from one of the remote ports of one of the external switching devices via one of the cascaded ports, and the remote port input guarantee count has reached the guarantee threshold, the processing unit is configured to: determine a port buffer occupancy status and a global buffer occupancy status based on the comparison results of the port input count corresponding to one of the cascaded ports and the global input count with their respective threshold ranges, and determine whether local input congestion has occurred at one of the cascaded ports based on the port buffer occupancy status and the global buffer occupancy status.
7. The switching device as described in claim 6, wherein the input counts include a remote port input count corresponding to one of the remote ports, a remote switch input count corresponding to one of the external switching devices, and a remote global input count, wherein when the source port of the input packet is from one of the remote ports of one of the external switching devices via one of the cascaded ports, and the remote port input guarantee count has reached the guarantee threshold, the processing unit is configured to: determine a remote port buffer occupancy status, a remote switch buffer occupancy status, and a remote global buffer occupancy status based on the comparison results of the remote port input count, the remote switch input count, and the remote global input count with their respective threshold ranges; and determine whether remote input congestion has occurred at one of the remote ports based on the remote port buffer occupancy status, the remote switch buffer occupancy status, and the remote global input count.
8. The switching device as claimed in claim 7, wherein when the source port of the input packet is from one of the remote ports of one of the external switching devices via one of the cascaded ports, and the remote port input guarantee count has reached the guarantee threshold, the processing unit is configured to: send the pause notification to the source port or discard the input packet when it is determined that local input congestion has occurred at one of the cascaded ports and that remote input congestion has occurred at one of the remote ports.
9. The switching device as claimed in claim 1, wherein the processing unit is configured to: determine whether the source port supports a flow control function; and if it is determined that the source port supports the flow control function and the source port is congested, send the pause notification to the source port.
10. The switching device as claimed in claim 9, wherein the processing unit is configured to: identify a target port for the input packet transmitted to the switching device; determine whether the target port is congested; and discard the input packet if it is determined that the source port does not support the flow control function, the source port is congested, and the target port is congested.
Citation Information
Patent Citations
Server, cascading system between servers and method thereof
TW202020672A
Electronic device and flow control method thereof
TW202339472A
Network switch chip and method for cascading the same
US20040174890A1
