TWI411268B - Sending speed controlling method for multi-cast packages - Google Patents
Sending speed controlling method for multi-cast packages Download PDFInfo
- Publication number
- TWI411268B TWI411268B TW99140665A TW99140665A TWI411268B TW I411268 B TWI411268 B TW I411268B TW 99140665 A TW99140665 A TW 99140665A TW 99140665 A TW99140665 A TW 99140665A TW I411268 B TWI411268 B TW I411268B
- Authority
- TW
- Taiwan
- Prior art keywords
- time
- multicast packet
- transmission
- error
- accumulated
- Prior art date
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本發明係關於一種多播封包的發送速度控制方法,特別是一種高精密度的多播封包的發送速度控制方法。The invention relates to a transmission speed control method for a multicast packet, in particular to a transmission speed control method for a high-precision multicast packet.
在與網路封包的發送技術相關的領域中,對發送速度進行控制是一個重要的議題。網路資料發送速度的計算方式是資料發送量與發送時間的比值。目前,微軟(Microsoft)的視窗(Windows)系統係使用延時(Sleep)函數控制網路封包的發送速度。延時函數就是在延時過程中不佔用系統資源,但是它的精度太低,大約僅能精確到毫秒級。且實際執行延時函數時的誤差一般會達到10毫秒,因此不適用於需要高速且穩定之發送速度的應用。Controlling the transmission speed is an important issue in the field related to the transmission technology of network packets. The network data transmission speed is calculated as the ratio of the data transmission amount to the transmission time. Currently, Microsoft's Windows (Windows) system uses the Sleep function to control the speed at which network packets are sent. The delay function does not occupy system resources during the delay, but its accuracy is too low, only about milliseconds. And the error when the delay function is actually implemented is generally 10 milliseconds, so it is not suitable for applications that require high speed and stable transmission speed.
而視窗系統亦提供了一種精度能與機器時鐘同步計數器,其能精確到奈秒(ns)級。但是利用此計數器進行延遲的方法需要系統頻繁計數並確認延時時間是否到達,而嚴重佔用中央處理器(central processor unit,CPU)資源,進而影響其他軟體及系統的運行。The Windows system also provides a precision counter that can be synchronized with the machine clock, which is accurate to the nanosecond (ns) level. However, the method of using this counter for delay requires the system to frequently count and confirm whether the delay time is reached, and seriously occupy the central processor unit (CPU) resources, thereby affecting the operation of other software and systems.
也就是說,在傳統上發送多播(multi-cast)等網路封包的發送速度控制中,具有延時精度過低而容易引起發送速度之波動的問題,或是具有需要極度耗費CPU資源的缺點。That is to say, in the transmission speed control of conventionally transmitting a network packet such as a multi-cast, there is a problem that the delay precision is too low and the fluctuation of the transmission speed is likely to occur, or there is a disadvantage that the CPU resource is required to be extremely expensive. .
為了解決上述問題,在此提供一種多播封包(multi-cast package)的發送速度控制方法,其用於令一網路卡(network interface card,NIC)以一目標速度發送多個多播封包。多播封包的發送速度控制方法包括:依據多播封包的大小以及目標速度計算一標準時間,並記錄一累計誤差時間;發送多播封包之一,並計算發送的多播封包的一發送時間;計算標準時間與發送時間的差值,將標準時間與發送時間的差值記錄為一本次誤差時間,將累計誤差時間與本次誤差時間合計,並將合計結果記錄一預定休眠時間;當預定休眠時間大於一誤差門檻值時,執行以下步驟:休眠預定休眠時間;自休眠中被喚醒,並計算一實際休眠時間;以及計算得到新的累計誤差時間為預定休眠時間減實際休眠時間;以及回到上述「依據多播封包的大小以及目標速度計算標準時間,並記錄累計誤差時間」的步驟,以發送下一個多播封包。In order to solve the above problem, there is provided a multicast speed control method for a multi-cast package for causing a network interface card (NIC) to transmit a plurality of multicast packets at a target speed. The sending speed control method of the multicast packet includes: calculating a standard time according to the size of the multicast packet and the target speed, and recording a cumulative error time; transmitting one of the multicast packets, and calculating a sending time of the sent multicast packet; Calculate the difference between the standard time and the transmission time, record the difference between the standard time and the transmission time as a current error time, total the accumulated error time and the current error time, and record the total result for a predetermined sleep time; When the sleep time is greater than an error threshold, the following steps are performed: sleeping a predetermined sleep time; awakening from sleep, and calculating an actual sleep time; and calculating a new accumulated error time to be a predetermined sleep time minus an actual sleep time; Go to the above "calculate the standard time based on the size of the multicast packet and the target speed, and record the accumulated error time" to send the next multicast packet.
其中在「依據多播封包的大小以及目標速度計算一標準時間,並記錄一累計誤差時間」的步驟之中,另可包括:建立一累計發送時間。而在「發送多播封包之一,並計算發送的多播封包的一發送時間」的步驟之前,多播封包的處理方法另可包括:計算一累計發送時間;以及當累計發送時間大於一累計時間門檻值時,將累計誤差時間以及累計發送時間重設為0。In the step of “calculating a standard time according to the size of the multicast packet and the target speed, and recording a cumulative error time”, the method may further include: establishing an accumulated transmission time. Before the step of "sending one of the multicast packets and calculating a transmission time of the transmitted multicast packet", the processing method of the multicast packet may further include: calculating an accumulated transmission time; and when the cumulative transmission time is greater than one accumulation When the time threshold is exceeded, the accumulated error time and the accumulated transmission time are reset to zero.
根據一實施範例,多播封包的發送速度控制方法另可包括:當預定休眠時間不大於一誤差門檻值時,將預定休眠時間 作為新的累計誤差時間。其中發送時間可以是將發送的多播封包發送前後的一系統時間相減得到。According to an embodiment, the sending speed control method of the multicast packet may further include: when the predetermined sleep time is not greater than an error threshold, the predetermined sleep time is to be determined. As a new cumulative error time. The sending time may be obtained by subtracting a system time before and after the sending of the multicast packet.
此外,上述之累計時間門檻值可以是1秒(s)。誤差門檻值可以是1毫秒(ms)。實際休眠時間可以是大於10毫秒。Further, the above accumulated time threshold may be 1 second (s). The error threshold can be 1 millisecond (ms). The actual sleep time can be greater than 10 milliseconds.
綜上所述,多播封包的發送速度控制方法利用原本為低精度的延時函數,來實現高精度的多播封包的發送速度控制。透過即時將累積誤差時間回饋給延時函數,並定時將其清空的技術,多播封包的發送速度控制方法能夠保證網路資料傳輸的高效穩定又不佔用過多的中央處理器(central processor unit,CPU)資源。In summary, the transmission speed control method of the multicast packet utilizes a delay function originally low precision to implement high-precision transmission rate control of the multicast packet. By instantaneously feeding back the accumulated error time to the delay function and periodically clearing it, the transmission speed control method of the multicast packet can ensure the efficient and stable network data transmission without occupying too much central processor unit (CPU). ) Resources.
以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟習相關技藝者了解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技藝者可輕易地理解本發明相關之目的及優點。The detailed features and advantages of the present invention are set forth in the Detailed Description of the Detailed Description of the <RTIgt; </ RTI> <RTIgt; </ RTI> </ RTI> </ RTI> <RTIgt; The objects and advantages associated with the present invention can be readily understood by those skilled in the art.
本發明係關於一種多播封包(multi-cast package)的發送速度控制方法,其用於令一網路卡(network interface card,NIC)以一目標速度發送多個多播封包。The present invention relates to a multicast speed control method for a multi-cast package for causing a network interface card (NIC) to transmit a plurality of multicast packets at a target speed.
請參照「第1圖」,其係為一實施範例之多播封包的發送速度控制方法之流程圖。Please refer to FIG. 1 , which is a flowchart of a method for controlling the transmission rate of a multicast packet according to an embodiment.
多播封包的發送速度控制方法首先依據要傳送之多播封包的大小以及目標速度計算一標準時間,並記錄一累計誤差時間(步驟S110)。其中標準時間為多播封包的大小除以目標速度的商數。接著令網路卡實際以目標速度發送一個多播封包,並計算發送的多播封包的一發送時間(步驟S120)。The transmission rate control method of the multicast packet first calculates a standard time according to the size of the multicast packet to be transmitted and the target speed, and records an accumulated error time (step S110). The standard time is the size of the multicast packet divided by the quotient of the target speed. The network card is then actually sent a multicast packet at the target speed, and a transmission time of the transmitted multicast packet is calculated (step S120).
發送時間可以是將發送的多播封包發送前後的一系統時間相減得到。更詳細地說,可以在發送多播封包前後讀取包括此網路卡的計算機所維護的系統時間,再將發送前後的時間相減便能得到實際發送此多播封包所花費的發送時間。The sending time may be obtained by subtracting a system time before and after the sending of the multicast packet. In more detail, the system time maintained by the computer including the network card can be read before and after the multicast packet is sent, and the time before and after the transmission can be subtracted to obtain the transmission time of actually transmitting the multicast packet.
接著計算標準時間與發送時間的差值,將標準時間與發送時間的差值記錄為本次誤差時間;將累計誤差時間與本次誤差時間合計,並將合計結果記錄一預定休眠時間(步驟S130)。也就是說,在步驟S130中將累計誤差時間回饋至預定休眠時間,以更靈敏地反應及調整發送速度。Then, the difference between the standard time and the transmission time is calculated, and the difference between the standard time and the transmission time is recorded as the error time; the accumulated error time is combined with the current error time, and the total result is recorded as a predetermined sleep time (step S130). ). That is, the cumulative error time is fed back to the predetermined sleep time in step S130 to more sensitively react and adjust the transmission speed.
得到預定休眠時間後,判斷預定休眠時間是否大於一誤差門檻值(步驟S140)。根據一實施範例,誤差門檻值可以是1毫秒(ms)。誤差門檻值能夠確實地掌握發送速度的控制的精準度,可依實際發送多播封包的需要設定,在此並不對其做限制。After the predetermined sleep time is obtained, it is determined whether the predetermined sleep time is greater than an error threshold (step S140). According to an embodiment, the error threshold may be 1 millisecond (ms). The error threshold can accurately grasp the accuracy of the control of the transmission speed, and can be set according to the actual need to send the multicast packet, and is not limited herein.
當預定休眠時間大於誤差門檻值時,令網路卡休眠一預定休眠時間,其中預定休眠時間為累計誤差時間加上本次誤差時間的和(步驟S160)。步驟S160中可透過例如視窗(Windows) 系統的延時(Sleep)函數等應用程式介面(application program interface,API)實作。相對的,當預定休眠時間不大於誤差門檻值時,則可將預定休眠時間作為新的累計誤差時間(步驟S150)。When the predetermined sleep time is greater than the error threshold, the network card is caused to sleep for a predetermined sleep time, wherein the predetermined sleep time is the sum of the accumulated error time plus the current error time (step S160). In step S160, for example, Windows (Windows) can be accessed. The application program interface (API) is implemented by the system's delay function. In contrast, when the predetermined sleep time is not greater than the error threshold, the predetermined sleep time may be taken as the new accumulated error time (step S150).
由步驟S150以及S160可以見悉,多播封包的發送速度控制方法將每次延時產生的本次誤差時間進行保留,而不是丟棄。本次誤差時間並即時回饋至下一次的延時控制中,而能夠動態補償誤差,從而減小延時誤差以及提高控制精度。此外,由於利用這種誤差補償機制,即使縮小測量時間產生的誤差也可以得到有效補償。It can be seen from steps S150 and S160 that the transmission rate control method of the multicast packet preserves the current error time generated by each delay instead of discarding. The error time is immediately fed back to the next delay control, and the error can be dynamically compensated, thereby reducing the delay error and improving the control precision. In addition, since such an error compensation mechanism is utilized, even an error caused by reducing the measurement time can be effectively compensated.
網路卡休眠了預定休眠時間之後自休眠中被喚醒,並計算實際休眠時間(步驟S170)。類似地,亦可將網路卡休眠前後的系統時間相減,以得到實際休眠時間。由於Sleep函數的可測精度大於10毫秒,因此一般而言實際休眠時間均會大於10毫秒。The network card wakes up from sleep after sleeping for a predetermined sleep time, and calculates an actual sleep time (step S170). Similarly, the system time before and after the network card is hibernated can be subtracted to obtain the actual sleep time. Since the measurable accuracy of the Sleep function is greater than 10 milliseconds, the actual sleep time will generally be greater than 10 milliseconds.
多播封包的發送速度控制方法接著計算預定休眠時間減去實際休眠時間的差值,並將預定休眠時間減去實際休眠時間的差值作為新的累計誤差時間(步驟S180)。且每傳送一個多播封包後都會判斷是否已將全部的多播封包發送完成(步驟S190)。若是,則可結束控制。若否,則回到步驟S110以發送下一個多播封包。The transmission rate control method of the multicast packet then calculates the difference between the predetermined sleep time minus the actual sleep time, and subtracts the difference between the predetermined sleep time and the actual sleep time as the new accumulated error time (step S180). And after transmitting one multicast packet, it is judged whether all the multicast packets have been transmitted (step S190). If yes, the control can be ended. If not, the process returns to step S110 to transmit the next multicast packet.
須注意的是,上述之「誤差門檻值」、「實際休眠時間」以 及「累計時間門檻值」所舉例的數值都可依實際發送多播封包的需要設定,在此並不對其做限制。透過調整這些數值,可以設定動態誤差補償的範圍,以及多快可以恢復到目標設定速度等。It should be noted that the above-mentioned "error threshold" and "actual sleep time" are The values exemplified by the "accumulated time threshold" can be set according to the actual need to send the multicast packet, and are not limited herein. By adjusting these values, you can set the range of dynamic error compensation and how quickly you can return to the target set speed.
請參考「第2圖」,其係為另一實施範例之多播封包的發送速度控制方法之部分流程圖。於本實施範例中,在步驟S110亦可同時建立一累計發送時間。且在實際發送多播封包(步驟S120)之前可執行下述用以重置累計誤差時間。Please refer to "FIG. 2", which is a partial flow chart of a transmission speed control method of a multicast packet of another embodiment. In this embodiment, an accumulated transmission time can also be established at step S110. And the following may be performed to reset the accumulated error time before actually transmitting the multicast packet (step S120).
在每次發送多播封包之前,先計算累計發送時間(步驟S210);也就是計算累計發送時間被建立或是被重置為0到目前已過了多久的時間。接著判斷發送時間是否大於一累計時間門檻值(步驟S220);當大於累計時間門檻值時,將累計誤差時間以及累計發送時間重設為0(步驟S230)。The cumulative transmission time is calculated before each transmission of the multicast packet (step S210); that is, the time when the accumulated transmission time is established or reset to 0 to how long has elapsed. Next, it is judged whether the transmission time is greater than an accumulated time threshold (step S220); when it is greater than the accumulated time threshold, the accumulated error time and the accumulated transmission time are reset to 0 (step S230).
根據一實施範例,累積誤差門檻值可以是1秒(s)。累積誤差門檻值亦可依實際發送多播封包的需要設定,在此並不對其做限制。由於每隔一段時間便將累積誤差時間重置為0,故能夠保證累積誤差時間在一小段時間內進行動態誤差補償。According to an embodiment, the cumulative error threshold may be 1 second (s). The cumulative error threshold can also be set according to the actual need to send the multicast packet, and is not limited herein. Since the accumulated error time is reset to 0 at intervals, it is possible to ensure that the accumulated error time is subjected to dynamic error compensation for a short period of time.
請參照「第3圖」,其係為一實施範例之發送速度之曲線圖。由「第3圖」的一發送速度曲線20可以見悉,網路卡剛開始啟動時尚在進行環境的配置等動作而無法快速傳送多播封包。但隨後為了將累積的多播封包即時傳出,變成完全不需執行延時函數,能傳多快就傳多快而達到網路卡的發送速度上 限。但為了調整過快的發送速度,多播封包的發送速度控制方法透過累積誤差時間迅速地將發送速度回復到目標速度。Please refer to "3", which is a graph of the transmission speed of an embodiment. It can be seen from a transmission speed curve 20 of "Fig. 3" that the network card has just started to activate the configuration of the environment, and cannot quickly transmit the multicast packet. But then in order to instantly transmit the accumulated multicast packets, it becomes completely unnecessary to execute the delay function, and how fast can be transmitted to reach the transmission speed of the network card. limit. However, in order to adjust the transmission speed too fast, the transmission rate control method of the multicast packet quickly returns the transmission speed to the target speed through the accumulated error time.
綜上所述,多播封包的發送速度控制方法即時將累積誤差時間回饋給延時函數,並定時將其清空。因此多播封包的發送速度控制方法能夠保證網路資料傳輸的高效穩定又不佔用過多的中央處理器(central processor unit,CPU)資源。換句話說,多播封包的發送速度控制方法能夠同時達到低資源利用率以及高精度控制的效果。更進一步地,本方法能保證多播資料能高速穩定傳輸,並減少了網路資料傳輸出錯的可能性。In summary, the transmission speed control method of the multicast packet immediately feeds back the accumulated error time to the delay function and periodically empties it. Therefore, the transmission speed control method of the multicast packet can ensure efficient and stable network data transmission without occupying excessive central processor unit (CPU) resources. In other words, the transmission rate control method of the multicast packet can achieve the effects of low resource utilization and high-precision control at the same time. Furthermore, the method can ensure that the multicast data can be transmitted at a high speed and stably, and the possibility of network data transmission errors is reduced.
以上較佳具體實施範例之詳述,是希望藉此更加清楚描述本發明之特徵與精神,並非以上述揭露的較佳具體實施範例對本發明之範疇加以限制。相反地,其目的是希望將各種改變及具相等性的安排涵蓋於本發明所欲申請之專利範圍的範疇內。The above detailed description of the preferred embodiments of the present invention is intended to provide a further understanding of the scope of the invention. On the contrary, the intention is to cover various modifications and equivalent arrangements within the scope of the invention as claimed.
20‧‧‧發送速度曲線20‧‧‧Send speed curve
第1圖係為一實施範例之多播封包的發送速度控制方法之流程圖。1 is a flow chart showing a method of controlling a transmission rate of a multicast packet of an embodiment.
第2圖係為另一實施範例之多播封包的發送速度控制方法之部分流程圖。2 is a partial flow chart of a transmission rate control method of a multicast packet of another embodiment.
第3圖係為一實施範例之發送速度之曲線圖。Figure 3 is a graph of the transmission speed of an embodiment.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW99140665A TWI411268B (en) | 2010-11-24 | 2010-11-24 | Sending speed controlling method for multi-cast packages |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW99140665A TWI411268B (en) | 2010-11-24 | 2010-11-24 | Sending speed controlling method for multi-cast packages |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201223200A TW201223200A (en) | 2012-06-01 |
TWI411268B true TWI411268B (en) | 2013-10-01 |
Family
ID=46725432
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW99140665A TWI411268B (en) | 2010-11-24 | 2010-11-24 | Sending speed controlling method for multi-cast packages |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI411268B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7130668B2 (en) * | 2003-09-01 | 2006-10-31 | Samsung Electronics Co., Ltd. | Method and system for controlling sleep mode in broadband wireless access communication system |
US7219171B2 (en) * | 2003-12-16 | 2007-05-15 | Intel Corporation | Flow control for digital signal processing to support data stream operations |
US20070248118A1 (en) * | 2006-04-19 | 2007-10-25 | Nafea Bishara | Adaptive Speed Control for MAC-PHY Interfaces |
US20090325533A1 (en) * | 2008-06-27 | 2009-12-31 | Abhijit Lele | Method for using an adaptive waiting time threshold estimation for power saving in sleep mode of an electronic device |
TW201004436A (en) * | 2008-07-11 | 2010-01-16 | Ind Tech Res Inst | A method for forming a device power savings class, a mobile station for wirelee communication and wireless communication |
TW201019747A (en) * | 2008-09-15 | 2010-05-16 | Qualcomm Inc | Methods and apparatus for optimizing idle mode stand-by time in a multicast system |
-
2010
- 2010-11-24 TW TW99140665A patent/TWI411268B/en not_active IP Right Cessation
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7130668B2 (en) * | 2003-09-01 | 2006-10-31 | Samsung Electronics Co., Ltd. | Method and system for controlling sleep mode in broadband wireless access communication system |
US7219171B2 (en) * | 2003-12-16 | 2007-05-15 | Intel Corporation | Flow control for digital signal processing to support data stream operations |
US20070248118A1 (en) * | 2006-04-19 | 2007-10-25 | Nafea Bishara | Adaptive Speed Control for MAC-PHY Interfaces |
US20090325533A1 (en) * | 2008-06-27 | 2009-12-31 | Abhijit Lele | Method for using an adaptive waiting time threshold estimation for power saving in sleep mode of an electronic device |
TW201004436A (en) * | 2008-07-11 | 2010-01-16 | Ind Tech Res Inst | A method for forming a device power savings class, a mobile station for wirelee communication and wireless communication |
TW201019747A (en) * | 2008-09-15 | 2010-05-16 | Qualcomm Inc | Methods and apparatus for optimizing idle mode stand-by time in a multicast system |
Also Published As
Publication number | Publication date |
---|---|
TW201223200A (en) | 2012-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7634589B2 (en) | Method for controlling peripheral adapter interrupt frequency by estimating processor load in the peripheral adapter | |
US8909961B2 (en) | Method and apparatus for adjusting power consumption level of an integrated circuit | |
US10135708B2 (en) | Technologies for performance inspection at an endpoint node | |
US8141014B2 (en) | System and method for common history pessimism relief during static timing analysis | |
JP2006178698A (en) | Load state monitoring apparatus and load state monitoring method | |
US11275829B2 (en) | Mechanism for throttling untrusted interconnect agents | |
US20140195178A1 (en) | Estimating component power usage from aggregate power usage | |
CN111681772A (en) | Quantitative detection method, system, storage medium and terminal for epidemic situation control effect | |
US10128987B2 (en) | Scalable receive window auto-tuning | |
US8918675B2 (en) | Rectifying corrupt sequence values in distributed systems | |
KR102523589B1 (en) | Strengthening the central processing unit's quality of service guarantees when servicing accelerator requests | |
TWI411268B (en) | Sending speed controlling method for multi-cast packages | |
WO2017157164A1 (en) | Data aggregation method and device | |
US8379643B2 (en) | Method for controlling transmission speed of multi-cast packets | |
CN114638643A (en) | Multimedia data delivery prediction method and device, electronic equipment and storage medium | |
CN102457424B (en) | Transmission speed control method for multi-cast package | |
US11349586B2 (en) | Time stamping method, time stamping apparatus and program | |
JP7521496B2 (en) | Bandwidth estimation device, method, and program | |
US9183042B2 (en) | Input/output traffic backpressure prediction | |
US10503807B2 (en) | Method and apparatus for measuring time stamp unit of remote device | |
US10638290B2 (en) | Communication terminal and communication system | |
US20060143486A1 (en) | System and method to profile an unconstrained power of a processor | |
JP2011154487A (en) | Content availability management system, method, and program | |
JP7446536B1 (en) | Statistical value calculation device, propagation delay measurement system, statistical value calculation method, and statistical value calculation program | |
CN117834484A (en) | Weak network testing method and device for application program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |