Summary of the invention
The object of the present invention is to provide a kind of optical line terminal equipment ethernet port character control device, be intended to solve in prior art to debug double link structure, can only be debugged by the method for plug circuit board or plug optical fiber link, easy damage circuit board and Optical fiber plug, give debugging and safeguard the problem made troubles.
The present invention realizes like this, a kind of optical line terminal equipment ethernet port character control device, described optical line terminal equipment ethernet port character control device is built in the RSTP module of the optical line terminal equipment of ethernet passive optical network system, and described device specifically comprises:
Bridge message processing module, for configuring bridge entities structure, and obtain the data message of outside input, simultaneously, Bridge configuration parsing is carried out to the data message got, obtain the type of described data message, the type of described data message specifically comprises port deal with data and state machine deal with data, and described bridge message processing module is connected with the external command configuration module for inputting external command;
Port information processing module, be connected with described bridge message processing module, for being configured port organization body, and to described bridge message processing module resolve the port deal with data obtained proceed type resolve, port information table corresponding with it for the type of resolving the port data obtained is compared, and according to the port data after comparison result output processing, simultaneously, generate the first hardware driving instruction, wherein, the type of described data message comprises command configuration information and data transmit package informatin, described port information table is provided with two, be designated as the first port information table and the second port information table respectively, whether described first port information table marks by the port of command set is specially backup port and corresponding port information, described second port information table is set up by analyzing BPDU, described port information processing module is connected with driver module, described driver module connects optical line terminal equipment master chip, described driver module is for driving described optical line terminal equipment master chip determination backup link or conveying data, wherein, described port organization body specifically comprises the pointer pointing to next port variable, port state machine list, bridge belonging to the port and port timer,
State machine processing module, be connected with described bridge message processing module and port information processing module, for to described bridge message processing module resolve the process that the state machine deal with data that obtains and described port information processing module export after port data carry out computing and control, generate the second hardware driving instruction, described state machine processing module also connects described driver module;
Described first hardware driving instruction and described second hardware driving instruction are transported to described driver module respectively, and described driver module and described external command configuration module are all connected with main program module.
As a kind of improved plan, bridge message processing module is also for carrying out number statistics to the data message received, when loss three BPDUs, described bridge message processing module generates the 3rd hardware driving instruction, described 3rd hardware driving instruction is transported to described driver module, for driving backup link as data channel.
As a kind of improved plan, described bridge entities structure specifically comprises the statistical information that port pointer, state machine pointer, bridge variable, protocol version, bridge id, bridge temporal information, root port ID, root priority, root temporal information, bridge mark and bridge are in operation.
As a kind of improved plan, the state of port comprises and abandons, learns and forwarding state, and the type of port comprises root port, assigns port, alternate port and backup port.
As a kind of improved plan, state machine specifically comprises port role selection mode machine, Port Profile transition state machine, port role transfering state machine, port status transfering state machine, port information state machine, topology change state machine, Linktype state machine and port cost state machine.
Another object of the embodiment of the present invention is to provide a kind of optical line terminal equipment ethernet port character control method based on optical line terminal equipment ethernet port character control device, and described optical line terminal equipment ethernet port character control method specifically comprises the steps:
Bridge message processing module configuration bridge entities structure, and obtain the data message of outside input, simultaneously, Bridge configuration parsing is carried out to the data message got, obtain the type of described data message, the type of described data message specifically comprises port deal with data and state machine deal with data, and described bridge message processing module is connected with the external command configuration module for inputting external command;
Port information processing module is configured port organization body, and to described bridge message processing module resolve the port deal with data obtained proceed type resolve, port information table corresponding with it for the type of resolving the port data obtained is compared, and according to the port data after comparison result output processing, simultaneously, generate the first hardware driving instruction, wherein, the type of described data message comprises command configuration information and data transmit package informatin, described port information table is provided with two, be designated as the first port information table and the second port information table respectively, whether described first port information table marks by the port of command set is specially backup port and corresponding port information, described second port information table is set up by analyzing BPDU, described port information processing module is connected with driver module, described driver module connects optical line terminal equipment master chip, described driver module is for driving described optical line terminal equipment master chip determination backup link or conveying data, wherein, described port organization body specifically comprises the pointer pointing to next port variable, port state machine list, bridge belonging to the port and port timer,
State machine processing module to described bridge message processing module resolve the process that the state machine deal with data that obtains and described port information processing module export after port data carry out computing and control, generate the second hardware driving instruction, described state machine processing module also connects described driver module;
Described first hardware driving instruction and described second hardware driving instruction are transported to described driver module respectively, and described driver module and described external command configuration module are all connected with main program module.
As a kind of improved plan, described method also comprises the steps:
Described bridge message processing module is also for carrying out number statistics to the data message received, when loss three BPDUs, described bridge message processing module generates the 3rd hardware driving instruction, described 3rd hardware driving instruction is transported to described driver module, for driving backup link as data channel.
As a kind of improved plan, described bridge entities structure specifically comprises the statistical information that port pointer, state machine pointer, bridge variable, protocol version, bridge id, bridge temporal information, root port ID, root priority, root temporal information, bridge mark and bridge are in operation.
As a kind of improved plan, the state of port comprises and abandons, learns and forwarding state, and the type of port comprises root port, assigns port, alternate port and backup port.
As a kind of improved plan, state machine specifically comprises port role selection mode machine, Port Profile transition state machine, port role transfering state machine, port status transfering state machine, port information state machine, topology change state machine, Linktype state machine and port cost state machine.
In embodiments of the present invention, RSTP module in OLT device is carried out function refinement, be specially bridge message processing module, port information processing module and state machine processing module, its duty of each tool of its each functional module, improve the operating efficiency of OLT device, the constringency performance of overall EPON system improves.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 1 shows the structured flowchart of optical line terminal equipment ethernet port character control device provided by the invention, for convenience of explanation, only provides part related to the present invention in figure.
Optical line terminal equipment ethernet port character control device is built in the RSTP module of optical line terminal equipment (OLT) of ethernet passive optical network system, described device specifically comprises bridge message processing module 11, port information processing module 12 and state machine processing module 13, in fact, these three modules are to the concrete refinement of the function of RSTP module, namely to the division of relevant to technical solution of the present invention three content module, it is specific as follows:
Bridge message processing module 11 is for configuring bridge entities structure, and obtain the data message of outside input, simultaneously, Bridge configuration parsing is carried out to the data message got, obtain the type of described data message, the type of described data message specifically comprises port deal with data and state machine deal with data, and described bridge message processing module is connected with the external command configuration module for inputting external command;
Port information processing module 12 is connected with described bridge message processing module 11, for being configured port organization body, and to described bridge message processing module 11 resolve the port deal with data obtained proceed type resolve, port information table corresponding with it for the type of resolving the port data obtained is compared, and according to the port data after comparison result output processing, simultaneously, generate the first hardware driving instruction, wherein, the type of described data message comprises command configuration information and data transmit package informatin, described port information table is provided with two, be designated as the first port information table and the second port information table respectively, whether described first port information table marks by the port of command set is specially backup port and corresponding port information, described second port information table is set up by analyzing BPDU, described port information processing module 12 is connected with driver module (unmarked in figure), described driver module connects optical line terminal equipment master chip, described driver module is for driving described optical line terminal equipment master chip determination backup link or conveying data, wherein, described port organization body specifically comprises the pointer pointing to next port variable, port state machine list, bridge belonging to the port and port timer,
State machine processing module 13 is connected with described bridge message processing module 11 and port information processing module 12, for to described bridge message processing module 11 resolve the process that the state machine deal with data that obtains and described port information processing module 12 export after port data carry out computing and control, generate the second hardware driving instruction, described state machine processing module 13 also connects described driver module;
First hardware driving instruction and described second hardware driving instruction are transported to described driver module respectively, described driver module carries out hardware driving to OLT master chip, and described driver module and described external command configuration module are all connected with main program module.
Wherein, above-mentioned RSTP module is functional module common in OLT, it exists as single functional module, this RSTP module carries out being refined as bridge message processing module 11, port information processing module 12 and state machine processing module 13 by the embodiment of the present invention, its function carries out concrete refinement, operating efficiency improves, and constringency performance improves.
In embodiments of the present invention, bridge message processing module 11 is also for carrying out number statistics to the data message received, when loss three BPDUs, described bridge message processing module 11 generates the 3rd hardware driving instruction, described 3rd hardware driving instruction is transported to described driver module, for driving backup link as data channel, described data message is BPDU, particularly:
In the course of work of bridge message processing module 11, what continue adds up the BPDU received, when losing three BPDUs continuously, bridge message processing module 11 generates one the 3rd hardware driving instruction automatically, when the 3rd hardware driving instruction is got by driver module, drives relevant hardware, using current alternate channel as main sendaisle, original data send main channel and interrupt, and break down, and prompting is safeguarded.
In embodiments of the present invention, bridge message processing module 11, port information processing module 12 and state machine processing module 13 process the data of its correspondence respectively, it belongs to work in essence, such as bridge information belongs bridge message processing module 11 processes, port information belongs to port information process 12 and processes, the deal with data that residue is specialized then is processed by state machine processing module 13, wherein:
Two inquiries are set in port information processing module 12 according to table, the first port information table and the second port information table respectively, these two port information tables are as a core point of the present embodiment, whether its first port information table marks by the port of command set is specially backup port and corresponding port information, described second port information table is set up by analyzing BPDU, and it comprises following two operating process:
(1), when each module automatic synchronization work that the present embodiment provides, the second port information table is as main reference frame, and it provides foundation for data transmit-receive link, namely gives tacit consent to link and carries link as key data, is namely used for realizing the conveying of routine data;
(2), when staff to be controlled link by CLI order select or debugging maintenance time, then can input corresponding CLI order bag by external hardware, bridge message processing module 11 is resolved this CLI order bag, and lost to port information processing module 12, port information processing module 12 is resolved this CLI order, and contrast the first port information table, according to the content described in this table, set corresponding link as main conveying link.
Therefore, from above-mentioned two implementations, in OLT device in debugging or maintenance process, improve adjustable and the maintainability of equipment, thus further increase fast convergence.
In embodiments of the present invention, above-mentioned bridge message processing module 11, port information processing module 12 and state machine processing module 13 are except the feature of foregoing description, also possesses conventional function, the functions such as the poll of such as port information processing module 12, it is specific as follows states described in content, but not in order to limit the present invention.
In the present embodiment, OLT device is provided with Ethernet interface and PON interface, the setting of these two kinds of interfaces and mode of operation are also different, regard OLT and the multiple stage ONU equipment that is attached thereto as a distribution switch, each network interface distributes a port id, RSTP agreement is mainly used in and OLT network interface side and ONU user interface side, avoid causing loop, waste Internet resources and cause network congestion, realize in the local area network (LAN) be made up of EPON system, select one simple acyclic, full communicating active topology spanning tree, wherein, active topology is predictable, reproducible, can be selected by placement algorithm parameter, when EPON system OLT device breaks down, automatically spanning-tree topology can be reconfigured.In the present embodiment, bridge entities structure comprises port pointer, state machine pointer, bridge variable, protocol version, bridge id, bridge temporal information, root port ID, root priority, root temporal information, bridge mark and the operating statistical information of bridge etc.
Its statement bridge information processing function, for other submodules provide corresponding operating.
Particularly, bridge run the release type of spanning tree: run STP compatibility mode when=0; When=2, run RSTP normal mode.
Wherein, being defined as follows of BPDU:
1. data field: add 4 field description positions, illustrates state and the type of port
2. CFG BPDU: directly in inter-exchange exchange between two, if lose 3 BPDU, mean that link topology changes
3. TCN BPDU: directly flood at inter-exchange
In the present embodiment, port variable structure, the variable of all associated port and state machine are organized into structure, one is defined to each bridge port and points to the information that the pointer of port variable carrys out storage port, port organization body specifically comprise point to next port variable pointer, port state machine list, bridge and port timer belonging to the port;
Port information is a subset of bridge information, and the variable that port information comprises, state machine and statistical information are more, and processing mode and bridge are also very different.In order to the correlation reducing bridge and port is divided into independently submodule port, Bridge configuration body is by all of the port of this bridge of pointed.
Wherein, (1) port status:
1. abandon (discarding): can not user data be forwarded
2. learn (learning): learning MAC address, build MAC and show process item
3. (forwarding) is forwarded: user data can be forwarded
(2) port type:
1. root (root) port: identical with 802.1D
2. (des ignated) port is assigned: identical with 802.1D
3. (alternative) port is prepared: port gets clogged, as the backup of root port
4. (backup) port is backed up: (learning): port gets clogged, as the backup of assigning port.
In the present embodiment, state machine is responsible for computing and the control of the various complex informations of bridge and port, state machine specifically comprises: port role selection mode machine, Port Profile transition state machine, port role transfering state machine, port status transfering state machine, port information send state machine, port information state machine, topology change state machine, Linktype state machine and port cost state machine, and different conditions machine does different computings or control.
Wherein, state machine belongs to port or bridge is comparatively simple to the operation of state machine, or checks its state updating condition, or implements state updating.A bridge or port comprise numerous state machine, and define state machine universal architecture body to better manage these state machines, structure points to concrete operation by function pointer.
State machine architecture body and grand, wherein, comprises bridge pointer (belonging to pointing to bridge), port pointer (belonging to pointing to port), state machine pointer (pointing to next state machine), state machine action-function and state machine information.
Port role transfering state machine: be responsible for root port, designated port to transfer to forwarding state; Optional port, backup port are transferred to discarding state.
In embodiments of the present invention, the EPON system function that should possess in a local network is as follows:
(1) a unique group address is had can be bridged all bridge identifications in LAN in a local network, this group address identifies all bridges on an independent LAN, and (namely in an independent LAN, destination address is the message of this group address, can be received by all bridges on this LAN, this message directly can not be forwarded by them) EPON group address is set;
(2) each bridge has a unique bridge identifier in bridged lan, is called bridge id (BridgeIdentifier).This ID part is from Bridge Address, and part is from bridge priority.And this value is less, the priority of this bridge is higher;
(3) all of the port of each bridge has different port-marks, be called port id (each bridge independent allocation of portId), this ID part is fixing (different from other port, to be such as port numbers), and part is from port priority.And this value is less, the priority of this port is higher.
Demand is below the active topology in order to support administration configuration spanning tree:
(1) relative priority can be distributed for each bridge in bridged lan;
(2) can be each port assignment relative priority of each bridge;
(3) can be each port assignment path cost (path cost) of each bridge.
The optical line terminal equipment ethernet port character control device that the embodiment of the present invention provides is applied in the environment of following configuration, and it is specially:
(1), in all from network bridges, one is selected as Root Bridge (root);
(2) shortest path of current bridge to Root Bridge is calculated;
(3) to each LAN, select from the nearest bridge of Root Bridge as Designated Bridge, be responsible for the forwarding of data on the LAN of place;
(4) bridge selects a port as root port, and the path that this port provides is that this bridge is to Root Bridge optimal path;
(5) port be contained in spanning tree except heel end mouth is selected.
In conjunction with the embodiment of the present invention, above-mentioned application configuration surroundings possesses following effect:
(1) time that the backup link in double link structure makes discovery topology change to recovery connective can reach several milliseconds, and without the need to transmitting configuration messages;
(2) Handshake Protocol makes network connectivty can recover within the time of exchange two configuration messages, the time delay of namely shaking hands, when the worst, shakes hands from network, be diffused into the bridge at another edge of network, network connectivty could recover.
(3) state variation of edge port does not affect network connectivty, also can not cause loop, enters forwarding state without the need to time delay.
The embodiment of the present invention needs following basic parameter configuration, described in specific as follows:
1, RSTP functional configuration demand is:
Only have and start every configuration task after RSTP and just can come into force, before startup RSTP, can the relevant parameter of configuration device or ethernet port, after RSTP closes, these configuration parameters still retain, and after RSTP restarts, these parameters main configuration task list of RSTP that will come into force is as follows:
(1) turn on/off devices STP characteristic
(2) the Spanning-Tree Protocol pattern of EPON is configured
(3) EPON RSTP priority is configured
(4) EPON Forward Delay characteristic is configured
(5) EPON hel lo-t ime characteristic is configured
(6) EPON Max Age characteristic is configured
(7) path cost of particular port is configured
(8) the RSTP priority of particular port is configured
(9) configure particular port to force to send RSTP BPDUs
(10) Linktype of particular port is configured
(11) the boundary port state of particular port is configured
(12) rate limit that particular port sends BPDU is configured
(13) STP monitoring and maintenance
2.CLI user command
Spanning-tree starts rstp agreement
Spanning-tree cost arranges the path cost of current Ethernet interface
Spanning-tree forward-time arranges the Forwarding Latency value of switch
Spanning-tree hello-time arranges the hello time value of switch
Spanning-tree link-type point-to-poin arranges the Linktype be connected with present port
Spanning-tree maxage arranges the maximum aging time of switch
Spanning-tree mcheck runs under forcing switch to move to rstp pattern
Spanning-tree mode arranges the pattern that switch runs spanning-tree
It is edge port that spanning-tree portfast arranges present port
Present port is set for replacing port
Spanning-tree port-priority arranges present port priority value
Spanning-tree priority arranges switch priority
In embodiments of the present invention, be provided with two port information tables in port information processing module, it provides two kinds of different data messages to carry out the reference frame of different operations, when being carried out link change by CLI order, then generate the first hardware driving instruction, it is corrected; When losing three BPDUs continuously, then being changed link by the 3rd hardware driving instruction, being about to send data channel and changing to backup link, wherein, above-mentioned second hardware driving instruction is that conventional data send instruction; Further, when on the backup link of sendaisle after change, also need to continue to detect the BPDU that it receives, when losing three continuously, also needing generation the 3rd hardware driving instruction, sendaisle is changed;
Further, when by the backup link after CLI order change, also need to continue to detect the BPDU that it receives, when losing three continuously, also needing generation the 3rd hardware driving instruction, sendaisle is changed.
For the ease of understanding, the following operational process that the RSTP of the optical line terminal equipment ethernet port character control device provided based on the embodiment of the present invention is provided:
(1) initialization
Carry out port setting, arrange maximum port number, port index tables, configuration communication information, configured port variable, state machine creates.
(2) RSTP user command configuration
Cli interface module is converted to power function CLI order, line parameter inspection of going forward side by side, and builds configuration communication information, and carry out bridge renewal according to the parameter transmitted.
(3) configuration information process
According to configuration requirement amendment configuration communication information, obtain bridge pointer, calculate bridge id according to bridge title, compare bridge priority, amendment bridge variable, port variable.
(4) BPDU process
If root port loses 3 BPDU, preparation (alternative) port is directly converted to heel end mouth and forwards, assign (des ignated) port to lose 3 BPDU, backup (backup) port is directly converted to assigns port to forward.BPDU normally receives, and according to the BPDU received, checks whether bridge topology changes, changes, TCN BPDU: directly flood at inter-exchange.Bridge renewal is carried out according to new network topology.
(5) bridge upgrades
Judge topologies change, carry out state machine renewal, send BPDU, hardware state is set.
BPDU message exchanges in direct-connected two bridges or multiple bridge, can not be forwarded.The bridge not running STP agreement will be used as BPDU message as general service message repeating.
The time interval sending BPDU between OLT device and direct-connected switch is set.
In embodiments of the present invention, the first port information table and the second Port State Table is provided with in port information processing module, the state of port can by the protocol changes of BPDU, also can be modified by CLI order, according to topological structure, because the replacement port of root port is all that the dual link arranged to improve reliability is formed in RSTP.So wherein certain port can be determined to replace port, edge port by CLI order, determine to replace port, to improve the convergence rate of spanning tree by CLI order.
Fig. 2 shows the realization flow figure of the optical line terminal equipment ethernet port character control method that the embodiment of the present invention provides, and its concrete step is as described below:
In step s 201, bridge message processing module configuration bridge entities structure, and obtain the data message of outside input, simultaneously, Bridge configuration parsing is carried out to the data message got, obtain the type of described data message, the type of described data message specifically comprises port deal with data and state machine deal with data, and described bridge message processing module is connected with the external command configuration module for inputting external command.
In step S202, port information processing module is configured port organization body, and to described bridge message processing module resolve the port deal with data obtained proceed type resolve, port information table corresponding with it for the type of resolving the port data obtained is compared, and according to the port data after comparison result output processing, simultaneously, generate the first hardware driving instruction, wherein, the type of described data message comprises command configuration information and data transmit package informatin, described port information table is provided with two, be designated as the first port information table and the second port information table respectively, whether described first port information table marks by the port of command set is specially backup port and corresponding port information, described second port information table is set up by analyzing BPDU, described port information processing module is connected with driver module, described driver module connects optical line terminal equipment master chip, described driver module is for driving described optical line terminal equipment master chip determination backup link or conveying data, wherein, described port organization body specifically comprises the pointer pointing to next port variable, port state machine list, bridge belonging to the port and port timer,
In step S203, state machine processing module to described bridge message processing module resolve the process that the state machine deal with data that obtains and described port information processing module export after port data carry out computing and control, generate the second hardware driving instruction, described state machine processing module also connects described driver module;
Wherein, the first hardware driving instruction and described second hardware driving instruction are transported to described driver module respectively, and described driver module and described external command configuration module are all connected with main program module.
Above are only a concrete grammar embodiment of the present invention, its concrete realization, with reference to described in said structure embodiment, does not repeat them here, but not in order to limit the present invention.
In embodiments of the present invention, said method embodiment also comprises the steps:
Bridge message processing module also carries out number statistics to the data message received, when loss three BPDUs, described bridge message processing module generates the 3rd hardware driving instruction, described 3rd hardware driving instruction is transported to described driver module, for driving backup link as data channel, its concrete realization, as described in said apparatus embodiment, does not repeat them here, but not in order to limit the present invention.
For the ease of understanding, followingly provide concrete realization flow, as shown in Figure 3:
1, overall design framework is: connect several switches under business router, connect an OLT device under every path switching mechanism, connect several ONU equipment under OLT device, wherein OLT is as local side, ONU as family end, and, be set to double link structure between switch and OLT;
2, suppose that figure double center chain road is designated as A and B respectively, wherein, can set A is primary link, and namely at the key data transfer passage of EPON system work, B, as backup link, when primary link A is as fault, uses B link to carry out data transmission;
3, in debug process, suppose the road ability first debugging passage A, then commissioning staff inputs corresponding CLI order, this CLI order includes connects A, disconnect the information of B, by this CLI command routing to the bridge message processing module of OLT device, bridge message processing module is resolved this CLI order, obtain it and belong to item handled by port information processing module, then by this CLI command routing to port information processing module; After port information processing module receives CLI order, the first port information table arranged in itself and its is compared, obtain the first concrete hardware driving instruction, and this first hardware driving instruction is delivered to driver module, driver module, by A equipment debugging passage, disconnects B, when debugging, realized the transmission of data between switch and OLT by A, thus determine the road ability of A; Otherwise, be also the same to the debugging of B;
4, in the course of work of OLT device, when breaking down, RSTP changes topology automatically, realizes resuming of data, and while not affecting OLT work, the mode can recorded by above-mentioned 3 is safeguarded dual link.
Certainly, for occurring that packet loss causes the content changing backup link not repeat them here, but not in order to limit the present invention.
In embodiments of the present invention, RSTP module in OLT device is carried out function refinement, be specially bridge message processing module, port information processing module and state machine processing module, its duty of each tool of its each functional module, improve the operating efficiency of OLT device, the constringency performance of overall EPON system improves.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.