A kind of distal end PW BFD descriptor learning method and system based on network processing unit
Technical field
The present invention relates to the technical fields for learning PW BFD descriptor in distal end in communication equipment, and in particular to one kind is based on net
The distal end PW BFD descriptor learning method and system of network processor.
Background technique
In current operator's return network, with being stepped up for portfolio, network topology is gradually complicated, matches in equipment
The PW BFD quantity set is also more and more, and wherein PW BFD is practical two-way converting detection BFD (Bidirectional
Forwarding Detection) binding pseudo-wire PW (Pseudowire) business a kind of configuration, for quickly detecting certain PW
State.During local terminal and opposite equip. establish dynamic bidirectional forwarding detection BFD, traditional dynamic PW BFD study is retouched
Stating symbol process is that control software is realized by transmitting-receiving LSP PING message, learns the BFD descriptor of distal end later by configuration data
It is handed down to the hardware of business board.It will appear cross-domain L2VPN in return network, intermediate cross-domain point is MS-PW node, this
Under scene, when PW BFD is established in local terminal and opposite end, if learning descriptor using LSP PING, local terminal does not know the IP of opposite end,
So the IP of LSP PING can only use the IP of MS-PW node, then software is controlled according to the binding of cross-domain PW by MS-PW node
Relationship converts the data and configuration of LSP PING message, and control software realization process is complicated, and feasibility is not high.
By way of controlling software learning PW BFD descriptor, control software will receive and parse through LSP PING message,
Whole operation process is run on cpu system, if local device is configured with thousands of dynamic PW BFD,
During BFD is established, entire learning process needs to repeat thousand times, and the process of dynamic PW BFD study descriptor can consume CPU
Resource, CPU usage can maintain a high position in learning process, influence whether to operate in the control software on CPU when serious
Other modules.For example the higher Routing Protocol of requirement of real-time is restrained.
Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of distal ends based on network processing unit
PW BFD descriptor learning method and system, implementation process is simple, high reliablity.
To achieve the above objectives, the technical solution adopted by the present invention is that:
A kind of distal end PW BFD descriptor learning method based on network processing unit, the specific steps are as follows:
Internal list item is arranged in S1 on the network processing unit of local terminal, and internal list item includes PW label and local terminal BFD descriptor
Corresponding relationship;
S2, after the BFD message that distal end is sent reaches network processing unit, network processing unit extracts BFD message, parsing BFD report
Text extracts PW label, and internal list item is searched using PW label as KEY, closes according to PW label is corresponding with local terminal BFD descriptor
System, network processing unit obtain corresponding local terminal BFD descriptor;
BFD message is written in local terminal BFD descriptor by S3, network processing unit, completes the study of BFD descriptor.
Based on the above technical solution, in S1, PW label is generated according to Routing Protocol, corresponding, PW label
End BFD descriptor is generated according to user configuration or control software algorithm.
Based on the above technical solution, specific step is as follows by the S2:
S20, after the BFD message that distal end is sent reaches network processing unit, network processing unit screens and extracts BFD message;
S21, network processing unit parses BFD message, and the YID field for obtaining BFD message is transferred to S22 if YID=0,
Conversely, then terminating, it is transferred to S23;
S22, network processing unit extracts the PW label of BFD message, using PW label as the inside of KEY Network Search processor
List item obtains a corresponding local terminal BFD descriptor according to the corresponding relationship of PW label and local terminal BFD descriptor;
BFD message is directly forwarded to FPGA by S23, network processing unit, and FPGA does subsequent BFD state machine processing.
Based on the above technical solution, in S3, by the YID field of local BFD descriptor write-in BFD message.
Based on the above technical solution, YID field is the remote descriptors of BFD session.
A kind of distal end PW BFD descriptor learning system based on network processing unit, comprising:
Internal list item setting unit, for internal list item to be arranged on the network processing unit of local terminal, wherein internal list item packet
Include the corresponding relationship of PW label Yu local terminal BFD descriptor;
Local terminal BFD descriptor acquiring unit, for from the BFD message that network processing unit extracts, parsing BFD message to be extracted
PW label, and using PW label as the inside list item of KEY Network Search processor, according to PW label and local terminal BFD descriptor
Corresponding relationship obtains corresponding local terminal BFD descriptor;
Local terminal BFD descriptor writing unit, for BFD message to be written from network processing unit by local terminal BFD descriptor.
Based on the above technical solution, the internal list item setting unit includes PW label generation unit and local terminal
BFD descriptor generation unit:
PW label generation unit, for generating PW label according to Routing Protocol;
Local terminal BFD descriptor generation unit, it is corresponding for generating PW label according to user configuration or control software algorithm
Local terminal BFD descriptor.
Based on the above technical solution, local terminal BFD descriptor writing unit reports local BFD descriptor write-in BFD
The YID field of text.
Compared with the prior art, the advantages of the present invention are as follows:
(1) present invention in the distal end PW BFD descriptor learning method based on network processing unit, first by PW label with
In the corresponding relationship write-in network processing unit of BFD descriptor, BFD descriptor is learnt by network processing unit, in entire learning process
It does not need control software to participate in, solves the problem concerning study of BFD descriptor under cross-domain scene, implementation process is simple, high reliablity.
(2) the distal end PW BFD descriptor learning method based on network processing unit in the present invention is received without using control software
It sends out LSP PING message and realizes that dynamic PW BFD learns descriptor process, the process of all PW BFD descriptor study is in net
It completes, is not run on CPU on network processor, reduce consumption of the BFD study to system CPU, improve the whole of system
Body performance.
Detailed description of the invention
Fig. 1 is the method flow diagram of the embodiment of the present invention;
Fig. 2 is the system flow chart of the embodiment of the present invention.
Specific embodiment
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Shown in Figure 1, the embodiment of the present invention provides a kind of distal end PW BFD descriptor study based on network processing unit
Method, the specific steps are as follows:
Internal list item is arranged in the network processing unit of local terminal in S1, and internal list item includes that several PW labels are retouched with local terminal BFD
State the corresponding relationship of symbol;Wherein, PW label is generated according to Routing Protocol, and the corresponding local terminal BFD descriptor of PW label is root
It is generated according to user configuration or control software algorithm.BFD descriptor for identifying a BFD session, be it is unique in equipment,
General bit wide is 32b.
S2, after the BFD message that distal end is sent reaches network processing unit, network processing unit extracts BFD message, parsing BFD report
Text extracts PW label, and internal list item is searched using PW label as KEY, closes according to PW label is corresponding with local terminal BFD descriptor
System, network processing unit obtain corresponding local terminal BFD descriptor;
Wherein specific step is as follows by S2:
S20, the BFD message that distal end is sent is after network processing unit plate mouth arrival network processing unit, network processing unit screening
And BFD message is extracted, wherein the format of BFD message is the head the Ethernet header+MPLS head+IP+BFD descriptor;
S21, network processing unit parses BFD message, and the YID field for obtaining BFD message is transferred to S22 if YID=0,
Conversely, then terminating, it is transferred to S23;
S22, network processing unit extracts the PW label of BFD message, using PW label as the inside of KEY Network Search processor
List item obtains a corresponding local terminal BFD descriptor according to the corresponding relationship of PW label and local terminal BFD descriptor;
BFD message is directly forwarded to FPGA by S23, network processing unit, and FPGA does subsequent BFD state machine processing.
The YID field of local terminal BFD descriptor write-in BFD message is completed the study of BFD descriptor by S3, network processing unit.
YID field is the remote descriptors of BFD session.
Shown in Figure 2, the present invention provides a kind of distal end PW BFD descriptor learning system based on network processing unit, packet
It includes:
Internal list item setting unit, for internal list item to be arranged in the network processing unit of local terminal, wherein internal list item packet
Include the corresponding relationship of several PW labels Yu local terminal BFD descriptor;
Wherein, internal list item setting unit includes PW label generation unit and local terminal BFD descriptor generation unit: PW label
Generation unit, for generating PW label according to Routing Protocol;
Local terminal BFD descriptor generation unit, it is corresponding for generating PW label according to user configuration or control software algorithm
Local terminal BFD descriptor.
Local terminal BFD descriptor acquiring unit, for from the BFD message that network processing unit extracts, parsing BFD message to be extracted
PW label, and using PW label as the inside list item of KEY Network Search processor, according to PW label and local terminal BFD descriptor
Corresponding relationship obtains corresponding local terminal BFD descriptor.
Local terminal BFD descriptor writing unit, for local terminal BFD descriptor to be written to the YID of BFD message from network processing unit
Field.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from
Under the premise of the principle of the invention, several improvements and modifications can also be made, these improvements and modifications are also considered as protection of the invention
Within the scope of.The content being not described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.