LLDP neighbor informations processing method and LLDP neighbor information processing equipments
Technical field
The present invention relates to ethernet technology, more particularly to Ethernet LLDP (Linklayer Discovery Protocol,
Link Layer Discovery Protocol) agreement technology.
Background technology
LLDP belongs to unidirectional information announcement agreement at a slow speed, the cycle it is logical to neighbor data communication equipment (hereinafter referred to as equipment)
This equipment and port information etc. are accused, while needing to process equipment and the port information that neighbor device sends.
As shown in Fig. 2 be system block diagram when two data communications equipment are direct-connected, wherein, the port P1 and equipment of device A
The port P2 of B is connected.LLDP agreements successively are enabled on the port P2 of the port P1 and equipment B of device A, in the port of device A
After LLDP agreements are enabled on P1, device A sends LLDP protocol massages by port P1 to equipment B immediately, and the port P2 of equipment B connects
After receiving the LLDP protocol massages of device A transmission, when not enabled LLDP agreements are gone back on the P2 of port, LLDP protocol massages can be lost
Abandon, but after the port P2 of equipment B enables LLDP agreements, equipment B sends LLDP agreement reports by port P2 to device A immediately
Text, the port P1 of device A is parsed after receiving LLDP protocol massages, the information of study to neighbor device B.
And equipment B has been due to having abandoned the LLDP protocol massages of device A before, then letters of the equipment B to study to device A
Breath, it is necessary to wait until that device A sends LLDP protocol massages again, if device A sends the cycle (example more long of LLDP protocol massages
Such as 10 minutes), then need to wait long period of time to learn the information to device A, Consumer's Experience is bad.
A kind of method of the patent application publication of Application No. 201410606724.0:Updated by sending active request
The method of TLV can solve problems.The technical scheme of present patent application is:After equipment enables LLDP agreements on port,
Actively sent to neighbor device and update request, neighbor device makes an immediate response after receiving the message for updating request, is exemplified below:
LLDP agreements are first enabled for the port P1 of device A, LLDP agreements are enabled after the port P2 of equipment B, equipment B is at it
After LLDP agreements are enabled on the P2 of port, actively sent to device A and update request message, device A receives the renewal request of equipment B
After message, make an immediate response (equivalent to LLDP protocol massages are sent again), and equipment B is the information that device A has been arrived in study.
The shortcoming of the above method is that must increase the problem in terms of new TLV and compatibility in LLDP protocol massages,
Message format is have modified, and increased the complexity of agreement.
The content of the invention
The purpose of the present invention be exactly solve direct-connected two equipment successively start LLDP agreements cannot Fast Learning neighbours letter
The problem of breath, there is provided a kind of not change LLDP neighbor informations processing method and one kind that message format just solve the above problems
LLDP neighbor information processing equipments.
The present invention solves its technical problem, and the technical scheme of use is that LLDP neighbor information processing methods, its feature exists
In comprising the following steps:
After receiving the LLDP protocol massages that neighbor device sends, judge whether receiving port enables LLDP agreements, if connect
Receiving end mouthful not enabled LLDP agreements, then cache the LLDP protocol massages;When the receiving port is by the end of not enabled LLDP agreements
When mouth is changed into enabling the port of LLDP agreements, judge whether be cached with LLDP protocol massages in caching, in this way, then in study caching
LLDP protocol massages in neighbor information;Otherwise directly learn the neighbor information of LLDP protocol massages for receiving.
Specifically, if the receiving port not enabled LLDP agreements, cache the LLDP protocol massages, specifically include with
Lower specific steps:
If the receiving port not enabled LLDP agreements, judge whether to have received the corresponding ports of identical neighbor device
The LLDP protocol massages for sending, in this way, then cache the LLDP protocol massages, and discharge the correspondence of the neighbor device for being cached
The LLDP protocol massages sent before port;Otherwise directly cache the LLDP protocol massages.
Further, methods described also includes, if it is determined that the receiving port is become by the port of not enabled LLDP agreements
During for the port for enabling LLDP agreements, it is immediately generated and periodically sends the LLDP of itself to the corresponding ports of neighbor device and assist
View message.
Specifically, the LLDP associations that the neighbor information or study in the LLDP protocol massages learnt in caching are received
Discussing the method for the neighbor information of message is:
Neighbor information is parsed from the LLDP protocol massages, neighbor information is placed in neighbor information table.
Further, the method for the neighbor information in the LLDP protocol massages in the study caching, including:
The LLDP protocol massages that all neighbor devices send in parsing caching, the neighbor information that will be parsed is placed in neighbours' letter
In breath table.
A kind of LLDP neighbor informations processing equipment, it is characterised in that including:
Receiver module, the LLDP protocol massages for receiving neighbor device transmission;
Judge module, for judging whether receiving port enables LLDP agreements, if receiving port not enabled LLDP agreements,
Notify that cache module is cached the LLDP protocol massages;When judging end of the receiving port by not enabled LLDP agreements
When mouth is changed into enabling the port of LLDP agreements, judge whether be cached with LLDP protocol massages, in this way, notification handler module in caching
The neighbor information in LLDP protocol massages in study caching;Otherwise, notification handler module directly learns the LLDP associations for receiving
Discuss the neighbor information of message;
Cache module, for the notice according to judge module, the LLDP protocol massages is cached;
Processing module, the end for being changed into enabling LLDP agreements from the port of not enabled LLDP agreements when the receiving port
During mouth, and when having LLDP protocol massages in caching, the neighbor information in LLDP protocol massages in study caching;Otherwise directly learn
The neighbor information of the LLDP protocol massages that habit is received.
Specifically, the judge module, specifically for judging whether to have received the corresponding ports hair of identical neighbor device
The LLDP protocol massages sent, in this way, then cache the LLDP protocol massages, and discharge the corresponding end of the neighbor device for being cached
The LLDP protocol massages sent before mouthful;Otherwise directly cache the LLDP protocol massages.
Further, the equipment also includes sending module, and the sending module is used for, when the receiving port is not by opening
When being changed into enabling the port of LLDP agreements with the port of LLDP agreements, it is immediately generated and periodically to the corresponding end of neighbor device
Mouth sends the LLDP protocol massages of itself.
Specifically, the processing module, specifically for the neighbor information in the LLDP protocol massages in parsing caching or
The neighbor information of the LLDP protocol massages for receiving, will parse from the LLDP protocol massages and be placed in neighbor information table.
Further, the processing module, specifically for the LLDP agreements that all neighbor devices send in parsing caching
Message, the neighbor information that will be parsed is placed in neighbor information table.
The beneficial effects of the invention are as follows by above-mentioned LLDP neighbor informations processing method and a kind for the treatment of of LLDP neighbor informations
Equipment, due to only needing in receiving port not enabled LLDP agreements, the received LLDP protocol massages of caching, and in port
When enabling LLDP agreements, LLDP protocol massages study neighbor information is obtained from caching, realized simply, and need not change
LLDP protocol massages forms, it is not necessary to increase the complexity of LLDP protocol processes, also ask in the absence of the compatibility with competitor's equipment
Topic, due to can rapidly learn neighbor information, so as to improve Consumer's Experience.
Brief description of the drawings
System block diagram when Fig. 1 is direct-connected two data communications equipment;
Fig. 2 is a kind of system block diagram of LLDP neighbor informations processing equipment in the present invention.
Specific embodiment
With reference to embodiment and accompanying drawing, technical scheme is described in detail.
LLDP neighbor informations processing method of the invention, specially:After receiving the LLDP protocol massages that neighbor device sends,
Judge whether receiving port enables LLDP agreements, if receiving port not enabled LLDP agreements, cache the LLDP protocol massages;
When the receiving port is changed into enabling the port of LLDP agreements from the port of not enabled LLDP agreements, judge whether delay in caching
There are LLDP protocol massages, in this way, then the neighbor information in LLDP protocol massages during study is cached;Otherwise directly study is received
The neighbor information of the LLDP protocol massages for arriving.
A kind of LLDP neighbor informations processing equipment of the invention, its system block diagram is used for referring to Fig. 1, including receiver module
Receive the LLDP protocol massages that neighbor device sends;Judge module, for judging whether receiving port enables LLDP agreements, if
Receiving port not enabled LLDP agreements, notify that cache module is cached the LLDP protocol massages;When judging the reception
Whether port judges be cached with LLDP associations in caching when the port of not enabled LLDP agreements is changed into enabling the port of LLDP agreements
View message, in this way, the neighbor information in LLDP protocol massages in notification handler module study caching;Otherwise, notifier processes mould
Block directly learns the neighbor information of the LLDP protocol massages for receiving;Cache module, for the notice according to judge module, by institute
LLDP protocol massages are stated to be cached;Processing module, for being changed into from the port of not enabled LLDP agreements when the receiving port
When enabling the port of LLDP agreements, and when having LLDP protocol massages in caching, the neighbour in LLDP protocol massages in study caching
Occupy information;Otherwise directly learn the neighbor information of LLDP protocol massages for receiving.
Embodiment
LLDP neighbor informations processing method, comprises the following steps in the embodiment of the present invention:
After receiving the LLDP protocol massages that neighbor device sends, judge whether receiving port enables LLDP agreements, if connect
Receiving end mouthful not enabled LLDP agreements, then cache the LLDP protocol massages;When receiving port is become by the port of not enabled LLDP agreements
During for the port for enabling LLDP agreements, judge whether be cached with LLDP protocol massages in caching, in this way, then in study caching
Neighbor information in LLDP protocol massages;Otherwise directly learn the neighbor information of LLDP protocol massages for receiving.
Wherein, if receiving port not enabled LLDP agreements, cache the LLDP protocol massages, following step is specifically included
Suddenly:
If receiving port not enabled LLDP agreements, judge whether that the corresponding ports for having received identical neighbor device send
The LLDP protocol massages for coming, in this way, then cache the LLDP protocol massages, and discharge the corresponding ports of the neighbor device for being cached
The LLDP protocol massages for sending before;Otherwise directly cache the LLDP protocol massages.
Step can also be included:If it is determined that receiving port is changed into enabling LLDP agreements from the port of not enabled LLDP agreements
Port when, be immediately generated and the LLDP protocol massages of itself periodically sent to the corresponding ports of neighbor device.
In the embodiment of the present invention, the method for the neighbor information of the LLDP protocol massages that study is received can be:
Neighbor information is parsed from the LLDP protocol massages, neighbor information is placed in neighbor information table.
And the method for learning the neighbor information in the LLDP protocol massages in caching can be:
The LLDP protocol massages that all neighbor devices send in parsing caching, the neighbor information that will be parsed is placed in neighbours' letter
In breath table.
A kind of LLDP neighbor informations processing equipment in the embodiment of the present invention, its system block diagram referring to Fig. 1, including:
Receiver module, the LLDP protocol massages for receiving neighbor device transmission.
Judge module, for judging whether receiving port enables LLDP agreements, if receiving port not enabled LLDP agreements,
Notify that cache module is cached the LLDP protocol massages;When judging end of the receiving port by not enabled LLDP agreements
When mouth is changed into enabling the port of LLDP agreements, judge whether be cached with LLDP protocol massages, in this way, notification handler module in caching
The neighbor information in LLDP protocol massages in study caching;Otherwise, notification handler module directly learns the LLDP associations for receiving
Discuss the neighbor information of message.
Cache module, for the notice according to judge module, the LLDP protocol massages is cached.
Processing module, the end for being changed into enabling LLDP agreements from the port of not enabled LLDP agreements when the receiving port
During mouth, and when having LLDP protocol massages in caching, the neighbor information in LLDP protocol massages in study caching;Otherwise directly learn
The neighbor information of the LLDP protocol massages that habit is received.Here, can be specifically in the LLDP protocol massages in parsing caching
The neighbor information of neighbor information or the LLDP protocol massages for receiving, will parse from the LLDP protocol massages and be placed in neighbours
In information table;Or the LLDP protocol massages that all neighbor devices send in parsing caching, the neighbor information that will be parsed is placed in neighbour
In occupying information table.
Here, judge module, can be specifically for:Judge whether that the corresponding ports for having received identical neighbor device send
LLDP protocol massages, in this way, then cache the LLDP protocol massages, and discharge the neighbor device for being cached corresponding ports it
Before the LLDP protocol massages that send;Otherwise directly cache the LLDP protocol massages.
In the embodiment of the present invention, sending module can also be included, sending module is used for:When the receiving port is by not enabled
When the port of LLDP agreements is changed into enabling the port of LLDP agreements, it is immediately generated and periodically to the corresponding ports of neighbor device
Send the LLDP protocol massages of itself.
In the embodiment of the present invention, because in data communications equipment, device id has global uniqueness, port id sets at this
Standby internal have a uniqueness, therefore, in LLDP agreements, neighbor information is all defined by device id and port id, by device id and
Port id can uniquely determine neighbours, be that neighbor information is defined by device id and port id.
Below when two data communications equipment are direct-connected as a example by be specifically described, its system block diagram referring to Fig. 2, wherein,
The port P2 of the port P1 and equipment B of device A is connected, and device A is a kind of above-mentioned LLDP neighbor informations treatment and sets with equipment B
It is standby.
After the port P1 of device A enables LLDP agreements,
The first step, device A sends LLDP protocol massages by port P1 to equipment B, due to the port P2 not enableds of equipment B
LLDP protocol massages, the LLDP protocol massages that equipment B receives port P2 are cached, if repeatedly received from port P2
The LLDP protocol massages of device A, then cache the LLDP protocol massages for finally receiving, LLDP agreements buffered before release
Message.
Second step, due to the port P2 also not enabled LLDP agreements of equipment B, the port P1 of device A is uncached to cross equipment B's
The LLDP protocol massages that port P2 sends, it is impossible to the LLDP protocol massages that port P1 was once received are obtained from caching.
The port P2 of equipment B by not enabled LLDP protocol configurations for after enabling LLDP agreements,
The first step, equipment B sends LLDP protocol massages by port P2 to device A, and the port P1 of device A receives LLDP
The information of equipment B is parsed after protocol massages, and these information are stored in neighbor information table.
Whether second step, equipment B judges be cached with LLDP protocol massages in caching, in this way, then the LLDP during study is cached
Neighbor information in protocol massages, i.e., parse the information of device A from LLDP protocol massages, is stored in neighbor information table,
After the LLDP protocol massages in caching have been processed, directly learn the neighbor information of LLDP protocol massages for receiving.
Obviously, after equipment B enables LLDP agreements, almost neighbor information is arrived in study simultaneously for device A and equipment B.