Abstract:
A method for sending and receiving data is provided. The method for sending data comprises the following steps. Firstly, monitor a network connection that transmits data and then check whether the network connection has a bandwidth reservation request. If the network connection has no such request, use the remaining bandwidth to send the data. If the network connection has a reservation request, check whether the network connection has a bandwidth reservation. If the network connection has a bandwidth reservation, check whether the reserved bandwidth is enough to send the data. If the reserved bandwidth is enough to send the data, use the reserved bandwidth to send the data. Lastly, if the network connection does not have bandwidth reservation, or if the reserved bandwidth is not enough to send the data, set up a new reserved bandwidth and use the new reserved bandwidth to send the data.

Description:
CROSS-REFERENCE TO RELATED APPLICATION  
       [0001]     This application claims the priority benefit of Taiwan application serial no. 94112526, filed on Apr. 20, 2005. All disclosure of the Taiwan application is incorporated herein by reference.  
       BACKGROUND OF THE INVENTION  
       [0002]     1. Field of the Invention  
         [0003]     The present invention relates to a method for sending and receiving data through a network. More particularly, the present invention relates to a method for sending and receiving data whose transmission efficiency is increased through bandwidth reservation.  
         [0004]     2. Description of the Related Art  
         [0005]     According to the conventional network quality service scheme of transmitting data to a number of clients simultaneously through a server, transmission time to each client is organized according to the importance of the clients. In other words, the client with a higher priority is assigned a longer transmission period while the other client with a lower priority is assigned a shorter transmission period. Therefore, the clients with a lower degree of importance have to spend more time downloading data from the server. For example, the network comprising a server S and two client terminals C 1  and C 2  as shown in  FIG. 1  may transmit data packets as shown in  FIG. 2 . Among a set of seven packets, six packets P 1  are transmitted to the client C 1  while only one packet P 2  is transmitted to the client C 2 . It can be imagined that under the condition shown in  FIG. 2 , the downloading speed for the client C 2  is just one-sixth of that of the client C 1 .  
         [0006]     One major defect for this kind of scheduling is that it will take a client having a lower rank a very long period to download important data or a larger quantity of data and render the service provided by the server unrealistically slow. One major objective of the present invention is to resolve this problem.  
       SUMMARY OF THE INVENTION  
       [0007]     Accordingly, at least one objective of the present invention is to provide a method for sending data that guarantees a minimum network transmission bandwidth to increase transmission efficiency.  
         [0008]     At least a second objective of the present invention is to provide a method for receiving data that guarantees a minimum network transmission bandwidth for receiving specific data to increase transmission efficiency.  
         [0009]     To achieve these and other advantages and in accordance with the purpose of the invention, as embodied and broadly described herein, the invention provides a method for sending data comprising the following steps. First, monitor a network connection that transmits data and then check whether the network connection has a bandwidth reservation request. If the network connection has no such request, use the remaining bandwidth to send the data. If the network connection has a reservation request, check whether the network connection has a bandwidth reservation. If the network connection has a bandwidth reservation, check whether the reserved bandwidth is sufficient to send the data. If the reserved bandwidth is enough to send the data, use the reserved bandwidth to send the data. Lastly, if the network connection does not have bandwidth reservation, or if the reserved bandwidth is not enough to send the data, set up a new reserved bandwidth and use the new reserved bandwidth to send the data.  
         [0010]     In one embodiment of the aforementioned method of sending data, the method of setting up a new reserved bandwidth and use the new reserved bandwidth to send the data comprises the following steps. First, compute the remaining bandwidth and check whether the remaining bandwidth is enough to send the data. If the remaining bandwidth is enough to send the data, set the new reserved bandwidth according to the remaining bandwidth and use the new reserved bandwidth to send the data. If the remaining bandwidth is not enough to send the data, wait until the remaining bandwidth is enough to send the data and then set the new reserved bandwidth according to the remaining bandwidth and use the new reserved bandwidth to send the data.  
         [0011]     From another perspective, the present invention also provides a method for receiving data comprising the following steps. First, obtain the next network connection from a receiving list and then check whether there is a data to be received. If the network connection has a data to be received, check whether the network connection has a bandwidth reservation request. If the network connection has no such request, use the remaining bandwidth to receive the data. If the network connection has a bandwidth reservation request, check whether the network connection has reserved bandwidth. If the network connection has reserved bandwidth, check whether the reserved bandwidth is sufficient enough to receive the data. If the reserved bandwidth is enough to receive the data, use the reserved bandwidth to receive the data. Lastly, if the network connection does not have bandwidth reservation, or if the reserved bandwidth is not enough to receive the data, set up a new reserved bandwidth and use the new reserved bandwidth to receive the data.  
         [0012]     In one embodiment of the aforementioned method of receiving data, the method of setting up a new reserved bandwidth and use the new reserved bandwidth to receive the data comprises the following steps. First, compute the remaining bandwidth and check whether the remaining bandwidth is enough to receive the data. If the remaining bandwidth is enough to receive the data, set the new reserved bandwidth according to the remaining bandwidth and use the new reserved bandwidth to receive the data.  
         [0013]     The operating principle of the present invention includes identifying the specific data that requires bandwidth reservation through user&#39;s setting or by monitoring the content of a network connection. Then, a portion of the bandwidth is reserved for the transmission of the specific data between the server and the clients. Thus, the specific data will not be excluded by other data during transmission. As a result, a minimum bandwidth for sending and receiving data is guaranteed and the transmission efficiency of the specific data is improved.  
         [0014]     It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the invention as claimed. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0015]     The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.  
         [0016]      FIG. 1  is a block diagram of a typical server and client group network.  
         [0017]      FIG. 2  shows an example of a conventional data transmission through the network shown in  FIG. 1 .  
         [0018]      FIG. 3  is a graph showing the bandwidth distribution in a method of sending and receiving data according to one embodiment of the present invention.  
         [0019]      FIG. 4  is a flow diagram showing the steps for sending data according to one embodiment of the present invention.  
         [0020]      FIG. 5  is a flow diagram showing the steps for receiving data according to one embodiment of the present invention. 
     
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0021]     Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.  
         [0022]     The present invention works by monitoring the network connection between the clients and the server. According to the bandwidth reservation request to the server provided by the application program which opened the network connection, a portion of the bandwidth between the clients and the server is reserved to be solely used by specific data or a particular transmission protocol, for example, multimedia data. As to the size of the reserved bandwidth, it depends on the specific types of embodiments in the present invention. For example, the reservation may depend on the demand in the application program or may adjust incrementally according to actual application conditions. In addition to the application program, the bandwidth reservation request can be provided through the setting of a user.  
         [0023]     The network connection can be intercepted and monitored, for example, by modifying the kernel of an operating system or modifying the link of an application program to the functional library. The advantage for this arrangement is its transparency of the application program. In other words, there is no need to change the existing program codes.  
         [0024]     After setting the bandwidth reservation, other application programs can only use the unreserved bandwidth. However, as soon as the aforementioned network connection ends, the reserved bandwidth will be immediately released for other application programs to use.  
         [0025]     The present invention is applicable not limited to the multimedia transmission protocol. Any specific data or transmission protocol that can be identified through related network connection parameters of a transmission port, packet content or other specific method is included in the scope of the present invention.  
         [0026]     To administer bandwidth reservation, the entire bandwidth of the network must be managed by classification.  FIG. 3  is a graph showing the bandwidth distribution in a method of sending and receiving data according to one embodiment of the present invention. As shown in  FIG. 3 , the letter ‘O’ represents the entire bandwidth or all the usable bandwidths in the network measured by standard network measuring techniques. ‘R 1 ’ and ‘R 2 ’ are two reserved bandwidths each reserved for a different application program (may also be reserved for the same application program but different network connections). ‘T’ represents the unreserved bandwidth or the bandwidth after subtracting the reserved bandwidths ‘R 1 ’ and ‘R 2 ’ from the entire bandwidth ‘O’. ‘U’ represents the unreserved in-use bandwidth or that portion of the unreserved bandwidth ‘T’ in use by an application program without reserved bandwidth. Lastly, ‘B’ represents the remaining bandwidth or the bandwidth after subtracting the unreserved bandwidth ‘T’ from the unreserved in-use bandwidth ‘U’. The descriptions in the following embodiments are based on the classification in  FIG. 3 .  
         [0027]     In the following, a detailed description of the method for sending and receiving data in the present invention is provided.  FIG. 4  is a flow diagram showing the steps for sending data according to one embodiment of the present invention. The flow in the present embodiment begins from step  401 .  
         [0028]     First, in step  401 , a network connection for transmitting data is monitored to obtain a bandwidth. The monitoring method has been described before and hence will not be repeated here. Then, in step  402 , the network connection is checked if there is any bandwidth reservation request. The bandwidth reservation request may originate from the application program or from the settings provided by a user. If the result in step  402  shows that the network connection has no such reservation, then the remaining bandwidth is used to send the data in step  409 . Then, according to the needed bandwidth for sending the data, the bandwidth record is adjusted to reflect the current in-use bandwidth status after the data transmission. The flow ends at this point.  
         [0029]     On the contrary, if the result in step  402  shows that the network connect has a bandwidth reservation request, step  403  is carried out to check whether the network connection has a first reserved bandwidth. If the network connection has a first reserved bandwidth, the first reserved bandwidth is checked in step  410  whether the first reserved bandwidth is enough to send data (whether the first reserved bandwidth is greater than the bandwidth obtained by monitoring the network connection or not). If the first reserved bandwidth is enough to send the data (the first reserved bandwidth is greater than the bandwidth obtained by monitoring the network connection), the first reserved bandwidth is used to send the data in step  412 . Furthermore, the bandwidth record is adjusted according to the bandwidth needed for sending the data to reflect the current in-use bandwidth status after the data transmission. The flow ends at this point.  
         [0030]     If the result in step  403  shows that the network connection has no first reserved bandwidth or the result in step  410  shows that the first reserved bandwidth is not enough to send the data (the first reserved bandwidth is smaller than the bandwidth obtained by monitoring the network connection), step  404  is carried out to compute the unreserved bandwidth by subtracting the first reserved bandwidth from the entire bandwidth and then step  405  is carried out to compute the remaining bandwidth by subtracting the unreserved in-use bandwidth from the unreserved bandwidth. Then, in step  406 , the remaining bandwidth is checked to determine whether the remaining bandwidth is enough to send the data. If the remaining bandwidth is enough to send the data (the remaining bandwidth is greater than the bandwidth obtained by monitoring the network connection), step  411  is carried out to deduct the bandwidth (a second bandwidth) necessary for sending data from the remaining bandwidth, and then add the original reserved bandwidth to the result to produce a new reserved bandwidth (a third bandwidth), and adjusting the bandwidth record of the network connection according to the changes. The flow ends at this point.  
         [0031]     Lastly, if the result in step  406  shows that the remaining bandwidth is not enough to send the data, step  407  is carried out to compute the period needed to wait until the remaining bandwidth is greater than the bandwidth obtained by monitoring the network connection. After the waiting period expires in step  408 , step  411  is again executed. The flow ends at this point.  
         [0032]      FIG. 5  is a flow diagram showing the steps for receiving data according to one embodiment of the present invention. The flow in the present embodiment begins from step  501 .  
         [0033]     First, in step  501 , the next network connection together with bandwidth is obtained from a receiving list. The receiving list is a data structure for storing information related to all network connections between the server and the clients. In  FIG. 5 , the flow can be executed a number of times so that each network connection inside the receiving list is dealt with one by one.  
         [0034]     In step  502 , the network connection is checked to determine if there is any more data to be received. If there is no more data to be received, the flow ends here. If there is some data waiting to be received, step  503  is carried out to check whether there is any bandwidth reservation request. If there is no bandwidth reservation request, step  508  is executed to receive data using the remaining bandwidth and adjust the bandwidth record of the network connection according to the bandwidth required for receiving the data. The flow ends at this point.  
         [0035]     On the contrary, if the result in step  503  shows that the network connect has a bandwidth reservation request, step  504  is carried out to check whether the network connection has a first reserved bandwidth. If the network connection has a first reserved bandwidth, the first reserved bandwidth is checked in step  509  to determine whether the first reserved bandwidth is enough to receive the data (whether the first reserved bandwidth is greater than the bandwidth obtained by monitoring the network connection or not). If the first reserved bandwidth is enough to receive the data (the first reserved bandwidth is greater than the bandwidth obtained by monitoring the network connection), the first reserved bandwidth is used to receive the data in step  511 . Furthermore, the bandwidth record of the network connection is adjusted according to the bandwidth needed for receiving the data. The flow ends at this point.  
         [0036]     If the result in step  504  shows that the network connection has no first reserved bandwidth or the result in step  509  shows that the first reserved bandwidth is not enough to receive the data (the first reserved bandwidth is smaller than the bandwidth obtained by monitoring the network connection), step  505  is carried out to compute the unreserved bandwidth by subtracting the first reserved bandwidth from the entire bandwidth and then step  506  is carried out to compute the remaining bandwidth by subtracting the unreserved in-use bandwidth from the unreserved bandwidth. Then, in step  507 , the remaining bandwidth is checked to determine whether the remaining bandwidth is enough to receive the data (whether the remaining bandwidth is greater than the bandwidth obtained by monitoring the network connection or not). If the remaining bandwidth is not enough to receive the data (the remaining bandwidth is smaller than the bandwidth obtained by monitoring the network connection), the reception of the data is suspended and the flow ends. On the other hand, if the remaining bandwidth is enough to receive the data (the remaining bandwidth is greater than the bandwidth obtained by monitoring the network connection), step  510  is carried out to deduct the bandwidth (a second bandwidth) necessary for receiving data from the remaining bandwidth, and then add the original reserved bandwidth to the result to produce a new reserved bandwidth (a third bandwidth), and adjusting the bandwidth record of the network connection according to the changes. The flow ends at this point.  
         [0037]     The operating principle of the present invention includes identifying the specific data or transmission protocol that requires bandwidth reservation through user&#39;s setting or by monitoring the content of a network connection. Then, a portion of the bandwidth is reserved for the transmission of the specific data between the server and the clients. Thus, the specific data will not be excluded by other data during transmission. As a result, a minimum bandwidth for sending and receiving data is guaranteed and the transmission efficiency of the specific data is improved.  
         [0038]     It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.