A kind of implementation method of transmission mode and device
Technical field
The present invention relates to network technology, particularly relate to a kind of implementation method and device of Packet Transfer Mode.
Background technology
People are benefiting from the fast development of network technology and the continuous expansion of network size.But the continuous expansion of network size brings severe problem of management and safety problem.In network management, the process message of some network equipments may be needed intactly message to be sent to opposite end receiving equipment (such as server etc.) by mirror port.In some safety applications, the network equipment may need all messages all to carry out safety filtering and inspection by a mouth delivers to safety means.
In above-mentioned two kinds of application scenarioss, if between receiving-transmitting sides be optical fiber link, and in the middle of link, there is the existence of optical splitter, will have problems.In Fiber connection, a port of the existing network equipment (such as Ethernet exchanging) has transmitting-receiving (Rx/Tx) two mouths to be connected on two optical fiber usually, otherwise link just can not get up, and cannot communicate with opposite end.And optical splitter only has reception direction, a lot of equipment is not supported to connect with optical splitter at present, and therefore optical splitter cannot be applied in above-mentioned scene.
Summary of the invention
In view of this, the invention provides a kind of implement device of transmission mode, be applied on the network equipment, this device comprises management interactive unit and configuration distributing unit, wherein:
Management interactive unit, for when receiving the light mouth single fiber pattern enabled instruction that keeper issues, determine whether this light mouth supports single fiber pattern according to the mark that light mouth is preset, if it is on this light mouth, start single fiber pattern, otherwise return miscue to keeper;
Configuration distributing unit, for when light mouth starts single fiber pattern, the PHY chip to light mouth sends virtual Link UP and configures, and to make the upper strata of PHY chip, this light mouth is considered as UP state.
Preferably, also comprise: initialization unit, for checking when the network equipment starts whether network equipment light mouth supports single fiber pattern, if it is this light mouth being labeled as and supporting single fiber mode light mouth;
Preferably, described initialization unit is used for the chip capabilities list preset by the attribute information coupling of network equipment light mouth PHY chip, if the match is successful, is labeled as by this light mouth and supports single fiber pattern.
Preferably, also comprising: configure-ack unit, for checking whether the configuration successful acknowledge message receiving PHY chip in the given time and return, if it is determine the success of single fiber pattern configurations, otherwise it is unsuccessful to be defined as single fiber pattern configurations.
The present invention also provides a kind of implementation method of transmission mode, and be applied on the network equipment, it is characterized in that, the method comprises:
A, when receiving the light mouth single fiber pattern enabled instruction that keeper issues, according to light mouth preset mark determine whether this light mouth supports single fiber pattern, if it is on this light mouth, start single fiber pattern, otherwise return miscue to keeper;
B, light mouth start single fiber pattern time, the PHY chip to light mouth sends virtual Link UP and configures, and to make the upper strata of PHY chip, this light mouth is considered as UP state.
Preferably, also comprise: C, check when the network equipment starts whether network equipment light mouth supports single fiber pattern, if it is this light mouth is labeled as and supports single fiber mode light mouth;
Preferably, described step C comprises further: the chip capabilities list preset by the attribute information coupling of network equipment light mouth PHY chip, if the match is successful, is labeled as this light mouth and supports single fiber pattern.
Preferably, also comprise: D, check whether the configuration successful acknowledge message receiving PHY chip in the given time and return, if it is determine the success of single fiber pattern configurations, otherwise it is unsuccessful to be defined as single fiber pattern configurations.
The present invention can realize the configuration of keeper to single fiber pattern by the mode of software control, under the prerequisite allowing the network equipment to possess in chip ability, use simple optical fiber to realize the unidirectional message transmissions functions such as message mirror, the cost of the fiber deployment of user can be saved.If when having optical splitter between the network equipment be connected by optical fiber, unidirectional message transmissions also can not be subject to any impact of optical splitter.
Accompanying drawing explanation
Fig. 1 is the building-block of logic of transmission mode implement device in one embodiment of the present invention.
Fig. 2 is the process chart of transmission mode implementation method in one embodiment of the present invention.
Fig. 3 is that in one embodiment of the present invention, networking realizes schematic diagram.
Embodiment
The transmission plan that the invention provides under a kind of single fiber pattern solves the problems referred to above.Please refer to Fig. 1 and Fig. 2, the implement device of a kind of transmission mode of the present invention, is applied on the network equipment, and this device comprises: initialization unit, management interactive unit, configuration distributing unit and configure-ack unit.In the mode that computer program realizes, it comprises following treatment step:
Step 101, initialization unit checks when the network equipment starts whether network equipment light mouth supports single fiber pattern, is if it is labeled as by this light mouth and supports single fiber mode light mouth;
Step 102, management interactive unit is when receiving the light mouth single fiber pattern enabled instruction that keeper issues, determine whether this light mouth supports single fiber pattern according to the mark that light mouth is preset, if it is on this light mouth, start single fiber pattern, otherwise return miscue to keeper;
Step 103, configuration distributing unit is when light mouth starts single fiber pattern, and the PHY chip to light mouth sends virtual Link UP and configures, and to make the upper strata of PHY chip, this light mouth is considered as UP state;
Step 104, configure-ack unit checks whether the configuration successful acknowledge message receiving PHY chip and return, and if it is determine the success of single fiber pattern configurations, otherwise it is unsuccessful to be defined as single fiber pattern configurations.
Please further refer to Fig. 2.Start in initialized process at the network equipment, the support list prestored in configuration file can be read to learn whether each light mouth supports single fiber pattern, this support list can be the support list finished writing in device fabrication process, is mainly used to mark light mouth and whether supports single fiber pattern.It can be seen, step 101 is not necessary in the present invention, and whether light mouth can support that single fiber pattern can mark in advance.
But in order to the Software for Design of the network equipment is more light and simple, the mode of step 101 can be adopted realize in a preferred embodiment.The PHY chip of self each light mouth can be scanned time network device initiating, check whether PHY chip has base power to support the said single fiber pattern of the present invention by the attribute information of chip.Current not every PHY chip can realize single fiber pattern by subsequent treatment of the present invention, first network equipment vendor can adopt in all chips and have the attribute information of the chip of above-mentioned base power (such as chip model or chip manufacturer) to save as a chip capabilities list in the process of software simulating.Whether there is above-mentioned base power can by analyze and test is learnt in the design and production process of equipment.
Consider that some light mouth transceiver modules can plug, and the slot that may reserve at equipment of some user is expanded the light mouth (such as inserting the new optical module bought) made new advances, whether the PHY chip of each light mouth has above-mentioned base power may be dynamic change, likely originally do not have port to be light mouth, occurred part light mouth afterwards; Or likely original ports having is light mouth, but has been all electric mouth afterwards.Therefore step 101 can read the attribute information of each light mouth initialized time, then it is mated with described chip capabilities list, if the match is successful, then illustrate that this light mouth supports fiber mode, so the network equipment just can learn whether each light mouth can support single fiber pattern, dynamically generates described support list again when being equivalent to initialized fast.It should be noted that, described chip capabilities list is also can by keeper by managing interactive unit from edlin and change, and light mouth PHY chip is constantly being weeded out the old and bring forth the new after all.
When keeper wishes that first need to carry out connection physically, be connected by optical fiber with the receiving port of opposite equip. by the transmission mouth of present networks equipment, receiving port does not connect any optical fiber when certain light mouth of this equipment opens single fiber pattern.After physical connection sets, keeper can send unlatching single fiber mode instruction by network management path to this equipment.One or more light mouth can be specified in this instruction.After equipment receives this instruction, first check whether this light mouth is marked as and support single fiber pattern, if the flow process starting configuration single fiber pattern can be started, otherwise send miscue to keeper, inform that this light mouth of keeper does not support single fiber pattern; Corresponding flash of light preceding an earthquake mouth PHY chip continues to keep original configuration.
Configuration distributing unit can, by a fraudulent virtual Link UP configuration distributing in the light mouth status register of chip, be equivalent to by force light mouth status register be changed to UP state.As previously mentioned, under single fiber pattern, the receiving port of light mouth does not connect any optical fiber, if according to normal handling process, port state register can be set to the state of Link Down by PHY chip.The such amendment of the present invention does not make light mouth normal Link Up as in two fine pattern, but amendment light mouth status register makes the software and hardware of the above aspect of PHY chip can think that light mouth is in Up state, can't report mistake.And in fact because keeper starts single fiber pattern often because keeper has the business demand of carrying out the uniquenesses such as message mirror.After virtual Link Up configuration distributing, if PHY chip supports configuration report function, can be confirmed whether to receive configuration successful acknowledge message by configure-ack unit, if do not receive configuration successful acknowledge message in the scheduled time, be then original configuration by the configuration restore of light mouth PHY chip, namely aforesaid amendment by force canceled.
Please refer to Fig. 3, suppose that all mirror ports are all light mouths, suppose that the network equipment 2 has safety filtering function, the network equipment 1 needs all messages (or the message of specifying) received by inbound port to send to the network equipment 2, now the receiving port of the transmission mouth of mirror port 2 with the mirror port 2 of the network equipment 2 can be connected by optical fiber by network manager on the network equipment 1, then on the network equipment 1, opens single fiber pattern for mirror port 2.Now the network equipment 1 just can realize the image feature of message by an optical fiber, has saved the cost of fiber deployment, and if have optical splitter between the network equipment 1 and the network equipment 2, also can not be affected.Same reason, also can open single fiber pattern to carry out message mirror business between two network equipment mirror ports 3.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.