CN108093091A - A kind of method and agent equipment for obtaining host additional information - Google Patents

A kind of method and agent equipment for obtaining host additional information Download PDF

Info

Publication number
CN108093091A
CN108093091A CN201611029102.1A CN201611029102A CN108093091A CN 108093091 A CN108093091 A CN 108093091A CN 201611029102 A CN201611029102 A CN 201611029102A CN 108093091 A CN108093091 A CN 108093091A
Authority
CN
China
Prior art keywords
address
host
message
agent equipment
dhcp client
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.)
Granted
Application number
CN201611029102.1A
Other languages
Chinese (zh)
Other versions
CN108093091B (en
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.)
Huawei Digital Technologies Suzhou Co Ltd
Original Assignee
Huawei Digital Technologies Suzhou 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 Huawei Digital Technologies Suzhou Co Ltd filed Critical Huawei Digital Technologies Suzhou Co Ltd
Priority to CN202110181562.0A priority Critical patent/CN113037882B/en
Priority to CN201611029102.1A priority patent/CN108093091B/en
Publication of CN108093091A publication Critical patent/CN108093091A/en
Application granted granted Critical
Publication of CN108093091B publication Critical patent/CN108093091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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]

Abstract

An embodiment of the present invention provides a kind of method and agent equipment for obtaining host additional information, for easily obtaining host additional information.The method is performed by agent equipment, and the agent equipment communicates to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, and this method includes:Obtain the first discovery message that the dhcp client is sent, the MAC Address of host where the first discovery message carries the dhcp client;If the agent equipment does not preserve host name corresponding with the MAC Address, the agent equipment is the host assignment temporary ip address;Agent equipment asks the additional information of the host using the temporary ip address to the host.Avoid to get the additional information of host and to the transformation of Dynamic Host Configuration Protocol server, agent equipment is without specially detecting the IP address of client with prospecting tools, therefore the method for the embodiment of the present invention is simple and practicable.

Description

A kind of method and agent equipment for obtaining host additional information
Technical field
The present invention relates to the communications field more particularly to a kind of methods and agent equipment for obtaining host additional information.
Background technology
DHCP (English full name:Dynamic Host Configuration Protocol;Chinese:DynamicHost is matched somebody with somebody Put agreement) it is a kind of procotol of LAN, effect is to the master for accessing Internet in the network based on TCP/IP Machine provides configuration information.DHCP is worked using customer end/server mode, and DHCP clothes are installed in a host in a local network Business device software, installs dhcp client software in other hosts.Configuration application is sent from dhcp client to Dynamic Host Configuration Protocol server, It is client assignment configuration information for request server, configuration information includes the ginsengs such as IP address, subnet mask, default gateway Number.Dynamic Host Configuration Protocol server returns to corresponding configuration information according to strategy to dhcp client.
By the message interaction between dhcp client and Dynamic Host Configuration Protocol server, one side dhcp client completes IP, and (English is complete Claim:Internet Protocol;Chinese:Internet protocol) address obtains, and another aspect Dynamic Host Configuration Protocol server is recorded as DHCP Host MAC (English names where the IP address and dhcp client of client distribution:Media Access Control;In Literary fame claims:Media access control) address mapping relations.
But the prior art has the disadvantages that:
For the ease of being managed to host, network management personnel generally requires to obtain the additional informations such as host name, however During dhcp client and Dynamic Host Configuration Protocol server carry out DHCP message interaction, any equipment in LAN, which for example relays, to be set Standby or interchanger can not obtain more additional informations.
The content of the invention
An embodiment of the present invention provides a kind of method and agent equipment for obtaining host additional information, for easily obtaining Host additional information.
In a first aspect, an embodiment of the present invention provides a kind of method for obtaining host additional information, this method is set by acting on behalf of Standby to perform, which communicates to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, and this method includes:
The agent equipment disposed between dhcp client and Dynamic Host Configuration Protocol server obtains the first hair that dhcp client is sent Existing message, the MAC Address of host where which carries dhcp client.Then, sent out by dhcp client The MAC Address of the host on the first discovery message sent is screened, and determines whether to have obtained the additional information of the host. If agent equipment does not preserve host name corresponding with MAC Address, agent equipment is host assignment temporary ip address, so as to generation Reason equipment can determine the network site of the host according to the temporary ip address.Then, agent equipment uses temporary ip address To the additional information of host requesting host.And agent equipment includes but not limited to proxy server, dhcp relay agent etc., adds Information includes but not limited to the information carried on the hosts such as host name, relevant department's information, software-hardware configuration information.
Such mode avoids to get the additional information of host and to the transformation of Dynamic Host Configuration Protocol server, agent equipment Specially the IP address of client is detected without with prospecting tools, prevents information of the user of client because worrying itself Excessive is exposed, and carries out corresponding shielding measure.Therefore the method for the embodiment of the present invention is simple and practicable.
With reference to first aspect, in the first possible implementation, agent equipment please to host using temporary ip address After the additional information for seeking host, the method for this realization method further includes:Agent equipment is established and preserves the additional information of host With the correspondence of both MAC Address, can be used so as to which, agent equipment is obtained after second that dhcp client sends finds message The correspondence.Wherein, the second discovery message carries MAC Address, the second discovery message be dhcp client in temporary IP What location was sent after being released.If determine that agent equipment is protected according to the correspondence of the additional information of host and both MAC Address There is additional information corresponding with the MAC Address that second finds message carrying, agent equipment is sent out to Dynamic Host Configuration Protocol server transparent transmission second Existing message, so that Dynamic Host Configuration Protocol server is host assignment real IP address.And then, agent equipment obtains Dynamic Host Configuration Protocol server and DHCP visitors At least one DHCP message of family end interaction, real IP address and MAC Address are carried at least one DHCP message.Then, Agent equipment reuses the additional information of the host of preservation and the correspondence of both MAC Address, and agent equipment is according at least one The MAC Address and the correspondence of preservation included in a DHCP message, establishes additional information, MAC Address and real IP address The correspondence of three.
Such mode avoids to establish the correspondence of host name, host MAC address and real IP address and right The transformation of Dynamic Host Configuration Protocol server, agent equipment specially visit the IP address and MAC Address of client without with prospecting tools It surveys, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and carry out corresponding shielding measure, so as to this hair The method of the bright correspondence for establishing host name, MAC Address and IP address is simple and practicable.
The first possible realization method with reference to first aspect, in second of possible realization method, this is at least one DHCP message, the offer message that the confirmation message or Dynamic Host Configuration Protocol server sent including Dynamic Host Configuration Protocol server is sent.In the confirmation report The real IP address of Dynamic Host Configuration Protocol server distribution is carried on text and offer message, so as to agent equipment using the real IP Location.
With reference to first aspect, the first or second of possible realization method of first aspect, in the third possible reality In existing mode, agent equipment uses additional information of the temporary ip address to host requesting host, including:Agent equipment is sent out to host Send to ask the response request message of additional information, which carries temporary ip address;So as to which agent equipment obtains The response response message that host is taken to send responds the source IP address of response message as temporary ip address, responds response message and carries The additional information of host.Agent equipment and the host are interacted by icmp packet, and agent equipment obtains the additional information of host.
With reference to first aspect, the first or second of possible realization method of first aspect, in the 4th kind of possible reality In existing mode, agent equipment is host assignment temporary ip address, including:Agent equipment sends to dhcp client and provides message, Message is provided and carries temporary ip address;And then, agent equipment obtains the request message that dhcp client is sent, wherein request message The temporary ip address is carried, which also carries MAC Address;If agent equipment is not preserved corresponding with MAC Address Additional information shows that agent equipment needs to obtain the additional information of the host, it is impossible to the request message of letting pass.Then, Dai Lishe The content of the standby Server Identifier fields for judging request message whether be agent equipment IP address, if request message Server Identifier fields content be agent equipment IP address, then agent equipment sent to dhcp client true Recognize message, confirmation message is used to indicate agent equipment and has completed to distribute the process of temporary ip address for dhcp client.Such generation Reason equipment can be completed as host assignment temporary ip address.
With reference to first aspect, the first or second of possible realization method of first aspect, in the 5th kind of possible reality In existing mode, agent equipment uses temporary ip address after the additional information of host requesting host, the method for this realization method It further includes:Agent equipment denies message when getting the request message of dhcp client broadcast, to dhcp client transmission.So Afterwards, agent equipment discharges temporary ip address when getting the release message of dhcp client transmission.So as to dhcp client solution Except the temporary ip address.
With reference to first aspect, the first or second of possible realization method of first aspect, in the 6th kind of possible reality In existing mode, using temporary ip address after the additional information of host requesting host, further include:Agent equipment, which is worked as, gets visitor During the request message of family end unicast, dhcp client is not responded;Agent equipment is when the request report for getting client broadcast transmission Wen Shi denies message to dhcp client transmission.Then, agent equipment is when the release message for getting dhcp client transmission When, discharge temporary ip address.So as to which dhcp client releases the temporary ip address.
With reference to first aspect, the first or second of possible realization method of first aspect, in the 7th kind of possible reality In existing mode, which is the host name of the host.
With reference to first aspect, the first or second of possible realization method of first aspect, in the 8th kind of possible reality In existing mode, agent equipment is less than preset time threshold values for the lease time of the temporary ip address of host assignment.
Second aspect provides a kind of agent equipment in the embodiment of the present invention, which, which has in the above method, acts on behalf of The function of equipment.The function can pass through hardware realization, it is also possible to perform corresponding software by hardware and realize.The hardware is soft Part includes the one or more and corresponding module of above-mentioned function.
In a kind of possible realization method, which includes:
First acquisition unit, first for obtaining dhcp client transmission finds message, and the first discovery message carries The MAC Address of host where dhcp client;
Allocation unit is that host assignment is interim if not preserving host name corresponding with MAC Address for agent equipment IP address;
Request unit, for using temporary ip address to the additional information of host requesting host.
In alternatively possible realization method, which includes:
Transceiver, processor;
The processor performs following action:The first discovery message that dhcp client is sent is obtained, the first discovery message is taken MAC Address with host where dhcp client;
The processor performs following action:It is host if agent equipment does not preserve host name corresponding with MAC Address Distribute temporary ip address;
The processor performs following action:Using temporary ip address to the additional information of host requesting host.
The third aspect, the embodiment of the present invention provide a kind of computer storage media, which is stored with journey Sequence code, the program code are used to indicate any one the possible realization method institute for performing above-mentioned first aspect or first aspect The method stated.
Fourth aspect, an embodiment of the present invention provides a kind of methods for obtaining host additional information, and method is by agent equipment It performs, which communicates to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, and this method includes:Agent equipment obtains The request message that dhcp client is sent, wherein, which carries where the first TransactionID and dhcp client The MAC Address of host.And agent equipment obtains the confirmation message that Dynamic Host Configuration Protocol server is sent, which includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution.As the first TransactionID and second When TransactionID is identical, then agent equipment determines that the IP address on the confirmation message is allocated to and agent equipment company The host connect.The agent equipment can determine the network site of corresponding host according to the IP address, so as to which agent equipment makes With the IP address to the additional information of host requesting host.
Such mode avoids to get the additional information of host and to the transformation of Dynamic Host Configuration Protocol server, agent equipment Specially the IP address of client is detected without with prospecting tools, prevents information of the user of client because worrying itself Excessive is exposed, and carries out corresponding shielding measure.Therefore the method for the embodiment of the present invention is simple and practicable.
With reference to fourth aspect, in the first possible implementation, agent equipment asks to lead using IP address to host Before the additional information of machine, the method for this realization method further includes:Agent equipment is established and preserves both MAC Address and IP address Correspondence.Agent equipment is using IP address after the additional information of host requesting host, and the method for this realization method is also Including:Agent equipment establishes pair of IP address, additional information and MAC Address three according to the correspondence and IP address of preservation It should be related to.
Such mode avoids to establish the correspondence of host name, MAC Address and IP address and to Dynamic Host Configuration Protocol server Transformation, agent equipment specially detects the IP address and MAC Address of client without with prospecting tools, prevents client The user at end is exposed because worrying that the information of itself is excessive, and carries out corresponding shielding measure.Therefore the embodiment of the present invention is built The method of the correspondence of vertical host name, MAC Address and IP address is simple and practicable.
With reference to the first realization method of fourth aspect, in second of possible realization method of fourth aspect, agency Equipment uses additional information of the IP address to host requesting host, including:Agent equipment sends to ask additional letter to host The response request message of breath responds request message and carries IP address.Then, agent equipment obtains the response response report that host is sent Text responds the additional information that response message carries host.Agent equipment and the host are interacted by icmp packet, and agent equipment obtains Obtained the additional information of host.
In terms of 5th, a kind of agent equipment is provided in the embodiment of the present invention, which, which has in the above method, acts on behalf of The function of equipment.The function can pass through hardware realization, it is also possible to perform corresponding software by hardware and realize.The hardware is soft Part includes the one or more and corresponding module of above-mentioned function.
In a kind of possible realization method, which includes:
First acquisition unit, for obtaining the request message of dhcp client transmission, request message carries first The MAC Address of TransactionID and dhcp client place host;
Second acquisition unit, for obtaining the confirmation message of Dynamic Host Configuration Protocol server transmission, confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;
Request unit, for as the first TransactionID and the 2nd TransactionID identical, using IP address To the additional information of host requesting host.
In alternatively possible realization method, which includes:
Transceiver, processor;
The transceiver performs following action:The request message that dhcp client is sent is obtained, request message carries first The MAC Address of TransactionID and dhcp client place host;
The transceiver performs following action:The confirmation message that Dynamic Host Configuration Protocol server is sent is obtained, confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;
The processor performs following action:As the first TransactionID and the 2nd TransactionID identical, make With IP address to the additional information of host requesting host.
6th aspect, the embodiment of the present invention provide a kind of computer storage media, which is stored with journey Sequence code, the program code are used to indicate any one the possible realization method institute for performing above-mentioned fourth aspect or fourth aspect The method stated.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
The agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, in dhcp client application IP address When, the DHCP message that is interacted by the DHCP message or dhcp client and Dynamic Host Configuration Protocol server that obtain dhcp client, with for It is the true of dhcp client distribution that the dhcp client, which distributes temporary ip address or extracts Dynamic Host Configuration Protocol server in DHCP message, The mode of IP address determines the IP address of the dhcp client, so as to can determine that the dhcp client according to the IP address The network site of place host, to obtain the additional information of the host according to the IP address of the host.So as to avoid to obtain To host additional information and to the transformation of Dynamic Host Configuration Protocol server, agent equipment without with prospecting tools specially to the IP of client Address is detected, and the user of client is prevented to be exposed because worrying that the information of itself is excessive, and is carried out corresponding shielding and arranged It applies.Therefore the method for the embodiment of the present invention is simple and practicable.
Description of the drawings
Fig. 1 is the network architecture involved by a kind of method for acquisition host additional information that one embodiment of the invention provides Figure;
Fig. 2 is a kind of method flow diagram of the method for acquisition host additional information that another embodiment of the present invention provides;
Fig. 3 is a kind of method flow diagram of the method for acquisition host additional information that another embodiment of the present invention provides;
Fig. 4 is a kind of method flow diagram of the method for acquisition host additional information that another embodiment of the present invention provides;
Fig. 5 is a kind of method flow diagram of the method for acquisition host additional information that another embodiment of the present invention provides;
Fig. 6 is a kind of structure diagram for agent equipment that another embodiment of the present invention provides;
Fig. 7 is a kind of hardware architecture diagram for agent equipment that another embodiment of the present invention provides;
Fig. 8 is a kind of structure diagram for agent equipment that another embodiment of the present invention provides.
Specific embodiment
An embodiment of the present invention provides a kind of method and agent equipment for obtaining host additional information, for easily obtaining Host additional information.
As shown in Figure 1, it illustrates involved by a kind of method for obtaining host additional information provided in an embodiment of the present invention Network architecture diagram.As shown in Figure 1, the network architecture includes host 101, agent equipment 102 and Dynamic Host Configuration Protocol server 103. Host 101 is equipped with dhcp client, and host 101 can be by the dhcp client IP address requesting that sets thereon, and DHCP takes Device 103 be engaged in IP address distribution function.The interaction of DHCP message is carried out between dhcp client and Dynamic Host Configuration Protocol server 103, i.e., Dynamic Host Configuration Protocol server 103 can be achieved and distribute IP address to dhcp client.
Agent equipment 102 is connected respectively with dhcp client and Dynamic Host Configuration Protocol server 103, in dhcp client and DHCP service When device 103 carries out DHCP message interaction, for these DHCP messages all by agent equipment 102, agent equipment 102 both can be by these DHCP message passes through next equipment, and can DHCP message be intercepted and captured and handled.
Wherein, the agent equipment of the embodiment of the present invention is configured with the IP address distribution function based on DHCP, the agent equipment It can be to the host assignment IP address.The agent equipment can also ask the additional information of the host, the additional information example to the host Such as can be host name information.
It is appreciated that agent equipment includes a variety of realization methods in embodiments of the present invention, proxy server is may be, for example, Or be dhcp relay agent (Relay Agent) etc., the embodiment of the present invention is not specifically limited this.
In the embodiment having in the present invention, agent equipment has communication link with dhcp client and Dynamic Host Configuration Protocol server respectively It connects, agent equipment obtains the first discovery message of dhcp client transmission, which carries dhcp client The MAC Address of place host, if agent equipment does not preserve host name corresponding with the MAC Address, agent equipment is the master Machine distributes temporary ip address, then, using temporary ip address to the additional information of host requesting host.
In the embodiment having in the present invention, agent equipment has communication link with dhcp client and Dynamic Host Configuration Protocol server respectively It connects, agent equipment obtains the request message that dhcp client is sent, and request message carries the first TransactionID and DHCP visitors The MAC Address of host where the end of family;Agent equipment also obtains the confirmation message of Dynamic Host Configuration Protocol server transmission, and confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;As the first TransactionID and second When TransactionID is matched, agent equipment determines the IP address that the IP address is the host being connected with the agent equipment, from And agent equipment uses additional information of the IP address to host request to the host.
In this way, need to only dispose the agent equipment between dhcp client and Dynamic Host Configuration Protocol server, agent equipment is in DHCP visitors When IP address is applied at family end, the MAC Address of the host on discovery message sent by dhcp client is screened, and is determined Whether the additional information of the host has been obtained, if not obtaining, agent equipment is for the dhcp client one temporary IP of distribution Location, so as to determine the network site of dhcp client place host by the temporary ip address, agent equipment uses should Temporary ip address can ask the additional information of the host to host.Such mode avoids to get the additional of host Information and to the transformation of Dynamic Host Configuration Protocol server, agent equipment specially visits the IP address of client without with prospecting tools It surveys, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and carry out corresponding shielding measure, so as to this reality The method for applying example is simple and practicable.
It is better understood from for the ease of the information processing method to the embodiment of the present invention, is hereafter specifically implemented with two groups Example is described in detail.
Fig. 2 is a kind of method flow diagram of method for obtaining host additional information provided in an embodiment of the present invention.
With reference to the network architecture diagram of figure 1 and more than content, refering to Fig. 2, the method for the embodiment of the present invention includes:
Step 201:Agent equipment obtains first that dhcp client is sent and finds message.
It was found that (DHCP discovery) message is a kind of message of dhcp address assigning process starting stage.The present embodiment In " first find message " and " the second discovery message " be not order of representation relation, but in order to distinguish different discovery reports Text, first, second grade mentioned in following file is also for distinguishing different messages.
Wherein, the MAC Address of host where the first discovery message carries dhcp client.
When dhcp client will apply for IP address, which finds message to Web broadcast.Because in the present invention In embodiment, which communicates to connect respectively with the dhcp client and Dynamic Host Configuration Protocol server, so as to the proxy server The first discovery message is first got with Dynamic Host Configuration Protocol server.Host where the first discovery message carries the dhcp client MAC Address.
Step 202:If agent equipment does not preserve additional information corresponding with the MAC Address, agent equipment is the master Machine distributes temporary ip address.
Agent equipment parses the first discovery message, in the chaddr field values for obtaining the first discovery message MAC Address.The MAC Address is the MAC Address of host where the dhcp client.
Then, agent equipment detects whether there is additional information corresponding with the MAC Address, to determine to first discovery The corresponding operating of message, if agent equipment does not preserve additional information corresponding with the MAC Address, agent equipment is the host point With temporary ip address, to determine the position on the network of the host according to the temporary ip address, so as to according to the temporary ip address The additional information of the host is asked to the host.If the agent equipment preserves additional information corresponding with the MAC Address, generation Equipment is managed without distributing temporary ip address to the dhcp client.Agent equipment sets lease time for temporary ip address, works as rent It makes an appointment after expiring, the temporary ip address will be discharged.After temporary ip address is released, dhcp client will re-initiate application The process of IP address.
Wherein, additional information can be the information such as the host name of host.
Step 203:Proxy server uses additional information of the temporary ip address to host requesting host.
Agent equipment is the host assignment temporary ip address, to be determined according to the temporary ip address on the network of the host Position, so as to ask the additional information of the host to the host according to the temporary ip address.
The mode of wherein agent equipment to host request additional information have it is a variety of, for example, agent equipment and the host Pass through ICMP (English full name:Internet Control Message Protocol;Chinese:Internet controls message Agreement) message interaction, obtain additional information.Specifically, agent equipment sends to ask the response of additional information to the host (ICMP Echo request) message is asked, host can feed back to the additional information for carrying host according to the response request message Response response (ICMP Echo reply) message.
In conclusion being communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server on agent equipment, agent equipment obtains The first discovery message that the dhcp client is sent is taken, the MAC of host where which carries dhcp client Address.If agent equipment does not preserve host name corresponding with the MAC Address, agent equipment is for the host assignment temporary IP Location.Then, using temporary ip address to the additional information of host requesting host.In this way, it need to only be taken in dhcp client and DHCP The agent equipment is disposed between business device, agent equipment is sent in dhcp client application IP address by dhcp client It was found that the MAC Address of the host on message is screened, determine whether to have obtained the additional information of the host.If it does not obtain It takes, then agent equipment distributes a temporary ip address for the dhcp client, so as to determine this by the temporary ip address The network site of host, agent equipment can ask the attached of the host using the temporary ip address to host where dhcp client Add information.Such mode avoids to get the additional information of host and to the transformation of Dynamic Host Configuration Protocol server, agent equipment Without specially being detected with prospecting tools to the IP address of client, information mistake of the user of client because worrying itself is prevented More is exposed, and carries out corresponding shielding measure.Therefore the method for the embodiment of the present invention is simple and practicable.
Optionally, the relevant information of substantial amounts of host in network is managed for the ease of proxy server, Huo Zhewei Convenient for subsequently can quick search to the additional information of host, in the embodiment having, proxy server can also be established additional The correspondence of information, MAC Address and real IP address three.At this point, it in this embodiment, after step 203, further includes Following step.
Step 204:Agent equipment is established and preserves the additional information of host and the correspondence of both MAC Address.
After agent equipment gets the additional information of host using temporary ip address, establish and preserve the additional information of host The correspondence for finding both MAC Address of host entrained in message with first.By the correspondence, the host it is attached Add information and the MAC Address of the host that can identify mutually.And agent equipment subsequent operation can be used as to perform condition.
Step 205:Agent equipment obtains second that dhcp client is sent and finds message.
Wherein, the second discovery message carries MAC Address.
Temporary ip address is distributed for the dhcp client and the dhcp client is obtained according to the IP address in agent equipment After the additional information of place host, after the temporary ip address lease time of the host expires, which is released.The master Machine will apply for IP address again by dhcp client, at this point, the dhcp client finds message to Web broadcast second.
Step 206:If according to the additional information of host and the correspondence of both MAC Address, determine that agent equipment is protected There is additional information corresponding with the MAC Address that second finds message carrying, agent equipment is sent out to Dynamic Host Configuration Protocol server transparent transmission second Existing message, so that Dynamic Host Configuration Protocol server is host assignment real IP address.
Because in step 204, agent equipment is established and preserves the additional information of host and the correspondence of both MAC Address, After agent equipment gets the second discovery message, agent equipment is with parsing the MAC for the host that the second discovery message carries According to the MAC Address, corresponding additional information is found out from the additional information and the correspondence of both MAC Address to prestore for location. At this point, agent equipment can inquire about corresponding additional information, so as to agent equipment, to Dynamic Host Configuration Protocol server transparent transmission, this second finds message, So that Dynamic Host Configuration Protocol server is host assignment real IP address.
Step 207:Agent equipment obtains at least one DHCP message of Dynamic Host Configuration Protocol server and dhcp client interaction.
Wherein, real IP address and MAC Address are carried at least one DHCP message.
Dynamic Host Configuration Protocol server is after the second discovery message is received, to send the dhcp client distribution of the second discovery message Real IP address, real IP address are the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution.
Offer (the DHCP that the assigning process of the real IP address is interacted by Dynamic Host Configuration Protocol server and dhcp client Offer) message, request (DHCP request) message and confirmation (DHCP ACK) message are realized.
In the embodiment having in the present invention, agent equipment can obtain confirmation message, and be parsed from the confirmation message The real IP address and the MAC Address of host that DCHP clients are assigned to.
In the embodiment having in the present invention, agent equipment can obtain request message and confirmation message, from request message solution The MAC Address of host, second is parsed from confirmation message where the first TransactionID and dhcp client is precipitated TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution, pass through the first TransactionID and second The real IP address corresponded and host MAC address are determined in the matching of TransactionID.
In the embodiment having in the present invention, agent equipment can obtain real IP address from providing in message, and the MAC of host It address can be from other Receive messages.
Step 208:Agent equipment is according to the MAC Address included at least one DHCP message and the correspondence of preservation Relation establishes the correspondence of additional information, MAC Address and real IP address three.
In step 204, agent equipment is established and preserves the additional information of host and the correspondence of both MAC Address, After agent equipment gets MAC Address and the real IP address of host in step 207, agent equipment can according to the MAC Location is inquired about in the correspondence of the two, obtains corresponding host additional information, so as to establishing additional information, MAC Location and the correspondence of real IP address three, after establishing the correspondence of the three, agent equipment can preserve the correspondence.
In conclusion on the agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, agent equipment The first discovery message that dhcp client is sent is obtained, the MAC of host where the first discovery message carries dhcp client Location.Host is screened by the MAC Address, determining to haunt gets the host of additional information.If agent equipment is not protected Have a host name corresponding with MAC Address, agent equipment is host assignment temporary ip address, so as to agent equipment can use face When additional information from IP address to host requesting host.In order to establish pair of additional information, MAC Address and real IP address three It should be related to, agency first establishes and preserves the additional information of host and the correspondence of both MAC Address, to prepare.Then generation Reason equipment obtains the second of dhcp client transmission and finds message, and the second discovery message carries MAC Address;If according to master The additional information of machine and the correspondence of both MAC Address determine that agent equipment preserves additional information corresponding with MAC Address, Agent equipment finds message to Dynamic Host Configuration Protocol server transparent transmission second, so that Dynamic Host Configuration Protocol server is host assignment real IP address.So as to, Agent equipment obtains at least one DHCP message of Dynamic Host Configuration Protocol server and dhcp client interaction, is taken at least one DHCP message Band real IP address and MAC Address;Agent equipment is according to the MAC Address included at least one DHCP message and pair of preservation It should be related to, establish the correspondence of additional information, MAC Address and real IP address three.
Such mode avoids to establish the correspondence of host name, host MAC address and real IP address and right The transformation of Dynamic Host Configuration Protocol server, agent equipment specially visit the IP address and MAC Address of client without with prospecting tools It surveys, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and carry out corresponding shielding measure, so as to this hair The method for the acquisition host additional information that bright embodiment provides is simple and practicable.
Fig. 3 is a kind of method flow diagram of method for obtaining host additional information provided in an embodiment of the present invention.In this hair In bright embodiment, the additional information using agent equipment as proxy server, host is that host name is described in detail.With reference to The content of network architecture diagram shown in FIG. 1 and above-mentioned embodiment illustrated in fig. 2, referring to Fig. 3, method stream provided in an embodiment of the present invention Journey includes:
Step 301:Proxy server obtains first that dhcp client is sent and finds message.Wherein, first message is found The MAC Address of host where carrying dhcp client.
The host of IP address is needed to broadcast the first discovery message into network by dhcp client, with request with renting IP Location.Because of the also no distribution IP address, therefore the source IP address in the first discovery message is of the host belonging to the first discovery message 0.0.0.0。
All hosts on the home network can be received by the first of this broadcast and find message, but only DHCP service Device has the function of that the equipment for distributing IP address just answers this broadcasting packet.
As shown in Figure 1, because proxy server communicates to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, i.e. agency service Device is serially connected between dhcp client and Dynamic Host Configuration Protocol server, so proxy server gets first hair prior to Dynamic Host Configuration Protocol server Existing message.
Step 302:If proxy server does not preserve host name corresponding with the MAC Address, proxy server to Dhcp client sends first and provides message.
Wherein, first message carrying temporary ip address is provided.
After proxy server gets the first discovery message, in the chaddr field values for reading the first discovery message MAC Address.The MAC Address is the MAC Address of host where the dhcp client.
Proxy server locally searches the corresponding host name of the MAC Address in proxy server, and whether judgement has thereon Host name corresponding with the MAC Address.If proxy server has a host name corresponding with the MAC Address, transparent transmission this One finds message, so that Dynamic Host Configuration Protocol server distributes IP address for the dhcp client.If proxy server does not have and the MAC The corresponding host name in address then replys from proxy server to client and provides message.The proxy server is configured with DHCP clothes Be engaged in device distribution IP address function, so the proxy server can feed back the offer DHCP messages such as message, with to the client Distribute temporary ip address.
Proxy server is judged not preserving host name corresponding with the MAC Address on the first discovery message thereon Afterwards, which distributes temporary ip address to the dhcp client.
In the embodiment having in the present invention, which is less than default for the lease time that the temporary ip address is set Time value.It is smaller to may be such that the lease time of the temporary ip address is set by the setting of the preset time value, for example, this is pre- If time value lease time more corresponding than the real IP address that Dynamic Host Configuration Protocol server distributes is much smaller.So as to which proxy server is set One lease time of very little gives the temporary ip address.In this way, host belonging to the dhcp client only one section shorter when It is interior use the temporary ip address, the dhcp client can within a short period of time due to lease time expires with applying for IP again Location reduces the function restriction that dhcp client is brought by the IP address that non-Dynamic Host Configuration Protocol server is used to distribute.
It is appreciated that in the embodiment having, it can not to the lease time of the temporary ip address of proxy server setting It is construed as limiting, as long as proxy server can be allowed to get the host name of host where dhcp client according to temporary ip address.
In an embodiment of the present invention, lease time is configured by proxy server is unified, and proxy server can be by the One offer message and/or the first confirmation message notify the lease time to dhcp client.
The proxy server to the dhcp client in order to distribute temporary ip address, and the proxy server is to the DHCP client End sends first and provides message, which includes distributing to temporary ip address of the dhcp client etc. with confidence Breath.
For example, after proxy server gets the first discovery message of dhcp client, the first discovery message is parsed Chaddr field values MAC Address be " 02-60-8C-57-A1-02 ".Proxy server, which inquires thereon, not to be had with being somebody's turn to do After the corresponding host name of MAC Address, proxy server takes out an IP from the free IP addresses pond of the proxy server management Address " 209.0.0.5 " is used as temporary ip address, and the temporary ip address is distributed to the client.Proxy server faces for this When IP address distribute the lease time of 1 minute.Then, proxy server provides report according to the information structurings such as temporary ip address first Text, and the first offer message is provided, carry the temporary ip address in the Yiaddr fields on the first offer message.
Step 303:Proxy server obtains the first request message that dhcp client is sent.
Wherein, the MAC Address of host where request message includes dhcp client.
After dhcp client gets the first offer message of proxy server transmission, select in the first offer message The temporary ip address of the Yiaddr fields of carrying is the address of dhcp client, and constructs the first request message and be sent to agency's clothes Business device.
Dhcp client is by sending first request message, the first offer message that response agent server is sent.It should The source address of first request message is full 0, but in the option50requested ip address words of first request message Section can carry the temporary IP, i.e. the first request message carries temporary ip address.
Dhcp client may be connected with a not only proxy server, it is also possible to be both connected with proxy server, also with Other Dynamic Host Configuration Protocol server connections.At this moment, dhcp client finds message to Web broadcast first, and receives the first discovery report Text and be capable of providing the server of IP address, all can give client respond one offer message, with provide an IP address to The client.So client may receive offer message from a more than server, client can select one of those Message is provided.And a request message is broadcasted into network, show oneself to have received the IP address that a server provides. Comprising received IP address and it has been accepted that the IP address of server in the request message.
In the embodiment of the present invention, dhcp client broadcasts the first request message, which carries the temporary IP Address represents that the dhcp client has received the temporary ip address of proxy server distribution, and causes other DHCP services Device is known:They can discharge the address having been provided, and these addresses are returned in free address pond.
Wherein, package identification is Request by DHCP parts, and uses DHCP:Requested Address fields are true There is provided address is provided.DHCP:The display of Server Identifier fields provides the IP address of the Dynamic Host Configuration Protocol server of lease.
In the embodiment of the present invention, client has selected proxy server sends first to provide message, and to agency service Device returns to the first request message.
Step 304:Proxy server sends the first confirmation message to dhcp client.
After proxy server receives the first request message of dhcp client transmission, parse what is carried in the request message Chaddr field values obtain the MAC Address of field carrying,
Proxy server searches the corresponding host name of the MAC Address on the ground at this.If there is corresponding with the MAC Address Host name, then proxy server let pass the request message.If the proxy server does not preserve master corresponding with the MAC Address Machine name, then proxy server judge whether the content of the Server Identifier fields of first request message is the agency The IP address of server.If not the IP address of the proxy server, show that dhcp client does not select the agency service The temporary ip address of device distribution, so as to which proxy server abandons the message.If the Server of first request message The content of Identifier fields is the IP address of the proxy server, then shows that dhcp client has selected proxy server point The temporary ip address matched somebody with somebody, proxy server send the first confirmation message to dhcp client.In general, confirmation message is DHCP The message for being used to confirm IP address lease that server is sent, after Dynamic Host Configuration Protocol server sends confirmation message, will distribute at this Allocated IP address is deleted from free address pond in journey, is increased in allocation tables allocated in the assigning process IP address and the correspondence of the MAC Address of the host as distribution object.In the present embodiment it can be appreciated that first is true Recognize message instruction proxy server to have completed to distribute the process of temporary ip address for dhcp client.
Proxy server shows that proxy server has received visitor to first confirmation message of dhcp client broadcast transmission The selection at family end, and the legal rental of this temporary ip address and other configuration informations are all put into the message and issue client End.So as to which proxy server has been completed to distribute temporary ip address to the dhcp client.
Dhcp client can carry out corresponding configuration behaviour after first confirmation message is received using the information in the message Make.The dhcp client binds the MAC Address of temporary ip address and place host.Dhcp client is in and has bound shape After state, IP address assigning process is completed, and the host where the dhcp client can use temporary ip address progress network to lead to Letter.
Step 305:Proxy server sends the response request message for requesting host name to the host.
Wherein, respond request message and carry the temporary ip address.
After the completion of proxy server distributes the operation of temporary ip address for client, proxy server can determine DHCP visitors The currently used IP address in family end is temporary ip address, and proxy server can determine the DHCP client according to the temporary ip address The network site of host where end.So as to which in order to obtain the host name of the host, proxy server faces proxy server according to this When IP address, send back to the host for binding the temporary ip address and answer request message, the response request message is for asking client The host name at end.
For example, responding data of the request message as IP datagram, in addition the stem of datagram, composition IP datagram is sent It goes out.The destination address that the IP datagram of request message is responded in the carrying is the temporary ip address of dhcp client binding, i.e., should The address of host where dhcp client, " 209.0.0.5 ", source address are the IP address of proxy server “128.30.33.33”。
Step 306:Proxy server obtains the response response message of host transmission.
Wherein, the host name that response message carries the host is responded.
The embodiment of the present invention is illustrated with the host name of proxy server acquisition host, which belongs to main One kind of the additional information of machine, in the embodiment of the invention having, which can also obtain other additional informations, Such as software-hardware configuration information of relevant department's information of host, host etc..
After host where dhcp client gets the response request message, its host is obtained according to the instruction of the message Name constructs according to the host name and responds response message, which sends back to the proxy server and answer response message, so that agency Server gets the host name of the host.
For example, host is constructed according to its host name " PC01 " responds response message, the response response message is as IP data The data of report, in addition the stem of datagram, composition IP datagram is sent.The IP datagram of response message is responded in the carrying Destination address is the IP address " 128.30.33.33 " of proxy server, and source address is the temporary ip address of the host binding “209.0.0.5”。
Step 304 and step 305, be it is specific using host name from temporary ip address to host requesting host wherein One mode.
As shown in the above, proxy server will first determine the net of the host to get the host name of host Network position, when the host sends discovery message to apply for IP address by dhcp client, proxy server is DHCP visitors A temporary ip address is allocated at family end in advance, and after dhcp client binds the temporary ip address, proxy server can be according to this The network site of host where temporary ip address determines the dhcp client, and sent according to the temporary ip address to the host For obtaining the request of host name, to obtain the host name of the host.Because the temporary ip address is that proxy server is objective for DHCP The distribution of family end, it is detected without the IP address current to host where dhcp client.
Step 307:Proxy server establishes the host name of host and the correspondence of both MAC Address;
After proxy server gets response response message, the message is parsed, obtains the dhcp client of message carrying Then the host name of place host, establishes the correspondence of the host name of the host and the MAC Address of the host.And to this The correspondence of host name and the MAC Address is preserved.
The correspondence establishes process and can be, because carrying temporary ip address and host name on the response response message, So as to obtain the host name and temporary ip address for belonging to same host according to the response response message, then, according to agency service The MAC Address and the correspondence of temporary ip address pre-established on device, using temporary ip address as index, proxy server is built Found the correspondence of the host name of the host and the MAC Address of the host.Alternatively, using order as intermediary, proxy server obtains To a host MAC Address and to the host assignment temporary ip address belonging to the MAC Address after, proxy server is only sent one time Request message is answered, afterwards, after proxy server gets first response response message, is directly taken with the response response message The host name of band and the MAC Address got before establish the correspondence of host name and MAC Address.Proxy server Other methods can also be used to establish the correspondence of Hostname and MAC Address, the embodiment of the present invention does not limit this specifically It is fixed.
As shown in Table 1, the proxy server of the embodiment of the present invention can be established and preserve multigroup host name and MAC Address Correspondence.
Table one
MAC Address Host name
02-60-8C-57-A1-02 PC01
00-00-C0-15-AD-18 PC02
08-00-2B-00-EE-0A PC03
Proxy server can allow the host belonging to the host name to discharge the temporary ip address after host name is got, So that the host obtains the real IP address of real Dynamic Host Configuration Protocol server distribution by dhcp client, realize that normal network leads to Telecommunication function.And proxy server can also obtain the real IP address that Dynamic Host Configuration Protocol server is distributed to dhcp client.Wherein, DHCP There are many ways to client releases the temporary ip address, the embodiment of the present invention is not especially limited this.Such as:
Method one
As noted previously, as the lease time of the temporary ip address of dhcp client binding is very short, when lease time arrives After phase, dhcp client again broadcast request message to proxy server, it is desirable that update lease period.When getting dhcp client During the request message of broadcast, proxy server denies message to dhcp client transmission.The dhcp client, which receives this, to be denied After message, dhcp client stops using the temporary ip address, and dhcp client sends release message to proxy server.When obtaining When getting the release message of dhcp client transmission, proxy server release temporary ip address.In this way, the state of dhcp client I.e. into original state, restart IP address requesting.
Embodiment as shown in Figure 3, that is, used mode one, i.e. the method for the embodiment of the present invention further includes:
Step 308:Dhcp client sends the second request message to proxy server.
Step 309:Proxy server denies message to dhcp client transmission.
Step 310:Dhcp client sends release message to proxy server.
Mode two,
When the lease time for the temporary ip address that dhcp client is got reaches the 50% of lease time, dhcp client Request message is sent with mode of unicast, proxy server is not responded to client at this time.That is, when getting the dhcp client list During the request message broadcast, proxy server does not respond the dhcp client.
When the lease time of the temporary ip address of dhcp client reaches the 87.5% of lease, dhcp client is to broadcast Mode sends request message.When getting the request message of dhcp client broadcast, proxy server is to the dhcp client Message is denied in transmission.Dhcp client, which receives, denies sending after message release message to proxy server.When getting the DHCP During the release message that client is sent, proxy server discharges the temporary ip address.In this way, the state of dhcp client enters Original state restarts IP address requesting.
In this way, proxy server can deny message by sending, it is the temporary IP of dhcp client distribution before release Address.
Mode three
When the lease time for the temporary ip address that dhcp client is got reaches the 50% of lease time, dhcp client Unitcast request message is sent, proxy server is not responded to client at this time.When the lease of the temporary ip address of dhcp client When time reaches the 87.5% of lease time, dhcp client sends broadcast request message, and proxy server is not also given at this time Dhcp client is responded.Dhcp client sends release message or does not send out any and disappear after when dhcp client address, lease exceeds the time limit Breath, directly restarts applied address.
That is, proxy server does not appoint the DHCP message of the lease time more new class of dhcp client in method three What is responded.Client releases the binding to temporary ip address after the lease time of temporary ip address is exceeded the time limit.
For dhcp client after original state is returned to, the IP address for restarting a new round rents process.It is hereafter generation After reason server gets host name, the corresponding of each equipment of the embodiment of the present invention performs flow.
Step 311:Proxy server obtains second that dhcp client is sent and finds message.
Wherein, the MAC Address of host where the second discovery message carries the dhcp client.
Dhcp client applies for IP address again, and dhcp client finds message to Dynamic Host Configuration Protocol server broadcast second, because of generation Server is managed to be arranged between Dynamic Host Configuration Protocol server and dhcp client, so as to proxy server prior to Dynamic Host Configuration Protocol server get this Two find message.
Step 312:Proxy server finds message to Dynamic Host Configuration Protocol server transparent transmission second.
After proxy server gets the second discovery message, the second discovery message is parsed, is obtained on the discovery message MAC Address in chaddr fields, the MAC Address of MAC Address host where the dhcp client.
According to the host name pre-established and the correspondence of MAC Address, search on proxy server is proxy server It is no to have host name corresponding with the MAC Address on the second discovery message.If agency's clothes are determined according to the correspondence Host name corresponding with the MAC Address is preserved on business device, then proxy server to Dynamic Host Configuration Protocol server transparent transmission report by second discovery Text, so that Dynamic Host Configuration Protocol server is the host assignment real IP address.If proxy server does not have corresponding host name, act on behalf of Server distributes a temporary ip address for the client, i.e., the method that the embodiment of the present invention is performed since above-mentioned step 302.
Step 313:Dynamic Host Configuration Protocol server sends second to dhcp client and provides message.
After Dynamic Host Configuration Protocol server gets the second discovery message, real IP address is distributed for dhcp client.Dynamic Host Configuration Protocol server The configuration information of the dhcp client is first searched in its database, if finding, returns to the information found;If can not find, Dynamic Host Configuration Protocol server takes an IP address to distribute to the dhcp client from the free IP addresses pond of the Dynamic Host Configuration Protocol server.So as to, Dynamic Host Configuration Protocol server constructs one second offer message according to the IP address for distributing to client, is carried on the second offer message The configuration informations such as IP address.Dynamic Host Configuration Protocol server sends the second offer message to dhcp client.The second offer message carries Dynamic Host Configuration Protocol server be dhcp client distribution IP address, be real IP address.
In an embodiment of the present invention, the lease time that Dynamic Host Configuration Protocol server is set can be configured by Dynamic Host Configuration Protocol server, DHCP clothes Business device can provide message and/or the 2nd DHCP confirmation messages to the client notification lease time by the 2nd DHCP.
Step 314:Dhcp client sends the 3rd request message to Dynamic Host Configuration Protocol server.
After dhcp client receives the 2nd DHCP offer messages, the Yiaddr field values carried in the message are selected as this The address of host where dhcp client, and construct the 3rd request message and be sent to Dynamic Host Configuration Protocol server.
Wherein, in embodiments of the present invention, first proxied server obtains the 3rd request message, is then taken by the agency Device be engaged in Dynamic Host Configuration Protocol server transparent transmission.
After Dynamic Host Configuration Protocol server receives the 3rd request message of dhcp client transmission, second is responded really to the dhcp client Recognize message.
Step 315:Proxy server obtains the second confirmation message that Dynamic Host Configuration Protocol server is sent.
Wherein, the MAC Address of host where real IP address and the dhcp client are carried in second confirmation message.
After Dynamic Host Configuration Protocol server receives the 3rd request message of dhcp client transmission, the second confirmation message is responded.Because of second The Yiaddr field values of confirmation message carry the real IP address that client is assigned to, and its chaddr field value carries this The MAC Address of host, proxy server parse second confirmation message where dhcp client, you can get real IP thereon Address and the MAC Address of the host.Because of the IP address and the MAC Address, from same confirmation message, then with can determine the IP Location and the MAC Address belong to same host.
Step 316:The corresponding pass that proxy server is preserved according to the MAC Address on the second confirmation message and step 307 System establishes the correspondence of host name, MAC Address and real IP address three.
Proxy server obtains Dynamic Host Configuration Protocol server and distributes to the IP address of dhcp client and dhcp client place host MAC Address after, proxy server is in the host name and the correspondence of MAC Address for pre-establishing and preserving, inquiry and the The corresponding host name of MAC Address of two confirmation messages, after getting corresponding host name, proxy server can establish real IP Address, the host name of the host, the host MAC Address three's correspondence.After the correspondence of the three establishes, generation Reason server saves the correspondence.
For example, after proxy server gets the second confirmation message of Dynamic Host Configuration Protocol server transmission, parse on the message The MAC Address of host where the dhcp clients of chaddr field values is " 02-60-8C-57-A1-02 ", the Yiaddr of the message The IP address that the dhcp client of field value is assigned to is " 209.0.0.11 ".Proxy server can pass through chaddr field values The MAC Address search local record host name, after finding host name, proxy server can establish the host name, The IP address and the correspondence of the MAC Address of host that dhcp client is assigned to.Such as, if storage is just like table on proxy server The correspondence of MAC Address and host name shown in one, then proxy server is according to the chaddr field values on the confirmation message MAC Address " 02-60-8C-57-A1-02 ", host name PC01 is determined from the correspondence of table one.So as to agency service Device can establish the correspondence of correspondence MAC Address, IP address and host name three:02-60-8C-57-A1-02、 And PC01 209.0.0.11.
Step 317:Proxy server is to dhcp client transparent transmission second confirmation message.
After proxy server gets the second confirmation message, proxy server can be to second confirmation of dhcp client transparent transmission Message, so that dhcp client completes the binding of the MAC Address of the IP address and dhcp client place host, so that Obtain the IP address that the host begins to use Dynamic Host Configuration Protocol server to distribute.
It is appreciated that the embodiment of the present invention is not especially limited the execution sequence of step 317, if step 315 it Afterwards.
In conclusion on the agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, agent equipment The first discovery message that dhcp client is sent is obtained, the MAC of host where the first discovery message carries dhcp client Location.Host is screened by the MAC Address, determining to haunt gets the host of additional information.If agent equipment is not protected Have a host name corresponding with MAC Address, agent equipment is host assignment temporary ip address, so as to agent equipment can use face When additional information from IP address to host requesting host.In order to establish pair of additional information, MAC Address and real IP address three It should be related to, agency first establishes and preserves the additional information of host and the correspondence of both MAC Address, to prepare.Then generation Reason equipment obtains the second of dhcp client transmission and finds message, and the second discovery message carries MAC Address;If according to master The additional information of machine and the correspondence of both MAC Address determine that agent equipment preserves additional information corresponding with MAC Address, Agent equipment finds message to Dynamic Host Configuration Protocol server transparent transmission second, so that Dynamic Host Configuration Protocol server is host assignment real IP address.So as to, Agent equipment obtains at least one DHCP message of Dynamic Host Configuration Protocol server and dhcp client interaction, is taken at least one DHCP message Band real IP address and MAC Address;Agent equipment is according to the MAC Address included at least one DHCP message and pair of preservation It should be related to, establish the correspondence of additional information, MAC Address and real IP address three.
Such mode avoids to establish the corresponding pass of the additional information of host, host MAC address and real IP address System and to the transformation of Dynamic Host Configuration Protocol server, agent equipment without with prospecting tools specially to the IP address and MAC Address of client It is detected, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and carry out corresponding shielding measure.Cause The method of this acquisition host additional information provided in an embodiment of the present invention is simple and practicable.
Fig. 4 be it is provided in an embodiment of the present invention it is a kind of obtain host additional information method method flow diagram, this method It is performed by agent equipment, agent equipment communicates to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, and this method includes:
Step 401:Agent equipment obtains the request message that dhcp client is sent.
Wherein, the MAC Address of host where request message carries the first TransactionID and dhcp client.
In dhcp client application IP address, dhcp client can find message to Web broadcast, get the discovery The Dynamic Host Configuration Protocol server of message distributes IP address for the dhcp client, and Dynamic Host Configuration Protocol server sends to the dhcp client and provides report Text, the offer message include the IP address of Dynamic Host Configuration Protocol server distribution.
Between being arranged on the Dynamic Host Configuration Protocol server of dhcp client because of agent equipment, agent equipment is getting the discovery message With this two message of meeting transparent transmission after offer message.After dhcp client gets and provides message, can be sent to Dynamic Host Configuration Protocol server please Seek message, at this point, request message is treated in agent equipment acquisition, agent equipment, that is, transparent transmission request message, also to the request message into Row parsing obtains the first TransactionID of the request message.In the embodiment having, which parses the request After message, the MAC Address of host where also obtaining dhcp client.
Step 402:Agent equipment obtains the confirmation message that Dynamic Host Configuration Protocol server is sent.
The IP that wherein, confirmation message includes the 2nd TransactionID and Dynamic Host Configuration Protocol server is dhcp client distribution Location.
Dynamic Host Configuration Protocol server sends confirmation message after request message is got, to dhcp client, which carries There is the IP address of the 2nd TransactionID and Dynamic Host Configuration Protocol server for dhcp client distribution.Agent equipment intercepts and captures the confirmation report Wen Hou parses the confirmation message, obtains the 2nd TransactionID and the IP address.
Step 403:As the first TransactionID and the 2nd TransactionID identical, agent equipment is using IP Location is to the additional information of host requesting host.
First TransactionID and the 2nd TransactionID are compared by agent equipment, if first TransactionID and the 2nd TransactionID are identical, it is determined that the IP address on the confirmation message is allocated to and the generation Manage the host of equipment connection.The agent equipment can determine the network site of corresponding host according to the IP address, so as to be somebody's turn to do The IP address can be used in agent equipment, and additional information is asked to the host for being fitted on the IP address.
Optionally, in the embodiment having, proxy server can also establish additional information, MAC Address and real IP address The correspondence of three.At this point, in this embodiment, IP address is being used before the additional information of host requesting host, it should Method further includes:
It establishes and preserves MAC Address and the correspondence of both IP address, in this way, on agent equipment, it can be according to the MAC Address and the IP address identify mutually, and the two belongs to same host, so as to when agent equipment is connected with multiple main frames, avoid by MAC Address and IP address thereon is obscured.
And the method for the embodiment of the present invention is also wrapped after the additional information of host requesting host using IP address It includes:According to the correspondence and IP address of preservation, the correspondence of IP address, additional information and MAC Address is established.
In this way, using IP address to the additional information of host requesting host, additional information corresponding with IP address is can obtain, According to the IP address, searched in the MAC Address and the correspondence of both IP address pre-established, find out with it is corresponding MAC Address, so as to which agent equipment can establish the correspondence of IP address, additional information and MAC Address, establish and complete the three Correspondence after, agent equipment can preserve the correspondence of the three or send the corresponding of the three to miscellaneous equipment and close System.
In conclusion on the agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, agent equipment The request message that dhcp client is sent is obtained, request message carries master where the first TransactionID and dhcp client The MAC Address of machine;Agent equipment also obtains the confirmation message of Dynamic Host Configuration Protocol server transmission, and confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;As the first TransactionID and second When TransactionID is matched, establish and preserve MAC Address and the correspondence of both IP address, in this way, agent equipment can make MAC Address and IP address that must thereon identify mutually, determine MAC Address and IP address in same host.Then, act on behalf of Equipment using additional information from IP address to host requesting host according to the correspondence and IP address of preservation, establish IP address, The correspondence of additional information and MAC Address.
Such mode, avoid to establish the additional information of host, the correspondence of MAC Address and IP address and it is right The transformation of Dynamic Host Configuration Protocol server, agent equipment specially visit the IP address and MAC Address of client without with prospecting tools It surveys, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and carry out corresponding shielding measure.Therefore this hair The method of with the obtaining host additional information of bright embodiment offer is simple and practicable.
Fig. 5 is a kind of method flow diagram of method for obtaining host additional information provided in an embodiment of the present invention.In Fig. 5 institutes In the embodiment shown, using agent equipment as proxy server, the additional information of host is described in detail for host name.With reference to figure The content of network architecture diagram and above-mentioned embodiment illustrated in fig. 4 shown in 1, referring to Fig. 5, method flow provided in an embodiment of the present invention Including:
Step 501:Dhcp client sends to Dynamic Host Configuration Protocol server and finds message.
Dhcp client broadcast finds message, to ask to rent IP address.Because of the client, there is presently no the IP of oneself Address, therefore the DHCP is had found that the source IP address of the IP datagram belonging to message is set to full 0 by it.
Proxy server is arranged between client and server, therefore, the message of interaction all passes through between client and server The proxy server.In embodiments of the present invention, proxy server can be directly to the Dynamic Host Configuration Protocol server transparent transmission discovery message.This hair The transparent transmission of bright embodiment can for example refer to message from proxy server by the way that proxy server parses the MAC and IP of the message Header is not required proxy server midway to intervene and just directly forwards.
Step 502:Dynamic Host Configuration Protocol server sends to dhcp client and provides message.
The realization details of step 502 can refer to step 313.
Step 503:Proxy server obtains the request message that dhcp client is sent.
Wherein, the MAC Address of host where which carries the first TransactionID and dhcp client.
Dhcp client may receive multiple offer messages that different Dynamic Host Configuration Protocol server are sent, and dhcp client selects wherein One Dynamic Host Configuration Protocol server, and send DHCP request message to selected Dynamic Host Configuration Protocol server.In the present embodiment, client to Dynamic Host Configuration Protocol server sends the DHCP request message, and proxy server gets the DHCP request message prior to Dynamic Host Configuration Protocol server.
After proxy server gets the DHCP request message of client transmission, which is parsed, The MAC Address and the first TransactionID of host where obtaining the dhcp client carried on the message.And agency service Device is to the Dynamic Host Configuration Protocol server transparent transmission DHCP request message.
Step 504:Proxy server is to the Dynamic Host Configuration Protocol server transparent transmission request message.
After proxy server gets the request message, to the Dynamic Host Configuration Protocol server transparent transmission request message.
Step 505:Proxy server obtains the confirmation message that Dynamic Host Configuration Protocol server is sent.
The IP that wherein, confirmation message includes the 2nd TransactionID and Dynamic Host Configuration Protocol server is dhcp client distribution Location.
After getting request message by the Dynamic Host Configuration Protocol server that dhcp client selects, dhcp client broadcast can be given to return Confirmation message shows to have received the selection of the dhcp client, and IP address and other configuration informations is all put into this Dhcp client is issued in message.Because proxy server is set between clients and servers, proxy server is prior to client End gets the confirmation message that Dynamic Host Configuration Protocol server is sent to dhcp client.
After proxy server gets the confirmation message, taken to the dhcp client transparent transmission confirmation message, and in agency The confirmation message is parsed on business device, obtains the IP address and second that the dhcp client on the confirmation message is assigned to TransactionID.Wherein, Transaction affairs ID is, client send every time selected during DHCP request message it is random Number, the response message for matching Dynamic Host Configuration Protocol server correspond to the response of which request message.Dhcp client can abandon " thing The business unmatched response messages of ID ".
In this way, proxy server has got the IP address that dhcp client is assigned to.
Step 506:As the first TransactionID and the 2nd TransactionID identical, proxy server is established simultaneously Preserve the correspondence of both MAC Address and IP address.
The MAC Address and TransactionID that are got by step 304 correspond to, and the IP address that step 306 is got and TransactionID is corresponded to, and so as to which proxy server is according to the index of the TransactionID, establishes the MAC Address of client With the correspondence of the IP address of client.
Step 507:Proxy server is to the client transparent transmission confirmation message.
After proxy server gets the confirmation message, proxy server can to the dhcp client transparent transmission confirmation message, So that client completes the binding of the MAC Address of the IP address and client, so as to which the host where the dhcp client is opened Begin the IP address distributed using Dynamic Host Configuration Protocol server.
Step 508:Proxy server sends the response request message for requesting host name to the host.
Wherein, respond request message and carry the IP address that the host assignment arrives.
After dhcp client binds the IP address, the host where dhcp client can use the IP address.Agency After server obtains the IP address that the dhcp client is assigned to, with can determine whether out the currently used IP of the dhcp client Location then according to the IP address, sends back to the host for binding the IP address and answers request message.The response request message is used for please Seek the host name of client.
Specifically, the realization details of step 508 can refer to step 305.
Step 509:Proxy server obtains the response response message that host is sent.
Wherein, which carries the host name of the host.
The realization details of step 509 can refer to step 306.
Step 508 and step 509, be specific proxy server using IP address to machine requesting host name wherein it One mode.
Step 510:Proxy server is according to the correspondence and IP address of preservation, with establishing IP address, host name and MAC The correspondence of location.
The response response message that the host is sent carries the IP address of the host, so as to which proxy server parses this time After answering response message, the IP address and host name of the host are obtained.Proxy server is according to the MAC Address and IP pre-established In the correspondence of location, MAC Address corresponding with the IP address that the response response message carries is got, so as to establish host Host name, the MAC Address of the host and the correspondence of IP address, i.e., according to the IP address and pre-stored MAC Address With the correspondence of IP address, the correspondence of IP address, host name and MAC Address is established.It then can to the IP of the foundation The correspondence of location, host name and MAC Address is stored.
In conclusion on the agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, agent equipment The request message that dhcp client is sent is obtained, request message carries master where the first TransactionID and dhcp client The MAC Address of machine.Agent equipment also obtains the confirmation message of Dynamic Host Configuration Protocol server transmission, and confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution.As the first TransactionID and second When TransactionID is identical, establishes and preserve MAC Address and the correspondence of both IP address.In this way, agent equipment can make MAC Address and IP address that must thereon identify mutually, determine MAC Address and IP address in same host.Then, act on behalf of Equipment using additional information from IP address to host requesting host according to the correspondence and IP address of preservation, establish IP address, The correspondence of additional information and MAC Address.
Such mode avoids to establish the correspondence of host name, MAC Address and IP address and to Dynamic Host Configuration Protocol server Transformation, agent equipment specially detects the IP address and MAC Address of client without with prospecting tools, prevents client The user at end is exposed because worrying that the information of itself is excessive, and carries out corresponding shielding measure.Therefore, the embodiment of the present invention carries The method of the additional information of the acquisition host of confession is simple and practicable.
Fig. 6 is a kind of structure diagram of agent equipment provided in an embodiment of the present invention, which is used to perform Fig. 2 The function that the agent equipment of any implementation in embodiment corresponding with Fig. 3 performs.The agent equipment respectively with dhcp client and Dynamic Host Configuration Protocol server communicates to connect, and referring to Fig. 6, which includes:
First acquisition unit 601, first for obtaining dhcp client transmission finds message, and first finds that message carries The MAC Address of host where having dhcp client;
Allocation unit 602 is host assignment if not preserving host name corresponding with MAC Address for agent equipment Temporary ip address;
Request unit 603, for using temporary ip address to the additional information of host requesting host.
Optionally,
Agent equipment further includes:
First establishes unit 604, for establishing and preserving the correspondence of the additional information of host and both MAC Address;
Second acquisition unit 605, second for obtaining dhcp client transmission finds message, and second finds that message carries There is MAC Address, second finds that message is that dhcp client is sent after temporary ip address is released;
Transparent transmission unit 606, if determining to act on behalf of for the additional information according to host and the correspondence of both MAC Address Equipment preserves additional information corresponding with the MAC Address of the second discovery message carrying, is found to Dynamic Host Configuration Protocol server transparent transmission second Message, so that Dynamic Host Configuration Protocol server is host assignment real IP address;
3rd acquiring unit 607, for obtaining at least one DHCP message of Dynamic Host Configuration Protocol server and dhcp client interaction, Real IP address and MAC Address are carried at least one DHCP message;
Second establishes unit 608, for according to the MAC Address and the correspondence of preservation included at least one DHCP message Relation establishes the correspondence of additional information, MAC Address and real IP address three.
Optionally,
At least one DHCP message, what the confirmation message or Dynamic Host Configuration Protocol server sent including Dynamic Host Configuration Protocol server was sent carries For message.
Optionally,
Request unit 603, including:
First transmission sub-unit 609, for sending to ask the response request message of additional information to host, responding please Message is asked to carry temporary ip address;
First obtains subelement 610, for obtaining the response response message of host transmission, with responding the source IP of response message Location is temporary ip address, responds the additional information that response message carries host.
Optionally,
Allocation unit 602, including:
Second transmission sub-unit 611 provides message for being sent to dhcp client, provides message with carrying temporary IP Location;
Second obtains subelement 612, and for obtaining the request message of dhcp client transmission, which carries interim IP address, the request message carry MAC Address;
Judgment sub-unit 613, if not preserving additional information corresponding with MAC Address for agent equipment, judging please Ask the Server Identifier fields of message content whether be agent equipment IP address;
3rd transmission sub-unit 614, if being set for the content of the Server Identifier fields of request message for agency Standby IP address, then send confirmation message to dhcp client, and confirmation message is used to indicate agent equipment and has completed as DHCP visitors The process of temporary ip address is distributed at family end.
Optionally,
Agent equipment further includes:
First transmitting element 615, for when getting the request message of dhcp client broadcast, being sent out to dhcp client It send and denies message;
First releasing unit 616, for when getting the release message that dhcp client is sent, discharging temporary IP Location.
Optionally,
Agent equipment further includes:
3rd acquiring unit 617, for when getting the request message of client unicast, not responding dhcp client;
Second transmitting element 618, for when getting the request message of client broadcast transmission, being sent out to dhcp client It send and denies message;
Second releasing unit 619, for when getting the release message that dhcp client is sent, discharging temporary IP Location.
In conclusion being communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server on agent equipment, first obtains list The first of 601 acquisition dhcp client transmission of member finds message, which carries master where dhcp client The MAC Address of machine.If agent equipment does not preserve host name corresponding with the MAC Address, allocation unit 602 is the host point With temporary ip address.Then, request unit 603 uses additional information of the temporary ip address to host requesting host.In this way, it only needs The agent equipment is disposed between dhcp client and Dynamic Host Configuration Protocol server, agent equipment in dhcp client application IP address, The MAC Address of the host on discovery message sent by dhcp client is screened, and determines whether to have obtained the master The additional information of machine.If not obtaining, agent equipment distributes a temporary ip address for the dhcp client, so as to be faced by this When IP address determine the network site of host where the dhcp client, agent equipment can be to master using the temporary ip address Machine asks the additional information of the host.Such mode avoids to get the additional information of host and to Dynamic Host Configuration Protocol server Transformation, agent equipment specially detects the IP address of client without with prospecting tools, prevents the user of client It is exposed because worrying that the information of itself is excessive, and carries out corresponding shielding measure.Therefore the method for the embodiment of the present invention is simple It is easy.
Fig. 7 is a kind of hardware architecture diagram of agent equipment provided in an embodiment of the present invention.Referring specifically to Fig. 7, sheet Another embodiment of agent equipment in inventive embodiments, specifically includes:The agent equipment 700 can be different because of configuration or performance And generate bigger difference, can include one or more central processing units (central processing units, CPU) 701 (for example, one or more processors) and memory 702, one or more storage application programs 7031 Or the storage medium 503 (such as one or more mass memory units) of data 7032.Wherein, memory 702 and storage Medium 703 can be of short duration storage or persistent storage.One or more can be included by being stored in the program of storage medium 703 Module (diagram does not mark), each module can include operating the series of instructions in server.Further, centre Reason device 701 could be provided as communicating with storage medium 703, and a series of fingers in storage medium 703 are performed on agent equipment 700 Order operation.
Agent equipment 700 can also include one or more power supplys 704, one or more wired or wireless nets Network interface 705, one or more input/output interfaces 706 and/or, one or more operating systems 7033, such as Windows Server TM, Mac OS XTM, Unix TM, Linux TM, FreeBSD TM etc..
The agent equipment structure shown in Fig. 7 can be based on as the step performed by agent equipment in above-described embodiment.
Concrete condition is as follows:
The central processing unit 701, has the function of as follows:
The first discovery message that dhcp client is sent is obtained, the first discovery message carries host where dhcp client MAC Address;
It is host assignment temporary ip address if agent equipment does not preserve host name corresponding with MAC Address;
Using temporary ip address to the additional information of host requesting host.
Optionally, the central processing unit 701 specifically also has the function of as follows:
It establishes and preserves the additional information of host and the correspondence of both MAC Address;
The second discovery message that dhcp client is sent is obtained, the second discovery message carries MAC Address, and second finds report Text is that dhcp client is sent after temporary ip address is released;
If determine that agent equipment is preserved and second according to the correspondence of the additional information of host and both MAC Address It was found that the corresponding additional information of MAC Address that message carries, finds message, so that DHCP service to Dynamic Host Configuration Protocol server transparent transmission second Device is host assignment real IP address;
At least one DHCP message of Dynamic Host Configuration Protocol server and dhcp client interaction is obtained, is taken at least one DHCP message Band real IP address and MAC Address;
According to the MAC Address and the correspondence of preservation included at least one DHCP message, establish additional information, MAC Address and the correspondence of real IP address three.
Optionally, the central processing unit 701 specifically also has the function of as follows:
To host transmission for asking the response request message of additional information, respond request message and carry temporary ip address;
The response response message that host is sent is obtained, responds the source IP address of response message as temporary ip address, responding should Answer the additional information that message carries host.
Optionally, the central processing unit 701 specifically also has the function of as follows:
It is sent to dhcp client and message is provided, message is provided and carries temporary ip address;
The request message that dhcp client is sent is obtained, which carries temporary ip address, and request message carries MAC Address;
If agent equipment does not preserve additional information corresponding with MAC Address, the Server of request message is judged The content of Identifier fields whether be agent equipment IP address;
If the content of the Server Identifier fields of request message is the IP address of agent equipment, to DHCP visitors Family end sends confirmation message, and confirmation message is used to indicate agent equipment and has completed to distribute the mistake of temporary ip address for dhcp client Journey.
Optionally, the central processing unit 701 specifically also has the function of as follows:
When getting the request message of dhcp client broadcast, deny message to dhcp client transmission;
When getting the release message of dhcp client transmission, temporary ip address is discharged.
Optionally, the central processing unit 701 specifically also has the function of as follows:
When getting the request message of client unicast, dhcp client is not responded;
When getting the request message of client broadcast transmission, deny message to dhcp client transmission;
When getting the release message of dhcp client transmission, temporary ip address is discharged.
In conclusion it is being communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server on agent equipment, central processing unit 701, which obtain first that the dhcp client is sent, finds message, which carries host where dhcp client MAC Address.If agent equipment does not preserve host name corresponding with the MAC Address, central processing unit 701 is the host point With temporary ip address.Then, central processing unit 701 uses additional information of the temporary ip address to host requesting host.In this way, only The agent equipment need to be disposed between dhcp client and Dynamic Host Configuration Protocol server, agent equipment is in dhcp client application IP address When, the MAC Address of the host on discovery message sent by dhcp client is screened, and determines whether to have obtained this The additional information of host.If not obtaining, agent equipment distributes a temporary ip address for the dhcp client, so as to pass through this Temporary ip address determines the network site of host where the dhcp client, and agent equipment can be to using the temporary ip address Host asks the additional information of the host.Such mode avoids to get the additional information of host and to DHCP service The transformation of device, agent equipment specially detect the IP address of client without with prospecting tools, prevent the use of client Family is exposed because worrying that the information of itself is excessive, and carries out corresponding shielding measure.Therefore the method letter of the embodiment of the present invention It is single easy.
Fig. 8 is a kind of structure diagram of agent equipment provided in an embodiment of the present invention, which is used to perform Fig. 4 The function that the agent equipment of any implementation in embodiment corresponding with Fig. 5 performs.The agent equipment respectively with dhcp client and Dynamic Host Configuration Protocol server communicates to connect, and referring to Fig. 8, which includes:
First acquisition unit 801, for obtaining the request message of dhcp client transmission, request message carries first The MAC Address of TransactionID and dhcp client place host;
Second acquisition unit 802, for obtaining the confirmation message of Dynamic Host Configuration Protocol server transmission, confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;
Request unit 803, for as the first TransactionID and the 2nd TransactionID identical, using IP Location is to the additional information of host requesting host.
Optionally,
Agent equipment further includes:First, which establishes unit 804 and second, establishes unit 805,
First establishes unit 804, for establishing and preserving the correspondence of both MAC Address and IP address;
Second establishes unit 805, for the correspondence and IP address according to preservation, establish IP address, additional information and The correspondence of MAC Address three.
Optionally,
Request unit 803, including:
Transmission sub-unit 806 for sending to ask the response request message of additional information to host, responds request report Text carries IP address;
Subelement 807 is obtained, for obtaining the response response message of host transmission, response message is responded and carries the attached of host Add information.
In conclusion on the agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, first obtains Unit 801 obtains the request message that dhcp client is sent, and request message carries the first TransactionID and dhcp client The MAC Address of place host;Second acquisition unit 802 obtains the confirmation message that Dynamic Host Configuration Protocol server is sent, and confirmation message includes the Two TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;As the first TransactionID and second When TransactionID is matched, request unit 803 uses additional information of the IP address to host requesting host.Such mode, It avoids to get the additional information of host to the transformation of Dynamic Host Configuration Protocol server, agent equipment is without special with prospecting tools The IP address of client is detected, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and into The corresponding shielding measure of row.Therefore the method for the embodiment of the present invention is simple and practicable.
Agent equipment in the embodiment of the present invention also has another embodiment, with reference to the hard of agent equipment shown in Fig. 7 Part structure, the agent equipment also have the hardware configuration similar with the hardware configuration of agent equipment shown in Fig. 7, i.e. the agency sets It is standby to specifically include:The agent equipment can generate bigger difference due to configuration or different performance, can include one or one More than central processing unit (central processing units, CPU) (for example, one or more processors) and storage (such as one or more mass memories are set the storage medium of device, one or more storage application programs or data It is standby).Wherein, memory and storage medium can be of short duration storage or persistent storage.Being stored in the program of storage medium can wrap One or more modules (diagram does not mark) are included, each module can include to a series of fingers in database control system Order operation.Further, central processing unit could be provided as communicating with storage medium, and storage medium is performed on agent equipment In series of instructions operation.
Agent equipment can also include one or more power supplys, one or more wired or wireless networks connect Mouthful, one or more input/output interfaces and/or, one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
It can be based on above-mentioned agent equipment structure as the step performed by agent equipment in above-mentioned Fig. 4 and Fig. 5 embodiments. The function of agent equipment shown in Fig. 8 can be performed based on the hardware configuration of the agent equipment of the embodiment of the present invention.
Concrete condition is as follows:
The central processing unit of the agent equipment has the function of as follows:The request message that dhcp client is sent is obtained, request The MAC Address of host where message carries the first TransactionID and dhcp client;Dynamic Host Configuration Protocol server is obtained to send really Recognize message, the IP address that confirmation message includes the 2nd TransactionID and Dynamic Host Configuration Protocol server is dhcp client distribution;When During one TransactionID and the 2nd TransactionID identical, using IP address to the additional information of host requesting host.
Optionally, the central processing unit of the agent equipment has the function of as follows:
It establishes and preserves MAC Address and the correspondence of both IP address;According to the correspondence and IP address of preservation, build The correspondence of vertical IP address, additional information and MAC Address three.
Optionally, the central processing unit of the agent equipment has the function of as follows:It sends to ask additional information to host Response request message, respond request message carry IP address;The response response message that host is sent is obtained, responds response message Carry the additional information of host.
In conclusion on the agent equipment communicated to connect respectively with dhcp client and Dynamic Host Configuration Protocol server, central processing Device obtains the request message that dhcp client is sent, and request message is carried where the first TransactionID and dhcp client The MAC Address of host.Central processing unit also obtains the confirmation message of Dynamic Host Configuration Protocol server transmission, and confirmation message includes second TransactionID and the IP address that Dynamic Host Configuration Protocol server is dhcp client distribution;As the first TransactionID and second When TransactionID is matched, central processing unit uses additional information of the IP address to host requesting host.Such mode, It avoids to get the additional information of host to the transformation of Dynamic Host Configuration Protocol server, agent equipment is without special with prospecting tools The IP address of client is detected, the user of client is prevented to be exposed because worrying that the information of itself is excessive, and into The corresponding shielding measure of row.Therefore the method for the embodiment of the present invention is simple and practicable.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit may be referred to the corresponding process in preceding method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit Division is only a kind of division of logic function, can there is other dividing mode, such as multiple units or component in actual implementation It may be combined or can be integrated into another system or some features can be ignored or does not perform.It is another, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be the indirect coupling by some interfaces, device or unit It closes or communicates to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical location, you can be located at a place or can also be distributed to multiple In network element.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be employed in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products It embodies, which is stored in a storage medium, is used including some instructions so that a computer Equipment (can be personal computer, server or the network equipment etc.) performs the complete of each embodiment the method for the present invention Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before Embodiment is stated the present invention is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to preceding The technical solution recorded in each embodiment is stated to modify or carry out equivalent substitution to which part technical characteristic;And these Modification is replaced, and the essence of appropriate technical solution is not made to depart from the spirit and scope of various embodiments of the present invention technical solution.

Claims (20)

  1. A kind of 1. method for obtaining host additional information, which is characterized in that the method is performed by agent equipment, and the agency sets Back-up does not communicate to connect with dhcp client and Dynamic Host Configuration Protocol server, the described method includes:
    Agent equipment obtains first that the dhcp client is sent and finds message, and the first discovery message carries described The MAC Address of host where dhcp client;
    If the agent equipment does not preserve host name corresponding with the MAC Address, the agent equipment is the host Distribute temporary ip address;
    The agent equipment asks the additional information of the host using the temporary ip address to the host.
  2. 2. according to the method described in claim 1, it is characterized in that,
    The agent equipment uses the temporary ip address after the additional information that the host asks the host, the side Method further includes:
    The agent equipment is established and preserves the additional information of the host and the correspondence of both MAC Address;
    The agent equipment obtains second that the dhcp client is sent and finds message, and described second finds that message carries MAC Address is stated, described second finds that message is that the dhcp client is sent after the temporary ip address is released;
    If determine that the agent equipment preserves according to the correspondence of both the additional information of the host and the MAC Address Have and find the corresponding additional information of MAC Address that message carries with described second, the agent equipment is to the Dynamic Host Configuration Protocol server Second finds message described in transparent transmission, so that the Dynamic Host Configuration Protocol server is the host assignment real IP address;
    The agent equipment obtains at least one DHCP message of the Dynamic Host Configuration Protocol server and dhcp client interaction, described The real IP address and the MAC Address are carried at least one DHCP message;
    The agent equipment is according to the MAC Address included at least one DHCP message and the correspondence of preservation Relation establishes the correspondence of the additional information, the MAC Address and the real IP address three.
  3. 3. according to the method described in claim 2, it is characterized in that,
    At least one DHCP message, the confirmation message or the Dynamic Host Configuration Protocol server sent including the Dynamic Host Configuration Protocol server The offer message of transmission.
  4. 4. method according to any one of claims 1 to 3, which is characterized in that
    The agent equipment asks the additional information of the host using the temporary ip address to the host, including:
    The agent equipment sends to ask the response request message of additional information, the response request message to the host Carry the temporary ip address;
    The agent equipment obtains the response response message that the host is sent, and the source IP address for responding response message is institute State temporary ip address, the additional information responded response message and carry the host.
  5. 5. method according to any one of claims 1 to 3, which is characterized in that
    The agent equipment is the host assignment temporary ip address, including:
    The agent equipment is sent to the dhcp client provides message, and the offer message carries the temporary ip address;
    The agent equipment obtains the request message that the dhcp client is sent, and the request message is with carrying the temporary IP Location, the request message carry the MAC Address;
    If the agent equipment does not preserve additional information corresponding with the MAC Address, described in the agent equipment judges The content of the Server Identifier fields of request message whether be the agent equipment IP address;
    If the content of the Server Identifier fields of the request message is the IP address of the agent equipment, described Agent equipment to the dhcp client send confirmation message, the confirmation message is used to indicate the agent equipment completed be The dhcp client distributes the process of the temporary ip address.
  6. 6. method according to any one of claims 1 to 3, which is characterized in that
    The agent equipment uses the temporary ip address after the additional information that the host asks the host, the side Method further includes:
    The agent equipment is sent no when getting the request message of the dhcp client broadcast to the dhcp client Recognize message;
    The agent equipment discharges the temporary ip address when getting the release message that the dhcp client is sent.
  7. 7. method according to any one of claims 1 to 3, which is characterized in that described to use the temporary ip address to institute After stating the additional information that host asks the host, further include:
    The agent equipment does not respond the dhcp client when getting the request message of the client unicast;
    The agent equipment is sent no when getting the request message that the client broadcast is sent to the dhcp client Recognize message;
    The agent equipment discharges the temporary ip address when getting the release message that the dhcp client is sent.
  8. A kind of 8. method for obtaining host additional information, which is characterized in that the method is performed by agent equipment, and the agency sets Back-up does not communicate to connect with dhcp client and Dynamic Host Configuration Protocol server, the described method includes:
    Agent equipment obtains the request message that the dhcp client is sent, and the request message carries first The MAC Address of TransactionID and dhcp client place host;
    The agent equipment obtains the confirmation message that the Dynamic Host Configuration Protocol server is sent, and the confirmation message includes described second TransactionID and the IP address that the Dynamic Host Configuration Protocol server is dhcp client distribution;
    The agent equipment is when the first TransactionID is identical with the 2nd TransactionID, using described IP address asks the additional information of the host to the host.
  9. 9. according to the method described in claim 8, it is characterized in that,
    The agent equipment is using the IP address before the additional information that the host asks the host, and the method is also Including:
    The agent equipment is established and preserves the MAC Address and the correspondence of both IP address;
    The agent equipment is using the IP address after the additional information that the host asks the host, and the method is also Including:
    Correspondence and the IP address of the agent equipment according to the preservation, establish the IP address, the additional letter Breath and the correspondence of the MAC Address three.
  10. 10. according to the method described in claim 9, it is characterized in that,
    The agent equipment asks the additional information of the host using the IP address to the host, including:
    The agent equipment sends to ask the response request message of additional information, the response request message to the host Carry the IP address;
    The agent equipment obtains the response response message that the host is sent, and the response message of responding carries the host Additional information.
  11. 11. a kind of agent equipment, which is characterized in that the agent equipment respectively with dhcp client and Dynamic Host Configuration Protocol server communication link It connects, the agent equipment includes:
    First acquisition unit finds message for obtaining the dhcp client is sent first, and the first discovery message is taken MAC Address with host where the dhcp client;
    Allocation unit is the host if not preserving host name corresponding with the MAC Address for the agent equipment Distribute temporary ip address;
    Request unit, for using the temporary ip address to the additional information of the host request host.
  12. 12. agent equipment according to claim 11, which is characterized in that
    The agent equipment further includes:
    First establishes unit, for establishing and preserving the correspondence of both the additional information of the host and the MAC Address;
    Second acquisition unit finds message for obtaining the dhcp client is sent second, and the second discovery message is taken With the MAC Address, described second finds that message is that the dhcp client is sent after the temporary ip address is released 's;
    Transparent transmission unit, if the correspondence for both the additional information according to the host and the MAC Address determines institute It states agent equipment and preserves additional information corresponding with the MAC Address of the described second discovery message carrying, to the DHCP service Second finds message described in device transparent transmission, so that the Dynamic Host Configuration Protocol server is the host assignment real IP address;
    3rd acquiring unit, for obtaining at least one DHCP reports of the Dynamic Host Configuration Protocol server and dhcp client interaction Text carries the real IP address and the MAC Address at least one DHCP message;
    Second establishes unit, for according to the MAC Address included at least one DHCP message and the institute of preservation Correspondence is stated, establishes the correspondence of the additional information, the MAC Address and the real IP address three.
  13. 13. agent equipment according to claim 12, which is characterized in that
    At least one DHCP message, the confirmation message or the Dynamic Host Configuration Protocol server sent including the Dynamic Host Configuration Protocol server The offer message of transmission.
  14. 14. according to claim 11 to 13 any one of them agent equipment, which is characterized in that
    The request unit, including:
    First transmission sub-unit, for sending to ask the response request message of additional information, the response to the host Request message carries the temporary ip address;
    First obtains subelement, for obtaining the response response message that the host is sent, the source IP for responding response message Address is the temporary ip address, the additional information responded response message and carry the host.
  15. 15. according to claim 11 to 13 any one of them agent equipment, which is characterized in that
    The allocation unit, including:
    Second transmission sub-unit provides message for being sent to the dhcp client, and the offer message carries described interim IP address;
    Second obtains subelement, for obtaining the request message that the dhcp client is sent, described in the request message carries Temporary ip address, the request message carry the MAC Address;
    Judgment sub-unit if not preserving additional information corresponding with the MAC Address for the agent equipment, judges institute State the Server Identifier fields of request message content whether be the agent equipment IP address;
    3rd transmission sub-unit, if being the agency for the content of the Server Identifier fields of the request message The IP address of equipment, then send confirmation message to the dhcp client, and the confirmation message is used to indicate the agent equipment It has completed as the process of the dhcp client distribution temporary ip address.
  16. 16. according to claim 11 to 13 any one of them agent equipment, which is characterized in that
    The agent equipment further includes:
    First transmitting element, for when getting the request message of dhcp client broadcast, to the dhcp client Message is denied in transmission;
    First releasing unit, for when getting the release message that the dhcp client is sent, with discharging the temporary IP Location.
  17. 17. according to claim 11 to 13 any one of them agent equipment, which is characterized in that
    The agent equipment further includes:
    4th acquiring unit, for when getting the request message of the client unicast, not responding the dhcp client;
    Second transmitting element, for when getting the request message that the client broadcast is sent, to the dhcp client Message is denied in transmission;
    Second releasing unit, for when getting the release message that the dhcp client is sent, with discharging the temporary IP Location.
  18. 18. a kind of agent equipment, which is characterized in that the agent equipment respectively with dhcp client and Dynamic Host Configuration Protocol server communication link It connects, the agent equipment includes:
    First acquisition unit, for obtaining the request message that the dhcp client is sent, the request message carries first The MAC Address of TransactionID and dhcp client place host;
    Second acquisition unit, for obtaining the confirmation message that the Dynamic Host Configuration Protocol server is sent, the confirmation message includes described the Two TransactionID and the IP address that the Dynamic Host Configuration Protocol server is dhcp client distribution;
    Request unit, for when the first TransactionID is identical with the 2nd TransactionID, using institute State the additional information that IP address asks the host to the host.
  19. 19. agent equipment according to claim 18, which is characterized in that
    The agent equipment further includes:First, which establishes unit and second, establishes unit,
    First establishes unit, for establishing and preserving the correspondence of both the MAC Address and the IP address;
    Second establishes unit, for the correspondence according to the preservation and the IP address, establishes the IP address, described attached Add the correspondence of information and the MAC Address three.
  20. 20. agent equipment according to claim 19, which is characterized in that
    The request unit, including:
    Transmission sub-unit, it is described to respond request for sending to ask the response request message of additional information to the host Message carries the IP address;
    Subelement is obtained, for obtaining the response response message that the host is sent, the response response message carries the master The additional information of machine.
CN201611029102.1A 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment Active CN108093091B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110181562.0A CN113037882B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment
CN201611029102.1A CN108093091B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611029102.1A CN108093091B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110181562.0A Division CN113037882B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment

Publications (2)

Publication Number Publication Date
CN108093091A true CN108093091A (en) 2018-05-29
CN108093091B CN108093091B (en) 2021-06-08

Family

ID=62169571

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110181562.0A Active CN113037882B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment
CN201611029102.1A Active CN108093091B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202110181562.0A Active CN113037882B (en) 2016-11-22 2016-11-22 Method for acquiring additional information of host and proxy equipment

Country Status (1)

Country Link
CN (2) CN113037882B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002067A (en) * 2022-04-19 2022-09-02 深圳市共进电子股份有限公司 Client host name processing method, device, system, equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101471966A (en) * 2006-07-06 2009-07-01 华为技术有限公司 Method for preventing IP address from leakage
CN101909089A (en) * 2010-06-07 2010-12-08 友达光电股份有限公司 Method for controlling multiple computers in local area network
CN102088377A (en) * 2011-01-04 2011-06-08 深圳市易聆科信息技术有限公司 Man-machine correspondence method and device for assets management
CN102238245A (en) * 2011-06-03 2011-11-09 杭州华三通信技术有限公司 Address allocation method and equipment
CN102594839A (en) * 2012-03-16 2012-07-18 杭州华三通信技术有限公司 Method for distinguishing pseudo dynamic host configuration protocol (DHCP) servers and switchboards
CN103516742A (en) * 2012-06-25 2014-01-15 台达电子工业股份有限公司 A cloud server and a method of managing and controlling the same
CN104065758A (en) * 2013-03-18 2014-09-24 杭州华三通信技术有限公司 Active device automatic deployment method, device and system
EP3035648A1 (en) * 2014-12-19 2016-06-22 Alcatel Lucent Determining dynamic user attributes using dynamic host configuration protocol

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662808A (en) * 2009-08-27 2010-03-03 上海交通大学 Method for quickly switching network layers of IEEE802.11 wireless local area network
CN102244689B (en) * 2010-05-13 2014-01-01 华为技术有限公司 Method and equipment for obtaining remote IP address
CN102111406B (en) * 2010-12-20 2014-02-05 杭州华三通信技术有限公司 Authentication method, system and DHCP proxy server
CN102594937A (en) * 2012-02-06 2012-07-18 神州数码网络(北京)有限公司 Method and system for realizing DHCP (Dynamic Host Configuration Protocol) v6 relay agent through two-layer network exchange equipment
CN105991791A (en) * 2015-05-12 2016-10-05 杭州迪普科技有限公司 Message forwarding method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101471966A (en) * 2006-07-06 2009-07-01 华为技术有限公司 Method for preventing IP address from leakage
CN101909089A (en) * 2010-06-07 2010-12-08 友达光电股份有限公司 Method for controlling multiple computers in local area network
CN102088377A (en) * 2011-01-04 2011-06-08 深圳市易聆科信息技术有限公司 Man-machine correspondence method and device for assets management
CN102238245A (en) * 2011-06-03 2011-11-09 杭州华三通信技术有限公司 Address allocation method and equipment
CN102594839A (en) * 2012-03-16 2012-07-18 杭州华三通信技术有限公司 Method for distinguishing pseudo dynamic host configuration protocol (DHCP) servers and switchboards
CN103516742A (en) * 2012-06-25 2014-01-15 台达电子工业股份有限公司 A cloud server and a method of managing and controlling the same
CN104065758A (en) * 2013-03-18 2014-09-24 杭州华三通信技术有限公司 Active device automatic deployment method, device and system
EP3035648A1 (en) * 2014-12-19 2016-06-22 Alcatel Lucent Determining dynamic user attributes using dynamic host configuration protocol

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002067A (en) * 2022-04-19 2022-09-02 深圳市共进电子股份有限公司 Client host name processing method, device, system, equipment and medium

Also Published As

Publication number Publication date
CN113037882B (en) 2022-12-27
CN108093091B (en) 2021-06-08
CN113037882A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN100490377C (en) Method and arrangement for preventing illegitimate use of IP addresses
KR100657316B1 (en) A fast handover method in DHCPv4, handover apparatus thereof and recording medium thereof
CN101159758B (en) Classification associated dynamic host machine configuring protocol option distribution method and device
CN100527752C (en) DHCP address allocation method
US8543674B2 (en) Configuration of routers for DHCP service requests
CN101447879B (en) Charging method and access equipment therefor
CN105554179B (en) Dns resolution method, system in local area network
US20060224704A1 (en) Auto-configuration for data collection terminals
CN106302839A (en) The distribution method of internet protocol address and device
CN100471148C (en) Apparatus and method for establishing network
WO2017161965A1 (en) Method, device, and system for dynamic domain name system (dns) redirection
CN110691042A (en) Resource allocation method and device
CN102594839B (en) Method for distinguishing pseudo dynamic host configuration protocol (DHCP) servers and switchboards
CN107046585A (en) Dynamic Host Configuration Protocol server system of selection and device
US20060193330A1 (en) Communication apparatus, router apparatus, communication method and computer program product
CN103795581A (en) Address processing method and address processing device
CN102970391B (en) Inquiry of the domain name processing method, server and system
CN106878481A (en) A kind of Internet protocol IP address acquisition methods, device and system
CN108011801B (en) Data transmission method, equipment, device and system
CN104468159A (en) Management method and device of dynamic host configuration protocol server and relay
KR20070024116A (en) System for managing network service connection based on terminal aucthentication
CN108093091A (en) A kind of method and agent equipment for obtaining host additional information
CN104144230B (en) A kind of easy monitor terminal binding method and device
CN112040027B (en) Data processing method and device, electronic equipment and storage medium
CN101453396B (en) Method and system for multiple service provider device management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant