CN109150745A - A kind of message processing method and device - Google Patents

A kind of message processing method and device Download PDF

Info

Publication number
CN109150745A
CN109150745A CN201811260255.6A CN201811260255A CN109150745A CN 109150745 A CN109150745 A CN 109150745A CN 201811260255 A CN201811260255 A CN 201811260255A CN 109150745 A CN109150745 A CN 109150745A
Authority
CN
China
Prior art keywords
list item
message
address
client
destination server
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
CN201811260255.6A
Other languages
Chinese (zh)
Other versions
CN109150745B (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 Security Technologies Co Ltd
Original Assignee
New H3C Security 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 Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN201811260255.6A priority Critical patent/CN109150745B/en
Publication of CN109150745A publication Critical patent/CN109150745A/en
Application granted granted Critical
Publication of CN109150745B publication Critical patent/CN109150745B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Abstract

The embodiment of the present application provides a kind of message processing method and device, is related to field of communication technology, to solve the problems, such as that dhcp client applied address fails caused by keeping due to session.The scheme of the embodiment of the present application includes: the dynamic host configuration protocol DHCP message for receiving client and sending, if it is determined that DHCP message is IP address request message, the destination server that IP address is distributed for client is then determined according to preset load balancing rule, and it generates the interim conversation identified comprising client identification and destination server and keeps list item, then IP address request message is forwarded to destination server, and receive the back message that destination server is returned according to IP address request message, if the IP address that back message does not carry as client distribution, then list item is kept to delete interim conversation.

Description

A kind of message processing method and device
Technical field
This application involves fields of communication technology, more particularly to a kind of message processing method and device.
Background technique
In order to realize that dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) takes The load balancing (Load Balance, LB) of business device, load-balancing device receive the discovery of the DHCP from dhcp client It (discover) can be that dhcp client selects Dynamic Host Configuration Protocol server according to dispatching algorithm, then by DHCP discover after message Message is transmitted to the Dynamic Host Configuration Protocol server of selection.
In order to guarantee to have the session of certain correlation can be handled by the same Dynamic Host Configuration Protocol server, load-balancing device exists After selecting Dynamic Host Configuration Protocol server for dhcp client, session keeping method can be used, generate comprising dhcp client mark and DHCP The session of server identification keeps list item, after subsequent load-balancing device receives the message from the dhcp client, equal root List item is kept to forward the message to the same Dynamic Host Configuration Protocol server processing according to session.
However, if the address that the Dynamic Host Configuration Protocol server that load-balancing device selects can not distribute for dhcp client, can lead Cause the failure of dhcp client applied address.Subsequent dhcp client again applied address when, load-balancing device can will still come from The DHCP discover message of the dhcp client is sent to session and Dynamic Host Configuration Protocol server in list item is kept to identify corresponding service Device, if still will lead to the failure of dhcp client applied address still without assignable address in the Dynamic Host Configuration Protocol server.
Summary of the invention
The embodiment of the present application is designed to provide a kind of message processing method and device, to solve since session is kept The problem of caused dhcp client applied address fails.Specific technical solution is as follows:
In a first aspect, the embodiment of the present application provides a kind of message processing method, the method is applied to load-balancing device, The described method includes:
Receive the dynamic host configuration protocol DHCP message that client is sent;
If it is determined that the DHCP message is IP address request message, then determined according to preset load balancing rule as institute The destination server of client distribution IP address is stated, and generating includes that the client identification and the destination server identify Interim conversation keeps list item;
The IP address request message is forwarded to the destination server, and receives the destination server according to the IP The back message that Address requests message returns;
If the IP address that the back message does not carry as client distribution, the interim conversation is kept into list item It deletes.
In one possible implementation, if the IP address that the back message carries as client distribution, Interim conversation holding list item is updated to formal session and keeps list item, the formal session keeps the ageing time of list item big In the rental period for being equal to the IP address.
In one possible implementation, if the DHCP message is other DHCP in addition to IP address request message Message, the method also includes:
Lookup includes that the formal session of the client identification keeps list item;
The server identification for including in list item is kept according to the formal session, to the corresponding service of the server identification Device forwards the DHCP message.
In one possible implementation, after the holding list item deletion by the interim conversation, the method Further include:
The counts for deleting the interim conversation list item comprising destination server mark are added 1;
If the counts reach preset times, does not identify correspond to the destination server within a preset period of time Destination server send IP address request message, and the counts are reset;
If before the counts reach the preset times, the interim conversation comprising destination server mark List item is updated to formal session and keeps list item, then resets the counts.
In one possible implementation, described that interim conversation holding list item is updated to formal session holding table , comprising:
The first flag bit in list item is kept to be updated to the second flag bit the interim conversation, first flag bit is used List item is kept in mark interim conversation, second flag bit keeps list item for identifying formal session.
Second aspect, the embodiment of the present application provide a kind of message process device, and described device is applied to load-balancing device, Described device includes:
Communication module, for receiving the dynamic host configuration protocol DHCP message of client transmission;
Generation module is used for if it is determined that the received DHCP message of the communication module is IP address request message, then The destination server for distributing IP address for the client is determined according to preset load balancing rule, and is generated comprising described Client identification and the interim conversation of destination server mark keep list item;
The communication module is also used to forward the IP address request message to the destination server, and described in reception The back message that destination server is returned according to the IP address request message;
Removing module, if not carrying for the received back message of the communication module as client distribution The interim conversation is then kept list item to delete by IP address.
In one possible implementation, described device further include: update module;
The update module will be described if carrying the IP address for client distribution for the back message Interim conversation keeps list item to be updated to formal session and keeps list item, and the formal session keeps the ageing time of list item to be more than or equal to The rental period of the IP address.
In one possible implementation, described device further include: searching module;
The searching module, if being other DHCP messages in addition to IP address request message for the DHCP message, Lookup includes that the formal session of the client identification keeps list item;
The communication module is also used to keep the server identification for including in list item according to the formal session, to described The corresponding server of server identification forwards the DHCP message.
In one possible implementation, described device further include: counting module;
The counting module, for will delete after the interim conversation is kept list item to delete by the removing module The counts of interim conversation list item comprising destination server mark add 1;If the counts reach preset times, Then corresponding destination server is not identified to the destination server within a preset period of time and send IP address request message, and will The counts are reset;If being identified before the counts reach the preset times comprising the destination server Interim conversation list item be updated to formal session and keep list item, then the counts are reset.
In one possible implementation, the update module is specifically used for keeping the interim conversation in list item The first flag bit be updated to the second flag bit, first flag bit keeps list item for identifying interim conversation, described second Flag bit keeps list item for identifying formal session.
The third aspect, the embodiment of the present application provide a kind of load-balancing device, the load-balancing device include: processor and Machine readable storage medium, the machine readable storage medium are stored with the executable finger of the machine that can be executed by the processor It enables, the processor is promoted by the machine-executable instruction: realizing message processing method described in first aspect.
Fourth aspect, the embodiment of the present application also provides a kind of computer readable storage medium, the computer-readable storages Dielectric memory contains computer program, realizes at message described in first aspect when the computer program is executed by processor Reason method.
5th aspect, the embodiment of the present application also provides a kind of computer program products comprising instruction, when it is being calculated When being run on machine, so that computer executes any of the above-described message processing method.
Using message processing method provided by the embodiments of the present application and device, load-balancing device receives IP address request After message, the destination server of client distribution IP address can be determined as according to load balancing rule, and generating includes client The interim conversation of mark and destination server mark keeps list item, then forwards IP address request message to destination server, and Back message is received, if the IP address that back message does not carry as client distribution, illustrates not distribute in destination server IP address, then by interim conversation keep list item delete, received next time in load-balancing device from the client in this way IP address request message after, would not keep list item that the IP address request message is forwarded to same server according to session, But the server that IP address is distributed for the client is reselected, it avoids the dhcp client and accesses the same DHCP always The problem of applied address fails caused by server.
Certainly, implement the application any product or method it is not absolutely required to and meanwhile reach all the above excellent Point.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram of communication system provided by the embodiments of the present application;
Fig. 2 is a kind of flow chart of message processing method provided by the embodiments of the present application;
Fig. 3 is the flow chart of another message processing method provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of message process device provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of load-balancing device provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
Message processing method provided by the embodiments of the present application can be applied in communication system as shown in Figure 1, the system In include dhcp client, interchanger, load-balancing device and at least two Dynamic Host Configuration Protocol server optionally may be used also in the system To include DHCP relay equipment.
In the case where not disposing DHCP relay equipment within the system, dhcp client is connected to interchanger, and interchanger connects It is connected to load-balancing device, and interchanger is connected at least two Dynamic Host Configuration Protocol server.
Optionally, dhcp client can also be connected with load-balancing device, i.e., dhcp client can pass through interchanger It communicates, can also directly be communicated with load-balancing device with load-balancing device.
Optionally, load-balancing device is also connected at least two Dynamic Host Configuration Protocol server, i.e. load-balancing device can be with It is communicated, can also be directly communicated with Dynamic Host Configuration Protocol server with Dynamic Host Configuration Protocol server by interchanger.
In the case where deploying DHCP relay equipment within the system, dhcp client is connected to DHCP relay equipment, DHCP relay equipment is connected to interchanger, i.e. dhcp client can pass through DHCP relay equipment and switch communication.Interchanger connects It is connected to load-balancing device, and interchanger is connected at least two Dynamic Host Configuration Protocol server, optionally, load-balancing device may connect to At least two Dynamic Host Configuration Protocol server, in this way, load-balancing device can be communicated by interchanger with Dynamic Host Configuration Protocol server, can also directly with Dynamic Host Configuration Protocol server communication.
Wherein, IP address request message can be transmitted in dhcp client, and it is equal which can be forwarded to load Weigh equipment, and the Dynamic Host Configuration Protocol server of the dhcp client service is then selected as by load-balancing device, and then the IP address is requested Message is forwarded to Dynamic Host Configuration Protocol server.
In the first implementation, dhcp client can send IP address request to interchanger by DHCP relay equipment Message, then IP address request message is forwarded to load-balancing device by interchanger, and load-balancing device is IP address request After message selects Dynamic Host Configuration Protocol server, IP address request message is forwarded to the Dynamic Host Configuration Protocol server of selection by interchanger.
In the second implementation, DHCP relay equipment receives the IP address request message of dhcp client transmission Afterwards, load-balancing device can be transmitted directly to without interchanger, load-balancing device is IP address request message selection After Dynamic Host Configuration Protocol server, IP address request message is forwarded to the Dynamic Host Configuration Protocol server of selection by interchanger.
In the third implementation, after IP address request message is forwarded to load-balancing device by interchanger, load is equal The equipment that weighs is that the IP address request message selects Dynamic Host Configuration Protocol server, then directly can be requested the IP address without interchanger Message is forwarded to the Dynamic Host Configuration Protocol server of selection.
In the 4th kind of implementation, in the case where not disposing DHCP relay equipment, dhcp client can also directly to Interchanger sends IP address request message, carries out subsequent message repeating process by interchanger.
The method of Message processing provided by the embodiments of the present application can be applied in any of the above-described kind of implementation.For example, In the description of subsequent embodiment, load-balancing device receives the IP address request message that dhcp client is sent, and can refer to negative The IP address request message that equalizing equipment directly receives dhcp client transmission is carried, can also refer to that load-balancing device passes through DHCP Trunking receives the IP address request message that dhcp client is sent.In addition, load-balancing device is forwarded to Dynamic Host Configuration Protocol server IP address request message can refer to that load-balancing device forwards IP address request message to Dynamic Host Configuration Protocol server by interchanger, It can refer to that load-balancing device directly forwards IP address request message to Dynamic Host Configuration Protocol server.
Communication system as shown in connection with fig. 1, in order to solve dhcp client applied address caused by keeping due to session The problem of failure, the embodiment of the present application provide a kind of message processing method, and this method is applied to load-balancing device, such as Fig. 2 It is shown, this method comprises:
S201, the DHCP message that client is sent is received.
Wherein, which can be dhcp client.
S202, if it is determined that DHCP message be IP address request message, then according to preset load balancing rule determine for Client distributes the destination server of IP address, and generates the interim conversation identified comprising client identification and destination server and protect Hold list item.
Optionally, IP address request message is the message for request IP address, such as can be DHCP Discover message.Destination server can be Dynamic Host Configuration Protocol server.
Wherein, load balancing rule is randomly assigned algorithm, polling dispatching algorithm, weighted round robin dispatching algorithm to use, or Person is according to the information of server dynamical feedback come selection target server.Certain the embodiment of the present application is without being limited thereto, other are used for Realize that the rule of load balancing can also be applied in the embodiment of the present application.
For example, the DHCP of dhcp client service can be selected as in a certain order by polling dispatching algorithm Server, when load-balancing device receives DHCP discover message, however, it is determined that last time receives DHCP discover When message, Dynamic Host Configuration Protocol server 1 is selected, then this time selection Dynamic Host Configuration Protocol server 2 similarly receives DHCP discover report next time Wen Shi then selects Dynamic Host Configuration Protocol server 3.Alternatively, Least-Connection Scheduling algorithm can also be used, i.e. load-balancing device receives After DHCP discover message, the Dynamic Host Configuration Protocol server of the dhcp client minimum number of service is selected.Certainly, the application is implemented The adoptable dispatching algorithm of example is not limited to exemplified as above two kinds, remaining dispatching algorithm for being used for load balancing is also applied for This.
S203, IP address request message is forwarded to destination server, and receives destination server and requests to report according to IP address The back message that text returns.
Optionally, if IP address request message is DHCP discover message, back message can be DHCP offer Message.
If the IP address that S204, back message do not carry as client distribution, list item is kept to delete interim conversation.
After load-balancing device receives the back message, the back message can be parsed, if back message does not carry as visitor The IP address of family end distribution, illustrates without assignable IP address in the destination server, is this time client point in other words Fail with IP address, so list item can be kept to delete interim conversation, when sending IP address request message again so as to client, Other servers can be matched to.
Optionally, after load-balancing device receives the back message, back message can be transmitted to client.
Using message processing method provided by the embodiments of the present application, load-balancing device receives IP address request message Afterwards, the destination server of client distribution IP address can be determined as according to load balancing rule, and generating includes client identification List item is kept with the interim conversation of destination server mark, then forwards IP address request message to destination server, and receive Back message, if the IP address that back message does not carry as client distribution, illustrates do not have assignable IP in destination server Interim conversation is then kept list item to delete, receives the IP from the client next time in load-balancing device in this way by address After Address requests message, it would not keep list item that the IP address request message is forwarded to same server according to session, but The server for distributing IP address for the client is reselected, the dhcp client is avoided and accesses the same DHCP service always The problem of applied address fails caused by device.
Optionally, on the basis of Fig. 2 embodiment, if the IP address that back message carries as client distribution, such as Fig. 3 institute Show, this method specifically includes: S301-S305.
Wherein, S301-S304 is identical as above-mentioned S201-S204.
If the IP address that S305, back message carry as client distribution, list item update is kept to be positive interim conversation Formula session keeps list item.
Wherein, formal session keeps the ageing time of list item to be more than or equal to the rental period of IP address, i.e., distributes when for client IP address when expiring, load-balancing device can delete the formal session and keep list item.
In addition, if client has sent the release message of IP address, then load-balancing device meeting before IP address expires After IP address is released, deletes the formal session and keep list item.
If client re-rents the IP address, and re-rents success, then load balancing is set before IP address expires Standby refreshable formal session keeps list item, which is kept the ageing time of list item with being updated to the IP after re-renting The rental period of location.
Interim conversation holding list item, which is updated to formal session, keeps the method for list item can be with are as follows: interim conversation is kept table The first flag bit in is updated to the second flag bit.First flag bit keeps list item, the second mark for identifying interim conversation Position keeps list item for identifying formal session.
For example, representing session if the first flag bit can be T (temporary, interim) and keeping list item as interim conversation guarantor Hold list item;Second flag bit is O (official, formal), represents session and list item is kept to keep list item as formal session.
In one possible implementation, if the received message of load-balancing device is except IP address is asked in above-mentioned S201 Other DHCP messages except message are sought, then this method further includes S306-S307.
S306, if it is determined that DHCP message is other DHCP messages in addition to IP address request message, then search and include The formal session of the client identification keeps list item.
Wherein, the client in this step is to send the client of DHCP message.Illustratively, IP address request message is removed Except other DHCP messages can be DHCP inform message.
S307, the server identification for including in list item is kept according to formal session, to the corresponding server of server identification Forward DHCP message.
It just will be interim under conditions of receiving the back message for carrying IP address using the method for the embodiment of the present application Session keeps list item to be updated to formal session and keeps list item, if subsequently received client send except IP address request message it Other outer DHCP messages, and the client keeps performance to match with formal session, then can keep wrapping in list item to formal session The corresponding server of the server identification contained forwards DHCP message, and the treatment effeciency to DHCP message can be improved.
In the embodiment of the present application, after interim conversation is kept list item to delete by load-balancing device every time, can will also connect The continuous counts for deleting the interim conversation list item comprising destination server mark add 1.Specifically, load-balancing device can lead to Counter is crossed to be counted.
If counts reach preset times, corresponding target is not identified to the destination server within a preset period of time Server sends IP address request message, and will reset to the counts of the destination server.
If the interim conversation list item comprising destination server mark is continuously deleted preset times, illustrate the destination server In there is no assignable IP address, in order to avoid having client again to the destination server application IP address, application is caused to be lost It loses, IP address request message can not sent to the destination server within a preset period of time.
And if before counts reach preset times, comprising the destination server mark interim conversation list item by more List item newly is kept for formal session, then the counts of the destination server will be reset.
Wherein, if the interim conversation comprising destination server mark keeps list item to be updated to formal session holding table , illustrate there may be IP address to be released in the destination server, so still can be client service.
Using the method for the embodiment of the present application, continuously it is deleted default time in the interim conversation list item comprising destination server Number, illustrates the IP address that the destination server can be assigned really, is not desired to destination server hair within a preset period of time IP address request message is sent, the success rate of client application IP address can be improved.
Corresponding to above method embodiment, the embodiment of the present application also provides a kind of message process device, as shown in figure 4, should Device includes: communication module 401, generation module 402, removing module 403.
Communication module 401, for receiving the dynamic host configuration protocol DHCP message of client transmission.
Generation module 402 is used for if it is determined that the received DHCP message of communication module 401 is IP address request message, then root The destination server that IP address is distributed for client is determined according to preset load balancing rule, and generating includes client identification List item is kept with the interim conversation of destination server mark.
Communication module 401, be also used to destination server forward IP address request message, and receive destination server according to The back message that IP address request message returns.
Removing module 403, if with not carrying the IP for client distribution for the received back message of communication module 401 Interim conversation is then kept list item to delete by location.
Optionally, device further include: update module;
Interim conversation is kept list item if carrying the IP address for client distribution for back message by update module It is updated to formal session and keeps list item, formal session keeps the ageing time of list item more than or equal to the rental period of IP address.
Optionally, device further include: searching module;
Searching module, if being other DHCP messages in addition to IP address request message for DHCP message, lookup includes There is the formal session of client identification to keep list item;
Communication module 401 is also used to keep the server identification for including in list item according to formal session, to server identification Corresponding server forwards DHCP message.
Optionally, device further include: counting module;
Counting module includes destination service for will delete after interim conversation is kept list item to delete by removing module The counts of the interim conversation list item of device mark add 1;If counts reach preset times, within a preset period of time not to Destination server identifies corresponding destination server and sends IP address request message, and counts are reset;If secondary counting Before number reaches preset times, the interim conversation list item comprising destination server mark is updated to formal session and keeps list item, Then counts are reset.
Optionally, update module is specifically used for keeping the first flag bit in list item to be updated to the second mark interim conversation Position, the first flag bit keep list item for identifying interim conversation, and the second flag bit keeps list item for identifying formal session.
The embodiment of the present application also provides a kind of load-balancing devices, as shown in figure 5, including processor 501, communication interface 502, memory 503 and communication bus 504, wherein processor 501, communication interface 502, memory 503 pass through communication bus 504 complete mutual communication,
Memory 503, for storing computer program;
Processor 501 when for executing the program stored on memory 503, is realized in above method embodiment by bearing Carry the step of equalizing equipment executes.
The communication bus that above-mentioned load-balancing device is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned load-balancing device and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
In another embodiment provided by the present application, a kind of computer readable storage medium is additionally provided, which can It reads to be stored with computer program in storage medium, the computer program realizes any of the above-described Message processing when being executed by processor The step of method.
In another embodiment provided by the present application, a kind of computer program product comprising instruction is additionally provided, when it When running on computers, so that computer executes any message processing method in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or It partly generates according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated meter Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.
The foregoing is merely the preferred embodiments of the application, are not intended to limit the protection scope of the application.It is all Any modification, equivalent replacement, improvement and so within spirit herein and principle are all contained in the protection scope of the application It is interior.

Claims (12)

1. a kind of message processing method, which is characterized in that the method is applied to load-balancing device, which comprises
Receive the dynamic host configuration protocol DHCP message that client is sent;
If it is determined that the DHCP message is IP address request message, then determined according to preset load balancing rule as the visitor The destination server of IP address is distributed at family end, and generate identified comprising the client identification and the destination server it is interim Session keeps list item;
The IP address request message is forwarded to the destination server, and receives the destination server according to the IP address The back message that request message returns;
If the IP address that the back message does not carry as client distribution, interim conversation holding list item is deleted It removes.
2. the method according to claim 1, wherein the method also includes:
If the IP address that the back message carries as client distribution, interim conversation holding list item is updated to Formal session keeps list item, and the formal session keeps the ageing time of list item more than or equal to the rental period of the IP address.
3. according to the method described in claim 2, it is characterized in that, if the DHCP message is in addition to IP address request message Other DHCP messages, the method also includes:
Lookup includes that the formal session of the client identification keeps list item;
The server identification for including in list item is kept according to the formal session, is turned to the corresponding server of the server identification Send out DHCP message described.
4. method according to claim 1-3, which is characterized in that the interim conversation is kept list item described After deletion, the method also includes:
The counts for deleting the interim conversation list item comprising destination server mark are added 1;
If the counts reach preset times, corresponding mesh is not identified to the destination server within a preset period of time It marks server and sends IP address request message, and the counts are reset;
If before the counts reach the preset times, the interim conversation list item comprising destination server mark It is updated to formal session and keeps list item, then reset the counts.
5. according to the method in claim 2 or 3, which is characterized in that described to be updated to interim conversation holding list item Formal session keeps list item, comprising:
The first flag bit in list item is kept to be updated to the second flag bit the interim conversation, first flag bit is for marking Know interim conversation and keep list item, second flag bit keeps list item for identifying formal session.
6. a kind of message process device, which is characterized in that described device is applied to load-balancing device, and described device includes:
Communication module, for receiving the dynamic host configuration protocol DHCP message of client transmission;
Generation module is used for if it is determined that the received DHCP message of the communication module is IP address request message, then basis Preset load balancing rule determines the destination server that IP address is distributed for the client, and generating includes the client The interim conversation of end mark and destination server mark keeps list item;
The communication module is also used to forward the IP address request message to the destination server, and receives the target The back message that server is returned according to the IP address request message;
Removing module, if with not carrying the IP for client distribution for the received back message of the communication module The interim conversation is then kept list item to delete by location.
7. device according to claim 6, which is characterized in that described device further include: update module;
The update module will be described interim if carrying the IP address for client distribution for the back message Session keeps list item to be updated to formal session and keeps list item, and it is described that the formal session keeps the ageing time of list item to be more than or equal to The rental period of IP address.
8. device according to claim 7, which is characterized in that described device further include: searching module;
The searching module is searched if being other DHCP messages in addition to IP address request message for the DHCP message It include the formal session holding list item of the client identification;
The communication module is also used to keep the server identification for including in list item according to the formal session, to the service Device identifies corresponding server and forwards the DHCP message.
9. according to the described in any item devices of claim 6-8, which is characterized in that described device further include: counting module;
The counting module, for including by deletion after the interim conversation is kept list item to delete by the removing module The counts of the interim conversation list item of the destination server mark add 1;If the counts reach preset times, Corresponding destination server is not identified to the destination server in preset time period and send IP address request message, and will be described Counts are reset;If including facing for destination server mark before the counts reach the preset times When session entry be updated to formal session and keep list item, then the counts are reset.
10. device according to claim 7 or 8, which is characterized in that
The update module, specifically for keeping the first flag bit in list item to be updated to the second mark the interim conversation Position, first flag bit keep list item for identifying interim conversation, and second flag bit is kept for identifying formal session List item.
11. a kind of load-balancing device, which is characterized in that described machine readable including processor and machine readable storage medium Storage medium is stored with the machine-executable instruction that can be executed by the processor, and the processor can be performed by the machine Instruction promotes: realizing any method and step of claim 1-5.
12. a kind of machine readable storage medium, which is characterized in that be stored with machine-executable instruction, by processor call and When execution, the machine-executable instruction promotes the processor: realizing any method and step of claim 1-5.
CN201811260255.6A 2018-10-26 2018-10-26 Message processing method and device Active CN109150745B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811260255.6A CN109150745B (en) 2018-10-26 2018-10-26 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811260255.6A CN109150745B (en) 2018-10-26 2018-10-26 Message processing method and device

Publications (2)

Publication Number Publication Date
CN109150745A true CN109150745A (en) 2019-01-04
CN109150745B CN109150745B (en) 2022-06-21

Family

ID=64809914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811260255.6A Active CN109150745B (en) 2018-10-26 2018-10-26 Message processing method and device

Country Status (1)

Country Link
CN (1) CN109150745B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730254A (en) * 2019-10-14 2020-01-24 新华三信息安全技术有限公司 Address allocation method, device, relay equipment and medium
CN111147617A (en) * 2019-12-20 2020-05-12 互联网域名系统北京市工程研究中心有限公司 Method and system for distributing addresses based on DHCP server cluster load
CN111212134A (en) * 2019-12-31 2020-05-29 北京金山云网络技术有限公司 Request message processing method and device, edge computing system and electronic equipment
CN111245913A (en) * 2020-01-06 2020-06-05 深圳壹账通智能科技有限公司 Message sending method and device based on gateway, computer equipment and storage medium
CN113612851A (en) * 2021-08-11 2021-11-05 山石网科通信技术股份有限公司 Remote connection method and device, storage medium and processor

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009082978A1 (en) * 2007-12-28 2009-07-09 Huawei Technologies Co., Ltd. Access network protecting method, system and access edge node
CN102299932A (en) * 2011-09-22 2011-12-28 杭州华三通信技术有限公司 Backup method for DHCP (Dynamic Host Configuration Protocol) server and DHCP server
US20130166754A1 (en) * 2011-12-22 2013-06-27 International Business Machines Corporation Client-driven load balancing of dynamic ip address allocation
CN103457869A (en) * 2013-08-28 2013-12-18 北京星网锐捷网络技术有限公司 Conversation maintaining method and device
CN103795581A (en) * 2012-10-29 2014-05-14 杭州华三通信技术有限公司 Address processing method and address processing device
CN106357838A (en) * 2016-09-26 2017-01-25 杭州昆海信息技术有限公司 Method and device for distributing IP (Internet protocol) address
CN107733995A (en) * 2017-09-21 2018-02-23 北京信安世纪科技股份有限公司 A kind of session keeping method, device and electronic equipment
CN107864101A (en) * 2017-12-26 2018-03-30 杭州迪普科技股份有限公司 Load-balancing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009082978A1 (en) * 2007-12-28 2009-07-09 Huawei Technologies Co., Ltd. Access network protecting method, system and access edge node
CN102299932A (en) * 2011-09-22 2011-12-28 杭州华三通信技术有限公司 Backup method for DHCP (Dynamic Host Configuration Protocol) server and DHCP server
US20130166754A1 (en) * 2011-12-22 2013-06-27 International Business Machines Corporation Client-driven load balancing of dynamic ip address allocation
CN103795581A (en) * 2012-10-29 2014-05-14 杭州华三通信技术有限公司 Address processing method and address processing device
CN103457869A (en) * 2013-08-28 2013-12-18 北京星网锐捷网络技术有限公司 Conversation maintaining method and device
CN106357838A (en) * 2016-09-26 2017-01-25 杭州昆海信息技术有限公司 Method and device for distributing IP (Internet protocol) address
CN107733995A (en) * 2017-09-21 2018-02-23 北京信安世纪科技股份有限公司 A kind of session keeping method, device and electronic equipment
CN107864101A (en) * 2017-12-26 2018-03-30 杭州迪普科技股份有限公司 Load-balancing method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730254A (en) * 2019-10-14 2020-01-24 新华三信息安全技术有限公司 Address allocation method, device, relay equipment and medium
CN111147617A (en) * 2019-12-20 2020-05-12 互联网域名系统北京市工程研究中心有限公司 Method and system for distributing addresses based on DHCP server cluster load
CN111147617B (en) * 2019-12-20 2022-08-12 互联网域名系统北京市工程研究中心有限公司 Method and system for distributing addresses based on DHCP server cluster load
CN111212134A (en) * 2019-12-31 2020-05-29 北京金山云网络技术有限公司 Request message processing method and device, edge computing system and electronic equipment
CN111245913A (en) * 2020-01-06 2020-06-05 深圳壹账通智能科技有限公司 Message sending method and device based on gateway, computer equipment and storage medium
CN113612851A (en) * 2021-08-11 2021-11-05 山石网科通信技术股份有限公司 Remote connection method and device, storage medium and processor

Also Published As

Publication number Publication date
CN109150745B (en) 2022-06-21

Similar Documents

Publication Publication Date Title
CN109150745A (en) A kind of message processing method and device
CN105610632B (en) Virtual network equipment and related method
CN109660607A (en) A kind of service request distribution method, method of reseptance, device and server cluster
EP2800302A1 (en) Method, device and system for determining policy and charging enforcement function
CN102918813A (en) Device and method for data load balancing
CN109510878B (en) Long connection session keeping method and device
CN106570097B (en) Sequence generation method and device
US9621412B2 (en) Method for guaranteeing service continuity in a telecommunication network and system thereof
CN111212134A (en) Request message processing method and device, edge computing system and electronic equipment
CN103685583A (en) Method and system for resolving domain names
CN103781055A (en) Data downloading method and associated device
US20130204926A1 (en) Information processing system, information processing device, client terminal, and computer readable medium
EP2824872A1 (en) Host providing system and communication control method
US10178033B2 (en) System and method for efficient traffic shaping and quota enforcement in a cluster environment
CN105450585A (en) Information transmission method and device
CN106899621B (en) A kind of scheduling system and method
CN102571936A (en) Method, device and system for searching data
US8978048B2 (en) Information processing system, control method, and non-transitory computer readable medium storing program
US9923794B2 (en) Method, apparatus, and system for identifying abnormal IP data stream
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
US7870251B2 (en) Devices, methods, and computer program products for real-time resource capacity management
CN110851275B (en) Load transfer method and device of routing node
CN108366102A (en) A kind of service discovery method, device and electronic equipment based on Consul
CN107682271B (en) Method and device for generating routing line
CN109617817A (en) A kind of generation method and device of the forwarding-table item of MLAG networking

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