WO2017101367A1 - 公网ip处理方法及装置 - Google Patents

公网ip处理方法及装置 Download PDF

Info

Publication number
WO2017101367A1
WO2017101367A1 PCT/CN2016/088867 CN2016088867W WO2017101367A1 WO 2017101367 A1 WO2017101367 A1 WO 2017101367A1 CN 2016088867 W CN2016088867 W CN 2016088867W WO 2017101367 A1 WO2017101367 A1 WO 2017101367A1
Authority
WO
WIPO (PCT)
Prior art keywords
floating
address
gateway
interface
port number
Prior art date
Application number
PCT/CN2016/088867
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 乐视控股(北京)有限公司
Priority to US15/246,517 priority Critical patent/US20170171150A1/en
Publication of WO2017101367A1 publication Critical patent/WO2017101367A1/zh

Links

Images

Classifications

    • 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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5076Update or notification mechanisms, e.g. DynDNS

Definitions

  • the embodiments of the present invention relate to the field of information technology, and in particular, to a public network IP processing method and apparatus.
  • router gateway IP In the network managed by OpenStack Neutron (open source cloud management platform project), there are two concepts: router gateway IP and floating IP. They all belong to the same network segment, namely router gateway IP and floating.
  • the IP belongs to the public IP (Public IP).
  • Public IP The default implementation method of OpenStack is to treat the router gateway IP and the floating IP differently. For them, they have their own operation interfaces, such as operating the interface of the router with the router, and operating the floating IP with the floating IP. interface.
  • the embodiment of the invention provides a public network IP processing method and device, which are used to reduce the extra workload generated when the existing public network IP processing is performed.
  • An embodiment of the present invention provides a public network IP processing method, where the method includes:
  • the floating IP is processed according to a floating IP interface.
  • the obtaining the gateway IP address includes:
  • the method further includes: before the processing the floating IP address according to the floating IP interface, the method further includes:
  • the floating IP is obtained through the floating IP interface.
  • the generating the floating IP according to the gateway IP address includes:
  • the floating IP is generated according to the gateway IP address and the floating port number.
  • the binding the gateway IP address and the floating IP includes:
  • the embodiment of the invention provides a public network IP processing device, and the device includes:
  • An obtaining unit configured to obtain a gateway IP address
  • a generating unit configured to generate a floating IP according to the gateway IP address, where the floating IP address in the floating IP is the gateway IP address;
  • a binding unit configured to bind the gateway IP address and the floating IP
  • the processing unit is configured to process the floating IP according to the floating IP interface.
  • the obtaining unit includes:
  • a receiving module configured to receive a request for setting a routing gateway
  • an obtaining module configured to acquire the gateway IP address according to the virtual network interface.
  • the acquiring unit is further configured to acquire the floating IP by using the floating IP interface.
  • the generating unit is specifically configured to generate the floating IP according to the gateway IP address and the floating port number.
  • the binding unit is specifically configured to bind the gateway IP address, the fixed port number, and the floating IP.
  • An embodiment of the present invention provides another public network IP processing apparatus, where the apparatus includes:
  • One or more processors are One or more processors.
  • the memory stores instructions that are configured to be executed by the one or more processors, and the one or more processors can perform the following operations by executing the instructions:
  • the floating IP is processed according to a floating IP interface.
  • the public network IP processing method and device provided by the embodiment of the present invention first obtains a gateway IP address, and then generates a floating IP according to the gateway IP address, where the floating IP address in the floating IP is the gateway IP address, and then Binding the gateway IP address to the floating IP, and finally processing the floating IP according to the floating IP interface.
  • two sets of interfaces are required, that is, one set of interfaces is for the gateway IP, and one set of interfaces is for the floating IP.
  • the gateway IP address is first used when the public IP is operated.
  • the floating IP address and the gateway IP address are the same in the floating IP address, and then the gateway IP address is bound to the floating IP, and finally the floating IP interface is processed by the floating IP interface. Therefore, the interface developed for the floating IP can be directly invoked by the present invention to operate the special floating IP, that is, the floating IP generated by the gateway IP, so that the floating IP and gateway IP operations can be completed only by the floating IP interface.
  • An interface developed for gateway IP reduces the amount of extra work generated by IP processing on the public network.
  • FIG. 1 is a flowchart of a public network IP processing method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another public network IP processing method according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram of a public network IP processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural block diagram of another public network IP processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a physical structure of a server according to an embodiment of the present invention.
  • the embodiment of the invention provides a public network IP processing method, as shown in FIG. 1 , the specific steps include:
  • the gateway IP address is essentially an IP address of the network to other networks, and the gateway IP address is a fixed IP address. It should be noted that in the network managed by OpenStack (open source cloud computing management platform project), the gateway IP address and floating IP belong to the public IP (Public IP).
  • Public IP public IP
  • the default implementation method of OpenStack is to distinguish the gateway IP from the floating IP. To treat them, they have their own operational interfaces, such as the interface that operates the gateway IP routing, and the floating IP interface for floating IP.
  • the floating IP address in the floating IP is the gateway IP address. It should be noted that the format of the floating IP is (floating IP address, floating portID, fixed IP address, fixed portID), where the floating portID is the floating port number, the fixed portID is the fixed port number, the floating port number and the fixed port number are When the public IP address is set, the system automatically assigns it.
  • the floating IP generated according to the IP address of the gateway is specifically (10.11.1.254, 11111, null, null). It should be noted that 10.11.1.254 in the floating IP address. Indicates the floating IP address, 11111 indicates the floating port number, and the positions of the next two values represent the fixed IP address and the fixed portID, respectively, and the positions of the two null values are used to subsequently bind the gateway IP address.
  • binding the gateway IP address and the floating IP is to The IP address and the fixed interface number are filled in to the generated floating IP.
  • the generated floating IP address is (10.11.1.254, 11111, null, null)
  • the floating IP may be specifically (10.11.1.254, 11111, 10.11. 1.254, 22222).
  • the floating IP address and the fixed IP address in the floating IP are the same, both of which are gateway IP addresses. Therefore, in the subsequent steps, the generated floating IP address can be operated through the floating IP interface, that is, the IP address of the operation gateway can be implemented through the floating IP interface.
  • the processing of the floating IP may be a bandwidth of a floating IP, a flow of a statistical floating IP, an added function, and the like, which are not specifically limited in this embodiment of the present invention.
  • the scenario that can be applied is as follows, but is not limited thereto. If the traffic corresponding to the public IP address of the OpenStack needs to be counted, the corresponding traffic under the gateway IP and the traffic corresponding to the floating IP are separately collected. Then, according to the sum of the traffic corresponding to the gateway IP and the traffic corresponding to the floating IP, the traffic corresponding to the public network IP is obtained. For the traffic on the floating IP address, you can obtain the floating IP traffic directly through the floating IP interface. To calculate the IP traffic of the gateway, you need to convert the gateway IP into a floating IP address. The floating IP address in the floating IP address is the gateway IP address, and then Bind the floating IP address to the IP address of the gateway.
  • the embodiment of the present invention further provides a public network IP processing method, as shown in FIG. 2, the specific steps include:
  • the obtaining the gateway IP address includes: receiving the setting routing gateway request information; creating a virtual network interface corresponding to the routing gateway request information; and acquiring the gateway IP address according to the virtual network interface.
  • the floating IP address in the floating IP address is the IP address of the gateway.
  • the format of the floating IP address is a floating IP address, a floating port ID, a fixed IP address, and a fixed port ID.
  • Floating port number then according to the gateway IP address and The floating port number generates a floating IP. It should be noted that the floating port number is automatically generated by the system and can be directly obtained. For example, if the obtained gateway IP address is 10.11.1.151 and the floating port number is 11111, the floating IP generated based on the gateway IP address and floating port number is specifically (10.11.1.151, 11111, null, null).
  • the floating IP generated based on the gateway IP address and floating port number is specifically (10.11.1.112, 11111, null, null).
  • the port number is 22222.
  • the floating IP address is specifically (10.11.1.112, 11111, 10.11.1.112, 22222).
  • the first IP address 10.11.1.112 in the floating IP indicates a floating IP address
  • 11111 indicates a floating port number
  • the latter IP address 10.11.1.112 in the floating IP indicates a fixed IP address
  • 22222 Indicates the fixed port number.
  • the floating IP address in the public network can be processed through the floating IP interface, and the processing of the gateway IP address in the public network needs to be based on the gateway IP address and The fixed port number generates a floating IP address.
  • the floating IP address and the gateway IP address in the generated floating IP address are the same.
  • the generated floating IP and the gateway IP address and the fixed port number are bound.
  • the interface developed for the floating IP is operated.
  • the floating IP is generated according to the IP address of the gateway and the fixed port number, so that the floating IP interface and the IP address of the gateway can be completed only by the floating IP interface, and the interface developed for the gateway IP is avoided, and the IP address generated by the public network is reduced. Extra workload.
  • an embodiment of the present invention provides a public network IP processing apparatus.
  • the apparatus includes: an acquiring unit, a generating unit, a binding unit, and a processing unit;
  • the obtaining unit 31 is configured to obtain a gateway IP address.
  • the generating unit 32 is configured to generate a floating IP according to the gateway IP address obtained by the obtaining unit 31, where the floating IP address in the floating IP is the gateway IP address.
  • the gateway IP address is essentially an IP address of the network to other networks, and the gateway IP address is fixed. IP address. It should be noted that in the network managed by OpenStack (open source cloud computing management platform project), the gateway IP address and floating IP belong to the public IP (Public IP).
  • Public IP public IP
  • the default implementation method of OpenStack is to distinguish the gateway IP from the floating IP. To treat them, they have their own operational interfaces, such as the interface that operates the gateway IP routing, and the floating IP interface for floating IP.
  • the binding unit 33 is configured to bind the gateway IP address and the floating IP generated by the generating unit 32.
  • the format of the floating IP is a floating IP address, a floating port ID, a fixed IP address, and a fixed port ID.
  • the floating portID is the floating port number.
  • the fixed portID is the fixed port number. The floating port number and the fixed port number are automatically assigned by the system when the public IP address is set.
  • the processing unit 34 is configured to process the floating IP according to the floating IP interface.
  • the processing of the floating IP may be a bandwidth of a floating IP, a flow of a statistical floating IP, an added function, and the like, which are not specifically limited in this embodiment of the present invention.
  • the obtaining unit 31 includes:
  • the receiving module 311 is configured to receive the setting routing gateway request information.
  • the creating module 312 is configured to create a virtual network interface corresponding to the routing gateway request information received by the receiving module 311.
  • the obtaining module 313 is configured to obtain the gateway IP address according to the virtual network interface created by the creating module 312.
  • the obtaining unit 31 is further configured to acquire the floating IP by using the floating IP interface.
  • the generating unit 32 is specifically configured to generate the floating IP according to the gateway IP address and the floating port number.
  • the floating IP address is a floating IP address, a floating port ID, a fixed IP address, and a fixed port ID. Therefore, when generating a floating IP address, you need to obtain a floating port number, and then generate a floating IP address based on the gateway IP address and floating port number. .
  • the floating port number is automatically generated by the system and can be directly obtained. For example, if the obtained gateway IP address is 10.11.1.151 and the floating port number is 11111, the floating IP generated based on the gateway IP address and floating port number is specifically (10.11.1.151, 11111, null, null).
  • the binding unit 33 is specifically configured to bind the gateway IP address, the fixed port number, and the floating IP. For example, if the obtained gateway IP address is 10.11.1.112 and the floating port number is 11111, the floating IP generated based on the gateway IP address and floating port number is specifically (10.11.1.112, 11111, null, null). The port number is 22222. After the gateway IP address, the fixed port number, and the floating IP address are bound, the floating IP address is specifically (10.11.1.112, 11111, 10.11.1.112, 22222).
  • the public network IP processing method and apparatus provided by the embodiment of the present invention first obtains a gateway IP address, and then generates a floating IP according to the gateway IP address, where the floating IP address in the floating IP is the The gateway IP address is bound to the gateway IP address and the floating IP, and finally the floating IP is processed according to the floating IP interface.
  • two sets of interfaces are required, that is, one set of interfaces is for the gateway IP, and one set of interfaces is for the floating IP.
  • the gateway IP address is first used when the public IP is operated.
  • the floating IP address and the gateway IP address are the same in the floating IP address, and then the gateway IP address is bound to the floating IP, and finally the floating IP interface is processed by the floating IP interface. Therefore, the interface developed for the floating IP can be directly invoked by the present invention to operate the special floating IP, that is, the floating IP generated by the gateway IP, so that the floating IP and gateway IP operations can be completed only by the floating IP interface.
  • An interface developed for gateway IP reduces the amount of extra work generated by IP processing on the public network.
  • FIG. 5 is a schematic diagram showing the physical structure of a server according to an embodiment of the present invention.
  • the server may include a processor 51, a communication interface 52, and a memory. (memory) 53 and bus 54, wherein the processor 51, the communication interface 52, and the memory 53 complete communication with each other via the bus 54.
  • Communication interface 52 can be used for information transfer between the server and the client.
  • the processor 51 can call the logic instruction in the memory 53 to perform the following method: acquiring a gateway IP address; generating a floating IP according to the gateway IP address, where the floating IP address in the floating IP is the gateway IP address; The gateway IP address is bound to the floating IP; the floating IP is processed according to the floating IP interface.
  • the logic instructions in the memory 53 described above may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to make a computer device (may be A personal computer, server, or network device, etc.) performs all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. 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)

Abstract

本发明实施例提供一种公网IP处理方法及装置,涉及信息技术领域,主要目的在于减少对公网IP处理时所产生的额外工作量。本发明实施例所采用的技术方案是:获取网关IP地址;根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;将所述网关IP地址和所述浮动IP进行绑定;根据浮动IP接口,处理所述浮动IP。本发明主要用于对公网IP进行操作。

Description

公网IP处理方法及装置
本申请基于申请号为2015109263454、申请日为2015年12月14日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本发明实施例涉及信息技术领域,尤其涉及一种公网IP处理方法及装置。
背景技术
在OpenStack Neutron(开源的云计算管理平台项目)管理的网络中,有router gateway IP(路由网关IP)和floating IP(浮动IP)两个概念,它们都属于同一网段,即router gateway IP和floating IP同属于公网IP(Public IP),OpenStack默认的实现方法是将router gateway IP和floating IP区别对待,针对它们有各自的操作接口,比如操作gateway用router的接口,操作floating IP用floating IP的接口。
目前,针对公网IP进行的操作,比如设置公网带宽,就需要开发两套API,一套针对router gateway IP,一套针对floating IP。若再增加关于公网流量统计的功能,又需要开发两套API,分别针对router gateway IP和floating IP。这样每针对公网IP增加一个功能,就需要开发两套API,不仅成倍的增加了额外的工作量,也增加了维护的成本,使得出错概率增大。
发明内容
本发明实施例提供一种公网IP处理方法及装置,用以减少对现有公网IP处理时所产生的额外工作量。
本发明实施例提供一种公网IP处理方法,该方法包括:
获取网关IP地址;
根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所 述网关IP地址;
将所述网关IP地址和所述浮动IP进行绑定;
根据浮动IP接口,处理所述浮动IP。
具体的,所述获取网关IP地址包括:
接收设置路由网关请求信息;
创建与所述路由网关请求信息对应的虚拟网络接口;
根据所述虚拟网络接口获取所述网关IP地址。
进一步地,所述根据浮动IP接口,处理所述浮动IP地址之前,所述方法还包括:
通过所述浮动IP接口,获取所述浮动IP。
具体的,所述根据所述网关IP地址生成浮动IP包括:
根据所述网关IP地址和浮动端口号生成所述浮动IP。
具体的,所述将所述网关IP地址和所述浮动IP进行绑定包括:
将所述网关IP地址、固定端口号和所述浮动IP进行绑定。
本发明实施例提供一种公网IP处理装置,该装置包括:
获取单元,用于获取网关IP地址;
生成单元,用于根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;
绑定单元,用于将所述网关IP地址和所述浮动IP进行绑定;
处理单元,用于根据浮动IP接口,处理所述浮动IP。
具体的,所述获取单元包括:
接收模块,用于接收设置路由网关请求信息;
创建模块,用创建与所述路由网关请求信息对应的虚拟网络接口;
获取模块,用于根据所述虚拟网络接口获取所述网关IP地址。
进一步地,所述获取单元,还用于通过所述浮动IP接口,获取所述浮动IP。
具体的,所述生成单元,具体用于根据所述网关IP地址和浮动端口号生成所述浮动IP。
具体的,所述绑定单元,具体用于将所述网关IP地址、固定端口号和所述浮动IP进行绑定。
本发明实施例提供另一种公网IP处理装置,该装置包括:
一个或多个处理器;和
存储器;
其中所述存储器中存储有指令,经配置所述指令由所述一个或多个处理器执行,所述一个或多个处理器通过执行所述指令能进行如下操作:
获取网关IP地址;
根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;
将所述网关IP地址和所述浮动IP进行绑定;
根据浮动IP接口,处理所述浮动IP。
本发明实施例提供的一种公网IP处理方法及装置,首先获取网关IP地址,然后根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址,再将所述网关IP地址和所述浮动IP进行绑定,最后根据浮动IP接口,处理所述浮动IP。与目前针对公网IP进行的操作需要开发两套接口,即一套接口针对网关IP,一套接口针对浮动IP相比,本发明实施例在对公网IP进行操作时,首先将网关IP地址转换成特殊的浮动IP,该浮动IP中的浮动IP地址和网关IP地址相同,然后将将所述网关IP地址和所述浮动IP进行绑定,最后通过浮动IP接口,处理所述浮动IP。因此通过本发明可以直接调用针对浮动IP开发的接口,操作这个特殊的浮动IP,即通过网关IP生成的浮动IP,从而本发明仅通过浮动IP接口就可以完成浮动IP和网关IP的操作,避免了针对网关IP开发的接口,减少对公网IP处理时所产生的额外工作量。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作以简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种公网IP处理方法流程图;
图2为本发明实施例提供的另一种公网IP处理方法流程图;
图3为本发明实施例提供的一种公网IP处理装置的结构框图;
图4为本发明实施例提供的另一种公网IP处理装置的结构框图;
图5为本发明实施例提供的一种服务器的实体结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种公网IP处理方法,如图1所示,具体步骤包括:
101、获取网关IP地址。
其中,网关IP地址实质上是一个网络通向其他网络的IP地址,并且网关IP地址是固定的IP地址。需要说明的是,在OpenStack(开源的云计算管理平台项目)管理的网络当中,网关IP地址和浮动IP同属于公网IP(Public IP),OpenStack默认的实现方法是将网关IP和浮动IP区别对待,针对它们有各自的操作接口,比如操作网关IP用路由的接口,操作浮动IP用浮动IP的接口。
102、根据所述网关IP地址生成浮动IP。
其中,所述浮动IP中的浮动IP地址为所述网关IP地址。需要说明的是,浮动IP的格式为(浮动IP地址,浮动portID,固定IP地址,固定portID),其中,浮动portID为浮动端口号,固定portID为固定端口号,浮动端口号和固定端口号是在设置公网IP时,系统自动分配的。
例如,获取到的网关IP地址为10.11.1.254,则根据所述网关IP地址生成的浮动IP具体为(10.11.1.254,11111,null,null),需要说明的是,浮动IP中的10.11.1.254表示的是浮动IP地址,11111表示的是浮动端口号,而之后的两个值的位置分别表示固定IP地址和固定portID,两个空值的位置用于后续绑定网关IP地址。
103、将所述网关IP地址和所述浮动IP进行绑定。
在本发明实施例中,将网关IP地址和所述浮动IP进行绑定就是将网 关IP地址和固定接口号对应填入到生成的浮动IP中。例如,生成的浮动IP为(10.11.1.254,11111,null,null),则将所述网关IP地址和所述浮动IP进行绑定后,浮动IP具体可以为(10.11.1.254,11111,10.11.1.254,22222)。通过上述例子可看出,将网关IP地址和所述浮动IP进行绑定后,浮动IP中的浮动IP地址和固定IP地址是相同的,均为网关IP地址。从而可以在后续步骤中,可以通过浮动IP接口操作生成的浮动IP,即通过浮动IP接口就可以实现操作网关IP地址。
104、根据浮动IP接口,处理所述浮动IP。
需要说明的是,处理所述浮动IP具体可以为设置浮动IP的带宽、统计浮动IP的流量、增加功能等,本发明实施例不做具体限定。
对于本发明实施例,可以应用的场景如下所示,但不仅限于此,包括:若需要统计OpenStack中公网IP对应的流量,则需要分别统计网关IP下对应的流量和浮动IP下对应的流量,然后根据网关IP下对应的流量与浮动IP下对应的流量的和得到公网IP对应的流量。对于浮动IP下的流量,可以直接通过浮动IP接口获取浮动IP流量,而统计网关IP流量,则首先需要将网关IP转换成一个浮动IP,该浮动IP中的浮动IP地址为网关IP地址,然后将浮动IP和网关IP地址进行绑定,最后通过浮动接口调取生成的浮动IP,实现以浮动接口获取网关IP对应的流量,而无需再创建与网关IP对应的接口实现获取网关IP对应的流量,从而通过本发明减少了统计公网IP流量时所产生的额外工作量。
与上述方法相对应地,本发明实施例还提供了一种公网IP处理方法,如图2所示,具体步骤包括:
201、获取网关IP地址。
对于本发明实施例,所述获取网关IP地址包括:接收设置路由网关请求信息;创建与所述路由网关请求信息对应的虚拟网络接口;根据所述虚拟网络接口获取所述网关IP地址。
202、根据所述网关IP地址和浮动端口号生成浮动IP。
其中,所述浮动IP中的浮动IP地址为所述网关IP地址,由于浮动IP的格式为(浮动IP地址,浮动portID,固定IP地址,固定portID),因此在生成浮动IP时,还需要获取浮动端口号,然后据所述网关IP地址和 浮动端口号生成浮动IP。需要说明的是,所述浮动端口号是系统自动生成的,可以直接获取。例如,获取到的网关IP地址为10.11.1.151,浮动端口号为11111,则根据网关IP地址和浮动端口号生成的浮动IP具体为(10.11.1.151,11111,null,null)。
203、将所述网关IP地址、固定端口号和所述浮动IP进行绑定。
例如,获取到的网关IP地址为10.11.1.112,浮动端口号为11111,则根据所述网关IP地址和浮动端口号生成的浮动IP具体为(10.11.1.112,11111,null,null),若固定端口号为22222,将所述网关IP地址、固定端口号和所述浮动IP进行绑定后,浮动IP具体为(10.11.1.112,11111,10.11.1.112,22222)。
需要说明的是,浮动IP中的第一个IP地址10.11.1.112表示的是浮动IP地址,11111表示的是浮动端口号,浮动IP中后一个IP地址10.11.1.112表示的是固定IP地址,22222表示的是固定端口号。
204、通过浮动IP接口,获取所述浮动IP。
205、根据所述浮动IP接口,处理所述浮动IP。
对于本发明实施例,在对公网IP进行操作时,对于公网中的浮动IP可以通过浮动IP接口进行处理,而对于公网中的网关IP地址的处理,则首先需要根据网关IP地址和固定端口号生成浮动IP,生成的浮动IP中的浮动IP地址和网关IP地址相同,然后将生成的浮动IP和网关IP地址、固定端口号进行绑定,最后针对浮动IP开发的接口,操作这个根据网关IP地址和固定端口号生成浮动IP,从而本发明仅通过浮动IP接口就可以完成浮动IP和网关IP的操作,避免了针对网关IP开发的接口,减少对公网IP处理时所产生的额外工作量。
进一步的,作为对上述方法的实现,本发明实施例提供了一种公网IP处理装置,如图3所示,该装置包括:获取单元,生成单元,绑定单元,处理单元;
获取单元31,用于获取网关IP地址;
生成单元32,用于根据所述获取单元31获取的网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址。其中,网关IP地址实质上是一个网络通向其他网络的IP地址,并且网关IP地址是固定的 IP地址。需要说明的是,在OpenStack(开源的云计算管理平台项目)管理的网络当中,网关IP地址和浮动IP同属于公网IP(Public IP),OpenStack默认的实现方法是将网关IP和浮动IP区别对待,针对它们有各自的操作接口,比如操作网关IP用路由的接口,操作浮动IP用浮动IP的接口。
绑定单元33,用于将所述网关IP地址和所述生成单元32生成的浮动IP进行绑定;浮动IP的格式为(浮动IP地址,浮动portID,固定IP地址,固定portID),其中,浮动portID为浮动端口号,固定portID为固定端口号,浮动端口号和固定端口号是在设置公网IP时,系统自动分配的。
处理单元34,用于根据浮动IP接口,处理所述浮动IP。处理所述浮动IP具体可以为设置浮动IP的带宽、统计浮动IP的流量、增加功能等,本发明实施例不做具体限定。
进一步地,所述获取单元31包括:
接收模块311,用于接收设置路由网关请求信息。
创建模块312,用创建与所述接收模块311接收的路由网关请求信息对应的虚拟网络接口。
获取模块313,用于根据所述创建模块312创建的虚拟网络接口获取所述网关IP地址。
所述获取单元31,还用于通过所述浮动IP接口,获取所述浮动IP。
所述生成单元32,具体用于根据所述网关IP地址和浮动端口号生成所述浮动IP。由于浮动IP的格式为(浮动IP地址,浮动portID,固定IP地址,固定portID),因此在生成浮动IP时,还需要获取浮动端口号,然后据所述网关IP地址和浮动端口号生成浮动IP。需要说明的是,所述浮动端口号是系统自动生成的,可以直接获取。例如,获取到的网关IP地址为10.11.1.151,浮动端口号为11111,则根据网关IP地址和浮动端口号生成的浮动IP具体为(10.11.1.151,11111,null,null)。
所述绑定单元33,具体用于将所述网关IP地址、固定端口号和所述浮动IP进行绑定。例如,获取到的网关IP地址为10.11.1.112,浮动端口号为11111,则根据所述网关IP地址和浮动端口号生成的浮动IP具体为(10.11.1.112,11111,null,null),若固定端口号为22222,将所述网关IP地址、固定端口号和所述浮动IP进行绑定后,浮动IP具体为 (10.11.1.112,11111,10.11.1.112,22222)。
综上所述,本发明实施例提供的一种公网IP处理方法及装置,首先获取网关IP地址,然后根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址,再将所述网关IP地址和所述浮动IP进行绑定,最后根据浮动IP接口,处理所述浮动IP。与目前针对公网IP进行的操作需要开发两套接口,即一套接口针对网关IP,一套接口针对浮动IP相比,本发明实施例在对公网IP进行操作时,首先将网关IP地址转换成特殊的浮动IP,该浮动IP中的浮动IP地址和网关IP地址相同,然后将将所述网关IP地址和所述浮动IP进行绑定,最后通过浮动IP接口,处理所述浮动IP。因此通过本发明可以直接调用针对浮动IP开发的接口,操作这个特殊的浮动IP,即通过网关IP生成的浮动IP,从而本发明仅通过浮动IP接口就可以完成浮动IP和网关IP的操作,避免了针对网关IP开发的接口,减少对公网IP处理时所产生的额外工作量。
需要说明的是,针对上述公网IP处理装置,凡是本发明实施例中使用到的各个单元模块的功能都可以通过硬件处理器(hardware processor)来实现。
示例性的,如图5所示,图5示出了本发明实施例提供的一种服务器的实体结构示意图,该服务器可以包括:处理器(processor)51、通信接口(Communications Interface)52、存储器(memory)53和总线54,其中,处理器51、通信接口52、存储器53通过总线54完成相互间的通信。通信接口52可以用于服务器与客户端之间的信息传输。处理器51可以调用存储器53中的逻辑指令,以执行如下方法:获取网关IP地址;根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;将所述网关IP地址和所述浮动IP进行绑定;根据浮动IP接口,处理所述浮动IP。
此外,上述的存储器53中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是 个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (11)

  1. 一种公网IP处理方法,其特征在于,包括:
    获取网关IP地址;
    根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;
    将所述网关IP地址和所述浮动IP进行绑定;
    根据浮动IP接口,处理所述浮动IP。
  2. 根据权利要求1所述的方法,其特征在于,所述获取网关IP地址包括:
    接收设置路由网关请求信息;
    创建与所述路由网关请求信息对应的虚拟网络接口;
    根据所述虚拟网络接口获取所述网关IP地址。
  3. 根据权利要求2所述的方法,其特征在于,所述根据浮动IP接口,处理所述浮动IP地址之前,所述方法还包括:
    通过所述浮动IP接口,获取所述浮动IP。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述网关IP地址生成浮动IP包括:
    根据所述网关IP地址和浮动端口号生成所述浮动IP。
  5. 根据权利要求4所述的方法,其特征在于,所述将所述网关IP地址和所述浮动IP进行绑定包括:
    将所述网关IP地址、固定端口号和所述浮动IP进行绑定。
  6. 一种公网IP处理装置,其特征在于,包括:
    获取单元,用于获取网关IP地址;
    生成单元,用于根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;
    绑定单元,用于将所述网关IP地址和所述浮动IP进行绑定;
    处理单元,用于根据浮动IP接口,处理所述浮动IP。
  7. 根据权利要求6所述的装置,其特征在于,所述获取单元包括:
    接收模块,用于接收设置路由网关请求信息;
    创建模块,用创建与所述路由网关请求信息对应的虚拟网络接口;
    获取模块,用于根据所述虚拟网络接口获取所述网关IP地址。
  8. 根据权利要求7所述的装置,其特征在于,
    所述获取单元,还用于通过所述浮动IP接口,获取所述浮动IP。
  9. 根据权利要求8所述的装置,其特征在于,
    所述生成单元,具体用于根据所述网关IP地址和浮动端口号生成所述浮动IP。
  10. 根据权利要求9所述的装置,其特征在于,
    所述绑定单元,具体用于将所述网关IP地址、固定端口号和所述浮动IP进行绑定。
  11. 一种公网IP处理装置,其特征在于,包括:
    一个或多个处理器;和
    存储器;
    其中所述存储器中存储有指令,经配置所述指令由所述一个或多个处理器执行,所述一个或多个处理器通过执行所述指令能进行如下操作:
    获取网关IP地址;
    根据所述网关IP地址生成浮动IP,所述浮动IP中的浮动IP地址为所述网关IP地址;
    将所述网关IP地址和所述浮动IP进行绑定;
    根据浮动IP接口,处理所述浮动IP。
PCT/CN2016/088867 2015-12-14 2016-07-06 公网ip处理方法及装置 WO2017101367A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/246,517 US20170171150A1 (en) 2015-12-14 2016-08-24 Method and apparatus for processing public ip

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510926345.4 2015-12-14
CN201510926345.4A CN105872120A (zh) 2015-12-14 2015-12-14 公网ip处理方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/246,517 Continuation US20170171150A1 (en) 2015-12-14 2016-08-24 Method and apparatus for processing public ip

Publications (1)

Publication Number Publication Date
WO2017101367A1 true WO2017101367A1 (zh) 2017-06-22

Family

ID=56624047

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/088867 WO2017101367A1 (zh) 2015-12-14 2016-07-06 公网ip处理方法及装置

Country Status (2)

Country Link
CN (1) CN105872120A (zh)
WO (1) WO2017101367A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241460B (zh) * 2017-06-30 2020-06-23 联想(北京)有限公司 一种浮动地址的处理方法及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090265493A1 (en) * 2008-04-16 2009-10-22 Mendu Krishna R Efficient Architecture for Interfacing Redundant Devices to a Distributed Control System
CN103036701A (zh) * 2012-04-01 2013-04-10 浙江宇视科技有限公司 一种跨网段的n+1备用方法及装置
CN103036702A (zh) * 2012-04-01 2013-04-10 浙江宇视科技有限公司 一种跨网段的n+1备份方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100442791C (zh) * 2005-01-07 2008-12-10 华为技术有限公司 使用浮动ip地址提高数据通信可靠性的方法
US20130238785A1 (en) * 2012-03-06 2013-09-12 Rackspace Us, Inc. System and Method for Metadata Discovery and Metadata-Aware Scheduling
US9471356B2 (en) * 2013-06-12 2016-10-18 Dell Products L.P. Systems and methods for providing VLAN-independent gateways in a network virtualization overlay implementation
WO2015147859A1 (en) * 2014-03-28 2015-10-01 Hewlett-Packard Development Company, L.P. Reconciling information in a controller and a node
CN104270464A (zh) * 2014-10-22 2015-01-07 西安未来国际信息股份有限公司 一种云计算虚拟化网络架构及优化方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090265493A1 (en) * 2008-04-16 2009-10-22 Mendu Krishna R Efficient Architecture for Interfacing Redundant Devices to a Distributed Control System
CN103036701A (zh) * 2012-04-01 2013-04-10 浙江宇视科技有限公司 一种跨网段的n+1备用方法及装置
CN103036702A (zh) * 2012-04-01 2013-04-10 浙江宇视科技有限公司 一种跨网段的n+1备份方法及装置

Also Published As

Publication number Publication date
CN105872120A (zh) 2016-08-17

Similar Documents

Publication Publication Date Title
JP6335363B2 (ja) 仮想クラウドインフラストラクチャへの仮想セキュリティ装置アーキテクチャの提供
US11695731B2 (en) Distributed identity-based firewalls
US10320674B2 (en) Independent network interfaces for virtual network environments
US10664301B2 (en) Methods and systems for establishing connections associated with virtual machine migrations
US9124536B2 (en) Managing data flows in overlay networks
US10038665B2 (en) Reducing broadcast flooding in a software defined network of a cloud
US11095716B2 (en) Data replication for a virtual networking system
US11362947B2 (en) Interconnecting multiple separate openflow domains
US20180006930A1 (en) Virtual extensible lan intercommunication mechanism for multicast in networking
US9225631B2 (en) Implementation of protocol in virtual link aggregate group
US20150139037A1 (en) Configuration of transparent interconnection of lots of links (trill) protocol enabled device ports in edge virtual bridging (evb) networks
CN110798341A (zh) 业务开通方法、装置及系统
US20150063108A1 (en) Openflow switch mode transition processing
WO2017101367A1 (zh) 公网ip处理方法及装置
US20170171150A1 (en) Method and apparatus for processing public ip
WO2023205003A1 (en) Network device level optimizations for latency sensitive rdma traffic
WO2019091284A1 (zh) 设备升级方法及装置
US9258273B2 (en) Duplicating packets efficiently within a network security appliance
WO2015117380A1 (zh) 一种远程桌面协议网关进行路由交换的方法、设备及系统
CN114979128A (zh) 跨区域通信方法、装置及电子设备
RU2014117681A (ru) Способ доступа к логическим системам сети с использованием программных сервисных запросов
CN109428823B (zh) 基于NFV实现多Data Plane的NAT资源自适应分配转换的系统及方法
WO2023205004A1 (en) Customized processing for different classes of rdma traffic
WO2022271990A1 (en) Routing policies for graphical processing units
EP4360279A1 (en) Routing policies for graphical processing units

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

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

Country of ref document: EP

Kind code of ref document: A1