Background technology
Along with the development of IP Video Supervision Technique, the deployment of IP video monitoring is more and more extensive, and along with the propelling of the fast development of 3G technology and the networking speed of operator, video monitoring service can more and more come into ordinarily resident family.By Internet network, user can utilize mobile phone terminal, panel computer, net book, PC etc. to monitor the fact in a certain place in real time.The reliability requirement of IP video monitoring system is also thereupon more and more higher, and a lot of link all needs to consider reliability, and the EC (video encoder) of two network interface arises at the historic moment under this kind of background condition.
As shown in Figure 1, under networking diagram general at present, EC has two network interfaces, be connected with access-layer switch respectively, wherein, two network interfaces (i.e. port) of EC both can be connected with a switch as shown in the figure, also can connect from different switches respectively.Two ports that switch is connected with this EC utilize polymerization property to be aggregating.Due to cost control, two ports of EC are all on same exchange chip, and this chip functions does not simply support link aggregation characteristic.Thus, following problem can be caused:
Switch enables link aggregation and the EC of opposite end does not support port trunking, and business can be caused unavailable.Because as shown in Figure 2, after going out from the broadcasting packet that exchanger side is next from P11 mouth, can forward from P2 mouth after EC receives this broadcasting packet from P1 mouth, cause switch on P12 mouth, learn source MAC (the Media Access Control of this broadcasting packet again, medium education) address, this not only can cause broadcast traffic to spread unchecked, and traffic forwarding also can be caused obstructed.
Summary of the invention
The invention provides a kind of message processing method based on port trunking and device thereof, during in order to solve two network interface network equipment employing double-ascending network, because this network equipment does not support that the broadcast traffic that port trunking causes spreads unchecked problem.
Message processing method based on port trunking provided by the invention, is applied to the switching equipment that different ports is connected to the different port of consolidated network equipment, and the different port of the described network equipment is on same exchange chip, and the method comprises:
When the port of switching equipment is under learning state, this switching equipment correspondence study arranges aggregation group to the port of same MAC Address, and study is added this aggregation group to the port of this MAC Address as member port;
When the port of switching equipment is under forwarding state, when the member port of described aggregation group receives message, judge whether other ports on described switching equipment except the member port of this aggregation group learn the source MAC of this message, if be judged as YES, then abandon this message; Otherwise, forward this message.
Switching equipment provided by the invention, the different port of described switching equipment is connected on the different port of consolidated network equipment, and the different port of the described network equipment is on same exchange chip, and this switching equipment comprises:
Module of port cluster, for when the port of switching equipment is under learning state, corresponding study arranges aggregation group to the port of same MAC Address, and study is added this aggregation group to the port of this MAC Address as member port;
Message processing module (MPM), for when the port of switching equipment is under forwarding state, when the member port of described aggregation group receives message, judge whether other ports on described switching equipment except this aggregation group member port learn the source MAC of this message, if be judged as YES, then abandon this message; Otherwise, forward this message.
Advantageous Effects of the present invention comprises:
In the present invention, when switching equipment port is under learning state, study is aggregated in aggregation group to the port of identical MAC Address as member port, when there being message to enter the aggregation group member port of switch, by judging whether the source MAC of this message learnt at other port except this aggregation group member port of this switch, thus whether the inbound port can judging this message is the port that starts connecting this MAC Address equipment, if this inbound port is not the port that starts connecting this MAC Address equipment, then abandon this message, in order to avoid cause flow to spread unchecked, if this inbound port is the port that starts connecting this MAC Address equipment, then conveniently flow process forwards this message, normally carry out with guarantee business.
Embodiment
Below in conjunction with accompanying drawing, the embodiment of the present invention is described in detail.
Usually, switch power on or port UP (relieving) time, its port enters study (1earning) state.Port under learning state can learning MAC address, but does not E-Packet.After certain hour length (as 30 seconds), port moves to forwarding (forward) state by learning state, and the port under forwarding state can E-Packet.
In the embodiment of the present invention, the MAC address learning process of above-mentioned switch is improved, that is, when the MAC Address having two or more port to learn is identical, these study are arrived the port trunking of identical MAC Address together, forms aggregation group.
Concrete, as shown in Figure 3, when switch power on or port UP time (step 301), corresponding port enters learning state and carries out MAC address learning (if switch powers on, other port realizing message repeating for interconnection network equipment then except stack port enters learning state, if port UP, this port enters learning state, sees step 302); Whether the two or more ports judging to be in learning state acquire same MAC Address (step 303), if, then switch configuration aggregation group, and these study are added this aggregation group (step 304) to the port of same MAC Address as member port, after this, after setting is long-time, the migration of this aggregation port is forwarding state; Otherwise carry out MAC address learning in a conventional manner, after setting is long-time, the port migration being in learning state is forwarding state.Fig. 4 shows the schematic diagram after port trunking, and wherein, because port P11 with P12 of switch is connected with the different port of EC respectively, therefore study is to the MAC Address of this EC, and then port P11 and P12 condenses together.
In above-mentioned flow process, preferably, switch is configurable parameter from entering learning state to the time span that migration is forwarding state.(as less in network size or network performance better, then configurable shorter time span, as being less than or equal to 30 seconds can to configure suitable time span according to the network environment such as network size, network performance; Otherwise, network size is comparatively large or network performance is poor, then configurable longer time span, as being greater than 30 seconds), thus can ensure that switch ports themselves can learn the MAC Address of other equipment in this period on the one hand, this time span can be shortened again as far as possible, enter forwarding state as early as possible to process message to make switch ports themselves.
When through after a while, after the port of learning state moves to forwarding state, as shown in Figure 5, when there being message to arrive certain member port of aggregation group (step 501), switch checks whether the source MAC of this message learnt at other port (other port herein does not comprise the member port of this aggregation group), that is, whether the source MAC of this message is present in (step 502) in the mac address table of other port; If other port had learnt this MAC Address, then show that this aggregation group member port is not the port that starts connecting this MAC Address equipment (namely MAC Address is the equipment of the source MAC of this message), now, the aggregation group member port receiving this message abandons this message received, and do not learn the source MAC of this message on that port, in order to avoid flow is caused to spread unchecked the problems (step 503) such as obstructed with follow-up forwarding; If other port did not learn this MAC Address, then show that this port is the port that starts connecting this MAC Address equipment, now, the port receiving this message conveniently flow process forwards this message, namely, mac address table according to this port configures matches port, and forwards this message (step 504) by the outbound port matched.
Below in conjunction with the group-network construction shown in Fig. 2 and concrete scene, the implementation procedure of the embodiment of the present invention is described in detail.
After broadcasting packet enters switch from port P10, port P10 learns the MAC Address of this broadcasting packet, switch forwards to all of the port, naturally also forwards from aggregation port (member port of this aggregation port comprises P11 and P12), supposes to go out from P11 port repeat.EC receives this broadcasting packet from P1 port, because the exchange chip of EC does not support polymerization property, so EC is also to its all port repeat, sends comprising from port P2.Now, exchange opportunity receives from the another one member port P12 aggregation port the broadcasting packet just forwarded, but other ports (i.e. P10) study of the source MAC of this broadcasting packet in mac address table has in a switch been arrived, so port P12 abandons this message, thus no longer broadcast this message.
By describing above and can finding out, in the embodiment of the present invention, because two network interfaces of EC are on same exchange chip, therefore there is identical MAC Address, when the switch be connected with two network interfaces of this EC powers on, the port of switch enters learning state, is in learning state and will learns identical MAC Address with 2 switch ports themselves that two network interfaces of EC connect respectively, these 2 ports are added aggregation group by such switch, form aggregation port.When there being message to enter aggregation port (or certain member port of aggregation port) of switch, by judging whether the source MAC of this message learnt at other port of this switch, thus can judge whether this inbound port is the port that starts connecting this MAC Address equipment, if this inbound port is not the port that starts connecting this MAC Address equipment, then abandon this message, in order to avoid cause flow to spread unchecked, if this inbound port is the port that starts connecting this MAC Address equipment, then conveniently flow process forwards this message, to ensure that business is normally carried out.
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of switching equipment that can be applicable to above-mentioned flow process.As shown in Figure 6, this switching equipment can comprise:
Module of port cluster 601, for when the port of switching equipment is under learning state, corresponding study arranges aggregation group to the port of same MAC Address, and study is added this aggregation group to the port of this MAC Address as member port;
Message processing module (MPM) 602, for when the port of switching equipment is under forwarding state, when the member port of described aggregation group receives message, judge whether other ports on described switching equipment except this aggregation group member port learn the source MAC of this message, if be judged as YES, then abandon this message; Otherwise, forward this message.
Further, message processing module (MPM) 602 also for: after judging that other ports except described aggregation group member port learn the source MAC of this message, abandon the source MAC learning this message on this aggregation group member port.
Further, module of port cluster 601 specifically for: when switch power on or port UP time, port enters learning state, and the port under learning state carries out MAC address learning; When judging have at least 2 ports to acquire same MAC Address, aggregation group is set, and study is added this aggregation group to the port of this same MAC Address as member port.
Further, above-mentioned switching equipment also can comprise port status administration module 603, for after entering learning state at the switch ports themselves being in learning state after setting duration, be forwarding state by the migration of this port.Preferably, this setting duration can arrange according to network environment.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.) perform method described in each embodiment of the present invention.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should look protection scope of the present invention.