CN106878479A - A kind of address distribution method and device - Google Patents

A kind of address distribution method and device Download PDF

Info

Publication number
CN106878479A
CN106878479A CN201611213460.8A CN201611213460A CN106878479A CN 106878479 A CN106878479 A CN 106878479A CN 201611213460 A CN201611213460 A CN 201611213460A CN 106878479 A CN106878479 A CN 106878479A
Authority
CN
China
Prior art keywords
dhcp
information
dhcp client
request message
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
CN201611213460.8A
Other languages
Chinese (zh)
Other versions
CN106878479B (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.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201611213460.8A priority Critical patent/CN106878479B/en
Publication of CN106878479A publication Critical patent/CN106878479A/en
Application granted granted Critical
Publication of CN106878479B publication Critical patent/CN106878479B/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]

Landscapes

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

Abstract

The present invention provides a kind of address distribution method and device, and methods described includes:The DHCP request message of DHCP relay forwarding is received, when the DHCP request message is that the DHCP relay receives the DHCP request message of dhcp client transmission, the user that the dhcp client is added in the DHCP request message reaches the standard grade what is forwarded after information;The user for obtaining the dhcp client carried in the DHCP request message reaches the standard grade information, and reaches the standard grade information for the dhcp client distributes address according to the user of the dhcp client.The accuracy of address distribution can be improved using the embodiment of the present invention.

Description

A kind of address distribution method and device
Technical field
The present invention relates to network communication technology field, more particularly to a kind of address distribution method and device.
Background technology
DHCP (Dynamic Host Configuration Protocol, DHCP) uses client/ Server mode, by server for the network equipment dynamically distributes the network configuration parameters such as IP address.
(Dynamic Host Configuration Protocol for IPv6 support that the dynamic of IPv6 is main to DHCPv6 Machine configuration protocol) it is directed to the design of IPv6 addressing schemes, it is host assignment IPv6 prefixes, IPv6 addresses and other network configurations The agreement of parameter.
The content of the invention
The present invention provides a kind of address distribution method and device, to improve the accuracy of address distribution.
A kind of first aspect according to embodiments of the present invention, there is provided address distribution method, is applied to include that DynamicHost is matched somebody with somebody The Dynamic Host Configuration Protocol server in the networking of protocol DHCP client and Dynamic Host Configuration Protocol server is put, DHCP relay, institute are also included in the networking State dhcp client and the Dynamic Host Configuration Protocol server is accessed by the DHCP relay, the method includes:
The DHCP request message of DHCP relay forwarding is received, the DHCP request message is that the DHCP relay is received During the DHCP request message that dhcp client sends, the user that the dhcp client is added in the DHCP request message reaches the standard grade Forwarded after information;
The user for obtaining the dhcp client carried in the DHCP request message reaches the standard grade information, and according to described The user of dhcp client reaches the standard grade information for the dhcp client distributes address.
A kind of second aspect according to embodiments of the present invention, there is provided address distribution method, is applied to include that DynamicHost is matched somebody with somebody Put in the networking of protocol DHCP client, Dynamic Host Configuration Protocol server and DHCP relay, the dhcp client is by the DHCP After the Dynamic Host Configuration Protocol server is accessed, the method includes:
Receive the DHCP request message that dhcp client sends;
The user that the dhcp client is added in the DHCP request message reaches the standard grade information, and will the addition DHCP The user of the client DHCP request message after information of reaching the standard grade is transmitted to Dynamic Host Configuration Protocol server, so that the Dynamic Host Configuration Protocol server is according to institute The user for stating dhcp client reaches the standard grade information for the dhcp client distributes address.
A kind of third aspect according to embodiments of the present invention, there is provided address distribution method, is applied to dynamic host configuration association View Dynamic Host Configuration Protocol server, the method includes:
DHCP request message is received, the user that dhcp client is carried in the DHCP request message reaches the standard grade information, institute State dhcp client user reach the standard grade information including the dhcp client virtual LAN VLAN information and media interviews control MAC Address processed;
MAC Address according to the dhcp client inquires about local lease information;
If the corresponding lease information of the MAC Address that there is the dhcp client, but the VLAN recorded in the lease information Information is different from the vlan information of the dhcp client, then be updated to the vlan information recorded in the lease information described The vlan information of dhcp client.
A kind of fourth aspect according to embodiments of the present invention, there is provided address distributing device, is applied to include that DynamicHost is matched somebody with somebody The Dynamic Host Configuration Protocol server in the networking of protocol DHCP client and Dynamic Host Configuration Protocol server is put, DHCP relay, institute are also included in the networking State dhcp client and the Dynamic Host Configuration Protocol server is accessed by the DHCP relay, the device includes:
Receiving unit, the DHCP request message for receiving DHCP relay forwarding, the DHCP request message is described When DHCP relay receives the DHCP request message of dhcp client transmission, the DHCP visitors are added in the DHCP request message The user at family end reaches the standard grade what is forwarded after information;
Acquiring unit, the user for obtaining the dhcp client carried in the DHCP request message reaches the standard grade letter Breath;
Allocation unit, for reaching the standard grade information for the dhcp client is distributed according to the user of the dhcp client Address.
A kind of 5th aspect according to embodiments of the present invention, there is provided address distributing device, is applied to include that DynamicHost is matched somebody with somebody Put in the networking of protocol DHCP client, Dynamic Host Configuration Protocol server and DHCP relay, the dhcp client is by the DHCP After the Dynamic Host Configuration Protocol server is accessed, the device includes:
Receiving unit, the DHCP request message for receiving dhcp client transmission;
Adding device, the user for adding the dhcp client in the DHCP request message reaches the standard grade information;
Transmitting element, is transmitted to for the DHCP request message after information that the user for adding the dhcp client reaches the standard grade Dynamic Host Configuration Protocol server, so that the Dynamic Host Configuration Protocol server reaches the standard grade information for the dhcp client according to the user of the dhcp client Distribution address.
A kind of 6th aspect according to embodiments of the present invention, there is provided address distributing device, is applied to dynamic host configuration association View Dynamic Host Configuration Protocol server, the device includes:
Receiving unit, for receiving DHCP request message, carries the use of dhcp client in the DHCP request message Family is reached the standard grade information, and the user of the dhcp client reaches the standard grade virtual LAN VLAN information of the information including the dhcp client And MAC address;
Query unit, for inquiring about local lease information according to the MAC Address of the dhcp client;
Allocation unit, if the corresponding lease information of MAC Address for there is the dhcp client, but the lease The vlan information recorded in information is different from the vlan information of the dhcp client, then the VLAN that will be recorded in the lease information Information updating is the vlan information of the dhcp client.
Using the embodiment of the present invention, by DHCP relay when the DHCP request message of dhcp client is received, at this The user that the dhcp client is added in DHCP request message reaches the standard grade information, and will add user and reach the standard grade the DHCP request after information Message is transmitted to Dynamic Host Configuration Protocol server, and information is reached the standard grade for dhcp client distributes address according to user by Dynamic Host Configuration Protocol server, realizes In DHCP relay scene, Dynamic Host Configuration Protocol server reaches the standard grade information for dhcp client distributes address according to user, improves address point The accuracy matched somebody with somebody.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of address distribution method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow sheet of address distribution method provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic flow sheet of address distribution method provided in an embodiment of the present invention;
Fig. 4 A~4B is the configuration diagram of concrete application scene provided in an embodiment of the present invention;
Fig. 5 is a kind of structural representation of address distributing device provided in an embodiment of the present invention;
Fig. 6 is the structural representation of another address distributing device provided in an embodiment of the present invention;
Fig. 7 is the structural representation of another address distributing device provided in an embodiment of the present invention;
Fig. 8 is a kind of structural representation of address distributing device provided in an embodiment of the present invention;
Fig. 9 is the structural representation of another address distributing device provided in an embodiment of the present invention;
Figure 10 is a kind of structural representation of address distributing device provided in an embodiment of the present invention.
Specific embodiment
In order that those skilled in the art more fully understand the technical scheme in the embodiment of the present invention, and make of the invention real Applying the above-mentioned purpose of example, feature and advantage can be more obvious understandable, below in conjunction with the accompanying drawings to technical side in the embodiment of the present invention Case is described in further detail.
Fig. 1 is referred to, Fig. 1 is a kind of schematic flow sheet of address distribution method provided in an embodiment of the present invention, wherein, should Address distribution method can apply to include in the DHCP in the networking of dhcp client, Dynamic Host Configuration Protocol server and DHCP relay After the dhcp client accesses Dynamic Host Configuration Protocol server by the DHCP relay, as shown in figure 1, the address distribution method can include Following steps:
Step 101, the DHCP request message for receiving dhcp client transmission.
It should be noted that in embodiments of the present invention, the address in the distribution of address can include IPv4 addresses, IPv6 ground Location or the prefix of IPv6, the present invention are subsequently no longer repeated.
In the embodiment of the present invention, dhcp client accesses Dynamic Host Configuration Protocol server by DHCP relay (Relay), correspondingly, when When dhcp client needs request Dynamic Host Configuration Protocol server distribution address, dhcp client can send DHCP request report to DHCP relay Text, Dynamic Host Configuration Protocol server is transmitted to by DHCP relay by the DHCP request message.
Step 102, the user for adding in DHCP request message dhcp client reach the standard grade information, and will add DHCP visitors The user at the family end DHCP request message after information of reaching the standard grade is transmitted to Dynamic Host Configuration Protocol server, so that Dynamic Host Configuration Protocol server is according to DHCP visitors The user at family end reaches the standard grade information for dhcp client distributes address.
In the embodiment of the present invention, when DHCP relay receives the DHCP request message of dhcp client transmission, in DHCP After user's information of reaching the standard grade of the DHCP terminals can be added in the DHCP request message.
For example, DHCP relay can reach the standard grade option of the information record in DHCP request message the user of dhcp client In (optional) field, such as option82 (correspondence IPv4) or option18 (correspondence IPv6).
Wherein, user's information of reaching the standard grade of dhcp client can include VLAN (the Virtual Local of dhcp client Area Network, VLAN) information and MAC (Media Access Control, media access control) address, or, Username information and MAC Address etc..
In the embodiment of the present invention, Dynamic Host Configuration Protocol server is received on the user for carrying dhcp client of DHCP relay forwarding During the DHCP request message of line information, can be reached the standard grade information according to the user of the dhcp client carried in the DHCP request message For dhcp client distributes address, it implements the associated description that may refer in method flow shown in Fig. 2.
As a kind of optional implementation method, in above-mentioned steps 102, dhcp client is added in DHCP request message User reaches the standard grade before information, can also comprise the following steps:
11), judge whether enable according to user reach the standard grade information distribution address function;
If 12), it is determined that perform the above-mentioned user that dhcp client is added in DHCP request message and reach the standard grade information Step.
In this embodiment, in order to increase the flexibility that IP address is distributed, user (such as keeper) can be according to reality Demand choose whether need according to user reach the standard grade information distribution address.
For example, One function switch can be increased in DHCP relay, if the functional switch is in opening, show DHCP relay enables the function of information distribution address of being reached the standard grade according to user;If the functional switch is closed, show DHCP relay be not enabled on according to user reach the standard grade information distribution function.
Correspondingly, when DHCP relay receives the DHCP request message of dhcp client transmission, it is necessary to first determine itself Whether the function of according to user reach the standard grade information distribution address is enabled, if so, then DHCP relay needs to obtain the dhcp client User reach the standard grade information, and the user of dhcp client information of reaching the standard grade is carried and is transmitted to DHCP in the DHCP request message Server.
What deserves to be explained is, in embodiments of the present invention, when DHCP relay is not enabled on reaching the standard grade information distributively according to user During the function of location, DHCP relay can directly forward the DHCP request message (do not carry user reach the standard grade information), and it is implemented Related realization of the prior art is may refer to, the embodiment of the present invention will not be described here.
Further, in embodiments of the present invention, when DHCP relay receives the DHCP request report of dhcp client transmission Wen Shi, dhcp client can also record the MAC Address of dhcp client, user and reach the standard grade the correspondence pass of information and upper line interface System.
Correspondingly, when DHCP relay receives the DHCP response messages of Dynamic Host Configuration Protocol server transmission, DHCP relay can be with root (option in DHCP response messages can be carried according to user's information of reaching the standard grade of the dhcp client carried in DHCP response messages In field, such as option82 (correspondence IPv4) or option18 (correspondence IPv6)), inquire about corresponding the reaching the standard grade of the dhcp client and connect Mouthful, and DHCP response messages are transmitted to by corresponding dhcp client by line interface on this and user information of reaching the standard grade.
For example, information is reached the standard grade as vlan information and as a example by MAC Address with user, DHCP relay is by DHCP request report When text is transmitted to Dynamic Host Configuration Protocol server, the correspondence pass of MAC Address, vlan information and the upper line interface of dhcp client can be recorded System;When DHCP relay receives the DHCP response messages of Dynamic Host Configuration Protocol server transmission, DHCP relay can obtain the DHCP responses The vlan information and MAC Address of the dhcp client carried in message, and according to the vlan information and MAC of dhcp client The corresponding relation of the MAC Address, vlan information and upper line interface of address lookup self record, determines the upper of the dhcp client Line interface, and then, DHCP relay can forward the DHCP response reports on corresponding VLAN of line interface on this to dhcp client Text.
Fig. 2 is referred to, Fig. 2 is a kind of schematic flow sheet of address distribution method provided in an embodiment of the present invention, wherein, should Address distribution method can apply to include the DHCP service in the networking of dhcp client, Dynamic Host Configuration Protocol server and DHCP relay Device, the dhcp client accesses Dynamic Host Configuration Protocol server by the DHCP relay, as shown in Fig. 2 the address distribution method can include Following steps:
Step 201, the DHCP request message for receiving DHCP relay forwarding, the DHCP request message is that DHCP relay is received During the DHCP request message that dhcp client sends, the user that dhcp client is added in the DHCP request message reaches the standard grade information Forward afterwards.
In the embodiment of the present invention, DHCP relay receives the DHCP request message of dhcp client transmission, please in the DHCP The user that dhcp client is added in message is asked to reach the standard grade during implementing of forwarding after information may refer to method flow shown in Fig. 1 Related realization, the embodiment of the present invention will not be repeated here.
Step 202, the user for obtaining the dhcp client carried in the DHCP request message reach the standard grade information, and according to this The user of dhcp client reaches the standard grade information for dhcp client distributes address.
In the embodiment of the present invention, when Dynamic Host Configuration Protocol server receives the DHCP request message of DHCP relay forwarding, can obtain The user for taking the dhcp client carried in the DHCP request message reaches the standard grade information, and is reached the standard grade according to the user of the dhcp client Information is that dhcp client distributes address.
Wherein, user's information of reaching the standard grade of dhcp client can include the vlan information and MAC Address of dhcp client, Or, username information and MAC Address etc..
As an example it is assumed that the user of dhcp client reaches the standard grade, information is the vlan information and MAC Address of dhcp client, When Dynamic Host Configuration Protocol server receives the DHCP request message of DHCP relay forwarding, can obtain what is carried in the DHCP request message The vlan information and mac address information of dhcp client, and be DHCP according to the vlan information and MAC Address of dhcp client Client distributes IP address, and records the corresponding relation of the IP address, vlan information and MAC Address.For example, can be by DHCP The vlan information and MAC Address of client are recorded in the lease information of dhcp client.
As an example it is assumed that the user of dhcp client reaches the standard grade, information is the username information and MAC of dhcp client again Address, when Dynamic Host Configuration Protocol server receives the DHCP request message of DHCP relay forwarding, can obtain take in the DHCP request message The username information and mac address information of the dhcp client of band, and username information and the MAC ground according to dhcp client Location is that dhcp client distributes IP address, and records the corresponding relation of the IP address, username information and MAC Address.For example, Can be by the username information of dhcp client and MAC Address record in the lease information of dhcp client.
As a kind of optional implementation method, in above-mentioned steps 202, the DHCP client carried in DHCP request message is obtained The user at end reaches the standard grade before information, can also comprise the following steps:
21), judge whether enable according to user reach the standard grade information distribution address function;
If 22), it is determined that perform and obtain the user of the dhcp client carried in DHCP request message and reach the standard grade information Step;
23), otherwise, the MAC Address according to dhcp client is that dhcp client distributes address.
In this embodiment, in order to improve the flexibility that IP address is distributed, user (such as keeper) can be according to reality Demand choose whether enable Dynamic Host Configuration Protocol server according to user reach the standard grade information distribute address function.
Correspondingly, in this embodiment, when Dynamic Host Configuration Protocol server receives the DHCP request message of DHCP relay forwarding, Dynamic Host Configuration Protocol server needs first to judge whether to enable reaches the standard grade information distribution address function according to user, if DHCP determines to enable root Reached the standard grade information distribution address function according to user, then Dynamic Host Configuration Protocol server can obtain the DHCP client carried in the DHCP request message The user at end reaches the standard grade information, such as obtains dhcp client from the option82 fields or option18 fields of DHCP request message User reach the standard grade information, and information is reached the standard grade for DHPC clients distribute address according to the user of dhcp client.
If Dynamic Host Configuration Protocol server be not enabled on according to user reach the standard grade information distribution address function, Dynamic Host Configuration Protocol server can basis The MAC Address of dhcp client is that dhcp client distributes address.
What deserves to be explained is, in embodiments of the present invention, when Dynamic Host Configuration Protocol server enable according to user reach the standard grade information distribution The user that dhcp client is not carried in address function, but the DHCP request message of DHCP relay forwarding reaches the standard grade information (such as DHCP Relaying be not enabled on according to user reach the standard grade information distribution address function) when, Dynamic Host Configuration Protocol server can also be directly according to dhcp client MAC Address for dhcp client distribute address.
Additionally, when Dynamic Host Configuration Protocol server be not enabled on according to user reach the standard grade information distribution address function, or, Dynamic Host Configuration Protocol server makes Can be reached the standard grade information distribution address function according to user, but DHCP client is not carried in the DHCP request message of DHCP relay forwarding The user at end reach the standard grade information when, Dynamic Host Configuration Protocol server except can according to the MAC Address of dhcp client be dhcp client distribution Can also be that dhcp client distributes address according to the Customer ID (mark) of dhcp client outside address;Wherein, DHCP service Device may refer in the prior art according to the specific implementation that the Customer ID of dhcp client is dhcp client distribution address Related realization, the embodiment of the present invention will not be described here.
Further, as a kind of optional implementation method, in embodiments of the present invention, according to the MAC of dhcp client Address is that dhcp client distributes address, be may comprise steps of:
31), the MAC Address according to dhcp client inquires about local lease information;
If 32) recorded, in the presence of the corresponding lease information of MAC Address of the dhcp client, but in the lease information Vlan information is different from the vlan information of dhcp client, then delete the lease information, and for dhcp client distributes address.
In this embodiment, when Dynamic Host Configuration Protocol server according to the MAC Address of dhcp client be dhcp client distributively During location, when the request message of dhcp client is received, whether Dynamic Host Configuration Protocol server can first judge locally deposit to Dynamic Host Configuration Protocol server In the corresponding lease information of the MAC Address of the dhcp client, if in the presence of determining whether the VLAN recorded in the lease information Whether information is consistent with the vlan information of dhcp client;If inconsistent, Dynamic Host Configuration Protocol server can consider MAC Address correspondence Former dhcp client it is offline so that, Dynamic Host Configuration Protocol server can delete the corresponding lease information of the MAC Address, and be again The dhcp client distributes address;If consistent, Dynamic Host Configuration Protocol server need not again again for the dhcp client distributes address, can Directly to give the dhcp client by the lease information-reply.
Used as another optional implementation method, in embodiments of the present invention, the MAC Address according to dhcp client is Dhcp client distributes address, may comprise steps of:
41), the MAC Address according to dhcp client inquires about local lease information;
If 42) recorded, in the presence of the corresponding lease information of MAC Address of the dhcp client, but in the lease information Vlan information is different from the vlan information of dhcp client, then the vlan information recorded in the lease information is updated into the DHCP The vlan information of client.
In this embodiment, when Dynamic Host Configuration Protocol server is that dhcp client distributes address according to the MAC Address of dhcp client When, when the request message of dhcp client is received, Dynamic Host Configuration Protocol server can first judge locally to whether there is Dynamic Host Configuration Protocol server The corresponding lease information of MAC Address of the dhcp client, if in the presence of determining whether the VLAN letters recorded in the lease information Whether breath is consistent with the vlan information of dhcp client;If inconsistent, Dynamic Host Configuration Protocol server can consider that the dhcp client is sent out VLAN migrations are given birth to, now, Dynamic Host Configuration Protocol server can retain the lease information, and the vlan information that will be recorded in the lease information The vlan information of the dhcp client is updated to, if unanimously, Dynamic Host Configuration Protocol server need not be again the dhcp client point again With address, the dhcp client directly can be given by the lease information-reply.
What deserves to be explained is, in this embodiment, when Dynamic Host Configuration Protocol server is not inquired about according to the MAC Address of dhcp client During to corresponding lease information, the MAC Address that Dynamic Host Configuration Protocol server can directly according to dhcp client is the dhcp client point With address, and record the MAC Address and vlan information that the dhcp client is recorded in lease information.
It can be seen that, in the method flow shown in Fig. 1 and Fig. 2, the DHCP of dhcp client is being received by DHCP relay During request message, the user that the dhcp client is added in the DHCP request message is reached the standard grade information, and addition user is reached the standard grade DHCP request message after information is transmitted to Dynamic Host Configuration Protocol server, and information is reached the standard grade for dhcp client according to user by Dynamic Host Configuration Protocol server Distribution address, realize in DHCP relay scene, Dynamic Host Configuration Protocol server according to user reach the standard grade information for dhcp client distributively Location, improves the accuracy of address distribution.
Fig. 3 is referred to, Fig. 3 is a kind of schematic flow sheet of address distribution method provided in an embodiment of the present invention, wherein, should Address distribution method can apply to Dynamic Host Configuration Protocol server, as shown in figure 3, the address distribution method may comprise steps of:
Step 301, DHCP request message is received, the user that dhcp client is carried in the DHCP request message reaches the standard grade letter Breath, the user of the dhcp client reaches the standard grade vlan information and MAC Address of the information including dhcp client.
In the embodiment of the present invention, the DHCP request message that Dynamic Host Configuration Protocol server is received is transmitted directly to by dhcp client The DHCP request message of Dynamic Host Configuration Protocol server.
Step 302, local lease information is inquired about according to the MAC Address of the dhcp client.
In the embodiment of the present invention, when Dynamic Host Configuration Protocol server receives DHCP request message, Dynamic Host Configuration Protocol server can be according to this The MAC Address of dhcp client inquires about local lease information, to determine that the lease locally with the presence or absence of the dhcp client is believed Breath.
If step 303, the corresponding lease information of MAC Address in the presence of the dhcp client, but recorded in the lease information Vlan information it is different from the vlan information of the dhcp client, then by the lease information record vlan information be updated to this The VLAN of dhcp client.
In the embodiment of the present invention, when Dynamic Host Configuration Protocol server inquire locally in the presence of the dhcp client MAC Address it is corresponding During lease information, Dynamic Host Configuration Protocol server needs further to compare the vlan information and the dhcp client recorded in the lease information Vlan information;If the vlan information recorded in the lease information is different from the vlan information of dhcp client, Dynamic Host Configuration Protocol server It is considered that the dhcp client there occurs that VLAN is migrated, now, Dynamic Host Configuration Protocol server can directly retain the lease information, and will Vlan information in the lease information is updated to the vlan information of the dhcp client, without being again the dhcp client Distribution address.
What deserves to be explained is, in embodiments of the present invention, when Dynamic Host Configuration Protocol server determines locally exist and the dhcp client The corresponding lease information of MAC Address, and vlan information and the dhcp client recorded in the lease information vlan information When consistent, the lease information-reply directly can be given the dhcp client by Dynamic Host Configuration Protocol server.
Additionally, when Dynamic Host Configuration Protocol server does not inquire corresponding lease information according to the MAC Address of the dhcp client, Dynamic Host Configuration Protocol server can distribute address for the dhcp client, and record should in the corresponding lease information of the dhcp client The MAC Address and vlan information of Dynamic Host Configuration Protocol server.
It can be seen that, in the method flow shown in Fig. 3, when Dynamic Host Configuration Protocol server receives DHCP request message, and locally exist The corresponding lease information of MAC Address of the dhcp client carried in the DHCP request message, but recorded in the lease information When vlan information is different from the vlan information of the dhcp client, Dynamic Host Configuration Protocol server can directly by the VLAN in the lease information Information updating is the vlan information of the dhcp client, without being again the dhcp client deallocation, effectively Support same user and migrated in different VLAN.
In order that those skilled in the art more fully understand technical scheme provided in an embodiment of the present invention, with reference to specific Application scenarios are described to technical scheme provided in an embodiment of the present invention.
Fig. 4 A are referred to, is a kind of structural representation of concrete application scene provided in an embodiment of the present invention, such as Fig. 4 A institutes Show, in the application scenarios, Host (main frame) is connected between A and DHCP relay by Ethernet interface, and Host A pass through DHCP Relay the Dynamic Host Configuration Protocol server application IP address to distal end.
Based on the application scenarios shown in Fig. 4 A, address distribution method provided in an embodiment of the present invention realizes that flow is as follows:
1st, Host A send DHCP request message to DHCP relay;
2nd, DHCP relay the MAC Address, vlan information and upper line interface of local record Host A corresponding relation, and The vlan information and MAC Address of Host A are filled into the option82 fields (or option18 fields) in DHCP request message In, forward DHCP request message to Dynamic Host Configuration Protocol server;
3rd, Dynamic Host Configuration Protocol server obtains the vlan information and MAC Address of the Host A carried in DHCP request message, and inquiry is originally Whether ground has recorded the vlan information and the corresponding IP address of MAC Address, for example, inquiry locally with the presence or absence of the vlan information and The corresponding lease information of MAC Address, is that Host A distribute address according to the vlan information and MAC Address, and remember if not existing The corresponding relation of the vlan information, MAC Address and the address distributed is recorded, for example, in the lease information of the address distributed The vlan information and MAC Address of middle record Host A;
4th, DHCP relay receives the DHCP response messages that Dynamic Host Configuration Protocol server sends, and Host is carried in the DHCP response messages The vlan information and MAC Address of A, the upper line interface of vlan information and MAC Address inquiry the Host A according to Host A, and should Host A are transmitted on the corresponding VLAN of DHCP response messages line interface on this.
Fig. 4 B are referred to, is the structural representation of another concrete application scene provided in an embodiment of the present invention, such as Fig. 4 B Shown, in the application scenarios, Host (main frame) is connected between A and Dynamic Host Configuration Protocol server by Ethernet interface.
Based on the application scenarios shown in Fig. 4 B, address distribution method provided in an embodiment of the present invention realizes that flow is as follows:
1st, Host A send DHCP request message to Dynamic Host Configuration Protocol server;
2nd, when Dynamic Host Configuration Protocol server receives the DHCP request message, the MAC Address and vlan information of Host A can be obtained;
3rd, Dynamic Host Configuration Protocol server inquires about local lease information according to the MAC Address of Host A;
If the 4, locally there is the corresponding lease information of MAC Address of Host A, further compare note in the lease information Whether the vlan information of record is identical with the vlan information of Host A;
5th, if it is different, then Dynamic Host Configuration Protocol server retains the lease information, and the vlan information in the lease information is updated to The vlan information of Host A.
By above description as can be seen that in technical scheme provided in an embodiment of the present invention, being connect by DHCP relay When receiving the DHCP request message of dhcp client, the user that the dhcp client is added in the DHCP request message reaches the standard grade letter Breath, and user's DHCP request message after information of reaching the standard grade will be added be transmitted to Dynamic Host Configuration Protocol server, by Dynamic Host Configuration Protocol server according to user Information of reaching the standard grade is that dhcp client distributes address, is realized in DHCP relay scene, and Dynamic Host Configuration Protocol server is reached the standard grade letter according to user Cease for dhcp client distributes address, improve the accuracy of address distribution.
Fig. 5 is referred to, is a kind of structural representation of address distributing device provided in an embodiment of the present invention, wherein, it is described Device can apply in the Dynamic Host Configuration Protocol server in embodiment of the method shown in Fig. 1 and Fig. 2, as shown in figure 5, the address distributing device Can include:
Receiving unit 510, the DHCP request message for receiving DHCP relay forwarding, the DHCP request message is described When DHCP relay receives the DHCP request message of dhcp client transmission, the DHCP visitors are added in the DHCP request message The user at family end reaches the standard grade what is forwarded after information;
Acquiring unit 520, the user for obtaining the dhcp client carried in the DHCP request message reaches the standard grade Information;
Allocation unit 530, for reaching the standard grade information for the dhcp client according to the user of the dhcp client Distribution address.
It is the structural representation of another address distributing device provided in an embodiment of the present invention please also refer to Fig. 6, such as schemes Shown in 6, on the basis of location distributor as shown in Figure 5, location distributor also includes as shown in Figure 6:
Judging unit 540, during for the DHCP request message that DHCP relay forwarding is received when the receiving unit 510, Judge whether enable according to user reach the standard grade information distribution address function;
The acquiring unit 520, specifically for when the judging unit 540 is judged as YES, obtaining the DHCP request The user of the dhcp client carried in message reaches the standard grade information;
The allocation unit 530, is additionally operable to when the judging unit 540 is judged as NO, according to DHCP visitors The media access control address MAC Address at family end is that the dhcp client distributes address.
It is the structural representation of another address distributing device provided in an embodiment of the present invention please also refer to Fig. 7, such as schemes Shown in 7, on the basis of location distributor as shown in Figure 6, as shown in Figure 7 in the distributor of location, the allocation unit 530, can include:
Inquiry subelement 531, for inquiring about local lease information according to the MAC Address of the dhcp client;
Subelement 532 is distributed in address, if the corresponding lease information of MAC Address for there is the dhcp client, but The virtual LAN VLAN information recorded in the lease information is different from the vlan information of the dhcp client, then delete the rent About information, and be dhcp client distribution address;Or, the vlan information recorded in the lease information is updated to described The vlan information of dhcp client.
Fig. 8 is referred to, is a kind of structural representation of address distributing device provided in an embodiment of the present invention, wherein, it is described Device can apply in the DHCP relay in embodiment of the method shown in Fig. 1 and Fig. 2, as shown in figure 8, the address distributing device can To include:
Receiving unit 810, the DHCP request message for receiving dhcp client transmission;
Adding device 820, the user for adding the dhcp client in the DHCP request message reaches the standard grade information;
Transmitting element 830, turns for the DHCP request message after information that the user for adding the dhcp client reaches the standard grade Dynamic Host Configuration Protocol server is issued, so that the Dynamic Host Configuration Protocol server reaches the standard grade information for the DHCP is objective according to the user of the dhcp client Address is distributed at family end.
It is the structural representation of another address distributing device provided in an embodiment of the present invention please also refer to Fig. 9, such as schemes Shown in 9, on the basis of location distributor as shown in Figure 8, location distributor also includes as shown in Figure 9:
Judging unit 840, the DHCP request message for receiving dhcp client transmission when the receiving unit 810 When, judge whether enable according to user reach the standard grade information distribution address function;
The adding device 820, specifically for when the judging unit is judged as YES, in the DHCP request message The user for adding the dhcp client reaches the standard grade information.
Figure 10 is referred to, is a kind of structural representation of address distributing device provided in an embodiment of the present invention, wherein, it is described Device can apply in the Dynamic Host Configuration Protocol server in embodiment of the method shown in Fig. 3, and as shown in Figure 10, the address distributing device can be with Including:
Receiving unit 1001, for receiving DHCP request message, dhcp client is carried in the DHCP request message User reach the standard grade information, the user of the dhcp client reaches the standard grade virtual LAN VLAN of the information including the dhcp client Information and MAC address;
Query unit 1002, for inquiring about local lease information according to the MAC Address of the dhcp client;
Allocation unit 1003, if the corresponding lease information of MAC Address for there is the dhcp client, but should The vlan information recorded in lease information is different from the vlan information of the dhcp client, then by record in the lease information Vlan information is updated to the vlan information of the dhcp client.
The function of unit and the implementation process of effect correspond to step in specifically referring to the above method in said apparatus Implementation process, will not be repeated here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is referring to method reality Apply the part explanation of example.Device embodiment described above is only schematical, wherein described as separating component The unit of explanation can be or may not be physically separate, and the part shown as unit can be or can also It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality Selection some or all of module therein is needed to realize the purpose of the present invention program.Those of ordinary skill in the art are not paying In the case of going out creative work, you can to understand and implement.
As seen from the above-described embodiment, by DHCP relay when the DHCP request message of dhcp client is received, at this The user that the dhcp client is added in DHCP request message reaches the standard grade information, and will add user and reach the standard grade the DHCP request after information Message is transmitted to Dynamic Host Configuration Protocol server, and information is reached the standard grade for dhcp client distributes address according to user by Dynamic Host Configuration Protocol server, realizes In DHCP relay scene, Dynamic Host Configuration Protocol server reaches the standard grade information for dhcp client distributes address according to user, improves address point The accuracy matched somebody with somebody.
Those skilled in the art considering specification and after putting into practice invention disclosed herein, will readily occur to it is of the invention its Its embodiment.The application is intended to any modification of the invention, purposes or adaptations, these modifications, purposes or Person's adaptations follow general principle of the invention and including undocumented common knowledge in the art of the invention Or conventional techniques.Description and embodiments are considered only as exemplary, and true scope and spirit of the invention are by following Claim is pointed out.
It should be appreciated that the invention is not limited in the precision architecture being described above and be shown in the drawings, and And can without departing from the scope carry out various modifications and changes.The scope of the present invention is only limited by appended claim.

Claims (12)

1. a kind of address distribution method, is applied to include the networking of dynamic host configuration protocol DHCP client and Dynamic Host Configuration Protocol server In Dynamic Host Configuration Protocol server, it is characterised in that in the networking also include DHCP relay, the dhcp client pass through the DHCP Relaying accesses the Dynamic Host Configuration Protocol server, and the method includes:
The DHCP request message of DHCP relay forwarding is received, the DHCP request message is that the DHCP relay receives DHCP visitors During the DHCP request message that family end sends, the user that the dhcp client is added in the DHCP request message reaches the standard grade after information Forwarding;
The user for obtaining the dhcp client carried in the DHCP request message reaches the standard grade information, and according to DHCP visitors The user at family end reaches the standard grade information for the dhcp client distributes address.
2. method according to claim 1, it is characterised in that what is carried in the acquisition DHCP request message is described The user of dhcp client reaches the standard grade before information, also includes:
Judge whether enable according to user reach the standard grade information distribution address function;
If, it is determined that the user for performing the dhcp client for obtaining and being carried in the DHCP request message reaches the standard grade letter The step of breath;
Otherwise, the media access control address MAC Address according to the dhcp client is that the dhcp client distributes address.
3. method according to claim 2, it is characterised in that the MAC Address according to the dhcp client is institute Dhcp client distribution address is stated, including:
MAC Address according to the dhcp client inquires about local lease information;
If the corresponding lease information of the MAC Address that there is the dhcp client, but the virtual local area recorded in the lease information Net vlan information is different from the vlan information of the dhcp client, then delete the lease information, and be the dhcp client Distribution address;Or, the vlan information recorded in the lease information to be updated to the vlan information of the dhcp client.
4. a kind of address distribution method, it is characterised in that be applied to include dynamic host configuration protocol DHCP client, DHCP clothes In the networking of business device and DHCP relay, the dhcp client accesses the Dynamic Host Configuration Protocol server by the DHCP relay, should Method includes:
Receive the DHCP request message that dhcp client sends;
The user that the dhcp client is added in the DHCP request message reaches the standard grade information, and will the addition DHCP client The user at the end DHCP request message after information of reaching the standard grade is transmitted to Dynamic Host Configuration Protocol server, so that the Dynamic Host Configuration Protocol server is according to The user of dhcp client reaches the standard grade information for the dhcp client distributes address.
5. method according to claim 4, it is characterised in that described to add the DHCP in the DHCP request message The user of client reaches the standard grade before information, also includes:
Judge whether enable according to user reach the standard grade information distribution address function;
If, it is determined that the user for adding the dhcp client described in performing in the DHCP request message reaches the standard grade information Step.
6. a kind of address distribution method, is applied to dynamic host configuration protocol DHCP server, it is characterised in that the method bag Include:
DHCP request message is received, the user that dhcp client is carried in the DHCP request message reaches the standard grade information, described The user of dhcp client reaches the standard grade the virtual LAN VLAN information and media access control of information including the dhcp client MAC Address;
MAC Address according to the dhcp client inquires about local lease information;
If the corresponding lease information of the MAC Address that there is the dhcp client, but the vlan information recorded in the lease information Vlan information from the dhcp client is different, then the vlan information recorded in the lease information is updated into the DHCP visitors The vlan information at family end.
7. a kind of address distributing device, is applied to include the networking of dynamic host configuration protocol DHCP client and Dynamic Host Configuration Protocol server In Dynamic Host Configuration Protocol server, it is characterised in that in the networking also include DHCP relay, the dhcp client pass through the DHCP Relaying accesses the Dynamic Host Configuration Protocol server, and the device includes:
Receiving unit, the DHCP request message for receiving DHCP relay forwarding, during the DHCP request message is the DHCP When the DHCP request message of dhcp client transmission is received, the dhcp client is added in the DHCP request message User reaches the standard grade what is forwarded after information;
Acquiring unit, the user for obtaining the dhcp client carried in the DHCP request message reaches the standard grade information;
Allocation unit, for according to the user of the dhcp client reach the standard grade information for the dhcp client distributively Location.
8. device according to claim 7, it is characterised in that described device also includes:
Judging unit, during for the DHCP request message for receiving DHCP relay forwarding when the receiving unit, judges whether to make Can according to user reach the standard grade information distribution address function;
The acquiring unit, specifically for when the judging unit is judged as YES, being carried in the acquisition DHCP request message The user of the dhcp client reach the standard grade information;
The allocation unit, is additionally operable to when the judging unit is judged as NO, according to the media of the dhcp client Accessing to control address MAC Address is that the dhcp client distributes address.
9. device according to claim 8, it is characterised in that the allocation unit, including:
Inquiry subelement, for inquiring about local lease information according to the MAC Address of the dhcp client;
Subelement is distributed in address, if the corresponding lease information of MAC Address for there is the dhcp client, but lease letter The virtual LAN VLAN information recorded in breath is different from the vlan information of the dhcp client, then delete the lease information, And for the dhcp client distributes address;Or, the vlan information recorded in the lease information is updated into the DHCP client The vlan information at end.
10. a kind of address distributing device, it is characterised in that be applied to include dynamic host configuration protocol DHCP client, DHCP In the networking of server and DHCP relay, the dhcp client accesses the Dynamic Host Configuration Protocol server by the DHCP relay, The device includes:
Receiving unit, the DHCP request message for receiving dhcp client transmission;
Adding device, the user for adding the dhcp client in the DHCP request message reaches the standard grade information;
Transmitting element, DHCP is transmitted to for the DHCP request message after information that the user for adding the dhcp client reaches the standard grade Server, so that the Dynamic Host Configuration Protocol server reaches the standard grade information for the dhcp client is distributed according to the user of the dhcp client Address.
11. devices according to claim 10, it is characterised in that described device also includes:
Judging unit, during for the DHCP request message that dhcp client transmission is received when the receiving unit, judges whether Enable according to user reach the standard grade information distribution address function;
The adding device, specifically for when the judging unit is judged as YES, institute being added in the DHCP request message The user for stating dhcp client reaches the standard grade information.
A kind of 12. address distributing devices, are applied to dynamic host configuration protocol DHCP server, it is characterised in that the device bag Include:
Receiving unit, for receiving DHCP request message, carries on the user of dhcp client in the DHCP request message Line information, the user of the dhcp client reaches the standard grade virtual LAN VLAN information and matchmaker of the information including the dhcp client Body access control MAC addresses;
Query unit, for inquiring about local lease information according to the MAC Address of the dhcp client;
Allocation unit, if the corresponding lease information of MAC Address for there is the dhcp client, but the lease information The vlan information of middle record is different from the vlan information of the dhcp client, then the vlan information that will be recorded in the lease information It is updated to the vlan information of the dhcp client.
CN201611213460.8A 2016-12-23 2016-12-23 Address allocation method and device Active CN106878479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611213460.8A CN106878479B (en) 2016-12-23 2016-12-23 Address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611213460.8A CN106878479B (en) 2016-12-23 2016-12-23 Address allocation method and device

Publications (2)

Publication Number Publication Date
CN106878479A true CN106878479A (en) 2017-06-20
CN106878479B CN106878479B (en) 2020-07-07

Family

ID=59163995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611213460.8A Active CN106878479B (en) 2016-12-23 2016-12-23 Address allocation method and device

Country Status (1)

Country Link
CN (1) CN106878479B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547688A (en) * 2017-09-06 2018-01-05 新华三技术有限公司 A kind of message processing method and device
CN109831541A (en) * 2017-11-23 2019-05-31 中国电信股份有限公司 Device address distribution method, system and relevant device
CN113132498A (en) * 2019-12-30 2021-07-16 中兴通讯股份有限公司 Message processing method, relay equipment, system and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060495A (en) * 2007-05-22 2007-10-24 华为技术有限公司 Message processing method, system and equipment
CN101873320A (en) * 2010-06-17 2010-10-27 杭州华三通信技术有限公司 Client information verification method based on DHCPv6 relay and device thereof
CN102257772A (en) * 2010-06-07 2011-11-23 华为技术有限公司 Method, device and system for service configuration
CN102325145A (en) * 2011-10-21 2012-01-18 杭州华三通信技术有限公司 Method and equipment for carrying out access control on dual-stack user
CN102594936A (en) * 2012-02-06 2012-07-18 神州数码网络(北京)有限公司 Method and system for realizing dynamic host configuration protocol for internet protocol version 6 (DHCPv6) relay through two-layer network switching equipment
US8285875B2 (en) * 2009-01-28 2012-10-09 Juniper Networks, Inc. Synchronizing resource bindings within computer network
CN103281203A (en) * 2013-05-22 2013-09-04 上海斐讯数据通信技术有限公司 Ecos (Embedded Configurable Operating System) system-based DHCP (Dynamic Host Configuration Protocol) address assignment management method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060495A (en) * 2007-05-22 2007-10-24 华为技术有限公司 Message processing method, system and equipment
US8285875B2 (en) * 2009-01-28 2012-10-09 Juniper Networks, Inc. Synchronizing resource bindings within computer network
CN102257772A (en) * 2010-06-07 2011-11-23 华为技术有限公司 Method, device and system for service configuration
CN101873320A (en) * 2010-06-17 2010-10-27 杭州华三通信技术有限公司 Client information verification method based on DHCPv6 relay and device thereof
CN102325145A (en) * 2011-10-21 2012-01-18 杭州华三通信技术有限公司 Method and equipment for carrying out access control on dual-stack user
CN102594936A (en) * 2012-02-06 2012-07-18 神州数码网络(北京)有限公司 Method and system for realizing dynamic host configuration protocol for internet protocol version 6 (DHCPv6) relay through two-layer network switching equipment
CN103281203A (en) * 2013-05-22 2013-09-04 上海斐讯数据通信技术有限公司 Ecos (Embedded Configurable Operating System) system-based DHCP (Dynamic Host Configuration Protocol) address assignment management method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
文波: "基于CDMA1X的企业VPDN应用及研究", 《通信世界》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547688A (en) * 2017-09-06 2018-01-05 新华三技术有限公司 A kind of message processing method and device
CN107547688B (en) * 2017-09-06 2020-07-10 新华三技术有限公司 Message processing method and device
CN109831541A (en) * 2017-11-23 2019-05-31 中国电信股份有限公司 Device address distribution method, system and relevant device
CN113132498A (en) * 2019-12-30 2021-07-16 中兴通讯股份有限公司 Message processing method, relay equipment, system and storage medium
CN113132498B (en) * 2019-12-30 2024-04-23 中兴通讯股份有限公司 Message processing method, relay device, system and storage medium

Also Published As

Publication number Publication date
CN106878479B (en) 2020-07-07

Similar Documents

Publication Publication Date Title
CN105245629B (en) Host communication method based on DHCP and device
EP1488610B1 (en) System for selecting a connectivity mechanism
DE10084639B4 (en) Automatic determination of nodes assigned to a virtual subnet
JP4072536B2 (en) Network device dynamic port configuration
US7991913B2 (en) Method for domain name configuration in IPv6 access network and the network device hereof
CN103338151B (en) Public network client accesses the method and router of private network server
US9118721B1 (en) Socket-based internet protocol for wireless networks
CN106878483A (en) A kind of IP address distribution method and device
EP1903742A1 (en) A method, system and apparatus for accessing the web server
CN105323173A (en) Network rule entry setting method and device
CN105227466B (en) Communication processing method and device
KR100944421B1 (en) Method and apparatus for parameter borrowing for network address translator configuration, and method for self-configuratioin of a nat device, computer-readable medium, and communication network
CN101873320B (en) Client information verification method based on DHCPv6 relay and device thereof
CN106878479A (en) A kind of address distribution method and device
CN105472048A (en) Address allocating method, information aggregation method and related equipment
CN104601743A (en) IP (internet protocol) forwarding IPoE (IP over Ethernet) dual-stack user access control method and equipment based on Ethernet
CN107770010A (en) A kind of home intranet method and home networking system based on OpenFlow
CN106878481B (en) Method, device and system for acquiring Internet Protocol (IP) address
CN102404417A (en) Method and device for accessing external network
US8995429B1 (en) Socket-based internet protocol for wired networks
JP2009529257A (en) IPv6 address acquisition apparatus, method, and system
CN102480476A (en) Multi-service access method based on DHCP protocol extension
EP1906588A1 (en) A method system and apparatus for relating the information associated with user in nass
CN106878485A (en) A kind of message processing method and device
CN103634844A (en) Method and system for realizing distributed multi-port DHCP relay

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