Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention is clearer,, the embodiment of the invention is done further explain below in conjunction with accompanying drawing.At this, illustrative examples of the present invention and explanation thereof are used to explain the present invention, but not as to qualification of the present invention.
The embodiment of the invention provides a kind of address distribution method and device thereof.Below in conjunction with accompanying drawing the embodiment of the invention is elaborated.
Embodiment 1
The embodiment of the invention provides a kind of address distribution method; As shown in Figure 1; This method comprises: receive the address request of client transmission and this address request is forwarded to server, this address request comprises that server is the address (step 101) that client provides in advance; If what receive that server returns comprises the address and the Address Confirmation message in the relevant time limit of this address of use, then the relevant time limit in this Address Confirmation message is converted into and act on behalf of the time limit (step 102); To comprise that address and the agent address acknowledge message of acting on behalf of the time limit of using this address are sent to client (step 103); Wherein, this relevant time limit comprises time in rental period, the time of re-renting and at least one in the time of address binding, and this is acted on behalf of the time limit and comprises that the time in rental period of acting on behalf of, agency re-rent at least one in time and the agent address binding time; Act on behalf of the time in rental period be less than or equal to the time in rental period, agency re-rent the time less than the time of re-renting, agent address binding time less than the address binding time.
In the present embodiment, this address can be the IP address.
In the present embodiment, the corresponding time in rental period is represented with Lease1 from address that corresponding server obtains; This time of re-renting representes that with T1 this address binding time is represented with T2.Wherein, this server can only provide time in rental period Lease1, and the value of re-renting time T 1 and address binding time T 2 can be calculated according to this time in rental period Lease1, and under the general default situations, this re-rents time T 1 is the half the of this time in rental period Lease1; This address binding time T 2 is 7/8ths of time in rental period Lease1; Perhaps this server can only provide and re-rent time T 1 or address binding time T 2, and time in rental period Lease1 can confirm according to itself and the relation of re-renting time T 1 or T2.Certainly, this server above-mentioned temporal information also can be provided simultaneously or provide wherein two, can confirm according to actual conditions.
In the present embodiment, the time in rental period of acting on behalf of that provides for client is used Lease1 ' expression; This agency uses T1 ' expression the time of re-renting, and this agent address binding time is used T2 ' expression.
For example, in the relevant time limit: Lease1=24 hour, T1=12 hour.Act on behalf of in the time limit: Lease1 '=30 minute, T1 '=15 minute.
In the present embodiment, this address request can adopt DHCP REQUEST message; This Address Confirmation message can adopt DHCP ACK message; This agent address acknowledge message can adopt DHCP ACK message.
Can know by the foregoing description; Through address assignment to client; Make this client can obtain the IP address and act on behalf of the time limit accordingly, and the agency re-rent time T 1 ' less than the server appointment re-rent time T 1, like this; Can be conveniently to the management of client, and effectively alleviate the processing burden of server.
Embodiment 2
The embodiment of the invention provides a kind of address distribution method.As shown in Figure 2, this method comprises:
Step 201, this access device receive the address discovery request message of client transmission and are transmitted to server.
In the present embodiment, this address discovery request message can adopt DHCP DISCOVER message, and client can be broadcasted this DHCP DISCOVER message; After this access device receives this DHCP DISCOVER message, can this DHCP DISCOVER message of clean culture, it is transmitted to corresponding D HCP server.
Step 202 receives this server returns comprise the address and use the message in the relevant time limit of this address.
In the present embodiment, after Dynamic Host Configuration Protocol server receives DHCP DISCOVER message, the relevant time limit that can adopt the DHCPOFFER message to be returned as this client addresses distributed and to use this address.Should be correlated with the time limit can be of embodiment 1, repeats no more here.
In the present embodiment, this Dynamic Host Configuration Protocol server IP address of offering this client and relevant time limit are not that this client is confirmed the address and time limit of using at last.
Below with this relevant time limit be server provide comprise time in rental period Lease1, re-rent time T 1, address binding time T 2 is that example describes.
Step 203, the time limit of should being correlated with converts into acts on behalf of the time limit.
In the present embodiment; This access device can replace the relevant time limit in this DHCP OFFER message with the time limit of acting on behalf of of obtaining in advance, is about to time in rental period Lease1 and replaces to and act on behalf of time in rental period Lease1 ', re-rent time T 1 and replace to that the agency re-rents time T 1 ', address binding time T 2 replaces to agent address binding time T2 '.
In the present embodiment; This act on behalf of the time limit act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', agent address binding time T2 ' can obtain from certificate server, such as aaa server, also can be by the access device configuration management; But be not limited thereto, can confirm according to actual conditions.
In the present embodiment, this access device can be stored this relevant time limit.
Step 204 will comprise the address and use the message of acting on behalf of the time limit of this address to return client.
In the present embodiment, access device can adopt DHCP OFFER message with this client addresses distributed that is that is obtained, and uses the time limit of acting on behalf of of this address to return to client.
When address that client receives and this address corresponding to act on behalf of the time limit be a plurality of the time, at this moment, this client can be selected one of them IP address as its use, such as selecting first address that receives, but is not limited thereto.
Step 205 receives the address request of this client transmission and is transmitted to server, and this address request comprises this address that this client is selected.
In the present embodiment, behind the IP address that this client acquisition server provides, can send address request, like this, this access device is forwarded to server after receiving this address request.
In the present embodiment, this address request can adopt DHCP REQUEST message, and client can be broadcasted this DHCP REQUEST message; After access device receives this DHCP REQUEST message, if this access device is when being switch, can this DHCP REQUEST message of clean culture, it is transmitted to this Dynamic Host Configuration Protocol server.In addition, when being the DHCP detecting devices, also can broadcasting this message and give this Dynamic Host Configuration Protocol server as if this access device.
Step 206 receives this server returns comprise the address and use the Address Confirmation message in the relevant time limit of this address.
In the present embodiment, this Address Confirmation message can adopt DHCP ACK message, and the address in this Address Confirmation message is the address that final assignment is given this client.This IP address can be identical with the address that step 202 receives, also can be inequality; Use the relevant time limit of this address can be identical with the relevant time limit that step 202 receives, also can be different, can confirm according to actual conditions.
Step 207, the time limit of will being correlated with converts into acts on behalf of the time limit.
In the present embodiment, access device can be changed the relevant time limit for acting on behalf of the time limit, and stores the relevant time limit of this server appointment, and is of step 203, repeats no more here.
Step 208 will comprise that address and the agent address acknowledge message of acting on behalf of the time limit of using this address send to client.
In the present embodiment; When client receives this message; Can confirm to use this address to give the address of this client as the server final assignment, this client can be used this IP address access network, and confirms that this relevant time limit is the final time limit with acting on behalf of the time limit.
Step 209 receives the request message of re-renting that client sends.
In the present embodiment, when reaching the agency and re-rent time T 1 ' turn-on time of client, this client can be sent to access device re-rent request message, and this re-rents request message can adopt DHCP REQUEST message.
Like this, this access device can be through whether receiving the request of re-renting to client online detection the whether.Wherein, re-rent when request, can know that this client is online when this access device receives this.In addition; Break down or this client rolls off the production line etc. under the situation at network, access device does not receive the request of re-renting, at this moment; This access device can confirm whether this client is online according to predetermined manner, if not online then announcement server discharges the address of distributing to this client.Therefore, can survey this client effectively by the way, avoid addresses distributed to be taken for a long time, cause the address waste by non-existent client.
In the present embodiment, can confirm that this client is not online through following mode:
First kind of situation: when client turn-on time surpasses the time in rental period; If receiving this number of times of re-renting request continuously, this access device do not surpass preset times; Then this access device can confirm that this client is not online; Announcement server discharges this client address, and deletes the corresponding relevant information of this client.
In the present embodiment, whether this access device can surpass preset times according to confirming not receive this number of times of re-renting request the time of re-renting with the agency turn-on time of this client.Wherein, The turn-on time of this client is for this client obtains moment of the agent address acknowledge message (ACK message) that this access device returns, and do not receive this number of times of re-renting request and be that to re-rent the time according to this turn-on time and agency definite, promptly picks up counting from turn-on time; If reaching the agency since turn-on time does not also receive the request of re-renting then count 1 time the time of re-renting; And the like, if do not receive continuously when this number of times of re-renting request surpasses preset times, but announcement server discharges the address.For example, if Lease1=1 days time in rental period, the agency re-rents time T 1 '=10 minute, and then this access device is in 1 day, if continuous 3 times (being continuous 30 minutes) do not receive the request of re-renting of this client, then announcement server discharges the IP address of this client.
Second kind of situation: surpass the time in rental period when client turn-on time; And this access device does not receive re-renting when asking of this client; This access device can confirm that this client is not online, and announcement server discharges this client address, and deletes the corresponding relevant information of this client.For example, when time in rental period Lease is provided with hour, if also do not receive the request of re-renting that client is sent under the situation of time in rental period Lease surpassing, then announcement server discharges the IP address of this client, and deletes the relevant information of this client.
In addition; If because network failure causes client online and access device can't receive the request of re-renting, normal at network recovery, this access device receives once more that client sends when re-renting request; This access device is if this client of inspection is not online; When promptly there is not the relevant information of this client in inspection, this access device will directly be replied this client NACK (NAK) message, notify this client to discharge addresses distributed; Because in this case, server possibly roll off the production line to other clients or this client of this server requirement this address assignment.
From the above, can survey this client effectively by the way, avoid addresses distributed to be taken for a long time, cause the address waste by non-existent client.
Step 210, whether meet or exceed the turn-on time of confirming this client is re-rented time T 1.
In the present embodiment, this access device receives the request message of re-renting that client sends, and what whether meet or exceed the server appointment turn-on time of confirming client this moment re-rents time T 1, then changes step 219 if meet or exceed; Otherwise change step 211.
Step 211 determines whether to send feedback message.
In the present embodiment, this access device receives that client sends re-rent request after, can send feedback message to client, also can not send feedback message.If confirm to send message, change step 212, otherwise change step 215.
Step 212 determines whether to notify client to discharge this address.
In the present embodiment, if access device confirms that this client need discharge this address, then changes step 213; If this client need not discharge this address, then change step 214.
For example, know operator when this access device and client is rolled off the production line, when this that receives that client sends re-rented request message, notify this client to discharge the address so that change some operation parameter or when obtaining new address.
Step 213 is sent the release address message and is notified this client to discharge this address to client.
In the present embodiment,, then notify this client to discharge this address if access device confirms that this client need discharge this address immediately.Wherein, this release address message can adopt NACK (NAK) message, but is not limited thereto message, also can adopt other message.
Step 214 is returned the agency and is re-rented acknowledge message to client.
In the present embodiment, if access device confirms that this client does not need to discharge immediately this address, then can directly send the agency to client and re-rent acknowledge message, this agency re-rents acknowledge message can adopt DHCP ACK message, comprises the time limit of acting on behalf of of using this address.After client receives that this agency re-rents acknowledge message, upgrade the time limit of acting on behalf of of this address, and can continue to use this address.
Step 215 receives the address binding request message that client is sent.
In the present embodiment, this access device receives that client sends re-rent request message after, also can not send feedback message, this moment, this client still can continue to use this address.When this client reach turn-on time use this address act on behalf of the agent address binding time T2 ' in the time limit time, client can be sent the address binding request message to access device, this address binding request message can adopt DHCP REQUEST message.
Whether step 216 meets or exceeds address binding time T 2 turn-on time of confirming this client.
In the present embodiment, after access device receives the address binding request message of client transmission, confirm whether meet or exceed address binding time T 2 turn-on time of client this moment, then change step 217 if meet or exceed; Otherwise change step 218.
Step 217 is forwarded to server with this address binding request.
In the present embodiment; If access device receives the address binding request message that client is sent; And meet or exceed address binding time T 2 turn-on time of client this moment, and then this access device can adopt DHCP REQUEST message that this address binding request is forwarded to Dynamic Host Configuration Protocol server.
In the present embodiment, after Dynamic Host Configuration Protocol server receives the address binding request, can adopt DHCP ACK message to send the message that comprises this address and use the relevant time limit of this address.After this, the processing of access device and step 206-step 216 are similar, repeat no more here.
Step 218 is returned agent address binding acknowledgement message and is given client.
In the present embodiment; This access device can directly send agent address binding acknowledgement message to this client; This agent address binding acknowledgement message can adopt DHCP ACK message, comprise act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', agent address binding time T2 '.Client is upgraded the time limit of acting on behalf of of this address after receiving this agent address binding acknowledgement message, and can continue to use this address.
In the present embodiment, give client if this access device returns any message, at this moment, this client can reach in the turn-on time of this client to be acted on behalf of when re-renting the time, discharges this IP address, initiates to obtain the process of IP address again.
Step 219 is forwarded to server with this request of re-renting.
In the present embodiment; If access device receives the request message of re-renting of client transmission; And meet or exceed and re-rent time T 1 turn-on time of client at this moment, then this access device can adopt the DHCPREQUEST message that this request of re-renting is forwarded to Dynamic Host Configuration Protocol server.
In the present embodiment, after Dynamic Host Configuration Protocol server receives the request of re-renting, can adopt DHCP ACK message to send the message that comprises this address and use the relevant time limit of this address.After this, the processing of access device and step 206-step 210 are similar, repeat no more here.
Can know by the foregoing description and since this agency re-rent time T 1 ' less than the server appointment re-rent time T 1, when access device receives this when re-renting request message; If this client turn-on time less than this server appointment re-rent time T 1 time, can directly reply client, and not need to give this server forwards; Like this, can reduce the processing burden of server, and; Because T1 ' is less; When operator need make client roll off the production line so that change some operation parameter or obtain new address and when notifying this client to roll off the production line, this that can receive that client sends at this access device sends the NAK message when re-renting request message, makes this client roll off the production line; Like this, be convenient to the management of client.In addition, present embodiment can whether online through receiving the request of re-renting that client sends if surveying this client, taken for a long time by non-existent client to prevent addresses distributed, causes the address waste.
Embodiment 3
The embodiment of the invention provides a kind of address distribution method, and is as shown in Figure 3, and this method comprises: client is sent address request to access device, and this address request comprises that server is the address (step 301) that this client provides in advance; If receive the agent address acknowledge message of acting on behalf of the time limit that comprises address and this address of use that access device returns, confirm that then this address is the address (step 302) of server-assignment; Wherein, Acting on behalf of the time limit comprises that the time in rental period of acting on behalf of, agency re-rent at least one in time and the agent address binding time, and this is acted on behalf of time in rental period, this agency that the time in rental period is less than or equal to the server appointment and re-rents the time less than time of re-renting of server appointment, this agent address binding time address binding time less than the server appointment.
In the present embodiment, this address request can adopt DHCP REQUEST message, and this agent address acknowledge message can adopt DHCP ACK message.Acting on behalf of the time in rental period can adopt Lease1 ' expression, agency's time of re-renting can adopt T1 ' expression, agent address binding time can adopt T2 ' expression.
Can know by the foregoing description, but this client is passed through the access device address acquisition, and the time limit of acting on behalf of of using this address; Wherein, This client obtains less agency and re-rents time T 1 ', makes things convenient for management and detection to client, and effectively alleviates the processing burden of server.
Embodiment 4
The embodiment of the invention provides a kind of address distribution method.As shown in Figure 4, this method comprises:
Step 401, client are sent the address discovery request message to access device.
In the present embodiment, this address discovery request message can adopt DHCP DISCOVER message, and client can be broadcasted this DHCP DISCOVER message; After access device receives this DHCP DISCOVER message, can it be transmitted to corresponding D HCP server.
Step 402 receives the message of acting on behalf of the time limit that comprises address and this address of use that access device returns.
In the present embodiment, this message can adopt DHCP OFFER message, this act on behalf of the time limit can comprise act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ' and agent address binding time T2 '.This is acted on behalf of the time limit and can be obtained from certificate server by access device, such as aaa server, also can be by the access device configuration management, but be not limited thereto, can confirm according to actual conditions.Wherein, this address is not final address and the time limit with acting on behalf of the time limit.
In the present embodiment, client can receive message from one or more access device, and the address that receives can be one or more with the corresponding time limit of acting on behalf of of this address, but is not limited thereto, and can confirm according to actual conditions.
Step 403 is sent address request to access device, and this address request is included as this address that this client is selected.
In the present embodiment, this client can be selected one of them from the address that receives, such as the IP address of selecting first address that receives as its use.Client can adopt DHCP REQUEST message to send address request to the corresponding access device in this IP address.
Step 404 receives the agent address acknowledge message that this access device returns, and this message comprises address and the message of acting on behalf of the time limit of using this address.
In the present embodiment; When client receives the agent address acknowledge message that access device returns; Can confirm to use this address and this address corresponding act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', agent address binding time T2 ', this client is with the IP address of this address as its use.
This IP address can be identical with the IP address that client in the step 403 is selected, also can be different, can confirm according to actual conditions.
Step 405 is confirmed whether to reach turn-on time the agency and is re-rented time T 1 '.
In the present embodiment, when reaching the agency and re-rent time T 1 ' turn-on time of client, this client can be sent to access device re-rent request message, and this re-rents request message can adopt DHCP REQUEST message.If do not reach, then continue to wait for; Otherwise change step 406.
Step 406 is sent and is re-rented request message to access device.
Step 407 determines whether to receive the message that access device returns.
In the present embodiment, if confirm to receive the message that access device returns, then change step 408; If confirm not receive the message that access device returns, then change step 411.
Whether step 408, the message of confirming to receive are to discharge address message still to act on behalf of and re-rent acknowledge message.
In the present embodiment, if the message of confirming to receive is then changeed step 410 for discharging address message; If confirming the message that receives is that the agency re-rents acknowledge message, change step 409.
Step 409 is upgraded the time limit of acting on behalf of of using this address.
In the present embodiment, re-rent acknowledge message for the agency if confirm to receive the message that access device returns, this agency re-rent acknowledge message comprise act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', agent address binding time T2 '.After client receives that this agency re-rents acknowledge message, the time limit of acting on behalf of of this address can be upgraded, and this address can be continued to use.
Step 410 discharges this address.
In the present embodiment, if confirm to receive the message that access device returns, and this message is to discharge address message, and then this client discharges this address.
Step 411 confirms whether reach agent address binding time T2 ' turn-on time.
In the present embodiment,, confirm then whether client reaches agent address binding time T2 ' turn-on time,, then continue to wait for, otherwise change step 412 if do not reach if confirm to connect the message of not receiving that access device returns.
Step 412 is sent the address binding request message and is given access device.
In the present embodiment, when reached agent address binding time T2 ' turn-on time of client, this client can be sent the address binding request message to access device, and this re-rents request message can adopt the DHCPREQUEST message.
Step 413 receives agent address binding acknowledgement message.
In the present embodiment; If confirm to receive the message that access device returns; And this message is not to discharge address message; Then this message can be agent address binding acknowledgement message, this agent address binding acknowledgement message comprise act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', agent address binding time T2 '.
Step 414 is upgraded the time limit of acting on behalf of of using this address.
Client can be upgraded the time limit of acting on behalf of of this address after receiving this agent address binding acknowledgement message, and can continue to use this address.
If do not receive the message that this access device returns, then this client can reach in the turn-on time of this client and discharge this IP address when acting on behalf of the time in rental period, initiates to obtain again the process of IP address.
Can know by the foregoing description, but this client is passed through the access device address acquisition, and the time limit of acting on behalf of of using this address; Wherein, This client obtains less agency and re-rents time T 1 ', makes things convenient for management and detection to client, and effectively alleviates the processing burden of server.
Embodiment 5
The embodiment of the invention provides a kind of address distributing device, and is as shown in Figure 5, and this device comprises Address requests receiving element 501, the first Address Confirmation message sink unit 502, time limit converting unit 503 and Address Confirmation message sending unit 504.
Wherein, this Address requests receiving element 501 is used to receive the address request of client transmission and this address request is forwarded to server, and this address request comprises the address that this server provides for this client in advance; The first Address Confirmation message sink unit 502 is used to confirm to receive this server returns comprise this address and use the Address Confirmation message in the relevant time limit of this address; Time limit converting unit 503 is connected with this first Address Confirmation message sink unit 502, when confirming to receive this Address Confirmation message that this server returns, the relevant time limit in this Address Confirmation message is converted into act on behalf of the time limit; Address Confirmation message sending unit 504 is connected with this time limit converting unit 503, is used for comprising that this address and the agent address acknowledge message of acting on behalf of the time limit of using this address are sent to this client.
Wherein, the relevant time limit comprises time in rental period, the time of re-renting and at least one in the time of address binding, acts on behalf of the time limit to comprise that the time in rental period of acting on behalf of, agency re-rent at least one in time and the agent address binding time; Act on behalf of the time in rental period be less than or equal to the time in rental period, agency re-rent the time less than the time of re-renting, agent address binding time less than the address binding time.
In the present embodiment, this device can be access device, like switch, DHCP detecting devices etc.The workflow of this device such as embodiment 1 are said, repeat no more here.
Can know by the foregoing description, realize address assignment, make this client can obtain less agency and re-rent time T 1 ', make things convenient for management and detection, and effectively alleviate the processing burden of server client to client through this device.
Embodiment 6
The embodiment of the invention provides a kind of address distributing device, and is as shown in Figure 6, and this device comprises Address requests receiving element 501, the first Address Confirmation message sink unit 502, time limit converting unit 503 and Address Confirmation message sending unit 504; Of embodiment 5, repeat no more here.
As shown in Figure 6, this device also comprises memory cell 600, is connected with this first Address Confirmation message sink unit 502, is used for storing the corresponding relevant time limit of address of address acknowledge message.
As shown in Figure 6, this device also comprises address discovery request receiving element 601, first information receiving element 602, information translation unit 603, information transmitting unit 604.Wherein, address discovery request receiving element 601 is used to receive the address discovery request of this client transmission and this address discovery request is forwarded to this server; First information receiving element 602 is used to confirm to receive this server returns comprise this address and use the message in the relevant time limit of this address; Information translation unit 603 is connected with this first information receiving element 602, be used for receive that this server returns comprise this address and use the message in relevant time limit of this address the time, converted into the time limit of acting on behalf of that prestores the relevant time limit in the message; Information transmitting unit 604 is connected with said information translation unit 603, is used for comprising this address and using the message of acting on behalf of the time limit of this address to return this client.
As shown in Figure 6, this device also comprises re-rents request receiving element 605, release notification unit 606.Wherein, re-rent request receiving element 605 and be used to receive the request of re-renting that this client is sent; Release notification unit 606 is re-rented request receiving element 605 with this and is connected, and is used for when confirming to notify this client to discharge this address, notifying this client to discharge the address.
As shown in Figure 6, this device also comprise the very first time confirm unit 607, re-rent the request retransmission unit 608, re-rent acknowledge message transmitting element 609.Wherein, the very first time confirms that unit 607 and this re-rent request receiving element 605 and is connected, is used for definite this client and meets or exceeds the time of re-renting turn-on time; Re-rent request retransmission unit 608 and confirm that with this very first time unit 607 is connected, be used for confirming that in this very first time definite this client in unit 607 meets or exceeds when re-renting the time turn-on time, re-rents this and asks to be forwarded to server; Re-rent acknowledge message transmitting element 609 and confirm that with this very first time unit 607 is connected; Be used for confirming that in this very first time unit 607 confirms that this client does not reach when re-renting the time turn-on time, return that the agency re-rents acknowledge message or not to these client return messages to client;
Wherein, this agency re-rents and comprises this address and the time limit of acting on behalf of of using this address in the acknowledge message.
As shown in Figure 6, this device comprises that also bind request receiving element 610, second time confirms unit 611, bind request retransmission unit 612, binding acknowledgement message sending unit 613.Wherein, bind request receiving element 610 with re-rent acknowledge message transmitting element 609 and be connected, be used for when this re-rents acknowledge message transmitting element 609 not to the client return messages, receive the heavy bind request in address that this client is sent; Second time confirmed that unit 611 was connected with bind request receiving element 610, was used for confirming that client meets or exceeds binding time turn-on time; Bind request retransmission unit 612 confirms that with second time unit 611 is connected, and when being used for confirming that in this second time unit 611 confirms that client meets or exceeds binding time turn-on time, the heavy bind request in this address is forwarded to server; Binding acknowledgement message sending unit 613 confirms that with second time unit 611 is connected; Be used for confirming that in this second time unit 611 confirms that clients do not reach address binding during the time turn-on time, return agent address binding acknowledgement message or not to these client return messages to client; Wherein, this agent address binding acknowledgement message comprises address and the time limit of acting on behalf of of using this address.
As shown in Figure 6, this device also comprises acknowledge message receiving element 614, the second time limit converting unit 615, acknowledge message transmitting element 616.Wherein, acknowledge message receiving element 614 with re-rent request retransmission unit 608 and be connected with bind request receiving element 610, what be used to confirm to receive relevant time limit that comprises address and this address of use that server returns re-rents acknowledge message and binding acknowledgement message; The second time limit converting unit 615 is connected with acknowledge message receiving element 614, is used for converting the relevant time limit of re-renting acknowledge message and binding acknowledgement message into prestore the time limit of acting on behalf of; Acknowledge message transmitting element 616 is connected with the second time limit converting unit 615, is used for comprising that address and the message of acting on behalf of the time limit of using this address are sent to client.
As shown in Figure 6, this device also comprises dispensing unit 617, and this dispensing unit 617 is used to dispose the said time limit of acting on behalf of; And also being used to store this, memory cell 600 acts on behalf of the time limit.
As shown in Figure 6, this device also comprises information acquisition unit 618, and this information acquisition unit 618 is used for obtaining from certificate server acts on behalf of the time limit; And also being used to store this, memory cell 600 acts on behalf of the time limit.
In the present embodiment, this device also can comprise definite unit, first notification unit and delete cells (not shown); Wherein, this confirms that the unit is used for turn-on time in client during less than this time in rental period, and the number of times of confirming not receive continuously the request of re-renting that this client sends meets or exceeds preset times; Perhaps be used for turn-on time in client during, confirm not receive the request of re-renting that this client is sent greater than this time in rental period; First notification unit; Be used for when this confirms that the unit is confirmed not receive the number of times of the request of re-renting that this client sends and met or exceeded preset times, or confirm that at this unit confirms not receive that this client sends when re-renting request, notify this server to discharge this address; This delete cells is used to delete the relevant information of this client, and this relevant information comprises this client corresponding address and relevant time limit.
In addition; When because the cause of network failure makes this device to receive when re-renting request, after network recovery was normal, this device also can receive the request of re-renting of client transmission; Because this device is deleted the relevant information of this client; Therefore, this device can directly be replied this client NAK message, makes this client discharge the address.
Like this, this device also can comprise the receiving element and the second notification unit (not shown).Wherein, this receiving element is used for notifying this server to discharge said address and this delete cells deletion client after the corresponding relevant time limit at this notification unit, receives the request of re-renting that this client is sent; This second notification unit is used for receiving the relevant information that does not find this client after this re-rents request at this receiving element, notifies this client to discharge this address.
In the present embodiment, this device can be access device, like network equipments such as DHCP relay server, switch, DHCP detecting devices, general packet radio service (GPRS:General Packet Radio Service) routers.The workflow of this device such as embodiment 2 are said, repeat no more here.
In the present embodiment, as shown in Figure 9, when this device is access device, can adopt interface board to realize, and this server adopt external server.Perhaps the time of re-renting can issue appointment through this locality configuration or aaa server to act on behalf of the time in rental period.As shown in Figure 9, the short rental period is re-rented message (less than T1) reply respectively by interface board separately, shown in step 901, re-rent message for the short rental period less than T1, interface board 1 is directly replied; The message of normally re-renting of this server appointment is replied through the interface that links to each other with Dynamic Host Configuration Protocol server by this access device, and shown in step 902 and 903, interface board 2 is transmitted the message of re-renting that meets or exceeds T1 that client is sent, and sends feedback message.
In the present embodiment, shown in figure 10, this device also can adopt interface board to realize, and this server adopts the built-in services device.Perhaps the time of re-renting can issue appointment through this locality configuration or aaa server to act on behalf of the time in rental period.Shown in figure 10; Master control borad is realized the function of server; The short rental period is re-rented message (less than T1) is replied respectively by interface board separately; Shown in step 1001 and step 1002, internal server is set normally re-rent message directly and master control borad accomplish re-renting of address alternately, shown in step 1003 and step 1004.
Above-mentioned only is embodiments of the invention, also can adopt alternate manner to realize, repeats no more here.
Can know by the foregoing description; The address of this server is re-rented time T 1 and is set to the value (generally being defaulted as 1 day) that server can bear; This device can be used as the rental period agency of client; The less value of the managerial demand that disposes on according to equipment when re-renting the time in the time in rental period of responding client, this value also can issue appointment with convenient management through aaa server, like this request of user's rental period less than the server appointment re-rent time T 1 time by the direct answer of this device; When time T 1 was re-rented in the address that is greater than or equal to server-assignment, the request of just will renewing a contract of this device was transmitted to server and renews a contract so that realize the address.Therefore, act on behalf of to realize management and detection as the rental period, make the processing of re-renting message decentralized, can effectively alleviate the burden of Dynamic Host Configuration Protocol server dhcp client through this device.
Embodiment 7
The embodiment of the invention provides a kind of address distributing device, and is as shown in Figure 7, and this device comprises that Address requests transmitting element 701, the second Address Confirmation message sink unit 702, address confirm unit 703.
Wherein, Address requests transmitting element 701 is used to send address request to access device, and this address request comprises that server is the address that client provides in advance; The second Address Confirmation message sink unit 702 is used to confirm to receive the agent address acknowledge message of acting on behalf of the time limit that comprises address and this address of use that access device returns; The address confirms that unit 703 is connected with the second Address Confirmation message sink unit 702, is used for when receiving the agent address acknowledge message that access device returns, confirming that this address is the address of server-assignment.
In the present embodiment; This is acted on behalf of the time limit and comprises that the time in rental period of acting on behalf of, agency re-rent at least one in time and the agent address binding time; Wherein, act on behalf of time in rental period, agency that the time in rental period is less than or equal to the server appointment and re-rent the time less than time of re-renting of server appointment, agent address binding time the address binding time less than the server appointment.
In the present embodiment, this device can be client.The workflow of this device such as embodiment 3 are said, repeat no more here.
From the above, but this device passes through the access device address acquisition, and the time limit of acting on behalf of of using this address; Wherein, This client obtains less agency and re-rents time T 1 ', makes things convenient for management and detection to client, and effectively alleviates the processing burden of server.
Embodiment 8
The embodiment of the invention provides a kind of address distributing device, and is as shown in Figure 8, and this device comprises that Address requests transmitting element 701, the second Address Confirmation message sink unit 702, address confirm unit 703.Its effect is similar with embodiment 7, repeats no more here.
As shown in Figure 8, this device also comprises address discovery request transmitting unit 801, second information receiving unit 802.Wherein, address discovery request transmitting unit 801 is used to send the address discovery request to access device; It is this client address that provides and time limit of acting on behalf of of using this address that second information receiving unit 802 is used to receive the server that access device returns.
As shown in Figure 8, this device comprises that also the 3rd time confirmed unit 803, re-rents request transmitting unit 804.Wherein, the 3rd time confirmed that unit 803 was used for confirming reaching the agency and re-renting the time turn-on time of this client; Re-rent request transmitting unit 804 and confirm that with the 3rd time unit 803 is connected, be used for reaching the agency when re-renting the time, send to re-rent and ask to access device in the turn-on time of client.
As shown in Figure 8, this device also comprises re-rents acknowledge message receiving element 805, first information updating block 806.Wherein, re-rent acknowledge message receiving element 805 and re-rent request transmitting unit 804 and be connected, be used to determine whether to receive comprise address and the agency who acts on behalf of the time limit who uses this address that access device returns and re-rent acknowledge message; First information updating block 806 with re-rent acknowledge message receiving element 805 and be connected, be used for upgrading the current time limit of acting on behalf of and re-renting the time limit of acting on behalf of that comprises in the acknowledge message for the agency receiving agency that access device returns when re-renting acknowledge message.
As shown in Figure 8, this device comprises that also the 4th time confirmed unit 807, bind request transmitting element 808.Wherein, The 4th time was confirmed unit 807 and re-rented acknowledge message receiving element 805 and be connected; Do not receive agency that access device returns when re-renting acknowledge message re-renting acknowledge message receiving element 805, reach the said agent binding time turn-on time of confirming client; Bind request transmitting element 808 confirms that with the 4th time unit 807 is connected, and is used for when reach the agent address binding time turn-on time of client, sends the heavy bind request in address to access device.
As shown in Figure 8, this device also comprises: binding acknowledgement message sink unit 809, second information updating unit 810.Wherein, binding acknowledgement message sink unit 809 is connected with bind request transmitting element 808, is used to determine whether to receive the proxy binding acknowledgment messages of acting on behalf of the time limit that comprises address and this address of use that access device returns; Second information updating unit 810 is connected with binding acknowledgement message sink unit 809, is used for when receiving the proxy binding acknowledgment messages that access device returns, and upgrading the current time limit of acting on behalf of is the time limit of acting on behalf of that comprises in the proxy binding acknowledgment messages.
In addition; This device also can comprise the first address releasing unit (not shown), is connected with this binding acknowledgement message sink unit 809, is used for when not receiving the proxy binding acknowledgment messages that this access device returns; When reaching this and act on behalf of the time in rental period the turn-on time of this client, discharge this address.
As shown in Figure 8, this device also comprises: release message receiving element 811, address releasing unit 812.Wherein, release message receiving element 811 with re-rent request transmitting unit 804 and be connected, be used to confirm to receive the message of the release address that access device returns; Address releasing unit 812 is connected with release message receiving element 811, is used for when receiving the message of the release address that access device returns, discharging the address according to this message.
In the present embodiment, this device can be client.The workflow of this device such as embodiment 4 are said, repeat no more here.
Can know by the foregoing description; This device obtains the address of server-assignment through access device; And this address corresponding act on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', agent address binding time T2 '; Like this, this device can use this IP address, and can re-rent time T 1 ' or address binding time T 2 ' is renewed a contract according to the agency.Because this client obtains less agency and re-rents time T 1 ', make things convenient for management and detection, and effectively alleviate the processing burden of server client.
Embodiment 9
The embodiment of the invention also provides a kind of IP address assignment method.Below in conjunction with accompanying drawing 11, Figure 12, be that switch is that example is elaborated to the embodiment of the invention with the access device.Shown in figure 12:
Step 1201, client are sent IP address discovery request to access device; This IP address discovery request is sent with DHCP DISCOVER message;
Step 1202, this access device receives the IP address discovery request that this client is sent, and promptly the DHCPDISCOVER message is forwarded to server with this request;
Step 1203, the relevant time limit that this server is corresponding with IP address and this IP address according to this request, promptly time in rental period Lease1, re-rent in time T 1 and the IP address binding time T 2 at least one send to this server through DHCP OFFER message;
Step 1204; After this access device receives this DHCP OFFER message; Can with this IP address and this IP address pre-configured or that obtain in advance corresponding act on behalf of the time limit, at least one that act on behalf of promptly that time in rental period Lease1 ', agency re-rent in time T 1 ' and the Agent IP address binding time T 2 ' is sent to this client.
In the present embodiment, this act on behalf of that time in rental period Lease1 ', agency re-rent in time T 1 ' and the Agent IP address binding time T 2 ' at least one can dispose in this locality in advance; In addition, also can obtain from aaa server in advance.
When aaa server obtains, can send earlier and insert request Access Request to this aaa server; After this aaa server receives this request, will act on behalf of time in rental period Lease1 ', agency and re-rent in time T 1 ' and the Agent IP address binding time T 2 ' at least one through inserting response message Access
Accept returns to this access device.Then, transmit this DHCP DISCOVER message again to server.
Step 1205, when the IP address that receives and this IP address corresponding to act on behalf of the time limit be a plurality of the time, at this moment, this client can be selected the IP address of first IP address that receives as its use, but is not limited thereto, and also can adopt other.Like this, this client is sent IP address request DHCP REQUEST to this authenticating device, and this IP address request DHCP REQUEST can comprise this IP address of selection;
After step 1206, this access device receive this DHCP REQUEST message, with this DHCP REQUEST forwards to this server;
Step 1207, this server are confirmed to give this client with this IP address assignment, and then this server sends DHCP ACK message to this access device; Otherwise, send the NAK message to this access device;
When step 1208, this access device confirm to receive DHCP ACK message, this message is forwarded to this client, like this, this client obtains IP address allocated.
Obtain the IP address of this server-assignment in this client after, can use this IP address.And every throwback reason is re-rented time T 1 ' and will be sent the request of re-renting to this access device, if this access device judge that this client uses that the time of this IP address surpasses the server appointment re-rent time T 1, then this access device is directly replied this client.If what this access device judged that this client uses that the time of this IP address meets or exceeds the server appointment re-rents time T 1, then this access device is forwarded to server with this request.
Like this, shown in figure 12, this method also comprises:
Step 1209, when this client judged that the time of using this IP address reaches the agency and re-rents time T 1 ', this client was sent and is re-rented request DHCP REQUEST to this access device;
Step 1210, this this client of access device judgement is used the time of this IP address to surpass and is re-rented time T, then can directly reply confirmation message, and promptly DHCP ACK message is to this client; After this client received this message, renewable this acted on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', Agent IP address binding time T 2 '.
Step 1211 is after re-renting, if this client judges that this client was sent once more and re-rented request DHCP REQUEST to this access device when the time of using this IP address reached the agency and re-rents time T 1 ';
Step 1212 at this moment, is used the time of this IP address to meet or exceed and is re-rented time T if this access device is judged this client, then this is re-rented request DHCP REQUEST message and is sent to server;
After step 1213, this server received this DHCP REQUEST message, this server determined whether to accept this and re-rents request, if this server is accepted this and re-rented request, then sent DHCP ACK message to this access device;
Step 1214 after this access device is received this message, is forwarded to this client with this message.After this client obtained this DHCP ACK message, renewable this acted on behalf of time in rental period Lease1 ', the agency re-rents time T 1 ', Agent IP address binding time T 2 ', continued to use this IP address.
In the present embodiment, if for a certain reason, for example; To need and need notify this client to roll off the production line the time in order runing, to send to re-rent when this client in step 1209 and ask to access device, in step 1210; This access device can directly be replied DHCP NAK message, and this client can be known and need roll off the production line after receiving this DHCP NAK message; Then this client is sent DHCP RELEASE message to this access device, comprises the address (seeing step 1215) of distributing to this client in this message; This access device is forwarded to this server with this message after receiving this DHCP RELEASE message, discharges this address (seeing step 1216).
Because to re-rent time T 1 ' less for this agency, for example, is 1 minute, like this, in the time of can needing this client to roll off the production line for a certain reason, can in time notify receiving after this re-rents request.
In addition, if do not re-rent success in the process above-mentioned re-renting, then this client also can be sent the address binding request to this access device when reaching address binding time T 2 '.After this access device receives this address binding request, if do not reach address binding time T 2 turn-on time, can directly send DHCP ACK message and give client, make this client continue to use this address; If meet or exceed address binding time T 2 turn-on time, then can transmit this address binding request to server.Handling process such as embodiment 2 or 4 are said, repeat no more here.
In the present embodiment, when access device was the DHCP detecting devices, the message between access device and the server also can adopt the mode of broadcasting, but is not limited thereto, and can confirm according to actual conditions.
Can know by the foregoing description; If the address of this server is re-rented time T 1 and is set to the value (generally being defaulted as 1 day) that server can bear; This device can be used as the rental period agency of client, the less value of the managerial demand that disposes on according to equipment when re-renting the time in the time in rental period of responding client, and this value also can issue appointment through aaa server and manage with convenient; Like this; The request of rental period of user less than the server appointment re-rent time T 1 time directly reply by this device, when time T 1 is re-rented in the address that is greater than or equal to server-assignment, this device just will be renewed a contract and asked to be transmitted to server so that realization address renewed treaty.Therefore, act on behalf of to realize management and detection as the rental period, make the processing of re-renting message decentralized, can effectively alleviate the burden of Dynamic Host Configuration Protocol server dhcp client through this device.
Above-described specific embodiment; The object of the invention, technical scheme and beneficial effect have been carried out further explain, and institute it should be understood that the above is merely specific embodiment of the present invention; And be not used in qualification protection scope of the present invention; All within spirit of the present invention and principle, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.