Embodiment
Below in conjunction with accompanying drawing, the embodiment of notifying method, device and the routing device of a kind of interface IP address that the embodiment of the invention is provided is at length explained.
The notifying method of the interface IP address that the embodiment of the invention provides, as shown in Figure 1, this method comprises the steps:
S101, send the address when adding message to LDP neighbours, judge whether that sending the address to this interface IP address to LDP neighbours adds message at needs; If judge that not sending the address to this interface IP address to LDP neighbours adds message, then carries out following step S102; Otherwise turn to step S103;
S102, this interface IP address is carried at the address adds in the message and announce to LDP neighbours;
S103, process ends;
In above-mentioned steps S101; Through judging whether the corresponding announcement sign of this interface IP address has been set to effectively judge whether that sending the address to this interface IP address to LDP neighbours adds message; Judging that the corresponding announcement sign of this interface IP address has been set to when effective; Confirm that then sending the address to this interface IP address to LDP neighbours adds message, otherwise confirm that not sending the address to this interface IP address to LDP neighbours adds message.
The corresponding announcement sign of this interface IP address has been set to effectively judging, and this interface IP address is carried at the address is adding in the message and announce to LDP neighbours, also need carry out the corresponding announcement sign of this interface IP address and be set to effective step.
In the embodiment of the invention; It is to be arranged in advance among the data structure of interface IP address that announcement identifies; Each interface IP address is announcement sign of correspondence all, and it was worth for false (non-effective), sent address interpolation message to this interface IP address after when this announced sign initialization; Need to announce sign and be set to a specific value (effectively), this specific value characterizes and sent address interpolation message to this interface IP address.
In embodiments of the present invention, need send the address to LDP neighbours adds the situation of message and comprises:
A, receive the situation that announcement is added in the local interface address; The local interface address is added and to be announced the announcement that produces in this locality under the situation such as interface IP address normally changes.
B, local interface are become the situation of UP state by the DOWN state;
C, the local new LDP session of creating are in the situation of UP state.
Below respectively to above-mentioned three kinds of situation, the notifying method of the interface IP address that the embodiment of the invention is provided is elaborated.
For the A situation:
As shown in Figure 2, the notifying method of this situation lower interface address specifically comprises the steps:
S201, receive interface IP address and add announcement;
S202, search whether there is the corresponding address record, if there is not execution in step S203; Carry out following step S204 if exist;
S203, write down this interface IP address; Execution in step S204 then;
S204, judge whether the corresponding interface of this interface IP address is in the UP state;
If this interface IP address to a plurality of interfaces should be arranged, needs one by one the state of each interface to be judged, only just can carry out following step S205 for the interface that is in the UP state, otherwise, turn to execution in step S208;
S205, judge whether the announcement sign (SEND_FLAG) of this interface IP address is set to effectively, if not, the further following step S206 of execution then; If then turn to execution in step S208;
S206, this interface IP address is carried at the address adds in the message announcement to all LDP neighbours;
S207, the announcement sign that this interface IP address is corresponding are set to effectively carry out following step S208 then;
S208, process ends.
For the B situation:
As shown in Figure 3, the notifying method of this situation lower interface address specifically comprises the steps:
S301, local interface become the UP state;
S302, to this interface each interface IP address down, judge whether the corresponding announcement sign of this interface IP address is set to effective; If not, carry out following step S303, otherwise, following step S306 carried out;
S303, this interface IP address is carried at the address adds in the message announcement to all LDP neighbours; Execution in step S304 then;
S304, the announcement sign that this interface IP address is corresponding are set to effectively turn to execution in step S305 then;
S305, judge that whether this interface is to there being other interface IP addresses; If turn to execution in step S302; If not, execution in step S306;
S306, process ends.
For the C situation:
As shown in Figure 4, the notifying method of this situation lower interface address specifically comprises the steps:
S401, new LDP session are in the UP state;
The announcement sign of the correspondence of S402, the current total interface of cancellation address;
S403, travel through the corresponding interface IP address of each interface, judge whether the announcement sign of this interface IP address is set to effectively; If, carry out following step S406, otherwise, following step S404 carried out;
S404, this interface IP address is carried at the address adds in the message announcement to all LDP neighbours; Execution in step S405 then;
S405, the announcement sign that this interface IP address is corresponding are set to effectively turn to execution in step S406 then;
S406, judgement are worked as front port and whether are also had other corresponding interface IP addresses, if, turn to execution in step S403, otherwise, execution in step S407;
S407 judges whether also to exist other interfaces to be untreated, if, turn to execution in step S403, otherwise, execution in step S408;
S408, process ends.
The notifying method of the interface IP address that the embodiment of the invention provides when LDP neighbours send address withdraw message, judges whether this interface IP address is gone back related other and be in the interface of UP state at needs; When judging this interface IP address related other are not in the interface of UP state, this interface IP address is carried in the address withdraw message announces to LDP neighbours.
Announce in the address withdraw message to LDP neighbours saying that this interface IP address is carried at, also need carry out the corresponding announcement sign of this interface IP address of cancellation, and the step of deleting this interface IP address.
In embodiments of the present invention, need there be following two kinds to the situation that LDP neighbours send address withdraw message:
D, delete certain interface IP address;
E, certain interface are changed into the state of DOWN by UP;
Carry out detailed explanation to above-mentioned two kinds of situation respectively below.
For the D situation, the notifying method of the interface IP address that the embodiment of the invention provides, as shown in Figure 5, comprise the steps:
Whether related other are in the interface of UP state to this interface IP address that S501, judgement need be deleted; If not, then carry out following step S502, if turn to and carry out following step S505;
S502, this interface IP address is carried in the address withdraw message announcement to all LDP neighbours;
S503, the announcement sign that this interface IP address of cancellation record is corresponding in this locality;
S504, at this interface IP address of this locality deletion; Execution in step S505 then;
S505, process ends.
For the E situation, the notifying method of the interface IP address that the embodiment of the invention provides, as shown in Figure 6, comprise the steps:
Each corresponding interface IP address of interface of DOWN state appears in S601, traversal; For each interface IP address, judge whether related other are in the interface of UP state to this interface IP address; If not, then carry out following step S602, if turn to and carry out following step S605;
S602, this interface IP address is carried at announces in the address withdraw message to LDP neighbours;
S603, the announcement sign that this interface IP address of cancellation record is corresponding in this locality;
S604, at this interface IP address of this locality deletion; Carry out following step S605 then;
S605, judge that this interface whether also to other interface IP addresses should be arranged, if having, turns to execution in step S601; If do not have, carry out following step S606;
S606, process ends.
Based on same inventive concept; The embodiment of the invention also provides a kind of means for signalling and routing device of interface IP address; Because these devices are similar with the notifying method of aforementioned a kind of interface IP address with the principle that equipment is dealt with problems; Therefore the enforcement of these devices and equipment can repeat part and repeat no more referring to the enforcement of method.
The means for signalling of a kind of interface IP address that the embodiment of the invention provides, as shown in Figure 7, comprising:
Judging unit 701 is used at needs when LDP neighbours send address interpolation message, judging whether that sending the address to this interface IP address to LDP neighbours adds message;
Notification unit 702 is used for being directed against this interface IP address when LDP neighbours sent address interpolation message in judging unit 701 judgements, this interface IP address is carried in the address interpolation message announces to LDP neighbours.
Further, above-mentioned judging unit 701 is used for through judging whether the corresponding announcement sign of this interface IP address has been set to effectively; If confirm that then sending the address to this interface IP address to LDP neighbours adds message; If not, confirm that then not sending the address to this interface IP address to LDP neighbours adds message.
Further; The means for signalling of the interface IP address that the embodiment of the invention provides; As shown in Figure 7; Can also comprise: the announcement sign is provided with unit 703, is used in notification unit 702 this interface IP address being carried at address message and announces to LDP neighbours' step, and the announcement of this interface IP address sign is set to effectively.
Further; The new LDP session of creating is under the UP state status in this locality, and this judging unit 701 is further used for local each interface of traversal; To each corresponding interface IP address of each interface, judge whether the announcement sign of this interface IP address has been set to effectively;
Said announcement sign is provided with unit 703, also is used for before local each interface of judging unit 701 traversals the announcement sign that the total interface address of the local storage of cancellation is corresponding.
Further, above-mentioned judging unit 701 also is used at needs when LDP neighbours send address withdraw message, judges whether this interface IP address is gone back related other and be in the interface of UP state;
Correspondingly, said notification unit 702 also is used for when said judging unit 701 is judged these interface IP addresses related other are not in the interface of UP state, this interface IP address is carried in the address withdraw message announces to LDP neighbours.
Further, the means for signalling of the interface IP address that the embodiment of the invention provides, as shown in Figure 7, can also comprise: address delete cells 704;
Said announcement sign is provided with unit 703, also is used in said notification unit 702 this interface being carried at address withdraw message and announces to LDP neighbours, the announcement sign that this interface IP address of cancellation is corresponding in this locality;
Said address delete cells 704 is used for unit 703 being set after the corresponding announcement sign of this locality this interface IP address of cancellation in said announcement sign, deletes this interface IP address.
The embodiment of the invention also provides a kind of routing device, and this routing device comprises the means for signalling of the above-mentioned interface IP address that the embodiment of the invention provides.
Preferably, the routing device that the embodiment of the invention provides for the LSR of supporting the LDP agreement (Label Switching Router, LSR).
The notifying method of the interface IP address that the embodiment of the invention provides, device and routing device; Send the address when adding message at needs to LDP neighbours; Judge whether to be directed against this interface IP address and sent address interpolation message,, this interface IP address is carried in the address interpolation message announces to LDP neighbours if judgement was directed against this interface IP address when LDP neighbours sent address interpolation message to LDP neighbours; Like this; Use at interface IP address, just a plurality of interfaces all use under the situation of same interface IP address, avoid repeatedly sending address interpolation message to same interface IP address to LDP neighbours and cause address conflict to make the LDP session problem of DOWN occur.
In addition; The notifying method of the interface IP address that the embodiment of the invention provides, device and routing device, need to judge whether this interface IP address is associated with the interface that other are in the UP state at needs when LDP neighbours send address withdraw message; If do not have; Just this interface IP address is carried at and announces in the address withdraw message, like this, can avoid under the situation that interface IP address is used to LDP neighbours; The DOWN state appears in some interfaces in a plurality of interfaces of shared same interface IP address; Perhaps need delete this interface IP address but this interface IP address also related other when being in the interface of UP state, delete this interface IP address in advance, the interface that causes being in the UP state can't re-use this interface IP address and communicate by letter normally.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.