WO2011072540A1 - Ip address assignment method and gateway - Google Patents

Ip address assignment method and gateway Download PDF

Info

Publication number
WO2011072540A1
WO2011072540A1 PCT/CN2010/076989 CN2010076989W WO2011072540A1 WO 2011072540 A1 WO2011072540 A1 WO 2011072540A1 CN 2010076989 W CN2010076989 W CN 2010076989W WO 2011072540 A1 WO2011072540 A1 WO 2011072540A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
mapping
mobile terminal
unique identification
segments
Prior art date
Application number
PCT/CN2010/076989
Other languages
French (fr)
Chinese (zh)
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 WO2011072540A1 publication Critical patent/WO2011072540A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/604Address structures or formats
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W80/00Wireless network protocols or protocol adaptations to wireless operation
    • H04W80/04Network layer protocols, e.g. mobile IP [Internet Protocol]

Definitions

  • the invention relates to the field of data service of a wireless core network, an IP address allocation method and a gateway. Background technique
  • the IP pool allocation method is relatively simple, that is, the gateway GPRS support node (GGSN) allocates an IP address to the mobile terminal in the shared local IP address pool, and the IP address used by the mobile terminal after the mobile terminal goes offline. The address can be assigned to other mobile terminals that are subsequently online.
  • GGSN gateway GPRS support node
  • the local IP address pool allocation method is characterized in that the IP address assigned by the mobile terminal every time it goes online may not be the same, and may occur under abnormal conditions:
  • the external server records the IP address used by the mobile terminal A, when After the mobile terminal A goes offline, the IP address originally assigned to the mobile terminal A is again assigned to other mobile terminals, such as the mobile terminal B, thereby causing the external server to erroneously transmit the message that should originally be sent to the mobile terminal A to Mobile terminal B.
  • the authentication authorization/authorization/accounting (AAA, Authentication Authorization Accounting) server assigns an IP address and a dynamic host configuration protocol (DHCP) to assign an IP address.
  • AAA Authentication Authorization Accounting
  • DHCP dynamic host configuration protocol
  • This method of assigning a foreign IP address is a mobile terminal passing an GGSN to an external server (for example, an AAA server or a DHCP server). Sending a request for assigning an IP address to the mobile terminal, after receiving the request, the external server allocates an idle IP address to the mobile terminal from the configured IP address pool and returns it to the mobile terminal through the GGSN.
  • the embodiments of the present invention provide an IP address allocation method and a corresponding gateway, which are intended to solve the problem of poor fault tolerance or relatively stable operation of an external server when assigning an IP address to a mobile terminal.
  • An IP address allocation method includes: acquiring a unique identification code of a mobile terminal; mapping the mapping variable to a mapping variable by using a unique identification field or the unique identification code in the unique identification code as a mapping variable
  • the last three segments of the IP address; the subnet number to which the unique identification code belongs is read from the configuration information, and the prefix with the subnet number being the IP address is combined with the last three segments of the IP address to form an IP address; Assigning the IP address obtained by the combination to the mobile terminal.
  • a gateway comprising: an obtaining module, configured to obtain a unique identifier of the mobile terminal; and a mapping module, configured to use the unique identifier field in the unique identifier code of the mobile terminal or the unique identifier as a mapping variable, and the mapping variable Mapping to the last three segments of the IP address; the IP address combination module, configured to read, from the configuration information, the subnet number to which the unique identifier is assigned, where the subnet number is a prefix of the IP address and the IP address The last three segments are combined into an IP address; an allocation module is configured to allocate an IP address obtained by combining the IP address combination modules to the mobile terminal.
  • the unique identifier field in the unique identifier code of the mobile terminal is used as a mapping variable, and the mapping variable is mapped to the last three segments of the IP address, and the subnet number to which the unique identifier of the mobile terminal belongs is used as the prefix of the IP address.
  • the IP address is combined with the last three segments of the mapped IP address. Since the IP address generated by the mapping method in the embodiment of the present invention is generated by the local GGSN, and does not depend on the stable operation of an external server (for example, an AAA server or a DHCP server), the IP address allocation is performed. The method has better robustness, and does not need to release the IP address pool as in the prior art, and the IP address is allocated quickly. In addition, for each mobile terminal, the IP generated by the mapping method of the present invention is used. The addresses are unique, thus eliminating address conflicts that may exist when assigning or releasing IP addresses.
  • FIG. 1 is a schematic flowchart of a basic method for generating an IP address according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a modified discontinuous IP address number segment provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a basic logical structure of a gateway according to an embodiment of the present invention. detailed description
  • a schematic flowchart of a method for generating an IP address according to an embodiment of the present invention includes the following steps:
  • the mobile terminal will provide a service GPRS support node (SGSN, Serving) before accessing the Internet.
  • the GPRS Support Node sends an activation message, for example, a Packet Data Protocol (PDP) context request, which is forwarded by the SGSN to the GGSN, and the GGSN acquires the unique identification code of the mobile terminal from the activation message.
  • PDP Packet Data Protocol
  • the unique identification code of the mobile terminal may be an International Mobile Subscriber Identity (IMSI), an International Mobile Equipment Identity (IMEI), or other code that can uniquely identify the mobile terminal. Word, etc.
  • IMSI International Mobile Subscriber Identity
  • IMEI International Mobile Equipment Identity
  • mapping variable is mapped to the last three segments of the IP address by using a unique identifier field or a unique identifier in the unique identifier of the mobile terminal as a mapping variable.
  • the system administrator can set a range of number segments.
  • the GGSN receives the activation message of the mobile terminal, it first determines whether the IMSI of the mobile terminal is within the set number range.
  • the unique identifier field in the unique identifier of the mobile terminal for example, the mobile station authentication number (MSIN, Mobile Station Identity Number) field in the IMSI is used as a mapping variable.
  • the mapping variable is mapped to the last three segments of the IP address, including:
  • the existing IP address is 32 bits, and each 8 bits is a section (or a segment).
  • the last three segments of the IP address are: the 16th to 23rd bits are the first segment, and the 8th and 15th bits are the second segment, the 0th to the 7th bits.
  • a mapping parameter can be selected for each of these segments, and one mapping parameter can remain unchanged for different MSINs.
  • one of the MSIN and one of the three mapping parameters is used as a mapping factor, and three operation operations are performed on the mapping factor to obtain three operation results, and the three operation results are used as the last three segments of the IP address.
  • IPv4 considering that the first segment of the IP address (bits 16 to 23) is converted to a corresponding decimal range between 0 and 255, 255x254 and 255 can be used as the first mapping parameter to execute (MSIN/ 255X254)
  • the operation result obtained after the operation operation of %255 is taken as the first segment of the last three segments of the IP address, where "x", "/" and "%" are respectively the multiplication operation, the division operation, and the modulo operation.
  • the legal range for conversion to decimal should be between 1 and 254. If the "modulo" operation is simply performed, that is, the operation of MSIN/%254 is performed. You may get an operation result of 0 or 255, which is not within the legal range. Therefore, for the third segment of the IP address, in the embodiment of the present invention, 254 can be used as the third mapping parameter, and the operation result obtained after the (MSIN%255) + 1 operation operation is used as the first segment of the IP address.
  • the MSIN is a unique identification field in the international mobile subscriber identity of the mobile terminal, for each mobile terminal, the last three segments of the mapped IP address are also unique, and will not be the last three of the IP addresses of other mobile terminals. Segment conflicts.
  • the present invention uses the MSIN field in the international mobile subscriber identity as a mapping variable, and performs operations operations such as adding, subtracting, multiplying, dividing, and modulating on the MSIN and the mapping parameters, the techniques in the art. Personnel should be able to understand that there are other mapping variables to choose from, and there are other operations that can be used as operations to implement the mapping, as long as the unique identification code of the mobile terminal or the field in the unique identification code is mapped. The last three segments of the IP address are unique, and the present invention is not limited.
  • a linear mapping (as shown in the above embodiment) may be used as a preferred mapping manner, such that for a serial number of consecutive IMSIs, after linear mapping The last three segments of the obtained IP address are consecutive.
  • the subnet number to which the unique identifier is assigned is read from the configuration information, and the prefix with the subnet number being the IP address is combined with the last three segments of the IP address to form an IP address.
  • the unique identification code number For multiple mobile terminals accessing the Internet, the unique identification code number, such as the IMSI number segment, needs to be planned into a certain subnet. That is, the network management personnel plan the IMSI number segment in advance, and clarify the child to which the unique identification code of the mobile terminal belongs.
  • the network number is stored in the GGSN in the form of configuration information.
  • the prefix of the IP address ie, the 24th to 31st bits of the IP address in the IPv4 address
  • the subnet number is a prefix of the IP address, and is combined with the last three segments of the IP address obtained by mapping in S102 to constitute an IP address.
  • the unique identification code number segments formed by the unique identification codes may not be consecutive to each other, so even after linear mapping, prefix is obtained.
  • the IP address number segments formed by the IP addresses are not continuous with each other. As shown in FIG.
  • the IMSI number segment 1 is mapped into an IP address number segment 1, for example, 192.148.125.2 to 192.148.125.96
  • the IMSI number segment 2 is mapped into an IP address number segment 2, for example, 192.148.125.100 to 192.148.125.213
  • discontinuous uniqueness is formed for multiple mobile terminal unique identification codes. After the identification code number segment is linearly mapped to obtain a discontinuous IP address number segment, the discontinuous IP address number segment may be corrected.
  • the specific modification method is: an IP address based on the endpoint of the IP address number segment, The reference IP address is increased by an offset (Offset). As for the size of the offset, it may not be fixed, mainly based on the difference between the endpoints of the discontinuous IP address number segment.
  • the basic principle is: After increasing the offset, the modified IP address number segment constitutes a continuous IP address number segment.
  • IMSI (1) and IMSI (95) constitute the IMSI number segment IMSI (3-no)
  • IMSI (m) and IMSI (234) constitute the IMSI number segment IMSI (121-234)
  • the mapped IP address number segment They are the first IP address number segment (IP address number segment 1) 192.148.125.2 ⁇ 192.148.125.96 and the second IP address number segment (IP address number segment 2) 192.148.125.100 ⁇ 192.148.125.213.
  • One endpoint (terminating IP address) of the first IP address number segment is 192.148.125.96
  • one endpoint (starting IP address) of the second IP address number segment is 192.148.125.100.
  • the two IP address numbers are not consecutive. If the IP address is directly allocated according to the mapped IP address number, the network planning is inconvenient and the address resources are wasted.
  • the endpoint 192.148.125.100 of the second IP address number segment can be increased by an offset (as shown in FIG. 3), for example, an offset of 192.148.125.100 is added.
  • a quantity - 3 that is, an operation of 192.148.125.100 + ( - 3 ) for 192.148.125.100, making it 192.148.125.97.
  • the second IP address number segment becomes 192.148.125.97 ⁇ 192.148.125.213, and its starting IP address becomes 192.148.125.97, immediately following the termination IP address of the first IP address number segment 192.148.125.96, two The IP address number segment becomes continuous.
  • the IP address obtained by adding the prefix constitutes The discontinuous IP address number segment is also not contiguous.
  • the method of increasing the offset can be used to modify the non-contiguous IP address number segment to a continuous IP address number segment. The specific method is not described here.
  • FIG. 4 a schematic diagram of a basic logical structure of a gateway according to an embodiment of the present invention is provided.
  • the illustrated functional modules/units may be software modules/units, hardware modules/units, or modules/units in which hardware and software are combined.
  • the gateway may be a GGSN or a router in the GPRS system, which specifically includes the following functional modules/units.
  • the mapping module 401 is configured to map the mapping variable to the last three segments of the IP address by using a unique identifier field in the unique identifier of the mobile terminal as a mapping variable, including:
  • Parameter selection unit 4011 configured to select three mapping parameters
  • the operation unit 4012 is configured to use one of the three mapping parameters selected by the MSIN and the parameter selection unit 4011 as a mapping factor, and perform three operation operations on the mapping factor to obtain three operation results, three operations.
  • the result is the last three segments of the IP address.
  • the IP address combination module 402 is configured to use the subnet number to which the mobile terminal unique identification code belongs as the IP address prefix, and combine with the last three segments of the IP address mapped by the mapping module 401 to form an IP address.
  • the unique identification code number segments formed by the unique identification codes may not be consecutive to each other.
  • the IP address number segment formed by the IP address obtained by adding the prefix (the subnet number to which the mobile terminal unique identification code belongs) is not continuous with each other; or, multiple The unique identification code number segments of the mobile terminal are continuous with each other, but because the mapping mode of the mapping module 401 is not a linear mapping, the IP address number segments formed by the IP addresses obtained by the prefix are not continuous with each other. .
  • An allocating module 403, configured to allocate an IP address obtained by combining the IP address combining module 402 to the mobile terminal End.
  • the gateway may further include: an IP address number segment.
  • the correcting module 404 when the unique identification code number segment formed by the unique identification code of the mobile terminal is mapped to obtain a discontinuous IP address number segment, the discontinuous IP address number segment is corrected to become a continuous IP address. The segment is then assigned to the mobile terminal by the allocation module 403.
  • the method of correcting the discontinuous IP address number segment may be an IP address based on the endpoint of the IP address number segment, and the reference IP address is increased by an offset (Offset).
  • the size of the offset it may not be fixed, mainly based on the difference between the endpoints of the discontinuous IP address number.
  • the basic principle is: After increasing the offset, the modified IP address number segment constitutes a continuous IP.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.
  • ROM Read Only Memory
  • RAM Random Access Memory
  • IP address allocation method and the corresponding gateway provided by the embodiment of the present invention is only for helping to understand the method and core idea of the present invention. Meanwhile, for those skilled in the art, according to the present invention, The present invention is not limited by the scope of the present invention.

Abstract

An IP address assignment method and the corresponding gateway are provided in the embodiments of the present invention, for solving the problem of bad fault tolerance or dependence on steady operation of extra servers when assigning IP addresses to mobile terminals. Said method includes: acquiring the unique identification code of the mobile terminal (S101); regarding the unique identification field in the unique identification code or the unique identification code as the mapping variable, mapping the mapping variable to the rear three sections of the IP address (S102); reading out the home sub-network number of the unique identification code from the configuration information, regarding the sub-network number as the prefix of the IP address and combining it and the rear three sections of the IP address together as the IP address (S103); and assigning the combined IP address to the mobile terminal (S104). The IP address assignment method in the present invention has better robust and quick IP address assignment speed, without consuming the time for releasing the IP address pool. In addition, the IP addresses generated by the mapping mode in the present invention are all unique, thus removing the possible conflict during assigning or releasing the IP address.

Description

一种 IP地址分配方法和网关 本申请要求于 2009 年 12 月 17 日提交中国专利局、 申请号为 200910252490.3、发明名称为"一种 IP地址分配方法和网关,,的中国专利申请的 优先权, 其全部内容通过引用结合在本申请中。 技术领域  The present invention claims the priority of the Chinese patent application filed on December 17, 2009, the Chinese Patent Office, the application number is 200910252490.3, and the invention name is "an IP address allocation method and gateway." The entire contents thereof are incorporated herein by reference.
本发明涉及无线核心网数据业务领域, 一种 IP地址分配方法和网关。 背景技术  The invention relates to the field of data service of a wireless core network, an IP address allocation method and a gateway. Background technique
随着移动终端的普及以及人们生活水平的提高,越来越多的用户习惯于使 用支持通用分组无线业务( GPRS, General Packet Radio Service ) 的移动终端 访问 Internet在这类用户数量不断攀升的情况下,如何快速且无沖突地为移动 终端分配 IP地址, 是 GPRS亟需解决的一个重要问题。 地址池(IP Pool )分配方法, 另一类是外地 IP地址分配方法。 本地 IP地址池 分配方法较为简单, 即网关 GPRS支持节点 ( GGSN, Gateway GPRS Support Node )在共享的本地 IP地址池中为移动终端分配一个 IP地址, 移动终端下线 后, 该移动终端使用的 IP地址可以分配给其他随后上线的移动终端。 这就是 说, 本地 IP地址池分配方法的特点是移动终端每一次上线时被分配的 IP地址 可能并不相同, 在异常情况下会出现: 外部服务器记录下移动终端 A使用过 的 IP地址, 当移动终端 A下线后, 原先分配给移动终端 A的 IP地址再次被 分配给其他的移动终端, 例如移动终端 B, 由此导致外部服务器将原本应该发 送给移动终端 A的报文错误地发送至移动终端 B。  With the popularity of mobile terminals and the improvement of people's living standards, more and more users are accustomed to using the mobile terminals supporting General Packet Radio Service (GPRS) to access the Internet. How to assign an IP address to a mobile terminal quickly and without conflict is an important problem that GPRS needs to solve. The IP pool allocation method, and the other is the foreign IP address allocation method. The local IP address pool allocation method is relatively simple, that is, the gateway GPRS support node (GGSN) allocates an IP address to the mobile terminal in the shared local IP address pool, and the IP address used by the mobile terminal after the mobile terminal goes offline. The address can be assigned to other mobile terminals that are subsequently online. That is to say, the local IP address pool allocation method is characterized in that the IP address assigned by the mobile terminal every time it goes online may not be the same, and may occur under abnormal conditions: The external server records the IP address used by the mobile terminal A, when After the mobile terminal A goes offline, the IP address originally assigned to the mobile terminal A is again assigned to other mobile terminals, such as the mobile terminal B, thereby causing the external server to erroneously transmit the message that should originally be sent to the mobile terminal A to Mobile terminal B.
至于外地 IP地址分配方法, 包括认证 /授权 /收费 (AAA, Authentication Authorization Accounting )服务器分配 IP地址和动态主机配置协议( DHCP, Dynamic Host Configuration Protocol )分配 IP地址。这种外地 IP地址分配方法 是移动终端通过 GGSN向外部服务器(例如, AAA服务器或 DHCP服务器) 发送为其分配 IP地址的请求, 外部服务器在收到该请求后, 从配置的 IP地址 池为该移动终端分配一个空闲的 IP地址再通过 GGSN返回给移动终端。 As for the foreign IP address allocation method, the authentication authorization/authorization/accounting (AAA, Authentication Authorization Accounting) server assigns an IP address and a dynamic host configuration protocol (DHCP) to assign an IP address. This method of assigning a foreign IP address is a mobile terminal passing an GGSN to an external server (for example, an AAA server or a DHCP server). Sending a request for assigning an IP address to the mobile terminal, after receiving the request, the external server allocates an idle IP address to the mobile terminal from the configured IP address pool and returns it to the mobile terminal through the GGSN.
由于外地 IP地址分配方法需要依赖外部服务器 (AAA服务器或 DHCP 服务器)的稳定运行,一旦外部服务器运行不稳定, 则会直接影响移动终端 IP 地址的分配, 进而影响用户的业务使用。 发明内容  Because the external IP address allocation method needs to rely on the stable operation of the external server (AAA server or DHCP server), once the external server is unstable, it will directly affect the allocation of the IP address of the mobile terminal, which in turn affects the user's service usage. Summary of the invention
本发明实施例提供一种 IP地址分配方法以及相应的网关, 旨在解决现有技 术在为移动终端分配 IP地址时容错性差或比较依赖外部服务器的稳定运行的 问题。  The embodiments of the present invention provide an IP address allocation method and a corresponding gateway, which are intended to solve the problem of poor fault tolerance or relatively stable operation of an external server when assigning an IP address to a mobile terminal.
一种 IP地址分配方法, 包括: 获取移动终端的唯一标识码; 以所述唯一标 识码中的唯一标识字段或所述唯一标识码为映射变量,将所述映射变量映射为 An IP address allocation method includes: acquiring a unique identification code of a mobile terminal; mapping the mapping variable to a mapping variable by using a unique identification field or the unique identification code in the unique identification code as a mapping variable
IP地址的后三段; 从配置信息中读取所述唯一标识码归属的子网编号, 以所述 子网编号为 IP地址的前缀与所述 IP地址的后三段一起组合成 IP地址; 将所述组 合所得的 IP地址分配给所述移动终端。 The last three segments of the IP address; the subnet number to which the unique identification code belongs is read from the configuration information, and the prefix with the subnet number being the IP address is combined with the last three segments of the IP address to form an IP address; Assigning the IP address obtained by the combination to the mobile terminal.
一种网关, 包括: 获取模块,用于获取移动终端的唯一标识码; 映射模块, 用于以移动终端唯一标识码中的唯一标识字段或所述唯一标识码为映射变量, 将所述映射变量映射为 IP地址的后三段; IP地址组合模块, 用于从配置信息中 读取所述唯一标识码归属的子网编号,以所述子网编号为 IP地址的前缀与所述 IP地址的后三段一起组合成 IP地址; 分配模块, 用于将所述 IP地址组合模块组 合所得的 IP地址分配给所述移动终端。  A gateway, comprising: an obtaining module, configured to obtain a unique identifier of the mobile terminal; and a mapping module, configured to use the unique identifier field in the unique identifier code of the mobile terminal or the unique identifier as a mapping variable, and the mapping variable Mapping to the last three segments of the IP address; the IP address combination module, configured to read, from the configuration information, the subnet number to which the unique identifier is assigned, where the subnet number is a prefix of the IP address and the IP address The last three segments are combined into an IP address; an allocation module is configured to allocate an IP address obtained by combining the IP address combination modules to the mobile terminal.
本发明实施例以移动终端唯一标识码中的唯一标识字段为映射变量,将该 映射变量映射为 IP地址的后三段后,将移动终端唯一标识码归属的子网编号作 为 IP地址的前缀, 与映射出的 IP地址的后三段一起组合成 IP地址。 由于本发明 实施例采用映射方式生成的 IP地址是由本地 GGSN生成, 并不依赖于外部服务 器(例如, AAA服务器或 DHCP服务器) 的稳定运行, 因此, 这种 IP地址分配 方法具有较好的健壮性(robust ), 也不需要如现有技术那样释放 IP地址池必须 消耗的时间, 分配 IP地址速度快, 另外, 对于每一个移动终端, 采用本发明映 射方式生成的 IP地址都是唯一的, 因此消除了在分配或释放 IP地址时可能存在 的地址沖突。 附图说明 In the embodiment of the present invention, the unique identifier field in the unique identifier code of the mobile terminal is used as a mapping variable, and the mapping variable is mapped to the last three segments of the IP address, and the subnet number to which the unique identifier of the mobile terminal belongs is used as the prefix of the IP address. The IP address is combined with the last three segments of the mapped IP address. Since the IP address generated by the mapping method in the embodiment of the present invention is generated by the local GGSN, and does not depend on the stable operation of an external server (for example, an AAA server or a DHCP server), the IP address allocation is performed. The method has better robustness, and does not need to release the IP address pool as in the prior art, and the IP address is allocated quickly. In addition, for each mobile terminal, the IP generated by the mapping method of the present invention is used. The addresses are unique, thus eliminating address conflicts that may exist when assigning or releasing IP addresses. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲, 在不付 出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图 1是本发明实施例提供的一种 IP地址生成方法基本流程示意图; 段示意图;  1 is a schematic flowchart of a basic method for generating an IP address according to an embodiment of the present invention;
图 3是本发明实施例提供的修正不连续 IP地址号码段示意图;  3 is a schematic diagram of a modified discontinuous IP address number segment provided by an embodiment of the present invention;
图 4是本发明实施例提供的一种网关基本逻辑结构示意图。 具体实施方式  FIG. 4 is a schematic diagram of a basic logical structure of a gateway according to an embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  BRIEF DESCRIPTION OF THE DRAWINGS The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without the creative work are all within the scope of the present invention.
请参阅图 1, 本发明实施例提供的一种 IP地址生成方法基本流程示意图, 主要包括步骤:  Referring to FIG. 1, a schematic flowchart of a method for generating an IP address according to an embodiment of the present invention includes the following steps:
S101 , 获取移动终端的唯一标识码。  S101. Obtain a unique identification code of the mobile terminal.
移动终端在访问 Internet之前, 会向服务 GPRS支持节点 ( SGSN, Serving GPRS Support Node )发送激活消息, 例如, 分组数据协议(PDP, Packet Data Protocol )上下文请求, 该激活消息由 SGSN向 GGSN转发, GGSN从激活消息 获取移动终端的唯一标识码。在本发明实施例中, 移动终端的唯一标识码可以 是国际移动用户标识 ( IMSI, International Mobile Subscriber Identity )、 国际移 动设备身份码 (IMEI, International Mobile Equipment Identity)或其他可以 唯一标识移动终端的码字等 The mobile terminal will provide a service GPRS support node (SGSN, Serving) before accessing the Internet. The GPRS Support Node sends an activation message, for example, a Packet Data Protocol (PDP) context request, which is forwarded by the SGSN to the GGSN, and the GGSN acquires the unique identification code of the mobile terminal from the activation message. In the embodiment of the present invention, the unique identification code of the mobile terminal may be an International Mobile Subscriber Identity (IMSI), an International Mobile Equipment Identity (IMEI), or other code that can uniquely identify the mobile terminal. Word, etc.
S102 , 以移动终端唯一标识码中的唯一标识字段或唯一标识码为映射变 量, 将该映射变量映射为 IP地址的后三段。  S102: The mapping variable is mapped to the last three segments of the IP address by using a unique identifier field or a unique identifier in the unique identifier of the mobile terminal as a mapping variable.
由于在具体实现本发明的技术方案时,会考虑将哪一个号码段的 IMSI作为 规划允许接入的号码段, 因此, 系统管理人员可以设定一个号码段范围。 当 GGSN收到移动终端的激活消息时, 首先判断该移动终端的 IMSI是否在设定的 号码段范围。  Since the IMSI of which number segment is considered as the number segment allowed to be accessed when the technical solution of the present invention is specifically implemented, the system administrator can set a range of number segments. When the GGSN receives the activation message of the mobile terminal, it first determines whether the IMSI of the mobile terminal is within the set number range.
若该移动终端的 IMSI在设定的号码段范围,则将移动终端唯一标识码中的 唯一标识字段, 例如, IMSI中的移动用户鉴权号码 ( MSIN, Mobile Station Identity Number )字段作为映射变量, 将该映射变量映射为 IP地址的后三段, 具体包括:  If the IMSI of the mobile terminal is in the range of the set number segment, the unique identifier field in the unique identifier of the mobile terminal, for example, the mobile station authentication number (MSIN, Mobile Station Identity Number) field in the IMSI is used as a mapping variable. The mapping variable is mapped to the last three segments of the IP address, including:
51021 , 针对 IP地址后三段中的每一段, 选择三种映射参数。  51021. Select three mapping parameters for each of the last three segments of the IP address.
以 IPv4为例, 现有 IP地址是 32位, 每 8位为一节 (或一段)。 在本发明实施 例中, IP地址的后三段是指: 第 16至 23位为第一段, 第 8至 15位为第二段, 第 0 至 7位。可以针对这每一段选择一种映射参数, 一种映射参数针对不同的 MSIN 可以保持不变。  In the case of IPv4, the existing IP address is 32 bits, and each 8 bits is a section (or a segment). In the embodiment of the present invention, the last three segments of the IP address are: the 16th to 23rd bits are the first segment, and the 8th and 15th bits are the second segment, the 0th to the 7th bits. A mapping parameter can be selected for each of these segments, and one mapping parameter can remain unchanged for different MSINs.
51022 ,分别以 MSIN和三种映射参数中的一种映射参数作为映射因子,对 该映射因子执行三种运算操作后得到三种运算结果,该三种运算结果作为 IP地 址的后三段。 仍然以 IPv4为例, 考虑到 IP地址的第一段(第 16至 23位)转换成对应的十 进制范围在 0〜 255之间, 可以以 255x254和 255作为第一种映射参数, 执行 ( MSIN/255X254 ) %255运算操作后得到的运算结果作为所述 IP地址的后三段 的第一段, 这里 "x"、 "/" 和 "%" 分别为乘法运算操作、 除法运算操作和取 模操作; 同样地, 考虑到 IP地址的第二段(第 8至 15位)转换成对应的十进制 范围在 0〜 255之间, 可以以 254和 255作为第一种映射参数, 执行 ( MSIN/254 ) %255运算操作后得到的运算结果作为所述 IP地址的后三段的第 二段。 51022, one of the MSIN and one of the three mapping parameters is used as a mapping factor, and three operation operations are performed on the mapping factor to obtain three operation results, and the three operation results are used as the last three segments of the IP address. Still taking IPv4 as an example, considering that the first segment of the IP address (bits 16 to 23) is converted to a corresponding decimal range between 0 and 255, 255x254 and 255 can be used as the first mapping parameter to execute (MSIN/ 255X254) The operation result obtained after the operation operation of %255 is taken as the first segment of the last three segments of the IP address, where "x", "/" and "%" are respectively the multiplication operation, the division operation, and the modulo operation. Similarly, considering that the second segment of the IP address (bits 8 to 15) is converted to a corresponding decimal range between 0 and 255, 254 and 255 can be used as the first mapping parameter to execute (MSIN/254). The operation result obtained after the %255 operation operation is taken as the second segment of the last three segments of the IP address.
对于 IP地址的第三段(第 0至 7位), 其转换成十进制的合法范围应该在 1〜 254之间, 如果单纯执行 "取模" 操作, 即, 执行 MSIN/%254的运算操作, 则 可能会得到运算结果为 0或 255, 这些都不在合法范围内。 因此, 对于 IP地址的 第三段, 在本发明实施例中, 可以将 254作为第三种映射参数, 执行 ( MSIN%255 ) + 1运算操作后得到的运算结果作为 IP地址的第一段。  For the third segment of the IP address (bits 0 to 7), the legal range for conversion to decimal should be between 1 and 254. If the "modulo" operation is simply performed, that is, the operation of MSIN/%254 is performed. You may get an operation result of 0 or 255, which is not within the legal range. Therefore, for the third segment of the IP address, in the embodiment of the present invention, 254 can be used as the third mapping parameter, and the operation result obtained after the (MSIN%255) + 1 operation operation is used as the first segment of the IP address.
由于 MSIN是移动终端的国际移动用户标识中的唯一标识字段, 因此, 对 于每一个移动终端, 经过映射得到的 IP地址的后三段也是唯一的, 不会与其他 移动终端的 IP地址的后三段相沖突。  Since the MSIN is a unique identification field in the international mobile subscriber identity of the mobile terminal, for each mobile terminal, the last three segments of the mapped IP address are also unique, and will not be the last three of the IP addresses of other mobile terminals. Segment conflicts.
需要说明的是, 本发明虽然是以国际移动用户标识中的 MSIN字段作为映 射变量, 并且对 MSIN和映射参数执行的是加、 减、 乘、 除和取模等运算操作, 但本领域的技术人员应该能够理解,还有其它的映射变量可供选择, 并且还有 其它的运算操作可以作为实现映射的运算操作,只要移动终端的唯一标识码或 该唯一标识码中的字段经过映射后得到的 IP地址的后三段是唯一的,则本发明 不加限制。  It should be noted that although the present invention uses the MSIN field in the international mobile subscriber identity as a mapping variable, and performs operations operations such as adding, subtracting, multiplying, dividing, and modulating on the MSIN and the mapping parameters, the techniques in the art. Personnel should be able to understand that there are other mapping variables to choose from, and there are other operations that can be used as operations to implement the mapping, as long as the unique identification code of the mobile terminal or the field in the unique identification code is mapped. The last three segments of the IP address are unique, and the present invention is not limited.
当然, 为了本发明技术方案实现起来简单, 可以以线性映射(如上述实施 例所示)为优选的映射方式, 如此, 对于号码段连续的 IMSI, 通过线性映射后 得到的 IP地址后三段是连续的。 Of course, in order to achieve simple implementation of the technical solution of the present invention, a linear mapping (as shown in the above embodiment) may be used as a preferred mapping manner, such that for a serial number of consecutive IMSIs, after linear mapping The last three segments of the obtained IP address are consecutive.
S103 ,从配置信息中读取所述唯一标识码归属的子网编号, 以所述子网编 号为 IP地址的前缀与所述 IP地址的后三段一起组合成 IP地址。  S103. The subnet number to which the unique identifier is assigned is read from the configuration information, and the prefix with the subnet number being the IP address is combined with the last three segments of the IP address to form an IP address.
对于访问 Internet的多个移动终端, 其唯一标识码号码, 例如 IMSI号码段 需要规划到某一子网内, 即, 网络管理人员事先对 IMSI号码段进行规划, 明确 移动终端唯一标识码归属的子网编号, 以配置信息的形式保存在 GGSN内。 在 本发明实施例中, 对于 IP地址的前缀(即 IPv4中 IP地址的第 24至 31位)可以不 通过映射得到, 只需要从配置信息中读取唯一标识码归属的子网编号, 以该子 网编号为 IP地址的前缀, 与在 S 102中通过映射得到的 IP地址的后三段一起组合 便构成 IP地址。  For multiple mobile terminals accessing the Internet, the unique identification code number, such as the IMSI number segment, needs to be planned into a certain subnet. That is, the network management personnel plan the IMSI number segment in advance, and clarify the child to which the unique identification code of the mobile terminal belongs. The network number is stored in the GGSN in the form of configuration information. In the embodiment of the present invention, the prefix of the IP address (ie, the 24th to 31st bits of the IP address in the IPv4 address) may be obtained by using the mapping, and only the subnet number to which the unique identification code belongs is read from the configuration information. The subnet number is a prefix of the IP address, and is combined with the last three segments of the IP address obtained by mapping in S102 to constitute an IP address.
由于在实际应用中,规划到某一个子网内的多个移动终端, 其唯一标识码 构成的唯一标识码号段相互之间可能不是连续的, 如此, 即使经过线性映射, 加上前缀后得到的 IP地址构成的 IP地址号段, 其相互之间也不是连续的。 如图 2所示, IMSI号段 1映射成的 IP地址号段 1,例如 192.148.125.2〜 192.148.125.96, IMSI号段 2映射成的 IP地址号段 2, 例如 192.148.125.100〜 192.148.125.213 ; IP 地址号段 1的 IP地址终止端点 192.148.125.96与 IP地址号段 2的 IP地址起始端点 192.148.125.100之间具有差值 4 ( 100 - 96 = 4 ), 即 IP地址号段 1和 IMSI号段 2不 连续。  In a practical application, if multiple mobile terminals in a certain subnet are planned, the unique identification code number segments formed by the unique identification codes may not be consecutive to each other, so even after linear mapping, prefix is obtained. The IP address number segments formed by the IP addresses are not continuous with each other. As shown in FIG. 2, the IMSI number segment 1 is mapped into an IP address number segment 1, for example, 192.148.125.2 to 192.148.125.96, and the IMSI number segment 2 is mapped into an IP address number segment 2, for example, 192.148.125.100 to 192.148.125.213; IP address number segment 1 IP address termination endpoint 192.148.125.96 and IP address number segment 2 IP address start endpoint 192.148.125.100 has a difference of 4 (100 - 96 = 4), ie IP address number segment 1 and IMSI Segment 2 is not continuous.
为了便于网络规划或出于其他目的(例如, 希望节省 IP地址资源, 不希望 IP地址尽快耗尽等)的考虑, 在本发明实施例中, 对于多个移动终端唯一标识 码构成的不连续唯一标识码号段经过线性映射后得到不连续的 IP地址号段这 种情况, 可以对不连续 IP地址号段进行修正, 具体修正方法是: 以该 IP地址号 段的端点为基准的 IP地址, 将该基准的 IP地址增加偏移量(Offset )。 至于偏移 量的大小, 可以不固定, 主要是根据不连续 IP地址号段端点之间的差值来定, 基本原则是: 经过增加偏移量, 修正之后的 IP地址号段构成连续的 IP地址号段 即可。 In order to facilitate network planning or for other purposes (for example, it is desirable to save IP address resources, do not want IP addresses to be exhausted as soon as possible), in the embodiment of the present invention, discontinuous uniqueness is formed for multiple mobile terminal unique identification codes. After the identification code number segment is linearly mapped to obtain a discontinuous IP address number segment, the discontinuous IP address number segment may be corrected. The specific modification method is: an IP address based on the endpoint of the IP address number segment, The reference IP address is increased by an offset (Offset). As for the size of the offset, it may not be fixed, mainly based on the difference between the endpoints of the discontinuous IP address number segment. The basic principle is: After increasing the offset, the modified IP address number segment constitutes a continuous IP address number segment.
举例说明。 假设 IMSI ( 1 )和 IMSI ( 95 )构成 IMSI号段 IMSI ( 3-no), IMSI ( m) 和 IMSI ( 234 )构成 IMSI号段 IMSI ( 121-234 ), 经过映射后得到的 IP地址号段分别是 第一个 IP地址号段(IP地址号段 1 ) 192.148.125.2 〜 192.148.125.96和第二个 IP 地址号段( IP地址号段 2 ) 192.148.125.100〜 192.148.125.213。 第一个 IP地址号 段的一个端点(终止 IP地址)是 192.148.125.96, 第二个 IP地址号段的一个端点 (起始 IP地址)是 192.148.125.100。 显然, 该两个 IP地址号段之间是不连续的, 如果只是按照这种映射出来的 IP地址号段直接进行 IP地址的分配, 那么网络规 划很不方便, 也比较浪费地址资源。  for example. It is assumed that IMSI (1) and IMSI (95) constitute the IMSI number segment IMSI (3-no), IMSI (m) and IMSI (234) constitute the IMSI number segment IMSI (121-234), and the mapped IP address number segment They are the first IP address number segment (IP address number segment 1) 192.148.125.2 ~ 192.148.125.96 and the second IP address number segment (IP address number segment 2) 192.148.125.100~ 192.148.125.213. One endpoint (terminating IP address) of the first IP address number segment is 192.148.125.96, and one endpoint (starting IP address) of the second IP address number segment is 192.148.125.100. Obviously, the two IP address numbers are not consecutive. If the IP address is directly allocated according to the mapped IP address number, the network planning is inconvenient and the address resources are wasted.
按照本发明实施例提供的修正方式和修正原则,可以将第二个 IP地址号段 的端点 192.148.125.100增加一个偏移量(如图 3所示),例如,将 192.148.125.100 增加一个偏移量- 3, 即, 对 192.148.125.100实施 192.148.125.100 + ( - 3 ) 的 运算,使之变成 192.148.125.97。如此, 第二个 IP地址号段变成 192.148.125.97〜 192.148.125.213 , 其起始 IP地址变成了 192.148.125.97, 紧挨第一个 IP地址号段 的终止 IP地址 192.148.125.96, 两个 IP地址号段变成连续的。  According to the modification mode and the correction principle provided by the embodiment of the present invention, the endpoint 192.148.125.100 of the second IP address number segment can be increased by an offset (as shown in FIG. 3), for example, an offset of 192.148.125.100 is added. A quantity - 3, that is, an operation of 192.148.125.100 + ( - 3 ) for 192.148.125.100, making it 192.148.125.97. Thus, the second IP address number segment becomes 192.148.125.97~192.148.125.213, and its starting IP address becomes 192.148.125.97, immediately following the termination IP address of the first IP address number segment 192.148.125.96, two The IP address number segment becomes continuous.
当然, 如果不是线性映射, 则即使由唯一标识码(例如, IMSI )构成的唯 一标识码号段之间是连续的, 那么, 经过这种非线性映射后, 加上前缀后得到 的 IP地址构成的不连续 IP地址号段也不是连续的。 在这种情况下, 仍然可以采 用增加偏移量这种方式将不连续的 IP地址号段修正为连续的 IP地址号段, 具体 方法如前述实施例, 此处不再赘述。  Of course, if it is not a linear mapping, even if the unique identification code number segments composed of the unique identification code (for example, IMSI) are continuous, after the nonlinear mapping, the IP address obtained by adding the prefix constitutes The discontinuous IP address number segment is also not contiguous. In this case, the method of increasing the offset can be used to modify the non-contiguous IP address number segment to a continuous IP address number segment. The specific method is not described here.
S104, 将 S103中组合所得的 IP地址分配给所述移动终端。 并不依赖于外部服务器(例如, AAA服务器或 DHCP服务器)的稳定运行, 因 此, 这种 IP地址分配方法具有较好的健壮性, 也不需要如现有技术那样释放 IP 地址池必须消耗的时间, 分配 IP地址速度快, 另外, 对于每一个移动终端, 采 用本发明映射方式生成的 IP地址都是唯一的, 因此消除了在分配或释放 IP地址 时可能存在的地址沖突。 S104. Assign the IP address obtained by combining in S103 to the mobile terminal. Does not depend on the stable operation of an external server (for example, an AAA server or a DHCP server) Therefore, the IP address allocation method has better robustness, does not need to release the IP address pool as in the prior art, and allocates an IP address quickly. In addition, for each mobile terminal, the mapping of the present invention is adopted. The IP addresses generated by the mode are unique, thus eliminating the address conflicts that may exist when assigning or releasing IP addresses.
请参阅图 4, 本发明实施例提供的一种网关基本逻辑结构示意图。 为了便 于说明, 仅仅示出了与本发明实施例相关的部分, 并且, 示出的功能模块 /单 元可以是软件模块 /单元、 硬件模块 /单元或软硬件相结合的模块 /单元。 该网关 可以是 GPRS系统中的 GGSN或路由器, 其具体包括以下功能模块 /单元。  Referring to FIG. 4, a schematic diagram of a basic logical structure of a gateway according to an embodiment of the present invention is provided. For convenience of explanation, only parts related to the embodiment of the present invention are shown, and the illustrated functional modules/units may be software modules/units, hardware modules/units, or modules/units in which hardware and software are combined. The gateway may be a GGSN or a router in the GPRS system, which specifically includes the following functional modules/units.
映射模块 401,用于以移动终端唯一标识码中的唯一标识字段为映射变量, 将该映射变量映射为 IP地址的后三段, 包括:  The mapping module 401 is configured to map the mapping variable to the last three segments of the IP address by using a unique identifier field in the unique identifier of the mobile terminal as a mapping variable, including:
参数选定单元 4011, 用于选定三种映射参数;  Parameter selection unit 4011, configured to select three mapping parameters;
运算单元 4012, 用于分别以 MSIN和参数选定单元 4011选定的三种映射参 数中的一种映射参数作为映射因子,对映射因子执行三种运算操作后得到三种 运算结果, 三种运算结果作为 IP地址的后三段。  The operation unit 4012 is configured to use one of the three mapping parameters selected by the MSIN and the parameter selection unit 4011 as a mapping factor, and perform three operation operations on the mapping factor to obtain three operation results, three operations. The result is the last three segments of the IP address.
IP地址组合模块 402, 用于将移动终端唯一标识码归属的子网编号作为 IP 地址的前缀, 与映射模块 401映射出的 IP地址的后三段一起组合成 IP地址。  The IP address combination module 402 is configured to use the subnet number to which the mobile terminal unique identification code belongs as the IP address prefix, and combine with the last three segments of the IP address mapped by the mapping module 401 to form an IP address.
如前所述, 由于在实际应用中, 规划到某一个子网内的多个移动终端, 其 唯一标识码构成的唯一标识码号段相互之间可能不是连续的。如此, 即使经过 映射模块 401的映射, 加上前缀(移动终端唯一标识码归属的子网编号)后得 到的 IP地址构成的 IP地址号段, 其相互之间也不是连续的; 或者, 多个移动终 端的唯一标识码号段相互之间是连续的, 但因为映射模块 401的映射方式不是 线性映射, 加上前缀后得到的 IP地址构成的 IP地址号段, 其相互之间也不是连 续的。  As mentioned above, since in a practical application, a plurality of mobile terminals in a certain subnet are planned, the unique identification code number segments formed by the unique identification codes may not be consecutive to each other. In this way, even after the mapping by the mapping module 401, the IP address number segment formed by the IP address obtained by adding the prefix (the subnet number to which the mobile terminal unique identification code belongs) is not continuous with each other; or, multiple The unique identification code number segments of the mobile terminal are continuous with each other, but because the mapping mode of the mapping module 401 is not a linear mapping, the IP address number segments formed by the IP addresses obtained by the prefix are not continuous with each other. .
分配模块 403, 用于将 IP地址组合模块 402组合所得的 IP地址分配给移动终 端。 An allocating module 403, configured to allocate an IP address obtained by combining the IP address combining module 402 to the mobile terminal End.
在上述情况下, 为了便于网络规划或出于其他目的(例如, 希望节省 IP地 址资源, 不希望 IP地址尽快耗尽等)的考虑,在本实施例中, 网关还可以包括: IP地址号段爹正模块 404, 用于移动终端唯一标识码构成的唯一标识码号 段经过映射后得到不连续的 IP地址号段时,对该不连续的 IP地址号段进行修正 使之成为连续的 IP地址号段, 然后由分配模块 403分配给移动终端。 不连续的 IP地址号段的修正方式可以是以 IP地址号段的端点为基准的 IP地址, 将该基准 的 IP地址增加偏移量(Offset )。 至于偏移量的大小, 可以不固定, 主要是根据 不连续 IP地址号段端点之间的差值来定, 基本原则是: 经过增加偏移量, 修正 之后的 IP地址号段构成连续的 IP地址号段即可, 具体示例可以参阅上述方法实 施例, 此处不再赘述。  In the above case, in order to facilitate network planning or for other purposes (for example, it is desirable to save IP address resources, do not want the IP address to be exhausted as soon as possible), in this embodiment, the gateway may further include: an IP address number segment. The correcting module 404, when the unique identification code number segment formed by the unique identification code of the mobile terminal is mapped to obtain a discontinuous IP address number segment, the discontinuous IP address number segment is corrected to become a continuous IP address. The segment is then assigned to the mobile terminal by the allocation module 403. The method of correcting the discontinuous IP address number segment may be an IP address based on the endpoint of the IP address number segment, and the reference IP address is increased by an offset (Offset). As for the size of the offset, it may not be fixed, mainly based on the difference between the endpoints of the discontinuous IP address number. The basic principle is: After increasing the offset, the modified IP address number segment constitutes a continuous IP. For the specific example, refer to the foregoing method embodiment, and details are not described herein again.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: 只读存储器(ROM, Read Only Memory )、 随机存取存储器 (RAM, Random Access Memory )、 磁盘或光盘等。  A person skilled in the art may understand that all or part of the various steps of the foregoing embodiments may be completed by a program instructing related hardware. The program may be stored in a computer readable storage medium, and the storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.
以上对本发明实施例所提供的一种 IP地址分配方法以及相应的网关进行 以上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时,对于 本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均 会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。  The above description of the IP address allocation method and the corresponding gateway provided by the embodiment of the present invention is only for helping to understand the method and core idea of the present invention. Meanwhile, for those skilled in the art, according to the present invention, The present invention is not limited by the scope of the present invention.

Claims

权 利 要 求 Rights request
1、 一种 IP地址分配方法, 其特征在于, 包括:  A method for allocating an IP address, comprising:
获取移动终端的唯一标识码;  Obtaining a unique identification code of the mobile terminal;
以所述唯一标识码中的唯一标识字段或所述唯一标识码为映射变量,将所 述映射变量映射为 IP地址的后三段;  Mapping the mapping variable to the last three segments of the IP address by using a unique identification field or the unique identification code in the unique identification code as a mapping variable;
从配置信息中读取所述唯一标识码归属的子网编号,以所述子网编号为 IP 地址的前缀与所述 IP地址的后三段一起组合成 IP地址;  Reading the subnet number to which the unique identifier code belongs from the configuration information, and combining the prefix with the subnet number as the IP address and the last three segments of the IP address into an IP address;
将所述组合所得的 IP地址分配给所述移动终端。  Assigning the IP address obtained by the combination to the mobile terminal.
2、 根据权利要求 1所述的 IP地址分配方法, 其特征在于, 所述移动终端唯 一标识码是国际移动设备身份码。  2. The IP address allocation method according to claim 1, wherein the mobile terminal unique identification code is an international mobile device identity code.
3、 根据权利要求 1所述的 IP地址分配方法, 其特征在于, 所述移动终端唯 一标识码是国际移动用户标识码,所述唯一标识码中的唯一标识字段是移动用 户鉴权号码 MSIN。  The IP address allocation method according to claim 1, wherein the unique identifier of the mobile terminal is an international mobile subscriber identity code, and the unique identifier field in the unique identifier code is a mobile subscriber authentication number MSIN.
4、 根据权利要求 3所述的 IP地址生成方法, 其特征在于, 所述以移动终端 唯一标识码中的唯一标识字段为映射变量,将所述映射变量映射为 IP地址的后 三段包括:  The method for generating an IP address according to claim 3, wherein the mapping of the mapping variable to the last three segments of the IP address is performed by using the unique identifier field in the unique identifier code of the mobile terminal as a mapping variable, and the method includes:
选定三种映射参数;  Three mapping parameters are selected;
分别以所述移动用户鉴权号码 (MSIN ) 和三种映射参数中的一种映射参 数作为映射因子,对所述映射因子执行三种运算操作后得到三种运算结果,所 述三种运算结果作为所述 IP地址的后三段。  Performing three kinds of operation operations on the mapping factor by using one of the mobile user authentication number (MSIN) and one of the three mapping parameters as a mapping factor, and the three operation results are obtained. As the last three segments of the IP address.
5、 根据权利要求 4所述的 IP地址生成方法, 其特征在于, 所述分别以所述 移动用户鉴权号码 MSIN和三种映射参数中的一种映射参数作为映射因子, 对 所述映射因子执行三种运算操作后得到三种运算结果包括:  The method for generating an IP address according to claim 4, wherein the mapping parameter is used as a mapping factor by using one of the mobile user authentication number MSIN and three mapping parameters, respectively. After performing three kinds of operations, three kinds of operation results are obtained:
将 255 X 254和 255作为第一种映射参数, 执行( MSIN/255 x 254 ) %255运 算操作后得到的运算结果作为所述 IP地址的后三段的第一段; 将 254和 255作为第二种映射参数, 执行(MSIN/254 ) %255运算操作后得 到的运算结果作为所述 IP地址的后三段的第二段; Using 255 X 254 and 255 as the first mapping parameter, the operation result obtained after the (MSIN/255 x 254) %255 operation is performed as the first segment of the last three segments of the IP address; Using 254 and 255 as the second mapping parameter, the operation result obtained after the (MSIN/254) %255 operation operation is performed as the second segment of the last three segments of the IP address;
将 254作为第三种映射参数, 执行(MSIN%255 ) + 1运算操作后得到的运 算结果作为所述 IP地址的后三段的第三段;  Using 254 as the third mapping parameter, the operation result obtained after the (MSIN%255) + 1 operation is performed as the third segment of the last three segments of the IP address;
所述 " X " 为乘法运算操作, 所述 "/" 为除法运算操作, 所述 "%" 为取 模操作。  The "X" is a multiplication operation, the "/" is a division operation, and the "%" is a modulo operation.
6、 根据权利要求 1所述的 IP地址分配方法, 其特征在于, 所述映射为线性 映射。  6. The IP address allocation method according to claim 1, wherein the mapping is a linear mapping.
7、 根据权利要求 1所述的 IP地址分配方法, 其特征在于, 若所述移动终端 唯一标识码构成的唯一标识码号段之间不连续,则对经过所述映射后得到的 IP 地址构成的不连续 IP地址号段进行修正使之成为连续的 IP地址号段。  The IP address allocation method according to claim 1, wherein if the unique identification code number segments formed by the unique identification code of the mobile terminal are discontinuous, the IP address obtained after the mapping is formed. The discontinuous IP address number segment is modified to become a continuous IP address number segment.
8、 根据权利要求 7所述的 IP地址分配方法, 其特征在于, 所述修正方式包 括:  8. The IP address allocation method according to claim 7, wherein the correction method comprises:
以所述 IP地址号段的端点为基准 IP地址, 将所述基准的 IP地址增加偏移  Determining the reference IP address by using the endpoint of the IP address number segment as a reference IP address
9、 一种网关, 其特征在于, 所述网关包括: A gateway, wherein the gateway comprises:
获取模块, 用于获取移动终端的唯一标识码;  An obtaining module, configured to acquire a unique identification code of the mobile terminal;
映射模块,用于以移动终端唯一标识码中的唯一标识字段或所述唯一标识 码为映射变量, 将所述映射变量映射为 IP地址的后三段;  a mapping module, configured to map the mapping variable to a last three segments of an IP address by using a unique identifier field in the mobile terminal unique identifier code or the unique identifier code as a mapping variable;
IP地址组合模块, 用于从配置信息中读取所述唯一标识码归属的子网编 号, 以所述子网编号为 IP地址的前缀与所述 IP地址的后三段一起组合成 IP地 址;  An IP address combination module, configured to read, from the configuration information, a subnet number to which the unique identifier is assigned, and combine the prefix with the subnet number as an IP address with the last three segments of the IP address to form an IP address;
分配模块, 用于将所述 IP地址组合模块组合所得的 IP地址分配给所述移动 终端。 And an allocating module, configured to allocate an IP address obtained by combining the IP address combination modules to the mobile terminal.
10、 根据权利要求 9所述的网关, 其特征在于, 所述移动终端唯一标识码 是国际移动用户标识码,所述唯一标识码中的唯一标识字段是移动用户鉴权号 码 MSIN。 The gateway according to claim 9, wherein the mobile terminal unique identification code is an international mobile subscriber identity code, and the unique identifier field in the unique identity code is a mobile subscriber authentication number MSIN.
11、 根据权利要求 10所述的网关, 其特征在于, 所述映射模块包括: 参数选定单元, 用于选定三种映射参数;  The gateway according to claim 10, wherein the mapping module comprises: a parameter selection unit, configured to select three mapping parameters;
运算单元, 用于分别以所述移动用户鉴权号码 MSIN和所述参数选定单元 选定的三种映射参数中的一种映射参数作为映射因子,对所述映射因子执行三 种运算操作后得到三种运算结果, 所述三种运算结果作为所述 IP地址的后三 段。  An operation unit, configured to use one of the three mapping parameters selected by the mobile user authentication number MSIN and the parameter selection unit as a mapping factor, and perform three operation operations on the mapping factor Three kinds of operation results are obtained, and the three operation results are used as the last three segments of the IP address.
12、 根据权利要求 9所述的网关, 其特征在于, 所述网关还包括: The gateway according to claim 9, wherein the gateway further comprises:
IP地址号段 ^ίι爹正模块,用于所述移动终端唯一标识码构成的唯一标识码号 段经过映射后得到不连续的 IP地址号段时,对所述不连续的 IP地址号段进行修 正使之成为连续的 IP地址号段。 The IP address number segment ^ίι爹正 module is configured to: when the unique identification code number segment formed by the unique identification code of the mobile terminal is mapped to obtain a discontinuous IP address number segment, perform the discontinuous IP address number segment Correction makes it a continuous IP address number segment.
13、 根据权利要求 12所述的网关, 其特征在于, 所述 IP地址号段修正模块 还用于:  The gateway according to claim 12, wherein the IP address number segment correction module is further configured to:
以所述 IP地址号段的端点为基准的 IP地址, 将所述基准的 IP地址增加偏移 量, 所述偏移量根据修正之后的 IP地址号段构成连续的 IP地址号段而定。  And determining, by the IP address based on the endpoint of the IP address number segment, an offset of the reference IP address, wherein the offset is determined according to the modified IP address number segment to form a continuous IP address number segment.
PCT/CN2010/076989 2009-12-17 2010-09-16 Ip address assignment method and gateway WO2011072540A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2009102524903A CN101764856B (en) 2009-12-17 2009-12-17 IP address allocation method and gateway
CN200910252490.3 2009-12-17

Publications (1)

Publication Number Publication Date
WO2011072540A1 true WO2011072540A1 (en) 2011-06-23

Family

ID=42495836

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/076989 WO2011072540A1 (en) 2009-12-17 2010-09-16 Ip address assignment method and gateway

Country Status (2)

Country Link
CN (1) CN101764856B (en)
WO (1) WO2011072540A1 (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674337B (en) * 2009-09-07 2012-12-19 中兴通讯股份有限公司 Method for distributing virtual private network internet protocol addresses and network management system
CN101764856B (en) * 2009-12-17 2012-11-07 华为技术有限公司 IP address allocation method and gateway
CN102231764A (en) * 2011-06-22 2011-11-02 华为技术有限公司 Method and device for distributing network addresses
US8832238B2 (en) * 2011-09-12 2014-09-09 Microsoft Corporation Recording stateless IP addresses
CN103248716B (en) * 2012-02-09 2017-04-12 华为技术有限公司 Distribution method, device and system of private network address
CN103379179B (en) * 2012-04-17 2016-12-14 南京中兴软件有限责任公司 A kind of method and system for planning network IP address
CN102739821A (en) * 2012-07-03 2012-10-17 大唐移动通信设备有限公司 Method and system for allocating IP addresses
CN102811263A (en) * 2012-07-25 2012-12-05 中国联合网络通信集团有限公司 Internet protocol version 6 (IPv6)-based communication method and system for mobile terminal and mobile terminal
CN103037026B (en) * 2012-12-10 2015-07-22 上海斐讯数据通信技术有限公司 Dynamic host configuration protocol (DHCP) server address pool automatic configuration method and device and central processing element (CPE) equipment
CN106570097B (en) * 2016-10-31 2020-09-08 华为技术有限公司 Sequence generation method and device
CN106953938A (en) * 2017-03-29 2017-07-14 武汉米风通信技术有限公司 A kind of broadcasting and TV frequency spectrum ultra-narrow the band recognition methods of internet-of-things terminal Information Repeater and device
CN108156275B (en) * 2017-12-20 2021-03-09 北京金山云网络技术有限公司 IP address allocation method, device, electronic equipment and storage medium
TWI692732B (en) * 2018-03-07 2020-05-01 虹映科技股份有限公司 Real-time information display method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1367974A (en) * 1999-03-31 2002-09-04 艾利森电话股份有限公司 IP address allocation for mobile terminals
US20030112794A1 (en) * 2001-12-19 2003-06-19 Bollapragada Manohar System and method for multiple PDP contexts with a single PDP address at a GGSN
CN1612570A (en) * 2003-10-27 2005-05-04 三星电子株式会社 Method and system for supporting mobility of mobile terminal
CN1992736A (en) * 2005-12-30 2007-07-04 西门子(中国)有限公司 IP address distribution method and use thereof
CN101764856A (en) * 2009-12-17 2010-06-30 华为技术有限公司 IP address allocation method and gateway

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2348778A (en) * 1999-04-08 2000-10-11 Ericsson Telefon Ab L M Authentication in mobile internet access
US6977917B2 (en) * 2000-03-10 2005-12-20 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for mapping an IP address to an MSISDN number within a service network
CN100571286C (en) * 2005-11-02 2009-12-16 中兴通讯股份有限公司 Cdma system distributes the method for fixed ip address for the user

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1367974A (en) * 1999-03-31 2002-09-04 艾利森电话股份有限公司 IP address allocation for mobile terminals
US20030112794A1 (en) * 2001-12-19 2003-06-19 Bollapragada Manohar System and method for multiple PDP contexts with a single PDP address at a GGSN
CN1612570A (en) * 2003-10-27 2005-05-04 三星电子株式会社 Method and system for supporting mobility of mobile terminal
CN1992736A (en) * 2005-12-30 2007-07-04 西门子(中国)有限公司 IP address distribution method and use thereof
CN101764856A (en) * 2009-12-17 2010-06-30 华为技术有限公司 IP address allocation method and gateway

Also Published As

Publication number Publication date
CN101764856B (en) 2012-11-07
CN101764856A (en) 2010-06-30

Similar Documents

Publication Publication Date Title
WO2011072540A1 (en) Ip address assignment method and gateway
ES2628083T3 (en) Method, relay device and system for acquiring an Internet protocol address in a network
JP5663549B2 (en) Method, apparatus and system for assigning public IP addresses
US8189567B2 (en) Method and nodes for registering a terminal
US7962584B2 (en) Usage of host generating interface identifiers in DHCPv6
CN102546568B (en) Method and device for Internet protocol (IP) terminal being accessed into network
US10218671B2 (en) Dynamic media access control address allocation and leasing for wireless network
CN106576119B (en) Method and apparatus for delegating prefixes to Wi-Fi clients
TWI429240B (en) Gateway and attack avoiding method thereof
CN108737585B (en) IP address allocation method and device
CN103384282B (en) The method and BRAS of a kind of acquisition IPV6ND addresses
WO2014101891A1 (en) Method and device for configuring ip address
WO2014101041A1 (en) Ipv6 address tracing method, device, and system
WO2014086167A1 (en) Mobile terminal and address allocation method and system thereof
CN110995883A (en) Method, system and storage medium for DHCPv6 fixed address configuration based on EUI-64
CN104753793A (en) Method for statefull management of access terminal under stateless internet protocol version 6 (IPv6) configuration
WO2011147343A1 (en) Method, device and system for address assignment in internet protocol (ip) networks
JP4497555B2 (en) Efficient IP address assignment apparatus for IPv6 and method in dial-up network
JP2001274845A (en) Communicating method accompanying protocol conversion and communication controller
WO2015196719A1 (en) Address configuration method, apparatus and device
JP2004015795A (en) IPv4 MANAGEMENT METHOD AND MANAGEMENT DEVICE IN IPv6 WIRELESS LAN ENVIRONMENT
CN102299860B (en) Acquisition method and equipment for path maximum transmission unit (Pathmtu)
WO2012139283A1 (en) Method and appratus for address allocation
JP2016515371A (en) Packet transmission method and apparatus, and server
CN113992629B (en) Address allocation method and device

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: 10836977

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: 10836977

Country of ref document: EP

Kind code of ref document: A1