Abstract:
The present invention provides a method for creating routes in access devices of the communication network by using access response messages. With the method provided by the present invention, services can be distinguished and forwarded based on destination IP sub-networks, so that different services can be distributed in access devices. In this way, on the premise that services are distinguished based on layer 3, the requirements for access devices are reduced and layer 2 networks on the user side are not required to carry out route protocols, which decreases administrators&#39; maintenance work and is the important condition for the realization of plug&amp;play and reduces the requirements for marginal routers.

Description:
TECHNICAL FIELD 
       [0001]    The present invention relates to the communication network, particularly to the access network of the communication network. 
       BACKGROUND OF THE INVENTION 
       [0002]    Currently, the requirements for layer 2 access devices put forward by telecom operators are higher and higher. Layer 2 devices are required to distinguish services based on layer 3 information, so that different services, such as audio, video, Internet and so on, can be distributed in access devices like the Digital Subscriber Line-Access Multiplexer (DSLAM) and access to corresponding service networks via gateways corresponding to different services. Concretely, operators will generally plan service networks in advance, and different service providers possess different IP addresses. In this way, access devices can distinguish and forward services based on destination IP sub-networks. However, common access devices are only layer 2 devices and not used as user gateways, therefore these access devices are transparent to users in the third layer. Moreover, they don&#39;t have dedicated IP addresses for forwarding data. Therefore, accordingly, the network can only create unnumbered IP interfaces to meet this requirement. And this is also used to cope with the requirement for saving IPv4 addresses which are becoming scarcer. 
         [0003]    Presently, there is a method for creating route tables by monitoring route protocol messages. But operators normally don&#39;t enable route protocols on the ports on the user side. Route protocols based on link statuses (e.g. Open Shortest Path First) normally requires the correspondent node to have layer 3 addresses, however, this requirement can not be satisfied. Although route protocols based on distance vectors (e.g. Routing Information Protocol) are usable, restrictions are put forward when operators choose route protocols, and employing route protocols in the user-end network increases the complexity of the network and the load of the layer 2 network. Since layer 2 devices should support route protocols in this way, higher requirements are put forward for them. 
         [0004]    Generally, it is very difficult for layer 2 devices to obtain layer 3 route information. Configuring each such access device statically not only leads to high work load, but also makes layer 2 devices lose their advantage of plug&amp;play. Thus, this becomes a relative prominent problem. 
         [0005]    The present invention proposes a method and an apparatus for distinguishing services and forwarding data based on destination IP sub-networks by creating routes on layer 2 devices via the use of access response messages generated by servers when terminal devices access to the network. Here, the access response message refers to the Dynamic Host Configuration Protocol (DHCP) response message. Below, a brief introduction will be made about the DHCP. 
         [0006]    Dynamic Host Configuration Protocol (DHCP): 
         [0007]    The DHCP can be divided into two parts: one is the server end, while the other is the client end. DHCP servers run centralized management of all IP network setting information, and are responsible for dealing with DHCP requirements of the client end; while the client end uses IP environment information assigned from servers. 
         [0008]    1. Assignment Forms of DHCP 
         [0009]    At first, there must be at least one DHCP server working in the network. It monitors DHCP requirements of the network and negotiates with the client end about the setting environment of TCP/IP. Two kinds of IP positioning ways are provided: 
         [0010]    automatic assignment, its circumstance is: once the DHCP client end has successfully leased an IP address from the DHCP server for the first time, it will use this address for ever; 
         [0011]    dynamic assignment: once the DHCP client end has leased an IP address from the DHCP server for the first time, it doesn&#39;t use this address for ever. As long as the lease expires, the client end should release this IP address, so as to provide it to other work stations. Of course, the client end can renew the lease with higher priorities than other hosts, or lease other IP addresses. 
         [0012]    2. Work Principle of DHCP 
         [0013]    Depending on whether it is the first time for the client end to log on the network, the working form of DHCP will be different. Below, the working form of DHCP when it is the first time for the client end to log on the network will be detailed described with reference to  FIG. 1 . 
         [0014]    Logging on the network for the first time: 
         [0015]    1) Searching Server. When the DHCP end client logs on the network for the first time, namely the client finds there is no IP information setting in the host, it will send a DHCPDISCOVER packet to the network. Since the client hasn&#39;t known to which network it belongs yet, the source address of the packet is 0.0.0.0, and the destination address is 255.255.255.255, then the packet is attached with DHCPDISCOVER information and broadcasted to the network. 
         [0016]    Under the circumstances of the Windows default setting, the waiting time of DHCPDISCOVER is preset as 1 second, namely after the client end has sent the first DHCPDISCOVER packet, if no response is obtained within 1 second, the second DHCPDISCOVER broadcast will be performed. Under the circumstances that no response is obtained all along, the client end will conduct totally four DHCPDISCOVER broadcasts (including the first DHCPDISCOVER broadcast), the waiting time for the first broadcast is 1 second, and the waiting time for the other three broadcasts is 9 seconds, 13 seconds and 16 seconds respectively. If there is still no response of the DHCP server, the client end will display error information and declares the failure of DHCPDISCOVER. After that, based on the choice of the user, the system will continue to repeat the DHCPDISCOVER process once again after 5 minutes. 
         [0017]    2) Providing an IP lease address. After the DHCP server has monitored the DHCPDISCOVER broadcast sent by the client end, it will choose the most front unleased IP address from the range of the addresses which have not been leased, together with other TCP/IP settings, to form a DHCPDISCOVER packet and sent the same to the client end as a response. 
         [0018]    Since the client end doesn&#39;t have IP address at the beginning, there is MAC address information contained in the DHCPDISCOVER packet, and there is an XID number to identify this packet. Based on this information, the DHCPOFFER packet responded by the DHCP server is forwarded to the client needing the lease. According to the setting of the server end, the DHCPOFFER packet contains information of the lease term. 
         [0019]    3) Accepting an IP lease. If the client end receives responses of multiple DHCP servers in the network, it will only choose one of the DHCPOFFERs (generally the one that arrives earliest), and send a DHCPREQUEST broadcast packet to the network in order to tell all DHCP servers that it will accept the IP address provided by which server. 
         [0020]    At the same time, the client end will also send an ARP packet to the network to enquire whether there are any other hosts using this IP address in the network; if it is found that this IP address has been occupied, the client end will send a DHCPDECLINE packet to the DHCP server, so as to decline to accept its DHCPOFFER and resend a DHCPDISCOVER message. 
         [0021]    4) Acknowledging the lease. After the DHCP server has received the DHCPREQUEST of the client end, it will send a DHCPACK response to the client end in order to acknowledge that the IP lease has come into effect formally, namely a whole DHCP working process is completed. 
       SUMMARY OF THE INVENTION 
       [0022]    The object of the present invention is to provide a method, in access devices of the communication network, for making use of access response messages to create routes, so as to distinguish services and forward based on destination IP sub-networks and make different services distribute in access devices. 
         [0023]    According to the first aspect of the present invention, there is provided a method for managing route information in an access device of the communication network. The method comprises the steps of: at first, receiving an access response message which is from the server and sent to a user terminal; then, extracting route-related information from said access response message, and creating or updating the route table based on said route-related information. 
         [0024]    According to the second aspect of the present invention, there is provided a route management apparatus for managing route information in an access device of the communication network. The route management apparatus comprises a receiving means, a first obtaining means and a route maintenance means. The receiving means receives an access response message which is from the server and sent to a user terminal; the first obtaining means extracts route-related information from said access response information; the route maintenance means creates or updates the route table based on said route-related information. 
         [0025]    According to the third aspect of the present invention, there is provided a method for forwarding data in an access device of the communication network, wherein data from user terminals belonging to different sub-networks is forwarded to corresponding sub-network gateways. 
         [0026]    According to the fourth aspect of the present invention, there is provided a forwarding apparatus for forwarding data in an access device of the communication network, wherein data from user terminals belonging to different sub-networks is forwarded to corresponding sub network gateways. 
         [0027]    As compared with the prior art, the present invention has following advantages: 
         [0028]    1. Not influencing the choice of route protocols; 
         [0029]    2. Not requiring layer 2 network on the user side to execute route protocols; 
         [0030]    3. Reducing the requirements for the marginal routers; 
         [0031]    4. Reducing the maintenance work of administrators, which is the important condition for realizing plug&amp;play; 
         [0032]    5. Under the premise that services are distinguished based on layer 3, reducing the requirements for access devices. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0033]    Other features, objects and advantages of the present invention will be apparent by reading the following detailed description of non-limiting exemplary embodiments with reference to appended drawings. 
           [0034]      FIG. 1   a  illustrates the frame structure of DHCP; 
           [0035]      FIG. 1   b  illustrates the option structure in the frame structure of DHCP; 
           [0036]      FIG. 2  illustrates the flowchart of the method for managing route information in an access device of the communication network according to an embodiment of the present invention; 
           [0037]      FIG. 3   a  illustrates a network topological structure of the access network according to an embodiment of the present invention; 
           [0038]      FIG. 3   b  illustrates another network topological structure of the access network according to an embodiment of the present invention; 
           [0039]      FIG. 4  illustrates the block diagram of the route management apparatus for managing route information in an access device of the communication network according to an embodiment of the present invention; 
           [0040]      FIG. 5  illustrates the flowchart of the method for forwarding data in an access device of the communication network according to an embodiment of the present invention; 
           [0041]      FIG. 6  illustrates the block diagram of the forwarding apparatus for forwarding data in an access device of the communication network according to an embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0042]      FIG. 1   a  illustrates the encapsulation format of a DHCP packet. All DHCP messages are encapsulated in UDP packets. The options in DHCP are vendor-specific area, so as to provide more setting information (e.g. Netmask, Gateway, DNS, etc.), and its length can be variable and there can be multiple options at the same time. The first byte of each option is the option code, its subsequent byte shows the length of the option content hereafter, and the rest is the option content, such as the option format in a DHCP message shown in  FIG. 1   b . DHCP employs the option code 0x53 to set the packet type:  1  represents DHCP-DISCOVER,  2  represents DHCP-OFFER,  3  represents DHCP-REQUEST,  4  represents DHCP-DECLINE,  5  represents DHCP-ACK,  6  represents DHCP-NACK and  7  represents DHCP-RELEASE. 
         [0043]    In the DHCP standard, three static route-related options are defined: option  3 , option  33  and option  121 . Wherein, option  3  is used to declare the gateway corresponding to the client. There can be multiple gateways in correspondence with the client, which are ordered according to the priority. Option  33  is put forward relative early, and is used to declare static type route information. Option  121  comprises the former two. It declares all static routes, including default routes, and supports Classless Inter-Domain Routing. These options are configured to the client end at the same time when the server is assigning IP addresses, so that the client end can create the route table correctly. It is worth noting that, for the whole network, user gateways and planed addresses of service providers are not often changed. They are located at two ends of the IP addresses and are the end points of the network topology and won&#39;t change with the network topology. Therefore, these routes can be regarded as static and can be pre-configured in the server by administrators. The configuration load is also not very large. 
         [0044]    For an access device, it is located between the marginal router and the user and won&#39;t be influenced by the topology change. Hence, these static routes are sufficient for the access device. 
         [0045]    Considering the current situation of the network, Classless Inter-Domain Routing has been widely used. An access device should learn and maintain the upstream route mainly depending on monitoring option  121  in each DHCP-ACK packet. 
         [0046]    Below, the present invention will be further elucidated in conjunction with  FIG. 2  to  FIG. 6 . 
         [0047]      FIG. 2  illustrates the flowchart of the method for managing route information in an access device of the communication network according to an embodiment of the present invention. 
         [0048]    At first, in step S 11 , an access response message which is from a server and sent to a user terminal is received. 
         [0049]    Then, in step S 12 , route-related information is extracted from said route-related message. 
         [0050]    Finally, a route table item is created or updated based on said route-related information. 
         [0051]    If said access response message further comprises the predefined using time indicating the time which can be used by said route, then in step S 12 , said predefined using time is obtained simultaneously; finally, the route table item is updated or created in conjunction with said route-related information and said predefined using time. 
         [0052]    Wherein the step in which said route table item is updated or created can be concretely divided into steps S 13 , S 14 , S 15  and S 16 . 
         [0053]    At first, in step S 13 , judging whether a route table item corresponding to said route-related information exists in said route table. 
         [0054]    If a route table item corresponding to said route-related information exists in said route table, then in step S 14 , judging whether the remaining time of said route table item is shorter than said predefined using time. 
         [0055]    If the remaining time of said route table item is shorter than said predefined using time, then updating the remaining time of said route item to the said predefined using time. 
         [0056]    If no route table item corresponding to said route-related information exists in said route table, then in step S 16 , creating a route-related item corresponding to said route-related information. 
         [0057]    If the virtual local area network (VLAN) configuration is employed between an access device and each sub-network gateway (also referred to as a marginal router) connected with the access device, correlated information of said route table item and the VLAN is obtained from the address resolution protocol (ARP) message or the access response message. 
         [0058]      FIGS. 3   a  and  3   b  illustrates two network topological structures of the access network according to an embodiment of the present invention. In  FIG. 3   a , each VLAN has a server responding to user access requests. In  FIG. 3   b , three VLANs share a server responding to user access requests. 
         [0059]    In general cases, such as the network topological structure graphs shown in  FIGS. 3   a  and  3   b , the access device  0  can obtain information of the VLAN via the VLAN tag in the acknowledgment frame of the ARP from each sub-network gateway, and correlate the information with corresponding route. The detailed flow is as below: at first, the access device  0  receives a packet from a user device. Assume that the packet is sent to the service a (world wide web). Based on the source network address and the destination network address in the packet, the access device  0  finds the destination network address of the next hop of the forwarding, then sends a ARP request frame to the host of the next hop (namely the marginal route a shown in FIGS.  3   a  and  3   b ) so as to inquire its link layer address. After receiving this request, the host of the next hop responds with an ARP response frame comprising a VLAN tag. When receiving said ARP response frame comprising a VLAN tag, the access device  0  extracts the information of the VLAN and correlates it with the route. 
         [0060]    If there is one (or more) server(s) in each VLAN which responds to user access requests, as shown in  FIG. 3   a , under such network configuration, information of the VLAN can also be obtained by the VLAN tag in an access response message, and then correlated with the route-related information. If multiple VLANs share one server responding to user access requests, as shown in  FIG. 3   b , then the VLAN information correlated with the route-related information can not be obtained via the VLAN tag in the access response message. At this time, the VLAN information correlated with the route-related information can only be obtained by the ARP message. 
         [0061]    In current network realizations, aforesaid access request message and access response message are DHCP messages, and said predefined using time is the lease time in the DHCP message. 
         [0062]      FIG. 4  illustrates the block diagram of the route management apparatus  1  for managing route information in an access device of the communication network according to an embodiment of the present invention. The route management apparatus  1  comprises a receiving means  11 , a first obtaining means  12 , a second obtaining means  13  and a route maintenance means  14 . Wherein the route maintenance means  14  comprises a first judging means  141 , a second judging means  142 , an updating means  143  and a creating means  144 . 
         [0063]    At first, the receiving means  11  receives an access response message which is from the server end and sent to the terminal. 
         [0064]    Then, the first obtaining means  12  obtains said route-related information from said access response message and obtains a predefined using time at the same time. The predefined using time is used to indicate the using time of said route. 
         [0065]    If the VLAN configuration is employed between an access device and each sub-network gateway (also referred to as a marginal router) connected with the access device, the second obtaining means  13  obtains the correlated information of said route table item and the VLAN from the ARP message or the access response message. 
         [0066]    In general cases, as shown in  FIGS. 3   a  and  3   b , the information of the VLAN can be obtained via the VLAN tag in the acknowledgment frame of the ARP from each sub-network gateway, and correlate the information with corresponding route. The detailed flow is as below: at first, the access device  0  receives a packet from a user device. Assume that the packet is sent to the service a (world wide web). Based on the source network address and the destination network address in the packet, the access device  0  finds the destination network address of the next hop of the forwarding, then sends a ARP request frame to the host of the next hop (namely the marginal route a shown in  FIGS. 3   a  and  3   b ) so as to inquire its link layer address. After receiving this request, the host of the next hop responds with an ARP response frame comprising a VLAN tag. When receiving said ARP response frame comprising a VLAN tag, the access device  0  extracts the information of the VLAN and correlates it with the route. 
         [0067]    If there is one (or more) server(s) in each VLAN which responds to user access requests, as shown in  FIG. 3   a , under such network configuration, information of the VLAN can also be obtained by the VLAN tag in the access response message, and then correlated with the route-related information. If multiple VLANs share one server responding to user access requests, as shown in  FIG. 3   b , then the VLAN information correlated with the route-related information can not be obtained via the VLAN tag in the access response message. At this time, the VLAN information correlated with the route-related information can only be obtained by the ARP message. 
         [0068]    Finally, the route maintenance means  14  creates or updates the route table based on said route-related information. 
         [0069]    In a preferred embodiment of the route maintenance means  14 , according to the route-related information, the predefined using time obtained by the first obtaining means  12  and the VLAN information obtained by the second obtaining means  13 , the first judging means  141  first judges whether a route table item corresponding to said route-related information exists in said route table. 
         [0070]    If a route table item corresponding to said route-related information exists in said route table, the second judging means  142  judges whether the remaining time in said route table item is shorter than said predefined using time. 
         [0071]    If a route table item corresponding to said route-related information exists in said route table and the remaining time in said route table item is shorter than said predefined using time, the updating means  143  updates the remaining time of said route table item to the predefined using time. 
         [0072]    If no route table item corresponding to said route-related information exists in said route table, the creating means  144  creates a route table item corresponding to said route-related information. 
         [0073]    In current network realizations, aforesaid access request message and access response message are DHCP messages, and said predefined using time is the lease time in the DHCP message. 
         [0074]      FIG. 5  illustrates the flowchart of the method for forwarding data in an access device of the communication network according to an embodiment of the present invention. The method consists in that data from user terminals belonging to different sub-networks is forwarded to corresponding sub-network gateway. As shown in  FIG. 5 , the method can be divided into four steps. 
         [0075]    At first, in step S 21 , a packet from a user terminal is received. 
         [0076]    Then, in step S 22 , the source network address and the destination network address are obtained from the packet. 
         [0077]    After that, in step S 23 , based on the source network address and the destination network address of said packet, a gateway which can get to the destination network and matches the source network address is inquired from the route table. In addition, the forwarding port corresponding to said gateway is also obtained. 
         [0078]    Finally, in step S 24 , the packet is sent to the gateway of said corresponding sub-network via said forwarding port. 
         [0079]    In current network realizations, aforesaid network addresses are IP addresses. 
         [0080]    In a preferred embodiment, an access device maintains a sub-network route table respectively for each sub-network. At first, a packet from a user terminal is received; then, based on the source IP address of said packet, a corresponding sub-network route table is inquired; after that, based on the destination IP address of said packet, the corresponding route table item is inquired from said corresponding sub-network route table, so as to determine the forwarding port of said packet; finally, the packet is sent to the gateway of said corresponding sub-network via said forwarding port. 
         [0081]    In another preferred embodiment, an access device only maintains one route table. At first, a packet coming from a user terminal is received; then based on the destination IP address of said packet, one or more route table items correlated with said destination address are inquired from said route table; after that, by using the source IP address of said packet, the route table item corresponding to the gateway belonging to its sub-network is determined from said one or more route table items correlated with said destination address, and the forwarding port of said packet is also determined; finally, the packet is sent to said corresponding sub-network&#39;s gateway via said forwarding port. 
         [0082]      FIG. 6  illustrates the block diagram of the forwarding apparatus  2  for forwarding data in an access device of the communication network according to an embodiment of the invention. The forwarding apparatus  2  forwards data from user terminals of different sub-networks to the gateways of corresponding sub-networks. 
         [0083]    The forwarding apparatus comprises a receiving means  21 , an obtaining means  22 , an inquiring means  23  and a sending means  24 . 
         [0084]    At first, the receiving means  21  receives a packet from a user terminal. 
         [0085]    Then, the obtaining means  22  obtains the source network address and the destination network address from said packet. 
         [0086]    After that, based on the source network address and the destination network address of said packet, the inquiring means  23  inquires a gateway from the route table which can get to the destination network and match the source network address, and a forwarding port corresponding to said gateway. 
         [0087]    Finally, the sending means  24  sends said packet to the gateway of said corresponding sub-network via said forwarding port. 
         [0088]    In current network realizations, aforesaid network addresses are IP addresses. 
         [0089]    In a preferred embodiment, an access device maintains a sub-network route table respectively for each sub-network. At first, the receiving means  21  receives a packet from a user terminal; then, the obtaining means  22  obtains the source network address and the destination network address from said packet; after that, based on the destination IP address of said packet, the inquiring means  23  inquires its corresponding sub-network route table; and then, based on the destination IP address of said packet, the inquiring means  23  inquires the corresponding route table item from said corresponding sub-network route table, so as to determine the forwarding port of said packet; finally, the sending means  24  sends said packet to the gateway of said corresponding sub-network via said forwarding port. 
         [0090]    In another preferred embodiment, an access device only maintains one route table. At first, the receiving means  21  receives a packet coming from a user terminal; then, the obtaining means  22  obtains the source network address and the destination network address from said packet; after that, based on the destination IP address of said packet, the inquiring means  23  inquires one or more route table items correlated with said destination address from said route table; afterwards, by using the source IP address of said packet, the route table item corresponding to the gateway belonging to its sub-network is determined from said one or more route table items correlated with said destination address, and the forwarding port of said packet is also determined; finally, the sending means sends said packet to the gateway said corresponding sub-network via said forwarding port. 
         [0091]    Above, embodiments of the present invention have been described. It should be understood that the present invention is not limited to aforementioned specific embodiments. Those skilled in the art can make various variations and modifications within the scope of the appended claims.