201038007 六、發明說明: 【發明所屬之技術領域】 尤其涉及一種網路 本發明涉及電腦網路的流量控制 t置及網路上行頻寬的自動檢測方法 【先前技術】201038007 VI. Description of the invention: [Technical field of the invention] In particular, the invention relates to a network network flow control t setting and an automatic detection method for network uplink bandwidth [Prior Art]
版一近年來’隨著電腦技術的發展,Internet成為了人們獲 ^資!^重要平台,人們在Internet上進行大量的資訊交 :’适時候為了保證相互間資訊交流的順暢,電腦網路的 流量控制就顯得尤其重要。 當用f使用路由器等網路設備連接到網路進行訪問 時丄如果沒有流量控制的機制,報文從終端發出後,由於 頻見有.限’當流量過大時’發出報文的部分或全部將無法 到達發送目的地,這就會造成部分或全部報文的丟失,而 報文的丟失是隨機的’也就是說丟失的可能是一些對用戶 而言很,要的報文。而為了確保報文不丟失,就必須進行 網路流量的控制,也就是必須知道網路上行的頻寬,只有 知道網路上行頻寬才能夠確定報文的發送數量。 目前常用來檢測網路上行頻寬的方法有: 1. 藉由監測網路流量的方式得到上行頻寬。這種方式 的缺點是得到的數值不夠準確。當用戶實際流量不足時, 得出的數據偏小;當用戶實際流量過大且流量主要由使用 者資料報協定(User Datagram Protoco卜UDP)報文組成 時,由於UDP為無保證的非面向連接協定,故得到的數據 偏大。 2. 藉由向網路服務器發送一組網際網路控制訊息協定 (Internet Control Message Protocol,ICMP)報文,再根據 回饋報文的接收時間確定上行的頻寬。這種方式的缺點是 網路伺服器不一定會回應ICMP報文,故常常無法得到結 果。 4 201038007 【發明内容】 .上行g於此’需提供―種網路裝置’能準確地測得娜路 ο 節點偵測報文到指定目的地,2送〜組 存時間從第一值到第二值依次;網測報文為生 ί匕當網路節點收到生存時曰間為1:網ϊΞΐϊί協 ;用:判斷是否從該網路節點G收到生斷模 點。第二發送模組用J最近的網路節 〇 時間計算該網路上;的的以及該回饋報文的接收 =接組還用 ί二重,組生存時間從第-值到 人2的網際網路控制訊息協定報文到該曰指H值 法,包括供的,網路終端上行頻寬的測試方 測報文經過的網二判斷是否從該節則貞 未接收到該生存時生 5 201038007 力重二值到增大後的第二值依次增 到該生存,報文職指定目的地;若接收 的源位超妗的報文,則根據該生存時間超時的報文 最近的網路置最近的網路節點;向該距離 測報文;發送複數網際網路控制訊息協定的頻寬探 却·+在_二二距離最近的網路節點中接收該網際網路控制 接收時間.舾ϊ探測報文的回饋報文並確定該回饋報文的 接收時間計算該的數量以及該回饋報文的In recent years, with the development of computer technology, the Internet has become an important platform for people to get a lot of money! People make a lot of information on the Internet: 'In order to ensure the smooth exchange of information between each other, the computer network Flow control is especially important. When using f to use a network device such as a router to connect to the network for access, if there is no flow control mechanism, after the message is sent from the terminal, due to the frequency limit, when the traffic is too large, part or all of the message is sent. Will not be able to reach the destination, which will result in the loss of some or all of the messages, and the loss of the message is random 'that is, the loss may be some very important to the user. In order to ensure that the message is not lost, network traffic must be controlled. That is, the bandwidth of the network uplink must be known. Only the network uplink bandwidth can be used to determine the number of packets sent. At present, the methods commonly used to detect the uplink bandwidth of a network are as follows: 1. The uplink bandwidth is obtained by monitoring the network traffic. The disadvantage of this approach is that the values obtained are not accurate enough. When the actual traffic of the user is insufficient, the data obtained is too small; when the actual traffic of the user is too large and the traffic is mainly composed of User Datagram Protoco (UDP) packets, UDP is a non-guaranteed non-connection-oriented protocol. Therefore, the data obtained is too large. 2. Determine the uplink bandwidth according to the receiving time of the feedback message by sending a set of Internet Control Message Protocol (ICMP) packets to the network server. The disadvantage of this method is that the network server does not necessarily respond to ICMP messages, so the results are often not obtained. 4 201038007 [Summary of the Invention] The uplink g is required to provide a kind of network device to accurately measure the node detection message to the specified destination, 2 to ~ group storage time from the first value to the first The two values are in sequence; the network measurement message is alive. When the network node receives the survival, the time is 1: network ϊΞΐϊ 协; use: to determine whether the network node G receives the birth and die point. The second sending module uses J's recent network thrift time to calculate the network; and the receiving of the feedback message = the group is also used by ί two, the group survival time from the first value to the person 2's Internet The road control message protocol message is sent to the H-value method, including the network terminal, and the test packet of the uplink bandwidth of the network terminal passes through the network 2 to determine whether the survival time is not received from the section. The second value from the binary value to the increased value is sequentially added to the survival, and the specified destination is sent to the secretary; if the received source address exceeds the packet, the nearest network of the message that expires according to the time-to-live is the latest. a network node; a packet to the distance; a bandwidth probe for transmitting a plurality of Internet Control Message Protocols. + receiving the Internet control reception time in the network node closest to the 222nd distance. Retrieving the message and determining the receiving time of the feedback message to calculate the quantity and the feedback message
輕⑻内具; 【實施方式】 圖1,所示為本發明一實施方式中網路裝置10 兄和結構圖。在本實施方式中,網路20包括非對 立用戶迴路(Asymmetrical Digital Subscriber Loop ’ ADSL)網路。網路裝置1〇與網路2〇相連,用於自動檢測 眉2〇的上行頻寬,其可以為路由器、交換機等網路設備。 在本實施方式中,網路農置10包括第一發送模組 、判斷模組102、第二發送模組104、接收模組106及 計算模組108。 第一發送模組100用於發送一組節點偵測報文到指定 目的地。在本實施方式中,該節點偵測報文為生存時間從 第一值到第二值依次增加的網際網路控制訊息協定 (Internet Control Message Protocol,ICMP)報文。其中, 網路節點是任一擁有唯一網路位址的網路設備,如路由 器、交換機等設備。報文是網路中交換與傳輸的資料單元, 包含了將要發送的完整的資料内容。生存時間 (Time-to-Live ’ TTL )是網際網路協定(Internet Protocol, IP)資料報文中的一個值,它決定了 IP資料報文在網路中 的存在時間,以避免報文在網路中的無限循環。報文在經 6 201038007 過每一網路路由器時其TTL的值都將自動減i。當網路 •點收到TTL值大於1的報文時,則會將該報文裡的TTL值 減j,然後再發往下一個網路節點。而當網路中的某個 ,節點接收到TTL冑1的報文時’該網路節點就決定去 该報文,並向發送這個報文的網路裝置返回一個生存; ,時(TTL—EXCEED)報文。在本實施方式中,第一值^ 第二值為預設的任意自然數,且第二值大於第一值。如^ 一值預设為1 ’第二值預設為1〇,這樣,第一發送模組丄⑻ 就發出一組生存時間從【到1〇依次增加的1(H@ICMp 文到指定目的地。 〇 判斷模組102用於判斷是否從網路節點中接收到生存 時間超時的報文,並在接收到該生存時間超時的報文時, 根據該生存時間超時的報文的源位址確定距離網路裝置最 近的網路節點。在本實施方式中,第—發送模組1〇〇同時 發出一組ICMP報文,由於實際網路中存在延時,而且每 個報文到達目的節點的路徑不完全相同,這就造成了返饋 回的TTL—EXCEED報文不是同時返回,所以,判斷模組 102收到的TTL_EXCEED報文是有先後順序的,並且將最 先發送TTL_EXCEED報文的節點確定為距離最近的網路 〇節點。在其他實施方式中,第-發賴組·不同時發出 I c Μ P報文’則距離最近的網路節點為發出報文與收到回應 報文時間間隔最小的網路節點。 第一發送模組100還用於在判斷模組102沒有接收到 TTL—EXCEED報文時,將第一發送模組1〇〇中的第二值增 加,再重新發出一組生存時間從第一值到增大後的第二值 依次增加的ICMP報文到該指定目的地,然後藉由判斷模 組102繼續循環判斷,直到收到ttl EXCEED報文。在本 實施方式中,第一發送模組1〇〇中第二值的增加次數不 限’只要判斷模組102沒有接收到TTL_EXCEED報文,第 一發送模組100就繼續發送一組TTL從第一值到增大後的 7 201038007 第二值依次增加的ICMP報文到指定目的地。藉由這種循 環增加第二值的方式,就一定可以找到會回應ICMP報文 的網路節點。 第二發送模組104用於向距離最近的網路節點發送複 數ICMP的頻寬探測報文。在本實施方式中,該等ICMp 頻寬探測報文是從網路裝置10同時發出的,報文總數為 N,每個報文所包含的位元組數都是p,這樣可以使得測試 的數據更準確。由於判斷模組1〇2所確定的距離最近的節 點一定會回饋TTL_EXCEED報文’所以該距離最近的節點[Embodiment] FIG. 1 is a block diagram showing the structure of a network device 10 according to an embodiment of the present invention. In the present embodiment, the network 20 includes an Asymmetrical Digital Subscriber Loop (ADSL) network. The network device 1 is connected to the network 2〇, and is used for automatically detecting the uplink bandwidth of the eyebrows, which may be network devices such as routers and switches. In this embodiment, the network farm 10 includes a first sending module, a determining module 102, a second sending module 104, a receiving module 106, and a computing module 108. The first sending module 100 is configured to send a group of node detection messages to a specified destination. In this embodiment, the node detection packet is an Internet Control Message Protocol (ICMP) packet whose lifetime increases from a first value to a second value. The network node is any network device that has a unique network address, such as a router or a switch. A message is a data unit exchanged and transmitted in the network, containing the complete data content to be sent. Time-to-Live 'TTL is a value in the Internet Protocol (IP) data message, which determines the existence time of IP data packets on the network to avoid packets on the network. An infinite loop in the road. The message will automatically decrement the value of TTL for each network router when it passes through 6 201038007. When the network receives a packet with a TTL greater than 1, the TTL value in the packet is decremented by j and then sent to the next network node. When a node in the network receives a packet with TTL 胄 1 'the network node decides to go to the packet and returns a survival to the network device that sent the packet; (TTL - EXCEED) message. In this embodiment, the first value ^ the second value is a preset arbitrary natural number, and the second value is greater than the first value. For example, if the value is preset to 1', the second value is preset to 1〇, so that the first sending module 丄(8) issues a set of survival time from [to 1〇 in turn, 1 (H@ICMp text to the specified purpose). The 〇 judging module 102 is configured to determine whether a packet with a timeout timeout is received from the network node, and when receiving the packet with the lifetime timeout, according to the packet whose lifetime expires The source address determines the network node closest to the network device. In this embodiment, the first-send module 1 sends a set of ICMP messages at the same time, because there is a delay in the actual network, and each message arrives. The path of the destination node is not completely the same, which causes the TTL-EXCEED message returned by the feedback node not to be returned at the same time. Therefore, the TTL_EXCEED message received by the judgment module 102 is in a sequential order, and the TTL_EXCEED message is sent first. The node of the text is determined to be the nearest network 〇 node. In other embodiments, the first squaring group does not simultaneously issue an I c Μ P message 'the nearest network node sends a message and receives a response. Network with the smallest message interval The first sending module 100 is further configured to: when the determining module 102 does not receive the TTL-EXCEED message, increase the second value in the first sending module 1〇〇, and then re-issue a set of survival time from The first value to the second value after the increase of the ICMP message is sequentially added to the specified destination, and then the judgment module 102 continues to loop until the ttl EXCEED message is received. In this embodiment, the first The number of times the second value of the sending module 1 is increased is not limited. As long as the determining module 102 does not receive the TTL_EXCEED message, the first sending module 100 continues to send a set of TTLs from the first value to the increased 7 201038007 The second value increases the ICMP message to the specified destination. By adding the second value in this loop, the network node that will respond to the ICMP message can be found. The second sending module 104 is used to The most recent network node sends a plurality of ICMP bandwidth detection packets. In this embodiment, the ICMp bandwidth detection packets are simultaneously sent from the network device 10. The total number of packets is N, and each packet is sent. The number of bytes included is p, so So that a more accurate test data. Since the determining module 1〇2 the determined nearest node will be reserved TTL_EXCEED packets' so that the nearest node
Ο 對其接收來的母一個ICMP頻寬探測報文都會有—個 TTL—EXCEED的回饋報文。 接收模組106用於從距離最近的節點接收ICMp頻 探測報文的TTL—EXCEED回饋報文並確定該回饋報文的 接收時間。在本實施方式中,由於實際網路中存在延時, 而且每個報文到達目的節點的路徑不完全相同,這就 了回饋回的TTL_EXCEED報文不是同時返回,所以網路^ 置10從距離最近的網路節點中接收到第一個回饋報文 時間為retUm_firSt_time,網路裝置1〇從距離最近 中接收到第二個回饋報文的時間1 return—secondjime’…,以及網路裝置1〇從距離最近二 點中接收到最後-個回饋報文㈣間為mu〇i la p 並將其接收時間按順序存儲。 -~ me 計算模組1〇8用於根據頻寬探測報文的數量以及 報文的接收時間計算網路上行的頻寬。在本實施方饋 根巧回饋報文的資訊可以確定從輯最近的節財 : 的取後一個回饋報文的時間與接收到首個回饋報文的 的差值為:return—last一time_return—fim一time。由於= 的ICMP頻寬探測報文總比特(Bit)數-為N*p*8 = ,计算她108的計算後,得到的網路上行頻寬 = 寬探測報文的總比特數除以接收到的最後—個回饋 8 201038007 時間與首個回饋報文的時間的差值,即:(Ν*ρ*8) / (return_last_time-return—first一time )。 -請參閱圖2,所示為本發明實施方式中網路 動 檢測網路上行頻寬的方法流程圖。在本實施方 法是藉由圖1中的網路裝置10的各個模組所以 μ ΐ 3=#中,i—/送模組100發出4節點偵測 報文到才曰疋目的地,其中,該節點偵測報文為生存時間 (Thne-to-Live,TTL)從第-值到第二值依次增加的網際 網路控制訊息協定報文(Internet c〇mr〇i他挪 ο都会 An ICMP bandwidth detection message received by the parent will have a TTL-EXCEED feedback message. The receiving module 106 is configured to receive the TTL-EXCEED feedback message of the ICMp frequency detection message from the nearest node and determine the receiving time of the feedback message. In this embodiment, since there is a delay in the actual network, and the path of each packet to the destination node is not completely the same, the TTL_EXCEED message returned is not returned at the same time, so the network is 10 from the nearest distance. The time of receiving the first feedback message in the network node is retUm_firSt_time, and the network device 1 receives the second feedback message from the nearest time, return_secondjime'..., and the network device 1 From the last two points received in the last two points, the message (mu) is mu〇i la p and its reception time is stored in order. -~ me The calculation module 1〇8 is used to calculate the bandwidth of the network uplink according to the number of bandwidth detection messages and the receiving time of the message. In the embodiment, the information of the feedback message can be determined by the nearest payment: the difference between the time of receiving the next feedback message and the receipt of the first feedback message is: return-last_time_return- Fim a time. Since the total number of bits of the ICMP bandwidth detection message of = is N*p*8 = , after calculating the calculation of her 108, the obtained uplink frequency bandwidth = the total number of bits of the wide detection message divided by the reception The last time - the feedback 8 201038007 time difference with the time of the first feedback message, namely: (Ν * ρ * 8) / (return_last_time-return - first one time). Referring to FIG. 2, a flow chart of a method for dynamically detecting an uplink bandwidth of a network in an embodiment of the present invention is shown. In this implementation method, by using the modules of the network device 10 in FIG. 1 , μ ΐ 3=#, the i-/send module 100 sends a 4-node detection message to the destination, where The node detects that the message is an Internet Control Message Protocol message whose lifetime (Thne-to-Live, TTL) increases from the first value to the second value (Internet c〇mr〇i)
Protoco卜ICMP)。在本實施方式中,這—組 是=路裝置H)同時發出的,報文在經過每」個 器時其TTL的值都將自動減1。當網路節點收到τιχ 於1的報文時,則會將該報文裏的TTL值減i, 而當網路中的某個網路節點、接收到 TTL·為1的報文時,該網路節點就會丟棄該報文,並向發 個報文的網路裝置1〇返回一個生存時間超時 (TTL一EXCEED)報文。在本實施方式中,帛一值與第二 值為預設的任意自然數’且第二值大於第一值。如g一值 〇 2二/預設為1〇,這樣,第一發送模組100就 $丨> 〜Ϊλα t時間從1到10依次增加的10個1CMP報文 判才日疋目的地。 mtfS2G2中’判斷模組皿判斷是否從節點偵測報 文厶過的網路節點中接收到TTL_EXCEED報文。 ^半ί H斷^莫組1〇2沒有接收到TTL_EXCEED報文,則 中’第一發送模組100將第-發送模組謂中 3 Θ,加,並返回步驟S200,重新發送一組生存時間 ", 至1增加後的第二值依次增加的ICMP報文到指定 目的地。 斷模組ι〇2接收到TTL-EXCEED報文,則在步 中’根據收到TTL_EXCEED的報文確定一個距離 9 201038007 二在 =並最=先路 =一報文的心 &在步驟S206中,第二發送模組104向距離最近的網% 郎點發送複數ICMP的頻寬探測報文。在本實施 該組ICMP頻寬探測報文是從網路裝置1〇同時/ ’ 文總數為N,每個報文所包含的位元組數都是p,这上 以使得測試的數據更準確。由於判斷模組1〇2所^的: ^最近,點-定會回饋TTL—EXCEED報文,所以該距= 最近的節點對其接收來的每一個ICMp頻寬探測報 有一個TTL—EXCEED的回饋報文。 會Protoco ICMP). In the present embodiment, this group is issued simultaneously by the = device H), and the value of the TTL of the message is automatically decremented by one every time it passes. When the network node receives the packet with τιχ1, the TTL value in the packet is decremented by i, and when a network node in the network receives a packet with a TTL·1, The network node discards the message and returns a time-to-live (TTL-EXCEED) message to the network device that sent the message. In the present embodiment, the first value and the second value are preset arbitrary natural numbers ' and the second value is greater than the first value. For example, g_value 〇 2 2 / preset is 1 〇, so that the first transmitting module 100 determines the destination of the 10 CMP messages sequentially increased from 1 to 10 by the time 丨>~Ϊλα t. In mtfS2G2, the judgment module judges whether a TTL_EXCEED message is received from the network node through which the node detects the message. ^ 半ίH断^莫组1〇2 does not receive the TTL_EXCEED message, then the 'first sending module 100 will send the first-send module to 3 Θ, add, and return to step S200 to resend a set of survival Time ", the second value after the increase of 1 increases the ICMP message to the specified destination. The module ι〇2 receives the TTL-EXCEED message, and in the step, 'determines a distance according to the message received TTL_EXCEED 9 201038007 2 in the = and most = first way = the heart of a message & in step S206 The second sending module 104 sends a bandwidth detection packet of the complex ICMP to the nearest network % lang. In this implementation, the ICMP bandwidth detection message is from the network device 1 / the total number of texts is N, and the number of bytes included in each message is p, which makes the test data more accurate. . Since the judgment module 1〇2 ^: ^Recently, the point-definitely will return the TTL-EXCEED message, so the distance = the nearest node has a TTL-EXCEED for each ICMp bandwidth probe reported to it. Feedback message. meeting
在步驟S208中,接收模組1.06從距離最近的網路 中接收ICMP頻寬探測報文的回饋報文並確定回饋報文的 接收時間。在本實施方式中,由於實際網路中存在延時,、 而且每個報文到達目的節點的路徑不完全相同,這就造 了回饋回的TTL_EXCEED報文不是同時返回,所以網路裝 置10從距離最近的節點中接收到第一個回饋報文的時g 為return一first一time,網路裝置1〇從距離最近的節點中接 收到第二個回饋報文的時間為 return_second_time,…,以 及網路裝置10從距離最近的節點中接收到最後一個回饋 報文的時間為return_last一time,並將其接收時間按順序存 儲。 在步驟S210中’計算模組1〇8根據頻寬探測報文的數 量以及回饋報文的接收時間計算出網路的上行頻寬。在本 實施方式中,根據回饋的報文資訊可以確定從距離最近的 節點中接收到最後一個回饋報文的時間與接收到首個回饋 報文的時間的差值為:return last time-return first time。 由於所傳輸的ICMP頻寬探測報文總比特(Bit )數為 N*P*8 ’所以經過計算模組1〇8的計算後,得到的網路上 201038007 行頻寬疋傳輸頻寬探測報文的總比特數除以接收到的最後 一個回饋報文時間與首個回饋報文的時間的差值,即: (N*P*8) / (return_last_time-return_first__time) ° 本發明實施方式所提供的網路裝置及網路上行頻寬的 =動檢測方法,藉由循環增加第二值的方式,以找到會回 ;^CMP報文的網路節點,然後向這個網路節點發送icMp 文,利用回饋報文的接收時間就可以準確的計 斤出=裝置1G的上行頻寬,而且實現的方式較容易。 Ο 刺由C本發明符合發明專利要件,爰依法提出專In step S208, the receiving module 1.06 receives the feedback message of the ICMP bandwidth detecting message from the closest network and determines the receiving time of the feedback message. In this embodiment, since there is a delay in the actual network, and the path of each packet to the destination node is not completely the same, the TTL_EXCEED message that is returned is not returned at the same time, so the network device 10 is from the distance. When the first node receives the first feedback message, the time g is return one first time, and the network device 1 receives the second feedback message from the nearest node as return_second_time, ..., and the network. The path device 10 receives the last feedback message from the nearest node as return_last one time, and stores its reception time in order. In step S210, the calculation module 1 计算 8 calculates the uplink bandwidth of the network based on the number of bandwidth detection messages and the reception time of the feedback message. In this embodiment, according to the message information of the feedback, it may be determined that the difference between the time when the last feedback message is received from the closest node and the time when the first feedback message is received is: return last time-return first Time. Since the total number of bits of the transmitted ICMP bandwidth detection message is N*P*8', after the calculation of the calculation module 1〇8, the obtained 201038007 line bandwidth 疋 transmission bandwidth detection message on the network is obtained. The total number of bits divided by the time of the last received reply message and the time of the first feedback message, ie: (N*P*8) / (return_last_time-return_first__time) ° provided by the embodiment of the present invention The network device and the network uplink bandwidth=motion detection method, by cyclically increasing the second value, to find the network node that will return the ^CMP message, and then send the icMp text to the network node, and utilize The receiving time of the feedback message can accurately calculate the upstream bandwidth of the device 1G, and the implementation is easier. Ο 刺 by C This invention meets the requirements of the invention patent,
Si案Ξ菽本發明之較佳實施例,舉凡 餉名轡ϋ Λ ^ ^.在羑依本案發明精神所作之等效修 飾或變化皆應包含於以下之申 【圖式簡單說明】 圖1為本發明—實施方式中網«置的剌環境與結 構圖 圖2為本發明一 方法的流程圖。 實施方式中網路上行頻寬的 自動檢測 【主要元件符號說明】 網路 20 10 100 102 104 106 108 〇 網路裝置 第一發送模組 判斷模組 第二發送模組 接收模組 計算模組 11The invention is based on the preferred embodiment of the present invention, and the equivalent modifications or variations made in the spirit of the invention are included in the following description. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 2 is a flow chart of a method of the present invention. Automatic detection of network uplink bandwidth in the embodiment [Description of main component symbols] Network 20 10 100 102 104 106 108 网路 Network device First transmitting module Judging module Second transmitting module Receiving module Computing module 11