Content of the invention
The application provides a kind of distribution method of IP address, is applied to service server, including:
Determine the physical location information of the service server and the port information of designated port;Wherein, described specified
Port refers to the port of present application IP address;
An IP address is obtained using the physical location information and the port information;
The IP address of acquisition is distributed to the designated port.
The process for being obtained an IP address using the physical location information and the port information, is specifically included:
From local search maximum port number, maximum traffic number of servers;
Using the physical location information, the port information, the maximum port number, the maximum traffic server
Quantity, obtains an IP address.
The physical location information includes:The frame mark of service server place frame, the service server
Groove bit-identify in the frame;The port information includes:The designated port is unique on the service server
Mark.
Described using the physical location information, the port information, described maximum port number, the maximum traffic clothes
Business device quantity, obtains the process of an IP address, specifically includes:
IP address is obtained using equation below:Initial ip address+(R*MaxS*M+S*M+K);
Wherein, the R is the frame mark of service server place frame, and the MaxS is the maximum traffic clothes
Business device quantity, the M is the maximum port number, and the S is groove bit-identify of the service server in the frame,
The K is the port information.
The process of the physical location information for determining the service server, specifically includes:
Receive the notification message from service server place frame;
The physical location information of the service server is parsed from the notification message.
The application provides a kind of distributor of IP address, is applied to service server, including:
Determining module, for determining the physical location information of the service server and the port information of designated port;
Wherein, the designated port refers to the port of present application IP address;
Module is obtained, for an IP address being obtained using the physical location information and the port information;
Distribute module, for distributing to the designated port by the IP address of acquisition.
The acquisition module, specifically for obtaining an IP ground using the physical location information and the port information
During location, from local search maximum port number, maximum traffic number of servers;
Using the physical location information, the port information, the maximum port number, the maximum traffic server
Quantity, obtains an IP address.
The physical location information that the determining module determines includes:The frame mark of service server place frame
Knowledge, groove bit-identify of the service server in the frame;The port information that the determining module determines includes:Institute
State unique mark of the designated port on the service server.
The acquisition module, specifically for using the physical location information, the port information, the maximum port
Quantity, the maximum traffic number of servers, during obtaining an IP address:
IP address is obtained using equation below:Initial ip address+(R*MaxS*M+S*M+K);
Wherein, the R is the frame mark of service server place frame, and the MaxS is the maximum traffic clothes
Business device quantity, the M is the maximum port number, and the S is groove bit-identify of the service server in the frame,
The K is the port information.
The determining module, specifically for, during the physical location information of the service server is determined, receiving
Notification message from service server place frame;The thing of the service server is parsed from the notification message
Reason positional information.
Based on technique scheme, in the embodiment of the present application, service server can utilize physical location information and specify
The port information of port, is the designated port distribution IP address, rather than random for designated port distribution IP address, so, industry
The IP address that each port assignment of business server is arrived has certain rule, that is, is relatively fixed, and reduces the complexity of management, and
And simple to operate, the service server of manager's rapid deployment batch can be helped.Physical bit confidence due to service server
Breath has corresponding relation with IP address, therefore, it can find physical location information by the IP address of service server is counter.Due to
Service server with oneself distribution IP address, and can distribute IP address without Dynamic Host Configuration Protocol server for service server, so as to disobey
The operation of bad Dynamic Host Configuration Protocol server, unrelated with Dynamic Host Configuration Protocol server, it is independent of the configuration of Dynamic Host Configuration Protocol server.
Specific embodiment
In term used in this application merely for the sake of the purpose for describing specific embodiment, and unrestricted the application.This Shen
Please it is also intended to include most forms with " one kind ", " described " and " being somebody's turn to do " of the singulative used in claims, unless
Context clearly shows that other implications.It is also understood that term "and/or" used herein is referred to comprising one or more
Associated any or all possible combination for listing project.
It will be appreciated that though term first, second, third, etc. may be adopted in the application describe various information, but this
A little information should not necessarily be limited by these terms.These terms are only used for same type of information is distinguished from each other out.For example, without departing from
In the case of the application scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on linguistic context, additionally, used word " if " can be construed to " and ... when " or " when ... when "
Or " in response to determining ".
As shown in figure 1, the deployment architecture schematic diagram for the service server in data center.In large-scale data center,
A large number of services server would generally be placed in frame, each service server is located on a groove position of frame.For convenience
Management, each frame all has unique frame mark (i.e. shelf number), and each the groove position in frame all has unique groove position to mark
Know (i.e. slot number).Therefore, it can uniquely represent the physical bit of a service server by frame mark and groove bit-identify
Put, i.e. the physical location information of service server includes:The frame mark of service server place frame, service server are in machine
Groove bit-identify on frame.In FIG, the physical location information of service server 1 is frame 0 and groove position 0, service server 2
Physical location information is frame 0 and groove position 1, and by that analogy, the physical location information of service server 8 is frame 0 and groove position 7,
The physical location information of service server 9 is frame 1 and groove position 0, by that analogy.
On each service server, one or more port, such as NIC (Network can be included
Interface Card, network adapter) (Baseboard Management Controller, substrate is managed for port and BMC
Controller) port etc., and service server needs to apply for IP address for these ports.Mistake in traditional dynamic application IP address
Cheng Zhong, service server be the application of these ports to IP address be unordered in a jumble, these IP address do not have any rule can
Speech.For example, the IP address of the port 1 of service server 1 is 100.1.1.3, and the IP address of port 2 is 100.1.1.200, port
3 IP address is 100.1.2.123.
For above-mentioned discovery, a kind of distribution method of IP address in the embodiment of the present application, is proposed, the method can be applied
On service server.Shown in Figure 2, it is the flow chart of the distribution method of the IP address.
Step 201, determines the physical location information of this service server and the port information of designated port.
In one example, it is intended that port refers to the port of present application IP address.The physical location information can include:
The frame mark of this service server place frame, groove bit-identify of this service server in the frame.The port information can
To include:Unique mark of the designated port on the service server.
Step 202, obtains an IP address using the physical location information and the port information.
Step 203, the IP address of acquisition is distributed to the designated port.
For step 201, service server first determines the physical location of this service server when needing to apply for IP address
Information.For the process of the physical location information for determining this service server, can include:Service server is received from this industry
The notification message of business server place frame, and the physical location information of this service server is parsed from the notification message.
As shown in figure 1, frame 0 can be by physical location information (the frame mark as 1 place frame of service server of service server 1
Know the groove bit-identify (groove position 0) of (frame 0), service server 1 in the frame 0 etc.) it is added in notification message, and this is led to
Knowing that message is sent to service server 1, frame 0 and groove position 0 is parsed from the notification message by service server 1.Certainly, exist
In practical application, it is not limited to which frame 0 notifies the mode of physical location information, service server 1 can also adopt other sides
Formula obtains the physical location information of itself, without limitation.
In one example, the physical location information of service server 1 can be sent to service server 1 by frame 0
Physical location information is sent to by BMC (Baseboard Management Controller, baseboard management controller) by BMC
The BIOS (Basic Input Output System, basic input-output system) of service server 1 and OS (Operating
System, operating system).So, BMC, BIOS, OS of service server 1 can all know the physical location of service server 1
Information.When the BMC of service server 1 needs to apply for IP address for port, BMC can know physical location information.Work as business
When the BIOS of server 1 needs to apply for IP address for port, BIOS can know physical location information.When service server 1
When OS needs to apply for IP address for port, OS can know physical location information.
For step 201, in one example, service server is during the port information of designated port is determined,
The port information can include unique mark of the designated port on this service server.For example, this service server includes 8
Individual port, is this 8 port numberings, then the mark of this 8 ports can be respectively port 0- port 7.Based on this, it is assumed that current
Need to apply for IP address for port 5, then designated port is port 5, and service server determines the port information for port 5.
For step 202, in one example, an IP is obtained for using the physical location information and the port information
The process of address, can include:Service server is from local search maximum port number and maximum traffic number of servers.
Service server utilizes the physical location information, the port information, the maximum port number, the maximum traffic number of servers,
Obtain an IP address.
Wherein it is possible to configure maximum port number in advance on service server, the maximum port number may refer to:Institute
The maximum of the port number of all service servers on organic frame.For example, as shown in figure 1, when service server 1 includes 8
Individual port, when service server 2- service server 14 is all comprising 6 ports, then all service servers on institute's organic frame
The maximum of port number is 8, and therefore, maximum port number can be 8.When the maximum port number of hypothesis is 8, then due to industry
Business server can be that an IP address is applied in a port of itself or multiple ports, therefore, on institute's organic frame
For all service servers, at most only can apply for 8 IP address, will not apply for more than 8 IP address.
Wherein it is possible to configure maximum traffic number of servers, the maximum traffic server count in advance on service server
Amount may refer to:The maximum of the service server quantity on institute's organic frame.For example, when frame 0 includes 8 service servers,
When frame 1 is comprising 6 service servers, then the maximum of the service server quantity on institute's organic frame is 8, therefore most great cause
Business number of servers can be 8.When hypothesis maximum traffic number of servers is 8, for institute's organic frame, at most only 8
Service server application IP address.
In one example, service server is using physical location information, port information, maximum port number, most great cause
Business number of servers, obtains the process of an IP address, can include but is not limited to:IP address is obtained using equation below:Just
Beginning IP address+(R*MaxS*M+S*M+K).Wherein, the R is identified for the frame of service server place frame, and the MaxS is maximum
Service server quantity, the M is maximum port number, and it is port that the S is groove bit-identify of the service server in frame, the K
Information.
Wherein, initial ip address can be configured according to practical situation, for example, it is possible to configure initial ip address be
100.1.1.3.On this basis, as shown in figure 1, being the process that IP address is distributed in port 0 for service server 1, then R is 0,
MaxS be 8, M be 8, S be 0, K be 0, therefore, the IP address of acquisition be.It is 1 point of port for service server 1
Join the process of IP address, then R be 0, MaxS be 8, M be 8, S be 0, K be 1, therefore, the IP address of acquisition be.With
This analogizes, and service server 1 is respectively 100.1.1.3-100.1.1.10 for the IP address of 8 port assignment.Take for business
Business device 2 be port 0 distribute IP address process, then R be 0, MaxS be 8, M be 8, S be 1, K be 0, therefore, the IP address of acquisition
For 100.1.1.11, by that analogy.Said process has been merely given as the example of several distribution IP address, distributes for other
Journey, similar with this process, will not be described here.Through the IP address of aforesaid way distribution, for each service server,
Multiple IP address that the service server is assigned to are continuous IP address, with certain rule, and are relatively fixed.
In the embodiment of the present application, for above-mentioned formula, frame mark, groove bit-identify, port information are all to start to compile from 0
Number, if frame mark, groove bit-identify, port information are not from 0 open numbering, above-mentioned formula can also be modified.Example
Such as, when frame mark is from 1 open numbering, then above-mentioned formula can be revised as:Initial ip address+[(R-1) * MaxS*M+S*M+
K].When frame mark and groove bit-identify are all from 1 open numbering, then above-mentioned formula can be revised as:Initial ip address+[(R-
1)*MaxS*M+(S-1)*M+K].When frame mark, groove bit-identify and port information are all from 1 open numbering, then above-mentioned formula
Can be revised as:Initial ip address+[(R-1) * MaxS*M+ (S-1) * M+ (K-1)].Certainly, in above process, it is merely given as
The acquisition pattern of several IP address, in actual applications, can also adopt alternate manner to obtain IP address, the embodiment of the present application
Without limitation, illustrate by taking above-mentioned formula as an example.
In one example, after IP address is obtained using above-mentioned formula, it is contemplated that full 0 and complete 1 address can not use,
If therefore obtaining full 0 or complete 1 IP address, the IP address for obtaining can also be adjusted.For example, it is possible to advance for
Several IP address, after the IP address of full 0 or complete 1 is obtained, then select an available IP address from the IP address for retaining,
To replace currently available IP address.
In one example, service server is it may also be determined that the port number of the machine, and compare the port number with pre-
The maximum port number for first configuring.If the port number is more than the maximum port number, the maximum port for configuring before illustrating
There is mistake in quantity, notify the maximum port number of manager's modification configuration.
In one example, it is assumed that in frame, maximum open ended service server quantity is 40, in each service server
On, maximum configurable port number is 12, then MaxS is 12 for 40, M.If by address field 10.0.0.0~
10.255.255.255 the port of service server is distributed in the 10.128.0.0~10.207.255.255 address in, and to every
Individual 0~255 address field, only using 240 addresses such as XXX.12~XXX.251, then can support 80*256*240/ (40*12)
=10240 service servers, this can meet address use.
For step 203, in one example, service server is after IP address is obtained, it is possible to by the IP of the acquisition
The designated port is distributed in address, and so, the designated port can be to send message using the IP address.
Based on technique scheme, in the embodiment of the present application, service server can utilize physical location information and specify
The port information of port, is the designated port distribution IP address, rather than random for designated port distribution IP address, so, industry
The IP address that each port assignment of business server is arrived has certain rule, that is, is relatively fixed, and reduces the complexity of management, and
And simple to operate, the service server of manager's rapid deployment batch can be helped.Physical bit confidence due to service server
Breath has corresponding relation with IP address, therefore, it can find physical location information by the IP address of service server is counter.Due to
Service server with oneself distribution IP address, and can distribute IP address without Dynamic Host Configuration Protocol server for service server, so as to disobey
The operation of bad Dynamic Host Configuration Protocol server, unrelated with Dynamic Host Configuration Protocol server, it is independent of the configuration of Dynamic Host Configuration Protocol server.
Conceived based on the application same with said method, the embodiment of the present application also provides a kind of distributor of IP address,
Apply on service server.The distributor of the IP address can be realized by software, it is also possible to by hardware or software and hardware
In conjunction with mode realize.As a example by implemented in software, as the device on a logical meaning, it is the business service being located by which
The processor of device, in reading non-volatile storage, corresponding computer program instructions are formed.From for hardware view, such as scheme
Shown in 3, it is a kind of hardware structure diagram of the service server at the distributor place of the IP address that the application is proposed, except Fig. 3
Outside shown processor, nonvolatile memory, the service server can also include other hardware, such as be responsible for process message
Forwarding chip, network interface, internal memory etc.;For from hardware configuration, the service server is also possible to be distributed apparatus, may
Including multiple interface cards, to carry out the extension of Message processing in hardware view.
As shown in figure 4, the structure chart of the distributor of the IP address for proposing for the application, the device includes:
Determining module 11, for determining the physical location information of the service server and the port letter of designated port
Breath;Wherein, the designated port refers to the port of present application IP address;
Module 12 is obtained, for an IP address being obtained using the physical location information and the port information;
Distribute module 13, for distributing to the designated port by the IP address of acquisition.
The acquisition module 12, specifically for obtaining an IP using the physical location information and the port information
During address, from local search maximum port number, maximum traffic number of servers;
Using the physical location information, the port information, the maximum port number, the maximum traffic server
Quantity, obtains an IP address.
The physical location information that the determining module 11 determines includes:The frame of service server place frame
Mark, groove bit-identify of the service server in the frame;The port information bag that the determining module 11 determines
Include:Unique mark of the designated port on the service server.
The acquisition module 12, specifically for using the physical location information, the port information, the maximum end
Mouth quantity, the maximum traffic number of servers, during obtaining an IP address:
IP address is obtained using equation below:Initial ip address+(R*MaxS*M+S*M+K);
Wherein, the R is the frame mark of service server place frame, and the MaxS is the maximum traffic clothes
Business device quantity, the M is the maximum port number, and the S is groove bit-identify of the service server in the frame,
The K is the port information.
In one example, the determining module 11, specifically in the physical bit confidence for determining the service server
During breath, the notification message from service server place frame is received;Institute is parsed from the notification message
State the physical location information of service server.
Through the above description of the embodiments, those skilled in the art can be understood that the application can be by
Software adds the mode of required general hardware platform to realize, naturally it is also possible to by hardware, but in many cases the former be more
Good embodiment.Based on such understanding, the technical scheme of the application is substantially contributed to prior art in other words
Part can be embodied in the form of software product, and the computer software product is stored in a storage medium, if including
Dry instruction is used so that a computer equipment (can be personal computer, server, or network equipment etc.) executes this Shen
Method that please be described in each embodiment.It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment,
Module or flow process in accompanying drawing is not necessarily implemented necessary to the application.
It will be appreciated by those skilled in the art that module in device in embodiment can be carried out point according to embodiment description
It is distributed in the device of embodiment, it is also possible to carry out respective change and be disposed other than in one or more devices of the present embodiment.On
The module for stating embodiment can merge into a module, can also be further split into multiple submodule.Above-mentioned the embodiment of the present application
Sequence number is for illustration only, does not represent the quality of embodiment.
The several specific embodiments for being only the application disclosed above, but, the application is not limited to this, any ability
What the technical staff in domain can think change should all fall into the protection domain of the application.