CN108259636A - A kind of message processing method and device - Google Patents
A kind of message processing method and device Download PDFInfo
- Publication number
- CN108259636A CN108259636A CN201710909590.3A CN201710909590A CN108259636A CN 108259636 A CN108259636 A CN 108259636A CN 201710909590 A CN201710909590 A CN 201710909590A CN 108259636 A CN108259636 A CN 108259636A
- Authority
- CN
- China
- Prior art keywords
- dhcp
- bgp
- message
- dynamic host
- host configuration
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0668—Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
Abstract
The present invention provides a kind of message processing method and device, the method includes:When the DHCP message for receiving dhcp client transmission, BGP encapsulation is carried out, and the BGP DHCP messages encapsulated are sent to primary Dynamic Host Configuration Protocol server to the DHCP message;When receiving the DHCP response messages of BGP encapsulation that the primary Dynamic Host Configuration Protocol server is sent, release BGP and encapsulate to obtain DHCP response messages, and DHCP response messages are sent to the dhcp client;When detecting that the BGP with the primary Dynamic Host Configuration Protocol server connect disconnection, the normal spare Dynamic Host Configuration Protocol server of a BGP connection is selected to be switched to primary Dynamic Host Configuration Protocol server.Using present invention can ensure that DHCP relay perceives the available mode of primary Dynamic Host Configuration Protocol server in time, address allocative efficiency is improved.
Description
Technical field
The present invention relates to network communication technology field more particularly to a kind of message processing methods and device.
Background technology
DHCP (Dynamic Host Configuration Protocol, dynamic host configuration protocol) agreement usually quilt
It applies in large-scale LAN environment, main function is the management concentrated, distribution IP address, makes the host in network environment
It is dynamic to obtain IP address, and the utilization rate of address can be promoted.
DHCP protocol uses client/server model, and the dynamic allocation task of host address is driven by network host.When
When Dynamic Host Configuration Protocol server receives the information from network host applied address, just relevant address configuration can be sent to network host
Etc. information, to realize the dynamic configuration of Network Host address information.
When dhcp client and Dynamic Host Configuration Protocol server are in the different physics network segments, dhcp client can pass through DHCP relay
(relay) it communicates with Dynamic Host Configuration Protocol server, obtains IP address.
It, can be preferentially to first Dynamic Host Configuration Protocol server of configuration after DHCP relay is using active/standby mode selection Dynamic Host Configuration Protocol server
Address forwards DHCP request message.When the Dynamic Host Configuration Protocol server determines that IP address can not be distributed, DHCP relay is by DHCP later
Request message is forwarded to next Dynamic Host Configuration Protocol server address.If DHCP relay has been switched to the last one DHCP service of configuration
Device address and find that the Dynamic Host Configuration Protocol server is still unavailable, then reselect configuration first Dynamic Host Configuration Protocol server address enter it is next
A cycle.
However practice is found, in address above mentioned allocation plan, when current primary Dynamic Host Configuration Protocol server is unavailable, in DHCP
After that can not know the primary Dynamic Host Configuration Protocol server available mode in time, lead to not be switched to next spare DHCP service in time
Device.
Invention content
The present invention provides a kind of message processing method and device, and to solve in existing address allocation plan, DHCP relay can not
The problem of knowing the primary Dynamic Host Configuration Protocol server available mode in time.
It is according to embodiments of the present invention in a first aspect, provide a kind of message processing method, it is described applied to DHCP relay
Being established between DHCP relay and Dynamic Host Configuration Protocol server has bgp neighbor, the method includes:
When the DHCP message for receiving dhcp client transmission, BGP encapsulation is carried out, and should to the DHCP message
The DHCP message of BGP encapsulation is sent to primary Dynamic Host Configuration Protocol server;
When receiving the DHCP response messages of BGP encapsulation that the primary Dynamic Host Configuration Protocol server is sent, release BGP and encapsulate
The dhcp client is sent to DHCP response messages, and by DHCP response messages;
When detecting that the BGP with the primary Dynamic Host Configuration Protocol server connect disconnection, select a BGP connection normal spare
Dynamic Host Configuration Protocol server is switched to primary Dynamic Host Configuration Protocol server.
Second aspect according to embodiments of the present invention provides a kind of message processing method, described applied to Dynamic Host Configuration Protocol server
Being established between Dynamic Host Configuration Protocol server and DHCP relay has bgp neighbor, the method includes:
When the DHCP message of BGP encapsulation for receiving DHCP relay transmission, release BGP and encapsulate to obtain DHCP message, and
The DHCP message is handled;
The DHCP response messages of BGP encapsulation are sent to the DHCP relay.
The third aspect according to embodiments of the present invention provides a kind of message process device, described applied to DHCP relay
Being established between DHCP relay and Dynamic Host Configuration Protocol server has bgp neighbor, and described device includes:
Receiving unit, for receiving message;
Encapsulation unit, for when the receiving unit receive dhcp client transmission DHCP message when, to described
DHCP message carries out BGP encapsulation;
Transmitting element, the DHCP message for the BGP to be encapsulated are sent to primary Dynamic Host Configuration Protocol server;
The encapsulation unit is additionally operable to receive the BGP envelopes of the primary Dynamic Host Configuration Protocol server transmission when the receiving unit
During the DHCP response messages of dress, release BGP and encapsulate to obtain DHCP response messages
The transmitting element is additionally operable to DHCP response messages being sent to the dhcp client;
Whether detection unit disconnects for detecting to connect with the BGP of Dynamic Host Configuration Protocol server;
Switch unit, for when the detection unit detect the BGP with the primary Dynamic Host Configuration Protocol server connect disconnection when,
The normal spare Dynamic Host Configuration Protocol server of one BGP connection of selection is switched to primary Dynamic Host Configuration Protocol server.
Fourth aspect according to embodiments of the present invention provides a kind of message process device, described applied to Dynamic Host Configuration Protocol server
Being established between Dynamic Host Configuration Protocol server and DHCP relay has bgp neighbor, and described device includes:
Receiving unit, for receiving message;
Encapsulation unit, for when the receiving unit receives the DHCP message of BGP encapsulation that DHCP relay is sent, solving
Except BGP encapsulates to obtain DHCP message;
Processing unit, for handling the DHCP message;
The encapsulation unit is additionally operable to carry out BGP encapsulation to DHCP response messages;
Transmitting element, for sending the DHCP response messages of BGP encapsulation to the DHCP relay.
Using the embodiment of the present invention, by establishing bgp neighbor between BGP relayings and BGP servers, when receiving DHCP
During the DHCP message that client is sent, BGP encapsulation is carried out, and the BGP DHCP messages encapsulated are sent to master to DHCP message
Use Dynamic Host Configuration Protocol server;When receiving the DHCP response messages of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent, BGP encapsulation is released
DHCP response messages are obtained, and DHCP response messages are sent to dhcp client;When detecting and primary Dynamic Host Configuration Protocol server
When BGP connections disconnect, the normal spare Dynamic Host Configuration Protocol server of a BGP connection is selected to be switched to primary Dynamic Host Configuration Protocol server, ensure that
DHCP relay perceives the available mode of primary Dynamic Host Configuration Protocol server in time, improves address allocative efficiency.
Description of the drawings
Fig. 1 is a kind of configuration diagram of message handling system provided in an embodiment of the present invention;
Fig. 2 is the flow diagram that a kind of bgp neighbor provided in an embodiment of the present invention is established;
Fig. 3 is a kind of flow diagram of message processing method provided in an embodiment of the present invention;
Fig. 4 is a kind of flow diagram of message processing method provided in an embodiment of the present invention;
Fig. 5 is a kind of structure diagram of message process device provided in an embodiment of the present invention;
Fig. 6 is the structure diagram of another message process device provided in an embodiment of the present invention;
Fig. 7 is the structure diagram of another message process device provided in an embodiment of the present invention;
Fig. 8 is a kind of structure diagram of message process device provided in an embodiment of the present invention.
Specific embodiment
In order to which those skilled in the art is made to more fully understand the technical solution in the embodiment of the present invention, below first to this hair
The system architecture that bright embodiment is applicable in is briefly described.
Fig. 1 is referred to, is a kind of configuration diagram of message handling system provided in an embodiment of the present invention, as shown in Figure 1,
TCP can be established between DHCP relay and Dynamic Host Configuration Protocol server, and (Transmission Control Protocol pass transport control protocol
View) connection, and then, BGP (Border Gateway Protocol, Border Gateway Protocol) neighbours are established, wherein, DHCP relay
The flow that bgp neighbor is established with Dynamic Host Configuration Protocol server can be with as shown in Fig. 2, its related realization details may refer to existing bgp protocol
In associated description, the embodiment of the present invention do not repeat this.
In the embodiment of the present invention, the BGP protocol families supported can be extended, increase DHCP protocol cluster, DHCP relay
The DHCP message of interaction, which is encapsulated in BGP messages, between Dynamic Host Configuration Protocol server transmits.
In order to enable the above-mentioned purpose of the embodiment of the present invention, feature and advantage more obvious understandable, below in conjunction with the accompanying drawings
Technical solution in the embodiment of the present invention is described in further detail.
Fig. 3 is referred to, is a kind of flow diagram of message processing method provided in an embodiment of the present invention, wherein, the report
Literary processing method can be applied to the DHCP relay in Fig. 1, as shown in figure 3, the message processing method can include:
Step 301, when receive dhcp client transmission DHCP message when, to DHCP message carry out BGP encapsulation, and will
The DHCP message of BGP encapsulation is sent to primary Dynamic Host Configuration Protocol server.
In the embodiment of the present invention, dhcp client send DHCP message include DHCP Discover (it was found that) message or
DHCP Request (request) message;Dhcp client may refer to existing to the specific implementation of DHCP relay transmission DHCP message
Associated description in DHCP protocol, this will not be repeated here for the embodiment of the present invention.
In the embodiment of the present invention, when DHCP relay receives the DHCP message of dhcp client transmission, DHCP relay can
To carry out BGP encapsulation to the DHCP message, to obtain the DHCP message of BGP encapsulation, and the DHCP message that the BGP is encapsulated is sent
To primary Dynamic Host Configuration Protocol server.
Wherein, the message format of the DHCP message of BGP encapsulation can be as shown in table 1:
Table 1
BGP message head |
DHCP message |
Step 302, when receiving the DHCP response messages of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent, release BGP envelopes
Dress obtains DHCP response messages, and DHCP response messages are sent to dhcp client.
In the embodiment of the present invention, when primary Dynamic Host Configuration Protocol server receives the DHCP message of BGP encapsulation of DHCP relay transmission,
The BGP DHCP messages encapsulated can be decapsulated, the BGP message head of the DHCP message of BGP encapsulation be divested, to obtain
The DHCP message wherein carried, and handled accordingly according to the type (Discover or Request) of the DHCP message.Its
In, Dynamic Host Configuration Protocol server may refer to the specific process flow of DHCP Discover messages or DHCP Request messages existing
Associated description in DHCP protocol, the embodiment of the present invention do not repeat this.
When the DHCP message that dhcp client is sent is DHCP Discover messages, what primary Dynamic Host Configuration Protocol server was sent
DHCP response messages are DHCP Offer (offer) message;When the DHCP message that dhcp client is sent is reported for DHCP Request
Wen Shi, the DHCP response messages that primary Dynamic Host Configuration Protocol server is sent are DHCP ACK (confirmation) message.
In the embodiment of the present invention, when primary Dynamic Host Configuration Protocol server is to DHCP relay reply DHCP response messages, need to DHCP
Response message carries out BGP encapsulation, and the DHCP response messages that the BGP is encapsulated are sent to DHCP relay.
When DHCP relay receives the DHCP response messages of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent, which is encapsulated
DHCP response messages decapsulated, divest the BGP encapsulation DHCP response messages BGP message head, wherein to be taken
The DHCP response messages of band, and the DHCP response messages are sent to dhcp client.
Step 303, when detecting that the BGP with primary Dynamic Host Configuration Protocol server connect disconnection, select BGP connection normally
Spare Dynamic Host Configuration Protocol server is switched to primary Dynamic Host Configuration Protocol server.
In the embodiment of the present invention, when Dynamic Host Configuration Protocol server is unavailable, the BGP between DHCP relay and the Dynamic Host Configuration Protocol server connects
Connecing will will disconnect.
Correspondingly, when DHCP relay detects that itself connect disconnection with the BGP of primary Dynamic Host Configuration Protocol server, DHCP relay is true
Fixed primary Dynamic Host Configuration Protocol server is unavailable, at this point, in order to avoid dhcp client can not reach the standard grade, DHCP relay can from itself
One spare Dynamic Host Configuration Protocol server of selection is switched to primary Dynamic Host Configuration Protocol server, and press in the normal spare Dynamic Host Configuration Protocol server of BGP connections
According to described in step 301~step 302 DHCP message interaction is carried out with the new primary Dynamic Host Configuration Protocol server.
For example, DHCP relay can according to configuration sequence select be switched to primary Dynamic Host Configuration Protocol server, i.e., ought there are it is multiple with
During the normal spare Dynamic Host Configuration Protocol server of the BGP connections of DHCP relay, the spare Dynamic Host Configuration Protocol server being wherein configured at first is switched to
Primary Dynamic Host Configuration Protocol server;Alternatively, it can select to connect just with the BGP of DHCP relay according to pre-set priority (or weight)
Often, and the spare Dynamic Host Configuration Protocol server of highest priority is switched to primary Dynamic Host Configuration Protocol server.
As it can be seen that in method flow shown in Fig. 3, DHCP relay with Dynamic Host Configuration Protocol server by establishing bgp neighbor, and then work as
When DHCP relay finds that itself BGP between Dynamic Host Configuration Protocol server connect disconnection, DHCP relay can determine bgp neighbor state
Down (inoperative), so that it is determined that Dynamic Host Configuration Protocol server is unavailable, you can with according to bgp neighbor state quick sensing Dynamic Host Configuration Protocol server
State, and when primary Dynamic Host Configuration Protocol server is unavailable, is switched to the enterprising row address distribution of other Dynamic Host Configuration Protocol server in time, improves
The efficiency of address distribution.
Further, in embodiments of the present invention, it is contemplated that multiple be used for as gateway address can be configured in DHCP relay
Available IP address, multiple available IP address is corresponding with the network segment each in Dynamic Host Configuration Protocol server respectively, and multiple available IP address
There are one be configured as primary ip address for middle meeting.
As an example it is assumed that the address network segment that can be distributed in Dynamic Host Configuration Protocol server includes 1~network segment of the network segment 10, then in DHCP
After 10 can be configured for available IP address (being assumed to be IP1~IP10) as gateway address, 10 available IP address
Corresponding with 1~network segment of the network segment 10 respectively, e.g., IP1 belongs to the network segment 1, and IP2 belongs to network segment 2...IP10 and belongs to the network segment 10, and this 10
There are one be configured as primary ip address (such as IP1) for meeting in a available IP address.
It, can be with the giaddr fields of primary ip address filling message when DHCP relay sends DHCP message to Dynamic Host Configuration Protocol server
(i.e. using primary ip address as giaddr addresses), and when the network segment address distribution that the giaddr fields are corresponded in Dynamic Host Configuration Protocol server is full
When (i.e. the network segment address is all assigned), Dynamic Host Configuration Protocol server will not reply DHCP response messages;DHCP relay is needed default
In the case of the DHCP response messages for not receiving Dynamic Host Configuration Protocol server transmission in time, by retransmitting preset times DHCP message
Mode finds this case (the network segment address distribution for correspond to the giaddr fields in Dynamic Host Configuration Protocol server is full), and use is next
A giaddr fields that message can be filled with IP address, cause dhcp client that can not be assigned to IP address in time.
Therefore, in order to further improve address allocative efficiency, in embodiments of the present invention, Dynamic Host Configuration Protocol server can be according to
Preset strategy sends address pool state notifying message to DHCP relay, and transmission report can be carried in the address pool state notifying message
Network segment address distribution state in the Dynamic Host Configuration Protocol server of text, DHCP relay can know this according to the address pool state notifying message
Network segment address distribution state in Dynamic Host Configuration Protocol server, so as to know that network segment address distributes full situation, and carries out in time
The update of giaddr addresses.
Wherein, Dynamic Host Configuration Protocol server sends address pool state notifying message to DHCP relay according to preset strategy and can include determining
When (as periodically) to DHCP relay send address pool state notifying message or/and, when the distribution of any network segment address is full,
Address pool state notifying message is sent to DHCP relay.
Correspondingly, in the present invention in one embodiment, when DHCP relay receives what primary Dynamic Host Configuration Protocol server was sent
During address pool state notifying message, the network segment address distribution state carried in message is obtained;
Determine that the corresponding network segment address in currently used giaddr addresses distributes completely when distributing state according to the network segment address
When, update currently used giaddr addresses.
In this embodiment, in order to realize address pool state notifying, the type of DHCP message can be extended, increased newly
Address pool state notifying type of message.
Correspondingly, when DHCP relay receives the DHCP message of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent, in DHCP
After decapsulation processing can be carried out to it, to divest BGP message head, wherein the DHCP message carried, and obtain the DHCP
The type of message of message, if the DHCP message is newly-increased address pool state notifying message, DHCP relay can obtain the report
The network segment address distribution state carried in text, and distribute state according to the network segment address and determine currently used giaddr addresses pair
Whether the network segment address answered distributes full.If it is determined that the corresponding network segment address distribution in currently used giaddr addresses is full, then update
Currently used giaddr addresses;Otherwise, it may not be necessary to carry out specially treated.
It should be noted that in this embodiment, when DHCP relay gets what is carried in address pool state notifying message
When network segment address distributes state, network segment address distribution state can also be recorded, and then, it is currently used determining to need to update
During giaddr addresses, state can be distributed according to the network segment address of self record, be selected from preconfigured available IP address
One corresponding network segment address distributes less than available IP address as new giaddr addresses.
For example, DHCP relay can select the corresponding network segment address distribution time that is less than, and being configured according to configuration sequence
Earliest available IP address is as new giaddr addresses, alternatively, selecting corresponding network segment address distribution less than, and priority is most
The available IP address of high (or weight is maximum) is as new giaddr addresses.
In addition, in this embodiment, when DHCP relay determines that the type of message of DHCP message is not newly-increased address pool shape
During state notice message, DHCP relay can carry out respective handling in the way of described in step 302, and the embodiment of the present invention is herein
It repeats no more.
As it can be seen that in embodiments of the present invention, address pool state notifying message is sent to DHCP relay by Dynamic Host Configuration Protocol server,
DHCP relay can be full with the corresponding network segment address distribution in the currently used giaddr addresses of quick sensing, and carries out giaddr addresses
Update, improves address allocative efficiency.
Fig. 4 is referred to, is a kind of flow diagram of message processing method provided in an embodiment of the present invention, as shown in figure 4,
The message processing method may comprise steps of:
Step 401, DHCP relay and Dynamic Host Configuration Protocol server establish bgp neighbor.
In the embodiment of the present invention, the interaction flow that DHCP relay establishes bgp neighbor with Dynamic Host Configuration Protocol server can be such as Fig. 2 institutes
Show, specific implementation does not repeat herein.
Step 402, DHCP relay receive the DHCP message that dhcp client is sent, and BGP encapsulation is carried out to the DHCP message,
And the BGP DHCP messages encapsulated are sent to primary Dynamic Host Configuration Protocol server.
In the embodiment of the present invention, when dhcp client is reached the standard grade, dhcp client can broadcast DHCP message, with request point
With IP address.Wherein, which includes DHCP Discover messages or DHCP Request messages.
When DHCP relay receives the DHCP message of dhcp client broadcast, to relay the IP address of main interface filling DHCP
The giaddr addresses of message, and BGP encapsulation is carried out to DHCP message, then, the side that the BGP DHCP messages encapsulated are passed through into unicast
Formula is sent to primary Dynamic Host Configuration Protocol server.
Step 403, primary Dynamic Host Configuration Protocol server receive the DHCP message of BGP encapsulation that DHCP relay is sent, and release BGP encapsulation
DHCP message is obtained, and the DHCP message is handled.
In the embodiment of the present invention, when primary Dynamic Host Configuration Protocol server receives the DHCP message of BGP encapsulation of DHCP relay transmission,
Decapsulation processing can be carried out to the message, divest its BGP message head, to obtain DHCP message, and according to the class of DHCP message
Type (i.e. DHCP Discover or DHCP Request) carries out respective handling.
Step 404, primary Dynamic Host Configuration Protocol server send the DHCP response messages of BGP encapsulation to DHCP relay.
In the embodiment of the present invention, when dhcp reply DHCP response messages, need to carry out BGP envelopes to DHCP response messages
Dress.
Wherein, when the DHCP message that dhcp client is sent is DHCP Discover messages, primary Dynamic Host Configuration Protocol server returns
Multiple DHCP response messages are DHCP Offer messages;
When the DHCP message that dhcp client is sent is DHCP Request messages, what primary Dynamic Host Configuration Protocol server was replied
DHCP response messages are DHCP ACK messages.
Step 405, DHCP relay receive the DHCP response messages of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent, and release BGP
Encapsulation obtains DHCP response messages, and DHCP response messages are sent to the dhcp client.
In the embodiment of the present invention, DHCP relay receives the DHCP response reports of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent
Wen Shi decapsulates the DHCP response messages of BGP encapsulation, divests the BGP message of the DHCP response messages of BGP encapsulation
The DHCP response messages with the DHCP response messages wherein carried, and are sent to dhcp client by head.
Step 406, primary Dynamic Host Configuration Protocol server send address pool state notifying message according to preset strategy to DHCP relay.
In the embodiment of the present invention, in order to which DHCP relay is enable to perceive each network segment address distribution state in DHCP in time,
Dynamic Host Configuration Protocol server can timing to Dynamic Host Configuration Protocol server send address pool state notifying message or/and, Dynamic Host Configuration Protocol server can be in office
When the distribution of one network segment address is full, address pool state notifying message is sent to Dynamic Host Configuration Protocol server.
Wherein, which can be reported by being extended to obtain to DHCP message in existing DHCP
Increase an address pool status message type in text newly, DHCP relay receives the BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent
After DHCP message, which is decapsulated, its BGP message head is divested, and judge the type of DHCP message, if DHCP
Offer messages or DHCP ACK messages, then handled by the associated description in existing DHCP protocol;Disappear if address pool state
Breath, goes to step 407.
Step 407, DHCP relay receive the address pool state notifying message that primary Dynamic Host Configuration Protocol server is sent, and obtain in message
The network segment address distribution state of carrying.
Step 408, when DHCP relay according to get network segment address distribution state with determining currently used giaddr
When the corresponding network segment address distribution in location is full, a corresponding network segment address distribution is selected from preconfigured available IP address not
Full available IP address is as new giaddr addresses.
In the embodiment of the present invention, DHCP relay receives the address pool state notifying message that primary Dynamic Host Configuration Protocol server is sent
When, it can obtain and record the network segment address distribution state wherein carried, and distribute state according to the network segment address and determine currently
The corresponding network segment address distribution state in giaddr addresses used, if the corresponding network segment address point in currently used giaddr addresses
Less than can be used is distributed with the corresponding network segment address of condition selecting one completely, then can be distributed according to the network segment address of self record
IP address is as new giaddr addresses.
Step 409, when DHCP relay detects that the BGP with primary Dynamic Host Configuration Protocol server connect disconnection, BGP is selected to connect
It connects normal spare Dynamic Host Configuration Protocol server and is switched to primary Dynamic Host Configuration Protocol server.
In the embodiment of the present invention, when DHCP relay detects that itself connect disconnection with the BGP of primary Dynamic Host Configuration Protocol server,
DHCP relay determines that primary Dynamic Host Configuration Protocol server is unavailable, at this point, in order to avoid dhcp client can not reach the standard grade, DHCP relay needs
The normal spare Dynamic Host Configuration Protocol server of one BGP connection of selection is switched to primary Dynamic Host Configuration Protocol server.
By above description as can be seen that in technical solution provided in an embodiment of the present invention, by BGP relaying and
Bgp neighbor is established between BGP servers, when the DHCP message for receiving dhcp client transmission, BGP is carried out to DHCP message
Encapsulation, and the BGP DHCP messages encapsulated are sent to primary Dynamic Host Configuration Protocol server;When receiving what primary Dynamic Host Configuration Protocol server was sent
During the DHCP response messages of BGP encapsulation, release BGP and encapsulate to obtain DHCP response messages, and for DHCP response messages to be sent to
Dhcp client;When detecting that the BGP with primary Dynamic Host Configuration Protocol server connect disconnection, select a BGP connection normal spare
Dynamic Host Configuration Protocol server is switched to primary Dynamic Host Configuration Protocol server, ensure that DHCP relay perceives the available shape of primary Dynamic Host Configuration Protocol server in time
State improves address allocative efficiency.
Fig. 5 is referred to, is a kind of structure diagram of message process device provided in an embodiment of the present invention, wherein, it is described
Device can be applied to the DHCP relay in above method embodiment, as shown in figure 5, the message process device can include:
Receiving unit 510, for receiving message;
Encapsulation unit 520, for when the receiving unit 510 receive dhcp client transmission DHCP message when, it is right
The DHCP message carries out BGP encapsulation;
Transmitting element 530, the DHCP message for the BGP to be encapsulated are sent to primary Dynamic Host Configuration Protocol server;
The encapsulation unit 520 is additionally operable to receive what the primary Dynamic Host Configuration Protocol server was sent when the receiving unit 510
During the DHCP response messages of BGP encapsulation, release BGP and encapsulate to obtain DHCP response messages;
The transmitting element 530 is additionally operable to DHCP response messages being sent to the dhcp client;
Whether detection unit 540 disconnects for detecting to connect with the BGP of Dynamic Host Configuration Protocol server;
Switch unit 550 detects that the BGP with the primary Dynamic Host Configuration Protocol server is connect for working as the detection unit 540
During disconnection, the normal spare Dynamic Host Configuration Protocol server of a BGP connection is selected to be switched to primary Dynamic Host Configuration Protocol server.
Please also refer to Fig. 6, for the structure diagram of another message process device provided in an embodiment of the present invention, such as scheme
Described in 6, on the basis of message process device shown in Fig. 5, message process device shown in fig. 6 can also include:
Acquiring unit 560, for working as the address pool state that the receiving unit 310 receives primary Dynamic Host Configuration Protocol server and sends
During notice message, the network segment address distribution state carried in message is obtained;
Updating unit 570 determines currently used giaddr addresses pair for working as according to network segment address distribution state
When the network segment address distribution answered is full, currently used giaddr addresses are updated.
Please also refer to Fig. 7, for the structure diagram of another message process device provided in an embodiment of the present invention, such as scheme
Described in 7, on the basis of message process device shown in Fig. 6, message process device shown in Fig. 7 can also include:
Recording unit 580, for recording the network segment address distribution state;
The updating unit 570, specifically for selecting a corresponding network segment from preconfigured available IP address
Less than available IP address is distributed as new giaddr addresses in location.
Fig. 8 is referred to, is a kind of structure diagram of message process device provided in an embodiment of the present invention, wherein, the report
Literary processing unit can be applied to the Dynamic Host Configuration Protocol server in above method embodiment, as shown in figure 8, the message process device can be with
Including:
Receiving unit 810, for receiving message;
Encapsulation unit 820, for working as the DHCP reports that the receiving unit 810 receives the BGP encapsulation of DHCP relay transmission
Wen Shi releases BGP and encapsulates to obtain DHCP message;
Processing unit 830, for handling the DHCP message;
The encapsulation unit 820 is additionally operable to carry out BGP encapsulation to DHCP response messages;
Transmitting element 840, for sending the DHCP response messages of BGP encapsulation to the DHCP relay.
In an alternative embodiment, the transmitting element 840 is additionally operable to send ground to the DHCP relay according to preset strategy
Location pond state notifying message.
In an alternative embodiment, the transmitting element 840 sends address pool shape specifically for timing to the DHCP relay
State notice message;Or/and when the distribution of any network segment address is full, address pool state notifying message is sent to the DHCP relay.
The function of each unit and the realization process of effect specifically refer to and step are corresponded in the above method in above device
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related part is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separating component
The unit of explanation may or may not be physically separate, and the component shown as unit can be or can also
It is not physical unit, you can be located at a place or can also be distributed in multiple network element.It can be according to reality
It needs that some or all of module therein is selected 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 establishing bgp neighbor between BGP relayings and BGP servers, when receiving DHCP
During the DHCP message that client is sent, BGP encapsulation is carried out, and the BGP DHCP messages encapsulated are sent to master to DHCP message
Use Dynamic Host Configuration Protocol server;When receiving the DHCP response messages of BGP encapsulation that primary Dynamic Host Configuration Protocol server is sent, BGP encapsulation is released
DHCP response messages are obtained, and DHCP response messages are sent to dhcp client;When detecting and primary Dynamic Host Configuration Protocol server
When BGP connections disconnect, the normal spare Dynamic Host Configuration Protocol server of a BGP connection is selected to be switched to primary Dynamic Host Configuration Protocol server, ensure that
DHCP relay perceives the available mode of primary Dynamic Host Configuration Protocol server in time, improves address allocative efficiency.
Those skilled in the art will readily occur to the present invention its after considering specification and putting into practice invention disclosed herein
Its embodiment.This application is intended to cover the present invention any variations, uses, or adaptations, these modifications, purposes or
Person's adaptive change follows the general principle of the present invention and including undocumented common knowledge in the art of the invention
Or conventional techniques.Description and embodiments are considered only as illustratively, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the invention is not limited in the precision architecture for being described above and being shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is only limited by appended claim.
Claims (12)
1. a kind of message processing method relays, which is characterized in that the DHCP relay applied to dynamic host configuration protocol DHCP
Being established between Dynamic Host Configuration Protocol server has Border Gateway Protocol (BGP) neighbours, the method includes:
When the DHCP message for receiving dhcp client transmission, BGP encapsulation is carried out, and the BGP is sealed to the DHCP message
The DHCP message of dress is sent to primary Dynamic Host Configuration Protocol server;
When receiving the DHCP response messages of BGP encapsulation that the primary Dynamic Host Configuration Protocol server is sent, release BGP and encapsulate to obtain
DHCP response messages, and DHCP response messages are sent to the dhcp client;
When detecting that the BGP with the primary Dynamic Host Configuration Protocol server connect disconnection, the normal spare DHCP of a BGP connection is selected
Server is switched to primary Dynamic Host Configuration Protocol server.
2. according to the method described in claim 1, it is characterized in that, the method further includes:
When receiving the address pool state notifying message that primary Dynamic Host Configuration Protocol server is sent, the network segment address carried in message is obtained
Distribution state;
When determining that the corresponding network segment address distribution in currently used giaddr addresses is full according to network segment address distribution state,
Update currently used giaddr addresses.
3. according to the method described in claim 2, it is characterized in that, described obtain the network segment address distribution state carried in message
Later, it further includes:
Record the network segment address distribution state;
The currently used giaddr addresses of the update, including:
A corresponding network segment address is selected to distribute less than available IP address as new from preconfigured available IP address
Giaddr addresses.
A kind of 4. message processing method, applied to dynamic host protocol Dynamic Host Configuration Protocol server, which is characterized in that the Dynamic Host Configuration Protocol server
Being established between DHCP relay has Border Gateway Protocol (BGP) neighbours, the method includes:
When the DHCP message of BGP encapsulation for receiving DHCP relay transmission, release BGP and encapsulate to obtain DHCP message, and to this
DHCP message is handled;
The DHCP response messages of BGP encapsulation are sent to the DHCP relay.
5. according to the method described in claim 4, it is characterized in that, the method further includes:
According to preset strategy address pool state notifying message is sent to the DHCP relay.
6. according to the method described in claim 5, it is characterized in that, described send ground according to preset strategy to the DHCP relay
Location pond state notifying message, including:
Timing sends address pool state notifying message to the DHCP relay;Or/and
When the distribution of any network segment address is full, the primary Dynamic Host Configuration Protocol server sends address pool state notifying to the DHCP relay
Message.
7. a kind of message process device relays, which is characterized in that the DHCP relay applied to dynamic host configuration protocol DHCP
Being established between Dynamic Host Configuration Protocol server has Border Gateway Protocol (BGP) neighbours, and described device includes:
Receiving unit, for receiving message;
Encapsulation unit, for when the receiving unit receives the DHCP message that dhcp client is sent, being reported to the DHCP
Text carries out BGP encapsulation;
Transmitting element, the DHCP message for the BGP to be encapsulated are sent to primary Dynamic Host Configuration Protocol server;
The encapsulation unit is additionally operable to receive the BGP encapsulation of the primary Dynamic Host Configuration Protocol server transmission when the receiving unit
During DHCP response messages, release BGP and encapsulate to obtain DHCP response messages;
The transmitting element is additionally operable to DHCP response messages being sent to the dhcp client;
Whether detection unit disconnects for detecting to connect with the BGP of Dynamic Host Configuration Protocol server;
Switch unit, for when the detection unit detects that the BGP with the primary Dynamic Host Configuration Protocol server connect disconnection, selecting
The normal spare Dynamic Host Configuration Protocol server of one BGP connection is switched to primary Dynamic Host Configuration Protocol server.
8. device according to claim 7, which is characterized in that described device further includes:
Acquiring unit, for working as the address pool state notifying message that the receiving unit receives primary Dynamic Host Configuration Protocol server and sends
When, obtain the network segment address distribution state carried in message;
Updating unit determines the currently used corresponding network segment in giaddr addresses for working as according to network segment address distribution state
When address distribution is full, currently used giaddr addresses are updated.
9. device according to claim 8, which is characterized in that described device further includes:
Recording unit, for recording the network segment address distribution state;
The updating unit, specifically for selecting a corresponding network segment address distribution from preconfigured available IP address not
Full available IP address is as new giaddr addresses.
A kind of 10. message process device, applied to dynamic host protocol Dynamic Host Configuration Protocol server, which is characterized in that the DHCP service
Being established between device and DHCP relay has Border Gateway Protocol (BGP) neighbours, and described device includes:
Receiving unit, for receiving message;
Encapsulation unit, for when the receiving unit receives the DHCP message of BGP encapsulation that DHCP relay is sent, releasing
BGP encapsulates to obtain DHCP message;
Processing unit, for handling the DHCP message;
The encapsulation unit is additionally operable to carry out BGP encapsulation to DHCP response messages;
Transmitting element, for sending the DHCP response messages of BGP encapsulation to the DHCP relay.
11. device according to claim 10, which is characterized in that
The transmitting element is additionally operable to send address pool state notifying message to the DHCP relay according to preset strategy.
12. according to the devices described in claim 11, which is characterized in that
The transmitting element sends address pool state notifying message specifically for timing to the DHCP relay;Or/and when appoint
When the distribution of one network segment address is full, address pool state notifying message is sent to the DHCP relay.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710909590.3A CN108259636B (en) | 2017-09-29 | 2017-09-29 | Message processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710909590.3A CN108259636B (en) | 2017-09-29 | 2017-09-29 | Message processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108259636A true CN108259636A (en) | 2018-07-06 |
CN108259636B CN108259636B (en) | 2021-11-02 |
Family
ID=62722326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710909590.3A Active CN108259636B (en) | 2017-09-29 | 2017-09-29 | Message processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108259636B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111629083A (en) * | 2020-06-01 | 2020-09-04 | 瑞斯康达科技发展股份有限公司 | Method, device, storage medium and electronic device for acquiring IP address |
CN115550319A (en) * | 2022-11-24 | 2022-12-30 | 新华三信息技术有限公司 | Address allocation method and device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197811A (en) * | 2006-12-04 | 2008-06-11 | 中兴通讯股份有限公司 | Method for improving server reliability in dynamic main unit configuration protocol under proxy mode |
US20080235400A1 (en) * | 2001-10-18 | 2008-09-25 | Level 3 Communications, Llc | Content request routing and load balancing for content distribution networks |
CN101567839A (en) * | 2008-04-23 | 2009-10-28 | 华为技术有限公司 | Message transmitting method, hometown agent device, route device and system |
CN102404146A (en) * | 2011-11-17 | 2012-04-04 | 福建星网锐捷网络有限公司 | Master-slave switching method, network device and DHCP server |
US20120084840A1 (en) * | 2010-10-04 | 2012-04-05 | Alaxala Networks Corporation | Terminal connection status management with network authentication |
CN104253874A (en) * | 2013-06-27 | 2014-12-31 | 华为技术有限公司 | Message sending and processing method, device and system |
CN104518963A (en) * | 2013-09-30 | 2015-04-15 | 瞻博网络公司 | Methods and apparatus for implementing connectivity between edge devices via a switch fabric |
CN106254203A (en) * | 2016-09-05 | 2016-12-21 | 杭州华三通信技术有限公司 | A kind of message forwarding method and device |
CN106331202A (en) * | 2015-06-30 | 2017-01-11 | 中兴通讯股份有限公司 | Dynamic host configuration protocol (DHCP) server management method and device |
-
2017
- 2017-09-29 CN CN201710909590.3A patent/CN108259636B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080235400A1 (en) * | 2001-10-18 | 2008-09-25 | Level 3 Communications, Llc | Content request routing and load balancing for content distribution networks |
CN101197811A (en) * | 2006-12-04 | 2008-06-11 | 中兴通讯股份有限公司 | Method for improving server reliability in dynamic main unit configuration protocol under proxy mode |
CN101567839A (en) * | 2008-04-23 | 2009-10-28 | 华为技术有限公司 | Message transmitting method, hometown agent device, route device and system |
US20120084840A1 (en) * | 2010-10-04 | 2012-04-05 | Alaxala Networks Corporation | Terminal connection status management with network authentication |
CN102404146A (en) * | 2011-11-17 | 2012-04-04 | 福建星网锐捷网络有限公司 | Master-slave switching method, network device and DHCP server |
CN104253874A (en) * | 2013-06-27 | 2014-12-31 | 华为技术有限公司 | Message sending and processing method, device and system |
CN104518963A (en) * | 2013-09-30 | 2015-04-15 | 瞻博网络公司 | Methods and apparatus for implementing connectivity between edge devices via a switch fabric |
CN106331202A (en) * | 2015-06-30 | 2017-01-11 | 中兴通讯股份有限公司 | Dynamic host configuration protocol (DHCP) server management method and device |
CN106254203A (en) * | 2016-09-05 | 2016-12-21 | 杭州华三通信技术有限公司 | A kind of message forwarding method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111629083A (en) * | 2020-06-01 | 2020-09-04 | 瑞斯康达科技发展股份有限公司 | Method, device, storage medium and electronic device for acquiring IP address |
CN115550319A (en) * | 2022-11-24 | 2022-12-30 | 新华三信息技术有限公司 | Address allocation method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108259636B (en) | 2021-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102752152B (en) | Method and device used for configuring VRRP (Virtual Router Redundancy Protocol) backup group | |
CN107566437B (en) | Information transmission method and device | |
CN102263704B (en) | Topology construction method and device supporting layer 2 interconnection of data centers | |
JP2006013827A (en) | Packet transfer apparatus | |
CN103684966B (en) | A kind of dynamic host configuration protocol message processing method and processing device | |
CN107332772B (en) | Forwarding table item establishing method and device | |
CN104144124B (en) | Data forwarding method, Apparatus and system | |
CN103532863B (en) | Method and device for realizing software stacking | |
CN102480423A (en) | Method and system for protecting layer 2 tunneling protocol (L2TP) network | |
CN103117935A (en) | Multicast data forwarding method and multicast data forwarding device applied to multi-homing networking | |
CN104734952B (en) | A kind of data message forwarding method and device | |
EP3622670B1 (en) | Connectivity monitoring for data tunneling between network device and application server | |
WO2018135428A1 (en) | Gateway device, network address translation device, communication system, communication method, and program | |
CN104320502A (en) | Terminal gateway IP address assignment method, data transmission method, MME and system | |
CN101674669A (en) | Method, service node equipment and access node equipment for keep-alive processing | |
CN110611590A (en) | Method and system for internet of things gateway communication backup | |
CN109088823B (en) | Method and device for realizing terminal interconnection | |
CN108259636A (en) | A kind of message processing method and device | |
CN106878481A (en) | A kind of Internet protocol IP address acquisition methods, device and system | |
CN102638396B (en) | Load balancing method and device | |
US11817970B2 (en) | Method, device, and system for determining generic routing encapsulation GRE tunnel identifier | |
CN102238092B (en) | Method for performing load sharing on encoder and encoder | |
CN101888319A (en) | Method and device for acquiring network access information of terminal equipment | |
CN102761477A (en) | Multicast protocol messaging method and device | |
US20100185755A1 (en) | Systems and Methods for Changing The Address of an Interface |
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 |