CN100488204C - Method for enquiring IPSec tunnel state - Google Patents
Method for enquiring IPSec tunnel state Download PDFInfo
- Publication number
- CN100488204C CN100488204C CNB2006100805699A CN200610080569A CN100488204C CN 100488204 C CN100488204 C CN 100488204C CN B2006100805699 A CNB2006100805699 A CN B2006100805699A CN 200610080569 A CN200610080569 A CN 200610080569A CN 100488204 C CN100488204 C CN 100488204C
- Authority
- CN
- China
- Prior art keywords
- ipsec tunnel
- issuer
- ipsec
- answer party
- characteristic parameter
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The disclosed method inquires IPSec channel according to target feature parameters, can avoid indirect query to produce error, interrupt communication and reduce reliability, and ensures normal running of communication network.
Description
Technical field
The present invention relates to the network security detection technique, refer to a kind of method of inquiry IP safety (IPSec) tunnel state especially.
Background technology
IPSec is the IP layer security framework agreement of an opening of the Internet engineering duty group (IETF) formulation, is a Layer 3 Tunneling Protocol.IPSec works in network layer, can provide safeguard protection for the transmission sensitive data, and the IP packet that transmits between the equipment that participates in IPSec is protected and authenticated.IPSec has been arranged, and data need not worry that victim monitors, alters and forges by public network transmissions the time.
The ipsec protocol protecting data is that (Security Association SA) realizes by Security Association.Defined the agreement of communicating pair among the IPSec SA, for example, used the shared key of protected data in the operator scheme, cryptographic algorithm, specific stream of which kind of agreement, agreement and life cycle of key etc. some key element in the communication process.IPSec SA carries out unique identification by a tlv triple, and this tlv triple comprises: Security Parameter Index (SPI), purpose IP address and security protocol.
After communicating pair is set up ipsec tunnel, communicating pair must keep the consistent and existence simultaneously of the SA of this ipsec tunnel, could guarantee that negotiation message and data-message carry out encryption and decryption normally, could guarantee that promptly communicating pair normally uses this ipsec tunnel to carry out data communication.Therefore, just need certain mechanism to come enquiring IPSec tunnel, promptly after the ipsec tunnel of communicating pair is set up, whether query communication both sides' IPSec SA exists simultaneously, so that when communicating pair IPSec SA does not exist simultaneously, trigger the former ipsec tunnel of deletion, rebulid new ipsec tunnel, guarantee the proper communication of data.
In the prior art, the inquiry to the ipsec tunnel state normally realizes by the dead opposite end detection (DPD) in the internet key exchange protocol (IKE).
DPD determines the state of IPSec SA by detecting the state of the IKE SA corresponding with IPSec SA, and then the state of definite IPSec that will inquire about.Here, the state of described IKE SA or IPSec SA is: whether IKE SA or IPSec SA exist; The state of described ipsec tunnel is: whether ipsec tunnel is available.But in the prior art, the state of IKE SA can not be represented the state of corresponding IPSecSA, that is to say, even under the situation that IKE SA exists, the IPSecSA corresponding with IKE SA also not necessarily can exist.Therefore the state of the state confirmation ipsec tunnel by inquiry IKE SA and unreasonable, if the wrong state of having determined ipsec tunnel, can make this testing mechanism ineffective, and cause the interruption of data communication, data communication can't be recovered for a long time automatically, bring harmful effect for the network actual motion.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method of enquiring IPSec tunnel state, uses this method and can inquire the current state of ipsec tunnel accurately, reliably.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of method of enquiring IPSec tunnel state, this method may further comprise the steps:
A, ISSUER send the ipsec tunnel query messages to answer party, carry the characteristic parameter of at least one ipsec tunnel that will inquire about in the ipsec tunnel query messages;
The characteristic parameter that carries in B, the answer party acquisition ipsec tunnel query messages is inquired about self and whether is had identical characteristic parameter, and Query Result is returned to the ISSUER;
The Query Result that C, ISSUER return according to answer party when there is identical characteristic parameter in answer party, determines that then the ipsec tunnel of described identical characteristic parameter correspondence can be used; When there is not identical characteristic parameter in answer party, determine that then the described ipsec tunnel of identical characteristic parameter correspondence that do not exist is unavailable.
In addition, in the time will inquiring about one or more ipsec tunnel, among the step B, describedly Query Result returned to the ISSUER be:
By a piece of news the Query Result of one or more ipsec tunnel is returned to the ISSUER; Or
At every ipsec tunnel, return a Query Result to the ISSUER respectively.
Wherein, among the step B, describedly Query Result returned to the ISSUER be:
When there is identical characteristic parameter in answer party, then return ipsec tunnel successful inquiring message to the ISSUER at described identical characteristic parameter; When there is not identical characteristic parameter in answer party, then do not exist identical characteristic parameter to respond failure to the ISSUER at described.
Wherein, described response failure is: answer party returns ipsec tunnel inquiry failed message to the ISSUER.
In addition, waiting timer further is set and waits for duration, when the ISSUER sends the ipsec tunnel query messages, start waiting timer;
Among the step B, described response failure is: when there is not the characteristic parameter of wanting enquiring IPSec tunnel in answer party, do not return Query Result to the ISSUER;
Among the step C, it is described when there is identical characteristic parameter in answer party, the ipsec tunnel of then determining described identical characteristic parameter correspondence is available as: when waiting timer arrives when waiting for duration, the ISSUER has received Query Result, determines that then the ipsec tunnel of described Query Result correspondence can be used; It is described when there is not identical characteristic parameter in answer party, determining then that the described ipsec tunnel that does not have an identical characteristic parameter correspondence is unavailable is: when waiting timer arrives when waiting for duration, the ISSUER does not receive Query Result, determines that then the ipsec tunnel of described Query Result correspondence is unavailable.
In addition, inquiry timer and polling cycle are set further, when the ISSUER sends the ipsec tunnel query messages, start the inquiry timer in the steps A; When the inquiry timer arrives polling cycle, judge whether the current state of enquiring IPSec tunnel of wanting is determined, if then inquire about timer and stop timing; Otherwise the ISSUER sends the ipsec tunnel query messages at the ipsec tunnel of not determining state.
In addition, maximum inquiry times further is set, the ipsec tunnel query messages that the ISSUER sends is counted, before the ISSUER sends the ipsec tunnel query messages at the ipsec tunnel of not determining state, further judge whether the ipsec tunnel query messages of current transmission is less than or equal to maximum inquiry times, if then carry out described transmission ipsec tunnel query messages; Otherwise, finish current handling process.
In addition, before step C, further comprise:
Judge whether the Query Result that answer party returns is the response that the ISSUER sends query messages in current polling cycle, if, execution in step C then; Otherwise refusal is handled the Query Result that current answer party returns.
Wherein, need send data or polling cycle when arriving to answer party, execution in step A as the ISSUER.
Wherein, described characteristic parameter is: the Security Parameter Index of ipsec tunnel outgoing direction Security Association, purpose IP address and security protocol; Or the Security Parameter Index of ipsec tunnel Inbound Security Association, purpose IP address and security protocol; Or the Security Parameter Index of the Security Parameter Index of ipsec tunnel outgoing direction Security Association, purpose IP address and security protocol and Inbound Security Association, purpose IP address and security protocol.
The method of a kind of enquiring IPSec tunnel state provided by the present invention according to the characteristic parameter of wanting enquiring IPSec tunnel, is inquired about the state of ipsec tunnel, determines the state of ipsec tunnel.Method provided by the present invention, avoided because inquiry indirectly promptly reflects the state of current ipsec tunnel by the state of inquiring about other, and caused because the wrong state of determining ipsec tunnel, make communication disruption, degradation problem under system delay, the reduction of customer service quality, the communication reliability.Method provided by the invention can inquire the current time of day of ipsec tunnel accurately, fast, reliably, reduced system delay, the normal operation of communication network that improved the reliability of communication, strong assurance.
Description of drawings
Fig. 1 is the flow chart of the embodiment of the invention one method;
Fig. 2 is the flow chart of the embodiment of the invention two methods.
Embodiment
Whether the communicating pair of setting up ipsec tunnel by inquiry exists identical IPSecSA in the present invention, determines whether the ipsec tunnel that communicating pair sets up is available.When setting up ipsec tunnel, can produce two IPSec SA simultaneously, the both sides that set up ipsec tunnel in this hypothesis are respectively: A and B, two IPSec SA of generation are respectively 1 and 2; If IPSec SA1 is outgoing direction SA, the IPSecSA2 of A is the Inbound SA of A; Then IPSec SA1 is the Inbound SA of B, the outgoing direction SA that IPSec SA2 is B.Here, the communication party's of each ipsec tunnel outgoing direction SA and the difference of Inbound SA are that the communication party utilizes the secret key encryption among the outgoing direction SA to send data; Receive data with the secret key decryption among the Inbound SA.Here, described communicating pair exists identical IPSec SA to be meant: there are two IPSec SA of ipsec tunnel correspondence simultaneously in communicating pair.
Owing to being simultaneous for setting up two IPSec SA that ipsec tunnel produces, therefore in the present invention, can be by determining whether communicating pair exists one of them IPSec SA simultaneously, determine whether communicating pair exists two identical IPSec SA, and then whether the ipsec tunnel that definite communicating pair is set up is available.
Because IPSec SA comes unique identification by the tlv triple that Security Parameter Index (SPI), purpose IP address and security protocol are formed.Therefore, the implication that IPSec SA is identical here is: communicating pair has the IPSec SA of identical tlv triple.Because two IPSec SA corresponding to same ipsec tunnel produce simultaneously, exist simultaneously and bind mutually, therefore the equal unique identification ipsec tunnel separately of these two IPSec SA tlv triple, so the tlv triple of these two IPSec SA all can be called the characteristic parameter of ipsec tunnel.
For making purpose of the present invention, technical scheme and advantage clearer, in invention, be listed as for two example two, the present invention is described in further detail.
The main distinction of these two embodiment is that embodiment one is: an ipsec tunnel setting up of query communication both sides only in the one query process; Embodiment two is: the ipsec tunnel of one or more that the query communication both sides set up in query script once.Below respectively these two embodiment are elaborated.
Embodiment one
When the ipsec tunnel of communicating pair foundation did not have data traffic for a long time, a side of communication was before initiating transfer of data, and whether the ipsec tunnel that the opposite end self is arrived in then necessary affirmation earlier is available.Here, describe,, for the initiator of inquiry, be called the ISSUER in the present invention the initiator of communication for convenient; The communication initiator is desired to carry out the opposite end of transfer of data, and promptly Cha Xun respondent is called answer party.In the application process of reality, can also be before the ISSUER initiate communication at every turn, whether the ipsec tunnel of all inquiring about self current required use is available.Whether available concrete enquiring IPSec tunnel flow process as shown in Figure 1:
Step 101: the ISSUER sends the ipsec tunnel query messages to answer party, carries self current characteristic parameter that is about to the ipsec tunnel of use in the ipsec tunnel query messages.
The characteristic parameter here can be ISSUER's outgoing direction SA tlv triple, also can be ISSUER's Inbound SA tlv triple.In order to simplify description, two IPSec SA with ipsec tunnel are referred to as ipsec tunnel SA hereinafter, if the characteristic parameter that uses in the ipsec tunnel query messages is an outgoing direction SA tlv triple, then corresponding ipsec tunnel SA is outgoing direction SA; If the characteristic parameter that uses in the ipsec tunnel query messages is an Inbound SA tlv triple, then corresponding ipsec tunnel SA is Inbound SA.
The data format of ipsec tunnel query messages can be inherited the form of IKE DPD message, also can adopt self-defining form.If inherit IKE DPD message format, then can adopt form as shown in table 1.
Table 1
Message format shown in the table 1 has been continued to use the message format framework of IKE DPD query messages.Wherein, the implication of each field and effect, all identical with former IKE DPD query messages, do not giving unnecessary details at this.Because the present invention is a state of determining corresponding ipsec tunnel by the state of enquiring IPSec SA, therefore in query messages, need carry the information that is used for enquiring IPSec SA state, and then in the respective field of query messages, also can have different content, specify as follows:
The domain of interpretation (Domain of Interpretation, the standard code of inserting in DOI) is to be used for various digital implications in the message field are described, which type of implication of each digitized representation is to determine according to different standards in the message, two standards are arranged in the ipsec protocol stack, one is the isakmp standard, i.e. IKE standard, and code is 0, another is the IPSec standard, the standard that promptly meets RFC 2407, code are 1, because in the present embodiment, at ipsec tunnel, therefore insert 1 here.Insert the length of current query messages in loaded length (Payload Length) field, do not comprise the header of this message correspondence.Insert the security protocol that current enquiring IPSec tunnel is supported in protocol number (Protocol-ID) field, a checking agreement (AH) or ESP (ESP) promptly carry security protocol in the IPSec SA tlv triple by the protocol number field.Insert in the SPI length, the length of SPI is 4 bytes.In message type field, insert the type of message of this message, if the ipsec tunnel query messages is then inserted IPSec-DPD-Request, if the ipsec tunnel response message is then inserted IPSec-DPD-Response.In the SPI field, insert the current SPI that wants enquiring IPSec tunnel, promptly carry SPI in the IPSec SA tlv triple by the SPI field.Next load (Next Payload) field zero filling shows and has only a load in this message.Reserved field (RESERVED) zero filling shows that keeping the position does not temporarily use.Notification data (Notification Data) field is inserted the sequence number of this message.
At this, the query messages of inserting IPSec SA information is called IPSec DPD message.As can be seen from Table 1, in IPSec DPD message, obviously do not carry purpose IP address information necessary in the IPSec SA tlv triple, reason is: IPSec DPD message is carried by the IP message, owing to must carry the purpose IP address that this message mails in the heading of IP message, therefore consider from the aspect that economizes on resources, IPSec DPD does not just need the purpose IP address field is set in addition, is used for carrying the purpose IP address in the IPSec SA tlv triple.
The ipsec tunnel query messages can also adopt self-defining message format, no matter which kind of form framework self-defining message format adopt, needs the SA of enquiring IPSec tunnel tlv triple as long as carry in self-defining message format.If the employing user-defined format then needs in advance at the equipment of communicating pair this form to be set, make the equipment of communicating pair all support self-defining message format in this, so that after receiving this self-defining message, message is discerned, resolved.
Step 102: answer party receives the ISSUER and sends to the ipsec tunnel query messages of self, obtains the IPSec SA tlv triple of carrying from the ipsec tunnel query messages that receives.Search in the database of equipment of itself according to the IPSecSA tlv triple that obtains, judge whether to exist identical IPSec SA tlv triple,, then return ipsec tunnel successful inquiring message to the ISSUER if exist; Otherwise, then respond ipsec tunnel inquiry failed message to the ISSUER.Here, ipsec tunnel successful inquiring message and ipsec tunnel inquiry failed message are referred to as the ipsec tunnel query response message.
Answer party obtains IPSec SA tlv triple from the ipsec tunnel query messages that receives: answer party is at first resolved the message type field that receives in the message, judge whether to be the ipsec tunnel query messages, if, then according to the shared byte number of each field, method according to prior art is resolved the ipsec tunnel query messages, the purpose IP address of carrying in the SPI that acquisition is wherein carried and security protocol and the ipsec tunnel query messages heading; Otherwise, the message that receives is carried out respective handling according to the type that obtains message.
Answer party also can adopt form as shown in table 1 to the ipsec tunnel query response message that the ISSUER returns, and is specially:
When answer party during, after then the type of message in the ipsec tunnel query messages that the ISSUER who receives is sent changes IPSec-DPD-Response into, send to the ISSUER to ipsec tunnel successful inquiring message that the ISSUER returns.
When answer party is inquired about failed message to the ipsec tunnel that the ISSUER returns, then the type of message in the ipsec tunnel query messages that the ISSUER who receives is sent changes IPSec-DPD-Response into, and, send to the ISSUER with behind wherein the SPI and/or the deletion of the content in the security protocol field.
Here, answer party can also return the ipsec tunnel query response message to the ISSUER in other way, for example, can only need carry the indication of success or failure in the instruction to the ISSUER by returning an instruction.
Step 103: the ipsec tunnel query response message that returns according to answer party, the ISSUER judges whether answer party exists identical IPSec SA, promptly judge and received ipsec tunnel successful inquiring message or ipsec tunnel inquiry failed message, if exist, then the ipsec tunnel of determining the current inquiry of ISSUER can be used, and the ISSUER can utilize this ipsec tunnel and answer party to carry out safe data communication; Otherwise, the ipsec tunnel of determining the current inquiry of ISSUER is unavailable, the ISSUER then can not utilize this ipsec tunnel and answer party to carry out safe data communication, and the ISSUER then can delete this ipsec tunnel, so as to rebulid and answer party between ipsec tunnel.
Generally because abominable, the assailant's of network environment attack, and some other factor, can cause the ISSUER may not or time-delay receive the response message that answer party returns.So just need waiting timer is set and wait for duration the ISSUER, when waiting timer arrives the wait duration, then be considered as the not IPSec SA identical with the ISSUER of answer party, the ISSUER determines that then the current ipsec tunnel that will inquire about is unavailable.Specific implementation process can be following form:
The ISSUER starts waiting timer when sending the ipsec tunnel query message; When waiting timer arrives the wait duration, the ISSUER judges self whether to have received the ipsec tunnel query response message that answer party returns, if received, then determine the state of the current ipsec tunnel that will inquire about according to the ipsec tunnel query response message of receiving; Otherwise the ISSUER determines that then the current ipsec tunnel that will inquire about is unavailable, finishes the handling process of current enquiring IPSec tunnel state, promptly no longer handles the follow-up ipsec tunnel query response message that receives.
Existence at the abominable and network attack that takes into full account network environment, in the present embodiment under the situation of validity that takes into full account current enquiring IPSec tunnel and reliability, inquiry timer, polling cycle and maximum inquiry times can also be set, repeat inquiry.Wherein, when the inquiry timer arrived polling cycle at every turn, the ISSUER determined whether to send the ipsec tunnel query messages once more then according to the situation of current enquiring IPSec tunnel.Here, maximum inquiry times is used for specifies query side and can sends the number of times of ipsec tunnel query messages altogether.Repeating to inquire about specific implementation process can be following form:
The ISSUER starts the inquiry timer when sending the ipsec tunnel query message, and begins the query messages that the ISSUER sends to answer party is begun counting.When the inquiry timer arrived polling cycle, the ISSUER judged then whether self has determined to want enquiring IPSec tunnel state, if determine, then inquired about timer and stopped timing, finished current querying flow; If do not determine, the ISSUER judges then whether the current number of times that has sent the ipsec tunnel query messages is less than or equal to the maximum inquiry times of setting again, if not, then inquire about timer and stop timing, finish current querying flow, if then send the ipsec tunnel query messages to answer party once more, and on the query messages number that has sent, add 1.
Be provided with under inquiry timer and the situation of polling cycle, the ISSUER is when receiving the ipsec tunnel query response message that answer party returns, can also judge further whether the current response message of receiving is the response message of the query messages of transmission in the current period, if then handle the current response message that receives; Otherwise, do not handle the current response message that receives.In order to simplify description, abbreviate the ipsec tunnel query messages as query messages in this article; Abbreviate the ipsec tunnel query response message as response message.
Here, judge whether the current response message of receiving is the response message that sends query messages in the current period, can be according to following method: each query messages is numbered, this this query messages of numbering energy unique identification, and set up query messages numbering and concern one to one with inquiry times, when answer party response query messages, the numbering of in response message, carrying corresponding query messages; The ISSUER judges whether the numbering of carrying in the current response message of receiving is corresponding with current inquiry times after receiving the response message that answer party returns, if corresponding, then handles the current response message that receives; Otherwise, do not handle the current response message that receives.Wherein, query messages is numbered in the notification data field that can be carried in the table 1.Here, the numbering to query messages can be the inquiry times of current record.
Here, can also be only the ISSUER be received that the ipsec tunnel successful inquiring message that answer party returns handles, the ISSUER is not received that the ipsec tunnel inquiry failed message that answer party returns handles, because even ipsec tunnel inquiry failed message is that the assailant forges, the both sides of communication only need rebulid ipsec tunnel and get final product, and the fail safe of communication quality and communication can't produce too much influence.Therefore, under this execution mode, when the message that receives as the ISSUER is ipsec tunnel successful inquiring message, judge further more whether the current ipsec tunnel successful inquiring message of receiving is the response message of the query messages of transmission in the current period, if then handle the current ipsec tunnel successful inquiring message that receives; Otherwise, do not handle the current ipsec tunnel successful inquiring message that receives.
In step 102, when there is not identical IPSec SA tlv triple in answer party, can also not return any message to the ISSUER, promptly represent self not exist identical IPSec SA tlv triple to the ISSUER by the mode of return messages not.So in this case, just need the ISSUER when sending the ipsec tunnel query message, start waiting timer; When waiting timer arrive to be waited for duration, the ISSUER judged self whether to have received the ipsec tunnel query response message that answer party returns, if received, then determined that according to the ipsec tunnel query response message of receiving the tunnel of message correspondence can use; Otherwise the ISSUER determines that then the current ipsec tunnel that will inquire about is unavailable, finishes the handling process of current enquiring IPSec tunnel state.
When the ISSUER represents self not have identical IPSecSA tlv triple, inquiry timer, polling cycle and maximum inquiry times can be set also in the mode of answer party by return messages not, repeat inquiry.The process that repeats to inquire about does not repeat them here as mentioned above.
In the present embodiment, except can the ISSUER need use and answer party between ipsec tunnel before, trigger the state that the ISSUER inquires about ipsec tunnel between self and the answer party, can also periodically inquire about, timer promptly is set, when timer arrives triggering during the cycle, promptly trigger the ipsec tunnel between ISSUER's inquiry and the answer party.
In the present invention, with periodically to the inquiry of ipsec tunnel and before needs send message to the inquiry of ipsec tunnel, be called the opportunity of enquiring IPSec tunnel.
Embodiment two
The present embodiment introduction be: the ISSUER by an ipsec tunnel query messages inquire about one or more self and answer party between the ipsec tunnel state.Detailed process is as shown in Figure 2:
Step 201: the ISSUER sends the ipsec tunnel query messages to answer party, carries current one or more ipsec tunnel SA tlv triple that needs inquiry in the ipsec tunnel query messages.
The data format of ipsec tunnel query messages can be inherited the form of IKE DPD message, also can adopt self-defining form.If inherit IKE DPD message format, then can adopt form as shown in table 2.
Table 2
The implication of each field is identical with the implication of each field in the table 1 in the table 2, is not giving unnecessary details at this.Table 2 is compared with table 1, has just increased protocol number field, SPI length field, reserved field and SPI field, the information that is used for carrying more ipsec tunnel SA, and the number of the ipsec tunnel that the concrete number that increases can be inquired about is as required determined.Wherein, the reserved field of increase can zero filling, also can remove.Here, in message type field, need insert IPSec-DPD-Multi-Request, be used for representing that the ISSUER inquires about at a plurality of ipsec tunnels; Accordingly, answer party then need be inserted IPSec-DPD-Multi-Response using identical message format when the ISSUER returns response message in message type field.
Step 202: answer party receives the ISSUER and sends to the ipsec tunnel query messages of self, the tlv triple of a plurality of IPSec SA that acquisition is wherein carried from the ipsec tunnel query messages that receives.Search in self database according to the tlv triple that obtains each IPSec SA, judge self whether there is identical IPSec SA tlv triple at each IPSec SA tlv triple, at existing identical IPSec SA tlv triple to return ipsec tunnel successful inquiring message to the ISSUER; Return ipsec tunnel inquiry failed message at there not being identical IPSec SA tlv triple to the ISSUER.
Answer party resolve receive message process can according to embodiment one in the method introduced in the step 102.
Here, at existing identical IPSec SA tlv triple to return ipsec tunnel successful inquiring message to the ISSUER; And, can be to return ipsec tunnel successful inquiring or failed message to the ISSUER respectively at different IPSec SA tlv triple at not existing identical IPSec SA tlv triple to return ipsec tunnel inquiry failed message to the ISSUER.For example, 6 ipsec tunnels between current inquiry of ISSUER self and the answer party, wherein answer party all self is inquiring identical IPSec SA tlv triple at the 1st, 2 with 3 ipsec tunnels; And all do not inquire identical IPSec SA tlv triple with 6 ipsec tunnels at the 4th, 5.Then this moment, answer party returns ipsec tunnel successful inquiring message at the 1st, 2 and 3 ipsec tunnel to the ISSUER respectively, and returns ipsec tunnel inquiry failed message at the 4th, 5 and 6 ipsec tunnel to answer party respectively simultaneously.
Answer party can also pass through a piece of news, and the request for information of each ipsec tunnel between current ISSUER and the answer party is returned to the ISSUER together.When the ISSUER received the response message that answer party returns, the ISSUER then can determine the state of each ipsec tunnel that will inquire about according to the content of carrying in the response message.
Answer party also can be form as shown in table 2 by a piece of news to the form that the ISSUER returns response message.Concrete method can be by increasing another field of back in each SPI field, to represent the preceding whether successful inquiring of the corresponding IPSec SA of SPI field institute; Also can keep SPI and protocol number, for the IPSec SA deletion SPI or the protocol number of inquiry failure for the IPSec SA of successful inquiring.
Step 203: the ISSUER receives the response message that answer party returns, and according to the request for information of each ipsec tunnel in the response message, determines the current state that needs each ipsec tunnel of inquiry.
For example, if answer party returns response message by a piece of news to the ISSUER, 1st, 2 all self inquiring identical IPSec SA tlv triple, and all do not inquiring identical IPSec SA tlv triple with 6 ipsec tunnels at the 4th, 5 with 3 ipsec tunnels; Then the ISSUER determines according to the content of message, answer party enquiring IPSec tunnel 1,2 and 3 successes, and enquiring IPSec tunnel 4,5 and 6 failures, and then the ISSUER determines that the state of ipsec tunnel 1,2 and 3 is available, ipsec tunnel 4,5 and 6 is unavailable.
If answer party returns response message at every ipsec tunnel, then the ISSUER determines the state of the ipsec tunnel of this message correspondence according to every response message, in this case, and can be referring to the step 103 among the embodiment one.
In embodiment two, when answer party by a piece of news when the ISSUER returns response message, also can waiting timer identically with embodiment one be set and wait for duration, when waiting timer arrives the wait duration, judge and self whether received the ipsec tunnel query response message that answer party returns, if received,, determine the state of current each ipsec tunnel then according to the request for information of each ipsec tunnel in the ipsec tunnel response message; Otherwise the ISSUER determines that then the current ipsec tunnel that will inquire about is unavailable, finishes the handling process of current enquiring IPSec tunnel state.
When answer party adopts at different ipsec tunnels respectively when the ISSUER returns ipsec tunnel successful inquiring or failed message, also can waiting timer identically with embodiment one be set and wait for duration, when waiting timer arrives the wait duration, according to self current paid-in response message, determine response message the state of corresponding ipsec tunnel; If do not return response message at some ipsec tunnel answer party, it is unavailable then to determine not return the pairing ipsec tunnel of response message, finishes the handling process of current enquiring IPSec tunnel state.
When answer party adopts at different ipsec tunnels respectively when the ISSUER returns ipsec tunnel successful inquiring or failed message, in embodiment two, can also and embodiment one identical the repetition inquire about, be provided with and inquire about timer, polling cycle and inquiry times.The ISSUER starts the inquiry timer when sending the ipsec tunnel query message, and begins the query messages that the ISSUER sends to answer party is begun counting.When the inquiry timer arrives polling cycle, the ISSUER judges then whether self has determined the state that all want enquiring IPSec tunnel, if all want the state of enquiring IPSec tunnel all to determine, then inquire about timer and stop timing, finish current querying flow; Definite as long as exist the state of an ipsec tunnel not have in the ipsec tunnel that will inquire about, the ISSUER judges then whether the current number of times that has sent the ipsec tunnel query messages is less than or equal to the maximum inquiry times of setting again, if not, then inquire about timer and stop timing, finish current querying flow, if, then send the ipsec tunnel query messages to answer party once more, wherein carry the current SA tlv triple of not determining the ipsec tunnel of upstate, and on the query messages number that has sent, add 1.
When being provided with under inquiry timer and the situation of polling cycle, the ISSUER is when receiving the ipsec tunnel query response message that answer party returns, can also judge further whether the current response message of receiving is the response message of the query messages of transmission in the current period, if then handle the current response message that receives; Otherwise, do not handle the current response message that receives.
Here, can also be only the ISSUER be received that the ipsec tunnel successful inquiring message that answer party returns handles, the ISSUER is not received that the ipsec tunnel inquiry failed message that answer party returns handles, because even ipsec tunnel inquiry failed message is that the assailant forges, the both sides of communication only need rebulid ipsec tunnel and get final product, and the fail safe of communication quality and communication can't produce too much influence.Therefore, under this execution mode, when the message that receives as the ISSUER is ipsec tunnel successful inquiring message, judge further just whether the current ipsec tunnel successful inquiring message of receiving is the response message of the query messages of transmission in the current period, if then handle the current ipsec tunnel successful inquiring message that receives; Otherwise, do not handle the current ipsec tunnel successful inquiring message that receives.
In embodiment two, when there is not the IPSec SA tlv triple of wanting enquiring IPSec in answer party, also can adopt the processing mode among the embodiment one, promptly represent self not exist the IPSec SA tlv triple of wanting enquiring IPSec tunnel to the ISSUER by the mode of not returning response message.Waiting timer then need be set this moment and wait for duration.Return under the situation of response message at answer party to the ISSUER by a piece of news, when waiting timer arrives the wait duration, the ISSUER judges self whether to have received the ipsec tunnel query response message that answer party returns, if received, then, determine the state of current each ipsec tunnel according to the request for information of each ipsec tunnel in the ipsec tunnel response message; Otherwise the ISSUER determines that then the current ipsec tunnel that will inquire about is unavailable, finishes the handling process of current enquiring IPSec tunnel state.Return under the situation of ipsec tunnel successful inquiring or failed message to the ISSUER respectively at different ipsec tunnels in the answer party employing, also need to be provided with waiting timer and wait for duration, when waiting timer arrives the wait duration, according to self current paid-in response message, determine response message the state of corresponding ipsec tunnel; If do not return response message at some ipsec tunnel answer party, it is unavailable then to determine not return the pairing ipsec tunnel of response message, finishes the handling process of current enquiring IPSec tunnel state.
When answer party at the ipsec tunnel that respectively will inquire about respectively when the ISSUER returns ipsec tunnel successful inquiring message or does not return response message, inquiry timer, polling cycle and inquiry times also can be set repeat inquiry, repeating among detailed process and the embodiment two inquired about identical, do not repeat them here.
In the present invention, when answer party enquiring IPSec SA tlv triple is unsuccessful, two kinds of implementations are arranged, a kind of is to return ipsec tunnel inquiry failed message to the ISSUER, a kind of is not return any message to the ISSUER, and these two kinds of implementations can be referred to as answer party and respond failure to the ISSUER.
In the present invention, except can whether having one of them IPSec SA, determine whether communicating pair exists two identical IPSec SA, and then whether the ipsec tunnel that definite communicating pair is set up is available by definite communicating pair; Can also determine simultaneously whether communicating pair exists two identical IPSecSA, determine whether the ipsec tunnel of communicating pair foundation is available.Promptly in the ipsec tunnel query messages, carry ISSUER's outgoing direction SA tlv triple and Inbound SA tlv triple simultaneously, check simultaneously by answer party whether the tlv triple of two SA exists again, and then whether the ipsec tunnel that definite communicating pair is set up is available, here other processing procedure is identical with the process described in embodiment one and the embodiment two, is not described in detail in this.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.
Claims (10)
1, a kind of method of enquiring IPSec tunnel state is characterized in that, this method may further comprise the steps:
A, ISSUER send the ipsec tunnel query messages to answer party, carry the characteristic parameter of at least one ipsec tunnel that will inquire about in the ipsec tunnel query messages;
The characteristic parameter that carries in B, the answer party acquisition ipsec tunnel query messages is inquired about self and whether is had identical characteristic parameter, and Query Result is returned to the ISSUER;
The Query Result that C, ISSUER return according to answer party when there is identical characteristic parameter in answer party, determines that then the ipsec tunnel of described identical characteristic parameter correspondence can be used; When there is not identical characteristic parameter in answer party, determine that then the described ipsec tunnel of identical characteristic parameter correspondence that do not exist is unavailable.
2, method according to claim 1 is characterized in that, in the time will inquiring about one or more ipsec tunnel, among the step B, describedly Query Result is returned to the ISSUER is:
By a piece of news the Query Result of one or more ipsec tunnel is returned to the ISSUER; Or
At every ipsec tunnel, return a Query Result to the ISSUER respectively.
3. method according to claim 1 is characterized in that, among the step B, describedly Query Result is returned to the ISSUER is:
When there is identical characteristic parameter in answer party, then return ipsec tunnel successful inquiring message to the ISSUER at described identical characteristic parameter;
When there is not identical characteristic parameter in answer party, then do not exist identical characteristic parameter to respond failure to the ISSUER at described.
4, method according to claim 3 is characterized in that, described response failure is: answer party returns ipsec tunnel inquiry failed message to the ISSUER.
5, method according to claim 3 is characterized in that, waiting timer further is set and waits for duration, when the ISSUER sends the ipsec tunnel query messages, starts waiting timer;
Among the step B, described response failure is: when there is not the characteristic parameter of wanting enquiring IPSec tunnel in answer party, do not return Query Result to the ISSUER;
Among the step C, it is described when there is identical characteristic parameter in answer party, the ipsec tunnel of then determining described identical characteristic parameter correspondence is available as: when waiting timer arrives when waiting for duration, the ISSUER has received Query Result, determines that then the ipsec tunnel of described Query Result correspondence can be used; It is described when there is not identical characteristic parameter in answer party, determining then that the described ipsec tunnel that does not have an identical characteristic parameter correspondence is unavailable is: when waiting timer arrives when waiting for duration, the ISSUER does not receive Query Result, determines that then the ipsec tunnel of described Query Result correspondence is unavailable.
6, according to claim 1,3,4 or 5 described methods, it is characterized in that, inquiry timer and polling cycle further are set, when the ISSUER sends the ipsec tunnel query messages, start the inquiry timer in the steps A;
When the inquiry timer arrives polling cycle, judge whether the current state of enquiring IPSec tunnel of wanting is determined, if then inquire about timer and stop timing; Otherwise the ISSUER sends the ipsec tunnel query messages at the ipsec tunnel of not determining state.
7, method according to claim 6 is characterized in that, maximum inquiry times further is set, the ipsec tunnel query messages that the ISSUER sends is counted,
Before the ISSUER sends the ipsec tunnel query messages at the ipsec tunnel of not determining state, further judge whether the ipsec tunnel query messages of current transmission is less than or equal to maximum inquiry times, if then carry out described transmission ipsec tunnel query messages; Otherwise, finish current handling process.
8, method according to claim 6 is characterized in that, before step C, further comprises:
Judge whether the Query Result that answer party returns is the response that the ISSUER sends query messages in current polling cycle, if, execution in step C then; Otherwise refusal is handled the Query Result that current answer party returns.
9, method according to claim 1 is characterized in that, when the ISSUER need send data or polling cycle when arriving to answer party, execution in step A.
10, method according to claim 1 is characterized in that, described characteristic parameter is:
The Security Parameter Index of ipsec tunnel outgoing direction Security Association, purpose IP address and security protocol;
Or the Security Parameter Index of ipsec tunnel Inbound Security Association, purpose IP address and security protocol;
Or the Security Parameter Index of the Security Parameter Index of ipsec tunnel outgoing direction Security Association, purpose IP address and security protocol and Inbound Security Association, purpose IP address and security protocol.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100805699A CN100488204C (en) | 2006-05-17 | 2006-05-17 | Method for enquiring IPSec tunnel state |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100805699A CN100488204C (en) | 2006-05-17 | 2006-05-17 | Method for enquiring IPSec tunnel state |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1845549A CN1845549A (en) | 2006-10-11 |
CN100488204C true CN100488204C (en) | 2009-05-13 |
Family
ID=37064462
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100805699A Expired - Fee Related CN100488204C (en) | 2006-05-17 | 2006-05-17 | Method for enquiring IPSec tunnel state |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100488204C (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101521602B (en) * | 2008-02-29 | 2012-09-05 | 上海博达数据通信有限公司 | Realizing method for utilizing IKE to monitor the state of communication nodes in IPSec VPN |
CN103716196B (en) * | 2012-09-28 | 2018-10-09 | 新华三技术有限公司 | A kind of network equipment and detection method |
WO2016106589A1 (en) * | 2014-12-30 | 2016-07-07 | 华为技术有限公司 | Dead peer detection method, ipsec peer and network device |
CN107682284B (en) | 2017-08-02 | 2021-06-01 | 华为技术有限公司 | Method and network equipment for sending message |
CN111641545B (en) * | 2020-05-15 | 2022-06-21 | 深信服科技股份有限公司 | Tunnel detection method and device, equipment and storage medium |
CN112737965B (en) * | 2020-12-31 | 2022-12-23 | 网络通信与安全紫金山实验室 | Method, system and computer readable storage medium for solving problem of limitation of concurrent access network element |
-
2006
- 2006-05-17 CN CNB2006100805699A patent/CN100488204C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1845549A (en) | 2006-10-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100488204C (en) | Method for enquiring IPSec tunnel state | |
CN102148810B (en) | Security association lifetime detection method, device and system | |
EP1625466B1 (en) | Using TCP to authenticate IP source addresses | |
Lau et al. | Layer two tunneling protocol-version 3 (L2TPv3) | |
EP1533977B1 (en) | Detection of denial of service attacks against SIP (session initiation protocol) elements | |
CN101258706B (en) | Methods for secure and bandwidth efficient cryptographic synchronization | |
US20060221946A1 (en) | Connection establishment on a tcp offload engine | |
CN106685930B (en) | Method and device for processing transmission control protocol options | |
CA2565409A1 (en) | Preventing network reset denial of service attacks using embedded authentication information | |
CN102655509B (en) | Network attack identification method and device | |
CN101594359A (en) | Defence synchronous flood attack method of transmission control protocol and transmission control protocol proxy | |
CN101527729A (en) | Reliable IKE message negotiation method, device and system thereof | |
CN101022458B (en) | Conversation control method and control device | |
CN111064755B (en) | Data protection method and device, computer equipment and storage medium | |
EP2214368A1 (en) | A wapi unicast secret key negotiation method | |
WO2016106589A1 (en) | Dead peer detection method, ipsec peer and network device | |
EP1881668A1 (en) | The method, system and apparatus for transferring syslog message | |
EP2211496A1 (en) | Key management method | |
CN109600277B (en) | IPSec tunnel keep-alive method and device based on NAT equipment | |
JP4847951B2 (en) | Protocol extension of signaling messages | |
EP1838038B1 (en) | Method for transfering network event protocol messages | |
JP2003283489A (en) | Packet authentication system, authentication method, group management server and group member device | |
US20140177575A1 (en) | Method for establishing an application session, device and corresponding notification | |
CN111262885B (en) | DPD detection system based on IPSEC | |
CN115473680B (en) | Application-preventing DDoS method based on online interactive WEB dynamic defense |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Patentee after: Xinhua three Technology Co., Ltd. Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base Patentee before: Huasan Communication Technology Co., Ltd. |
|
CP03 | Change of name, title or address | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090513 Termination date: 20200517 |
|
CF01 | Termination of patent right due to non-payment of annual fee |