Summary of the invention
The object of the present invention is to provide VRRPE message processing method and equipment in a kind of double layer network, to save Internet resources, and improve the stability of system.For this reason, the present invention adopts following technical scheme:
VRRPE message processing method in a kind of double layer network, be applied to the VRRPE networking comprising two-layer switching equipment and VRRPE backup group, described VRRPE backup group realizes interconnected by two-layer switching equipment, the method comprises:
Described two-layer switching equipment receives VRRPE message, and safeguards VRRPSnooping list item according to this VRRPE message; VRRP backup group mark, the notification time of VRRPE message, source MAC address and incoming interface is recorded in described VRRPSnooping list item;
Described two-layer switching equipment is VRRPSnooping list item according to the VRRPE backup group identified query carried in described VRRPE message, identify identical when recording VRRPE backup group mark in described VRRPSnooping list item with the VRRPE backup group carried in described VRRPE message, but the source MAC carried in source MAC and described VRRPE message, and during the incoming interface list item different from the incoming interface receiving described VRRPE message, the target MAC (Media Access Control) address of described VRRPE message is replaced with the source MAC recorded in this list item by described two-layer switching equipment, and the VRRPE message after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding, otherwise two-layer switching equipment stops two layers of forwarding of described VRRPE message.
Wherein, described two-layer switching equipment safeguards VRRPSnooping list item according to described VRRPE message, is specially:
Described two-layer switching equipment is VRRPSnooping list item according to the VRRPE backup group identified query carried in described VRRPE message;
When not recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, described two-layer switching equipment sets up list item corresponding to this VRRPE backup group mark, and is recorded in this list item by the notification time of the VRRPE message carried in described VRRPE message, source MAC and the incoming interface that receives this VRRPE message;
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, but there is not the source MAC carried in source MAC and described VRRPE message in the list item that the VRRPE backup group carried in described VRRPE message mark is corresponding, and during the incoming interface list item all identical with the incoming interface receiving described VRRPE message, described two-layer switching equipment increases the list item of the VRRPE backup group mark of carrying in a described VRRPE message of correspondence, and the notification time of VRRPE message of will carry in described VRRPE message, source MAC and the incoming interface receiving this VRRPE message are recorded in this newly-increased list item,
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and it is identical with the incoming interface receiving described VRRPE message to there is incoming interface in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, but during the source MAC list item different from the source MAC carried in described VRRPE message, described two-layer switching equipment is by the notification time of the VRRPE message in list item, source MAC and incoming interface replace with the notification time of the VRRPE message carried in described VRRPE message respectively, source MAC and receive the incoming interface of described VRRPE message,
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and there is the source MAC carried in source MAC and described VRRPE message in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, and incoming interface is all identical with the incoming interface receiving described VRRPE message, but during the notification time of the VRRPE message list item not identical with the notification time of the VRRPE message carried in described VRRPE message, notification time in this list item is replaced with the notification time of the VRRPE message carried in described VRRPE message by described two-layer switching equipment.
Wherein, VRRPSnooping list item ageing timer is provided with in described two-layer switching equipment;
When described two-layer switching equipment is before ageing timer time-out, during the VRRPE message that the incoming interface from the list item that this ageing timer is corresponding receives VRRPE backup group mark, the notification time of VRRPE message identifies with the VRRPE backup group in this list item, the notification time of VRRPE message is identical respectively, described two-layer switching equipment upgrades this ageing timer;
When described two-layer switching equipment is before ageing timer time-out, it is identical with the VRRPE backup group recorded in this list item that the incoming interface recorded from the list item that this ageing timer is corresponding receives VRRPE backup group mark, but during the notification time of the VRRPE message VRRPE message different from the notification time of the VRRPE message recorded in this list item, described two-layer switching equipment resets this ageing timer according to the notification time of the VRRPE message carried in this VRRPE message;
When described two-layer switching equipment is before ageing timer time-out, when the incoming interface do not recorded from list item corresponding to this ageing timer receives VRRP backup group identical VRRPE message, described two-layer switching equipment deletes this list item.
Wherein, the method also comprises:
When to receive Virtual Forwarder VF priority be the VRRPE notification packet of 0 to described two-layer switching equipment, described two-layer switching equipment is inquired about according to the incoming interface carrying VRRPE backup group mark in this VRRPE notification packet and receive this VRRPE notification packet and deletes the corresponding list item in described VRRPSnooping list item;
When to there is VRRPE backup group mark in described VRRPSnooping list item be the VRRPE notification packet of 0 with this VF priority, VRRPE backup group identifies identical, the source MAC of source MAC and this VRRPE notification packet, and during the incoming interface list item different from the incoming interface receiving this VRRPE notification packet, the target MAC (Media Access Control) address of this VRRPE notification packet is replaced with the source MAC in this list item by described two-layer switching equipment, and the VRRPE notification packet after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding.
Wherein, virtual MAC address and empty internet protocol address is also recorded in the VRRPSnooping list item safeguarded in described two-layer switching equipment;
The method also comprises:
When the ARP request message that the object IP address that described two-layer switching equipment receives client transmission is mated with the virtual IP address in VRRPSnooping list item, described two-layer switching equipment stops this ARP request message, and the VRRPSnooping list item corresponding according to this object IP address determines the virtual MAC address corresponding with this object IP address;
When the described virtual MAC address corresponding with this object IP address is one, the corresponding relation of described object IP address and this virtual MAC address is carried in arp reply message and returns to described client by described two-layer switching equipment;
When the described virtual MAC address corresponding with this object IP address is multiple, described two-layer switching equipment selects one from described multiple virtual MAC address, and is carried in arp reply message by the corresponding relation of described object IP address and selected virtual MAC address and returns to described client.
Wherein, described two-layer switching equipment safeguards VRRPSnooping list item according to described VRRPE message, also comprises:
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and there is the source MAC carried in source MAC and described VRRPE message in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, the notification time of the VRRPE message carried in the notification time of VRRP message and described VRRPE message, and incoming interface is all identical with the incoming interface receiving described VRRPE message, but during the list item not identical with the virtual MAC address of carrying in described VRRPE message of virtual MAC address, the virtual MAC address of carrying in described VRRPE message is recorded in this list item by described two-layer switching equipment.
A kind of two-layer switching equipment, be applied to and comprise VRRPE backup group VRRPE networking, described VRRPE backup group realizes interconnected by two-layer switching equipment, this two-layer switching equipment comprises:
Receiver module, for receiving VRRPE message;
Maintenance module, for safeguarding VRRPSnooping list item according to this VRRPE message; VRRP backup group mark, the notification time of VRRPE message, source MAC address and incoming interface is recorded in described VRRPSnooping list item;
Sending module, for identifying identical when recording VRRPE backup group mark in described VRRPSnooping list item with the VRRPE backup group carried in described VRRPE message, but the source MAC carried in source MAC and described VRRPE message, and during the incoming interface list item different from the incoming interface receiving described VRRPE message, the target MAC (Media Access Control) address of described VRRPE message is replaced with the source MAC recorded in this list item, and the VRRPE message after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding; Otherwise, stop two layers of forwarding of described VRRPE message.
Wherein, described maintenance module safeguards VRRPSnooping list item specifically for realizing in the following manner according to described VRRPE message:
VRRPSnooping list item according to the VRRPE backup group identified query carried in described VRRPE message;
When not recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, set up the list item that this VRRPE backup group mark is corresponding, and the notification time of the VRRPE message carried in described VRRPE message, source MAC and the incoming interface that receives this VRRPE message are recorded in this list item;
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, but there is not the source MAC carried in source MAC and described VRRPE message in the list item that the VRRPE backup group carried in described VRRPE message mark is corresponding, and during the incoming interface list item all identical with the incoming interface receiving described VRRPE message, increase the list item of the VRRPE backup group mark of carrying in a described VRRPE message of correspondence, and the notification time of VRRPE message of will carry in described VRRPE message, source MAC and the incoming interface receiving this VRRPE message are recorded in this newly-increased list item,
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and it is identical with the incoming interface receiving described VRRPE message to there is incoming interface in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, but during the source MAC list item different from the source MAC carried in described VRRPE message, by the notification time of the VRRPE message in list item, source MAC and incoming interface replace with the notification time of the VRRPE message carried in described VRRPE message respectively, source MAC and receive the incoming interface of described VRRPE message,
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and there is the source MAC carried in source MAC and described VRRPE message in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, and incoming interface is all identical with the incoming interface receiving described VRRPE message, but during the notification time of the VRRPE message list item not identical with the notification time of the VRRPE message carried in described VRRPE message, notification time in this list item is replaced with the notification time of the VRRPE message carried in described VRRPE message.
Wherein, VRRPSnooping list item ageing timer is provided with in described two-layer switching equipment;
Described maintenance module also for, when described two-layer switching equipment is before ageing timer time-out, during the VRRPE message that the incoming interface from the list item that this ageing timer is corresponding receives VRRPE backup group mark, the notification time of VRRPE message identifies with the VRRPE backup group in this list item, the notification time of VRRPE message is identical respectively, described two-layer switching equipment upgrades this ageing timer; When described two-layer switching equipment is before ageing timer time-out, it is identical with the VRRPE backup group recorded in this list item that the incoming interface recorded from the list item that this ageing timer is corresponding receives VRRPE backup group mark, but during the notification time of the VRRPE message VRRPE message different from the notification time of the VRRPE message recorded in this list item, described two-layer switching equipment resets this ageing timer according to the notification time of the VRRPE message carried in this VRRPE message; When described two-layer switching equipment is before ageing timer time-out, when the incoming interface do not recorded from list item corresponding to this ageing timer receives VRRP backup group identical VRRPE message, described two-layer switching equipment deletes this list item.
Wherein, described maintenance module also for, when to receive Virtual Forwarder VF priority be the VRRPE notification packet of 0 to described receiver module, the incoming interface according to carrying VRRPE backup group mark in this VRRPE notification packet and receiving this VRRPE notification packet is inquired about and deletes the corresponding list item in described VRRPSnooping list item;
Described sending module also for, when to there is VRRPE backup group mark in described VRRPSnooping list item be the VRRPE notification packet of 0 with this VF priority, VRRPE backup group identifies identical, the source MAC of source MAC and this VRRPE notification packet, and during the incoming interface list item different from the incoming interface receiving this VRRPE notification packet, the target MAC (Media Access Control) address of this VRRPE notification packet is replaced with the source MAC in this list item, and the VRRPE notification packet after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding.
Wherein, virtual MAC address and empty internet protocol address is also recorded in the VRRPSnooping list item that described two-layer switching equipment is safeguarded;
Described two-layer switching equipment also comprises:
ARP responder module, for receive when described receiver module client send object IP address mate with the virtual IP address in VRRPSnooping list item ARP request message time, stop this ARP request message, and the VRRPSnooping list item corresponding according to this object IP address determines the virtual MAC address corresponding with this object IP address; When the described virtual MAC address corresponding with this object IP address is one, the corresponding relation of described object IP address and this virtual MAC address is carried in arp reply message and returns to described client; When the described virtual MAC address corresponding with this object IP address is multiple, from described multiple virtual MAC address, select one, and the corresponding relation of described object IP address and selected virtual MAC address is carried in arp reply message returns to described client.
Wherein, described maintenance module also for, when recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and there is the source MAC carried in source MAC and described VRRPE message in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, the notification time of the VRRPE message carried in the notification time of VRRP message and described VRRPE message, and incoming interface is all identical with the incoming interface receiving described VRRPE message, but during the list item not identical with the virtual MAC address of carrying in described VRRPE message of virtual MAC address, the virtual MAC address of carrying in described VRRPE message is recorded in this list item.
State on the invention in embodiment, after two-layer switching equipment receives VRRPE message, judge whether also there is other routing device in the VRRPE backup group of this VRRPE message of transmission according to the VRRPE backup group mark of carrying in this message, source MAC and the incoming interface that receives this VRRPE message, and when being judged as YES, the target MAC (Media Access Control) address of this VRRPE message is replaced with corresponding unicast mac address, and carry out two layers of unicast forwarding, prevent the broadcast transmission of message; When judged result is no, stop the forwarding of this VRRPE message, effectively reduce flooding of VRRPE message in double layer network, save Internet resources, improve the stability of a system.
Embodiment
For the above-mentioned problems in the prior art, embodiments provide the technical scheme of VRRPE Message processing in a kind of double layer network, be applied to the VRRPE networking comprising two-layer switching equipment and VRRPE backup group.In this technical scheme, VRRPE backup group realizes interconnected by two-layer switching equipment, when the VRRPE message that the router that two-layer switching equipment receives in VRRPE backup group sends, safeguards VRRPE list item according to this VRRPE message, this two-layer switching equipment is according to the VRRPE backup group identified query VRRPSnooping list item carried in the VRRPE message received, and identify identical when recording VRRPE backup group mark in VRRPSnooping list item with the VRRPE backup group carried in this VRRPE message, but the source MAC carried in source MAC and this VRRPE message, and during the incoming interface list item different from the incoming interface receiving this VRRPE message, the target MAC (Media Access Control) address of the VRRPE message received is replaced with the source MAC recorded in this list item by two-layer switching equipment, and the VRRPE message after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding, otherwise two-layer switching equipment stops the forwarding of this VRRPE message.Wherein, record VRRP backup group mark, the notification time of VRRPE message, source MAC, virtual MAC address and incoming interface in the VRRPE list item that two-layer switching equipment is safeguarded, its form can be as shown in table 1:
Table 1
Wherein, VRRPVRID, notification time and source MAC are respectively the VRRPE backup group mark, notification time and the source MAC that carry in the VRRPE message that two-layer switching equipment receives, and incoming interface is the incoming interface that two-layer switching equipment receives this VRRPE message.
In embodiments of the present invention, after two-layer switching equipment receives VRRPE message, judge whether also there is other routing device in the VRRPE backup group of this VRRPE message of transmission according to the VRRPE backup group mark of carrying in this message, source MAC and the incoming interface that receives this VRRPE message, and when being judged as YES, the target MAC (Media Access Control) address of this VRRPE message is replaced with corresponding unicast mac address, and carry out two layers of unicast forwarding, prevent the broadcast transmission of message; When judged result is no, stop the forwarding (namely this VRRPE message not being forwarded) of this VRRPE message, effectively reduce flooding of VRRPE message in double layer network, save Internet resources, improve the stability of a system.
Below in conjunction with the accompanying drawing in embodiments of the invention, carry out clear, complete description to the technical scheme in embodiments of the invention, obviously, the embodiments described below are only some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not paying the every other embodiment obtained under creative work prerequisite, all belong to the scope of embodiments of the invention protection.
As shown in Figure 3, be the schematic flow sheet of VRRPE message processing method in a kind of double layer network that the embodiment of the present invention provides, can comprise the following steps:
Step 301, two-layer switching equipment receive VRRPE message, and safeguard VRRPSnooping list item according to this VRRPE message.
Concrete, when two-layer switching equipment receives message, can judge whether this message is VRRPE message according to the message characteristic of this message.Such as, if the protocol number of message that two-layer switching equipment receives is 112, version number is 8 or 9, then two-layer switching equipment determines that this message is VRRPE message.
In embodiments of the present invention, when two-layer switching equipment receives VRRPE message, VRRPSnooping list item can be safeguarded according to this VRRPE message.
Wherein, in embodiments of the present invention, according to VRRPE message, two-layer switching equipment safeguards that VRRPSnooping list item can realize especially by with under type:
Two-layer switching equipment is according to the VRRPE backup group identified query VRRPSnooping list item carried in the VRRPE message received;
When not recording the list item of the VRRPE backup group mark correspondence of carrying in this VRRPE message in VRRPSnooping list item, two-layer switching equipment sets up list item corresponding to this VRRPE backup group mark, and is recorded in this list item by the notification time of the VRRPE message carried in this VRRPE message, source MAC and the incoming interface that receives this VRRPE message;
When recording the list item of the VRRPE backup group mark correspondence of carrying in this VRRPE message in VRRPSnooping list item, but there is not the source MAC carried in source MAC and this VRRPE message in the list item that the VRRPE backup group carried in this VRRPE message mark is corresponding, and during the incoming interface list item all identical with the incoming interface receiving this VRRPE message, two-layer switching equipment increases a list item to the VRRPE backup group mark should carried in VRRPE message, and the notification time of VRRPE message of will carry in this VRRPE message, source MAC and the incoming interface receiving this VRRPE message are recorded in this newly-increased list item,
When recording the list item of the VRRPE backup group mark correspondence of carrying in this VRRPE message in VRRPSnooping list item, and it is identical with the incoming interface receiving this VRRPE message to there is incoming interface in the list item of the VRRPE backup group carried in this VRRPE message mark correspondence, but during the source MAC list item different from the source MAC carried in this VRRPE message, two-layer switching equipment is by the notification time of the VRRPE message in list item, source MAC and incoming interface replace with the notification time of the VRRPE message carried in this VRRPE message respectively, source MAC and receive the incoming interface of this VRRPE message,
When recording the list item of the VRRPE backup group mark correspondence of carrying in this VRRPE message in VRRPSnooping list item, and there is the source MAC carried in source MAC and this VRRPE message in the list item of the VRRPE backup group carried in this VRRPE message mark correspondence, and incoming interface is all identical with the incoming interface receiving this VRRPE message, but during the notification time of the VRRPE message list item not identical with the notification time of the VRRPE message carried in this VRRPE message, notification time in this list item is replaced with the notification time of the VRRPE message carried in this VRRPE message by two-layer switching equipment.
Step 302, two-layer switching equipment are according to the VRRPE backup group identified query VRRPSnooping list item carried in this VRRPE message, identify identical when recording VRRPE backup group mark in this VRRPSnooping list item with the VRRPE backup group carried in VRRPE message, but the source MAC carried in source MAC and this VRRPE message, and during the incoming interface list item different from the incoming interface receiving this VRRPE message, go to step 303; Otherwise, go to step 304.
Concrete, in embodiments of the present invention, in order to prevent VRRPE message in double layer network from flooding, after two-layer switching equipment receives VRRPE message, only this VRRPE message repeating is given other routers belonging to same VRRPE backup group with the router sending this VRRPE message.
Wherein, two-layer switching equipment can according to the VRRPE backup group identified query VRRPSnooping list item carried in the VRRPE message received, identify identical when recording VRRPE backup group mark in VRRPSnooping list item with the VRRPE backup group carried in this VRRPE message, but the source MAC carried in source MAC and this VRRPE message, and during the incoming interface list item different from the incoming interface receiving this VRRPE message, determine to send in the VRRPE backup group belonging to the router of this VRRPE message the router that also there are other; Otherwise, determine to send in the VRRPE backup group belonging to the router of this VRRPE message the router that there are not other.
The target MAC (Media Access Control) address of this VRRPE message is replaced with the source MAC recorded in this list item by step 303, two-layer switching equipment, and the VRRPE message after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding.
Concrete, when two-layer switching equipment determines that recording VRRPE backup group mark in VRRPSnooping list item identifies identical with the VRRPE backup group carried in the VRRPE message received, but the source MAC carried in source MAC and this VRRPE message, and the list item that incoming interface is different from the incoming interface receiving this VRRPE message, namely send when also there are other routers in the VRRPE backup group belonging to router of VRRPE message, the target MAC (Media Access Control) address of this VRRPE message is replaced with the source MAC in corresponding list item by two-layer switching equipment, and the VRPPE message after being replaced by target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding
Step 304, two-layer switching equipment stop two layers of forwarding of this VRRPE message.
Concrete, when two-layer switching equipment determines to send in the VRRPE backup group belonging to the router of this VRRPE message the router that there are not other, this VRRPE message does not forward by two-layer switching equipment.Wherein, two-layer switching equipment directly can abandon this VRRPE message.
Further, in embodiments of the present invention, VRRPSnooping list item ageing timer can be set, and according to ageing timer, corresponding list item be safeguarded.
Concrete, for each list item in VRRPSnooping list item, two-layer switching equipment all can arrange corresponding ageing timer according to the notification time of VRRPE message.When before ageing timer time-out, when the incoming interface that two-layer switching equipment records from list item corresponding to this ageing timer receives VRRPE backup group mark, notification time distinguishes identical VRRPE message with the VRRPE backup group recorded in this list item, notification time, two-layer switching equipment upgrades this ageing timer; When before ageing timer time-out, it is identical with the VRRPE backup group recorded in this list item that the incoming interface that two-layer switching equipment records from list item corresponding to this ageing timer receives VRRPE backup group mark, but during the notification time VRRPE message different from the notification time recorded in this list item, two-layer switching equipment resets this ageing timer according to the notification time of carrying in this VRRPE message; When ageing timer time-out, when the incoming interface that two-layer switching equipment does not record from list item corresponding to this ageing timer receives VRRP backup group identical VRRPE message, two-layer switching equipment deletes this list item.Preferably, the timeouts of ageing timer can be set to the notification time of 3 times.
Further, the router in VRRPE backup group when exiting backup group, can to two-layer switching equipment send VF(VirtualForwarder, Virtual Forwarder) priority be 0 VRRPE notification packet.In embodiments of the present invention, when to receive VF priority be the VRRPE notification packet of 0 to two-layer switching equipment, two-layer switching equipment is inquired about according to this VRRPE notification packet and is deleted corresponding list item in VRRPSnooping list item, and the target MAC (Media Access Control) address of this VRRPE notification packet is replaced with VRRPE backup group mark identify identical with the VRRPE backup group of this VRRPE notification packet, the source MAC of source MAC and this VRRPE notification packet, and the source MAC recorded in the incoming interface list item different from the incoming interface receiving this VRRPE notification packet, and the VRRPE notification packet after being replaced by target MAC (Media Access Control) address is transmitted to corresponding router.The Message processing flow process that the router receiving this VRRPE notification packet specifies according to agreement processes, and takes over the virtual MAC address of carrying in this VRRPE notification packet.The router taking over the virtual MAC address of carrying in this VRRPE notification packet sends two VRRPE messages to two-layer switching equipment, and one of them carries the virtual MAC of self, and another carries taken over virtual MAC, and its specific implementation flow process does not repeat them here.Wherein, after two-layer switching equipment receives VRRPE message, the VRRPE message according to receiving safeguards VRRPSnooping list item.
Further, in embodiments of the present invention, the virtual MAC address and virtual IP address of carrying in the VRRPE message that two-layer switching equipment receives can also be recorded in VRRPSnooping list item.Correspondingly, when two-layer switching equipment receives the ARP request message of client transmission, and the object IP address of this ARP request message is when mating with the virtual IP address in VRRPSnooping list item, two-layer switching equipment stops this ARP request message, and according in VRRPSnooping list item to determining the virtual MAC address that this object IP address is corresponding in the list item of object IP address, when the virtual MAC address that this object IP address is corresponding is one, the corresponding relation of this object IP address and virtual MAC address is carried in arp reply message and returns to client by two-layer switching equipment; When the virtual MAC address that this object IP address is corresponding is multiple, two-layer switching equipment selects a virtual MAC address from multiple virtual MAC addresses corresponding to this object IP address, and the corresponding relation of object IP address and selected virtual MAC address is carried in arp reply message returns to client, avoid the broadcast of ARP request message in VLAN, decrease flooding of ARP request message, save Internet resources.Wherein, two-layer switching equipment selects the modes such as the mode of a virtual MAC address can be selected for poll, Stochastic choice from multiple virtual MAC addresses corresponding to object IP address, and its specific implementation does not repeat them here.
Correspondingly, when two-layer switching equipment receives VRRPE message, and in VRRPSnooping list item, record the list item of the VRRPE backup group mark correspondence of carrying in this VRRPE message, and there is the source MAC carried in source MAC and VRRPE message in the list item of the VRRPE backup group carried in VRRPE message mark correspondence, the notification time of the VRRPE message carried in the notification time of VRRP message and this VRRPE message, and incoming interface is all identical with the incoming interface receiving VRRPE message, but during the list item not identical with the virtual MAC address of carrying in this VRRPE message of virtual MAC address, the virtual MAC address of carrying in this VRRPE message is recorded in this list item by this two-layer switching equipment.
Below in conjunction with concrete application scenarios, the technical scheme that the embodiment of the present invention provides is further described in more detail.
In this embodiment, the VRRPSnooping list item safeguarded in two-layer switching equipment can be as shown in table 2:
Table 2
Wherein, the corresponding each VRRPSnooping list item of two-layer switching equipment is provided with ageing timer, and the timeouts of ageing timer is the notification time of 3 times.
If two-layer switching equipment receives from interface E0/1 the VRRPE message that VRRPVRID is 1, notification time is 1s, source MAC is 0-0-1, virtual MAC address is 000f-e2ff-0011, virtual IP address is 20.10.0.10, two-layer switching equipment inquires about VRRPSnooping list item according to this VRRPE switch according to the respective field in this VRRPE message, determine the list item that there is coupling in VRRPSnooping list item, then two-layer switching equipment upgrades ageing timer corresponding to this list item.
Further, two-layer switching equipment is according to Query Result, also there are two VRRPVRID identical with the VRRPVRID carried in the VRRPE message received in VRRPSnooping list item, but the source MAC (0-0-1) carried in source MAC and this VRRPE message, and the list item that incoming interface is different from the incoming interface (E0/1) receiving this VRRPE message, the target MAC (Media Access Control) address of this VRRPE message is replaced with 0-0-2 and 0-0-3 by two-layer switching equipment respectively, and respectively according to corresponding relation (0-0-2 and the E0/2 of the source MAC recorded in corresponding list item and incoming interface, 0-0-3 and E0/3) inquire about two layer MAC address table, and then the VRRPE message after being replaced by target MAC (Media Access Control) address carries out two layers of unicast forwarding by corresponding interface.
If it is 2 that two-layer switching equipment receives VRRPVRID from interface E0/4, notification time is 1s, source MAC is 0-0-4, virtual MAC address is 000f-e2ff-0021, virtual IP address is the VRRPE message of 30.10.0.10, two-layer switching equipment is according to the respective field inquiry VRRPSnooping list item of this VRRPE message, determine in VRRPSnooping list item, to there is not the list item that VRRPVRID is 2, then two-layer switching equipment is set up should VRRPVRID(2) list item, and the respective field of carrying in this VRRPE message is recorded in this list item, wherein, this list item can be as shown in table 3:
Table 3
After two-layer switching equipment sets up this list item, arrange should the ageing timer of list item, its timeouts be 3s.
If it is the ARP request message of 20.0.0.10 that two-layer switching equipment receives the object IP address that client sends, two-layer switching equipment, according to this object IP address lookup VRRPSnooping list item, determines that virtual MAC address corresponding to this object IP address comprises: 000f-e2ff-0011,000f-e2ff-0012 and 000f-e2ff-0013.Two-layer switching equipment therefrom selects a virtual MAC address by the mode that poll is selected, and as 000f-e2ff-0012, and is carried in arp reply message by the corresponding relation of this virtual MAC address (000f-e2ff-0012) and object IP address and returns to this client.
By describing above and can finding out, in the technical scheme that the embodiment of the present invention provides, after two-layer switching equipment receives VRRPE message, this VRRPE message is not forwarded in VLAN, but by mode of unicast, this VRRPE message repeating is given other routers belonging to same VRRPE backup group with the router sending this VRRPE message, effectively prevent VRRPE message in double layer network to flood, save Internet resources, improve the stability of a system.
Based on the inventive concept of said method embodiment system, the embodiment of the present invention additionally provides a kind of two-layer switching equipment, can be applied to said method embodiment as two-layer switching equipment.
As shown in Figure 4, be the structural representation of a kind of two-layer switching equipment that the embodiment of the present invention provides, can be applied to and comprise VRRPE backup group VRRPE networking, described VRRPE backup group realizes interconnected by two-layer switching equipment, this two-layer switching equipment can comprise:
Receiver module 41, for receiving VRRPE message;
Maintenance module 42, for safeguarding VRRPSnooping list item according to this VRRPE message; VRRP backup group mark, the notification time of VRRPE message, source MAC address and incoming interface is recorded in described VRRPSnooping list item;
Sending module 43, for identifying identical when recording VRRPE backup group mark in described VRRPSnooping list item with the VRRPE backup group carried in described VRRPE message, but the source MAC carried in source MAC and described VRRPE message, and during the incoming interface list item different from the incoming interface receiving described VRRPE message, the target MAC (Media Access Control) address of described VRRPE message is replaced with the source MAC recorded in this list item, and the VRRPE message after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding; Otherwise, stop two layers of forwarding of described VRRPE message.
Wherein, described maintenance module 42 safeguards VRRPSnooping list item specifically for realizing in the following manner according to described VRRPE message:
VRRPSnooping list item according to the VRRPE backup group identified query carried in described VRRPE message;
When not recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, set up the list item that this VRRPE backup group mark is corresponding, and the notification time of the VRRPE message carried in described VRRPE message, source MAC and the incoming interface that receives this VRRPE message are recorded in this list item;
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, but there is not the source MAC carried in source MAC and described VRRPE message in the list item that the VRRPE backup group carried in described VRRPE message mark is corresponding, and during the incoming interface list item all identical with the incoming interface receiving described VRRPE message, increase the list item of the VRRPE backup group mark of carrying in a described VRRPE message of correspondence, and the notification time of VRRPE message of will carry in described VRRPE message, source MAC and the incoming interface receiving this VRRPE message are recorded in this newly-increased list item,
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and it is identical with the incoming interface receiving described VRRPE message to there is incoming interface in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, but during the source MAC list item different from the source MAC carried in described VRRPE message, by the notification time of the VRRPE message in list item, source MAC and incoming interface replace with the notification time of the VRRPE message carried in described VRRPE message respectively, source MAC and receive the incoming interface of described VRRPE message,
When recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and there is the source MAC carried in source MAC and described VRRPE message in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, and incoming interface is all identical with the incoming interface receiving described VRRPE message, but during the notification time of the VRRPE message list item not identical with the notification time of the VRRPE message carried in described VRRPE message, notification time in this list item is replaced with the notification time of the VRRPE message carried in described VRRPE message.
Wherein, VRRPSnooping list item ageing timer is provided with in described two-layer switching equipment;
Described maintenance module 42 also for, when described two-layer switching equipment is before ageing timer time-out, during the VRRPE message that the incoming interface from the list item that this ageing timer is corresponding receives VRRPE backup group mark, the notification time of VRRPE message identifies with the VRRPE backup group in this list item, the notification time of VRRPE message is identical respectively, described two-layer switching equipment upgrades this ageing timer; When described two-layer switching equipment is before ageing timer time-out, it is identical with the VRRPE backup group recorded in this list item that the incoming interface recorded from the list item that this ageing timer is corresponding receives VRRPE backup group mark, but during the notification time of the VRRPE message VRRPE message different from the notification time of the VRRPE message recorded in this list item, described two-layer switching equipment resets this ageing timer according to the notification time of the VRRPE message carried in this VRRPE message; When described two-layer switching equipment is before ageing timer time-out, when the incoming interface do not recorded from list item corresponding to this ageing timer receives VRRP backup group identical VRRPE message, described two-layer switching equipment deletes this list item.
Wherein, described maintenance module 42 also for, when to receive Virtual Forwarder VF priority be the VRRPE notification packet of 0 to described receiver module, the incoming interface according to carrying VRRPE backup group mark in this VRRPE notification packet and receiving this VRRPE notification packet is inquired about and deletes the corresponding list item in described VRRPSnooping list item;
Described sending module 43 also for, when to there is VRRPE backup group mark in described VRRPSnooping list item be the VRRPE notification packet of 0 with this VF priority, VRRPE backup group identifies identical, the source MAC of source MAC and this VRRPE notification packet, and during the incoming interface list item different from the incoming interface receiving this VRRPE notification packet, the target MAC (Media Access Control) address of this VRRPE notification packet is replaced with the source MAC in this list item, and the VRRPE notification packet after replacing this target MAC (Media Access Control) address according to the source MAC recorded in this list item and incoming interface carries out two layers of unicast forwarding.
Wherein, virtual MAC address and empty internet protocol address is also recorded in the VRRPSnooping list item that described two-layer switching equipment is safeguarded;
Described two-layer switching equipment also comprises:
ARP responder module 44, for receive when described receiver module 41 client send object IP address mate with the virtual IP address in VRRPSnooping list item ARP request message time, stop this ARP request message, and the VRRPSnooping list item corresponding according to this object IP address determines the virtual MAC address corresponding with this object IP address; When the described virtual MAC address corresponding with this object IP address is one, the corresponding relation of described object IP address and this virtual MAC address is carried in arp reply message and returns to described client; When the described virtual MAC address corresponding with this object IP address is multiple, from described multiple virtual MAC address, select one, and the corresponding relation of described object IP address and selected virtual MAC address is carried in arp reply message returns to described client.
Wherein, described maintenance module 42 also for, when recording the list item of the VRRPE backup group mark correspondence of carrying in described VRRPE message in described VRRPSnooping list item, and there is the source MAC carried in source MAC and described VRRPE message in the list item of the VRRPE backup group carried in described VRRPE message mark correspondence, the notification time of the VRRPE message carried in the notification time of VRRP message and described VRRPE message, and incoming interface is all identical with the incoming interface receiving described VRRPE message, but during the list item not identical with the virtual MAC address of carrying in described VRRPE message of virtual MAC address, the virtual MAC address of carrying in described VRRPE message is recorded in this list item.
It will be appreciated by those skilled in the art that the module in the device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
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 two-layer switching 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.