A kind of Ethernet storm inhibition method
One, technical field
A kind of Ethernet storm inhibition method belongs to ethernet communication and power automation field, is used in Suppression network being applicable to the weak embedded intelligence communication terminal device of processor disposal ability to repeat to be sent as the network storm of feature.
Two, background technology
Along with the development of China's power industry, the putting into operation and build up and put into operation of increasing intelligent substation is because intelligent substation adopts communication protocol framework based on the IEC61850 of Ethernet
[14], the intelligent communications terminal equipment with real time communication requirement a large amount of in transformer station are endowed network function, make substation safety reliability service height rely on network service.And these intelligent communications terminal equipment adopt the low and middle-end flush bonding processor usually, and disposal ability is not enough to compare with BCS.If device hardware device damage or the individual device software of networking go wrong, cause network traffics to increase suddenly and even arrive the storm level, this will seriously reduce protection equipment calculating and communication performance in real time, thereby affect power supply safety
[7] [8]
Promote this theme of network performance about the Suppression network storm, tissue has launched research widely to this both at home and abroad, but research direction reduces total flow on network mainly for switch and bridge etc. by the technology such as packet loss of dividing VLAN isolation broadcast domain or utilize switch will get over Flow Limit.And transformer station physically or be all a closed system on network, and the multicasts that adopt substitute broadcasting more in the intelligent substation standard
[14] [15] [16] [4], only have that seldom broadcast frame is useful to intelligent communications terminal, and in transformer station, intelligent communications terminal all using embedded system or dedicated system, the probability that infects outside virus is very low.The reason that causes network storm is mainly network interface and damages
[1] [2]Or the interface software defective, show as a large amount of in a short time packets that repeats to send.According to these characteristics, the present invention proposes a kind of storm inhibition method for intelligent communications terminal, repeats in a short time the datagram that sends and coordinates flow detection by inhibition, comes the limiting network flow, keep as far as possible again the regular traffic message, guarantee well the stable operation of intelligent terminal.
At the Suppression network storm, guarantee that the effort of intelligent communications terminal safe operation is mainly reflected in the following aspects at present:
1. divide VLAN and suppress the storm transmission
[5]
Divide from isolating in logic different segment by VLAN, isolate simultaneously different broadcast domains, so just limited the propagation of broadcasting in net, the quantity of having reduced the useless broadcasting that to receive.Due to the devices exchange information that does not affect in same VLAN, so can configure three-layer equipment, dwindle broadcast domain, reduce as much as possible broadcast storm, improve access to netwoks efficient.
2. based on the inhibition technology of STP agreement and loop detection
[11]
This method is in same ethernet device, divide the logic bridge according to spanning tree running environment, for each spanning tree running environment is divided a logic bridge, incorporating respectively the port of needs isolation into described logic bridge makes and needs the port of isolation to belong to different logic bridges, and identify this bridge, thereby realize suppressing broadcast storm by Spanning-Tree Protocol in containing the Ethernet of a plurality of network segments according to the relevant Spanning-Tree Protocol generation of the logic bridge identifier operation topology of each ethernet device and port thereof.
3. flow compact technique
Come the supervising the network port by a period of time and measurement of comparison with the method for predefined compacting rank threshold value, if the threshold value of discharge pattern has reached, how such flow will be subject to compacting (simply abandoning), until the flow that pushes on drops to below the threshold value rank.The independent storm of switch support is controlled thresholding to broadcast group broadcast and clean culture.
4. software query filter method
[6]
A plurality of CPU of configuration in system, business datum is completed by a core, and ethernet communication is completed by another kernel.Be responsible for the kernel of communication by the driving Network Interface Unit of polling mode, the number that restriction simultaneously receives buffering limits the CPU. that too much packet enters the business of being responsible for
5. dynamically close the hardware Receiving
[9]
With receive buffer length half as the storm decision threshold, think that the broadcast receiving function of network interface card occurs and closes storm when data in reception buffer zone overstock when arriving this thresholding.Judge simultaneously the storm persistent state in idle task, and reopen network interface card hardware broadcast receiving function at storm time-delay later.
In above several method, method 1, method 2 and method 3 are mainly for network equipments such as switch and bridges, be intended to reduce storm data in network, method 3 also can cause the regular traffic message to be dropped, method 4 need to configure a plurality of cpu system more complicated in system, method 5 need to take the certain expense of CPU and need MAC to support dynamically to close broadcast receiving function
[17] [18], other Frame is not had inhibitory action.
List of references
1. how suppress laboratory science the 3rd phase of June in 2005 my opinion about broadcast storm from hardware in Liu Jin young tiger local area network (LAN)
2. the reason that produces of the male network broadcasting windstorm of Lee one and countermeasure Guangxi Technical College journal in June, 2007 supplementary issue 1
3. Xiao's loud and clear LAN broadcast storm origin cause of formation and process Hunan agricultural machinery in March, 2011
4. trying to gain true jade Wang Xing becomes industrial control system to use multicasting technology inhibition broadcast storm observation and control technology the 8th phase in 2009
5. Cao Yue fine jade LAN broadcast storm is analyzed and the application computer knowledge of vlan technology and technology in December, 2009
Zhu come strong, Chen Xin it, control Electric Power Automation Equipment in the November, 2010 of broadcast storm in the Gao Zhiyong digital transformer substation
7. network storm Hongsuihe River the 4th phase in 2007 that can not be ignored in the female electric power monitoring system of Zhu Zi
8. the Ceng Ruijiang beam is known high-new power station automation system Analysis of Network Malfunction in January, 2008 Guangdong Electric Power of mutinying of soldier
9. king's Xiao Ling is easily sent out victory and is avoided broadcast storm adaptive algorithm Southwest University for Nationalities journal in September, 2005 in a kind of intelligent terminal
10. trip ripple Mu Rong increases PREQ broadcast storm inhibition scheme computer application research in the August, 2012 of a kind of IEEE802.11s tree network of Yan Yuepeng
11. suppress the implementation method patent No. CN03101275.2 Huawei Tech Co., Ltd of broadcast storm in a kind of Ethernet of Zheng Ping Yang Yang
14. the company standard intelligent substation Protection Technology standard Q/GDW441-2010 of State Grid Corporation of China
15. the power industry standard merge cells technical conditions DL/T282-20122012-03-01 of the People's Republic of China (PRC) implements
16.IEC61850-9-2∶Communication networks and systems in substations Part9-2∶
Specific Communication Service Mapping(SCSM)Sampled values over ISO/IEC8802-3link
17.LAN91C11110/100Non-PCI Ethernet single chip MAC+PHY SMSC standard Microsystems corporation Rev1.4(12-12-03)
18.MCF54455Reference Manual Freescale Semiconductor Rev.54/2009
Three, summary of the invention
The objective of the invention is to propose a kind of because repeating to send the Ethernet storm inhibition method that causes network traffics to increase severely.
The present invention realizes by such scheme, a kind of Ethernet storm inhibition method, and step is as follows:
(1) at first build a MAC receiving-member that is comprised of MAC Address identifier, reception framer, flow rate calculation, packet filtering device, hash table and reception decision device and MCU interface, wherein the list item of hash table should comprise message characteristic code and message rise time;
(2) calculate the peak flow of normal use business datum, set on this basis the flow limit value that starts the storm compacting;
(3) statistics is by flow in the data band that enters the MAC receiving-member after the MAC Address identifier, if in band, the out-of-limit step 4 that turns of flow checks the reception message, if in band, flow directly receives this packet at limit value with the interior step (8) that turns;
(4) extract by receiving framer the frame check code (FCS) that receives message, and according to this as the condition code of this message;
(5) input as hash function with frame check code FCS, calculate Hash-table index and search corresponding hash table entry with this;
(6) if the FCS of corresponding hash table entry is consistent with current FCS and life span is not 0 and abandons this packet and simultaneously the life span of this list item is subtracted 1 (when life span is 0, FCS being set to 0 simultaneously), turns step (9) and wait for new datagram;
(7) if corresponding list item FCS and current FCS are inconsistent, the FCS field of list item is made as current FCS, simultaneously the life span field is set to maximum;
(8) the MAC receiving-member is revised reception buffer zone pointer and accepting state mark confirmation reception current data packet;
(9) wait for that next packet arrives and turns step (3);
Realize that by repeating step (3) to (8) constantly the repeating data newspaper filters, and reduces network storm to the impact of rear end CPU.
Further, each of the hash search table that packet filtering of the present invention is used all comprises message characteristic code and life span field, when realizing with message checking code (FCS) as the message characteristic code, utilize simultaneously FCS to calculate the index of hash table and the respective items of fast finding hash table.The replacement policy of hash search table is: when life span field that in the hashed value of the datagram of newly receiving and table, a certain will this item when identical subtracts 1, use new FCS to replace the condition code field of this list item when inconsistent and the life span field of resetting is maximum; The packet filtering strategy is in the out-of-limit rear startup of flow, and when identical and life span corresponding list item is not 0 when the message characteristic code field of a certain in newly arrived message FCS and hash table, this message is not dropped.
The invention has the beneficial effects as follows:
1. based on the harmless filtration of message characteristic, what be dropped is the datagram that repeats to send of nearest a period of time;
5. build the dynamic hashing table based on frame check (FCS), search and filter rapidly, resource overhead is little, be convenient to hardware and realize;
3. each feature list item has certain ageing time, avoids the normal business datum of filtering;
4. the message rejection ratio can be controlled flexibly by the maximum of revising message life span field;
5. can monitor simultaneously and filter many different duplicate messages;
6. packet filtering is started by flow detection unit, receives all messages during low discharge, and the regular traffic flow is unaffected.
The present invention passes through to extract the frame check code FCS of network message, and with this foundation as message characteristic and calculating Hash-table index.Start packet filtering mechanism after in Netowrk tape, flow reaches preset threshold, and life span consistent with condition code field in hash table is not that 0 duplicate message abandons with message FCS, by constantly repeating data newspaper filtration, reduce network storm and the impact of rear end CPU is namely reduced the purpose of pressure and the compacting network storm of application processor.
Four, description of drawings
Fig. 1 is that pure software of the present invention is realized system construction drawing
Fig. 2 is the pure system for implementing hardware structure chart of the present invention
Fig. 3 is status transition chart of the present invention
Five, specific implementation
The Ethernet storm inhibition method that the present invention provides can be incorporated into MAC and realize based on pure hardware, also can be based on the ASIC network controller realizes with pure software, below provide Hardware Implementation of the present invention, pure software implementation method and hardware approach difference only are Address Recognition and receive framing to be processed by ASIC.
1. system realizes block diagram
Accompanying drawing 2 provides hardware of the present invention and realizes block diagram, by address recognition logic, receive framer, flow rate calculation unit, packet filtering device, hash table and reception decision device and the MCU interface forms.Wherein address recognition logic is screened the ethernet frame that receives according to the Address Recognition strategy of MCU configuration, and the frame that meets condition of acceptance enters framer and flow rate calculation unit, and ineligible directly abandons.The calculating with interior flow is responsible in the flow rate calculation unit, and framer will be completed calculating and the judgement of data framing and the check code (FCS) of MII interface.The packet filtering device calculates Hash-table index and Dynamic Maintenance hash table according to FCS, and after in band, flow surpassed preset threshold, every reception message FCS duplicate message consistent with hash table FCS will be labeled.The output (FEN) that receives decision device synthetic address recognition logic output (RXEN), framer output (FCS_OK), packet filtering device provides and receives enable signal (RCV_EN), and arbitrary condition does not satisfy all will directly abandon this frame.
2. flow detection unit
Packet filtering mechanism of the present invention is the out-of-limit startup later on of flow in band, thereby avoids the impact on the regular traffic flow.Flow detection unit is only added up flow in band, i.e. Frame by Address Recognition.Flow detection unit comprises a frame counter Q and a summary counter S, rising edge at the receive data useful signal (RXDV) of MII interface is removed counter Q, start-of-frame (SFD) detected and begin counting afterwards under receive clock (RXCLK) drives, the trailing edge of RXDV stops counting when arriving and incites somebody to action, if this frame by Address Recognition Q be added on total counter S.After a period of time Δ T observation, utilize the following formula method to calculate current real-time traffic.When startup is observed next time, remove total counter S.
In formula: the current real-time traffic Δ of flux---T--observation time
N---is the Frame by Address Recognition in observation time
Q
i---the frame counter that observes for the i time
B
w--MII interface data highway width (the MII interface is 4, and gmii interface is 8)
3. status transition chart
The present invention adopts state machine shown in accompanying drawing 2 to control Address Recognition, message reception, check code calculating, hash table management and packet and receives judgement.
The IDLE state: idle condition will enter this state after system's startup or reception finish.At the state of this state-detection MII interface data useful signal (RXDV), enter the Recognize state when starting character (SFD) being detected after the rising edge of RXDV;
The Recognize state: the Address Recognition state, screen at this state received frame, turn the Receive state and carry out message and receive if destination-mac address meets condition of acceptance, otherwise turn the IDLE state and abandon the current data newspaper;
Receive state: accepting state, move under the driving of receive clock (RXCLK) in these state network data (RXD) and receive framer, calculate simultaneously local frame check code (FCS) and extract reception check code (FCS), change the PostReceive state over to after the trailing edge of RXDV arrives;
The PostReceive state: receive the reprocessing state, flow in the current band of this state computation carries out the check code inspection to received frame, turns the IDLE state if verification makes mistakes, otherwise further checks present flow rate.If in current band, flow turns the Commit state lower than default thresholding, submit current bag to, carry out the duplicate packages examination otherwise turn the Filter state;
The Commit state: the confirmation of receipt state, submit current bag and modification reception buffer zone pointer to system, turn afterwards the IDLE state and wait for new packet;
Filter state: packet filtering state, FCS according to current bag calculates Hash-table index and searches accordingly hash table at this state, the qualified Commit state that turns is submitted current bag to system, ineligible turn the IDLE state after directly abandoning and waits for new packet.
4. hash table management and packet filtering
4.1 hash table structure
Hash table of the present invention is a linear list, is comprised of some list items, and each list item comprises message characteristic code and two fields of life span.Be simple implementation, the capacity of getting the hash search table herein is 256 * 36 linear list, each list item is represented by 36 hytes, adopt 32-bit ethernet frame check code (FCS) as the message characteristic code, with the calculating Hash-table index (for simplicity getting the least-significant byte of FCS herein as index) of FCS, be used for each list item of fast finding.Each field implication of list item is as follows:
<D35 ..., D32〉--the list item life span represents this out of date can substituting when this field is 0;
<D31 ..., D0〉--the frame condition code, the present invention substitutes with frame check code (FCS).
4.2. hash table replacement and packet filtering
The present invention adopts the hash table that is used as packet filtering based on the full matching strategy Dynamic Maintenance of hash search and life span, and only just starts when flow is out-of-limit, recovers the normal rear hash table of removing at flow, and concrete steps are as follows:
(1). system initialization, empty all list items, wait for that message arrives;
(2). extract the check code FCS of present frame after new message arrives from receiving framer, with the calculating Hash-table index (for simplicity getting the least-significant byte of FCS herein as index) of FCS, fast search is to corresponding list item;
(3). frame condition code field and present frame FCS in the coupling list item, consistent if (this message was receiving not long ago) the rise time field of this list item is subtracted 1 (being 0 should be simultaneously the message characteristic code field of list item to be set to 0 when the rise time), the filter output enable signal (FEN) that resets turns step 5, carries out replacement policy otherwise enter next step;
(4). the message characteristic code field that will mate list item replaces with current FCS, then the life span of corresponding list item is set to maximum, the filter of set simultaneously output enable signal (check code is inconsistent, and this is a new datagram, needs to receive);
(5). wait for new datagram, datagram turns step 2 after arriving;
Receive subsequently decision device and will whether receive newly arrived datagram according to the Determines of packet filtering device output enable signal.
4.3. duplicate message rejection ratio
According to 4.2 and 4.3, one datagrams that repeat to send, should coated receive when the life span of its corresponding hash table entry is 0, and new datagram always is made as maximum with the life span of corresponding list item when arriving for the first time.Can establish with following expression formula its rejection ratio of the datagram that repeats to send:
λ=1/(N-1) (2)
In formula: λ-message rejection ratio, N-message maximum lifetime
In hash table, each list item represents a specific message, and the degree of depth of hash table has determined the message amount that the packet filtering device can monitor simultaneously.
4.4. receive judgement
The output (FEN) that receives decision device synthetic address recognition logic output (RXEN), framer output (FCS_OK), packet filtering device provides and receives enable signal (RCV_EN).The Frame that Address Recognition and received frame verification are not passed through is simply discarded, and the packet filtering device is by the flow rate calculation unit starting.The out-of-limit rear packet filtering device output FEN of flow is low, thereby corresponding coated abandoning realizes that the repeating data newspaper effectively suppresses.
5. other considerations
For the effectively impact of Suppression network storm to terminal embedded communication, the present invention's following factor when implementing needs to consider:
(1). according to the data-handling capacity of MCU in system and the startup flow limit value of regular traffic data traffic decision packet filtering device;
(2). the hash search table degree of depth determines to monitor how many kinds of repeating data newspaper, and in the list item of hash search table, the bit wide of life span field determines the rejection ratio of duplicate packages, if resource is allowed the capacity that increases hash table as far as possible.
(3). should be according to the real network environment, the comprehensive means such as broadcasting inhibition, multicast inhibition that adopt are suppressed the flow of crossing the processor ability, but the flow limit value of these means should be higher than limit value of the present invention, just can reach the reasonable effect of stabilizing storm.
(4). different Hash-table index algorithms is different to the hash table utilance, the high but time overhead can increase hard-wired resource overhead and software and realize the time of complicated algorithm hash table utilance.
(5). the observation time Δ T of flow rate calculation unit should determine in conjunction with rear end MCU disposal ability, should guarantee during specific implementation that under possible maximum storm flow in the Δ T time, the load factor of MCU is in the design allowed band.The too little meeting of Δ T causes flow rate calculation result fluctuation large, and too the conference reception buffer zone that causes when burst storm message filter also not start MAC just collapses.
Although the present invention discloses as above with preferred embodiment, so it is not to limit the present invention.The persond having ordinary knowledge in the technical field of the present invention, without departing from the spirit and scope of the present invention, when being used for a variety of modifications and variations.Therefore, protection scope of the present invention is as the criterion when looking claims person of defining.