WO2010045809A1 - 一种实现网络地址转换的方法、媒体网关和网络系统 - Google Patents

一种实现网络地址转换的方法、媒体网关和网络系统 Download PDF

Info

Publication number
WO2010045809A1
WO2010045809A1 PCT/CN2009/072916 CN2009072916W WO2010045809A1 WO 2010045809 A1 WO2010045809 A1 WO 2010045809A1 CN 2009072916 W CN2009072916 W CN 2009072916W WO 2010045809 A1 WO2010045809 A1 WO 2010045809A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
network
mapping relationship
media gateway
packet
Prior art date
Application number
PCT/CN2009/072916
Other languages
English (en)
French (fr)
Inventor
祝宁
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2010045809A1 publication Critical patent/WO2010045809A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2539Hiding addresses; Keeping addresses anonymous

Definitions

  • the present invention relates to the field of communications, and in particular, to a method for implementing network address translation, a media gateway, and a network system. Background technique
  • the NGN network mainly includes a Media Gateway (MG) and a Media Gateway Controller (MGC).
  • the MGC is configured to implement call state management and control of MG bearer resources.
  • the MG is configured to convert the media stream type from one format to another format, for example, the E1 time slot in the circuit switched network.
  • the media information is converted into a Real Time Transport Protocol (RTP) media stream in the IP network, and the functions of establishing, modifying, releasing, and resource management of the media stream are implemented under the signaling control of the MGC.
  • RTP Real Time Transport Protocol
  • the MGC sends control and other information to the MG through the H.248 protocol message.
  • the MG also has a Network Address Translation or Network Address Translator (NAT) function.
  • NAT Network Address Translation
  • Traditional NAT (Traditional NAT) technology is a technology that translates an internal private network address, that is, an IP (Internet Protocol) address into an external public network IP address.
  • NAT is to use the internal address in the LAN internal network, and when the internal node wants to communicate with the external network, it will be inside the gateway (such as the media gateway in the NGN network)
  • the address is replaced with a public address for normal use on an external public network (Internet).
  • the internal address mentioned here includes the private IP address assigned to the node in the internal network, which can be used in the internal network and cannot be routed.
  • a public address is a legal IP address, which is a globally uniform addressable address.
  • NAT functionality can also be integrated into routers, firewalls, ISDN routers, or separate NAT devices.
  • NAT can be divided into the following types:
  • NAPT Network Address Port Translation
  • the basic NAT has multiple public IP addresses.
  • a host located on the internal network initiates a session request to an external host, the internal address is converted into a global public IP address.
  • NAPT further extends the concept of "basic NAT" conversion, gp, which also converts the transport layer flag (such as TCP/UDP port number, ICMP query ID) while translating the address, thereby re-signing the transport layer of multiple internal hosts. Used as a unique external address.
  • basic NAT conversion
  • a session request can be initiated from the internal network to the external network, or a session request can be initiated from the external network to the internal network.
  • the internal network address is statically or dynamically bound to a globally unique address. It is assumed here that the namespace (Fully Qualified Domain Names, FQDN, full-quality domain name, referred to as namespace) between the internal network and the external network is end-to-end unique, so that the host located in the external addressing domain utilizes the domain name system ( Domain Name System, DNS ) A host that accesses the internal network.
  • namespace Full-quality domain name
  • DNS-ALG DNS Application Level Gateway
  • the embodiment of the present invention aims to provide a method for implementing network address translation, a media gateway, and a network system, to solve the problem.
  • the correct network address translation can be achieved.
  • an embodiment of the present invention provides a method for implementing network address translation, including: obtaining an address mapping relationship sent by a media gateway controller, where the address mapping relationship includes a first network An address and a second address to which the first address is mapped, a third address of the second network, and a fourth address to which the third address is mapped; sending the received from the first network to the The IP packet of the second network, according to the address mapping relationship, the first address of the IP packet as the source address is modified into the second address, and the IP packet is used as the destination address.
  • the fourth address is modified into the third address, and then forwarded to the second network; and the received IP packet sent from the second network to the first network is determined according to the address mapping relationship.
  • the third address as the source address in the IP packet is modified into the fourth address, and the second address in the IP packet as the destination address is modified into the first address, and then forwarded to Place Said the first network.
  • an embodiment of the present invention provides a media gateway, including: an acquiring unit, configured to: Obtaining an address mapping relationship sent by the media gateway controller, where the address mapping relationship includes a first address of the first network and a second address to which the first address is mapped, a third address of the second network, and the first a fourth address to which the third address is mapped; a packet receiving unit, configured to receive an IP packet sent from the first network to the second network, or send the packet from the second network to the first An IP packet of the network, where the mapping unit is configured to send the IP packet sent from the first network to the second network as a source address according to the address mapping relationship.
  • the first address is modified into the second address, and the fourth address in the IP packet as the destination address is modified into the third address, and the IP packet with the modified address is obtained, or is used for Transmitting the received IP packet from the second network to the first network, and modifying the third address in the IP packet as a source address to the fourth address according to the address mapping relationship Decoding the IP packet as the destination address Second address to the first address modification, IP packet to obtain the address changes; forwarding unit for IP packets after the mapping unit obtains the forwarding address modification to the first network or the second network.
  • the embodiment of the present invention further provides a network system, including a media gateway controller and a media gateway, where the media gateway controls to send an address mapping relationship to the media gateway, where the address mapping relationship includes the first a first address of the network and a second address to which the first address is mapped, a third address of the second network, and a fourth address to which the third address is mapped; the media gateway is configured to use the address according to the address
  • the mapping relationship performs network address mapping to send an IP packet from the first network to the second network, or send an IP packet from the second network to the first network.
  • the media gateway obtains an address mapping relationship that is sent by the media gateway controller, where the address mapping relationship includes a first address of the first network and a second address to which the first address is mapped.
  • the third address of the second network and the third address are mapped to the fourth address, so that the media gateway can map the destination address and the source address of the IP packet according to the address mapping relationship to bridge different two
  • the address field of the network solves the problem of internal address domain and external addressed domain address conflicts.
  • 1 is a schematic diagram of the composition of a conventional NGN system
  • FIG. 2 is a schematic diagram showing the composition of a specific embodiment of a network system in the present invention.
  • FIG. 3 is a schematic diagram showing the composition of a specific embodiment of the media gateway in FIG. 2;
  • FIG. 4 is a schematic diagram showing the composition of a specific embodiment of the acquisition unit in FIG. 3;
  • FIG. 5 is a schematic diagram of a specific embodiment of a mapping relationship obtaining module in FIG. 4;
  • FIG. 6 is a schematic flowchart of a first embodiment of a method for implementing network address translation in the present invention;
  • FIG. 2 is a schematic diagram showing the composition of a specific embodiment of the network system in the present invention.
  • the network system includes: a media gateway controller 1 and a media gateway 2, and the media gateway controller 1 and the media gateway 2 are connected.
  • the media gateway controller 1 is configured to send an address mapping relationship to the media gateway 2, and the media gateway 2 performs address mapping on the forwarded IP packet according to the address mapping relationship.
  • the address mapping relationship includes: a first address mapped by the IP network 1 and a second address mapped to the first address, a third address of the IP network 2, and a fourth address mapped by the third address.
  • the mapping relationship may describe a mapping between a single address, and may also describe a mapping between address groups, and the mapping between the address groups represents a one-to-one mapping between multiple addresses included in two address groups.
  • the first address and the second address in the mapping relationship are both a single address or a single address in the address group, and the third address and the fourth address are both the single address or the same in the address group. Address.
  • the address mapping relationship can be sent to the media gateway 2 by sending a context attribute, for example, by adding (ADD), modifying (MOD), or moving (MOV) commands.
  • the address information may be sent in a context attribute, or may be delivered by two context attributes, and the mapping relationship between the first address and the second address is respectively described in two context attributes, and the third The mapping relationship between the address and the fourth address.
  • the address mapping relationship may further include an interface identifier of the interface related to the address mapping, and the interface identifier may be sent to the media gateway 2 by being carried in the context attribute.
  • the interface identifier in the context attribute describing the address mapping relationship is not required.
  • the interface identification information may be delivered in other manners, such as to the media gateway 2 by means of a naming manner of the terminal carried in the context of the context attribute.
  • the two terminals in the context are named "IP/G12/interfacel/l" and “IP/G34/interface2/2", respectively, and the terminal name includes NA.
  • T address mapping refers to the respective interface names of the two terminals, gp, the interface where the terminal 1 is located is named “interf acel”, the “interfacel” is the first network interface in the network address mapping, and the interface name where the terminal 2 is located For “interface2”, the “interface2" is the second network interface in the network address mapping.
  • part of the information in the address mapping relationship sent by the media gateway controller 1 can be represented only as a wildcard symbol, rather than a specific address, such as a wildcard symbol of "$".
  • the specific address information may be allocated by the media gateway according to other information in the delivered address mapping relationship, so that the media gateway can increase the flexibility of the media network for network address translation according to the information corresponding to the free wildcard symbol in the local situation. Sex.
  • the media gateway 2 may include:
  • the obtaining unit 20 is configured to obtain an address mapping relationship that is sent by the media gateway controller, where the address mapping relationship includes a first address of the first network and a second address to which the first address is mapped, where the second network is The third address and the third address are mapped to the fourth address, and the obtaining unit 20 is further configured to obtain an address including one or more of the first network port, the second network port, and the NAT address mapping type information. Mapping relations; a packet receiving unit 21, configured to receive an IP packet sent from the first network to the second network, or receive an IP packet sent from the second network to the first network;
  • the mapping unit 22 is configured to: in the received IP packet sent from the first network to the second network, the first address in the IP packet as a source address according to the address mapping relationship Modifying to the second address, modifying the fourth address in the IP packet as the destination address to the third address, obtaining an IP packet with the modified address, or for receiving the received slave Transmitting, by the second network, the IP packet to the first network, the third address in the IP packet as a source address, to the fourth address according to the address mapping relationship, where the The second address that is the destination address in the IP packet is modified into the first address, and the IP packet with the modified address is obtained.
  • the forwarding unit 23 is configured to forward, by the mapping unit, the IP packet whose address is modified to the first network or the second network.
  • the obtaining unit 20 may include: an attribute obtaining module 200, configured to obtain at least one context attribute sent by the media gateway controller; and a mapping relationship obtaining module 202, configured to acquire an address mapping in the context attribute relationship.
  • the mapping relationship obtaining module 202 includes an allocation submodule 2020, configured to obtain an address mapping relationship sent by the media gateway controller, according to the wildcard symbol in the address mapping relationship.
  • the other information is obtained by using the mapping address corresponding to the wildcard symbol, for example, may be directly allocated by the distribution sub-module 2020, or obtained by other devices in the network.
  • the mapping relationship obtaining module 202 may further include: an response sub-module 2022, configured to And generating, by the address mapping relationship and the allocated mapping address, a response message, and returning to the media gateway controller, where the response message includes an address mapping relationship that replaces the wildcard symbol with the corresponding mapping address.
  • the media gateway may map the destination address and the source address of the IP packet to bridge the two networks in which the address domain overlaps, thereby solving the problem of address conflict.
  • multiple ways for the media gateway to obtain an address mapping relationship are provided, so that the technical solution is more flexible and practical.
  • FIG. 6 and FIG. 7 is a flowchart of a method for implementing network address translation according to an embodiment of the present invention. The flow shown in FIG. 6 and FIG. 7 is described in detail below.
  • the method for implementing network address translation includes the following processes:
  • the mapping relationship may describe a mapping between a single address, and may also describe a mapping between address groups, where mapping between the address groups indicates a one-to-one mapping between individual addresses between two address groups;
  • the interface identifier may also be included in the address mapping relationship.
  • the media gateway and the media gateway controller implement the management of the address mapping relationship of the media gateway controller by synchronizing the address mapping relationship, and the media gateway performs NAT address translation and IP packet forwarding on the passed media IP packets according to the address mapping relationship.
  • the first network and the second network may have address overlaps, so it is necessary to use two NATs to perform IP packet forwarding between the two networks.
  • These two networks can be regarded as two private networks. In actual operation, one of the networks can also be regarded as a private network, and the other network is regarded as a public network. Later, to avoid confusion, the two networks are referred to as networkl and network2, respectively.
  • Networkl Interface I " NetworkllP Address
  • I NetworklMappedlP Address
  • Network2Interface ⁇ Network2IP Address
  • Network2MappedIP Address IP
  • the network address in Network 1 can be a single address, or it can be an address group (or subnet address plus mask).
  • NetworklMappedlP Address is the address to which NetworkllP Address is mapped, the number of addresses it represents and NetworkllP Address The same, if it is a mapping between address groups, the addresses in the group have a one-to-one correspondence.
  • Network2Interface is the interface name in IP network 2, and Network2IPAddress is in IP network 2.
  • Network address, Network2IPAddress can be a single address, or it can be an address group (or subnet address plus mask).
  • Network2MappedIPAddress is the address to which Network2IP Address is mapped. The number of addresses represented by Network2MappedIPAddress is the same as that of Network2IP Address. If it is a mapping between address groups, the addresses in the group are one-to-one correspondence.
  • 200.200.200.0/24 indicates that the subnet address is 200.200.200.0, and the network bit is 24 bits, that is, the mask is 2 55.255.255.0.
  • 138.76.28.0/24 indicates that the subnet address is 138.76.28.0 and the mask is 255.255.255.0.
  • 172.16.1.0/24 indicates that the subnet address is 172.16.1.0 and the mask is 255.255.255.0.
  • the mapping between address groups represents a one-to-one mapping of addresses between address groups. For example: on the interface "interfac el", 200.200.200.1 maps to 138.76.28.1, 200.200.200.2 maps to 138.76.28.2, and so on.
  • mappings between address groups or you can map only individual addresses, for example:
  • the delegate maps the address 200.200.200.1 to 138.76.28.1 on the interface, interfacel ", and maps the address 200.200.200.100 to 172.16.1.100 on the interface "interface2".
  • the interface information is transmitted to the media gateway by other means, for example, by naming the terminal name, etc.
  • the interface name part in the above context attribute may also be partially or completely omitted.
  • Interface information Part of it can also be determined by static configuration, in which case it is not necessary to send interface information in the context attribute.
  • a similar implementation method is to describe the address mapping relationship of the two networks by using two context attributes respectively.
  • the address mapping relationship on interfacel and the address mapping relationship on interface2 are respectively described by context attributes in two contexts.
  • the above method describes the mapping relationship of a single two NAT address mappings through context attributes.
  • the context attributes in the multiple contexts can be combined to describe the mapping relationship of multiple NAT address mappings to form two NAT address mapping tables, so that the media gateway implements the functions of the two NAT devices.
  • the above only considers the mapping between the IP addresses of the three layers. If the port of the TCP/UDP (Transfer Control Protocol/User Datagram Protocol) is considered, the address mapping relationship described above is used. It also needs to be further extended to describe the address mapping relationship between the IP address plus the port. A port of an IP address of IP network 1 is mapped to an address plus a port; a port of an IP address of IP network 2 is mapped to an address plus a port. In this case, the media gateway actually implements the functions of NAPT twice.
  • TCP/UDP Transfer Control Protocol/User Datagram Protocol
  • a part of the context attribute may be set to a wildcard symbol, for example, one of the first address, the second address, the third address, or the fourth address uses a wildcard symbol; or one of the first address and the second address uses a wildcard symbol And using one of the third address and the fourth address to use the wildcard symbol; the media gateway returns the address value associated with the wildcard symbol to the media gateway controller.
  • the context attribute is:
  • interfacel 1200.200.200.11$1 interface2l200.200.200.1001172.16.1.100 is equivalent to requiring the media gateway to return the address mapped on interfacel 200.200.200.1.
  • the media gateway returns "interfacell200.200.200.1ll38.76.28.1linterface2l" in the response message. 200.20 0.200.1001172.16.1.100 " .
  • the media gateway controller obtains the address mapped to 200.200.200.1 on interfacel as 138.76.28.1.
  • the address mapping rule of the two NATs is different from the one-time NAT (for example, the traditional NAT and the two-way NAT).
  • the address mapping of the two NATs requires address mapping for both the source address and the destination address.
  • the present invention The context attribute describing the address mapping relationship of the two NATs in the embodiment may be a newly extended context attribute, and may also borrow attributes of the prior art for describing the address mapping of the traditional NAT, for example, the current draft of H.248.
  • the nmi attribute of the iprnat packet is used to describe the address mapping relationship in the present invention. In the latter case, the existing syntax of the attribute is modified.
  • a method for describing a context attribute of an address mapping relationship of two NATs is: Adding a flag to the attribute syntax, for example, if the flag "typ e: twi Ce " is present, it means that the attribute describes the address of the NAT twice.
  • Mapping relationships for example:
  • nmi attribute The syntax of the nmi attribute can also be modified as follows:
  • PrivatelPAddress'T'PublicIP Address [" Iprp: “PrivatePort] ["lpup:”PubicPort] ["Ida:” DestinationlP Address] ["Idp:” DestinationPort] is a NAT address for a single NAT (traditional NAT or bidirectional NAT) A description of the mapping relationship.
  • Network 1 Interface I " NetworkllP Address”
  • I NetworklMappedIP Address
  • ⁇ Network2Interface ⁇ Network2IP Address
  • ⁇ Network2MappedIP Address is a description of the mapping of NAT NAT addresses.
  • the context attribute that is issued is:
  • the address mapping relationship in the context attribute indicates that the type of the NAT address mapping is twice NAT.
  • the address mapping maps the address 200.200.200.1 to 138.76.28.1 on the interface "interfacel” and the address 200.200.200.100 on the interface "interface2". Map to 172.16.1.100.
  • the NAT address mapping can also be other types, for example: “ type:BasicNATI200.200.200.11138.76.28.1 "
  • NAT is a basic NAT and maps the address 200.200.200.1 to 138.76.28.1.
  • the part of the context attribute describing the NAT type can also be moved out and described by a new extended context attribute, that is, a separate attribute defining the type of NAT describing the context description of the NIPR (NAT IP Router). .
  • the address mapping of the two NATs acts on two-way IP packets between the two IP networks.
  • the present invention can also be used for one-way IP packets, for example, only for IP.
  • Two NAT mappings from network 1 to IP network 2 or only two NAT mappings from IP network 2 to IP network 1.
  • the fourth address as the destination address in the IP packet is modified into the mapped third address.
  • the IP address 1 and IP network 2 address plans overlap, assuming the network addresses are 2 00.200.200.0.
  • the media gateway obtains the address mapping relationship as the mapping of the address group: mapping the address 200.200.200.0/24 in the IP network 1 to 138.76.28.0/2 4; The address 200.200.200.0/24 is mapped to 172.16.1.0/24; where, the 2 4 after "/" indicates that the first 24 bits are the network address, and the last 8 bits are the host address.
  • 200.200.200.0/24 means the network address is 200.200.200.0, the mask is 255.255.255.0; 138.76.28.0/24 means the network address 138.76.28.0, the mask is 255.255.255.0; 172.16.1.0/24 means the network address 172.16 .1.0, the mask is 255.255.255.0.
  • the address mapping relationship is to map a group of network addresses to another group of network addresses
  • the media gateway maps the address 200.200.200.1 in the IP network 1 to 138.76.28.1, and the address 200.200.200.2 to 138.76.28.2. And so on; the media gateway maps the address 200.200.200.1 in IP network 2 to 172. 16.1.1, the address 200.200.200.2 maps to 172.16 ⁇ 2, and so on.
  • mapping an address can only be mapped to another address, but not to multiple addresses, that is, the mapped addresses are all corresponding.
  • the media gateway receives the IP data stream sent from the IP network 1, if the range of the source address and the destination address is within the range of the address mapping relationship described above, the two NAT address mappings described above may be applied, assuming the source address. 200.200.200.1, the destination address is 172.16.1.100, the media gateway modifies the source address of the IP data stream 200.200.200.1 to 138.76.28.1, the destination address 172.16.1.100 to 200.200.200.100, and then forwards the data stream to the IP address. Network 2.
  • the flow shown in FIG. 7 is described below. As shown in FIG. 7, the flow includes 601 and 603.
  • the 601 in FIG. 7 is similar to the 601 shown in FIG. 6 above, and details are not described herein. .
  • the media gateway receives the IP data stream sent from the IP network 2, if the range of the source address and the destination address is within the range of the address mapping relationship described above, the two NAT address mappings described above may be applied. Assuming the source address is 200.200.200.100 and the destination address is 138.76.28.1, the media gateway modifies the source address of the IP data stream from 200.200.200.100 to 172.16.1.100, and the destination address 138.76.2 8.1 to 200.200.200.1, and then the data. The flow is forwarded to the IP network 1.
  • the processes shown in FIG. 6 and FIG. 7 may be performed in a crossover manner.
  • the execution of 602 and 603 is not performed in sequence, and may be performed simultaneously, or may be performed after executing 602 first, or 603, or The execution 602 is performed after the first execution of 603, and the present invention is not limited thereto.
  • step 601 the process of the media gateway controlling the sending of the address mapping relationship to the media gateway may be initiated by the media network controller, or may be triggered by the media gateway to trigger the media gateway controller. If the process is initiated by the media gateway triggering the media gateway controller, the following steps are also included before step 601:
  • the media gateway When receiving the IP packet sent by the IP network 1 from the media gateway and failing to find the available address mapping relationship, the media gateway generates and sends a report event message to the media gateway controller to notify the media network.
  • the controller source address and/or destination address have no corresponding entries in the address mapping table. If the source address does not have a corresponding item in the address mapping table, the media gateway controller may search for the interaction with the DNS-ALG or assign a new mapping address to the source address, or the media gateway controller spontaneously generates the source address. The address is searched or assigned a new mapping address. The new mapping address can be sent to the media gateway in subsequent messages.
  • the media gateway controller can pass the DNS- The ALG's interactive lookup, or look up the destination network and the real destination device and its address in the destination network on the media gateway controller. This event can be set on the terminal of the interface context or defined to other terminals.
  • the IP address received by the media gateway on the IP network 1 is 200.200.200.1, and the destination address is 172. 16.1.100, but the matching NAT address mapping entry cannot be found.
  • the media gateway passes the above two addresses. The event is reported to the media gateway controller. Through the interaction with the DNS-ALG, the media gateway controller finds that the address 200.200.200.1 in the IP network 1 is mapped to 138.76.28.1, and the destination address 172.16.1.100 is mapped in the IP network 2 address 200.200.200.100. The address.
  • the media gateway controller sends an H.248 message to the media gateway to create a new NIPR context.
  • the context attribute describes the address mapping relationship of the NAT twice as "interfacell200.200.200.1ll38.76.28.1linterface2l 200.200.200.1001172.16. 1.100", The meaning of the address mapping relationship has been described above, and will not be described here. After that, it proceeds to step 601.
  • the media gateway may map the destination address and the source address of the IP packet to bridge the address domains of the two different networks, thereby solving the problem of address conflict.
  • multiple manners for obtaining a mapping relationship between the media gateway and a specific multiple address mapping relationship are provided, so that the solution implemented during address mapping can be more flexible and practical.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, ie may be integrated Set as a network unit, or you can set it separately On multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Description

本申请要求于 2008年 10月 22日提交中国专利局、 申请号为 200810218689.X、 发明名称为"一种实现网络地址转换的方法、 媒体网关和网络系统" 的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通讯领域, 尤其涉及一种实现网络地址转换的方法、 媒体网关 和网络系统。 背景技术
在网络系统中通常分为多个子网, 各个子网之间通过网关相互连接。 如以 软交换设备为核心的下一代网络 (Next Generation Network, NGN) , 其网络 结构如图 1所示。 NGN网络主要包括媒体网关(Media Gateway, MG)和媒体网 关控制器(Media Gateway Controller, MGC) 。 其中, MGC, 用于实现呼叫状 态的管理, 以及对 MG承载资源的控制; MG, 用于将媒体流类型由一种格式转 换为另一种格式, 例如, 将电路交换网中的 E1时隙中的媒体信息转换为 IP网络 中的实时传输协议 (Realtime Transport Protocol, RTP) 媒体流, 并在 MGC的 信令控制下实现媒体流的建立、 修改、 释放以及资源管理等功能。 MGC通过 H. 248协议消息向 MG发送控制等信息。
另夕卜, MG还具有网络地址转换 (Network Address Translation或 Network Address Translator , NAT) 功能。 传统 NAT (Traditional NAT) 技术是一种把 内部私有网络地址, 即 IP (Internet Protocol, 网络协议) 地址, 翻译成外部公 有网络 IP地址的技术。
简单的说, NAT就是在局域网内部网络中使用内部地址, 而当内部节点要 与外部网络进行通讯时, 就在网关 (如 NGN网络中的媒体网关) 处, 将内部地 址替换成公用地址, 从而在外部公网 (Internet) 上正常使用。 这里提到的内部 地址, 包括在内部网络中分配给节点的私有 IP地址, 该私有 IP地址能在内部网络 中使用, 不能被路由。 而公用地址, 是指合法的 IP地址, 该合法的 IP地址是全球 统一的可寻址的地址。 NAT功能还可以被集成到路由器、 防火墙、 ISDN路由器 或者单独的 NAT设备中。
从功能上看,根据 RFC (Request For Comment,注释的请求)的定义, NAT 可以分为以下几种类型:
1、 传统 NAT (Traditional NAT)
传统 NAT又可以分为两种类型: 基本 NAT (Basic NAT)和网络地址端口转 换 (Network Address Port Translation, NAPT) , 其中,
(1)基本 NAT
基本 NAT拥有多个公开 IP地址, 当位于内部网络的主机向外部主机发起会 话请求时, 把内部地址转换成全球惟一的公开 IP地址;
(2) NAPT
NAPT把 "基本 NAT"转换的概念进一步延伸, gp, 在转换地址的同时也转 换传输层标志 (如 TCP/UDP的端口号, ICMP的查询 ID), 从而把多个内部主机的 传输层标志复用为一个惟一的外部地址。
2、 双向 NAT (Bi-directional NAT或 Two- Way NAT)
使用双向 NAT时, 可以从内部网络向外部网络发起会话请求, 也可以从外 部网络向内部网络发起会话请求。 当在外出或进入任何一个方向上建立连接时, 把内部网络地址静态或动态绑定到全局惟一的地址上。 这里假设位于内部网络 和外部网络之间的名字空间 (Fully Qualified Domain Names, FQDN , 完全 质量域名, 简称为名字空间) 是端到端惟一的, 以使得位于外部编址域的主机 利用域名系统 (Domain Name System, DNS ) 访问内部网络的主机。 在双向 N AT上必须部署 DNS应用层网关(DNS-Application Level Gateway, DNS-ALG), 以处理名字到地址的映射。 当一个 DNS包需要穿越内部和外部编址域时, DNS- ALG必须能够将 DNS查询和响应消息中的内部地址翻译成外部地址, 或把外部 地址翻译成内部地址。
在实现本发明过程中, 发明人发现, 由于上述的两种 NAT只翻译源地址或 者目的地址 (或还包括翻译端口) , 因此, 当一个站点不恰当地使用已分配给 其它机构的公开 IP地址对其内部主机进行编址时,或者当一个站点从一家运营商 换到另外一家运营商, 同时希望在内部保留前一家运营商分配的地址时 (而前 一家运营商可能会在一段时间后将这些地址重新分配给其它人使用) , 这些情 况下, 会发生内部编址域和外部编址域冲突, 然而, 现有技术中的 NAT不能解 决这种冲突。
发明内容
由于现有技术中的 NAT无法解决内部编址域和外部编址域冲突的问题, 基 于此, 本发明实施例旨在提供一种实现网络地址转换的方法、 媒体网关和网络 系统, 以解决当发生内部编址域和外部编址域冲突时, 能够实现正确的网络地 址转换。
为实现上述目的, 一方面, 本发明的实施例提供了一种实现网络地址转换 的方法, 包括: 获得媒体网关控制器发送的地址映射关系, 所述地址映射关系 中包括第一网络的第一地址和所述第一地址被映射成的第二地址, 第二网络的 第三地址和所述第三地址被映射成的第四地址; 对接收到的从所述第一网络发 往所述第二网络的 IP报文,根据所述地址映射关系将所述 IP报文中作为源地址的 所述第一地址修改成所述第二地址,将所述 IP报文中作为目的地址的所述第四地 址修改成所述第三地址, 然后转发到所述第二网络; 对接收到的从所述第二网 络发往所述第一网络的 IP报文,根据所述地址映射关系将所述 IP报文中作为源地 址的所述第三地址修改成所述第四地址,将所述 IP报文中作为目的地址的所述第 二地址修改成所述第一地址, 然后转发到所述第一网络。
另一方面, 本发明的实施例提供了一种媒体网关, 包括: 获取单元, 用于 获得媒体网关控制器发送的地址映射关系, 所述地址映射关系中包括第一网络 的第一地址和所述第一地址被映射成的第二地址, 第二网络的第三地址和所述 第三地址被映射成的第四地址; 报文接收单元, 用于接收从所述第一网络发往 所述第二网络的 IP报文, 或接收从所述第二网络发往所述第一网络的 IP报文; 映 射单元,用于对接收到的从所述第一网络发往所述第二网络的 IP报文,根据所述 地址映射关系将所述 IP报文中作为源地址的所述第一地址修改成所述第二地址, 将所述 IP报文中作为目的地址的所述第四地址修改成所述第三地址,得到地址修 改后的 IP报文, 或用于对接收到的从所述第二网络发往所述第一网络的 IP报文, 根据所述地址映射关系将所述 IP报文中作为源地址的所述第三地址修改成所述 第四地址, 将所述 IP报文中作为目的地址的所述第二地址修改成所述第一地址, 得到地址修改后的 IP报文; 转发单元, 用于将所述映射单元获得地址修改后的 I P报文转发到所述第一网络或第二网络。
同时, 本发明的实施例还提供了一种网络系统, 包括媒体网关控制器和媒 体网关, 其中, 所述媒体网关控制用于向媒体网关发送地址映射关系, 所述地 址映射关系中包括第一网络的第一地址和所述第一地址被映射成的第二地址, 第二网络的第三地址和所述第三地址被映射成的第四地址; 所述媒体网关用于 根据所述地址映射关系进行网络地址映射,以将来自第一网络的 IP报文发送到第 二网络, 或将来自第二网络的 IP报文发送到第一网络。
通过本发明实施例提供的技术方案, 媒体网关获得媒体网关控制器发送的 地址映射关系, 该地址映射关系中包括第一网络的第一地址和所述第一地址被 映射成的第二地址, 第二网络的第三地址和所述第三地址被映射成的第四地址, 这样,媒体网关可以根据上述地址映射关系对 IP报文的目的地址和源地址进行映 射, 以桥接不同的两个网络的地址域, 解决了内部编址域和外部编址域地址冲 突的问题。
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅 仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳 动性的前提下, 还可以根据这些附图获得其他的附图。
图 1是现有的 NGN系统的组成示意图;
图 2是本发明中网络系统的一个具体实施例的组成示意图;
图 3是图 2中的媒体网关的一个具体实施例的组成示意图;
图 4是图 3中的获取单元的一个具体实施例的组成示意图;
图 5是图 4中的映射关系获取模块的一个具体实施例的组成示意图; 图 6是本发明中实现网络地址转换的方法的第一具体实施例的流程示意图; 图 7是本发明中实现网络地址转换的方法的第二具体实施例的流程示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
如图 2所示, 为本发明中网络系统的一个具体实施例的组成示意图。 该网络 系统包括: 媒体网关控制器 1和媒体网关 2, 媒体网关控制器 1和媒体网关 2相连 接。 其中, 媒体网关控制器 1用于向媒体网关 2发送地址映射关系, 媒体网关 2根 据该地址映射关系对转发的 IP报文进行地址映射。 所述地址映射关系中包括: I P网络 1的第一地址和所述第一地址映射成的第二地址, IP网络 2的第三地址和所 述第三地址映射成的第四地址。
所述映射关系可以描述单个地址之间的映射, 也可以描述地址组之间的映 射, 所述地址组之间的映射表示两个地址组包含的多个地址之间的一一映射。 所述映射关系中的第一地址和第二地址同时为单个地址或同时为地址组中的单 个地址, 第三地址和第四地址同时为所述单个地址或同时为所述地址组中的地 址。
该地址映射关系可以通过发送上下文属性的方式向媒体网关 2发送, 如, 可 以通过增加 (ADD ) , 修改(MOD) 或者移动 (MOV) 等命令下发。 这些地址 信息可以在一个上下文属性中下发, 也可以通过两个上下文属性下发, 在两个 上下文属性中分别描述所述第一地址和所述第二地址的映射关系, 和所述第三 地址和所述第四地址的映射关系。
同时, 该地址映射关系中还可进一步包括与地址映射相关的接口的接口标 识, 接口标识可以通过在上下文属性中携带的方式发送给媒体网关 2。
这里需要指出的是, 描述地址映射关系的上下文属性中接口标识不是必需 的。 接口标识信息可以以其他方式传递, 如通过携带在上下文属性的上下文中 的终端的命名方式等发送给媒体网关 2。 例如, 上下文中的两个终端分别命名为 "IP/G12/interfacel/l "和 "IP/G34/interface2/2" , 该终端名中分别包括表示 NA
T地址映射涉及到的两个终端各自的接口名, gp, 终端 1所在的接口名为 " interf acel " , 该 " interfacel "在该网络地址映射中是第一网络接口, 终端 2所在的接 口名为 "interface2 " , 该 "interface2"在该网络地址映射中是第二网络接口。
同时, 媒体网关控制器 1下发的地址映射关系中的部分信息可以仅表示为通 配符号, 而不是具体的地址等信息, 如采用通配符号为 "$" 。 具体的地址信息 可由媒体网关, 根据下发的地址映射关系中的其他信息来进行分配, 这样, 媒 体网关能根据本地情况自由的通配符号对应的信息, 增大了媒体网络进行网络 地址转换的灵活性。
相应的, 如图 3所示, 媒体网关 2可以包括:
获取单元 20, 用于获得媒体网关控制器发送的地址映射关系, 所述地址映 射关系中包括第一网络的第一地址和所述第一地址被映射成的第二地址, 第二 网络的第三地址和所述第三地址被映射成的第四地址, 所述获取单元 20还用于 获得包括第一网络端口、 第二网络端口以及 NAT地址映射类型信息中的一种或 多种的地址映射关系; 报文接收单元 21,用于接收从所述第一网络发往所述第二网络的 IP报文,或 接收从所述第二网络发往所述第一网络的 IP报文;
映射单元 22, 用于对接收到的从所述第一网络发往所述第二网络的 IP报文, 根据所述地址映射关系将所述 IP报文中作为源地址的所述第一地址修改成所述 第二地址, 将所述 IP报文中作为目的地址的所述第四地址修改成所述第三地址, 获得地址修改后的 IP报文,或者,用于对接收到的从所述第二网络发往所述第一 网络的 IP报文,根据所述地址映射关系将所述 IP报文中作为源地址的所述第三地 址修改成所述第四地址,将所述 IP报文中作为目的地址的所述第二地址修改成所 述第一地址, 获得地址修改后的 IP报文;
转发单元 23,用于将所述映射单元获得地址修改后的 IP报文转发到所述第一 网络或第二网络。
其中, 如图 4所示, 获取单元 20可包括: 属性获取模块 200, 用于获得媒体 网关控制器发送的至少一个上下文属性; 映射关系获取模块 202, 用于获取所述 上下文属性中的地址映射关系。
当地址映射关系包括通配符号时, 如图 5所示, 映射关系获取模块 202包括 分配子模块 2020, 用于获得媒体网关控制器发送的地址映射关系, 根据所述地 址映射关系中通配符号之外的其他信息获得与通配符号对应的映射地址, 如, 可由分配子模块 2020直接分配, 或是网络中其他设备获得; 另外, 映射关系获 取模块 202还可以包括, 应答子模块 2022, 用于根据所述地址映射关系和分配的 所述映射地址生成应答消息, 并返回至所述媒体网关控制器, 所述应答消息中 包括将所述通配符号替换为所述对应的映射地址的地址映射关系。
在本发明实施例提供的技术方案中,媒体网关可以将 IP报文的目的地址和源 地址均进行映射, 以桥接地址域有重叠的两个网络, 解决了地址冲突的问题。 同时, 在上述实施例中还提供了, 媒体网关获得地址映射关系的多种途径, 使 得本技术方案更加灵活和实用。
相应的, 本发明还提供了一种实现网络地址转换的方法的实施例, 图 6和图 7分别是根据本发明实施例的实现网络地址转换的方法的流程图, 以下分别对图 6和图 7所示的流程进行详细的描述。
如图 6所示, 该实现网络地址转换的方法包括如下流程:
601、 获得媒体网关控制器发送的地址映射关系, 所述地址映射关系中包括 第一网络的第一地址和所述第一地址被映射成的第二地址, 第二网络的第三地 址和所述第三地址被映射成的第四地址。 其中, 所述映射关系可以描述单个地 址之间的映射, 也可以描述地址组之间的映射, 所述地址组之间的映射表示两 个地址组之间的单独的地址之间一一映射; 同时, 地址映射关系中还可包括接 口标识。
媒体网关和媒体网关控制器通过同步地址映射关系实现媒体网关控制器对 地址映射关系的管理,以及媒体网关根据地址映射关系对经过的媒体 IP报文进行 NAT地址转换和 IP报文转发。
第一网络和第二网络可能有地址重叠, 所以需要用两次 NAT来进行这两个 网络之间的 IP包转发。这两个网络可以看作是两个私有网络, 在实际操作中, 也 可以将其中一个网络看作私有网络, 另外一个网络看作公有网络。 后面为了避 免混淆, 将这两个网络分别称呼为 networkl和 network2。
上述的地址映射关系可用下述上下文属性的语法表述:
Networkl Interface " I " NetworkllP Address " I " NetworklMappedlP Address " Γ Network2Interface" Γ Network2IP Address " Γ Network2MappedIP Address 其中, " I "用作分割符, Networkllnterface为 IP网络 1中的接口名 (接口标 识) , NetworkllPAddress为 IP网络 1中的网络地址, Networkl IPAddress可以是单 个地址 , 也可以是地址组 ( 或者是子网络地址加掩码 ) 。 NetworklMappedlP Address为 NetworkllP Address被映射成的地址, 其代表的地 址个数和 NetworkllP Address相同, 如果是地址组之间的映射, 则组内地址为一 一对应关系。
Network2Interface为 IP网络 2中的接口名, Network2IPAddress为 IP网络 2中的 网络地址, Network2IPAddress可以是单个地址, 也可以是地址组 (或者是子网 络地址加掩码 )。 Network2MappedIPAddress为 Network2IP Address被映射成的地 址, 其代表的地址个数和 Network2IP Address相同, 如果是地址组之间的映射, 则组内地址为一一对应关系。
例如:
"interfacell200.200.200.0/24H38.76.28.0/24l
interface2l200.200.200.0/24l 172.16.1.0/24 "
代表在接口" interfacel "上将地址段 (或称为地址组) 200.200.200.0/24中 的地址一一映射成地址段 (或称为地址组) 138.76.28.0/24中的地址, 在接口" interface2 "上将地址段 (或称为地址组) 200.200.200.0/24中的地址——映射成 地址段 (或称为地址组) 172.16.1.0/24中的地址。
其中:
200.200.200.0/24表示子网地址为 200.200.200.0, 网络位为 24位, 即掩码为 2 55.255.255.0。
138.76.28.0/24表示子网地址为 138.76.28.0, 掩码为 255.255.255.0。
172.16.1.0/24表示子网地址为 172.16.1.0, 掩码为 255.255.255.0。
地址组之间的映射表示地址组之间的地址一一映射。 例如:在接口" interfac el "上, 200.200.200.1映射到 138.76.28.1, 200.200.200.2映射到 138.76.28.2, 以 此类推。
以上的例子是地址组之间的映射, 也可以只映射单独的地址, 例如:
"interfacell200.200.200.H138.76.28.ll
interface2l200.200.200.1001172.16.1.100 "
代表在接口,, interfacel "上将地址 200.200.200.1映射成 138.76.28.1, 在接 口" interface2"上将地址 200.200.200.100映射成 172.16.1.100。
如果接口信息通过其它方式, 例如, 通过终端名的命名方式等传递给媒体 网关, 则上述上下文属性中的接口名部分也可以部分或者全部省略。 接口信息 部分还可以通过静态配置确定, 这种情况下也不需要在上下文属性中下发接口 信息。
一个类似的实现方法是用两个上下文属性分别描述两个网络各自的地址映 射关系, 例如分别在两个上下文中通过上下文属性分别描述前述的 interfacel上 的地址映射关系和 interface2上的地址映射关系。
以上方法通过上下文属性描述单个两次 NAT地址映射的映射关系。 多个上 下文中的该上下文属性综合起来可以描述多个两次 NAT地址映射的映射关系, 形成两次 NAT地址映射表, 从而媒体网关实现两次 NAT设备的功能。
上述只是考虑了三层的 IP地址之间的映射 , 如果考虑到四层的 TCP/UDP (Transfer Control Protocol/User Datagram Protocol传输控制协议 /用户数据报协 议)的端口,则前面描述的地址映射关系还需要进一步扩展成描述 IP地址加端口 的地址映射关系。 IP网络 1的某个 IP地址的某个端口映射成某个地址加端口; IP 网络 2的某个 IP地址的某个端口映射成某个地址加端口。 这种情况下, 媒体网关 实际上实现了两次 NAPT的功能。
上下文属性中的部分内容可以设置成通配符号, 例如, 第一地址、 第二地 址、 第三地址或第四地址中的一个使用通配符号; 或者第一地址和第二地址中 的一个使用通配符号, 第三地址和第四地址中的一个使用通配符号; 由媒体网 关将与该通配符号相关的地址值返回媒体网关控制器。 例如, 下发上下文属性 为:
" interfacel 1200.200.200.11$1 interface2l200.200.200.1001172.16.1.100 " 则相当于要求媒体网关返回在 interfacel上 200.200.200.1被映射后的地址,媒 体网关在应答消息中返回 "interfacell200.200.200.1ll38.76.28.1linterface2l 200.20 0.200.1001172.16.1.100 " 。 媒体网关控制器从中获得在 interfacel上 200.200.200.1 被映射后的地址为 138.76.28.1。
两次 NAT的地址映射规律和一次 NAT (例如传统 NAT和双向 NAT) 不同的 是, 两次 NAT的地址映射对源地址和目的地址都需要进行地址映射。 本发明实 施例中描述两次 NAT的地址映射关系的上下文属性可以是一个新扩展的上下文 属性, 也可以借用现有技术中用于描述传统 NAT的地址映射的属性, 例如 H.248. 64现在的草稿中的 iprnat包的 nmi属性,来描述本发明中的地址映射关系,后一种 情况下要修改现有的该属性的语法。
一种描述两次 NAT的地址映射关系的上下文属性的实施方法是: 在属性语 法增加一个标志, 比如如果带有标志" type:twiCe",则表示本属性描述的是两次 NAT的地址映射关系,例如:
nmi属性的语法还可以做如下修改:
[ "type: " twice] (INetworkllnterface " I " NetworkllP Address " I " NetworklM appedIP Address " Γ Network2Interface " Γ Network2IP Address " Γ
Network2MappedIPAddress)/(IPrivateIPAddress"l"PublicIP Address
[" Iprp: "PrivatePort] ["lpup:"PubicPort] ["Ida:" DestinationlP Address] ["Idp:" DestinationPort])
其中, 符号 " [] " 中代表的为可选项。
PrivatelPAddress'T'PublicIP Address [" Iprp: "PrivatePort] ["lpup:"PubicPort] ["Ida:" DestinationlP Address] ["Idp:" DestinationPort]是对单次 NAT (传统 NAT或者 双向 NAT) 的 NAT地址映射关系的描述。
Network 1 Interface " I " NetworkllP Address " I " NetworklMappedIP Address " Γ Network2Interface" Γ Network2IP Address " Γ Network2MappedIP Address 是对两次 NAT的 NAT地址映射关系的描述。
如, 下发的上下文属性为:
"type:twicelinterfacel 1200.200.200. Ill 38.76.28.11
interface2l200.200.200.1001172.16.1.100 "
该上下文属性中的地址映射关系表示该 NAT地址映射的类型是两次 NAT, 地址映射在接口" interfacel "上将地址 200.200.200.1映射成 138.76.28.1,在接口" interface2 "上将地址 200.200.200.100映射成 172.16.1.100。
NAT地址映射也可以是其它类型, 例如: " type:BasicNATI200.200.200.11138.76.28.1 "
表示该 NAT为基本 NAT,将地址 200.200.200.1映射成 138.76.28.1。
该上下文属性中描述 NAT类型的部分也可以移出来单独用一个新扩展的上 下文属性来描述, 即单独定义一个描述本 NIPR (NAT IP Router, 网络地址转 换 IP路由) 上下文描述的 NAT的类型的属性。
还可以通过数据配置等方式设定整个网关或者某些接口上的 NAT地址映射 类型为两次 NAT的地址映射。
根据目前对两次 NAT功能的描述, 两次 NAT的地址映射作用于两个 IP网络 之间双向的 IP报文, 实际上本发明也可以用于单向的 IP报文, 例如只用于 IP网络 1到 IP网络 2的两次 NAT映射, 或者只用于 IP网络 2到 IP网络 1的两次 NAT映射。
602、 对从第一网络向第二网络发送的 IP报文, 根据所述地址映射关系将所 述 IP报文中作为源地址的所述第一地址修改成所述第二地址,将所述 IP报文中作 为目的地址的所述第四地址修改成映射后的所述第三地址。
如图 2所示的网络, IP网络 1和 IP网络 2的地址规划重叠, 假设网络地址都是 2 00.200.200.0。 根据上述描述的地址映射关系可知, 此时媒体网关获得地址映射 关系为地址组的映射: 将 IP网络 1中的地址 200.200.200.0/24映射成 138.76.28.0/2 4; 将 IP网络 2中的地址 200.200.200.0/24映射成 172.16.1.0/24; 其中, "/"后的 2 4表示表示前 24位为网络地址, 后 8位为主机地址。
那么有, 200.200.200.0/24表示网络地址 200.200.200.0, 掩码为 255.255.255.0 ; 138.76.28.0/24表示网络地址 138.76.28.0, 掩码为 255.255.255.0; 172.16.1.0/24 表示网络地址 172.16.1.0, 掩码为 255.255.255.0。
在本例中, 地址映射关系为将一组网络地址映射为另一组网络地址, 媒体 网关将 IP网络 1中的地址 200.200.200.1映射成 138.76.28.1,地址 200.200.200.2映射 成 138.76.28.2, 以此类推; 媒体网关将 IP网络 2中的地址 200.200.200.1映射成 172. 16.1.1, 地址 200.200.200.2映射成 172.16丄 2, 以此类推。 需要说明的是, 映射时 一个地址只能映射为另一个地址, 而不能映射为多个地址, 即映射的地址都是 一一对应的。
若, 媒体网关接收到 IP网络 1中发来的 IP数据流, 如果源地址和目的地址的 范围在前面描述的地址映射关系的范围内, 可以适用前面描述的两次 NAT地址 映射, 假设源地址为 200.200.200.1, 目的地址为 172.16.1.100, 则媒体网关将 IP 数据流的源地址 200.200.200.1修改为 138.76.28.1,将目的地址 172.16.1.100修改为 200.200.200.100, 然后将数据流转发到 IP网络 2。
以下对图 7所示的流程进行描述, 如图 7所示, 该流程包括 601和 603, 该图 7 中的 601与上述图 6中所示的 601类似, 这里不再赘述, 以下详细描述 603。
603、 对接收到的从所述第二网络发往所述第一网络的 IP报文, 根据所述地 址映射关系将所述 IP报文中作为源地址的所述第三地址修改成所述第四地址,将 所述 IP报文中作为目的地址的所述第二地址修改成所述第一地址,然后转发到所 述第一网络。
相应的, 若媒体网关接收到 IP网络 2中发来的 IP数据流, 如果源地址和目的 地址的范围在前面描述的地址映射关系的范围内, 可以适用前面描述的两次 NA T地址映射, 假设源地址为 200.200.200.100, 目的地址为 138.76.28.1, 则媒体网 关将 IP数据流的源地址 200.200.200.100修改为 172.16.1.100, 将目的地址 138.76.2 8.1修改为 200.200.200.1, 然后将数据流转发到 IP网络 1。
在实际操作中, 图 6和图 7所示的流程可能会交叉进行, 此时, 602和 603的 执行并没有先后顺序之分, 可以是同时执行, 也可以是先执行 602后执行 603, 或是先执行 603后执行 602, 本发明不限于此。
在上述步骤 601中, 媒体网关控制向媒体网关发送地址映射关系的过程, 可 以是由媒体网络控制器主动发起的, 也可以是由媒体网关触发媒体网关控制器 发起的。 如果该过程是由媒体网关触发媒体网关控制器发起的, 此时步骤 601之 前还包括以下步骤:
当从媒体网关接收到 IP网络 1发来的 IP报文并且查找不到已有可用的地址映 射关系时, 媒体网关生成并向媒体网关控制器发送上报事件消息, 通知媒体网 关控制器源地址和 /或目的地址在地址映射表中没有对应项。 如果是所述源地址 在地址映射表中没有对应项, 则媒体网关控制器可以通过和 DNS-ALG的交互查 找或者为该源地址分配一个新的映射地址, 或者媒体网关控制器自发为该源地 址查找或者分配一个新的映射地址, 新的映射地址可以在后续消息中下发给媒 体网关; 如果是所述目的地址在地址映射表中没有对应项, 则媒体网关控制器 可以通过和 DNS-ALG的交互查找, 或者在媒体网关控制器上查找目的网络以及 真正的目的设备及其在目的网络中的地址。 该事件可以在接口上下文 (Interface context)的终端上设置, 也可以定义设置到其它终端上。
例如,媒体网关在 IP网络 1接收到的源地址为 200.200.200.1, 目的地址为 172. 16.1.100的 IP报文, 但是查找不到符合的 NAT地址映射项, 媒体网关将以上两个 地址通过事件上报给媒体网关控制器。媒体网关控制器通过和 DNS-ALG的交互, 查找到 IP网络 1中的地址 200.200.200.1被映射成 138.76.28.1,而目的地址 172.16.1. 100是 IP网络 2中的地址 200.200.200.100被映射成的地址。媒体网关控制器向媒体 网关发送 H.248消息创建新的 NIPR上下文,上下文属性中描述两次 NAT的地址映 射关系为" interfacell200.200.200.1ll38.76.28.1linterface2l 200.200.200.1001172.16. 1.100" , 该地址映射关系的含义已在前面有描述, 这里不再赘述。 之后, 执行 到步骤 601。
在上述实施例中所述的地址映射关系的具体定义和形式也可以适用于本发 明的其他实施例。
在本发明实施例提供的技术方案中,媒体网关可以将 IP报文的目的地址和源 地址均进行映射, 以桥接不同的两个网络的地址域, 解决了地址冲突的问题。 同时, 在上述实施例中还提供了, 媒体网关获得地址映射关系的多种途径, 以 及具体的多种地址映射关系, 使得地址映射时实施的方案可以更加灵活和实用。
以上所描述的装置实施例仅仅是示意性的, 其中所述作为分离部件说明的 单元可以是或者也可以不是物理上分开的, 作为单元显示的部件可以是或者也 可以不是物理单元, 即可以集成设置成一个网络单元, 或者也可以分别设置在 多个网络单元上。 可以根据实际的需要选择其中的部分或者全部模块来实现本 实施例方案的目的。 本领域普通技术人员在不付出创造性的劳动的情况下, 即 可以理解并实施。
通过以上的实施方式的描述, 本领域的技术人员可以清楚地了解到各实施 方式可借助软件加必需的通用硬件平台的方式来实现, 当然也可以通过硬件。 基于这样的理解, 上述技术方案本质上或者说对现有技术做出贡献的部分可以 以软件产品的形式体现出来, 该计算机软件产品可以存储在计算机可读存储介 质中,如 ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可 以是个人计算机, 服务器, 或者网络设备等) 执行各个实施例或者实施例的某 些部分所述的方法。
以上所述的具体实施例, 对本发明的目的、 技术方案和有益效果进行了进 一步详细说明, 所应理解的是, 以上所述仅为本发明的具体实施例而已, 并不 用于限定本发明的保护范围, 凡在本发明的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种实现网络地址转换的方法, 其特征在于, 所述方法包括: 获得媒体网关控制器发送的地址映射关系, 所述地址映射关系中包括第一 网络的第一地址和所述第一地址被映射成的第二地址, 第二网络的第三地址和 所述第三地址被映射成的第四地址;
对接收到的从所述第一网络发往所述第二网络的 IP报文, 根据所述地址映 射关系将所述 IP报文中作为源地址的所述第一地址修改成所述第二地址, 将所 述 IP报文中作为目的地址的所述第四地址修改成所述第三地址, 然后转发到所 述第二网络;
对接收到的从所述第二网络发往所述第一网络的 IP报文, 根据所述地址映 射关系将所述 IP报文中作为源地址的所述第三地址修改成所述第四地址, 将所 述 IP报文中作为目的地址的所述第二地址修改成所述第一地址, 然后转发到所 述第一网络。
2、 如权利要求 1所述的方法, 其特征在于, 所述地址映射关系还包括第一 网络的接口标识和第二网络的接口标识, 所述第一网络的接口标识用以标识所 述地址映射关系中的第一地址和第二地址对应所述第一网络, 所述第二网络的 接口标识用以标识所述地址映射关系中的第三地址和第四地址对应所述第二网 络。
3、 如权利要求 1或 2所述的方法, 其特征在于,
所述地址映射关系中包含通配符号;
所述获得媒体网关控制器发送的地址映射关系包括:
获得所述媒体网关控制器发送的地址映射关系, 根据所述地址映射关系中 所述通配符号之外的其他信息获得与所述通配符号对应的映射地址; 生成应答消息, 并返回至所述媒体网关控制器, 所述应答消息中包括将所 述通配符号替换为与所述通配符号对应的映射地址的地址映射关系。
4、 如权利要求 1或 2所述的方法, 其特征在于, 所述获得媒体网关控制器 发送的地址映射关系包括:
获得所述媒体网关控制器发送的至少一个上下文属性, 所述上下文属性中 包括所述地址映射关系。
5、 如权利要求 4所述的方法, 其特征在于, 所述地址映射关系中还包括用 于标识所述地址映射的类型的地址映射类型信息。
6、 如权利要求 1所述的方法, 其特征在于,
所述映射关系中的所述第一地址、 所述第二地址、 所述第三地址和所述第 四地址分别为单个地址或地址组中的地址。
7、 如权利要求 1所述的方法, 其特征在于, 在所述获得媒体网关控制器发 送的地址映射关系前还包括:
向媒体网关控制器发送上报事件消息, 该上报事件消息用于触发所述媒体 网关控制器发送所述的地址映射关系。
8、 一种媒体网关, 其特征在于, 所述媒体网关包括:
获取单元, 用于获得媒体网关控制器发送的地址映射关系, 所述地址映射 关系中包括第一网络的第一地址和所述第一地址被映射成的第二地址, 第二网 络的第三地址和所述第三地址被映射成的第四地址;
报文接收单元, 用于接收从所述第一网络发往所述第二网络的 IP报文, 或 接收从所述第二网络发往所述第一网络的 IP报文; 映射单元, 用于对接收到的从所述第一网络发往所述第二网络的 IP报文, 根据所述地址映射关系将所述 IP报文中作为源地址的所述第一地址修改成所述 第二地址,将所述 IP报文中作为目的地址的所述第四地址修改成所述第三地址, 得到地址修改后的 IP报文; 或者, 用于对接收到的从所述第二网络发往所述第 一网络的 IP报文, 根据所述地址映射关系将所述 IP报文中作为源地址的所述 第三地址修改成所述第四地址, 将所述 IP报文中作为目的地址的所述第二地址 修改成所述第一地址, 得到地址修改后的 IP报文;
转发单元, 用于将所述映射单元获得地址修改后的 IP报文转发到所述第一 网络或所述第二网络。
9、 如权利要求 8所述的媒体网关, 其特征在于, 所述获取单元包括: 属性获取模块, 用于获得媒体网关控制器发送的至少一个上下文属性; 映射关系获取模块, 用于获取所述上下文属性中的地址映射关系。
10、 如权利要求 9所述的媒体网关, 其特征在于, 所述地址映射关系中包 括通配符号, 所述映射关系获取模块包括:
分配子模块, 用于获得所述媒体网关控制器发送的地址映射关系, 根据所 述地址映射关系中所述通配符号之外的其他信息获得与所述通配符号对应的映 射地址;
应答子模块, 用于根据所述分配子模块的处理结果生成应答消息, 并将所 述应答消息返回至所述媒体网关控制器, 其中, 所述应答消息中包括将所述通 配符号替换为所述对应的映射地址的地址映射关系。
11、 一种网络系统, 包括媒体网关控制器和媒体网关, 其特征在于, 所述媒体网关控制器用于向所述媒体网关发送地址映射关系, 所述地址映 射关系中包括第一网络的第一地址和所述第一地址被映射成的第二地址, 第二 网络的第三地址和所述第三地址被映射成的第四地址;
所述媒体网关用于根据所述地址映射关系进行网络地址映射, 以将来自第 一网络的 IP报文发送到第二网络, 或将来自第二网络的 IP报文发送到第一网 络。
12、 如权利要求 11所述的系统, 其特征在于, 所述媒体网关包括: 获取单元, 用于获得所述媒体网关控制器发送的地址映射关系;
报文接收单元, 用于接收从所述第一网络发往所述第二网络的 IP报文, 或 接收从所述第二网络发往所述第一网络的 ip报文;
映射单元, 用于对接收到的从所述第一网络发往所述第二网络的 IP报文, 根据所述地址映射关系将所述 IP报文中作为源地址的所述第一地址修改成所述 第二地址,将所述 IP报文中作为目的地址的所述第四地址修改成所述第三地址, 得到地址修改后的 IP报文; 或者, 用于对接收到的从所述第二网络发往所述第 一网络的 IP报文, 根据所述地址映射关系将所述 IP报文中作为源地址的所述 第三地址修改成所述第四地址, 将所述 IP报文中作为目的地址的所述第二地址 修改成所述第一地址, 得到地址修改后的 IP报文;
转发单元, 用于将所述映射单元获得地址修改后的 IP报文转发到所述第一 网络或所述第二网络。
PCT/CN2009/072916 2008-10-22 2009-07-24 一种实现网络地址转换的方法、媒体网关和网络系统 WO2010045809A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810218689.X 2008-10-22
CN200810218689XA CN101729388B (zh) 2008-10-22 2008-10-22 一种实现网络地址转换的方法、媒体网关和网络系统

Publications (1)

Publication Number Publication Date
WO2010045809A1 true WO2010045809A1 (zh) 2010-04-29

Family

ID=42118927

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/072916 WO2010045809A1 (zh) 2008-10-22 2009-07-24 一种实现网络地址转换的方法、媒体网关和网络系统

Country Status (2)

Country Link
CN (1) CN101729388B (zh)
WO (1) WO2010045809A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866110A (zh) * 2020-07-13 2020-10-30 浙江捷创方舟数字技术有限公司 一种工业设备通信方法以及5g网关
CN113098991A (zh) * 2021-03-29 2021-07-09 北京金山云网络技术有限公司 一种报文处理方法、装置、专线接入网关以及公有云系统
CN117812039A (zh) * 2024-02-24 2024-04-02 深圳赋乐科技集团有限公司 一种网络地址转换日志记录方法、系统、设备及介质

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103379185B (zh) * 2012-04-26 2016-08-03 华为技术有限公司 一种网络地址转换的方法、设备和系统
CN102904813B (zh) * 2012-11-05 2016-03-02 华为技术有限公司 一种报文转发的方法及相应设备
CN103220586A (zh) * 2013-03-05 2013-07-24 杭州常春藤软件科技有限公司 媒体码流数据获取方法、装置和软交换系统
CN104488240B (zh) * 2013-06-17 2017-04-26 华为技术有限公司 一种会话管理方法、地址管理方法及相关装置
CN105704082A (zh) * 2014-11-24 2016-06-22 中兴通讯股份有限公司 报文的接收处理、发送处理方法及装置
CN107872542B (zh) 2016-09-27 2021-05-04 阿里巴巴集团控股有限公司 一种数据传输的方法及网络设备
CN106533536B (zh) * 2016-11-07 2019-07-26 北京航空航天大学 极地轨道低轨道卫星网络ip编址方法及装置
CN107181812B (zh) * 2017-06-08 2020-05-22 网宿科技股份有限公司 一种加速代理设备、加速代理方法以及一种内容管理系统
CN113630316B (zh) * 2020-05-06 2022-12-06 华为技术有限公司 一种数据传输方法及通信装置
CN111698346B (zh) * 2020-06-11 2023-01-17 北京百度网讯科技有限公司 一种专线网络地址转换方法、装置、专线网关及存储介质
CN113068206A (zh) * 2021-03-31 2021-07-02 联想(北京)有限公司 信息处理方法及装置
CN113556414B (zh) * 2021-09-18 2021-12-10 浙江国利信安科技有限公司 用于网络间通信的方法、网关设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030145104A1 (en) * 2002-01-23 2003-07-31 International Business Machines Corporation Virtual private network and tunnel gateway with multiple overlapping, remote subnets
CN1941753A (zh) * 2005-09-30 2007-04-04 华为技术有限公司 下一代网络中的ip互通网关及其实现ip域互通的方法
US20080013554A1 (en) * 2006-07-12 2008-01-17 Kddi Corporation Gateway for controlling electric equipment connected to lan through wan
CN101136910A (zh) * 2006-08-30 2008-03-05 中国电信股份有限公司 网络地址和协议翻译设备与应用层网关设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030145104A1 (en) * 2002-01-23 2003-07-31 International Business Machines Corporation Virtual private network and tunnel gateway with multiple overlapping, remote subnets
CN1941753A (zh) * 2005-09-30 2007-04-04 华为技术有限公司 下一代网络中的ip互通网关及其实现ip域互通的方法
US20080013554A1 (en) * 2006-07-12 2008-01-17 Kddi Corporation Gateway for controlling electric equipment connected to lan through wan
CN101136910A (zh) * 2006-08-30 2008-03-05 中国电信股份有限公司 网络地址和协议翻译设备与应用层网关设备

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866110A (zh) * 2020-07-13 2020-10-30 浙江捷创方舟数字技术有限公司 一种工业设备通信方法以及5g网关
CN111866110B (zh) * 2020-07-13 2023-12-19 浙江捷创方舟数字技术有限公司 一种工业设备通信方法以及5g网关
CN113098991A (zh) * 2021-03-29 2021-07-09 北京金山云网络技术有限公司 一种报文处理方法、装置、专线接入网关以及公有云系统
CN113098991B (zh) * 2021-03-29 2022-11-04 北京金山云网络技术有限公司 一种报文处理方法、装置、专线接入网关以及公有云系统
CN117812039A (zh) * 2024-02-24 2024-04-02 深圳赋乐科技集团有限公司 一种网络地址转换日志记录方法、系统、设备及介质
CN117812039B (zh) * 2024-02-24 2024-05-14 深圳赋乐科技集团有限公司 一种网络地址转换日志记录方法、系统、设备及介质

Also Published As

Publication number Publication date
CN101729388B (zh) 2012-01-25
CN101729388A (zh) 2010-06-09

Similar Documents

Publication Publication Date Title
WO2010045809A1 (zh) 一种实现网络地址转换的方法、媒体网关和网络系统
EP2034666B1 (en) Method and system for realizing media stream interaction and media gateway controller and media gateway
US7408928B2 (en) Methods and apparatus for setting up telephony connections between two address domains having overlapping address ranges
JP5054114B2 (ja) Ipネットワークをインタフェースするための方法及び装置
JP5312672B2 (ja) 共通IPアドレス及びMACアドレスを有するVoIPカードを備えるアクセス・ノード
US7272148B2 (en) Non-ALG approach for application layer session traversal of IPv6/IPv4 NAT-PT gateway
JP4786747B2 (ja) ミドルボックスにおけるipアドレス分散
JP4766976B2 (ja) ノード間接続方法及び装置
WO2005011216A1 (fr) Systeme et procede pour realiser une commutation d'appels multimedia dans un reseau prive
WO2002103981A2 (en) Providing telephony services to terminals behind a firewall and/or network address translator
JP2003273935A (ja) 相異なるプライベートネットワークに存在するネットワーク機器間の直接接続を提供するネットワーク接続装置及びその方法
US20060146870A1 (en) Transparent communication with IPv4 private address spaces using IPv6
JP2003218953A (ja) インターネットプロトコルアドレス変換装置、これを用いた通信ネットワークシステム及び通信方法
US20080151875A1 (en) VoIP service system using NAT and method of processing packet therein
WO2007036160A1 (fr) Appareil, systeme et procede assurant la communication entre un client et un serveur
WO2008138245A1 (fr) Procédé de mise en oeuvre d'un routage de couche d'application de passerelle interfonctionnelle, système et contrôleur de session en périphérie associés
CN101729606A (zh) 一种实现网络地址转换的方法及相关设备
CN110691150A (zh) 一种基于SDN的IPv4与IPv6互联方法及系统
EP2026528B1 (en) Integrated internet telephony system and signaling method thereof
EP2509284B1 (en) Method and system for allocating local transport address, media gateway and media gateway controller
US20040047340A1 (en) Method for address conversion in packet networks, control element and address converter for communication networks
WO2007041927A1 (fr) Méthode de mappage d’adresses pendant un message de réaction à nat d’un dns
JP4670979B2 (ja) パケット生成方法およびその機能を有する情報処理装置並びにパケット生成プログラムを記録した記録媒体
KR100438182B1 (ko) 게이트키퍼와 nat-pt 연동을 위한 서로 상이한ip 주소 연동 방법
JP2003060711A (ja) パケット通信制御方式及びパケット通信方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09821530

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09821530

Country of ref document: EP

Kind code of ref document: A1