TWI748613B - Switch - Google Patents
Switch Download PDFInfo
- Publication number
- TWI748613B TWI748613B TW109129263A TW109129263A TWI748613B TW I748613 B TWI748613 B TW I748613B TW 109129263 A TW109129263 A TW 109129263A TW 109129263 A TW109129263 A TW 109129263A TW I748613 B TWI748613 B TW I748613B
- Authority
- TW
- Taiwan
- Prior art keywords
- egress
- queue
- queues
- cache
- urgency
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/625—Queue scheduling characterised by scheduling criteria for service slots or service orders
- H04L47/6275—Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/622—Queue service order
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/6215—Individual queue per QOS, rate or priority
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/30—Peripheral units, e.g. input or output ports
- H04L49/3027—Output queuing
Abstract
Description
本發明涉及一種排程方法,且特別涉及一種交換機的排程方法。The invention relates to a scheduling method, and in particular to a scheduling method of an exchange.
交換機在轉發封包時,為了區分不同資料流的傳送順序,出口埠(Egress Port)會有多個出口佇列(Queue)。每一出口佇列用來存放不同優先級的封包,並配予不同出口佇列權重(Weight)以決定不同優先級的封包的傳送比例。也就是說,出口埠可使用排程器(Scheduler)決定選擇哪個出口佇列送封包,並依據出口佇列權重,決定從選擇的出口佇列中抓取多少個封包做傳送。When the switch forwards packets, in order to distinguish the transmission sequence of different data streams, the egress port has multiple egress queues. Each egress queue is used to store packets of different priority levels, and is assigned different egress queue weights to determine the transmission ratio of packets of different priority levels. In other words, the egress port can use the scheduler to determine which egress queue to choose to send packets, and according to the egress queue weight, decide how many packets to grab from the selected egress queue for transmission.
如圖1所示,出口埠P0有兩個出口佇列Q0和Q1分別用來存放優先級為S1和S2的封包,並當出口埠P0的出口佇列Q0和Q1的出口佇列權重分別為1和2時,即{Q0:Q1}=1:2,出口埠P0的排程器10則依據上述出口佇列權重,決定從出口埠P0的出口佇列Q0抓取優先級為S1的一個封包做傳送,並決定從出口埠P0的出口佇列Q1抓取優先級為S2的兩個封包做傳送。如果出口埠的排程器想從選擇的出口佇列中抓取封包,卻遇到選擇的出口佇列沒有封包可送時,排程器就會去抓下一出口佇列內的封包做傳送,以至於出口佇列權重失衡。As shown in Figure 1, the egress port P0 has two egress queues Q0 and Q1 to store packets with priority S1 and S2 respectively, and when the egress queues Q0 and Q1 of the egress port P0 have the weights of the egress queues respectively 1 and 2, ie {Q0:Q1}=1:2, the
另外,轉發封包可分為單播(Unicast)、多播(Multicast)和廣播(Broadcast),單播是指一個封包只能送往單一個出口佇列和單一個出口埠,而多播和廣播是指一個封包可送往多個出口佇列和多個出口埠。而在高頻寬的交換器為了節省存放轉發封包的記憶體空間,一般會採取中央的記憶體架構來讓所有的出口佇列共同使用,然而這種架構受限於記憶體的頻寬能力。因此,對於多播/廣播封包而言,交換機需要花多次才能把多播/廣播封包送到所需前往的多個出口埠的多個出口佇列。為了彌補這部分運作上的低效能,交換機在設計上可將多播/廣播封包存放在中央緩存記憶體(Central Absorb Memory),同時為了因應出口佇列的出口佇列權重,中央緩存記憶體可配置有多個緩存佇列(Absorb Queue)和緩存排程器。In addition, forwarding packets can be divided into Unicast, Multicast and Broadcast. Unicast means that a packet can only be sent to a single egress queue and a single egress port, while multicast and broadcast It means that a packet can be sent to multiple egress queues and multiple egress ports. In high-bandwidth switches, in order to save memory space for storing and forwarding packets, a central memory architecture is generally adopted for common use by all egress queues. However, this architecture is limited by the bandwidth capability of the memory. Therefore, for multicast/broadcast packets, the switch takes multiple times to send the multicast/broadcast packets to multiple egress queues of multiple egress ports to which it needs to go. In order to make up for this part of the operational inefficiency, the switch is designed to store multicast/broadcast packets in the central buffer memory (Central Absorb Memory). At the same time, in response to the export queue weight of the export queue, the central buffer memory can be Configured with multiple buffer queues (Absorb Queue) and buffer schedulers.
每一緩存佇列也用來存放不同優先級的封包,並配予不同緩存佇列權重以決定不同優先級的封包的傳送比例。一般而言,緩存佇列和出口佇列會存在對應關係,以便封包可從緩存佇列送到對應的出口佇列,且緩存排程器則依據緩存佇列權重將緩存佇列內的封包送到所需前往的出口埠的出口佇列。如圖2所示,緩存佇列AQ0連接出口埠P0、P1和P2的出口佇列Q0,且緩存佇列AQ1連接出口埠P0、P1和P2的出口佇列Q1。緩存佇列AQ0存放兩個封包,第一個封包要送往出口埠P0和P1的出口佇列Q0,而第二個封包要送往出口埠P0和P2的出口佇列Q0。另外,緩存佇列AQ1也存放兩個封包,但這兩個封包都要送往出口埠P0、P1和P2的出口佇列Q1。為了方便以下說明,圖2已示意緩存佇列AQ0和AQ1內的這些封包在通過緩存排程器13送到所需前往的出口埠的出口佇列後的存放樣貌。Each buffer queue is also used to store packets of different priorities, and different buffer queue weights are assigned to determine the transmission ratio of packets of different priorities. Generally speaking, there will be a corresponding relationship between the cache queue and the egress queue, so that packets can be sent from the cache queue to the corresponding egress queue, and the cache scheduler sends the packets in the cache queue according to the weight of the cache queue Go to the exit queue of the exit port you need to go to. As shown in Figure 2, the cache queue AQ0 is connected to the egress queue Q0 of the egress ports P0, P1 and P2, and the cache queue AQ1 is connected to the egress queue Q1 of the egress ports P0, P1 and P2. The buffer queue AQ0 stores two packets. The first packet is sent to the egress queue Q0 of the egress ports P0 and P1, and the second packet is sent to the egress queue Q0 of the egress ports P0 and P2. In addition, the buffer queue AQ1 also stores two packets, but these two packets must be sent to the egress queue Q1 of the egress ports P0, P1, and P2. For the convenience of the following description, FIG. 2 has shown the storage appearance of these packets in the buffer queues AQ0 and AQ1 after being sent to the exit queue of the desired exit port through the
為了不影響出口佇列的出口佇列權重,緩存排程器13可對於緩存佇列AQ0和AQ1配置適合的緩存佇列權重。如圖3A所示,當緩存佇列AQ0和AQ1存放要送往出口埠P0的封包,且出口埠P0的出口佇列Q0和Q1的出口佇列權重分別為1和8時,緩存排程器13則可配置緩存佇列AQ0和AQ1的緩存佇列權重分別為1和8,即{AQ0:AQ1}=1:8。類似地,如圖3B所示,當緩存佇列AQ0和AQ1存放要送往出口埠P1的封包,且出口埠P1的出口佇列Q0和Q1的出口佇列權重分別為8和1時,緩存排程器13則可配置緩存佇列AQ0和AQ1的緩存佇列權重分別為8和1,即{AQ0:AQ1}=8:1。In order not to affect the egress queue weight of the egress queue, the
另外,如圖3C所示,當緩存佇列AQ0和AQ1存放要送往出口埠P1和P2的封包,且出口埠P2的出口佇列Q0和Q1的出口佇列權重分別為4和1時,緩存排程器13就會將出口埠P1的出口佇列Q0的出口佇列權重和出口埠P2的出口佇列Q0的出口佇列權重取平均值作為緩存佇列AQ0的緩存佇列權重,並且將出口埠P1的出口佇列Q1的出口佇列權重和出口埠P2的出口佇列Q1的出口佇列權重取平均值作為緩存佇列AQ1的緩存佇列權重,即{AQ0:AQ1}={(8+4)/2:(1+1)/2}=6:1。也就是說,當緩存排程器13服務的對象是多個出口埠,且這些出口埠所配置的出口佇列權重一致時,緩存佇列AQ0和AQ1的緩存佇列權重就能有簡單的配置基礎,但當緩存排程器13服務的多個出口埠所配置的出口佇列權重懸殊時,緩存排程器13將無法配置出適合的緩存佇列權重。In addition, as shown in Figure 3C, when the buffer queues AQ0 and AQ1 store packets to be sent to the egress ports P1 and P2, and the egress queue weights of the egress queues Q0 and Q1 of the egress port P2 are 4 and 1, respectively, The
如圖3D所示,因為出口埠P0的{Q0:Q1}和出口埠P1的{Q0:Q1}取平均為1:1,即{AQ0:AQ1}={(1+8)/2:(8+1)/2}=1:1,所以緩存佇列AQ0和AQ1存放要送往出口埠P0和P1的封包是用1:1的比例送往,但出口埠P0的排程器10則期望用1:8的比例送出出口埠P0的出口佇列Q0和Q1的封包,以至於出口埠P0的出口佇列Q1的封包會送得比較快,容易出現出口埠P0的出口佇列Q1空掉而沒有封包可送的情形,且一旦出口佇列空掉就會讓出口佇列權重失衡。因此,如何設計出一種交換機的排程方法以避免出口佇列權重失衡則成為本領域的一項重要課題。As shown in Figure 3D, because {Q0:Q1} of outlet port P0 and {Q0:Q1} of outlet port P1 are averaged 1:1, that is, {AQ0:AQ1}={(1+8)/2:( 8+1)/2}=1:1, so the buffer queues AQ0 and AQ1 store the packets to be sent to the egress ports P0 and P1 at a ratio of 1:1, but the
有鑑於此,本發明實施例提供一種轉發封包的排程方法,用於包括多個緩存佇列、多個出口埠和緩存排程器的交換機中。每一出口埠具有多個出口佇列,每一出口埠的每一出口佇列連接到這些緩存佇列的不同一個,且排程方法包括如下步驟。首先,針對每一出口埠的每一出口佇列產生一緊急度,且該緊急度用來反映對應的出口佇列即將快沒有封包送的程度。接著,根據每一出口佇列的緊急度,緩存排程器選擇這些緩存佇列的一個來送出其存放的封包至所需前往的目標出口埠的目標出口佇列。In view of this, an embodiment of the present invention provides a scheduling method for forwarding packets, which is used in a switch that includes multiple cache queues, multiple egress ports, and a cache scheduler. Each egress port has multiple egress queues, each egress queue of each egress port is connected to a different one of these cache queues, and the scheduling method includes the following steps. First, an urgency is generated for each egress queue of each egress port, and the urgency is used to reflect the degree to which the corresponding egress queue is about to be out of packets. Then, according to the urgency of each egress queue, the cache scheduler selects one of these cache queues to send the stored packets to the target egress queue of the desired egress port.
除此之外,本發明實施例另提供一種交換機,包括多個緩存佇列、多個出口埠和緩存排程器。每一出口埠具有多個出口佇列,每一出口埠的每一出口佇列連接到這些緩存佇列的不同一個。交換機針對每一出口埠的每一出口佇列可產生一緊急度,且該緊急度用來反映對應的出口佇列即將快沒有封包送的程度。緩存排程器則根據每一出口佇列的緊急度,選擇這些緩存佇列的一個來送出其存放的封包至所需前往的目標出口埠的目標出口佇列。In addition, the embodiment of the present invention further provides a switch including a plurality of cache queues, a plurality of egress ports, and a cache scheduler. Each egress port has multiple egress queues, and each egress queue of each egress port is connected to a different one of these cache queues. The switch can generate an urgency for each egress queue of each egress port, and the urgency is used to reflect the degree to which the corresponding egress queue is about to be out of packets. The cache scheduler selects one of these cache queues according to the urgency of each egress queue to send the stored packets to the target egress queue of the desired egress port.
為使能更進一步瞭解本發明的特徵及技術內容,請參閱以下有關本發明的詳細說明與圖式,然而所提供的圖式僅用於提供參考與說明,並非用來對本發明加以限制。In order to further understand the features and technical content of the present invention, please refer to the following detailed description and drawings about the present invention. However, the provided drawings are only for reference and description, and are not used to limit the present invention.
以下是通過特定的具體實施例來說明本發明的實施方式,本領域技術人員可由本說明書所提供的內容瞭解本發明的優點與效果。本發明可通過其他不同的具體實施例加以施行或應用,本說明書中的各項細節也可基於不同觀點與應用,在不悖離本發明的構思下進行各種修改與變更。另外,本發明的附圖僅為簡單示意說明,並非依實際尺寸的描繪,事先聲明。以下的實施方式將進一步詳細說明本發明的相關技術內容,但所提供的內容並非用以限制本發明的保護範圍。The following are specific specific examples to illustrate the implementation of the present invention. Those skilled in the art can understand the advantages and effects of the present invention from the content provided in this specification. The present invention can be implemented or applied through other different specific embodiments, and various details in this specification can also be based on different viewpoints and applications, and various modifications and changes can be made without departing from the concept of the present invention. In addition, the drawings of the present invention are merely schematic illustrations, and are not drawn according to actual size, and are stated in advance. The following embodiments will further describe the related technical content of the present invention in detail, but the provided content is not intended to limit the protection scope of the present invention.
應當理解的是,雖然本文中可能會使用到“第一”、“第二”、“第三”等術語來描述各種元件或者信號,但這些元件或者信號不應受這些術語的限制。這些術語主要是用以區分一元件與另一元件,或者一信號與另一信號。另外,本文中所使用的術語“或”,應視實際情況可能包含相關聯的列出項目中的任一個或者多個的組合。It should be understood that although terms such as “first”, “second”, and “third” may be used herein to describe various elements or signals, these elements or signals should not be limited by these terms. These terms are mainly used to distinguish one element from another, or one signal from another signal. In addition, the term "or" used in this text should include any one or a combination of more of the associated listed items depending on the actual situation.
請同時參閱圖4和圖5,圖4是本發明實施例所提供的排程方法的步驟流程圖,圖5則是本發明實施例所提供的交換機使用圖4的排程方法的第一示意圖。如圖5所示,交換機5可包括多個緩存佇列、多個出口埠和緩存排程器53。如前所述,每一緩存佇列用來存放不同優先級的封包,每一出口埠具有多個出口佇列,且每一出口埠的每一出口佇列連接到這些緩存佇列的不同一個,以也用來存放不同優先級的封包。Please refer to FIG. 4 and FIG. 5 at the same time. FIG. 4 is a flowchart of the steps of the scheduling method provided by an embodiment of the present invention, and FIG. 5 is a first schematic diagram of the switch provided by an embodiment of the present invention using the scheduling method of FIG. 4 . As shown in FIG. 5, the
為了方便以下說明,圖5僅以兩個緩存佇列AQ0、AQ1和三個出口埠為例,但本發明不以此為限制。因此,圖5的每一出口埠具有兩個出口佇列Q0和Q1,且每一出口埠的出口佇列Q0和Q1分別連接到緩存佇列AQ0和AQ1,以用來存放不同優先級的封包。另外,交換機5可針對每一出口埠的每一出口佇列產生一緊急度Q
n_URG。以圖5為例,
n為0或1,且緊急度Q
n_URG用來反映對應的出口佇列Q
n即將快沒有封包送的程度。
For the convenience of the following description, FIG. 5 only takes two cache queues AQ0, AQ1 and three egress ports as an example, but the present invention is not limited thereto. Therefore, each egress port in Figure 5 has two egress queues Q0 and Q1, and the egress queues Q0 and Q1 of each egress port are respectively connected to the buffer queues AQ0 and AQ1 to store packets of different priorities. . In addition, the
實作上,每一出口佇列可個別配置高、低兩個閾值,即高閾值THR_HIGH和低閾值THR_LOW。接著,交換機5可將每一出口佇列目前累積的封包數量作為其佇列使用量,並根據封包數量和這兩個閾值的比較結果來產生緊急度Q
n_URG。舉例來說,當出口埠P1的出口佇列Q0目前累積的封包數量小於等於低閾值THR_LOW時,交換機5可針對出口埠P1的出口佇列Q0產生數值為1的緊急度Q0_URG。
In practice, each exit queue can be individually configured with high and low thresholds, namely the high threshold THR_HIGH and the low threshold THR_LOW. Then, the
另外,當出口埠P0的出口佇列Q1目前累積的封包數量大於低閾值THR_LOW,並小於等於高閾值THR_HIGH時,交換機5可針對出口埠P0的出口佇列Q1產生數值為2的緊急度Q1_URG。相對地,當出口埠P0的出口佇列Q0目前累積的封包數量大於高閾值THR_HIGH時,交換機5可針對出口埠P0的出口佇列Q0產生數值為3的緊急度Q0_URG,但本發明皆不以此為限制。總而言之,在本實施例中,每一出口佇列的緊急度Q
n_URG是可根據其佇列使用量和至少一閾值的比較結果來產生,且本實施例假設數值越低的緊急度Q
n_URG代表對應的出口佇列Q
n越即將快沒有封包送。
In addition, when the number of packets currently accumulated in the egress queue Q1 of the egress port P0 is greater than the low threshold THR_LOW and less than or equal to the high threshold THR_HIGH, the
另一方面,當每一出口佇列目前累積的封包數量相同時,流速越快的出口佇列Q
n越即將快沒有封包送。因此,在其它實施例中,每一出口佇列的緊急度Q
n_URG也是可根據其佇列使用量和流速的比較結果來產生,反正只要是以佇列使用量來決定緊急度Q
n_URG就能符合本發明的技術精神。類似地,交換機5將封包數量作為佇列使用量只是舉例,本發明不限制交換機5計算佇列使用量的具體實現方式。在其它實施例中,交換機5也可將位元組計數(Byte Count)作為佇列使用量,反正只要緩存排程器53是根據每一出口佇列的佇列使用量來調度緩存佇列就能符合本發明的技術精神。也就是說,根據每一出口佇列的緊急度Q
n_URG,緩存排程器53可選擇多個緩存佇列的一個來送出其存放的封包至所需前往的目標出口埠的目標出口佇列。
On the other hand, when the number of packets currently accumulated in each egress queue is the same, the faster the egress queue Q n with the faster flow rate, the sooner no packets will be sent. Therefore, in other embodiments, the urgency Q n _URG of each exit queue can also be generated based on the comparison result of its queue usage and flow rate. Anyway, as long as the queue usage is used to determine the urgency Q n _URG It can conform to the technical spirit of the present invention. Similarly, the
在本實施例中,每一出口佇列可回傳緊急度Q
n_URG至連接的緩存佇列AQ
n。接著,根據連接的每一出口佇列的緊急度Q
n_URG,交換機5可決定每一緩存佇列的一轉發封包緊急度AQ
n_URG,且轉發封包緊急度AQ
n_URG用來反映對應的緩存佇列AQ
n急需要送出其存放的封包的程度。以圖5為例,出口埠P0、P1和P2的出口佇列Q0分別回傳數值為3、1和3的緊急度Q0_URG至連接的緩存佇列AQ0,且交換機5可從中選出數值最低的緊急度Q0_URG作為緩存佇列AQ0的轉發封包緊急度AQ0_URG,即AQ0_URG=1。應當理解的是,為了能反映緩存佇列AQ0急需要送出封包的程度,所以交換機5選擇數值最低的緊急度Q0_URG作為緩存佇列AQ0的轉發封包緊急度AQ0_URG,但本發明不以此為限制。
In this embodiment, each egress queue can return the urgency Q n _URG to the connected cache queue AQ n . Then, according to the urgency Q n _URG of each connected egress queue, the
同理,出口埠P0、P1和P2的出口佇列Q1分別回傳數值為2、3和3的緊急度Q1_URG至連接的緩存佇列AQ1,且交換機5可從中選出數值最低的緊急度Q1_URG作為緩存佇列AQ1的轉發封包緊急度AQ1_URG,即AQ1_URG=2。因此,對於圖5的轉發封包緊急度AQ0_URG為1且轉發封包緊急度AQ1_URG為2來說,緩存排程器53就會優先調度緩存佇列AQ0來送出其存放的封包到所需前往的出口埠P
m的出口佇列Q0。以圖5為例,
m為0、1或2,反正就看送出的封包所需前往哪個出口埠。也就是說,根據每一緩存佇列的轉發封包緊急度AQ
n_URG,緩存排程器53可選擇最急需要送出封包的緩存佇列來做調度。
In the same way, the exit queue Q1 of the exit ports P0, P1, and P2 returns the urgency Q1_URG with values of 2, 3, and 3 to the connected cache queue AQ1, and the
本發明不限制緩存排程器53的具體實現方式,且為了方便以下說明,圖式中的緩存排程器53將大多用以處在緩存佇列和出口佇列間的一框來表示。另外,在每次有封包由緩存佇列AQ
n送到出口佇列Q
n後,就會讓出口佇列Q
n的佇列使用量產生變化,從而影響出口佇列Q
n的緊急度Q
n_URG,並連帶影響緩存佇列AQ
n的轉發封包緊急度AQ
n_URG。因此,每一出口佇列會一直回傳緊急度Q
n_URG給連接的緩存佇列AQ
n,使得緩存佇列AQ
n的轉發封包緊急度AQ
n_URG也就一直被更新,並當緩存排程器53要對多個緩存佇列來做調度時,緩存排程器53就可使用最即時的轉發封包緊急度AQ
n_URG來作為選擇依據。
The present invention does not limit the specific implementation of the
由此可見,相較於現有技術,緩存排程器53除了可不需對於緩存佇列AQ0和AQ1配置緩存佇列權重外,也不需依據緩存佇列權重來調度緩存佇列AQ0和AQ1,而是可根據每一出口佇列的佇列使用量來調度緩存佇列AQ0和AQ1。因此,如圖4所示,在步驟S410中,交換機5可針對每一出口埠的每一出口佇列產生緊急度Q
n_URG,且緊急度Q
n_URG用來反映對應的出口佇列Q
n即將快沒有封包送的程度。接著,在步驟S430中,根據每一出口佇列的緊急度Q
n_URG,緩存排程器53可選擇多個緩存佇列的一個來送出其存放的封包至所需前往的目標出口埠的目標出口佇列。
It can be seen that, compared with the prior art, the
如前所述,因為每一出口佇列可回傳緊急度Q
n_URG至連接的緩存佇列AQ
n,所以圖4的方法更可包括步驟S420,但也可以省略步驟S420。在步驟S420中,根據連接的每一出口佇列的緊急度Q
n_URG,交換機5可決定每一緩存佇列的轉發封包緊急度AQ
n_URG,且轉發封包緊急度AQ
n_URG用來反映對應的緩存佇列AQ
n急需要送出其存放的封包的程度。相對地,步驟S430的「根據每一出口佇列的緊急度Q
n_URG,緩存排程器53選擇多個緩存佇列的一個」就可以是指根據每一緩存佇列的轉發封包緊急度AQ
n_URG,緩存排程器53選擇最急需要送出封包的緩存佇列。由於細節已如同前述內容所陳,故於此就不再多加贅述。
As mentioned above, because each egress queue can return the urgency Q n _URG to the connected cache queue AQ n , the method in FIG. 4 may further include step S420, but step S420 may also be omitted. In step S420, according to the urgency Q n _URG of each egress queue of the connection, the
另一方面,當緩存排程器53在選擇多個緩存佇列的一個時,如果這些緩存佇列有兩個以上的轉發封包緊急度都反映對應的這些緩存佇列最急需要送出封包的話,緩存排程器53則採用輪循(Round Robin)或隨機的方式選擇對應的這些緩存佇列的一個。以圖6為例,
n改為0、1或2。也就是說,每一出口埠具有三個出口佇列Q0、Q1和Q2,且每一出口埠的出口佇列Q0、Q1和Q2分別連接到緩存佇列AQ0、AQ1和AQ2。因此,當轉發封包緊急度AQ0_URG和AQ1_URG皆為1,且轉發封包緊急度AQ2_URG為2時,緩存排程器53就應該會優先調度緩存佇列AQ0和AQ1。概念上,圖6的緩存排程器53可輪流調度緩存佇列AQ0和AQ1,且每次只調度緩存佇列AQ0或AQ1來送出其存放的一筆封包到所需前往的出口埠P
m的出口佇列Q0或Q1,但事實上,因為緊急度Q
n_URG的改變會影響到緩存排程器53的選擇結果,所以圖6的緩存排程器53也可採用隨機的方式選擇緩存佇列AQ0或AQ1來送出其存放的一筆封包到所需前往的出口埠P
m的出口佇列Q0或Q1。
On the other hand, when the
從另一角度而言,如果偏袒單一個緩存佇列一直將存放的封包送到某一出口佇列的話,可能會讓其它出口佇列飢餓到沒有封包可送,導致出口佇列權重失衡。以圖6為例,轉發封包緊急度AQ0_URG和AQ1_URG是分別根據出口埠P1的出口佇列Q0的緊急度Q0_URG和出口埠P0的出口佇列Q1緊急度Q1_URG來決定。因此,如果緩存排程器53優先調度緩存佇列AQ0來送出其存放的封包到出口埠P1的出口佇列Q0,且出口埠P1的出口佇列Q0的出口佇列權重較大,甚至是絕對優先權(Strict Priority,SP)的話,出口埠P1的出口佇列Q0就會一直被出口埠P1的排程器51來做調度,以至於轉發封包緊急度AQ0_URG可能會一直處於為1的情形,且緩存排程器53也就一直調度緩存佇列AQ0,而沒有機會調度緩存佇列AQ1,使得出口埠P0的出口佇列Q1容易出現沒有封包送的情形。From another point of view, if a single cache queue always sends the stored packets to a certain egress queue, it may starve other egress queues to the point that there are no packets to send, resulting in an imbalance in the weight of the egress queue. Taking Figure 6 as an example, the forwarding packet urgency levels AQ0_URG and AQ1_URG are determined according to the urgency level Q0_URG of the egress queue Q0 of the egress port P1 and the egress queue Q1 urgency Q1_URG of the egress port P0, respectively. Therefore, if the
另外,在本實施例中,緊急度Q
n_URG為1代表對應的出口佇列Q
n目前累積的封包數量小於等於低閾值THR_LOW,且這有兩種情形所導致出口佇列Q
n累積的封包數量小於等於低閾值THR_LOW。第一種情形是出口佇列Q
n累積的封包快要被送完,所以緩存佇列AQ
n急需要送出封包到出口佇列Q
n,而第二種情形是還沒有封包被送到出口佇列Q
n,所以緩存排程器53可暫緩調度緩存佇列AQ
n。以圖7為例,中央緩存記憶體64的每一緩存佇列更可對送往每一出口埠的封包進行計數,並根據計數的結果決定每一出口埠的每一出口佇列的一無意義狀態值P
mQ
n_EMP_STA。
In addition, in this embodiment, the urgency Q n _URG of 1 means that the current accumulated number of packets in the corresponding egress queue Q n is less than or equal to the low threshold THR_LOW, and there are two situations that result in the accumulated packets in the egress queue Q n The number is less than or equal to the low threshold THR_LOW. The first situation is that the accumulated packets in the egress queue Q n are about to be delivered, so the buffer queue AQ n urgently needs to send the packets to the egress queue Q n , and the second situation is that no packets have been sent to the egress queue. Q n , so the
舉例來說,當緩存佇列AQ n對送往出口埠P m的封包進行計數,且計數的結果等於0時,本實施例則決定出口埠P m的出口佇列Q n的無意義狀態值P mQ n_EMP_STA為成立(TRUE)。反之,當緩存佇列AQ n對送往出口埠P m的封包進行計數,且計數的結果不等於0時,本實施例則決定出口埠P m的出口佇列Q n的無意義狀態值P mQ n_EMP_STA為不成立(FALSE)。也就是說,無意義狀態值P mQ n_EMP_STA可用來指示是否沒有封包被送到出口埠P m的出口佇列Q n。如圖7所示,緩存佇列AQ0只有會送封包到出口埠P0和P2,而沒有會送封包到出口埠P1。因此,出口埠P0和P2的出口佇列Q0的無意義狀態值P0Q0_EMP_STA和P2Q0_EMP_STA皆為FALSE,且出口埠P1的出口佇列Q0的無意義狀態值P1Q0_EMP_STA為TRUE。 For example, when the buffer queue AQ n counts the packets sent to the egress port P m , and the result of the count is equal to 0, this embodiment determines the meaningless state value of the egress queue Q n of the egress port P m P m Q n _EMP_STA is established (TRUE). Conversely, when the buffer queue AQ n counts the packets sent to the egress port P m , and the result of the count is not equal to 0, this embodiment determines the meaningless state value P of the egress queue Q n of the egress port P m m Q n _EMP_STA is not established (FALSE). In other words, the meaningless status value P m Q n _EMP_STA can be used to indicate whether no packets are sent to the egress queue Q n of the egress port P m . As shown in Figure 7, the buffer queue AQ0 will only send packets to the egress port P0 and P2, but not the egress port P1. Therefore, the meaningless state values P0Q0_EMP_STA and P2Q0_EMP_STA of the egress queue Q0 of the egress ports P0 and P2 are both FALSE, and the meaningless state value P1Q0_EMP_STA of the egress queue Q0 of the egress port P1 is TRUE.
另外,圖7的每一緩存佇列更可配置一邏輯電路,用來接收與對應的緩存佇列AQ
n連接的每一出口埠的每一出口佇列的無意義狀態值P
mQ
n_EMP_STA和回傳的緊急度Q
n_URG,以決定緩存佇列AQ
n的轉發封包緊急度AQ
n_URG,並且將緩存佇列AQ
n的轉發封包緊急度AQ
n_URG傳送至緩存排程器53。在本實施例中,每一邏輯電路則利用無意義狀態值P
mQ
n_EMP_STA來對出口埠P
m的出口佇列Q
n的緊急度Q
n_URG做前置處理,以排除對應的緩存佇列AQ
n從未送出封包到出口佇列Q
n的情形。也就是說,根據無意義狀態值P
mQ
n_EMP_STA,邏輯電路可調整出口埠P
m的出口佇列Q
n回傳的緊急度Q
n_URG。
In addition, each cache queue of FIG. 7 can be further configured with a logic circuit for receiving the meaningless state value P m Q n _EMP_STA of each egress queue of each egress port connected to the corresponding cache queue AQ n and the degree of urgency backhaul Q n _URG, to determine the cache queue AQ n the degree of urgency of the packet forwarding AQ n _URG, and the buffer queue AQ n the degree of urgency of the packet forwarding AQ n _URG conveyed to
舉例來說,當無意義狀態值P
mQ
n_EMP_STA為TRUE時,邏輯電路可調整出口埠P
m的出口佇列Q
n的緊急度Q
n_URG為一特別值,例如4來表示出口埠P
m的出口佇列Q
n不需要緩存佇列AQ
n的服務。如圖7所示,因為無意義狀態值P1Q0_EMP_STA為TRUE,所以邏輯電路65可調整出口埠P1的出口佇列Q0的緊急度Q0_URG從1變更為4。這樣一來,根據出口埠P0和P2的出口佇列Q0分別回傳的緊急度Q0_URG為3和3,以及調整後的出口埠P1的出口佇列Q0的緊急度Q0_URG為4,邏輯電路65可從中選出數值最低的緊急度Q0_URG作為緩存佇列AQ0的轉發封包緊急度AQ0_URG,即AQ0_URG=3。由於細節已如同前述內容所陳,故於此就不再多加贅述。
For example, when the meaningless state value P m Q n _EMP_STA is TRUE, the logic circuit can adjust the urgency Q n _URG of the exit queue Q n of the exit port P m to a special value, such as 4 to indicate the exit port P m exit queue buffer queue Q n AQ n need not service. As shown in FIG. 7, because the meaningless state value P1Q0_EMP_STA is TRUE, the
另一方面,由前述內容可知,閾值會影響緊急度Q n_URG的對應值,所以實作上,本發明可將連接速度(Link Speed)、限流速度(Rate Limit)、出口佇列權重,以及出口佇列是否被賦予SP等因素來作為閾值的配置依據。以圖8為例,雖然出口埠P0、P1和P2的連接速度都是1Gbps,但出口埠P2的出口佇列Q1被賦予SP來優先被選出傳送封包,所以可預期出口埠P2的出口佇列Q1將不會累積太多封包,從而其閾值也就需要配置高一點來讓緩存排程器更積極地調度封包到出口佇列Q1,例如出口埠P2的出口佇列Q1的高閾值THR_HIGH和低閾值THR_LOW,以真實反映SP佇列的需求。 On the other hand, it can be seen from the foregoing that the threshold will affect the corresponding value of the urgency Q n _URG, so in practice, the present invention can set the link speed (Link Speed), the current limit speed (Rate Limit), and the weight of the exit queue, And whether the exit queue is assigned SP and other factors as the basis for the configuration of the threshold. Taking Figure 8 as an example, although the connection speeds of the egress ports P0, P1, and P2 are all 1Gbps, the egress queue Q1 of the egress port P2 is given SP to be selected to transmit packets first, so the egress queue of the egress port P2 can be expected Q1 will not accumulate too many packets, so its threshold needs to be configured higher to allow the cache scheduler to more actively schedule packets to the egress queue Q1, such as the high threshold THR_HIGH and low of the egress queue Q1 of the egress port P2 Threshold value THR_LOW, to truly reflect the demand of SP queue.
另外,當出口埠P0的出口佇列Q0和Q1的出口佇列權重分別為1和8時,出口埠P0的出口佇列Q1就會比出口埠P0的出口佇列Q0有8倍的機會被選出傳送封包。然後,為了維持封包的傳送比例能夠1:8,交換機5會希望出口埠P0的出口佇列Q1一直有封包累積以等待被送出。因此,出口埠P0的出口佇列Q1的封包需求大於出口埠P0的出口佇列Q0的封包需求,且出口埠P0的出口佇列Q1的閾值也就可配置得比出口埠P0的出口佇列Q0的閾值高,來讓緩存排程器更積極地調度封包到出口佇列Q1。總而言之,本發明不限制配置閾值的具體實現方式。In addition, when the outlet queue weights of the outlet queues Q0 and Q1 of the outlet port P0 are 1 and 8, respectively, the outlet queue Q1 of the outlet port P0 will be 8 times more likely than the outlet queue Q0 of the outlet port P0. Select the transmission packet. Then, in order to maintain the packet transmission ratio of 1:8, the
綜上所述,本發明實施例所提供的交換機,除了可不需對於緩存佇列配置緩存佇列權重外,也不需依據緩存佇列權重來調度緩存佇列,而是可根據每一出口佇列的佇列使用量來調度緩存佇列。因此,本發明能滿足不同出口佇列的需求,且即時服務需要封包的出口佇列,讓出口佇列權重不會失衡,也讓緩存排程器可更有效率的運作。In summary, the switch provided by the embodiment of the present invention does not need to configure the cache queue weight for the cache queue, and does not need to schedule the cache queue according to the cache queue weight, but can be based on each egress queue. The queue usage of the row is used to schedule the cache queue. Therefore, the present invention can meet the needs of different egress queues, and real-time services require a packaged egress queue, so that the weight of the egress queue will not be unbalanced, and the cache scheduler can operate more efficiently.
以上所提供的內容僅為本發明的優選可行實施例,並非因此侷限本發明的申請專利範圍,所以凡是運用本發明說明書及圖式內容所做的等效技術變化,均包含於本發明的申請專利範圍內。The content provided above is only the preferred and feasible embodiments of the present invention, and does not limit the scope of the patent application of the present invention. Therefore, all equivalent technical changes made using the description and schematic content of the present invention are included in the application of the present invention. Within the scope of the patent.
5:交換機
P0,P1,P2:出口埠
Q0,Q1,Q2:出口佇列
AQ0,AQ1,AQ2:緩存佇列
10,11,12,50,51,52:出口埠的排程器
13,53:緩存排程器
THR_HIGH,THR_LOW:閾值
Q0_URG,Q1_URG,Q2_URG:緊急度
AQ0_URG,AQ1_URG,AQ2_URG:轉發封包緊急度
S410~S430:流程步驟
64:中央緩存記憶體
P0Q0_EMP_STA~P2Q0_EMP_STA:無意義狀態值
65,66,67:邏輯電路5: Switch
P0, P1, P2: Outlet port
Q0, Q1, Q2: Exit queue
AQ0, AQ1, AQ2:
圖1是出口埠使用排程器依據出口佇列權重,決定從出口佇列中抓取多少個封包做傳送的示意圖。Figure 1 is a schematic diagram of the egress port using the scheduler to determine how many packets are captured from the egress queue for transmission based on the egress queue weight.
圖2是緩存佇列內的封包在通過現有的緩存排程器送到所需前往的出口埠的出口佇列的示意圖。Fig. 2 is a schematic diagram of the egress queue of packets in the cache queue that are sent to the egress port they need to go to through the existing cache scheduler.
圖3A至圖3D是現有的緩存排程器對於緩存佇列配置緩存佇列權重的示意圖。3A to 3D are schematic diagrams of the existing cache scheduler configuring the cache queue weight for the cache queue.
圖4是本發明實施例所提供的排程方法的步驟流程圖。Fig. 4 is a flowchart of the steps of a scheduling method provided by an embodiment of the present invention.
圖5是本發明實施例所提供的交換機使用圖4的排程方法的第一示意圖。FIG. 5 is a first schematic diagram of a switch provided by an embodiment of the present invention using the scheduling method of FIG. 4.
圖6是本發明實施例所提供的交換機使用圖4的排程方法的第二示意圖。FIG. 6 is a second schematic diagram of a switch provided by an embodiment of the present invention using the scheduling method of FIG. 4.
圖7是本發明實施例所提供的交換機使用圖4的排程方法的第三示意圖。FIG. 7 is a third schematic diagram of a switch provided by an embodiment of the present invention using the scheduling method of FIG. 4.
圖8是本發明實施例所提供的交換機使用圖4的排程方法的第四示意圖。FIG. 8 is a fourth schematic diagram of a switch provided by an embodiment of the present invention using the scheduling method of FIG. 4.
5:交換機 5: Switch
P0,P1,P2:出口埠 P0, P1, P2: Outlet port
Q0,Q1:出口佇列 Q0, Q1: Exit queue
AQ0,AQ1:緩存佇列 AQ0, AQ1: cache queue
50,51,52:出口埠的排程器 50, 51, 52: Scheduler of the exit port
53:緩存排程器 53: Cache Scheduler
THR_HIGH,THR_LOW:閾值 THR_HIGH, THR_LOW: threshold
Q0_URG,Q1_URG:緊急度 Q0_URG, Q1_URG: Urgency
AQ0_URG,AQ1_URG:轉發封包緊急度 AQ0_URG, AQ1_URG: The urgency of forwarding packets
Claims (9)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109129263A TWI748613B (en) | 2020-08-27 | 2020-08-27 | Switch |
US17/412,504 US20220070109A1 (en) | 2020-08-27 | 2021-08-26 | Switch and scheduling method for packet forwarding of the same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109129263A TWI748613B (en) | 2020-08-27 | 2020-08-27 | Switch |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI748613B true TWI748613B (en) | 2021-12-01 |
TW202209926A TW202209926A (en) | 2022-03-01 |
Family
ID=80357351
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109129263A TWI748613B (en) | 2020-08-27 | 2020-08-27 | Switch |
Country Status (2)
Country | Link |
---|---|
US (1) | US20220070109A1 (en) |
TW (1) | TWI748613B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102201988A (en) * | 2011-05-12 | 2011-09-28 | 西北工业大学 | Scheduling method of avionics full duplex switched Ethernet (AFDX) exchanger |
CN104852863A (en) * | 2015-04-15 | 2015-08-19 | 清华大学 | Method and device for managing dynamic threshold in switch of shared cache |
WO2017000872A1 (en) * | 2015-06-30 | 2017-01-05 | 中兴通讯股份有限公司 | Buffer allocation method and device |
TWI593253B (en) * | 2011-05-18 | 2017-07-21 | 馬維爾國際貿易有限公司 | Network traffic scheduler and associated method, computer program and computer program product |
US20180227247A1 (en) * | 2015-02-03 | 2018-08-09 | Avago Technologies General Ip (Singapore) Pte. Ltd. | Early queueing network device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7317727B2 (en) * | 2003-05-21 | 2008-01-08 | International Business Machines Corporation | Method and systems for controlling ATM traffic using bandwidth allocation technology |
US9485188B2 (en) * | 2013-02-01 | 2016-11-01 | International Business Machines Corporation | Virtual switching based flow control |
-
2020
- 2020-08-27 TW TW109129263A patent/TWI748613B/en active
-
2021
- 2021-08-26 US US17/412,504 patent/US20220070109A1/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102201988A (en) * | 2011-05-12 | 2011-09-28 | 西北工业大学 | Scheduling method of avionics full duplex switched Ethernet (AFDX) exchanger |
TWI593253B (en) * | 2011-05-18 | 2017-07-21 | 馬維爾國際貿易有限公司 | Network traffic scheduler and associated method, computer program and computer program product |
US20180227247A1 (en) * | 2015-02-03 | 2018-08-09 | Avago Technologies General Ip (Singapore) Pte. Ltd. | Early queueing network device |
CN104852863A (en) * | 2015-04-15 | 2015-08-19 | 清华大学 | Method and device for managing dynamic threshold in switch of shared cache |
WO2017000872A1 (en) * | 2015-06-30 | 2017-01-05 | 中兴通讯股份有限公司 | Buffer allocation method and device |
Also Published As
Publication number | Publication date |
---|---|
TW202209926A (en) | 2022-03-01 |
US20220070109A1 (en) | 2022-03-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10764208B2 (en) | Distributed switch architecture | |
US7426185B1 (en) | Backpressure mechanism for switching fabric | |
US7953002B2 (en) | Buffer management and flow control mechanism including packet-based dynamic thresholding | |
US8218546B2 (en) | Interleaved processing of dropped packets in a network device | |
US7058057B2 (en) | Network switch port traffic manager having configurable packet and cell servicing | |
US9083655B2 (en) | Internal cut-through for distributed switches | |
US8467295B2 (en) | System and methods for distributed quality of service enforcement | |
US20070070895A1 (en) | Scaleable channel scheduler system and method | |
US20020141427A1 (en) | Method and apparatus for a traffic optimizing multi-stage switch fabric network | |
US20110038261A1 (en) | Traffic manager and a method for a traffic manager | |
US20020097733A1 (en) | Packet transmitting apparatus | |
US20100150164A1 (en) | Flow-based queuing of network traffic | |
US20110019544A1 (en) | Systems for scheduling the transmission of data in a network device | |
WO2002062013A2 (en) | Methods and systems providing fair queuing and priority scheduling to enhance quality of service in a network | |
EP1654616A2 (en) | Method and apparatus for bandwidth guarantee and overload protection in a network switch | |
KR20030019608A (en) | Method and apparatus for reducing pool starvation in a shared memory switch | |
WO2003005227A1 (en) | Method and apparatus for allocating link bandwidth | |
CA2462793C (en) | Distributed transmission of traffic streams in communication networks | |
US20050047405A1 (en) | Switching device for controlling data packet flow | |
US7477636B2 (en) | Processor with scheduler architecture supporting multiple distinct scheduling algorithms | |
US8879578B2 (en) | Reducing store and forward delay in distributed systems | |
JP4164771B2 (en) | Load balance type switch device and load balance type switch method | |
US7769026B2 (en) | Efficient sort scheme for a hierarchical scheduler | |
TWI748613B (en) | Switch | |
US7619971B1 (en) | Methods, systems, and computer program products for allocating excess bandwidth of an output among network users |