Abstract:
A method for forwarding data packet, a communication system, a Carrier Grade Network Address Translation (CGN) device, and an access gateway are provided. The CGN device communicates with the access gateway through an Internet Protocol Version 4 (IPv4) network and is used for receiving a first data packet forwarded by the access gateway and determining whether the first data packet is an IPv4 packet or an IPv6-over-IPv4 tunnel packet; forwarding the first data packet to the IPv4 network if the first data packet is the IPv4 packet; and decapsulating the first data packet if the first data packet is the IPv6-over-IPv4 tunnel packet to a first IPv6 packet, and sending the first IPv6 packet to an IPv6 network or the IPv4 network. Therefore, technical problems of fully utilizing the IPv4 network and, gradually increasing deployment of the IPv6 network, and realizing communication are solved.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation of U.S. patent application Ser. No. 13/111,662, filed on May 19, 2011, which is a continuation of International Application No. PCT/CN2009/072671, filed on Jul. 7, 2009. The International Application claims priority to Chinese Patent Application No. 200810219260.2, filed on Nov. 20, 2008. The afore-mentioned patent applications are hereby incorporated by reference in their entireties. 
     
    
     FIELD OF THE TECHNOLOGY 
       [0002]    The present invention relates to a network communication technology, and more particularly to a method for forwarding data packet, a system, and a device. 
       BACKGROUND OF THE INVENTION 
       [0003]    With the development of communication technologies, computer networks enter all aspects of human lives. The second generation Internet based on the Internet Protocol Version 4 (IPv4) becomes a bottleneck of launching network services as IPv4 address resources are about to be exhausted soon. Thus, the Internet Engineering Task Force (IETF) provides a series of technology means for effectively slowing down IPv4 address exhaustion, which includes: Private IP Address Space; Dynamic IP Address Allocation; Variable Length Subnet Mask; Classless Inter-Domain Routing (CIDR); and Network Address Translation/Network Address Port Translation (NAT/NAPT). With the deployment of the 3G, Next Generation Network (NGN) and IP multimedia systems and the development trend of the all IP, a great amount of IP addresses need to be consumed, which forces to expedite commercial use of the Internet Protocol Version 6 (IPv6). However, transition from the IPv4 to the IPv6 involves enormous work of upgrading and modifying systems of hosts and routers, which is impossible to be accomplished in a short time, the IPv4 and the IPv6 will coexist in a long term. Hence, how to fully utilize the existing IPv4 network to gradually increase deployment of the IPv 6  network and to realize communication is an industry focus. 
       SUMMARY OF THE INVENTION 
       [0004]    Accordingly, the embodiments of the present invention are directed to a method for forwarding data packet, a communication system, a Carrier Grade Network Address Translation (CGN) device, and an access gateway, so as to solve technical problems of fully utilizing the IPv4 network, gradually increasing deployment of the IPv6 network, and realize communication. 
         [0005]    According to a first aspect of the embodiments of the present invention, a method for forwarding data packet includes: 
         [0006]    A CGN device receives a first data packet forwarded by an access gateway, and determines whether the first data packet is an IPv4 packet or an IPv6-over-IPv4 tunnel packet. If the first data packet is the IPv4 packet, the CGN device forwards the first data packet to an IPv4 network. If the first data packet is the IPv6-over-IPv4 tunnel packet, the CGN device decapsulates the first data packet to a first IPv6 packet, and sends the first IPv6 packet to an IPv6 network or the IPv4 network. 
         [0007]    According to a second aspect of the embodiments of the present invention, a method for forwarding data packet includes: 
         [0008]    An access gateway receives a first data packet from a client, and determines whether the first data packet is an IPv4 packet or a first IPv6 packet. If the first data packet is the IPv4 packet, the access gateway forwards the IPv4 packet to a CGN device. If the first data packet is the first IPv6 packet, the access gateway encapsulates the IPv6 packet into an IPv6-over-IPv4 tunnel packet and sends the IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel. 
         [0009]    According to a third aspect of the embodiments of the present invention, a communication system includes: 
         [0010]    The CGN device, which communicates with an access gateway through a first IPv4 network, is configured to receive a first data packet forwarded by the access gateway and determine whether the first data packet is an IPv4 packet or an IPv6-over-IPv4 tunnel packet; forward the first data packet to a second IPv4 network if the first data packet is the IPv4 packet; and decapsulate the first data packet to a first IPv6 packet if the first data packet is the IPv6-over-IPv4 tunnel packet, and send the first IPv6 packet to an IPv6 network or the second IPv4 network. 
         [0011]    According to a fourth aspect of the embodiments of the present invention, a CGN device includes: a receiver, a determining module, a first communication module, and a second communication module. The receiver receives a first data packet forwarded by an access gateway; and the determining module determines whether the first data packet is an IPv4 packet or an IPv6-over-IPv4 tunnel packet. If the determining module determines that the first data packet is the IPv4 packet, the first communication module forwards the first data packet to an IPv4 network. If the determining module determines that the first data packet is the IPv6-over-IPv4 tunnel packet, the second communication module decapsulates the first data packet to a first IPv6 packet, and sends the first IPv6 packet to an IPv6 network or the IPv4 network. 
         [0012]    According to a fifth aspect of the embodiments of the present invention, an access gateway includes: a receiver, a determining unit, a first communication unit, and a second communication unit. The receiver receives a first data packet from a client; and the determining unit determines whether the first data packet received by the receiver is an IPv4 packet or a first IPv6 packet. If the determining unit determines that the first data packet is the IPv4 packet, the first communication unit, configured to forward the first data packet to a CGN device. If the determining unit determines that the first data packet is the first IPv6 packet, the second communication unit encapsulates the first IPv6 packet into an IPv6-over-IPv4 tunnel packet, and sends the IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel. 
         [0013]    By implementing the methods for forwarding data packet, the communication system, the CGN device, and the access gateway according to the embodiments of the present invention, at the same time of realizing network communication, the existing IPv4 network and devices are fully utilized, and the deployment of the IPv6 network can be gradually increased. Resource utilization is effectively increased, and networking cost is reduced, so as to facilitate smooth transition of communication technologies. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0014]      FIG. 1  is a flow chart of forwarding a data packet by an access gateway according to an embodiment of the present invention; 
           [0015]      FIG. 2  is a flow chart of forwarding a data packet by a CGN device according to an embodiment of the present invention; 
           [0016]      FIG. 3  is a flow chart of forwarding IPv4 traffic according to an embodiment of the present invention; 
           [0017]      FIG. 4  is a flow chart of forwarding IPv6 traffic according to an embodiment of the present invention; 
           [0018]      FIG. 5  is a structural block diagram of a communication system according to an embodiment of the present invention; 
           [0019]      FIG. 6  illustrates the CGN device in  FIG. 5  according to a first embodiment; 
           [0020]      FIG. 7  is a structural block diagram of the first communication module in  FIG. 6 ; 
           [0021]      FIG. 8  illustrates the CGN device in  FIG. 5  according to a second embodiment; 
           [0022]      FIG. 9  illustrates the access gateway in  FIG. 5  according to a first embodiment; 
           [0023]      FIG. 10  is a structural block diagram of the first communication unit in  FIG. 9 ; 
           [0024]      FIG. 11  illustrates the access gateway in  FIG. 5  according to a second embodiment; 
           [0025]      FIG. 12  illustrates a first preferred implementation mode of the present invention; and 
           [0026]      FIG. 13  illustrates a second preferred implementation mode of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0027]    In order to enable persons skilled in the art to more clearly understand technical solutions according to embodiments of the present invention, a method for forwarding data packet and a communication system according to embodiments of the present invention is set forth hereinafter in detail in combination with accompanying drawings. 
         [0028]    In the embodiments of the present invention, a CGN device and an access gateway are deployed in a network. The access gateway integrates an IPv4 forwarding function and an IPv6-over-IPv4 tunnel function, and alternatively, may further integrate an IPv4-IPv4 NAT function. The CGN device integrates the IPv6-over-IPv4 tunnel function and the IPv4-IPv4 NAT function, and alternatively, may further integrate an NAT-protocol translation (PT) function. 
         [0029]      FIG. 1  illustrates a method for forwarding data packet according to an embodiment of the present invention, which includes the following blocks. 
         [0030]    S 001 , an access gateway receives a first data packet from a client. 
         [0031]    S 002 , the access gateway determines whether the first data packet is a first IPv4 packet or a first IPv6 packet according to an IP protocol number in a header of the first data packet. 
         [0032]    S 003 , the access gateway forwards the first data packet to a CGN device if the first data packet is the first IPv4 packet. 
         [0033]    S 004 , the access gateway encapsulates the first data packet into a first IPv6-over-IPv4 tunnel packet if the first data packet is the first IPv6 packet, and sends the first IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel. 
         [0034]    In the embodiment of the present invention, after receiving a first data packet from an access gateway, a CGN device processes the first data packet as shown in  FIG. 2 , which includes the following blocks. 
         [0035]    S 100 , the CGN device receives the first data packet forwarded by the access gateway. 
         [0036]    S 200 , the CGN device determines whether the first data packet is a first IPv4 packet or a first IPv6-over-IPv4 tunnel packet according to information in the header of the first data packet. Specifically, when the first data packet has two or more than two headers, and a protocol number in an outer header is IPv4, the first data packet is the first IPv6-over-IPv4 tunnel packet; when it only has one header, and the protocol number is IPv4, the first data packet is the first IPv4 packet. 
         [0037]    S 300 , the CGN device forwards the first data packet to an IPv4 network if the first data packet is the first IPv4 packet. 
         [0038]    Alternatively, in S 400 , the CGN device decapsulates the first data packet to a first IPv6 packet if the first data packet is the first IPv6-over-IPv4 tunnel packet, and sends the first IPv6 packet to an IPv6 network or the IPv4 network. 
         [0039]    As shown in  FIG. 3 , forwarding of a data packet from an IPv4 client or a dual stack client through the IPv4 Protocol includes the following blocks. 
         [0040]    S 11 , a CGN device receives a first data packet carrying a first private IPv4 address forwarded by an access gateway. 
         [0041]    S 12 , the CGN device replaces the first private IPv4 address with a public IPv4 address, records a first mapping relationship between the public IPv4 address and the first private IPv4 address, and forwards the first data packet carrying the public IPv4 address to an IPv4 network. The first mapping relationship includes: a corresponding relationship between the public IPv4 address and the first private IPv4 address, and/or a corresponding relationship among the public IPv4 address, the first private IPv4 address and a first private port number. 
         [0042]    Before S 11 , if the IPv4 client has no public IPv4 address, the method may further include: the access gateway replaces a second private IPv4 address of the first data packet from the IPv4 client or the dual stack client with the first private IPv4 address, records a second mapping relationship between the second private IPv4 address and the first private IPv4 address, and forwards the first data packet carrying the first private IPv4 address to the CGN device. The second mapping relationship includes: a corresponding relationship between the second private IPv4 address and the first private IPv4 address, and/or a corresponding relationship among the first private IPv4 address, the second private IPv4 address and a second private port number. 
         [0043]    It should be noted that, when the CGN device receives a second data packet carrying the public IPv4 address from the IPv4 network, the method may further include the following blocks. 
         [0044]    The CGN device replaces the public network IPv4 address with the first private IPv4 address according to the first mapping relationship, and forwards the second data packet carrying the first private IPv4 address to the access gateway. 
         [0045]    Further, the access gateway receives the second data packet carrying the first private IPv4 address forwarded by the CGN device, translates the first private IPv4 address into the second private IPv4 address according to the second mapping relationship, and forwards the second data packet carrying the second private IPv4 address to the IPv4 client or the dual stack client. 
         [0046]    As shown in  FIG. 4 , forwarding of a data packet from an IPv6 client or a dual stack client through the IPv6 Protocol includes the following blocks. 
         [0047]    S 21 , a CGN device receives a first data packet forwarded by an access gateway through an IPv6-over-IPv4 tunnel. 
         [0048]    S 22 , the CGN device decapsulates the first data packet to a first IPv6 packet, and records information about the IPv6-over-IPv4 tunnel. The information about the IPv6-over-IPv4 tunnel includes: a tunnel number, a private IPv4 address of a starting point of the tunnel, and an IPv6 address corresponding to the tunnel. 
         [0049]    S 23 , the CGN device sends the first IPv6 packet to an IPv6 network or an IPv4 network. 
         [0050]    Before S 21 , the method may include the following blocks. 
         [0051]    The access gateway encapsulates the first IPv6 packet from the IPv6 client or the dual stack client into the first data packet, and sends the first data packet to the CGN device through the IPv6-over-IPv4 tunnel. 
         [0052]    During specific implementation, in S 23 , the sending of the first IPv6 packet to the IPv4 network includes the following blocks. 
         [0053]    The CGN device translates the first IPv6 packet to a second IPv4 packet, and records NAT-PT mapping information, and sends the second IPv4 packet to the IPv4 network. 
         [0054]    The translating, by the CGN device, the first IPv6 packet to the second IPv4 packet includes that: The CGN device replaces the IPv6 address in the first IPv6 packet with a public IPv4 address, thereby constructing the second IPv4 packet, and records an NAT-PT mapping relationship between the public IPv4 address and the IPv6 address. 
         [0055]    When receiving a second data packet from the IPv4 network, the CGN device translates the second data packet to a second IPv6 packet according to the recorded NAT-PT mapping relationship. Specifically, the CGN device replaces the public IPv4 address with the IPv6 address, obtaining the second IPv6 packet. 
         [0056]    It should be noted that when the CGN device receives a second IPv6 packet from the IPv6 network or obtains the second IPv6 packet by translating the received IPv4 packet with NAT-PT function, the method may further include the following blocks. 
         [0057]    The CGN device encapsulates the second IPv6 packet into a second IPv6-over-IPv4 tunnel packet according to the recorded information about the IPv6-over-IPv4 tunnel, and sends the second IPv6-over-IPv4 tunnel packet to the access gateway through the IPv6-over-IPv4 tunnel. 
         [0058]    Further, the access gateway receives the second IPv6-over-IPv4 tunnel packet sent by the CGN device through the IPv6-over-IPv4 tunnel, decapsulates the second IPv6-over-IPv4 tunnel packet to the second IPv6 packet, and sends the second IPv6 packet to the client. 
         [0059]    According to a method for forwarding data packet in an embodiment of the present invention, for a data packet carrying a first private IPv4 address, an access gateway directly forwards the data packet to a CGN device. For a data packet carrying a second private IPv4 address, the access gateway translates the second private IPv4 address into the first private IPv4 address, and then sends the data packet to the CGN device; the CGN device translates the first private IPv4 address into a public IPv4 address, and then forwards the data packet to a IPv4 network. For an IPv6 packet, the access gateway encapsulates the IPv6 packet into an IPv6-over-IPv4 tunnel packet, and sends the IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel; the CGN device decapsulates the IPv6-over-IPv4 tunnel packet to the IPv6 packet, and then sends the IPv6 packet to an IPv6 network. Therefore, the existing IPv4 network and devices are fully utilized, and the deployment of the IPv6 network can be gradually increased. Resource utilization is effectively increased, and networking cost is reduced, so as to facilitate smooth transition of communication technologies. 
         [0060]    Correspondingly, as shown in  FIG. 5 , an embodiment of the present invention provides a communication system, which includes a CGN device  5200  and an access gateway  5100 . 
         [0061]    The CGN device  5200  communicates with the access gateway  5100  through a first IPv4 network, and is configured to receive a first data packet forwarded by the access gateway  5100  and determine whether the first data packet is a first IPv4 packet or a first IPv6-over-IPv4 tunnel packet; forward the first data packet to a second IPv4 network if the first data packet is the first IPv4 packet; and decapsulate the first data packet to a first IPv6 packet if the first data packet is the first IPv6-over-IPv4 tunnel packet, and send the first IPv6 packet to an IPv6 network or the second IPv4 network. 
         [0062]    The access gateway  5100  is configured to receive the first data packet from a client (such as an IPv4 client or a dual stack client), and determine whether the first data packet is the first IPv4 packet or the first IPv6 packet; forward the first data packet to the CGN device if the first data packet is the first IPv4 packet; and encapsulates the first data packet into the first IPv6-over-IPv4 tunnel packet if the first data packet is the first IPv6 packet, and send the first IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel. 
         [0063]    During specific implementation, the CGN device  5200  is further configured to receive a second data packet from the second IPv4 network, and forward the second data packet to the access gateway  5100 ; or receive a second IPv6 packet from the IPv6 network, encapsulate the IPv6 packet into a second IPv6-over-IPv4 tunnel packet, and send the second IPv6-over-IPv4 tunnel packet to the access gateway  5100  through the IPv6-over-IPv4 tunnel. The access gateway  5100  is configured to forward the second data packet forwarded by the CGN  5200  device to the IPv4 client; or decapsulate the second IPv6-over-IPv4 tunnel packet to the second IPv6 packet, and send the second IPv6 packet to the dual stack client. 
         [0064]    According to an aspect of the embodiment of the present invention, as shown in  FIG. 6 , a CGN device includes a receiver  5201 , a determining module  5202 , a first communication module  5203 , and a second communication module  5204 . 
         [0065]    The receiver  5201  is configured to receive a first data packet forwarded by an access gateway. 
         [0066]    The determining module  5202  is configured to determine whether the first data packet is a first IPv4 packet or a first IPv6-over-IPv4 tunnel packet. 
         [0067]    The first communication module  5203  is configured to forward the first data packet to an IPv4 network if the determining module  5202  determines that the first data packet is the first IPv4 packet. 
         [0068]    The second communication module  5204  is configured to decapsulate the first data packet to a first IPv6 packet if the determining module  5202  determines that the first data packet is the first IPv6-over-IPv4 tunnel packet, and send the first IPv6 packet to an IPv6 network or the IPv4 network. 
         [0069]    As shown in  FIG. 7 , the first communication module  5203  includes an IPv4 address translating module  52031  and a sending module  52032 . 
         [0070]    The IPv4 address translating module  52031  is configured to replace a first private IPv4 address carried in the first data packet with a public IPv4 address. 
         [0071]    The sending module  52032  is configured to forward the first data packet carrying the public IPv4 address to the IPv4 network. 
         [0072]    According to another aspect of the embodiment of the present invention, as shown in  FIG. 8 , in addition to the structure in  FIG. 6 , the CGN device may further include a third communication module  5205  and a fourth communication module  5206 . 
         [0073]    The third communication module  5205  is configured to replace the public IPv4 address carried in a second data packet with the first private IPv4 address when receiving the second data packet from the IPv4 network, and forward the second data packet carrying the first private IPv4 address to the access gateway. 
         [0074]    The fourth communication module  5206  is configured to encapsulate a second IPv6 packet into a second IPv6-over-IPv4 tunnel packet according to recorded information about IPv6-over-IPv4 tunnel when receiving the second IPv6 packet from the IPv6 network, and send the second IPv6-over-IPv4 tunnel packet to the access gateway through an IPv6-over-IPv4 tunnel. 
         [0075]    During specific implementation, the CGN device may further include a protocol translating module  5207 , which is configured to translate the first IPv6 packet obtained by the second communication module  5204  to a second IPv4 packet, and send the second IPv4 packet to an IPv4 network; or to translate the second data packet received by the third communication module  5205  to a third IPv6 packet, and send the third IPv6 packet to the fourth communication module  5206 . 
         [0076]    As shown in  FIG. 9 , in the communication system in  FIG. 5 , the access gateway includes a receiver  8100 , a determining unit  8200 , a first communication unit  8300 , and a second communication unit  8400 . 
         [0077]    The receiver  8100  is configured to receive a first data packet from a client. 
         [0078]    The determining unit  8200  is configured to determine whether the first data packet received by the receiver  8100  is a first IPv4 packet or a first IPv6 packet. 
         [0079]    The first communication unit  8300  is configured to forward the first data packet to a CGN device if the determining unit  8200  determines that the first data packet is the first IPv4 packet. 
         [0080]    The second communication unit  8400  is configured to encapsulate the first data packet into a first IPv6-over-IPv4 tunnel packet if the determining unit  8200  determines that the first data packet is the first IPv6 packet, and send the first IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel. 
         [0081]    As shown in  FIG. 10 , the first communication unit  8300  includes an IPv4 address translating unit  8301  and a sending unit  8302 . 
         [0082]    The IPv4 address translating unit  8301  is configured to replace a second private IPv4 address carried in the first data packet with a first private IPv4 address. 
         [0083]    The sending unit  8302  is configured to send the first data packet carrying the first private IPv4 address to the CGN device. 
         [0084]    In another embodiment of the present invention, as shown in  FIG. 11 , the access gateway may further include a third communication unit  8500  and a fourth communication unit  8600 . 
         [0085]    The third communication unit  8500  is configured to replace the first private IPv4 address carried in a second data packet forwarded by the CGN device with a second private IPv4 address, and forward the second data packet to the client. 
         [0086]    The fourth communication unit  8600  is configured to decapsulate a second IPv6-over-IPv4 tunnel packet sent by the CGN device through the IPv6-over-IPv4 tunnel to a second IPv6 packet, and send the second IPv6 packet to a dual stack client. 
         [0087]    According to a communication system in an embodiment of the present invention, for a data packet carrying a first private IPv4 address, an access gateway directly forwards the data packet to a CGN device. For a data packet carrying a second private IPv4 address, the access gateway translates the second private IPv4 address into the first private IPv4 address, sends the data packet to the CGN device; the CGN device translates the first private IPv4 address into a public IPv4 address, and then forwards the data packet to an IPv4 network. For an IPv6 data packet, the access gateway encapsulates the IPv6 data packet into an IPv6-over-IPv4 tunnel packet, and sends the IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel; the CGN device decapsulates the IPv6-over-IPv4 tunnel packet to the IPv6 packet, and then sends the IPv6 packet to an IPv6 network. Furthermore, by integrating an NAT-PT function, interworking between IPv6 and IPv4 is realized, so that the existing IPv4 network and devices are fully utilized, and the deployment of the IPv6 network can be gradually increased. Resource utilization is effectively increased, and networking cost is reduced, so as to facilitate smooth transition of communication technologies. 
         [0088]    In order to make technical solutions implemented in the embodiment of the present invention be further understood, the following preferred implementation modes are provided. 
         [0089]    In a first mode, an access gateway integrates an IPv4-IPv4 translation function and an IPv6-over-IPv4 tunnel function, and a CGN device integrates an IPv4-IPv4 translation function and the IPv6-over-IPv4 tunnel function. 
         [0090]    As shown in  FIG. 12 , an IPv4 client and a dual stack client communicate with an access gateway respectively, the access gateway communicates with a CGN device through the IPv4 Protocol, and the CGN device is connected to an IPv6 network and an IPv4 network. 
         [0091]    The access gateway applies multiple private IPv4 addresses (such as, first private addresses according to the embodiments of the present invention) from the CGN device. 10.1.0.1 is allocated to the IPv4 client and 10.1.0.2 is allocated to an IPv4 port of the dual stack client. A local area network (LAN) interface address of the access gateway is 10.0.0.2, and a wide area network (WAN) interface address of the access gateway is 10.0.0.1. A private IPv4 address of the CGN device is 10.0.0.0, and a public IPv4 address of the CGN device is 193.0.0.2. 
         [0092]    The CGN device distributes a private IPv6 address with a prefix 2001:0:0:100/56 to the access gateway. Both an internal interface of the access gateway and an IPv6 port of the dual stack client use addresses within the address segment, such as 2001:0:0:100::1 and 2001:0:0:100::2. An IPv6address of the CGN device is 2001:0:0:0::1. 
         [0093]    When IPv4 traffic (or a message or a data packet) of the IPv4 client or the IPv4 port of the dual stack client arrives the access gateway, for example, a source address carried in the traffic (or the message or the data packet) of the IPv4 client is 10.1.0.1, the access gateway directly forwards the traffic (or the message or the data packet) to the CGN device. After IPv6 traffic of an IPv6 port of the dual stack client arrives the access gateway, the access gateway encapsulates the IPv6 traffic into IPv6-over-IPv4 tunnel traffic, and then sends the IPv6-over-IPv4 tunnel traffic to the CGN device through an IPv6-over-IPv4 tunnel. 
         [0094]    After receiving the traffic, the CGN device determines whether the traffic is IPv4traffic or traffic from the IPv6-over-IPv4 tunnel. For the IPv4 traffic, the CGN device translates the first private IPv4 address 10.1.0.1 into the public IPv4 address 193.0.0.2, and then the IPv4 traffic is forwarded to the IPv4 network. For the traffic from the IPv6-over-IPv4 tunnel, the CGN device decapsulates the traffic to the IPv6 traffic, and the IPv6 traffic is directly forwarded to the IPv6 network. The CGN device records information about the IPv6-over-IPv4 tunnel, such as a tunnel number and a private IPv4 address (such as 10.0.0.1) of a starting point of the tunnel. When the CGN device has multiple internal ports (that is, private network ports), an internal port number and an IPv6 address corresponding to the tunnel are recorded. For the traffic delivered from the IPv4 or IPv6 network, processing of the CGN device and the access gateway is similar to that in the foregoing, the description of which is not described repeatedly here. 
         [0095]    In a second mode, the access gateway integrates an IPv4-IPv4 address translation function and the IPv6-over-IPv4 tunnel function, and the CGN device integrates the IPv4-IPv4 address translation function and the IPv6-over-IPv4 tunnel function. The access gateway communicates with the CGN device through the IPv4 Protocol. 
         [0096]    In the case that the private IPv4 address of the LAN interface of the access gateway is different from the private IPv4 address of the WAN interface of the access gateway, a Home Gateway (HG) needs translate a second private IPv4 address into a first private IPv4 address delivered by CGN device. 
         [0097]    As shown in  FIG. 13 , a CGN device distributes a first private IPv4 address to an access gateway manually or with Dynamic Host Configuration Protocol (DHCP) v4, such as 10.0.0.1 (used by a WAN interface), and the CGN device also uses a private IPv4address 10.0.0.0 internally. The access gateway distributes a second private IPv4 address downwards, which belongs to independent space for IPv 4  private address. As shown in  FIG. 13 , an internal interface (LAN interface) of the access gateway uses 192.168.0.0, an IPv4 client uses 192.168.0.1, and an IPv4 port of a dual stack client uses 192.168.0.2. For IPv4 traffic from a client, the access gateway translates the second private IPv4 address 192.168.0.1 into a first private IPv4 address 10.0.0.1, and forwards the IPv4 traffic to the CGN device. The CGN device replaces the 10.0.0.1 with a public IPv4 address, such as 193.0.0.2, and forwards the IPv4 traffic to an IPv4 network. For a reverse IPv4 traffic, the CGN device translates the public IPv4 address into the first private IPv4 address, and forwards the IPv4 traffic to the access gateway. When the IPv4 traffic arrives the access gateway, the access gateway translates the first private IPv4 address into the second private IPv4 address and forwards the IPv4 traffic to the client. Processing for the IPv6 traffic is similar to that in the first mode, the description of which is not described repeatedly here. 
         [0098]    Persons skilled in the art should understand that, the CGN device may further integrates an NAT-PT function of IPv6-IPv4, and therefore interconnecting and interworking between IPv6-only and IPv4-only are supported. 
         [0099]    Through the descriptions of the preceding embodiments, persons skilled in the art may understand that the embodiments of the present invention may be implemented by using by using software plus a necessary universal hardware platform or by using hardware only. Based on such understanding, all or part of the technical solution under the present invention that makes contributions to the prior art may be essentially embodied in the form of a software product. The software product may be stored in a storage medium, which can be a Read-Only Memory (ROM)/Random Access Memory (RAM), a magnetic disk, and an optical disk. The software product includes a number of instructions that enable a computer device (a personal computer, a server, or a network device) to execute the methods provided in the embodiments of the present invention. 
         [0100]    According to a method for forwarding data packet and a communication system in the embodiments of the present invention, for a data packet with a first private IPv4 address, an access gateway directly forwards it to a CGN device. For a data packet with a second private IPv4 address, the access gateway first translates the source address of the data packet into a second private IPv4 address, then sends the data packet to the CGN device. The CGN device translates the first private IPv4 address into a public IPv4 address, and then forwards the data packet to an IPv4 network. For an IPv6 data packet, the access gateway encapsulates the IPv6 data packet into an IPv6-over-IPv4 tunnel packet, and sends the IPv6-over-IPv4 tunnel packet to the CGN device through an IPv6-over-IPv4 tunnel. The CGN device decapsulates the IPv6-over-IPv4 tunnel packet to the IPv6 packet, and then sends the IPv6 packet to an IPv6 network. Therefore, the existing IPv4 network and devices are fully utilized, and the deployment of the IPv6 network can be gradually increased. Resource utilization is effectively increased, and networking cost is reduced, so as to facilitate smooth transition of communication technologies. 
         [0101]    The foregoing description is merely a preferred embodiment of the present invention, but not intended to limit the scope of the present invention. Equivalent changes made according to the appended claims of the present invention should fall within the scope of the present invention.