CN106131234A - A kind of method and apparatus distributing address information - Google Patents

A kind of method and apparatus distributing address information Download PDF

Info

Publication number
CN106131234A
CN106131234A CN201610458164.8A CN201610458164A CN106131234A CN 106131234 A CN106131234 A CN 106131234A CN 201610458164 A CN201610458164 A CN 201610458164A CN 106131234 A CN106131234 A CN 106131234A
Authority
CN
China
Prior art keywords
address
public network
client
message
network address
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201610458164.8A
Other languages
Chinese (zh)
Inventor
林慧
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201610458164.8A priority Critical patent/CN106131234A/en
Publication of CN106131234A publication Critical patent/CN106131234A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses

Landscapes

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

Abstract

The present invention discloses a kind of method and apparatus distributing address information, and described method includes: receive the request message for asking public network address that client sends;Distribute the first private net address for described client, and according to the private net address of self record and the mapping relations of the first public network address, make described client access public network by described first public network address.By the method it is achieved that multiplexing to the first public network address so that one or more client can access public network according to first public network address, thus save the client consumption to public network address.

Description

A kind of method and apparatus distributing address information
Technical field
The present invention relates to communication technical field, particularly to a kind of method and apparatus distributing address information
Background technology
DHCP (Dynamic Host Configuration Protocol, DHCP) is used for as network Equipment dynamically distributes the network configuration parameters such as IP address.
DHCP uses client/server communication pattern, user end to server file a request and distribute network configuration ginseng The application of number, server is returned as the configuration informations such as the IP address of client distribution, to realize dynamically joining of the information such as IP address Put.
When dhcp client and Dynamic Host Configuration Protocol server are in the different physics network segment, client can pass through DHCP relay and service Device communicates, and obtains IP address and other configuration informations, and the dhcp client on multiple networks can use same DHCP service Device.
Summary of the invention
The present invention proposes a kind of method distributing address information, is applied in gateway device, and described method includes:
Receive the request message for asking public network address that client sends;
The first private net address is distributed for described client, and according to the private net address of self record and the first public network address Mapping relations, make described client access public network by described first public network address.
Present invention also offers a kind of device distributing address information, this device is applied in gateway device, described device Including:
Receiver module, for receiving the request message for asking public network address that client sends;
Processing module, for distributing the first private net address for described client, and according to the private net address of self record with The mapping relations of the first public network address, make described client access public network by described first public network address.
By foregoing it can be seen that gateway device is client distributes the first private net address, and according to private net address With the mapping relations of the first public network address, make client according to (wherein, this first public network address and the first private of the first public network address Net address is corresponding) access public network, it is achieved that the multiplexing to the first public network address so that one or more client is permissible Access public network according to first public network address, thus save the client consumption to public network address.
Accompanying drawing explanation
A kind of networking schematic diagram that Fig. 1 provides for the embodiment of the present invention.
A kind of schematic flow sheet distributing address information that Fig. 2 provides for the embodiment of the present invention.
Detailed description of the invention
For making the purpose of the present invention, technical scheme and advantage clearer, develop simultaneously embodiment referring to the drawings, right Scheme of the present invention is described in further detail, it is clear that described embodiment is only a part of embodiment of the present invention, Rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creative labor The all other embodiments obtained under dynamic premise, broadly fall into the scope of protection of the invention.
Although should be appreciated that in the application possible employing term first, second, third, etc. to 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.Such as, 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.Depend on linguistic context, additionally, the word used " if " can be construed to " ... time " or " when ... " Or " in response to determining "
As it is shown in figure 1, in the application scenarios of a kind of network, it is provided that a kind of method distributing address information, wherein, should DHCP client (dhcp client), DHCP relay (DHCP relay), DHCP server (DHCP service is included by scene Device), wherein, DHCP relay is connected to DHCP client and DHCP server, is used for as DHCP client and DHCP Server provides relay forwarding work.
In this application scene, when certain client (i.e. DHCP client) needs from Dynamic Host Configuration Protocol server (i.e. DHCP When server) obtaining public network address, this client can send the request message of acquisition request public network address, and this request message can be first Send to DHCP relay (hereinafter referred to as gateway device).
After gateway device receives the request message that client sends, the address information of self can be carried in this request In message, then the request message carrying gateway device address information is sent to Dynamic Host Configuration Protocol server.
After Dynamic Host Configuration Protocol server receives the request message that gateway device sends, the gateway according to carrying in request message sets Standby address information, obtains the address information with described gateway device and belongs to the public network address of the same network segment, and the institute that will obtain State public network address and be sent to client by gateway device, so that client accesses public network according to described public network address.
Due to the resource-constrained of the public network address of storage in server, when the address with gateway device of storage in server During the inadequate resource of the public network address that information belongs to the same network segment, server will not provide public network address, thus cause client End cannot access outer net because not getting public network address.
In order to solve the problems referred to above, embodiments providing a kind of method distributing address information, the method can be answered In gateway device, as in figure 2 it is shown, the method includes:
Step 201, receives the request message for asking public network address that client sends.
Step 202, distributes the first private net address for described client, and the private net address and first according to self record is public The mapping relations of net address, make described client access public network by described first public network address.
In a kind of implementation of the present embodiment, gateway device can basis after receiving the message that client sends Prerequisite determines whether to send the first private net address for this client, and wherein, this prerequisite can be that judgement receives Message whether be the request message for asking public network address, or be from Dynamic Host Configuration Protocol server, to obtain public network address, Wherein, when prerequisite is cannot to obtain public network address from Dynamic Host Configuration Protocol server, specific as follows:
Gateway device, can be according to this request message after receiving the request message that client sends, to DHCP service Device request public network address, if when described Dynamic Host Configuration Protocol server obtains public network address, then step 202 cannot be performed.
Wherein, it is judged that whether gateway device can be able to include from the method for Dynamic Host Configuration Protocol server acquisition public network address, works as net Pass equipment is after Dynamic Host Configuration Protocol server request public network address, if not receiving the return information of Dynamic Host Configuration Protocol server, then can determine that can not Public network address is obtained from Dynamic Host Configuration Protocol server, concrete, intervalometer can be set in gateway device, when gateway device is to DHCP service After device request public network address, start this intervalometer, when this timer expiry, if not receiving the reply letter that Dynamic Host Configuration Protocol server sends Breath, it is determined that public network address can not be obtained from Dynamic Host Configuration Protocol server.In the preferred example of another kind, gateway device also can set pre- If number of times, when gateway device is after Dynamic Host Configuration Protocol server request public network address, and during timer expiry, do not receive Dynamic Host Configuration Protocol server The return information sent, then gateway device asks public network address to Dynamic Host Configuration Protocol server again, when gateway device is to Dynamic Host Configuration Protocol server The number of times of request public network address meets or exceeds described preset times, and does not still receive the reply letter that Dynamic Host Configuration Protocol server sends Breath, it is determined that public network address can not be obtained from Dynamic Host Configuration Protocol server.
In the present embodiment, gateway device have recorded private net address and the mapping relations of the first public network address, wherein, private network Address can be the address different from the described first public network address network segment being pre-configured in described gateway device.
In the embodiment that the present invention provides, owing to gateway device is for communicating with Dynamic Host Configuration Protocol server (DHCP server) Address be public network address, therefore, it can be used for gateway device the public network address with server communication as the first public network ground Location, sets up with the private net address self arranged and maps, and generate private net address and the mapping relations of the first public network address.
Further, described private net address can include that a private net address can also include multiple private net address.
Concrete, when private net address includes a private net address when, described mapping relations are one private network ground Location and the mapping relations of the first public network address;When private net address includes multiple private net address when, described mapping relations are many Individual private net address and the mapping relations of the first public network address.If mapping relations are reflecting of multiple private net address and the first public network address When penetrating relation, outside can supporting that multiple client accesses according to the mapping relations of different private net addresses and the first public network address simultaneously Net.
Concrete, when the mapping relations that mapping relations are multiple private net address and the first public network address, gateway device can To be that multiple client distributes the first private net address according to the address allocation rule preset, to ensure that each client can obtain Unique first private net address, wherein, address allocation rule can include that the size order according to different private net addresses is for difference Client distributes the first private net address.
Further, the described in step 202. described client that makes accesses public network by described first private net address Detailed process is as follows:
Step 2021, receives the service message that client sends, and the source address of described service message is described first private network Address.
Step 2022, according to described mapping relations, described first public network address is replaced described first private net address as The source address of described service message, and send the service message after replacement.
In step 2021, when gateway device receives the service message of client transmission (below by the industry from client Business message be referred to as the first message) after, obtain the source address of the first message, when in the mapping relations judge self record exist with During consistent the first private net address of described source address, perform step 2022.
In step 2022, gateway device obtains first private net address consistent with the source address of described first message, and According to mapping relations, obtain first public network address corresponding with described first private net address, described first public network address is replaced Source address in described first message (will described first public network address as the source address of described first message) to public network Send, thus realize the first private net address access public network that client is distributed according to gateway device.
At a time, when gateway device receives the service message from public network, can as follows by from The service message of public network is sent to client, specific as follows:
Step 2023, receives the service message from public network, and the destination address of described service message is described first public network Address.
Step 2024, according to described mapping relations, described first private net address is replaced described first public network address as The destination address of described service message, and will replace after service message be sent to described client.
In step 2023, gateway device receives the service message from public network (below by the business report from public network Literary composition is referred to as the second message) after, obtain the destination address of the second message, when the mapping relations judge self record exist and institute When stating consistent the first public network address of destination address, perform step 2024.
In step 2024, gateway device obtains first public network address consistent with the destination address of described second message, And according to mapping relations, obtain first private net address corresponding with described first public network address, described first private net address is replaced Change destination address in described second message (will described first private net address as the destination address of described second message) and The second message after replacing sends to the client corresponding with destination address (the first private net address).
Accessing public network in order to clearly demonstrate client according to the first private net address, the present embodiment combines actual applied field Scape, is that client distributes the first private net address to gateway device, and client accesses the mistake of public network according to the first private net address Journey is described in detail, specific as follows:
Network includes that three clients are respectively Client1, Client2, Client3, and includes gateway device, its In, the private net address of gateway device record includes: 5.5.5.1,5.5.5.2,5.5.5.3, and gateway device is used for and DHCP The address (this address is public network address) of server communication is 10.10.1.1,
In certain moment, Client1, Client2, Client3 send the request report of request public network address respectively to gateway device Literary composition, gateway device receive that above-mentioned 3 clients send after the request message asking public network address, according to different first The ascending order of private net address is that client distributes the first private net address, for ease of representing, in this example with form Form embodies client, the first private net address, the first triangular corresponding relation of public network address, as shown in table 1:
Table 1
Subsequent time, when client Client1 needs to send the first message to public network, (this sentences Client1 and lifts Example illustrates, the process that Client2, Client3 access public network is similar with Client1), Client1 is by the first private net address 5.5.5.1 carry in described first message as source address, and described first message is sent to gateway device.
After gateway device receives the first message that Client1 sends, obtain the source address of described first message 5.5.5.1, because in table 1, private net address exists 5.5.5.1, and the first public network address corresponding to 5.5.5.1 is 10.10.1.1, Then 10.10.1.1 is replaced the 5.5.5.1 in described first message as new source address by gateway device, first after replacing Message sends to public network.
Subsequent time, when gateway device receives the second message from public network, obtains the purpose of described second message Address 10.10.1.1, according to table 1, the destination address of the second message is consistent, then with the first public network address in mapping relations Illustrate to need, according to mapping relations, this second message is sent to client, again because of according to table 1 understand Client1, Client2, Client3 is all corresponding with the first public network address, then 5.5.5.1,5.5.5.2,5.5.5.3 can be replaced second by gateway device respectively The destination address 10.10.1.1 of message, and will replace after the second message be sent respectively to Client1, Client2, Client3。
By above-described embodiment it can be seen that the gateway device mapping relations by self record, it is achieved that public to first The multiplexing of net address so that one or more client can access public network according to first public network address, thus Save the client consumption to public network address.
Further, the gateway device mapping relations by self record, client can be made cannot to obtain DHCP service In the case of the public network address of device distribution, realize accessing public network according to the first private net address of gateway device distribution, say, that Can be in the case of not increasing Dynamic Host Configuration Protocol server public network address resource so that when the quantity of client is more than in Dynamic Host Configuration Protocol server public During net address resource, still can enable the client to access public network.
The invention provides another kind of embodiment, particularly as follows:
Gateway device have recorded private net address, private network mark, the mapping relations of the first public network address, wherein private network mark with Private net address is unique corresponding, and a private network mark is for representing a private net address.
When gateway device receives the first message from client, (this first message is that client is distributed according to gateway device The service message that sends to public network of the first private net address, concrete determination methods is illustrated the most in the aforementioned embodiment, because of This repeats no more), the first public network address is replaced the source address in this first message, and described private network mark is also carried After in this first message, then the first message is sent to public network.
In certain moment, when gateway device receives the second message from public network, obtain the purpose in this second message Address and private network mark, if the destination address obtained is the first public network address, but when not getting private network mark, then according to front State embodiment to carry out processing (embodiment as corresponding with table 1);If the destination address obtained is the first public network address, and obtains To private network identify time, then obtain and private network the first private net address corresponding to mark according to described private network mark, and by the of acquisition One private net address replaces the destination address of the second message (will replace to the first private network ground by the first public network address in the second message Location), then will replace after the second message according to replace after destination address (the i.e. first private net address) send to and destination address Corresponding client.
For convenience of description, in conjunction with actual application scenarios, the present embodiment is illustrated, specific as follows:
Network includes that three clients are respectively Client1, Client2, Client3, and includes gateway device, its In, client, private net address, private network identify, the corresponding relation of the first public network address is as shown in table 2 (because gateway device is client The process of end distribution the first private net address is identical with the assigning process in previous embodiment, therefore repeats no more).
Table 2
In certain moment, when the first private net address 5.5.5.2 is sent the first message as source address to public network by Client2 Time, source address 5.5.5.2 of this first message is replaced with 10.10.1.1 by gateway device, adds private in the first message simultaneously Network mark knows B, and will substituted for source address and add the first message transmission of private network mark to public network.
In certain moment, when gateway device receives the second message from public network, obtain the destination of this second message Location is 10.10.1.1, and gets the private network that the second message carries and be designated B, then gateway device obtains according to private network mark B The first private net address 5.5.5.2 corresponding with B, and 5.5.5.2 is replaced the destination address 10.10.1.1 of the second message, will replace The second message after changing sends to the Client2 corresponding for private net address 5.5.5.2 with first.
By above-described embodiment it can be seen that when the gateway device mapping relations by self record, client can be made to exist In the case of cannot obtaining the public network address of Dynamic Host Configuration Protocol server distribution, realize visiting according to the first private net address of gateway device distribution Ask public network, further, owing to the present embodiment being identified by private network, when gateway device receives the second message from public network Time, can determine and private network the first private net address corresponding to mark according to the private network mark carried in the second message, thus can be by the Two messages are sent to client targetedly.
The invention provides another kind of embodiment is:
In step 202., in the private net address of gateway device record and the mapping relations of the first public network address, the first public network Address can also be the public network address that other clients are distributed for Dynamic Host Configuration Protocol server, particularly as follows:
Because Dynamic Host Configuration Protocol server is when client distributes public network address, need the message carrying this public network address is passed through gateway Equipment is sent to client, when therefore gateway device receives the message that Dynamic Host Configuration Protocol server sends, obtains public affairs from described message Net address, and using the described public network address of acquisition as the first public network address, further, set up the first public network address and private network The mapping relations of address, following example:
Gateway device have received three the 3rd messages the (the wherein, the 3rd carrying public network address that Dynamic Host Configuration Protocol server sends Message be Dynamic Host Configuration Protocol server be client distribution public network address time send message, this carry public network address), wherein these three The public network address carried in 3rd message is respectively as follows: 10.10.1.2,10.10.1.3,10.10.1.4.It should be noted that work as After gateway device receives above three the 3rd message, record the public network address carried in three the 3rd messages, simultaneously by the 3rd The client of the forward direction Dynamic Host Configuration Protocol server acquisition request public network address that message is sent to, such as, before Client4, Client5, Client6 requests public network address to Dynamic Host Configuration Protocol server respectively, and three above-mentioned the 3rd messages be Dynamic Host Configuration Protocol server according to 3rd message of the request feedback of Client4, Client5, Client6, then gateway device record above three public network address, and Above three the 3rd message is sent respectively to Client4, Client5, Client6 so that Client4, Client5, Client6 obtains public network address, and the public network address obtained such as Client4 is the public network address that 10.10.1.2, Client5 obtain The public network address obtained for 10.10.1.3, Client6 is 10.10.1.4.
If first private net address that includes of private network of gateway device storage be respectively 5.5.5.1,5.5.5.2, 5.5.5.3, (gateway device is that client distributes the first private network herein to set up the mapping relations of private net address and the first public network address The process of address is same as the previously described embodiments, therefore omits, and above three the first private net address is distributed to by default gateway equipment Client1, Client2, Client3), as shown in table 3:
Client First private net address First public network address
Client1 5.5.5.1 10.10.1.2
Client2 5.5.5.2 10.10.1.3
Client3 5.5.5.3 10.10.1.4
Table 3
In certain moment, when Client1 sends the first message to public network, (source address of the first message now is 5.5.5.1), this first message can be sent (detailed process for 10.10.1.2 to public network with source address according to table 3 by gateway device Such as previous embodiment, therefore repeat no more, the process that Client2, Client3 send to public network also with).
Certain moment, when gateway device receives the second message that public network sends, if the purpose got in the second message When address is 10.10.1.2, (now existence two kinds is possible, and the first is possible, and the purpose client of described second message is for obtaining The Client4 of public network address 10.10.1.2, the second is possible, and the purpose client of described second message is for obtaining the first private network The Client1 of address 5.5.5.1), described gateway device this second message can be sent respectively to Client4 and Client1。
By above-described embodiment it can be seen that gateway device is possible not only to the public network using self to communicate with Dynamic Host Configuration Protocol server The mapping relations between the first private net address and the first public network address, as the first public network address, are set up in address, make client according to These mapping relations realize client and utilize the first private net address to access public network, and further, gateway device can also record DHCP Server be the allocated public network address of other clients as the first public network address, set up the first private net address and the first public network Mapping relations between address, make client realize client according to these mapping relations and utilize the first private net address to access public network.
In another implementation, gateway device have recorded the mapping pass of private net address, private network mark, the first public network address System, wherein, the first public network address includes that Dynamic Host Configuration Protocol server is that the allocated public network address of other clients is made, particularly as follows:
Gateway device have recorded the public network address that Dynamic Host Configuration Protocol server distributes to Client4, Client5, Client6, specifically , the public network address that public network address is 10.10.1.2, Client5 acquisition that Client4 obtains is 10.10.1.3, Client6 The public network address obtained is 10.10.1.4.
The first private net address that the private network of gateway device storage includes is respectively 5.5.5.1,5.5.5.2,5.5.5.3, Set up private net address, (now default gateway equipment is by above-mentioned with the first triangular mapping relations of public network address for private network mark Three the first private net addresses distribute to Client1, Client2, Client3), as shown in table 4:
Client First private net address Private network identifies First public network address
Client1 5.5.5.1 A 10.10.1.2
Client2 5.5.5.2 B 10.10.1.3
Client3 5.5.5.3 C 10.10.1.4
Table 3
In certain moment, when the first private net address 5.5.5.1 is sent the first message as source address to public network by Client1 Time, source address 5.5.5.1 of this first message is replaced with 10.10.1.2 by gateway device, adds private in the first message simultaneously Network mark knows A, and will substituted for source address and add the first message transmission of private network mark to public network.
In certain moment, when gateway device receives the second message from public network, obtain the destination of this second message Location is 10.10.1.2, and gets the private network that the second message carries and be designated A, then gateway device obtains according to private network mark A The first private net address 5.5.5.1 corresponding with A, and 5.5.5.1 is replaced the destination address 10.10.1.2 of the second message, will replace The second message after changing sends to the Client1 corresponding for private net address 5.5.5.1 with first.If it should be noted that gateway sets The destination address of standby the second message received is 10.10.1.2, and does not carries private network mark A, then can determine that the second message Purpose client be Client4, then this second message is sent to Client4 by gateway device.
By above-described embodiment it can be seen that when the gateway device mapping relations by self record, client can be made to exist In the case of cannot obtaining the public network address of Dynamic Host Configuration Protocol server distribution, realize visiting according to the first private net address of gateway device distribution Ask public network, further, owing to the present embodiment being identified by private network, when gateway device receives the second message from public network Time, can determine and private network the first private net address corresponding to mark according to the private network mark carried in the second message, thus can be by the Two messages are sent to client targetedly.
Present invention also offers another kind of embodiment, when gateway device is after client distributes the first private net address, described Gateway device periodically sends detection messages to Dynamic Host Configuration Protocol server, and whether described detection messages is used for detecting in Dynamic Host Configuration Protocol server Existence can be the public network address of described client distribution, for convenience of illustrating, and reference list 1,
Client Client1, Client2, Client3 ask public network address, net by gateway device to Dynamic Host Configuration Protocol server Pass equipment finds that Dynamic Host Configuration Protocol server does not distributes public network address to above three client, then gateway device is above three client Distribute the first private net address, specifically, the first private net address for Client1 distribution is 5.5.5.1, for Client2 distribution First private net address is 5.5.5.2, and the first private net address for Client3 distribution is 5.5.5.3, and records above-mentioned first private network Address and the corresponding relation of client.
Next time, gateway device construction itself detection messages, and to Dynamic Host Configuration Protocol server send described detection messages, work as net Pass equipment determines the public network that there is the free time in Dynamic Host Configuration Protocol server according to Dynamic Host Configuration Protocol server for described detection messages feedack During address resource, gateway device notice be allocated the first private net address Client1, Client2, Client3 (also dependent on For the size of the first private net address of above three client distribution, notify the client corresponding with the first maximum private net address Or the client corresponding to the first private net address of notice and minimum) so that receive the client of described notice again to Dynamic Host Configuration Protocol server application public network address, after client is from Dynamic Host Configuration Protocol server application to public network address, then uses this public network address Access public network, and access public network not in use by the first private net address.
By above-described embodiment it can be seen that when the gateway device mapping relations by self record, client can be made to exist In the case of cannot obtaining the public network address of Dynamic Host Configuration Protocol server distribution, realize visiting according to the first private net address of gateway device distribution Asking public network, further, whether gateway device, also by detection messages, exists the public network ground of free time in detection Dynamic Host Configuration Protocol server Location resource, if existing, then notice client is to Dynamic Host Configuration Protocol server application public network address, when applying for after public network address according to these public affairs Net address accesses public network.
Based on the inventive concept as said method, the embodiment of the present invention also provides for a kind of dress distributing address information Put, apply on gateway device.This device can be realized by software, it is also possible to by the way of hardware or software and hardware combining Realize.As a example by implemented in software, as the device on a logical meaning, it is the processor of gateway device by its place, Computer program instructions corresponding in reading non-volatile storage is formed.For hardware view, except processor, non-easily Outside the property lost memorizer, gateway device can also include other hardware, such as the forwarding chip of responsible process message, network interface, interior Deposit;From the point of view of from hardware configuration, this gateway device, it is also possible that distributed apparatus, potentially includes multiple interface card, in order to Hardware view carries out the extension of Message processing.
The embodiment of the present invention provides a kind of device distributing address information, and this device is applied in gateway device, this device Including:
Receiver module, for receiving the request message for asking public network address that client sends;
Processing module, for distributing the first private net address for described client, and according to the private net address of self record with The mapping relations of the first public network address, make described client access public network by described first public network address.
By said apparatus, processing module, according to mapping relations, utilizes private net address to achieve the first public network address Multiplexing so that one or more client utilizes private net address and the mapping relations of the first public network address, makes above-mentioned visitor Family end utilizes the first public network address to access public network, thus saves the client consumption to public network address.
Further, described device also includes judge module.
This judge module, being used in described processing module is before described client distributes the first private net address, it is judged that be No meet prerequisite, when described judge module judges to meet prerequisite, notify that described processing module is described client End distribution the first private net address.
Further, described prerequisite includes: receive described request message, or cannot be from Dynamic Host Configuration Protocol server Obtain public network address.
Further, described device also includes detection module.
This detection module, for sending detection messages to Dynamic Host Configuration Protocol server, described detection messages is used for detecting DHCP service Assignable public network address in device.
Then receiver module, is additionally operable to receive the feedback message that Dynamic Host Configuration Protocol server sends for described detection messages, processes mould Block, is additionally operable to when determining that in described Dynamic Host Configuration Protocol server, existence can be the public network ground of described client distribution according to described feedback message During location, notify that described client resends described request message.
Concrete, described receiver module, it is additionally operable to receive the service message that described client sends, described service message Source address is described first private net address, described processing module, is additionally operable to according to described mapping relations, by described first public network ground Location, as the source address of described service message, sends this service message.
Or, described receiver module, it is additionally operable to receive the service message from public network, the destination address of described service message For described first public network address, described processing module, be additionally operable to according to described mapping relations, using described first private net address as The destination address of described service message, and this service message is sent to described client.
By above-described embodiment it can be seen that the gateway device mapping relations by self record, client can be made in nothing In the case of method obtains the public network address of Dynamic Host Configuration Protocol server distribution, realize accessing according to the first private net address of gateway device distribution Public network, say, that can be in the case of not increasing Dynamic Host Configuration Protocol server public network address resource so that when the quantity of client is more than In Dynamic Host Configuration Protocol server during public network address resource, still can enable the client to access public network.
Through the above description of the embodiments, those skilled in the art is it can be understood that can be by the present invention Software adds the mode of required general hardware platform and realizes, naturally it is also possible to by hardware, but a lot of in the case of the former is more Good embodiment.Based on such understanding, prior art is contributed by technical scheme the most in other words Part can embody with the form of software product, and this computer software product is stored in a storage medium, if including Dry instruction is with so that a computer equipment (can be personal computer, server, or the network equipment etc.) performs this Method described in each embodiment bright.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 are not necessarily implemented necessary to the present invention.
It will be appreciated by those skilled in the art that the module in the device in embodiment can describe according to embodiment to carry out point 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 stating embodiment can merge into a module, it is possible to is further split into multiple submodule.The invention described above embodiment Sequence number, just to describing, does not represent the quality of embodiment.
The several specific embodiments being only the present invention disclosed above, but, the present invention is not limited to this, any ability What the technical staff in territory can think change all should fall into protection scope of the present invention.

Claims (12)

1. the method distributing address information, it is characterised in that described method is applied in gateway device, described method bag Include:
Receive the request message for asking public network address that client sends;
The first private net address is distributed for described client, and according to the private net address of self record and the mapping of the first public network address Relation, makes described client access public network by described first public network address.
2. the method for claim 1, it is characterised in that before distributing the first private net address for described client, also Including:
When meeting prerequisite, distribute the first private net address for described client.
3. method as claimed in claim 2, it is characterised in that described prerequisite includes:
Receive described request message, or public network address cannot be obtained from Dynamic Host Configuration Protocol server.
4. the method for claim 1, it is characterised in that described method also includes:
Sending detection messages to Dynamic Host Configuration Protocol server, described detection messages is used for detecting assignable public network ground in Dynamic Host Configuration Protocol server Location;
Receive the feedback message that Dynamic Host Configuration Protocol server sends for described detection messages, determine described DHCP according to described feedback message Whether server exists can be described client distribution public network address;
If existing, then notify that described client resends described request message.
5. the method as described in Claims 1-4 is arbitrary, it is characterised in that described in make described client by described first public Net address accesses public network, including:
Receiving the service message that described client sends, the source address of described service message is described first private net address;
According to described mapping relations, using described first public network address as the source address of described service message, and send this business Message.
6. the method as described in Claims 1-4 is arbitrary, it is characterised in that described in make described client by described first public Net address accesses public network, including:
Receiving the service message from public network, the destination address of described service message is described first public network address;
According to described mapping relations, using described first private net address as the destination address of described service message, and by this business Message is sent to described client.
7. the device distributing address information, it is characterised in that described device is applied in gateway device, described device bag Include:
Receiver module, for receiving the request message for asking public network address that client sends;
Processing module, for distributing the first private net address for described client, and according to the private net address and first of self record The mapping relations of public network address, make described client access public network by described first public network address.
8. device as claimed in claim 7, it is characterised in that described device also includes: judge module,
Described judge module, being used in described processing module is before described client distributes the first private net address, it may be judged whether Meet prerequisite;
When described judge module judges to meet prerequisite, notify that described processing module is that described client distribution first is private Net address.
9. device as claimed in claim 8, it is characterised in that described prerequisite includes:
Receive described request message, or public network address cannot be obtained from Dynamic Host Configuration Protocol server.
10. device as claimed in claim 7, it is characterised in that described device also includes: detection module,
Described detection module, for sending detection messages to Dynamic Host Configuration Protocol server, described detection messages is used for detecting Dynamic Host Configuration Protocol server In assignable public network address;
Described receiver module, is additionally operable to receive the feedback message that Dynamic Host Configuration Protocol server sends for described detection messages;
Described processing module, is additionally operable to when determining that according to described feedback message existing in described Dynamic Host Configuration Protocol server can be described client During the public network address that end distributes, notify that described client resends described request message.
11. devices as described in claim 7 to 10 is arbitrary, it is characterised in that described in make described client by described first Public network address accesses public network, including:
Described receiver module, is additionally operable to receive the service message that described client sends, and the source address of described service message is institute State the first private net address;
Described processing module, is additionally operable to according to described mapping relations, using described first public network address as described service message Source address, sends this service message.
12. devices as described in claim 7 to 10 is arbitrary, it is characterised in that described in make described client by described first Public network address accesses public network, including:
Described receiver module, is additionally operable to receive from the service message of public network, and the destination address of described service message is described the One public network address;
Described processing module, is additionally operable to according to described mapping relations, using described first private net address as described service message Destination address, and this service message is sent to described client.
CN201610458164.8A 2016-06-20 2016-06-20 A kind of method and apparatus distributing address information Pending CN106131234A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610458164.8A CN106131234A (en) 2016-06-20 2016-06-20 A kind of method and apparatus distributing address information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610458164.8A CN106131234A (en) 2016-06-20 2016-06-20 A kind of method and apparatus distributing address information

Publications (1)

Publication Number Publication Date
CN106131234A true CN106131234A (en) 2016-11-16

Family

ID=57267885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610458164.8A Pending CN106131234A (en) 2016-06-20 2016-06-20 A kind of method and apparatus distributing address information

Country Status (1)

Country Link
CN (1) CN106131234A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111465001A (en) * 2020-04-01 2020-07-28 中国联合网络通信集团有限公司 Registration method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060493A (en) * 2007-05-14 2007-10-24 中兴通讯股份有限公司 A method of private network user access the server in a private network through domain name
CN101730268A (en) * 2009-11-27 2010-06-09 中国电信股份有限公司 Femto gateway and method and system for mobile terminal to access network resources

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060493A (en) * 2007-05-14 2007-10-24 中兴通讯股份有限公司 A method of private network user access the server in a private network through domain name
CN101730268A (en) * 2009-11-27 2010-06-09 中国电信股份有限公司 Femto gateway and method and system for mobile terminal to access network resources

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111465001A (en) * 2020-04-01 2020-07-28 中国联合网络通信集团有限公司 Registration method and device
CN111465001B (en) * 2020-04-01 2023-05-02 中国联合网络通信集团有限公司 Registration method and device

Similar Documents

Publication Publication Date Title
CN105245629B (en) Host communication method based on DHCP and device
CN101159758B (en) Classification associated dynamic host machine configuring protocol option distribution method and device
CN108063735B (en) VNF cluster distribution method and device
CN108429824B (en) Address allocation method and device
CN104812021B (en) A kind of method and device of AP access AC
CN108933847A (en) A kind of method and device that address is quickly distributed
CN106412143B (en) A kind of visualization distribution method of clustered node IP address
US20190253383A1 (en) Method to distribute a centralized service
CN106027356B (en) A kind of conversion method and device of Tunnel Identifier
CN101094224A (en) Method and system of providing services, access services, logging in and out services
CN106533973A (en) Method and system for distributing service message, and equipment
CN104468869A (en) Method for allocating IP addresses to terminals and method and device for obtaining IP addresses
CN109474713A (en) Message forwarding method and device
CN104253878A (en) VLAN (Virtual Local Area Network) information management system and method of DHCP (Dynamic Host Configuration Protocol) RELAY termination sub-interface
CN102611623B (en) Port configuration processing method, port configuration processing device and port configuration processing system on basis of network access
CN103401954B (en) The implementation method of virtual DHCP
CN110636149B (en) Remote access method, device, router and storage medium
CN107800745A (en) The method that service declaration and service discovery are carried out based on mDNS
CN111464370B (en) Network distribution device, Internet of things control system and network distribution method thereof
CN105897542A (en) Tunnel building method and video monitoring system
CN106131234A (en) A kind of method and apparatus distributing address information
CN106506236A (en) The methods, devices and systems that a kind of WAP is declared automatically
CN106713287A (en) Method, apparatus and system for automatically registering wireless access point
CN107547674A (en) Address distribution method and device
CN105847143A (en) VRRP (virtual router redundancy protocol)-based load balancing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20161116

RJ01 Rejection of invention patent application after publication