Background technology
In the actual networking of communication network, carry the key position of important flow or big flow at some, need to dispose link redundancy usually.Existing redundancy scheme mainly contains two kinds of the redundant and 1:N redundancies of 1+1.
The 1+1 redundancy refers to that each bar active link has a proprietary protection link to provide backup for it.Transmitting terminal transmits data simultaneously on active link and protection link (this process is called bridge joint: Bridge); under normal circumstances; receiving terminal receives data from active link; be received end when detecting when active link breaks down, receiving terminal will switch on the protection interface and receive data from the protection link.Handoff procedure only moves at receiving terminal.
The 1:N redundancy refers to that a protection link provides protection for N bar active link simultaneously.Under normal circumstances, transmitting terminal can transmit the data of some low priorities this moment only at corresponding active link transmitting data on the protection link, certainly, also can not carry out the transmission of data.When active link broke down, the Data Bridge that transmitting terminal will transmit was to the protection link, and receiving terminal receives data from the protection link this moment.If originally have lower-priority data transmitting on the protection link, at this moment, the data of low priority will be made way for the protected data of high priority, also just can not transmit.When having several active links to break down simultaneously, then according to the priority of each active link, have only the data on the limit priority link can be switched on the protection link, the data on the protection link that other breaks down can only be lost.The 1:N redundancy needs transmitting terminal and receiving terminal to switch simultaneously in the protection process.
Especially, when N=1, the 1:N redundancy is exactly the 1:1 redundancy.
No matter be which kind of redundancy scheme, all need to have the support of masterslave switchover mechanism, could when active link breaks down, in time find fault, and be switched to the enterprising line data transmission of protection link.There are several masterslave switchover mechanism in the prior art, briefly introduce respectively below:
APS(Automatic Protection Switching; APS) mechanism is SDH(Synchronous Digital Hierarchy; synchronous digital hierarchy) a kind of APS mechanism in the network utilizes APS can effectively support the redundant and 1+1 redundancy of 1:N.APS mainly is by utilizing the K1K2 byte in the STM-N frame to be with interior negotiation at the protection passage, finishing the reversed process from faulty link to non-faulty link.G.841 APS mechanism is had a detailed description, do not repeat them here.Have only the STM-N interface can use APS mechanism, can't use APS mechanism on the synchronous serial interface.
The general network access layer that is used for of interface backup mechanism, two links are up, and one main one is equipped with.During primary link physics DOWN, standby link physics UP, flow switches to standby link from primary link.This mechanism docking port type is insensitive, and nearly all interface type can both support that synchronous serial interface also can be supported.Yet interface backup is a kind of comparatively ancient redundancy scheme, and the outgoing interface in this mechanism in three layer retransmitting table items is active and standby interface, during active and standby like this switching, will cause the renewal of three layer retransmitting table items, at list item more for a long time, convergence rate is slower, has more seriously influenced the speed of link switchover.And interface backup mechanism can't support the 1+1 redundancy scheme, and flow can not send on active and standby interface simultaneously.
As seen, do not exist in the technical scheme that realizes the 1+1 redundancy on the synchronous serial interface in the prior art.
Summary of the invention
The invention provides and a kind ofly realize method and the device of 1+1 redundancy at synchronous serial interface, occur being switched to the protection link fast when unusual with the active link at synchronous serial interface.
A kind of method in synchronous serial interface realization 1+1 redundancy provided by the invention comprises:
Logic interfacing is set, with two each other redundant synchronous serial interface as the member port of described logic interfacing, with the business configuration more than the link layer of described synchronous serial interface carrying to described logic interfacing;
During initial launch, one of them of redundant synchronous serial interface is as working interface each other with described two, and another one is as the protection interface;
Sequence number and buffer circle are set, and the value of described sequence number is set to initial value;
Working interface whenever receives a message, and the value of described sequence number is increased progressively, and when described sequence number reaches the maximum that sets in advance, the value of described sequence number is re-set as initial value;
The protection interface whenever receives a message, obtains the currency of described sequence number, and judges whether described buffer circle overflows, if do not overflow, the currency of described sequence number is inserted the afterbody of described buffer circle; If buffer circle overflows, judge whether the currency of sequence number is identical with buffer circle sequence number that stem is inserted, if inequality, the currency of sequence number is inserted the stem of described buffer circle, otherwise, working interface and protection interface are switched.
When the currency of sequence number is inserted buffer circle, can further the pointer that points to the current message that receives of protection interface be inserted buffer circle.
Preferably, the span of the length of described buffer circle is: more than or equal to the shortest length that the unusual generation of working interface is judged by accident, smaller or equal to the unusual extreme length that can in time find working interface.
The present invention also provides a kind of and has realized the 1+1 redundant devices at synchronous serial interface, comprising: two redundant synchronous serial interface, logic interfacing, redundant control module and memory cell each other;
Described two each other redundant synchronous serial interface be the member port of described logic interfacing, described logic interfacing is used for described two the redundant synchronous serial interface above business of link layer of carrying each other of configuration;
Described memory cell is used for storage sequence number and buffer circle;
Described redundant control module, be used for when initial launch described two each other one of them of synchronous serial interface of redundancy be set to working interface, another one is set to protect interface;
Be used for when described working interface receives a message, the value of described sequence number is increased progressively, when described sequence number reaches the maximum that sets in advance, be used for the value of described sequence number is re-set as initial value;
And be used for when described protection interface receives a message, obtaining the currency of described sequence number, and judging whether described buffer circle overflows, if do not overflow, the currency of described sequence number is inserted the afterbody of described buffer circle; If buffer circle overflows; whether the currency of judging sequence number is identical with buffer circle sequence number that stem is inserted, if inequality, the currency of sequence number inserted the stem of described buffer circle; otherwise, described working interface and described protection interface are switched.
Redundant control module in the described device is further used for the pointer that points to the current message that receives of protection interface is inserted buffer circle when the currency of sequence number is inserted buffer circle.
Preferably, the span of the length of described buffer circle is: more than or equal to the shortest length that the unusual generation of working interface is judged by accident, smaller or equal to the unusual extreme length that can in time find working interface.
As seen from the above technical solution, method and the device of realizing the 1+1 redundancy at synchronous serial interface provided by the invention, by logic interfacing is set, and with the member port of two redundant each other synchronous serial interfaces as this logic interfacing, realized upper-layer service shielding synchronous serial interface, thereby make not switching of synchronous serial interface be accelerated the speed of link switchover by the perception of upper-layer service institute; In addition; the present invention counts the received message of working interface by safeguarding a sequence number; and by safeguarding the currency of sequence number on the buffer circle storage working interface; realized the abnormality detection to working interface; thereby make can in time being found unusually of working interface; and in time trigger switching between working interface and the protection interface, realized the 1+1 redundancy at synchronous serial interface.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
Fig. 1 is for carrying out the networking schematic diagram of the redundant networking of 1+1 at synchronous serial interface.In networking shown in Figure 1, device A links to each other by two synchronous serial interface links with equipment B, and device A is sent consistent flow from two links, requires equipment B to select a flow, forwards the traffic to equipment C.
Formed the 1+1 redundancy by two synchronous serial interface links between device A and the equipment B.When the link of current reception flow was unusual, equipment B need select the flow on the other link to transmit.But, because no link monitoring agreement can be used between device A and the equipment B, therefore can't implement physical detection and link detecting, can't find that link is unusual, also just can't realize the 1+1 redundancy.
Main thought of the present invention is: can't implement on the synchronous serial interface under the prerequisite of physical detection, link detecting; utilize software simulation to detect the monitors physical link; thereby occur being switched to the protection link fast, with the 1+1 redundancy on effective support synchronous serial interface when unusual at active link.
Based on above-mentioned main thought, the present invention proposes a kind of method in synchronous serial interface realization 1+1 redundancy, and this method may further comprise the steps:
The 1st step: logic interfacing is set, with two each other redundant synchronous serial interface as the member port of this logic interfacing, with the business configuration more than the link layer of described synchronous serial interface carrying to this logic interfacing.
In actual applications, the network equipment is supported logic interfacing usually.The present invention arranges such logic interfacing, with two each other redundant synchronous serial interface as the member port of this logic interfacing, and the upper-layer service (comprising link layer, network layer, application layer etc.) that will be carried on synchronous serial interface is configured and moves based on this logic interfacing, what record in three layer retransmitting table items like this, is exactly logic interfacing but not synchronous serial interface.Therefore, just switching not between two synchronous serial interfaces can be by the perception of upper-layer service institute, thereby has avoided in the prior art, and interface backup mechanism is existing when the list item slower problem of convergence rate more for a long time.
Suppose that the set logic interfacing of the present invention is labeled as redundancy, the configuration sample in the practical application is as follows:
interface?redundancy1
link-protocol?hdlc
member?interface?serial1/1master
member?interface?serial1/2slave
The 2nd step: during initial launch, one of them of redundant synchronous serial interface is as working interface each other with above-mentioned two, and another one is as the protection interface.
During network equipment initial launch, two synchronous serial interface links all do not have fault, any one synchronous serial interface can be set as working interface, and another is as the protection interface.For example: the network equipment can be set receive and converting flow from this member port of master.The present invention is called working interface with the interface of current reception and converting flow, receives but the interface that abandons flow is called the protection interface.
The 3rd step: sequence number and buffer circle are set, and the value of this sequence number is set to initial value.
In this step, set sequence number is used for message received on the working interface is counted, and buffer circle is used for detecting unusually working interface.
The 4th step: synchronous serial interface carries out flow and receives and transmit, and carries out switching of working interface and protection interface when working interface is unusual.Particularly:
Working interface whenever receives a message, and the value of described sequence number is increased progressively, and when sequence number reaches the maximum that sets in advance, the value of sequence number is re-set as initial value;
The protection interface whenever receives a message, obtains the currency of sequence number, and judges whether buffer circle overflows, if do not overflow, the currency of sequence number is inserted the afterbody of buffer circle; If buffer circle overflows, judge whether the currency of sequence number is identical with buffer circle sequence number that stem is inserted, if inequality, the currency of sequence number is inserted the stem of buffer circle, otherwise, working interface and protection interface are switched.
When the currency of sequence number is inserted buffer circle, the pointer that points to the current message that receives of protection interface can also be inserted buffer circle, thereby, when working interface is unusual, can give the message of a period of time before the unusual generation for change.
When specific implementation, a redundant control module can be set realize the above-mentioned function of safeguarding sequence number and buffer circle, and according to the situation of the sequence number of storing in the buffer circle working interface be carried out abnormality detection; Also the function of sequence number be can be realized safeguarding by working interface, and buffer circle and the function of working interface being carried out abnormality detection realized safeguarding by the protection interface.When adopting the latter, because working interface may switch at any time with the protection interface, therefore, sequence number can be arranged in one section memory space that working interface and protection interface can both visit.Current working interface is responsible for safeguarding the value of this sequence number, and the protection interface can be visited at any time, to obtain the current value of sequence number.Certainly, working interface also can obtain the current value of sequence number to the protection interface.
Among the present invention, sequence number is cycle count, and it is enough big that the span of sequence number is wanted, to avoid the counter-rotating of sequence number short time, if the counter-rotating of sequence number short time will cause judging by accident.For example: can sequence number be set to unsigned int, so, the span of sequence number is 0~2
32-1, sequence number will can not reversed at short notice, can avoid the generation of judging by accident.
Describe below by an example:
Working interface is safeguarded a sequence number, and when a message was transmitted in every reception, this sequence number increased progressively, and the initial value of this sequence number is 1;
The protection interface is safeguarded an annular packet buffer district, and the length of buffer area is configurable, is configured to 12 in this example.
When buffer area less than the time, the current value of pointing to sequence number on the pointer of the current message that receives of protection interface and the working interface as one, is inserted buffer circle, as shown in Figure 2.In the buffer circle shown in Figure 2, the S in every represents sequence number, and P represents to point to the pointer of message.
When buffer area overflows, the sequence number (value of this sequence number is the currency of sequence number) that will add among of annular buffer area deducts the sequence number that owner pointer points in the buffer circle, if be not 0(as shown in Figure 3), show that working interface is normal, then owner pointer reach, the tail pointer reach, the item that will add is put into annular buffer area, replaces the item that deposits buffer circle at first in; If be 0(as shown in Figure 4); then illustrate and do not receive flow on the working interface for a long time, working interface has taken place need switch the role of two interfaces unusually; the protection interface becomes working interface and begins to receive flow, and working interface becomes the protection interface and begins to monitor flow.
Above-mentioned steps of the present invention is numbered just for convenience of explanation, in actual applications, is not to implement the present invention according to above-mentioned numbering.For example, the enforcement in above-mentioned the 2nd step and the 3rd step can be carried out by exchanging order.
Among the present invention, the length of buffer circle is configurable.When the length of buffer circle is set, need take into account the factor of two aspects: on the one hand, if the length of buffer circle is too short, may cause the unusual of working interface judged by accident, therefore, the length of buffer circle need be more than or equal to the shortest length that the unusual generation of working interface is judged by accident; On the other hand, if the length of buffer circle is long, may cause can not in time being found unusually of working interface, therefore, the length of buffer circle need be smaller or equal to the unusual extreme length that can in time find working interface.Therefore, in actual applications, need take into account above-mentioned factor, the length of buffering area reasonably is set.
Corresponding to said method, the present invention also provides a kind of and has realized the 1+1 redundant devices at synchronous serial interface, as shown in Figure 5.Device shown in Figure 5 comprises: two redundant synchronous serial interface 501 and 502, logic interfacing 503, memory cell 504 and redundant control module 505 each other, wherein:
Above-mentioned two each other redundant synchronous serial interface 501 and 502 are member ports of logic interfacing 503, logic interfacing 503 is used for these two of the configurations redundant synchronous serial interface above business of link layer of carrying each other;
Memory cell 504 shown in Figure 5 is used for storage sequence number and buffer circle;
Redundant control module 505 shown in Figure 5 is responsible for realizing the 1+1 redundancy between synchronous serial interface 501 and 502, particularly:
When initial launch, be used for above-mentioned two each other one of them of synchronous serial interface of redundancy be set to working interface, another one is set to protect interface; Suppose that be set to working interface with shown in Figure 5 501,502 are set to protect interface;
When working interface 501 receives a message, be used for the value of sequence number is increased progressively, and when sequence number reaches the maximum that sets in advance, be used for the value of sequence number is re-set as initial value;
When protection interface 502 receives a message, be used for obtaining the currency of sequence number, and judge whether buffer circle overflows, if do not overflow, the currency of sequence number is inserted the afterbody of buffer circle; If buffer circle overflows, judge whether the currency of sequence number is identical with buffer circle sequence number that stem is inserted, if inequality, the currency of sequence number is inserted the stem of buffer circle, otherwise, working interface 501 and protection interface 502 are switched.
Redundant control module 505 in the device shown in Figure 5 can be further used for the pointer that points to the protection interface 501 current messages that receive is inserted buffer circle when the currency of sequence number is inserted buffer circle.
The preferable span of the length of buffer circle is: more than or equal to the shortest length that the unusual generation of working interface is judged by accident, smaller or equal to the unusual extreme length that can in time find working interface.
When specific implementation, the function of redundant control module 505 also can be realized by working interface 501 and protection interface 502 respectively.For example: be responsible for safeguarding sequence number by working interface, and the protection interface is responsible for safeguarding buffer circle and working interface is carried out abnormality detection, particularly:
When working interface 501 whenever receives a message, be used for the value of sequence number is increased progressively, and when sequence number reaches the maximum that sets in advance, the value of sequence number is re-set as initial value;
When protection interface 502 whenever receives a message, be used for obtaining the currency of sequence number, and judge whether buffer circle overflows, if do not overflow, the currency of sequence number is inserted the afterbody of buffer circle; If buffer circle overflows; whether the currency of judging sequence number is identical with buffer circle sequence number that stem is inserted; if it is inequality; the currency of sequence number is inserted the stem of buffer circle; otherwise; notice working interface 501 role that it is current switches to the protection interface, and will protect interface 502 self to switch to working interface.
As seen from the above-described embodiment, the present invention is by arranging logic interfacing, and two will be each other redundant synchronous serial interfaces have realized upper-layer service shielding synchronous serial interface as the member port of this logic interfacing, thereby make the switching of synchronous serial interface can be by the perception of upper-layer service institute; In addition; the present invention counts the received message of working interface by safeguarding a sequence number; and by safeguarding the currency of sequence number on the buffer circle storage working interface; realized the abnormality detection to working interface; thereby make can in time being found unusually of working interface; and in time trigger switching between working interface and the protection interface, realized the 1+1 redundancy at synchronous serial interface.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.