WO2014101155A1 - Vpls中vc标签分配和mac地址学习的方法,设备和系统 - Google Patents

Vpls中vc标签分配和mac地址学习的方法,设备和系统 Download PDF

Info

Publication number
WO2014101155A1
WO2014101155A1 PCT/CN2012/087962 CN2012087962W WO2014101155A1 WO 2014101155 A1 WO2014101155 A1 WO 2014101155A1 CN 2012087962 W CN2012087962 W CN 2012087962W WO 2014101155 A1 WO2014101155 A1 WO 2014101155A1
Authority
WO
WIPO (PCT)
Prior art keywords
vsi
identifier
sub
service level
local
Prior art date
Application number
PCT/CN2012/087962
Other languages
English (en)
French (fr)
Inventor
张冀明
谭兆远
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/087962 priority Critical patent/WO2014101155A1/zh
Priority to CN201280002587.9A priority patent/CN104040965B/zh
Publication of WO2014101155A1 publication Critical patent/WO2014101155A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Definitions

  • the embodiments of the present invention relate to the field of computer communications, and in particular, to a VPLS (Virtual Circuit, VC for short) tag allocation and Media Access Control (MAC) address learning method, device and system.
  • VPLS Virtual Circuit, VC for short
  • MAC Media Access Control
  • Virtual local area network (LAN) service (virtual private LAN service, VPLS for short) is an Internet-based protocol (Internet).
  • IP Protocol 2
  • MPLS multi-protocol label switching
  • L2VPN Ethernet 2 layer private private network
  • IP IP/MPLS networks
  • VPLS can connect users' sites distributed in different locations through a packet swith network (PNN) and make each site work like a LAN.
  • PNN packet swith network
  • VPLS supports point-to-point, point-to-multipoint, and multi-point to multi-point service types.
  • the rovider edge (PE) devices in a VPLS are fully connected, that is, there is a pseudowire (PW) between them, and the PW is a virtual connection between two PEs.
  • the transmission frame, the establishment, maintenance, and removal of the PW are performed by the PE using the PW signaling protocol, which is divided into the Martini VPLS using the label distribution protocol (LDP) as the PW signaling protocol, and the boundary gateway protocol (LDP) as the PW signaling protocol, and the boundary gateway protocol ( The border gateway protocol (referred to as BGP) is used as the Kompella VPLS of the PW signaling protocol.
  • a PW usually consists of a pair of virtual circuits (VCs).
  • VC is a one-way logical connection between two PEs.
  • a VC can also be used as a one-way PW.
  • User edge customer The edge device (CE) is connected to the PE through an accessing circuit (AC).
  • the AC is used to transmit frames between the CE and the PE. It can be either a physical link or a logical link.
  • the PE assumes the function of the simulated bridge, and forwards the Ethernet frame sent by the CE via the AC to the appropriate PW and delivers it to the destination, thereby realizing mutual access between the LANs of different users.
  • the VPLS forwarding is performed between the PEs using the virtual switch instance (VSI).
  • the VSI implements the Ethernet bridging function and can terminate the PW.
  • Each VSI provides a separate VPLS service.
  • the PE In VPLS, the PE is based on the MAC address of the Media Access Control (MAC), or the MAC address and the virtual local area network (VLAN) to forward packets. To forward packets, the PE must be able to forward packets.
  • the destination MAC address is associated with the PW or the VC.
  • the PE also has the MAC address learning behavior. Each PE not only learns the MAC address of the Ethernet packet from the PW, but also learns the connected CE device. MAC address.
  • the PE establishes a MAC forwarding table by learning the source MAC address of the packet, learns the remote MAC address from the PW, and learns the MAC address of the local access from the AC.
  • the PE uses the destination MAC address to look up the MAC forwarding table to determine the forwarding path, that is, PW or AC.
  • the Ethernet packets for unknown unicast addresses, broadcast addresses, and multicast addresses are broadcast in the entire VPLS domain.
  • a common attack method in the PSN is MAC address spoofing attacks.
  • This type of attack uses the principle of the bridge device MAC address learning process.
  • the attack source continuously sends the MAC address carrying the counterfeit source MAC address, such as the fake gateway device, the dynamic host configuration protocol (DHCP) server, or the domain name system (DNS) server.
  • the address of the packet to illegally update the MAC forwarding table of the bridge device, affecting the forwarding behavior of the bridge device, causing serious degradation or even interruption of network service quality.
  • DHCP dynamic host configuration protocol
  • DNS domain name system
  • a MAC address can be statically configured to prevent MAC address spoofing attacks, but it needs to be in all PEs. Static configuration is performed on the network. Once the network topology changes, such as active/standby switchover or device migration, the entire network needs to be deployed and adjusted. The maintenance is difficult and the maintenance cost is high. Summary of the invention
  • the embodiment of the present invention provides a method for VC tag allocation and MAC address learning in a VPLS, a device and a system, which can construct a VPLS based on a service level, and perform MAC address learning based on a service level, thereby automatically identifying whether a MAC exists. Address spoofing attacks improve the security of the VPLS network.
  • the first aspect provides a method for a MAC to learn an address in a VPLS, where: the local PE receives the first packet from the first interface;
  • the MAC forwarding table of the local PE is queried according to the identifier of the first VSI and the source MAC address of the first text, where the MAC forwarding table includes a VSI identifier, a MAC address, an outbound interface identifier, and a MAC service level.
  • the first MAC forwarding entry that matches the source MAC address of the first packet and the source MAC address of the first packet a MAC service level, if the service level of the first sub-VSI is higher than or equal to the MAC service level of the first MAC forwarding entry, using the identifier of the first interface and the service of the first sub-VSI The level updates the outbound interface identifier and the MAC service level of the first MAC forwarding entry.
  • the method further includes: determining that a MAC address spoofing attack exists if the service level of the first sub-VSI is lower than a MAC service level of the first MAC forwarding entry.
  • the local PE is further configured to: send alarm information, record an attack log, attack source tracing, and block one or more processes in the attack.
  • the method further includes: when the local PE does not exist in the MAC forwarding table When the identifier of the first VSI and the source MAC address of the first packet match, the identifier of the first VSI, the source MAC address of the first text, the identifier of the first interface, and The correspondence between the service levels of the first sub-VSI is stored in the MAC forwarding table of the local PE.
  • the first packet includes a first VC label
  • the first interface is specifically a first VC.
  • the obtaining the identifier of the first VSI to which the first packet belongs and the service level of the first sub-VSI specifically include:
  • the service level of the identifier and the sub-VSI is used as the identifier of the first VSI to which the first packet belongs and the service level of the first sub-VSI.
  • the first interface is specifically a first AC;
  • Obtaining the identifier of the first VSI to which the first packet belongs and the service level of the first sub-VSI specifically include:
  • the query is performed according to the source MAC address of the first packet or the identifier of the first AC a terminal service level information table of the local PE, which acquires a VSI identifier and a sub-VSI of the entry in the terminal service level information table that matches the source MAC address of the first packet or the identifier of the first AC.
  • the service levels specifically include:
  • the terminal service level information table Querying the terminal service level information table according to the source MAC address of the first packet; the terminal identifier of the first terminal service level information entry in the terminal service level information table and the source MAC address of the first packet
  • the VSI identifier of the first terminal service level information entry and the service level of the sub-VSI are obtained; when the terminal identifier of any entry in the terminal service level information table is related to the first packet
  • the terminal service level information table is queried according to the identifier of the first AC, and the second terminal service with the same terminal identifier and the identifier of the first AC in the terminal service level information table is obtained.
  • the VSI identifier of the level information entry and the service level of the sub-VSI is
  • the method before receiving the first packet, the method further includes:
  • the local PE advertises the local sub-VSI of the first VSI to the remote PE, and obtains the VC identifier and the outgoing VC label allocated by the remote PE to the local sub-VSI;
  • the method before receiving the first packet, further includes: the local PE receiving the remote sub-VSI of the first VSI advertised by the remote PE;
  • the second aspect provides a method for allocating a VC label in a VPLS, including: a local operator edge PE notifying a local sub-VSI of the VSI to the remote PE;
  • the VSI, the service level of the local sub-VSI, and the correspondence between the VC identifier and the VC label allocated by the remote PE to the local sub-VSI are saved to the outbound label mapping table of the local PE.
  • the acquiring the VC identifier and the VC label that are allocated by the remote PE to the local sub-VSI includes:
  • LDP label mapping message Receiving a label distribution protocol LDP label mapping message sent by the remote PE, and obtaining, by the LDP label mapping message, a VC identifier and a VC label allocated by the remote PE to the local sub-VSI, where the LDP label mapping
  • the message includes an identifier of the VSI, a service level of the local sub-VSI, and a VC identifier and a VC label allocated by the remote sub-VSI.
  • the method further includes: the local PE receiving the remote end of the VSI advertised by the remote PE a sub-VSI; the local PE allocates a VC identifier and a VC label to the remote sub-VSI of the VSI to the remote PE;
  • the inbound label mapping table stores the identifier of the VSI, the service level of the remote sub-VSI, and the correspondence between the VC identifier and the VC label allocated by the remote PE to the remote sub-VSI of the VSI. .
  • the local PE notifying the remote PE of the local sub-VSI of the VSI specifically includes The local PE sends a first LDP label request message to the remote PE to advertise the local sub-VSI of the VSI, where the first LDP label request message includes the identifier of the VSI and the local sub -VSI service level.
  • the local PE advertises, to the remote PE, all local sub-VSIs of the VSI
  • the local PE sends a first LDP label mapping message to the remote PE to advertise the local sub-VSI of the VSI, where the first LDP label mapping message includes an identifier of the VSI, where the local The service level of the sub-VSI, the first VC identifier and the first VC label.
  • the local PE sends the first LDP label mapping message to the remote PE to advertise the VSI.
  • the method further includes:
  • the local PE allocates the first VC identifier and the first VC label to the local sub-VSI to the remote PE; the inbound label mapping table of the local PE saves the identifier and the location of the VSI A service level of the local sub-VSI, a correspondence between the first VC identifier and the first VC label.
  • a VC tag distribution apparatus including:
  • a transmitter configured to notify a remote carrier edge PE of a local sub-VSI of the VSI
  • an acquiring module configured to acquire, by the remote PE, a VC identifier and a VC label allocated by the local sub-VSI of the VSI, where Saving the mapping of the VSI, the service level of the local sub-VSI, and the mapping between the VC identifier and the VC label allocated by the remote PE to the local sub-VSI to the outbound label mapping of the local PE table.
  • the device further includes: a receiver, configured to receive, by the remote PE, a remote sub-VSI that advertises the VSI, and a label allocation module, configured to The remote PE allocates a VC identifier and a VC label to the remote sub-VSI.
  • the transmitter is configured to send an LDP label request message to the remote PE to advertise the VSI.
  • a local sub-VSI where the LDP label request message includes an identifier of the VSI and a service level of the local sub-VSI;
  • the receiver is further configured to receive an LDP label mapping message sent by the remote PE, where the LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, a first VC identifier, and a a VC tag;
  • the acquiring module is specifically configured to acquire the first VC identifier and the first VC label from the LDP label mapping message received by the receiver, and identify the VSI, the local sub-VSI The service level, the correspondence between the first VC identifier and the first VC label is saved to an outgoing label mapping table of the PE.
  • the transmitter is configured to send the first LDP label mapping message to the remote PE to advertise the VSI
  • the message includes the identifier of the VSI, the service level of the local sub-VSI, the first VC identifier, and the first VC label.
  • the receiver is further configured to receive a second LDP label mapping message sent by the remote PE, where the second LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, and a second a VC identifier and a second VC label;
  • the acquiring module is configured to obtain the second VC identifier and the second VC label from the second LDP label mapping message received by the receiver, and the identifier of the VSI, the local sub-VSI The correspondence between the service level, the second VC identifier, and the second VC label is saved to the outbound label mapping table of the PE.
  • the label distribution module is further configured to use the remote PE as the local sub-VSI of the VSI Corresponding relationship between the first VC identifier and the first VC label, and the service level, the first VC identifier, and the first VC label.
  • the device further includes a determining module, configured to use, according to the terminal service level information table of the PE, Determining the local sub-VSI of the VSI advertised to the remote PE.
  • a media access control MAC address learning device including: a receiver, configured to receive a first packet from a first interface;
  • a first acquiring module configured to obtain a source MAC address of the first packet, and an identifier of the first virtual switching instance VSI to which the first packet belongs and a service level of the first sub-virtual switching instance sub-VSI;
  • the querying module is configured to query a MAC forwarding table of the PE according to the identifier of the first VSI and the source MAC address of the first packet, where the MAC forwarding table includes a VSI Corresponding relationship between the identifier, the MAC address, the outbound interface identifier, and the MAC service level; the second obtaining module, configured to: when the MAC forwarding table of the PE exists, the identifier of the first VSI and the source of the first packet Obtaining a MAC service level of the first MAC forwarding entry when the MAC address matches the first MAC forwarding entry;
  • a determining module configured to determine whether the service level of the first sub-VSI obtained by the first acquiring module is higher than or equal to the MAC service of the first MAC forwarding entry obtained by the second acquiring module Grade
  • An update module configured to use an identifier of the first interface and the first sub-VSI when a service level of the first sub-VSI is higher than or equal to a MAC service level of the first MAC forwarding entry
  • the service level updates the outbound interface identifier and the MAC service level of the first MAC forwarding entry.
  • the device further includes: the attack determining module, configured to: when a service level of the first sub-VSI is lower than a MAC address of the first MAC forwarding entry At the service level, it is determined that there is a MAC address phishing attack;
  • An address storage module configured to: when the MAC forwarding table of the PE does not have an entry matching the source MAC address of the first VSI and the text, the first VSI, the first report The correspondence between the source MAC address of the text, the first interface, and the service level of the first sub-VSI is stored in the MAC forwarding table of the PE.
  • the first interface when the first packet includes a first virtual circuit VC label, the first interface Specifically, the first acquiring module is configured to: query the inbound label mapping table of the PE according to the first VC label, and obtain the VC label and the first label in the inbound label mapping table. a VSI identifier of a first label mapping entry matched by a VC tag and a service level of the sub-VSI, as the first packet to which the first packet belongs The identity of the VSI and the service level of the first sub-VSI.
  • the first acquiring module specifically Querying, according to the source MAC address of the first packet or the identifier of the first AC, a terminal service level information table of the local PE, and acquiring a terminal identifier and the first in the terminal service level information table.
  • the source MAC address of the packet or the VSI identifier of the entry matching the identifier of the first AC and the service level of the sub-VSI are used as the identifier of the first VSI and the first sub-VSI to which the first packet belongs. Service level.
  • the first acquiring module is configured to query the terminal according to the source MAC address of the first packet. a service level information table; when the terminal identifier of the first terminal service level information entry in the terminal service level information table is the same as the source MAC address of the first packet, obtaining the first terminal service level information entry The service level of the VSI identifier and the sub-VSI; when the terminal identifier of any entry in the terminal service level information table is different from the source MAC address of the first packet, according to the first AC The identifier is queried for the terminal service level information table, and the VSI identifier of the second terminal service level information entry and the service level of the sub-VSI are the same as the identifier of the first AC in the terminal service level information table.
  • the device further includes an attack processing module, configured to: when the attack determination module determines that a MAC exists When the address is spoofed, one or more types of processing are performed, such as sending alarms, recording attack logs, attacking the source, and blocking attacks.
  • an attack processing module configured to: when the attack determination module determines that a MAC exists When the address is spoofed, one or more types of processing are performed, such as sending alarms, recording attack logs, attacking the source, and blocking attacks.
  • the device further includes a VC establishing module,
  • the remote PEs allocate a VC identifier and a VC label to the sub-VSI of the first VSI based on the service level, and establish a VC.
  • the present invention provides a virtual private local area network service VPLS network, including at least two carrier edge PE devices, where the PE device includes any of the foregoing third aspect or the third aspect, or The device of any of the possible implementations of the fourth aspect or the fourth aspect.
  • a method, a device, and a system for learning a VC label allocation and a MAC address in a VPLS according to an embodiment of the present invention, by dividing a VSI into sub-VSIs of different service levels, and adding the terminal to different service level sub-VSIs, performing VC based on the service level Tag allocation, VC establishment, VPLS based on service level, and MAC address learning based on service level, which can automatically identify and prevent MAC address spoofing attacks and improve the security of VPLS networks.
  • FIG. 1 is a schematic diagram of a topology of a VPLS network according to an embodiment of the present invention
  • FIG. 3 is a flow chart of a method for allocating a VC label by using a DoD method according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a format of an LDP label request message according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of information interaction of a DoD mode advertisement service level and label allocation according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a format of an LDP label mapping message according to an embodiment of the present invention
  • FIG. 7 is a flow chart of a method for allocating a VC label by using a DU mode according to an embodiment of the present invention
  • FIG. 8 is a schematic diagram of information exchange of a DU mode advertisement service level and label allocation according to an embodiment of the present disclosure
  • 10a, 10b, and 10c are structural block diagrams of a VC tag distribution apparatus according to an embodiment of the present invention
  • Figure l la, l ib, 11c and l id are block diagrams of the MAC address learning device provided by the embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of hardware of a PE device according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram of a system of a VPLS network according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic diagram of a topology of a VPLS network according to an embodiment of the present invention.
  • User A has four sites (sites) distributed in different locations, each with a CE device, connected to the corresponding PE device through the AC, and interconnected into an emulated LAN to form a VPLS instance, corresponding to a VSI, for example, using VSI-A. VSI logo.
  • site B of the user B distributed in different locations becomes another emulated LAN, forming another VPLS instance, corresponding to a VSI, for example, using VSI-B as the VSI identifier.
  • a VSI is divided into sub-VSIs of different service levels, and the terminals in the VSI are divided into sub-VSIs of different service levels, and one sub-VSI is specifically identified by the VSI. And a sub-VSI service level to identify.
  • the service level of all the sub-VSIs of the VSI may be on one PE, or may be only the service level of some sub-VSIs, which corresponds to the service level of the terminals in the VSI accessing the PE.
  • a terminal service level information table is saved on each PE, and the terminal service level information is saved. The table includes the correspondence between the terminal identifier, the VSI identifier, and the service level of the sub-VSI.
  • the terminal service level information table is pre-configured on each PE.
  • the network service status may also be adjusted.
  • the terminal identifier may be a MAC address or an AC according to the manner in which the terminal service level is divided. Specifically, the manner in which the terminal service level is divided includes:
  • the service level is divided only by AC.
  • the terminal of the PE is divided into service levels by AC. All terminals under one or more ACs are a service level, and a sub-VSI is added by default.
  • the service level is divided only by the MAC address; that is, the terminal of the specified one or more MAC addresses is a service level, and the specified sub-VSI is added, which is more fine than the classification according to the AC.
  • the service level is divided by the AC and the MAC address; the terminal under the PE is divided into service levels by the AC, and all the terminals under one or more ACs are a service level, and a sub-VSI is added by default; The service level of the terminal or the MAC address of the terminal is added to the specified sub-VSI.
  • the VSI-A is divided into multiple service levels, and the terminal service level is divided into AC and MAC addresses.
  • the service level of AC3 connected to PE1 is set to 0, and sub-VSI 0 is added.
  • the terminal is added to sub-VSI 0 by default.
  • the service level of AC4 connected to PE2 is set to 5 and added to sub-VSI 5.
  • the terminals connected to AC4 are added to sub-VSI 5 by default.
  • the service levels of AC1 and AC2 connected to PE3 are added. Set 0 to join sub-VSI 0, so that the terminals connected to AC1 and AC2 are added to sub-VSI 0 by default.
  • the server with the MAC address of 0001-0203-0405 is assigned the service level of 10 and joins sub-VSI 10.
  • Set 5 join sub-VSI 5, so the terminal connected under AC 13 is added to sub-VSI 5 by default; set the service level of AC 11 connected to PE2 to 0, and add sub-VSI 0, so the terminal connected under AC 13 defaults.
  • the terminal service level information table of PE1 is shown in Table la
  • the terminal service level information table of PE2 is shown in Table 2a
  • the terminal service level information table of PE3 is shown in Table 3a.
  • VSI-A is divided into three sub-VSIs and has three sub-VSI service levels.
  • PE1 has only one sub-VSI service level of VSI-A, 0; PE2 only There is a service level of a sub-VSI of VSI-A, 5; and the service level of two sub-VSIs of VSI-A on PE3 are 0 and 10.
  • a low service level is represented by 0, and a larger value indicates a service, etc. The higher the level.
  • A indicates a low service level
  • F indicates a high service level, which is not limited by the present invention.
  • a sub-VSI with a low service level may be configured for each VSI by default on each PE, for example, a sub-VSI 0 with a service level of 0. For an AC or MAC address with no service level, the default is added. Low service level sub-VSI.
  • FIG. 2 is a flowchart of a method for allocating a VC label in a VPLS according to an embodiment of the present invention. As shown in FIG. 2, the method includes:
  • the local PE advertises the local sub-VSI of the VSI to the remote PE.
  • the local PE advertises the local sub-VSI of the VSI to the remote PE by using an LDP label request message or an LDP label mapping message.
  • the local PE may advertise the local sub-VSI of the VSI to the remote PE in the DoD manner; the local PE sends an LDP label request message to the remote PE, where the LDP label request message is included.
  • the identifier of the VSI and the service level of the local sub-VSI are two ways to assign labels based on the LDP protocol: downstream on demand (DoD) and downstream unsolicited (DU).
  • DoD downstream on demand
  • DU downstream unsolicited
  • the local The label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, and a corresponding VC identifier and an incoming VC label, where the incoming VC label refers to the VC label allocated by the local PE; Before the local PE sends the LDP label mapping message to the remote PE, the local PE allocates a corresponding VC identifier and an incoming VC label to the local sub-VSI.
  • the VC label assigned by the other PEs to the PE is called the outgoing VC label, and is stored in the outbound label mapping table of the PE.
  • the VC label allocated by the PE to other PEs is called The VC tag is saved in the inbound label mapping table of the PE. It can be understood that the VC tag or the VC tag is relatively speaking.
  • the local PE determines the local sub-VSI of the VSI that needs to be advertised to the remote PE according to the terminal service level information table of the local PE.
  • the VSI-A in the VPLS network shown in Figure 1 is used as an example.
  • the PE1 determines the local sub-VSI of the VSI-A that needs to be advertised to the remote PE according to the terminal service level information table of the PE1.
  • PE3 determines all local sub-VSIs of VSI-A that need to be advertised to the remote PE according to the terminal service level information table of PE3, as shown in Table 3a: -A and sub-VSI 0 identified by service level 0, and sub-VSI 10 identified by VSI-A and service level 10.
  • the local PE determines, according to the terminal service level information table of the local PE, the local sub-VSI of the VSI that needs to be advertised to the remote PE, and specifically includes: The local PE determines the local sub-VSI of the VSI that needs to be advertised to the remote PE according to the terminal service level information table and the outgoing label mapping table of the local PE.
  • PE3 first determines that sub-VSI 0 and sub-VSI 10 need to be advertised to PE1 according to the terminal service level information table of PE3, as shown in Table 3a, and then PE3 is based on The outgoing label mapping table of PE3 finds that PE1 has advertised sub-VSI 0 to PE3, that is, the outgoing label mapping of PE3.
  • the VC label assigned to sub-VSI 0 by PE1 is already stored in the table.
  • PE3 finally determines that the local sub-VSI to be advertised to PE1 has only sub-VSI 10.
  • PE3 first advertises sub-VSI 0 and sub-VSI 10 to PE1 in the DU mode, and saves the VC label allocated by PE3 for sub-VSI 0 and sub-VSI 10 in the outbound label mapping table of PE1, and then PE1 According to the terminal service level information table of the PE1, as shown in the table la, it is determined that the sub-VSI 0 needs to be advertised to the PE3, and according to the outbound label mapping table of the PE1, it is found that the VC label allocated by the PE3 for the sub-VSI 0 has been saved. PE1 finally determines that it is no longer necessary to advertise the local sub-VSI to PE3, that is, sub-VSI 0.
  • the remote PE receives the local sub-VSI of the VSI advertised by the local PE, and allocates the local sub-VSI to the local PE by using the first LDP label mapping message to the local PE.
  • a VC identifier and a first VC label where the first LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, the first VC identifier, and the first VC label, and Saving the correspondence between the first VC label and the local sub-VSI, that is, the correspondence between the first VC label, the identifier of the VSI, and the service level of the local sub-VSI to the remote end
  • the PE is entered into the label mapping table.
  • the inbound label mapping table includes the correspondence between the VC label, the VSI identifier, and the service level of the sub-VSI.
  • the local PE receives the first LDP label mapping message sent by the remote PE, where the first LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, The first VC identifier and the first VC label The first VC identifier and the first VC label are obtained from the first LDP label mapping message, and the corresponding relationship between the local sub-VSI and its corresponding VC identifier and the outgoing VC label is saved to The outbound label mapping table of the local PE, that is, the identifier of the VSI, the service level of the local sub-VSI, and the correspondence between the first VC identifier and the first VC label are saved to the local The outgoing label mapping table of the PE.
  • the label mapping table includes a VSI identifier, a service level of the sub-VSI, a corresponding relationship between the VC identifier and the outgoing VC label.
  • the local PE further performs the following 203 and 204, and receives the remote sub-VSI advertised by the remote PE, and allocates a VC label to the remote sub-VSI.
  • the local PE receives the remote sub-VSI of the VSI advertised by the remote PE.
  • the remote PE advertises the remote sub-VSI of the VSI to the PE, and the local PE sends the local sub-VSI of the VSI to the remote PE.
  • the remote PE advertises the remote sub-VSI of the VSI to the PE, and the local PE sends the local sub-VSI of the VSI to the remote PE.
  • the remote PE advertises the remote sub-VSI of the VSI to the PE, and the local PE sends the local sub-VSI of the VSI to the remote PE.
  • the local PE allocates a second VC identifier and a second VC label to the remote sub-VSI to the remote PE.
  • the local PE receives the remote sub-VSI of the VSI advertised by the remote PE, and sends a second LDP label mapping message to the remote PE, and allocates a second VC to the remote sub-VSI.
  • An identifier and a second VC label where the second LDP label mapping message includes an identifier of the VSI, a service level of the remote sub-VSI, the second VC identifier, and the second VC label;
  • Corresponding relationship between the remote sub-VSI and its corresponding incoming VC label that is, the correspondence between the second incoming VC label, the identifier of the VSI, and the service level of the remote sub-VSI is saved to
  • the local PE is entered into the label mapping table.
  • the order of executing 201-202, 203-204 is not limited, To perform synchronization, you can also execute 203-204 and then execute 201-202. All the PEs in the VPLS advertise the sub-VSI between each other. After the VC label is allocated, the VC is established according to the sub-VSI. That is, the VC is established for each VSI according to each service level, so that the VPLS is constructed based on the service level.
  • the VPLS service level feature can be set to enable the feature. Then, according to the technical solution provided by the present invention, the VPLS is constructed based on the service level. If the feature is disabled, the VPLS is constructed according to the VSI.
  • the service levels of the sub-VSI and the sub-VSI are not local or remote.
  • the sub-VSI of the VSI set on the local PE is used for convenience of description.
  • the service level of the sub-VSI is correspondingly referred to as the service level of the local sub-VSI and the local sub-VSI;
  • the service levels of the sub-VSI and sub-VSI of the VSI set on the remote PE are correspondingly referred to as far
  • the service level of the terminal sub-VSI and the remote sub-VSI With reference to FIG.
  • the sub-VSI set on each PE is consistent with the service level of the terminal division; the local sub-VSI and the remote sub-VSI may be the same or different; that is, the local sub-VSI The service level may be the same as or different from the service level of the remote sub-VSI.
  • FIG. 3 is a flowchart of a method for allocating a VC label based on a service level by using a DoD method according to an embodiment of the present disclosure, where the method includes:
  • the local PE sends an LDP label request message to the remote PE to advertise all the local sub-VSIs of the VSI, where the LDP label request message includes the identifier of the VSI and the service level of all the local sub-VSIs.
  • the local PE may have a service level of multiple local sub-VSIs of the VSI, and the local PE may carry the service level of all local sub-VSIs in an LDP label.
  • the LDP label request message may be sent only in one or part of the local sub-VSI.
  • the local PE carries the service level of all local sub-VSIs of the VSI in an LDP label request message to improve network performance and efficiency.
  • a new type-length-value (TLV), a service level TLV is used to carry the service level information of the sub-VSI in the LDP label request message, as shown in FIG. 4
  • the format of the LDP label request message is provided by the embodiment of the present invention.
  • the LDP message header, the label request message, and the forward equivalence class (FEC) TLV are the same as the normal LDP label request message.
  • the service level of the sub-VSI is advertised through the extended service level TLV. It can be understood that if multiple sub-VSIs are advertised through an LDP label request message, multiple service level TLVs are carried.
  • the receiving end ignores the TLV. Therefore, for a PE that does not support the technical solution of the present invention, the VC label allocation can still be completed, and a normal VPLS network is established.
  • the local PE determines, according to the terminal service level information table of the local PE, a local sub-VSI of the VSI that needs to be advertised to the remote PE.
  • the VSI-A in the VPLS network shown in Figure 1 is used as an example.
  • the PE1 determines the local sub-VSI of the VSI-A that needs to be advertised to the remote PE according to the terminal service level information table of the PE1.
  • PE3 determines all local sub-VSIs of VSI-A that need to be advertised to the remote PE according to the terminal service level information table of PE3, as shown in Table 3a: -A and sub-VSI 0 identified by service level 0, and sub-VSI 10 identified by VSI-A and service level 10.
  • the PE3 is used as the local PE, and the PE1 is used as the remote PE.
  • the PE3 sends an LDP label request message to the PE1.
  • FIG. 5 is a schematic diagram of information interaction between the DoD mode advertisement service level and label allocation according to an embodiment of the present invention.
  • the remote PE After receiving the LDP label request message, the remote PE sends an LDP label mapping message to the local PE, and responds to the LDP label request message to allocate a VC identifier to all local sub-VSIs of the VSI.
  • the LDP label mapping message includes an identifier of the VSI, a service level of all local sub-VSIs, and a corresponding VC identifier and a VC label;
  • FIG. 6 is a schematic diagram of a format of an LDP label mapping message according to an embodiment of the present invention, where a service level TLV is carried, which is used to carry service level information of a sub-VSI.
  • a forwarding equivalence class TLV and a tag TLV correspond to a service class TLV.
  • the remote PE allocates VC and VC labels for each local sub-VSI in all local sub-VSIs of the VSI, and saves the allocated VC label and local
  • the correspondence of the sub-VSI is in the inbound label mapping table of the remote PE. For example, the remote PE allocates a first VC identifier and a first VC label to a first local sub-VSI of all local sub-VSIs of the VSI, and the first VC label and the first local
  • the correspondence between the sub-VSI that is, the correspondence between the first VC label, the identifier of the VSI, and the service level of the first local sub-VSI is saved in the inbound label allocation table of the remote PE.
  • the remote PE After receiving the VC label allocated for all the local sub-VSIs of the VSI, the remote PE generates an LDP label mapping message, and sends the LDP label mapping message to the local PE, including the identifier of the VSI. , the service level of all local sub-VSIs and their corresponding VC identifiers and VC labels.
  • PE1 is sub-VSI 0, that is, VSI-A and service level 0, and VC2 and VC label 1024 are allocated; sub-VSI 10 , that is, VSI-A and service level 10, allocate VC3 and VC label 1027; and correspondence between VC label 1024, VSI-A and service level 0, and correspondence between VC label 1027, VSI-A and service level 10. , saved to the inbound label allocation table of PE1.
  • the PE1 sends an LDP label mapping message to the PE3, including the VSI-A, VC2, VC label 1024, and service level 0, VC3, VC label 1027, and service level 10. See the LDP label mapping message mapl3 shown in FIG.
  • the local PE receives the LDP label mapping message sent by the remote PE, and obtains a VC identifier and a VC label of all the local sub-VSIs of the VSI from the LDP label mapping message.
  • the identifier of the VSI, the service level of the local sub-VSI, and the corresponding relationship between the corresponding VC identifier and the outgoing VC label are saved to the outbound label mapping table of the local PE;
  • all the PEs in the VPLS advertise the sub-VSI between each other, and after the VC label is allocated, the VC is established according to the sub-VSI, that is, the VC is established for each VSI according to each service level.
  • Implement VPLS based on service level.
  • PE3 After receiving the LDP label mapping message map 13, PE3 obtains PE1 as the two local sub-VSIs: sub-VSI 0, that is, VSI-A and service level 0, and sub- The VSI 10, that is, the VSI-A and the service level 10, the assigned VC identifier and the VC label, that is, the VC identifier and the out VC label of the two local sub-VSIs are obtained from the LDP label mapping message map 13; specifically, the PE3 is The LDP label mapping message map 13 acquires VSI-A, VC2, label 1024, and service level 0, VC3, and Sign 1027 and service level 10; and save the correspondence between VSI-A, service level 0, VC2 and VC label 1024, and the correspondence between VSI-A, service level 10, VC3 and VC label 1027 to the outgoing label of PE3 In the allocation table.
  • VCs from PE3 to PE1 are respectively established for the two local sub-VSIs of the VSI-A.
  • VC2 corresponding to sub-VSI 0 and VC3 corresponding to sub-VSI 10 are used.
  • PE3 is used as the local PE and PE1 is used as the remote PE.
  • the process of assigning VC and VC labels to the VC1 to PE1 is established.
  • the PE2 allocates the VC identifier and the VC label as the remote PE, and establishes the VC from the PE3 to the PE2 direction, as shown by req32 and map23 in FIG.
  • PE1 is used as the local PE, and PE3 is configured as the remote PE to assign the VC identifier and the VC label.
  • the PE1 is set up to the PE in the direction of the PE3, as shown in Figure 5, reql3 and map31.
  • PE1 is the local PE and PE2 is the remote PE. Labels, set PE1 to PE2 direction VC, as shown in reql2 and map21 in Figure 5; PE2 acts as the local PE, and PE1 allocates the VC identifier and VC label as the remote PE, and establishes PE2 to PE1 direction VC, as shown in Figure 5, req21 and mapl2. As shown in Figure 5, req23 and map32, as shown in Figure 5, PE2 is used as the local PE, and PE3 is assigned as the remote PE to the VC and VC labels. For details, refer to the process of using the PE3 as the local PE and the PE1 as the remote PE in this embodiment, and details are not described herein.
  • the inbound label mapping table and the outbound label mapping table of each PE respectively store the corresponding sub-VSI entries of the VSI-A, as shown in the following tables; Table lb is the inbound label mapping table of PE1, and table lc is the PE1 Table 2b is the inbound label mapping table of PE2, Table 2b is the outbound label mapping table of PE2, Table 3b is the inbound label mapping table of PE3, and Table 3c is the outgoing label mapping table of PE3.
  • FIG. 7 is a flowchart of a method for allocating a VC label based on a service level by using a DU mode according to an embodiment of the present disclosure, where the method includes:
  • the local PE sends a first LDP label mapping message to the remote PE to notify the local sub-VSI of the VSI, where the first LDP label mapping message includes the identifier of the VSI, the service level of the local sub-VSI and Corresponding first VC identifier and first VC label;
  • the first VC identifier and the first VC label are VC identifiers and VC labels allocated by the local PE to the remote PE for the local sub-VSI.
  • the inbound label mapping table of the local PE stores the identifier of the VSI, the service level of the local sub-VSI, and the correspondence between the first VC identifier and the first VC label.
  • the service level information of the sub-VSI is carried in the first LDP label mapping message by using the newly defined service level TLV, as shown in FIG. 6.
  • the local PE determines, according to the terminal service level information table and the outgoing label mapping table of the local PE, the local sub-VSI of the VSI that needs to be advertised to the remote PE.
  • PE3 first determines that sub-VSI 0 and sub-VSI 10 need to be advertised to PE1 according to the terminal service level information table of PE3, as shown in Table 3a. Then, PE3 is based on PE3.
  • the outgoing label mapping table finds that PE1 has advertised sub-VSI 0 to PE3. That is, the outbound label mapping table of PE3 has saved the VC label allocated by PE1 for sub-VSI 0, and PE3 finally determines the local area to be advertised to PE1.
  • the sub-VSI is only sub-VSI 10.
  • PE3 first adopts DU mode to PE1.
  • the sub-VSI 0 and the sub-VSI 10 are advertised, and the VC label allocated by the PE3 for the sub-VSI 0 and the sub-VSI 10 is stored in the outbound label mapping table of the PE1, and then the PE1 is based on the terminal service level information table of the PE1, such as As shown in the following table, it is determined that the sub-VSI 0 needs to be advertised to the PE3. Then, according to the outbound label mapping table of the PE1, it is found that the VC label allocated by the PE3 for the sub-VSI 0 is saved, and the PE1 finally determines that the local sub is not required to be advertised to the PE3.
  • PE3 is used as the local PE
  • PE1 is used as the remote PE
  • PE3 is two local sub-VSIs of VSI-A.
  • PE1 allocates VC identifier and VC label; specifically, it is sub-VSI 0, that is, VSI-A and service level 0, and allocates VC6 and VC label 1026; for sub-VSI 10, that is, VSI-A and service level 10, VC7 is allocated. And VC tag 1027.
  • PE3 saves the correspondence between VC label 1026, VSI-A, and service level 0, and the correspondence between VC label 1027, VSI-A, and service level 10 to the inbound label allocation table of PE3.
  • PE3 sends a first LDP label mapping message to PE1, and advertises two sub-VSIs of VSI-A on PE3: sub-VSI 0 and sub-VSI 10, and VC6 and VC labels 1024 allocated for sub-VSI 0, which are sub - VSI 10 assigned VC7 and VC label 1027; the first LDP label mapping message includes VSI-A, VC6, VC label 1024 and service level 0, and VC7, VC label 1027 and service level 10, see map 31 in FIG.
  • FIG. 8 is a schematic diagram of information exchange of a DU mode notification service level and label allocation according to an embodiment of the present invention.
  • the remote PE After receiving the first LDP label mapping message sent by the local PE, the remote PE obtains, from the first LDP label mapping message, the local PE as the local sub- of the VSI.
  • the first VC identifier and the first VC label allocated by the VSI are saved, and the correspondence between the identifier of the VSI, the service level of the local sub-VSI, the first VC identifier, and the first VC label is saved to the remote PE.
  • Tag mapping table In this way, a VC from the remote PE to the local PE is established for the local sub-VSI.
  • the PE1 After receiving the first LDP label mapping message map31, the PE1 obtains the VC identifier and the VC label allocated by the two local sub-VSIs of the VSI-A to the PE1, and the VSI- A, the correspondence between the service level 0, the VC6, and the VC tag 1026, and the correspondence between the VSI-A, the service level 10, the VC7, and the VC tag 1027 are saved in the outbound label allocation table of the PE1.
  • the remote PE After receiving the first LDP label mapping message sent by the local PE, the remote PE sends a second LDP label mapping message to the local PE, and responds to the first LDP label mapping message.
  • the local sub-VSI of the VSI allocates a second VC identifier and a second VC label, where the second LDP label mapping message includes an identifier of the VSI, a service level of the sub-VSI, and a second VC identifier. And a second VC tag;
  • the remote PE after receiving the first LDP label mapping message, allocates a second VC identifier and a second VC label to the local sub-VSI of the VSI, and saves the second VC label and the Corresponding relationship between the local sub-VSI, that is, the correspondence between the second VC label, the identifier of the VSI, and the service level of the local sub-VSI, to the inbound label mapping table of the remote PE.
  • the remote PE generates a second LDP label mapping message, where the second LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, the second VC identifier, and the And transmitting, by the second VC label, the second LDP label mapping message to the local PE.
  • remote PE can execute 702 and 703 in parallel.
  • PE1 After receiving the first LDP label mapping message map31, PE1 allocates VC8 and VC label 1025 for sub-VSI 0, and allocates VC9 and VC label 1026 for sub-VSI 10; Label 1025, VSI-A and service level
  • the correspondence between 0, and the correspondence between VC tag 1026, VSI-A, and service level 10 are stored in the inbound label allocation table of PE1.
  • PE1 sends a second LDP label mapping message to PE3, as shown in map 31 of FIG. 8, which includes the VSI-A, VC8, VC label 1025, and service level 0, VC9, VC label 1026, and service level 10.
  • the local PE receives the second LDP label mapping message sent by the remote PE, and obtains, by using the second LDP label mapping message, the remote PE as the local sub-VSI of the VSI. Saving the second VC identifier and the second VC label, and saving the identifier of the VSI, the service level of the local sub-VSI, the correspondence between the second VC identifier, and the second VC label to the outgoing label of the local PE Mapping table
  • all the PEs in the VPLS advertise the sub-VSI between each other, and after the VC label is allocated, the VC is established according to the sub-VSI, that is, the VC is established for each VSI according to each service level.
  • Implement VPLS based on service level.
  • PE3 after receiving the second LDP label mapping message map31, PE3 obtains PE1 as the two local sub-VSIs: sub-VSI O, that is, VSI. -A and service level 0, and sub-VSI 10, that is, VSI-A and service level 10, the assigned VC identifier and VC label; specifically, PE3 obtains VSI-A, VC8 from the LDP label mapping message map31, Tag 1025 and service level 0, VC9, tag 1026, and service level 10; and the correspondence between VSI-A, service level 0, VC8, and VC tag 1025, and VSI-A, service level 10, VC9, and VC tag 1026 Correspondence is saved in the outbound label allocation table of PE3. In this way, VCs from PE3 to PE1 are established for the two local sub-VSIs of VSI-A.
  • PE3 is used as the local PE and PE1 is used as the remote PE.
  • the VC mode is allocated to the local sub-VSI of the PE3 in the DU mode to establish a bidirectional VC between the PE3 and the PE1.
  • the PE3 is used as the local PE
  • the PE2 is the remote PE.
  • the VC and the VC label are assigned to the local sub-VSI of the PE3, and the bidirectional VC between the PE3 and the PE1 is established.
  • the process is as shown in Figure 8 and map32.
  • the PE1 functions as the local PE and the PE2 functions as the remote PE.
  • the VC and the VC label are assigned to the local sub-VSI of PE1.
  • the process of establishing the bidirectional VC between PE1 and PE2 is as shown in the figure.
  • mapl2 and mapl2 are shown; PE2 is used as the local PE, and PE1 is used as the remote PE to allocate the VC identifier and the VC label, to allocate the VC label to the local sub-VSI of PE2, and establish a bidirectional VC between PE2 and PE1, as shown in Figure 8.
  • PE2 is used as the local PE
  • PE3 is the remote PE
  • the VC and the VC label are assigned to the local sub-VSI of PE2.
  • Map23 shown.
  • the PE3 sends the first LDP label mapping message to the PE1 to advertise the sub-VSI 0 and the sub-VSI 10, and the PE1 responds to the advertisement of the PE3 through the second LDP label mapping message;
  • the terminal service level information table and the outgoing label mapping table determine that the first LDP label mapping message advertisement sub-VSI 0 does not need to be sent to the PE3.
  • the inbound label mapping table and the outbound label mapping table of each PE respectively store the related sub-VSI entries of the VSI-A, as shown in the following tables;
  • Table lb is the inbound label mapping table of PE1
  • the table lc is PE1.
  • Table 2b is the inbound label mapping table of PE2, and Table 2c is the outbound label mapping table of PE2;
  • Table 3b is the inbound label mapping table of PE3, and Table 3c is the outgoing label mapping table of PE3.
  • the VC mode is allocated by using the DU mode, and the VC established between the PEs is symmetric.
  • the VC between the PEs is established faster, and the new sub-VSI is added more quickly and easily, but it wastes some.
  • VC tag After the PE performs VC label allocation according to the sub-VSI, establishes VC, and builds the VPLS based on the service level, the MAC address learning can be further performed based on the service level.
  • the embodiment of the invention provides a method for learning MAC address in VPLS, as shown in the figure.
  • the local PE receives the first packet from the first interface.
  • the first packet may be from the AC side or from the VC side.
  • the first interface is specifically the first
  • the obtaining the identifier of the first VSI and the service level of the first sub-VSI that the first packet belongs to include: querying the ingress label of the local PE according to the first VC label a mapping table of the VSI identifier and the sub-VSI of the first label mapping entry that matches the VC label and the first VC label in the inbound label mapping table, as the first packet belongs to the first packet.
  • the acquiring the identifier of the first VSI to which the first packet belongs and the service level of the first sub-VSI specifically include: according to the first report Querying the source MAC address of the text or the identifier of the first AC, querying the terminal service level information table of the local PE; the terminal service level information table includes the correspondence between the terminal identifier, the VSI identifier, and the service level of the sub-VSI
  • the terminal identifier includes a MAC address or an AC identifier, and the VSI identifier and the sub of the entry that matches the source identifier of the first text or the identifier of the first AC in the terminal service level information table.
  • the service level of the VSI is the identifier of the first VSI to which the first packet belongs and the service level of the first sub-VSI.
  • the PE device usually uses a port number, or a VLAN identifier and a port number to identify an AC.
  • the local PE is queried according to the source MAC address of the first packet or the identifier of the first AC.
  • the level specifically includes:
  • the terminal service level information table Querying the terminal service level information table according to the source MAC address of the first packet; the terminal identifier of the first terminal service level information entry in the terminal service level information table and the source MAC address of the first packet
  • the first terminal service is obtained.
  • a VSI identifier of the level information entry and a service level of the sub-VSI when the terminal identifier of any entry in the terminal service level information table is different from the source MAC address of the first packet, according to the The identifier of the first AC queries the terminal service level information table, and obtains a VSI identifier and a sub-VSI of the second terminal service level information entry in which the terminal identifier in the terminal service level information table is the same as the identifier of the first AC. Service level.
  • the MAC forwarding table of the local PE according to the identifier of the first VSI and the source MAC address of the first packet, where the MAC forwarding table includes a VSI identifier, a MAC address, an outbound interface identifier, and a MAC service level. Correspondence relationship;
  • the MAC forwarding table of the local PE does not have an entry that matches the identifier of the first VSI and the source MAC address of the first text, the identifier of the first VSI, the first The source MAC address of the packet, the identifier of the first interface, and the service level of the first sub-VSI are stored in the MAC forwarding table of the local PE; the MAC address learning process ends.
  • the local PE When learning the source MAC address of the first packet, the local PE saves the service level of the first sub-VSI as the MAC service level of the source MAC address to the MAC forwarding table of the local PE. In this way, during the subsequent MAC address learning process, it is determined whether the MAC address learning is abnormal according to the MAC service level to prevent MAC spoofing attacks.
  • the VSI identifier of the first MAC entry in the MAC forwarding table of the local PE is the same as the identifier of the first VSI, and the MAC address of the first MAC forwarding entry is related to the first
  • the MAC service level of the first MAC forwarding entry is obtained. 906: Determine whether a service level of the first sub-VSI is higher than or equal to a MAC service level of the first MAC forwarding entry.
  • the local PE determines that there is a MAC address spoofing attack, and does not refresh the first MAC forwarding entry.
  • the local PE considers that the MAC address learning abnormality performed according to the first packet is abnormal. A MAC address spoofing attack is performed. The MAC address forwarding table is not refreshed. The automatic identification and prevention of MAC address spoofing attacks are implemented, which improves the security of the VPLS network. Further, the local PE may perform: sending the alarm information, recording the attack log, attacking the source of the attack, and blocking the one or more processes in the attack; specifically, the local PE may perform the attack behavior according to the MAC address.
  • the inbound direction that is, the first interface that receives the first packet carrying the MAC address of the counterfeit source, determines the location of the MAC spoofing attack source, and traces the source of the MAC address spoofing attack; further, the local PE may be based on the spoofed MAC address. And discard all the attack packets received by the inbound direction of the MAC address spoofing attack, that is, the source MAC address is the packet of the spoofed MAC address, thereby blocking the attack traffic, isolating the attack source, and further improving the VPLS network. safety. It can be understood that each PE in the VPLS performs MAC address learning.
  • the MAC address spoofing attack packet sent by the attack source in the site will be blocked by the PE connected to the site. It is broken in the site and will not be transmitted to other PEs in the VPLS network to block the attack traffic and isolate the attack source.
  • the purpose is to further enhance the defense against MAC address spoofing attacks.
  • the local PE performs the method for allocating the VC label in the present invention as shown in FIG. 2, FIG. 3 or FIG. 7, and establishes a VC with the remote PE to construct a VPLS network based on the service level;
  • the local PE advertises the local sub-VSI of the first VSI to the remote PE, and obtains the VC identifier and the outgoing VC label allocated by the remote PE for the local sub-VSI;
  • the local PE receives the remote sub-VSI of the first VSI advertised by the remote PE; and allocates a VC identifier and an incoming VC label to the remote sub-VSI to the remote PE;
  • the inbound label mapping table of the PE saves the identifier of the first VSI, the service level of all the remote sub-VSIs, the VC identifier allocated by the local PE for the remote sub-VSI, and the VC into the VC The correspondence of the labels.
  • the method may further include: the local PE forwarding the first packet; specifically, the local PE acquires a destination MAC address of the first packet, and when the local PE sends a MAC forwarding table Obtaining an outbound interface identifier of the second MAC forwarding entry when the second MAC forwarding entry is matched with the identifier of the first VSI and the destination MAC address of the first packet; Querying the local PE according to the first VSI, the service level of the first sub-VSI, and the outbound interface identifier of the second MAC forwarding entry, when the interface corresponding to the outbound interface identifier of the MAC forwarding entry is a VC
  • the outgoing label mapping table obtains the outgoing VC label of the first packet, and then encapsulates and forwards the first packet; if the interface corresponding to the outbound interface identifier of the second MAC forwarding entry is AC, And forwarding, by the AC corresponding to the outbound interface identifier of the second MAC forwarding entry, the first packet.
  • the local PE forwards the first packet to the same VPLS, that is, all directly connected ports of the first VSI. It will not be forwarded to other PEs.
  • the first packet is a local user, that is, a broadcast message sent by the CE of the local PE
  • the local PE will be the same VPLS, that is, all other direct connections of the first VSI.
  • the port and all other PEs forward the first packet.
  • the destination MAC address of the first packet is a non-broadcast address, and the destination MAC address is not learned in the MAC forwarding table of the local PE, the local PE will broadcast the first Message.
  • the method for learning the MAC address in the VPLS provided by the embodiment of the present invention, after receiving the first packet from the first interface, the local PE first acquires the first VSI and the first sub-VSI to which the first packet belongs.
  • the MAC service level is used to update the outbound interface and the MAC service level of the first MAC forwarding entry with the first interface and the service level of the first sub-VSI; thereby automatically identifying and preventing the sub-VSI from the low service level. Message, phishing attack
  • the MAC address of the service level It can be understood that, in the embodiment of the present invention, the AC or MAC address of the important device such as the gateway device, the DHCP server, and the DNS server can be set to a high service level, and a sub-VSI with a high service level is established accordingly, thereby learning at the MAC address.
  • the MAC address spoofing attack can be automatically identified and prevented, and the network service quality is degraded or even interrupted due to the MAC address spoofing attack.
  • the embodiment of the invention provides a VC label distribution device, which is located in a PE device and used The method shown in FIG. 2, FIG. 3 or FIG. 4 of the present invention is implemented; as shown in FIG. 10a, the device may include:
  • the transmitter 1001 is configured to notify the remote PE of the local sub-VSI of the VSI.
  • the obtaining module 1002 is configured to obtain the VC identifier and the VC label allocated by the remote PE for the local sub-VSI of the VSI, and the identifier of the VSI, the service level of the local sub-VSI, and the The mapping between the VC identifier and the VC label allocated by the remote PE to the local sub-VSI is saved to the outbound label mapping table of the local PE;
  • the device may further include:
  • the receiver 1003 is configured to receive, by the remote PE, the remote sub-VSI of the VSI, and the label allocation module 1004, configured to allocate, by the remote PE, the VC identifier and the VC label to the remote sub-VSI. .
  • a VSI is divided into sub-VSIs (sub-VSIs) of different service levels, and terminals in the VSI are divided into sub-VSIs of different service levels, and one sub-VSI specifically passes through the VSI and a sub.
  • a PE may have a service level of all sub-VSIs of the VSI, or may only have a service level of a part of the sub-VSI, which corresponds to the service level of the terminal in the VSI that accesses the PE.
  • the terminal service level information table is stored on each PE, and the terminal service level information table includes a correspondence between the terminal identifier, the VSI, and the service level of the sub-VSI, and is usually pre-configured on each PE.
  • the service level information table on each PE can be found in Table la, Table 2a and Table 3a.
  • the apparatus may further include a determining module 1005, configured to determine, according to the terminal service level information table of the PE, a local sub-VSI of the VSI advertised to the remote PE.
  • the determining module 1005 is specifically configured to determine, according to the terminal service level information table and the outgoing label mapping table of the PE, the VSI that is advertised to the remote PE. Local sub-VSI. Specific reference As described in 201, it will not be described here.
  • the PE may advertise the local sub-VSI of the VSI to the remote PE in a DoD manner or a DU manner.
  • a new type-length-value (TLV), a service level TLV is used to carry the service level of the sub-VSI in the LDP label request message or the LDP label mapping message.
  • TLV a new type-length-value
  • FIG. 4 is a schematic diagram of a format of an LDP label request message according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a format of an LDP label mapping message according to an embodiment of the present invention. It can be understood that multiple service level TLVs can be carried in the LDP label request message or the LDP label mapping message to advertise multiple sub-VSIs of the VSI.
  • the transmitter 1001 is configured to send a first LDP label request message to the remote PE to notify the local sub-VSI of the VSI, where the first LDP label is requested.
  • the message includes an identifier of the VSI and a service level of the local sub-VSI.
  • the receiver 1003 is further configured to receive a first LDP label mapping message sent by the remote PE, where the first LDP label mapping message includes an identifier of the VSI, and a service level and a location of the local sub-VSI Describe the first VC identifier and the first VC label.
  • the obtaining module 1002 is specifically configured to acquire the first VC identifier and the first VC label from the first LDP label mapping message received by the receiver 1003, and use the identifier and the identifier of the VSI.
  • the service level of the local sub-VSI, the correspondence between the first VC identifier and the first VC label is saved to the outbound label mapping table of the PE.
  • the receiver 1003 is specifically configured to receive a second LDP label sent by the remote PE.
  • the request message, the second LDP label request message includes an identifier of the VSI and a service level of the remote sub-VSI.
  • the label distribution module 1004 is configured to allocate a second VC identifier and a second VC label to the remote sub-VSI of the VSI according to the second LDP label request message received by the receiver 1003. And saving the correspondence between the second VC label and the remote sub-VSI, that is, the second VC label, the identifier of the VSI, and the service level of the remote sub-VSI to the PE In the label mapping table.
  • the transmitter 1001 is further configured to send a second LDP label mapping message to the remote PE, and respond to the second LDP label request message, where the second LDP label mapping message includes the identifier of the VSI.
  • the service level of the remote sub-VSI, the second VC identifier, and the second VC label is further configured to send a second LDP label mapping message to the remote PE, and respond to the second LDP label request message, where the second LDP label mapping message includes the identifier of the VSI.
  • the service level of the remote sub-VSI, the second VC identifier, and the second VC label is further configured to send a second LDP label mapping message to the remote PE, and respond to the second LDP label request message, where the second LDP label mapping message includes the identifier of the VSI.
  • the service level of the remote sub-VSI, the second VC identifier, and the second VC label is further configured to send a second LDP label mapping message to the remote PE, and respond to the second LDP
  • the DoD mode is used for VC label allocation, and the VC is established.
  • the inbound label mapping table generated on each PE is shown in Tables lb, 2b, and 3b, and the label mapping table is displayed.
  • Tables lb, 2b, and 3b the label mapping table is displayed.
  • the table lc, 2c, and 3c refer to the method embodiment shown in FIG. 3, and details are not described herein again.
  • the transmitter 1001 is configured to send a first LDP label mapping message to the remote PE to advertise the local sub-VSI of the VSI, where the first LDP label mapping is performed.
  • the message includes the identifier of the VSI, the service level of the local sub-VSI, the first VC identifier, and the first VC label.
  • the label distribution module 1004 may be further configured to use the remote PE as the VSI.
  • the local sub-VSI allocates the first VC identifier and the first VC label, and saves the identifier of the VSI, the service level of the local sub-VSI, and the first VC label to the PE Into the label mapping table.
  • the receiver 1003 is further configured to receive a second LDP label mapping message sent by the remote PE, where the second LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, and a a second VC identifier and a second VC label.
  • the obtaining module 1002 is specifically configured to obtain the second LDP label mapping message received by the receiver 1003. Taking the second VC identifier and the second VC label of the local sub-VSI, and corresponding to the identifier of the VSI, the service level of the local sub-VSI, the second VC identifier, and the second VC label The relationship is saved to the outgoing label mapping table of the PE.
  • the receiver 1003 is specifically configured to receive a third LDP label mapping message sent by the remote PE, where the third LDP label mapping message includes an identifier of the VSI, and a service level of the remote sub-VSI a third VC identifier and a third VC label.
  • the obtaining module 1002 is further configured to obtain, by using the third LDP label mapping message, the third VC identifier that is allocated by the remote PE to the remote sub-VSI. And the third VC tag, and the correspondence between the identifier of the VSI, the service level of the remote sub-VSI, the third VC identifier, and the third VC label is saved to the outbound label mapping table of the PE.
  • the label allocation module 1004 is specifically configured to allocate a fourth VC identifier and a fourth VC label to the remote sub-VSI of the VSI, and the fourth VC label and the remote sub-VSI Corresponding relationship, that is, the fourth VC label, the identifier of the VSI, and the service level of the remote sub-VSI are saved in the inbound label mapping table of the PE.
  • the transmitter 1001 is further configured to send a fourth LDP label mapping message to the remote PE, in response to the third LDP label mapping message, where the fourth LDP label mapping message includes the VSI, the far The service of the terminal sub-VSI, the fourth VC identifier and the fourth VC label.
  • the VC label is allocated in the DU mode, and the VC is created.
  • the inbound label mapping table generated on each PE is shown in Tables lb, 2b' and 3b, respectively.
  • the label mapping table is shown in the table lc, 2c, and 3c, respectively.
  • the VPLS service level feature can be set when the VPLS is deployed. If the feature is enabled, the VPLS is built based on the service level according to the technical solution provided by the present invention. If the feature is disabled, the VPLS is configured according to the VSI.
  • the apparatus can also include a feature control module for enabling or disabling VPLS service level characteristics. It should be noted that the service level of the sub-VSI and the sub-VSI is not divided into the local and the remote. In the embodiment of the present invention, the sub-VSI of the VSI set on the PE, The service level of the sub-VSI and the sub-VSI are correspondingly referred to as the service level of the sub-VSI and the sub-VSI of the VSI. sub-VSI, the service level of the remote sub-VSI.
  • the PE by using the VC label distribution device, mutually announces the service level of the sub-VSI with the remote PE, allocates the VC label, and establishes the VC, so that the service level-based VPLS can be constructed.
  • the embodiment of the present invention provides a MAC address learning device, which is located in a PE device, and is used to implement the method shown in FIG. 9 of the present invention.
  • the device may include: a receiving module 1101, configured to An interface receives the first packet;
  • the first obtaining module 1102 is configured to obtain a source MAC address of the first packet, and an identifier of the first virtual switching instance VSI to which the first packet belongs and a service level of the first sub-virtual switching instance sub-VSI ;
  • the querying module 1103 is configured to query, according to the identifier of the first VSI and the source MAC address of the first packet, a MAC forwarding table of the PE, where the MAC forwarding table includes a VSI identifier, a MAC address, an outbound interface identifier, and Corresponding relationship of the MAC service level;
  • the second obtaining module 1104 is configured to: when the MAC forwarding table of the PE exists, the first MAC address that matches the identifier of the first VSI and the source MAC address of the first packet Obtaining a MAC service level of the first MAC forwarding entry when the item is published;
  • the determining module 1105 is configured to determine whether the service level of the first sub-VSI acquired by the first acquiring module 1102 is higher than or equal to the first MAC forwarding entry obtained by the second acquiring module 1104. MAC service level;
  • the updating module 1106 is configured to: when the service level of the first sub-VSI is higher than or equal to the MAC service level of the first MAC forwarding entry, use the label of the first interface Recognizing that the service level of the first sub-VSI updates an outbound interface identifier and a MAC service level of the first MAC forwarding entry.
  • the device may further include:
  • the attack determination module 1107 is configured to determine that there is a MAC address spoofing attack when the service level of the first sub-VSI is lower than the MAC service level of the first MAC forwarding entry.
  • the address storage module 1108 is configured to: when the MAC forwarding table of the PE does not have an entry that matches the identifier of the first VSI and the source MAC address of the first packet, the first VSI The identifier, the source MAC address of the first packet, the identifier of the first interface, and the service level of the first sub-VSI are stored in a MAC forwarding table of the PE.
  • the attack determination module 1107 determines that there is a MAC address spoofing attack, it indicates that the MAC address learning abnormality is performed according to the first packet, and the MAC address entry is not refreshed, thereby implementing a MAC address spoofing attack.
  • Automatic identification and prevention improve the security of the VPLS network.
  • the first acquiring module 1102 is specifically configured to query the PE according to the first VC label. And a service level of the VSI identifier and the sub-VSI of the first label mapping entry that matches the VC label and the first VC label in the inbound label mapping table, where the first packet belongs. The identity of the first VSI and the service level of the first sub-VSI.
  • the first acquiring module 1102 is configured to query the terminal of the PE according to the source MAC address of the first packet or the identifier of the first AC.
  • a service level information table where the terminal identifier in the terminal service level information table and the source MAC address of the first text or the identifier of the first AC are obtained.
  • the VSI identifier of the matched entry and the service level of the sub-VSI are used as the identifier of the first VSI to which the first packet belongs and the service level of the first sub-VSI;
  • the terminal service level information table includes the terminal identifier Correspondence between the VSI identifier and the service level of the sub-VSI, where the terminal identifier includes a MAC address or an AC identifier.
  • the first acquiring module 1102 is specifically configured to query the terminal service level information table according to the source MAC address of the first packet; when the first terminal service level in the terminal service level information table Obtaining the VSI identifier of the first terminal service level information entry and the service level of the sub-VSI when the terminal identifier of the information entry is the same as the source MAC address of the first packet; If the terminal identifier of any one of the entries is different from the source MAC address of the first packet, the terminal service level information table is queried according to the identifier of the first AC, and the terminal service level information table is obtained. The terminal identifies the VSI identifier of the second terminal service level information entry and the service level of the sub-VSI that are the same as the identifier of the first AC.
  • the PE may further include an attack processing module 1109, configured to send an alarm message, record an attack log, perform attack source tracing, and block when the attack determination module determines that 1107 has a MAC address spoofing attack.
  • an attack processing module 1109 configured to send an alarm message, record an attack log, perform attack source tracing, and block when the attack determination module determines that 1107 has a MAC address spoofing attack.
  • One or more treatments such as aggression.
  • the attack processing module 1109 is specifically configured to determine the inbound direction of the MAC address spoofing attack behavior, that is, the first interface of the first packet carrying the spoofing source MAC address, and determine the location of the MAC phishing attack source; According to the spoofed MAC address, all the attack packets received in the inbound direction of the MAC address spoofing attack are discarded, that is, the source MAC address is the packet of the spoofed MAC address, thereby blocking the attack traffic and isolating the attack source. .
  • the MAC address learning device of the PE performs attack processing after determining that there is a MAC address spoofing attack, and further improves the security of the VPLS network. It can be understood that each PE in the VPLS will perform MAC learning, if The PE is configured to block the attack.
  • the MAC address spoofing attack packets sent by the attack source in a certain site are blocked by the PEs connected to the site and are not transmitted to the VPLS network. Other PEs can block the attack traffic and isolate the attack source. This further enhances the defense against MAC address spoofing attacks.
  • the apparatus may further include a VC establishing module 1110, configured to allocate a VC identifier and a VC label to the sub-VSI of the first VSI based on a service level between the remote PEs, and build a service-based service.
  • VPLS of the level specifically, the VC establishing module 1110 may include each module in the VC label distribution apparatus shown in FIGS. 10a-10c of the present invention, for implementing the method shown in FIG. 2, FIG. 3 or FIG. 4 of the present invention. , will not repeat them here.
  • the device may further include a forwarding module, configured to forward the first packet, where the forwarding module is configured to obtain a destination MAC address of the first packet, where the local PE sends a MAC forwarding table.
  • the outgoing label mapping table obtains the outgoing VC label of the first packet, and then encapsulates and forwards the first packet; if the interface corresponding to the outbound interface identifier of the second MAC forwarding entry is AC, And forwarding, by the AC corresponding to the outbound interface identifier of the second MAC forwarding
  • the forwarding module is further configured to: if the first packet is a broadcast packet sent by the remote PE, forward the first packet to the same VPLS, that is, all the directly connected ports of the first VSI. If the first packet is a local user, that is, a broadcast message sent by the CE connected to the local PE, the same VPLS, that is, all other direct ports of the first VSI, and all others PE forwards the first report If the destination MAC address of the first packet is a non-broadcast address packet, and the destination MAC address is not learned in the MAC forwarding table of the PE, the first packet is broadcasted.
  • the MAC address learning apparatus can automatically identify and prevent sub-VSI from a low service level by constructing a VPLS based on a service level and determining whether the MAC learning is abnormal based on the service level during the MAC address learning process. Packet, phishing attack MAC address with high service level. It can be understood that, in the embodiment of the present invention, the AC or MAC address of the important device such as the gateway device, the DHCP server, and the DNS server can be set to a high service level, and a sub-VSI with a high service level is established accordingly, thereby learning at the MAC address.
  • FIG. 12 is a schematic diagram of a hardware structure of a carrier edge PE device according to an embodiment of the present invention.
  • the PE includes a processor 1201, a memory 1202, a communication interface 1203, and a bus 1204.
  • the 1201, the memory 1202, and the communication interface 1203 pass through the bus.
  • 1204 is interconnected; the bus 1204 may be an ISA bus, a PCI bus, or an EISA bus.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 12, but it does not mean that there is only one bus or one type of bus.
  • the memory 1202 is configured to store a program.
  • the program can include program code, the program code including computer operating instructions.
  • Memory 1202 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
  • the processor 1201 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP processor, etc.), or a digital signal processor (DSP), an application specific integrated circuit (ASIC). ), Ready-to-use programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP processor network processor
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGAs Ready-to-use programmable gate arrays
  • FPGAs programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • the processor 1201 executes the program code, and is used to notify the remote PE of the local sub-VSI of the VSI, obtain the VC identifier and the VC label allocated by the remote PE for the local sub-VSI, and The identifier, the service level of the local sub-VSI, and the correspondence between the VC identifier and the VC label allocated by the remote PE for the local sub-VSI are saved to the outbound label mapping table of the PE; The remote sub-VSI of the VSI advertised by the PE allocates a VC identifier and a VC label to the remote sub-VSI to the remote PE.
  • the communication interface 1203 is configured to communicate with devices in the network, including the remote PE, a user edge CE device that accesses the PE, and the like.
  • a VSI is divided into sub-VSIs (sub-VSIs) of different service levels, and terminals in the VSI are divided into sub-VSIs of different service levels, and one sub-VSI specifically passes through the VSI and a sub.
  • a PE may have a service level of all sub-VSIs of the VSI, or may only have a service level of a part of the sub-VSI, and each terminal stores a terminal service level information table, where the terminal service level information table includes a terminal identifier, a VSI, and
  • the correspondence between the service levels of the sub-VSI is usually pre-configured on each PE.
  • the service level information table on each PE can be referred to the table la, the table 2a and the table 3a.
  • the processor 1201 is further configured to determine, according to the terminal service level information table of the PE, all the local sub-VSIs of the VSI advertised to the remote PE.
  • the memory 1202 is further configured to save a terminal service level information table of the PE, and an inbound label mapping table and an outgoing label mapping table of the PE.
  • the processor 1201 When the label distribution is performed by using the DoD method, the processor 1201 is specifically used for the labeling
  • the remote PE sends a first LDP label request message to advertise the local sub-VSI of the VSI, where the first LDP label request message includes the identifier of the VSI and the service level of the local sub-VSI, and receives The first LDP label mapping message sent by the remote PE, the first LDP label mapping message includes an identifier of the VSI, a service level of the local sub-VSI, the first VC identifier, and the Obtaining, by the first VC label, the first VC identifier and the first VC label, and the identifier of the VSI, the service level of the local sub-VSI, the The corresponding relationship between the first VC identifier and the first VC label is saved to the outbound label mapping table of the PE; specifically, it is further configured to receive a second LDP label request message sent by the remote PE, where the second LDP label is The request message
  • the processor 1201 is configured to send a first LDP label mapping message to the remote PE to advertise the local sub-VSI of the VSI, where the first LDP label mapping message is used. And including the identifier of the VSI, the service level of the local sub-VSI, the first VC identifier, and the first VC label; and allocating the first VC to the local sub-VSI of the VSI to the remote PE And identifying the first VC label, and saving the identifier of the VSI, the service level of the local sub-VSI, and the first VC label into an inbound label mapping table of the PE; receiving the remote PE sending a second LDP label mapping message, where the second LDP label mapping message includes The identifier of the VSI, the service level of the local sub-VSI, the second VC identifier, and the second VC label, and the second VC identifier and the second of the local sub-VSI are obtained from the second LDP label mapping message.
  • the VC label is configured to save the identifier of the VSI, the service level of the local sub-VSI, the correspondence between the second VC identifier, and the second VC label to the outbound label mapping table of the PE; Receiving a third LDP label mapping message sent by the remote PE, the third LDP label mapping message includes an identifier of the VSI, a service level of the remote sub-VSI, a third VC identifier, and a third And obtaining, by the third LDP label mapping message, the third VC identifier and the third VC label that are allocated by the remote PE to the remote sub-VSI, and the identifier of the VSI, the far
  • the correspondence between the service level of the end sub-VSI, the third VC identifier, and the third VC label is saved to the outbound label mapping table of the PE; the fourth VC identifier and the fourth sub-VSI are allocated to the VSI.
  • a fourth VC tag and the fourth VC tag, the identifier of the VSI, and the service of the remote sub-VSI
  • the level is saved in the inbound label mapping table of the PE; the fourth LDP label mapping message is sent to the remote PE, and the fourth LDP label mapping message is included in the fourth LDP label mapping message.
  • the processor 1201 may be further configured to receive the first packet from the first interface, obtain the source MAC address of the first packet, and the first virtual switching instance VSI to which the first packet belongs. And the service level of the first sub-virtual exchange instance sub-VSI, the MAC forwarding table of the PE is queried according to the identifier of the first VSI and the source MAC address of the first packet, where the MAC forwarding table includes Corresponding relationship between the VSI identifier, the MAC address, the outbound interface identifier, and the MAC service level; when there is no table matching the identifier of the first VSI and the source MAC address of the first packet in the MAC forwarding table of the PE And storing, in the identifier, the identifier of the first VSI, the source MAC address of the first text, the identifier of the first interface, and the service level of the first sub-VSI In the MAC forwarding table of the PE, when the first MAC forwarding entry that matches the source MAC address
  • the memory 1202 is further configured to save a MAC forwarding table of the PE.
  • the processor 1201 is specifically configured to query the local PE according to the first VC label. a VSI identifier and a service level of the sub-VSI of the first label mapping entry that matches the first VC label in the inbound label mapping table, and the service level of the sub-VSI, where the first packet belongs. The identity of the first VSI and the service level of the first sub-VSI.
  • the processor 1201 is configured to query the terminal service level of the PE according to the source MAC address of the first packet or the identifier of the first AC.
  • the information table, the VSI identifier of the entry in the terminal service level information table and the source MAC address of the text or the identifier of the first AC, and the service level of the sub-VSI are obtained as the The identifier of the first VSI to which the packet belongs and the service level of the first sub-VSI;
  • the terminal service level information table includes the correspondence between the terminal identifier, the VSI identifier, and the service level of the sub-VSI, where the terminal identifier includes the MAC address. Or AC logo.
  • the processor 1201 Specifically, the terminal service level information table is queried according to the source MAC address of the first packet; and the terminal identifier of the first terminal service level information entry in the terminal service level information table is related to the first packet.
  • the source MAC address is the same
  • the VSI identifier of the first terminal service level information entry and the service level of the sub-VSI are obtained; when the terminal identifier of any entry in the terminal service level information table is the first
  • the terminal service level information table is queried according to the identifier of the first AC, and the terminal identifier in the terminal service level information table is the same as the identifier of the first AC.
  • the VSI identifier of the second terminal service level information entry and the service level of the sub-VSI is queried according to the source MAC address of the first packet; and the terminal identifier of the first terminal service level information entry in the terminal service level information table is related to the first packet.
  • the processor 1201 may be further configured to perform one or more processes of sending an alarm information, recording an attack log, performing an attack source tracing, and a blocking attack when determining that a MAC address spoofing attack exists.
  • the processor 1201 is specifically configured to perform the inbound direction of the MAC address spoofing attack behavior, that is, the first interface that receives the first packet carrying the spoofing source MAC address, and determine the location of the MAC spoofing attack source; MAC address, discards all attack packets received by the inbound direction of the MAC address spoofing attack, that is, the source MAC address is the packet of the spoofed MAC address, thereby blocking the attack traffic and isolating the attack source. Security of the VPLS network.
  • the PE provided by the embodiment of the present invention can construct a VPLS based on the service level, and perform MAC address learning in the service level-based VPLS to implement automatic identification and prevention of MAC address spoofing attacks, thereby avoiding degradation of network service quality due to MAC address spoofing attacks. Interrupted.
  • FIG. 13 is a schematic diagram of a system of a VPLS network according to an embodiment of the present invention.
  • the VPLS network includes at least two PE devices, and the PE device includes FIG. 10a-10c and FIG. -lle and the apparatus shown in Fig. 12, it is possible to implement service level based VC label allocation and MAC address learning.
  • the embodiment of the present invention mainly adopts the LDP protocol as the PW letter.
  • the Martini VPLS scenario of the protocol is used to describe how to construct VPLS and MAC address learning based on the service level, so as to implement automatic identification and prevention of MAC address spoofing attacks.
  • Those skilled in the art can understand that the technical solution of the present invention is in the Kompella mode VPLS scenario.
  • the BGP protocol Through the appropriate extension of the BGP protocol, its implementation principle and process are similar.

Abstract

本发明实施例公开了一种VPLS中VC标签分配和MAC地址学习的方法,设备和系统;通过将VSI划分为不同服务等级的子VSI,并将终端加入不同服务等级子VSI中,基于服务等级进行VC标签分配,构建VPLS,并基于服务等级进行MAC地址学习,可以自动识别并防止MAC地址仿冒攻击。

Description

VPLS中 VC标签分配和 MAC地址学习的方法, 设备和系统 技术领域
本发明实施例涉及计算机通信领域, 尤其涉及一种 VPLS中 ( Virtual Circuit, 简称 VC )标签分配和介质访问控制( Media Access Control, 简称 MAC )地址学习的方法, 设备和系统。 背景技术
虚拟专用局域网 ( local area network, 简称 LAN )业务( virtual private LAN service, 简称 VPLS )是一种基于网际协议 ( Internet
Protocol, 简称 IP ) /多协议标签交换 ( multi-protocol label switching, 简称 MPLS )和以太网技术的二层虚拟专用网 ( layer 2 virtual private network, 简称 L2VPN )技术, 能够在 IP/MPLS网络上提供类似于 LAN 服务的业务。 VPLS可以使用户分布于不同位置的站点(site )通过分 组交换网络( packet swith network, 简称 PSN )相连, 并且使各个站 点像在一个 LAN那样工作。 不同于普通 L2VPN的点到点业务, VPLS 支持点到点、 点到多点、 多点到多点的业务类型。
一个 VPLS中的运营商边缘 ( rovider edge, PE )设备是全连接的, 即彼此之间存在伪线(psedo wire, 简称 PW ), PW是两个 PE 间的虚 拟连接, 在两个 PE之间传输帧, 建立、 维护和拆除 PW的工作由 PE 利用 PW信令协议完成, 分为利用标签分发协议 ( label distribution protocol, 简称 LDP )作为 PW信令协议的 Martini方式 VPLS, 和利用边 界网关协议 ( border gateway protocol, 简称 BGP )作为 PW信令协议 的 Kompella方式 VPLS两种。 一条 PW通常由一对反向虚电路 ( Virtual Circuit, 简称 VC )组成, VC是两个 PE之间的一种单向逻辑连接, 在 一些应用中一个 VC 也可作为单向 PW使用。 用户边缘(customer edge, 简称 CE )设备通过接入线路(Attachment Circuit, 简称 AC ) 接入到 PE, AC 用于 CE 和 PE之间传输帧, 可以是物理链路, 也可 以是逻辑链路。 PE承担仿真网桥的功能, 将 CE经由 AC送入的以太网 帧转发至适当的 PW, 送达目的地, 由此实现用户不同位置的局域网 间的相互访问。 PE间使用虚拟交换实例(virtual switch instance, 简称 VSI )进行 VPLS转发; VSI 实现以太桥接功能, 并能够终结 PW, 每 个 VSI提供单独的 VPLS 服务。
在 VPLS中, PE基于介质访问控制 (Media Access Control, 简称 MAC ) MAC 地址, 或者 MAC 地址和虚拟局域网 ( virtual local area network, 简称 VLAN ) 标识转发报文; 为了能转发报文, PE必须能 够将目的 MAC地址与 PW或 VC进行关联; 和桥设备相同, PE同样存 在 MAC地址学习行为, 每个 PE不但要学习从 PW来的以太网报文的 MAC地址, 也要学习所连接的 CE设备来的 MAC地址。 PE通过报文源 MAC地址学习的方法建立 MAC转发表, 从 PW学习远端 MAC地址, 从 AC学习本地接入的 MAC地址。转发时, PE使用目的 MAC地址查找 MAC转发表确定转发路径, 即 PW或 AC; 而对于未知单播地址、 广播 地址和组播地址的以太网报文, 将在整个 VPLS域内进行广播。
PSN中一种常见的攻击方式是 MAC地址仿冒攻击,这类攻击利用 桥设备 MAC地址学习过程的原理。 攻击源通过不断发送携带仿冒的 源 MAC地址, 例如仿冒网关设备, 动态主机配置协议( dynamic host configuration protocol,简称 DHCP )月良务器,或域名系统 ( domain name system, 简称 DNS ) 服务器等的 MAC地址的报文, 来非法更新桥设 备的 MAC转发表, 影响桥设备的转发行为, 引起网络服务质量严重 下降甚至中断。 目前在 VPLS中, 可以针对重要 MAC地址, 采用静态 配置 MAC地址的方式来防止 MAC地址仿冒攻击, 但是需要在所有 PE 上都进行静态配置, 一旦网络拓朴发送变化, 例如主备切换或者设备 迁移, 则需要整网都进行部署调整, 维护难度大且维护成本高。 发明内容
有鉴于此,本发明实施例提供了一种 VPLS中 VC标签分配和 MAC 地址学习的方法, 设备和系统, 可以基于服务等级构建 VPLS, 基于 服务等级进行 MAC地址学习, 从而可以自动识别是否存在 MAC地址 仿冒攻击, 提高了 VPLS网络的安全性。
第一方面, 提供了一种 VPLS中 MAC学习地址的方法, 包括: 本地 PE从第一接口接收第一报文;
获取所述第一报文的源 MAC地址, 以及所述第一报文所属的第 一虚拟交换实例 VSI的标识和第一子虚拟交换实例 sub-VSI的服务等 级;
才艮据所述第一 VSI的标识和所述第一 文的源 MAC地址查询所 述本地 PE的 MAC转发表, 所述 MAC转发表包括 VSI标识, MAC 地址, 出接口标识和 MAC服务等级的对应关系;
当所述本地 PE的 MAC转发表中存在与所述第一 VSI的标识和 所述第一报文的源 MAC地址匹配的第一 MAC转发表项时, 获取所 述第一 MAC转发表项的 MAC服务等级, 若所述第一 sub-VSI的服 务等级高于或等于所述第一 MAC转发表项的 MAC服务等级, 用所 述第一接口的标识及所述第一 sub-VSI 的服务等级更新所述第一 MAC转发表项的出接口标识和 MAC服务等级。
在第一方面的第一种可能实现方式中, 还包括: 若所述第一 sub-VSI的服务等级低于所述第一 MAC转发表项的 MAC服务等级, 判定存在 MAC地址仿冒攻击。
结合第一方面的第一种可能实现方式,在第一方面的第二种可能 实现方式中, 还包括所述本地 PE执行: 发送告警信息, 记录攻击日 志, 攻击溯源, 阻断攻击中的一种或多种处理。
结合第一方面或第一方面的第一种或第二种可能实现方式,在第 一方面的第三种可能实现方式中, 还包括: 当所述本地 PE的 MAC 转发表中不存在与所述第一 VSI的标识和所述第一报文的源 MAC地 址匹配的表项时, 将所述第一 VSI的标识、 所述第一 文的源 MAC 地址、 所述第一接口的标识及所述第一 sub-VSI的服务等级的对应关 系存入所述本地 PE的 MAC转发表中。
结合第一方面或第一方面的第一种或第二种或第三种可能实现 方式, 在第一方面的第四种可能实现方式中, 所述第一报文中包括第 一 VC标签, 所述第一接口具体为第一 VC; 所述获取所述第一报文 所属的第一 VSI的标识和第一 sub-VSI的服务等级具体包括:
根据所述第一 VC标签, 查询所述本地 PE的入标签映射表; 获 取所述本地 PE的入标签映射表中入 VC标签与所述第一 VC标签匹 配的第一标签映射表项的 VSI标识和 sub-VSI的服务等级,作为所述 第一报文所属的第一 VSI的标识和第一 sub-VSI的服务等级。
结合第一方面或第一方面的第一种或第二种或第三种可能实现 方式, 在第一方面的第五种可能实现方式中, 所述第一接口具体为第 一 AC;所述获取所述第一报文所属的第一 VSI的标识和第一 sub-VSI 的服务等级具体包括:
根据所述第一报文的源 MAC地址或者所述第一 AC的标识, 查 询所述本地 PE的终端服务等级信息表, 所述终端服务等级信息表中 包括终端标识、 VSI标识和 sub-VSI的服务等级的对应关系; 获取所 述终端服务等级信息表中终端标识与所述第一报文的源 MAC地址或 者所述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI的服务等级, 作为所述第一报文所属的第一 VSI的标识和第一 sub-VSI的服务等 级。
结合第一方面的第五种可能实现方式,在第一方面的第六种可能 实现方式中, 所述根据所述第一报文的源 MAC 地址或者所述第一 AC的标识, 查询所述本地 PE的终端服务等级信息表, 获取所述终 端服务等级信息表中终端标识与所述第一报文的源 MAC地址或者所 述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI的服务等级具体 包括:
根据所述第一报文的源 MAC 地址查询所述终端服务等级信息 表; 当所述终端服务等级信息表中第一终端服务等级信息表项的终端 标识与所述第一报文的源 MAC地址相同时, 获取所述第一终端服务 等级信息表项的 VSI标识和 sub-VSI的服务等级; 当所述终端服务等 级信息表中任一表项的终端标识与所述第一报文的源 MAC地址均不 相同时, 根据所述第一 AC的标识查询所述终端服务等级信息表, 获 取所述终端服务等级信息表中终端标识与所述第一 AC的标识相同的 第二终端服务等级信息表项的 VSI标识和 sub-VSI的服务等级。
结合第一方面或第一方面的上述任一种可能实现方式,在第一方 面的第七种可能实现方式中, 在接收第一报文之前, 还包括:
所述本地 PE向远端 PE通告所述第一 VSI的本地 sub-VSI; 获取所述远端 PE为所述本地 sub-VSI分配的所述 VC标识和出 VC标签;
将所述第一 VSI的标识、 所述本地 sub-VSI的服务等级、 所述远 端 PE为所述本地 sub-VSI分配的所述 VC标识和所述出 VC标签的 对应关系保存到所述本地 PE的出标签映射表。
结合第一方面或第一方面的上述任一种可能实现方式,在第一方 面的第八种可能实现方式中, 在接收第一报文之前, 还包括: 所述本地 PE接收所述远端 PE 通告的所述第一 VSI 的远端 sub-VSI;
向所述远端 PE为所述远端 sub-VSI分配 VC标识和入 VC标签; 在所述本地 PE的入标签映射表保存所述第一 VSI的标识、 所述 所有远端 sub-VSI的服务等级、 所述本地 PE为所述远端 sub-VSI分 配的所述 VC标识和所述入 VC标签的对应关系。 第二方面, 提供了一种 VPLS中 VC标签分配的方法, 包括: 本地运营商边缘 PE向远端 PE通告 VSI的本地 sub-VSI;
获取所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标 签;
将所述 VSI、 所述本地 sub-VSI的服务等级、 所述远端 PE为所 述本地 sub-VSI分配的 VC标识和 VC标签的对应关系保存到所述本 地 PE的出标签映射表。
在第二方面的第一种可能实现方式中, 所述获取所述远端 PE为 所述本地 sub-VSI分配的 VC标识和 VC标签具体包括:
接收所述远端 PE发送的标签分发协议 LDP标签映射消息,从所 述 LDP标签映射消息中获取所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签,所述 LDP标签映射消息中包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 所述远端 PE为所述本地 sub-VSI分 配的 VC标识和 VC标签。
结合第二方面或第二方面的第一种可能实现方式,在第二方面的 第二种可能实现方式中, 还包括: 所述本地 PE接收所述远端 PE通 告的所述 VSI的远端 sub-VSI; 所述本地 PE向所述远端 PE为所述 VSI的所述远端 sub-VSI分配 VC标识和 VC标签; 在所述本地 PE 的入标签映射表保存所述 VSI的标识、所述远端 sub-VSI的服务等级、 所述远端 PE为所述 VSI的所述远端 sub-VSI分配的 VC标识和 VC 标签的对应关系。
结合第二方面或第二方面的第一种或第二种可能实现方式,在第 二方面的第三种可能实现方式中, 所述本地 PE向远端 PE通告 VSI 的本地 sub-VSI具体包括:所述本地 PE向所述远端 PE发送第一 LDP 标签请求消息通告所述 VSI的所述本地 sub-VSI,所述第一 LDP标签 请求消息中包括所述 VSI的标识和所述本地 sub-VSI的服务等级。
结合第二方面或第二方面的第一种或第二种可能实现方式,在第 二方面的第四种可能实现方式中, 所述本地 PE向远端 PE通告 VSI 的所有本地 sub-VSI具体包括:所述本地 PE向所述远端 PE发送第一 LDP标签映射消息通告所述 VSI的所述本地 sub-VSI,所述第一 LDP 标签映射消息中包括所述 VSI的标识,所述本地 sub-VSI的服务等级, 第一 VC标识和第一 VC标签。
结合第二方面的第四种可能实现方式,在第二方面的第五种可能 实现方式中, 在所述本地 PE向所述远端 PE发送所述第一 LDP标签 映射消息通告所述 VSI的所述本地 sub-VSI之前, 还包括:
所述本地 PE向所述远端 PE为所述本地 sub-VSI分配所述第一 VC标识和所述第一 VC标签; 在所述本地 PE的入标签映射表保存 所述 VSI的标识、 所述本地 sub-VSI的服务等级、 所述第一 VC标识 和所述第一 VC标签的对应关系。
结合第二方面或第二方面的任一种可能实现方式,在第二方面的 第六种可能实现方式中, 在所述本地 PE向远端 PE通告 VSI的所有 本地 sub-VSI之前,还包括: 所述本地 PE根据所述本地 PE的终端服 务等级信息表确定向所述远端 PE 通告的所述 VSI 的所述本地 sub-VSI。 第三方面, 提供了一种 VC标签分配装置, 包括:
发送器, 用于向远端运营商边缘 PE通告 VSI的本地 sub-VSI; 获取模块,用于获取所述远端 PE为所述 VSI的所述本地 sub-VSI 分配的 VC标识和 VC标签, 将所述 VSI的标识、 所述本地 sub-VSI 的服务等级, 及所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签的对应关系保存到所述本地 PE的出标签映射表。
在第三方面的第一种可能实现方式中, 所述装置还包括: 接收器, 用于接收所述远端 PE通告所述 VSI的远端 sub-VSI; 标签分配模块,用于向所述远端 PE为所述远端 sub-VSI分配 VC 标识和 VC标签。
结合第三方面的第一种可能实现方式,在第三方面的第二种可能 实现方式中, 所述发送器, 具体用于向所述远端 PE发送 LDP标签请 求消息通告所述 VSI的所述本地 sub-VSI,所述 LDP标签请求消息中 包括所述 VSI的标识和所述本地 sub-VSI的服务等级;
所述接收器,还用于接收所述远端 PE发送的 LDP标签映射消息, 所述 LDP标签映射消息包括所述 VSI的标识, 所述本地 sub-VSI的 服务等级, 第一 VC标识和第一 VC标签;
所述获取模块具体用于从所述接收器接收的所述 LDP标签映射 消息中获取所述第一 VC标识和所述第一 VC标签, 并将所述 VSI的 标识、 所述本地 sub-VSI的服务等级、 所述第一 VC标识和所述第一 VC标签的对应关系保存到所述 PE的出标签映射表。
结合第三方面的第一种可能实现方式,在第三方面的第三种可能 实现方式中, 所述发送器, 具体用于向所述远端 PE发送第一 LDP标 签映射消息通告所述 VSI的所述本地 sub-VSI,所述第一 LDP标签映 射消息中包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 第一 VC标识和第一 VC标签;
所述接收器,还用于接收所述远端 PE发送的第二 LDP标签映射 消息, 所述第二 LDP标签映射消息包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 第二 VC标识和第二 VC标签;
所述获取模块, 具体用于从所述接收器接收的所述第二 LDP标 签映射消息中获取所述第二 VC标识和第二 VC标签,将所述 VSI的 标识, 所述本地 sub-VSI的服务等级、 第二 VC标识和第二 VC标签 的对应关系保存到所述 PE的出标签映射表。
结合第三方面的第三种可能实现方式,在第三方面的第四种可能 实现方式中, 所述标签分配模块还用于向所述远端 PE为所述 VSI的 所述本地 sub-VSI分别所述第一 VC标识和所述第一 VC标签, 并在 的服务等级、 所述第一 VC标识和所述第一 VC标签的对应关系。
结合第三方面或第三方面的任一种可能实现方式,在第三方面的 第五种可能实现方式中, 所述装置还包括确定模块, 用于根据所述 PE的终端服务等级信息表, 确定向所述远端 PE通告的所述 VSI的 所述本地 sub-VSI。 第四方面,提供了一种介质访问控制 MAC地址学习装置, 包括: 接收器, 用于从第一接口接收第一报文;
第一获取模块, 用于获取所述第一报文的源 MAC地址, 以及所 述第一报文所属的第一虚拟交换实例 VSI的标识和第一子虚拟交换实 例 sub-VSI的服务等级;
所述查询模块,用于根据所述第一 VSI的标识和所述第一报文的 源 MAC地址查询 PE的 MAC转发表, 所述 MAC转发表包括 VSI 标识, MAC地址, 出接口标识和 MAC服务等级的对应关系; 第二获取模块, 用于当所述 PE的 MAC转发表中存在与所述第 一 VSI的标识和所述第一报文的源 MAC地址匹配的第一 MAC转发 表项时, 获取所述第一 MAC转发表项的 MAC服务等级;
判断模块, 用于判断所述第一获取模块中获取的所述第一 sub-VSI的服务等级是否高于或等于所述第二获取模块中获取的所述 第一 MAC转发表项的 MAC服务等级;
更新模块, 用于当所述第一 sub-VSI的服务等级高于或等于所述 第一 MAC转发表项的 MAC服务等级时, 用所述第一接口的标识及 所述第一 sub-VSI的服务等级更新所述第一 MAC转发表项的出接口 标识和 MAC服务等级。
在第四方面的第一种可能实现方式中, 所述装置还包括: 所述攻击判定模块, 用于当所述第一 sub-VSI的服务等级低于所 述第一 MAC转发表项的 MAC服务等级时, 判定存在 MAC地址仿 冒攻击;
地址存储模块, 用于当所述 PE的 MAC转发表中不存在与所述 第一 VSI和所述第 文的源 MAC地址匹配的表项时,将所述第一 VSI、所述第一报文的源 MAC地址、所述第一接口及所述第一 sub-VSI 的服务等级的对应关系存入所述 PE的 MAC转发表中。
结合第四方面或第四方面的第一种可能实现方式,在第四方面的 第二种可能实现方式中, 当所述第一报文中包括第一虚拟电路 VC标 签, 所述第一接口具体为第一 VC时, 所述第一获取模块, 具体用于 根据所述第一 VC标签, 查询所述 PE的入标签映射表, 获取所述入 标签映射表中入 VC标签与所述第一 VC标签匹配的第一标签映射表 项的 VSI标识和 sub-VSI的服务等级,作为所述第一报文所属的第一 VSI的标识和第一 sub-VSI的服务等级。
结合第四方面或第四方面的第一种可能实现方式,在第四方面的 第三种可能实现方式中, 当所述第一接口具体为第一 AC时, 所述第 一获取模块, 具体用于根据所述第一报文的源 MAC地址或者所述第 一 AC的标识, 查询所述本地 PE的终端服务等级信息表, 获取所述 终端服务等级信息表中终端标识与所述第一报文的源 MAC地址或者 所述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI的服务等级, 作为所述第一报文所属的第一 VSI的标识和第一 sub-VSI的服务等 级。
结合第四方面的第三种可能实现方式,在第四方面的第四种可能 实现方式中, 所述第一获取模块, 具体用于根据所述第一报文的源 MAC地址查询所述终端服务等级信息表; 当所述终端服务等级信息 表中第一终端服务等级信息表项的终端标识与所述第一报文的源 MAC地址相同时, 获取所述第一终端服务等级信息表项的 VSI标识 和 sub-VSI的服务等级; 当所述终端服务等级信息表中任一表项的终 端标识与所述第一报文的源 MAC 地址均不相同时, 根据所述第一 AC的标识查询所述终端服务等级信息表, 获取所述终端服务等级信 息表中终端标识与所述第一 AC的标识相同的第二终端服务等级信息 表项的 VSI标识和 sub-VSI的服务等级。
结合第四方面或第四方面的上述任一种可能实现方式,在第四方 面的第五种可能实现方式中, 所述装置还包括攻击处理模块, 用于当 所述攻击判定模块判定存在 MAC地址仿冒攻击时, 执行发送告警信 息、记录攻击日志、进行攻击溯源、阻断攻击行为等一种或多种处理。
结合第四方面或第四方面的上述任一种可能实现方式,在第四方 面的第六种可能实现方式中, 所述装置还包括 VC建立模块, 用于与 远端 PE间基于服务等级为所述第一 VSI的 sub-VSI分配 VC标识和 VC标签, 建立 VC。
第五方面, 本发明提供了一种虚拟专用局域网业务 VPLS网络, 包括至少两个运营商边缘 PE设备, 所述 PE设备包括如上述第三方 面或第三方面的任一种可能实现方式,或第四方面或第四方面的任一 种可能实现方式中所述的装置。
本发明实施例提供的 VPLS中 VC标签分配和 MAC地址学习的 方法, 设备和系统, 通过将 VSI划分为不同服务等级的子 VSI, 并将 终端加入不同服务等级子 VSI中, 基于服务等级进行 VC标签分配、 建立 VC,基于服务等级构建 VPLS, 并基于服务等级进行 MAC地址 学习, 可以自动识别并防止 MAC地址仿冒攻击, 提高 VPLS网络的 安全性。
附图说明
图 1是本发明实施例提供的 VPLS网络的拓朴示意图; 图 3是本发明实施例提供的采用 DoD方式分配 VC标签的方法流 程图;
图 4是本发明实施例提供的 LDP标签请求消息的格式示意图; 图 5是本发明实施例提供的 DoD方式通告服务等级和标签分配的 信息交互示意图;
图 6是本发明实施例提供的 LDP标签映射消息的格式示意图; 图 7是本发明实施例提供的采用 DU方式分配 VC标签的方法流程 图;
图 8是本发明实施例提供的 DU方式通告服务等级和标签分配的 信息交互示意图; 图 10a, 10b, 10c是本发明实施例提供的 VC标签分配装置的结构 框图;
图 l la, l ib, 11c和 l id是本发明实施例提供的 MAC地址学习装置 的结构框图;
图 12是本发明实施例提供的 PE设备的硬件结构示意图;
图 13是本发明实施例提供的 VPLS网络的系统示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发 明的一部分实施例, 而不是全部的实施例。 基于本发明中的实施 例, 本领域普通技术人员在没有做出创造性劳动前提下所获得的 所有其他实施例, 都属于本发明保护的范围。
参见图 1, 为本发明实施例提供的 VPLS网络的拓朴示意图。 用 户 A有分布于不同位置的 4个站点(site ), 分别设置有 CE设备, 通 过 AC连接对应的 PE设备,互联成为一个仿真 LAN,构成一个 VPLS 实例, 对应一个 VSI, 例如用 VSI-A作为 VSI标识。 同样, 用户 B 分布于不同位置的站点互联成为另一个仿真 LAN,构成另一个 VPLS 实例, 对应一个 VSI, 例如用 VSI-B作为 VSI标识。
本发明实施例中,将一个 VSI分为不同服务等级的子虚拟交换实 例(sub-VSI ),并将 VSI内的终端划分到不同服务等级的 sub-VSI中, 一个 sub-VSI具体通过 VSI标识和一个 sub-VSI的服务等级来标识。 一个 PE上可能有 VSI的所有 sub-VSI的服务等级, 也可能只有部分 sub-VSI的服务等级, 具体与接入该 PE的 VSI内终端的服务等级相 对应。 各个 PE上保存终端服务等级信息表, 所述终端服务等级信息 表中包括终端标识、 VSI标识和 sub-VSI的服务等级的对应关系; 通 常终端服务等级信息表是预先配置在各个 PE上; 当然, 在网络运行 过程中, 还可以根据网络状况进行调整。根据终端服务等级的划分方 式, 终端标识可以为 MAC地址或 AC。 具体的, 终端良务等级的划 分方式包括:
( 1 ) 仅按 AC划分服务等级; 将 PE下终端, 以 AC为单位划分 服务等级,一个或多个 AC下的所有终端为一个服务等级, 默认加入一个 sub-VSI。
( 2 ) 仅按 MAC地址划分服务等级; 也就是指定的一个或多个 MAC地址的终端为一个服务等级, 加入指定的 sub-VSI, 与按照 AC划分等级相比更加精细。
( 3 ) 结合 AC和 MAC地址划分服务等级; 将 PE下终端, 以 AC为单位划分服务等级,一个或多个 AC下的所有终端为 一个服务等级, 默认加入一个 sub-VSI; 同时可以指定某 个或某些 MAC 地址的终端的服务等级, 加入指定的 sub-VSI。
参见图 1,将 VSI-A划分为多个服务等级,采用结合 AC和 MAC 地址划分终端服务等级的方式; 将连接 PE1的 AC3的服务等级设置 0, 加入 sub-VSI 0, 这样 AC3下挂的终端默认都加入 sub-VSI 0; 将 连接 PE2的 AC4的服务等级设置 5, 加入 sub-VSI 5, 这样 AC4下挂 的终端默认都加入 sub-VSI 5; 将连接 PE3的 AC1和 AC2的服务等 级设置 0, 加入 sub-VSI 0, 这样 AC1和 AC2下挂的终端默认都加入 sub-VSI 0; 同时指定 MAC地址为 0001-0203-0405的服务器的服务等 级为 10, 加入 sub-VSI 10。 将 VSI-B划分为多个服务等级, 采用仅 按 AC划分终端服务等级的方式,将连接 PE1的 AC13的服务等级设 置 5, 加入 sub-VSI 5, 这样 AC 13下挂的终端默认都加入 sub-VSI 5; 将连接 PE2的 AC 11的服务等级设置 0, 加入 sub-VSI 0, 这样 AC 13 下挂的终端默认都加入 sub-VSI 0; 将连接 PE3的 AC12的服务等级 设置 2,加入 sub-VSI 2,这样 AC 12下挂的终端默认都加入 sub-VSI 2。 图 1所示 VPLS网络中, PE1的终端服务等级信息表如表 la所示, PE2的终端服务等级信息表如表 2a所示, PE3的终端服务等级信息 表如表 3a所示。 从上述可知, VSI-A共划分为 3个 sub-VSI, 有 3个 sub-VSI的服务等级; 其中, PE1上仅有 VSI-A的一个 sub-VSI的服 务等级, 0; PE2上也仅有 VSI-A的一个 sub-VSI的服务等级, 5; 而 PE3上有 VSI-A的两个 sub-VSI的服务等级, 分别为 0和 10。
表 la
Figure imgf000016_0001
本发明实施例中, 以 0表示低服务等级, 数值越大, 表示服务等 级越高。 当然, 也可以定义其他方式, 例如 A表示低服务等级, F表 示高服务等级, 本发明对此不作限定。
可选地, 可以在各个 PE上为一个 VSI默认配置一个低服务等级 的 sub-VSI, 例如, 服务等级为 0的 sub-VSI 0, 对于未设置服务等级 的 AC或 MAC地址, 则默认加入该低服务等级的 sub-VSI。
本发明实施例中,通过将一个 VSI分为不同服务等级的 sub-VSI, 在各个 PE上设置终端的服务等级, 加入相应的 sub-VSI中, 可以基 于服务等级构建 VPLS并进行 MAC地址学习, 从而实现 MAC地址 仿冒攻击的自动识别和防范。
以下将具体介绍如何基于服务等级构建 VPLS, 以及在基于服务 等级的 VPLS中如何进行 MAC地址学习。
参见图 2, 为本发明实施例提供的 VPLS中 VC标签分配的方法 流程图, 如图 2所示, 所述方法包括:
201 : 本地 PE向远端 PE通告 VSI的本地 sub-VSI;
具体地, 所述本地 PE通过 LDP标签请求( label request )消息或 LDP标签映射( label mapping ) 消息向所述远端 PE通告所述 VSI的 本地 sub-VSI。
基于 LDP 协议的标签分配有两种方式: 下游按需分配 ( downstream on demand, 简称 DoD ) 方式和下游自主分配 ( downstream unsolicited, 简称 DU ) 方式。 所述本地 PE可以采用 DoD方式向所述远端 PE通告所述 VSI的本地 sub-VSI; 此时所述本 地 PE向所述远端 PE发送 LDP标签请求消息,所述 LDP标签请求消 息中包括所述 VSI的标识和所述本地 sub-VSI的服务等级。所述本地
Figure imgf000017_0001
标签映射消息中包括所述 VSI的标识,所述本地 sub-VSI的服务等级 及其对应的 VC标识和入 VC标签; 其中, 入 VC标签是指所述本地 PE分配的 VC标签;在所述本地 PE向所述远端 PE发送所述 LDP标 签映射消息之前, 所述本地 PE向所述远端 PE为所述本地 sub-VSI 分配对应的 VC标识和入 VC标签。
通常, 从一个 PE的角度, 将其他 PE为该 PE分配的 VC标签称 为出 VC标签, 并保存在该 PE的出标签映射表中; 而将该 PE为其 他 PE分配的 VC标签称为入 VC标签,并保存在该 PE的入标签映射 表中。 可以理解的是, 出 VC标签或入 VC标签是相对而言的。
在 201之前, 所述本地 PE根据所述本地 PE的终端服务等级信 息表, 确定需要向远端 PE通告的所述 VSI的本地 sub-VSI。 以图 1 所示 VPLS网络中 VSI-A为例, PE1根据 PE1的终端服务等级信息 表, 如表 la所示, 确定需要向远端 PE通告的 VSI-A的本地 sub-VSI 包括: 由 VSI-A和服务等级 0标识的 sub-VSI 0; PE3根据 PE3的终 端服务等级信息表, 如表 3a所示,确定需要向远端 PE通告的 VSI-A 的所有本地 sub-VSI包括: 由 VSI-A和服务等级 0标识的 sub-VSI 0, 以及由 VSI-A和服务等级 10标识的 sub-VSI 10。
进一步地, 当采用 DU方式进行 VC标签分配时, 所述本地 PE 根据所述本地 PE的终端服务等级信息表, 确定需要向远端 PE通告 的所述 VSI的本地 sub-VSI, 具体包括: 所述本地 PE根据所述本地 PE的终端服务等级信息表和出标签映射表,确定需要向远端 PE通告 的所述 VSI的本地 sub-VSI。仍以图 1所示 VPLS网络中 VSI-A为例, PE3首先根据 PE3的终端服务等级信息表, 如表 3a所示, 确定需要 向 PE1通告 sub-VSI 0和 sub-VSI 10, 然后 PE3根据 PE3的出标签映 射表, 发现 PE1已经向 PE3通告了 sub-VSI 0, 即 PE3的出标签映射 表中已经保存了 PE1为 sub-VSI 0分配的 VC标签, 则 PE3最终确定 需要向 PE1通告的本地 sub-VSI只有 sub-VSI 10。 或者, 例如 PE3首 先采用 DU方式向 PE1通告了 sub-VSI 0和 sub-VSI 10, 在 PE1的出 标签映射表中保存了 PE3为 sub-VSI 0和 sub-VSI 10分配的 VC标签, 然后 PE1根据 PE1的终端服务等级信息表, 如表 la所示, 确定需要 向 PE3通告 sub-VSI 0, 再根据 PE1的出标签映射表, 发现已经保存 了 PE3为 sub-VSI 0分配的 VC标签, 则 PE1最终确定无需再向 PE3 通告本地 sub-VSI, 即 sub-VSI 0。
所述远端 PE 收到所述本地 PE 通告的所述 VSI 的所述本地 sub-VSI, 会通过第一 LDP标签映射消息向所述本地 PE为所述 VSI 的所述本地 sub-VSI分配第一 VC标识和第一 VC标签,所述第一 LDP 标签映射消息中包括所述 VSI的标识、所述本地 sub-VSI的服务等级、 所述第一 VC标识和所述第一 VC标签, 并将所述第一 VC标签和所 述本地 sub-VSI的对应关系, 即, 该第一 VC标签、 所述 VSI的标识 和所述本地 sub-VSI的服务等级的对应关系保存到所述远端 PE的入 标签映射表中。
本发明实施例中, 入标签映射表中包括入 VC标签, VSI标识和 sub-VSI的服务等级的对应关系。
202:获取所述远端 PE为所述 VSI的所述本地 sub-VSI分配的第 一 VC标识和第一 VC标签, 将所述 VSI的标识、 所述本地 sub-VSI 的服务等级、 所述第一 VC标识和所述第一 VC标签的对应关系保存 到所述本地 PE的出标签映射表;
具体地, 所述本地 PE接收所述远端 PE发送的所述第一 LDP标 签映射消息, 所述第一 LDP标签映射消息中包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 所述第一 VC标识和所述第一 VC标 签, 从所述第一 LDP标签映射消息中获取所述第一 VC标识和所述 第一 VC标签; 并将所述本地 sub-VSI及其对应的 VC标识和出 VC 标签的对应关系保存到所述本地 PE的出标签映射表,即,将所述 VSI 的标识、 所述本地 sub-VSI的服务等级, 所述第一 VC标识和所述第 一 VC标签的对应关系保存到所述本地 PE的出标签映射表。
本发明实施例中, 出标签映射表中包括 VSI标识、 sub-VSI的服 务等级、 VC标识和出 VC标签的对应关系。
可选地, 所述本地 PE还执行如下 203和 204, 接收所述远端 PE 通告的远端 sub-VSI, 并为远端 sub-VSI分配 VC标签。
203 : 所述本地 PE接收所述远端 PE 通告的所述 VSI 的远端 sub-VSI;
所述远端 PE向所述 PE通告所述 VSI的远端 sub-VSI的方式同 201中所述本地 PE向所述远端 PE通告所述 VSI的本地 sub-VSI, 具 体可参考 201, 在此不再赘述。
204: 所述本地 PE向所述远端 PE为所述远端 sub-VSI分配第二 VC标识和第二 VC标签。
所述本地 PE收到所述远端 PE通告的所述 VSI的远端 sub-VSI, 会向所述远端 PE发送第二 LDP标签映射消息, 为所述远端 sub-VSI 分配第二 VC标识和第二 VC标签,所述第二 LDP标签映射消息中包 括所述 VSI的标识, 所述远端 sub-VSI的服务等级, 所述第二 VC标 识和所述第二 VC标签; 并将所述远端 sub-VSI及其对应的入 VC标 签的对应关系, 即, 所述第二入 VC标签、 所述 VSI的标识和所述远 端 sub-VSI的服务等级的对应关系, 保存到所述本地 PE的入标签映 射表中。
本发明实施例中, 对执行 201-202, 203-204的顺序不作限定, 可 以同步进行, 也可以先执行 203-204, 再执行 201-202。 VPLS中的所 有 PE在相互之间通告 sub-VSI, 进行 VC标签分配之后, 完成按照 sub-VSI建立 VC, 即, 为 VSI按照各个服务等级分别建立 VC, 从而 实现基于服务等级构建 VPLS。
可选地, 在部署 VPLS时, 可以设置 VPLS服务等级特性, 使能 该特性, 则按照本发明提供的技术方案, 基于服务等级构建 VPLS; 去使能该特性, 则按照 VSI构建 VPLS。
需要说明的是, sub-VSI、 sub-VSI的服务等级本身并没有本地和 远端之分; 本发明实施例中, 为方便叙述, 将所述本地 PE上设置的 所述 VSI的 sub-VSI、 sub-VSI的服务等级相应称为本地 sub-VSI、 本 地 sub-VSI的服务等级;将所述远端 PE上设置的所述 VSI的 sub-VSI、 sub-VSI的服务等级相应称为远端 sub-VSI、远端 sub-VSI的服务等级。 结合图 1, 可以理解的是, 各个 PE上设置的 sub-VSI与终端划分的 服务等级一致; 本地 sub-VSI与远端 sub-VSI可以相同,也可以不同; 也就是说, 本地 sub-VSI的服务等级与远端 sub-VSI的服务等级可以 相同, 也可以不同。
接下来, 在图 2所示方法基础上, 分别详细介绍采用 DoD方式 和 DU方式分配 VC标签, 基于服务等级构建 VPLS的过程。
参见图 3, 为本发明实施例提供的采用 DoD方式基于服务等级 分配 VC标签的方法流程图, 所述方法包括:
301 : 本地 PE向远端 PE发送 LDP标签请求消息通告 VSI的所 有本地 sub-VSI,所述 LDP标签请求消息中包括所述 VSI的标识和所 述所有本地 sub-VSI的服务等级;
所述本地 PE上可能有所述 VSI的多个本地 sub-VSI的服务等级, 所述本地 PE可以将所有本地 sub-VSI的服务等级携带在一个 LDP标 签请求消息中; 也可以在一个 LDP标签请求消息中仅携带其中一个 或部分的本地 sub-VSI的服务等级, 分多次发送 LDP标签请求消息。 本发明实施例中, 所述本地 PE将所述 VSI的所有本地 sub-VSI的服 务等级携带在一个 LDP标签请求消息中, 以提高网络性能和效率。
本发明 实施例 中 , 可以定义一种新的类型长度值 ( type-length- value, 简称 TLV ), 服务等级 TLV, 用于在 LDP标签请 求消息中携带 sub-VSI的服务等级信息, 参见图 4, 本发明实施例提 供的 LDP标签请求消息的格式示意图, 其中 LDP消息头、 标签请求 消息、 转发等价类 (forward equivalence class, 简称 FEC ) TLV与通 常的 LDP标签请求消息相同,本发明实施例通过扩展的服务等级 TLV 来通告 sub-VSI的服务等级。 可以理解的是, 如果通过一个 LDP标 签请求消息通告多个 sub-VSI 时, 则携带多个服务等级 TLV。 根据 LDP协议, 对于不能识别的 TLV, 接收端忽略掉该 TLV, 因此对于 不支持本发明技术方案的 PE, 仍然可以完成 VC标签分配, 建立通 常的 VPLS网络。
在 301之前, 所述本地 PE根据所述本地 PE的终端服务等级信 息表, 确定需要向远端 PE通告的所述 VSI的本地 sub-VSI。 以图 1 所示 VPLS网络中 VSI-A为例, PE1根据 PE1的终端服务等级信息 表, 如表 la所示, 确定需要向远端 PE通告的 VSI-A的本地 sub-VSI 包括: 由 VSI-A和服务等级 0标识的 sub-VSI 0; PE3根据 PE3的终 端服务等级信息表, 如表 3a所示,确定需要向远端 PE通告的 VSI-A 的所有本地 sub-VSI包括: 由 VSI-A和服务等级 0标识的 sub-VSI 0, 以及由 VSI-A和服务等级 10标识的 sub-VSI 10。 举例来说, 结合图 1所示 VPLS网络中用户 A的 VSI-A, 以 PE3作为所述本地 PE, PE1 作为所述远端 PE为例, PE3向 PE1发送 LDP标签请求消息,通告两 个本地 sub-VSI: sub-VSI 0,即 VSI-A和服务等级 0,以及 sub-VSI 10, 即 VSI-A和服务等级 10; 该 LDP标签请求消息中包括 VSI-A, 0和 10, 参见图 5所示 LDP标签请求消息 req31 ; 图 5为本发明实施例提 供的 DoD方式通告服务等级和标签分配的信息交互示意图。
302: 所述远端 PE收到所述 LDP标签请求消息后, 向所述本地 PE发送 LDP标签映射消息, 响应所述 LDP标签请求消息, 为所述 VSI的所有本地 sub-VSI分配 VC标识和 VC标签, 所述 LDP标签映 射消息中包括所述 VSI的标识,所述所有本地 sub-VSI的服务等级及 其对应的 VC标识和 VC标签;
参见图 6,为本发明实施例提供的 LDP标签映射消息的格式示意 图, 其中携带服务等级 TLV, 用于携带 sub-VSI的服务等级信息。 如 图 6所示, 一个转发等价类 TLV和一个标签 TLV对应一个服务等级 TLV。
具体地,所述远端 PE收到所述 LDP标签请求消息后, 分别为所 述 VSI的所有本地 sub-VSI中每个本地 sub-VSI分配 VC和 VC标签, 并保存分配的 VC标签和本地 sub-VSI的对应关系到所述远端 PE的 入标签映射表中。例如,所述远端 PE为所述 VSI的所有本地 sub-VSI 中的第一本地 sub-VSI分配第一 VC标识和第一 VC标签, 并将所述 第一 VC 标签和所述第一本地 sub-VSI 的对应关系, 即, 所述第一 VC标签、 所述 VSI的标识和所述第一本地 sub-VSI的服务等级的对 应关系保存到所述远端 PE的入标签分配表中。 所述远端 PE在得到 为所述 VSI的所有本地 sub-VSI分配的 VC标签之后, 生成 LDP标 签映射消息, 并向所述本地 PE发送所述 LDP标签映射消息, 其中包 括所述 VSI的标识, 所有本地 sub-VSI的服务等级及其对应的 VC标 识和 VC标签。 举例来说, 承上所述, 当 PE1收到该 LDP标签请求消息 req31 后, PE1为 sub-VSI 0, 即, VSI-A和服务等级 0, 分配 VC2和 VC 标签 1024; 为 sub-VSI 10, 即, VSI-A和服务等级 10, 分配 VC3和 VC标签 1027;并将 VC标签 1024、 VSI-A和服务等级 0的对应关系, 以及 VC标签 1027、 VSI-A和服务等级 10的对应关系, 保存到 PE1 的入标签分配表中。 PE1向 PE3发送 LDP标签映射消息, 其中包括 所述 VSI-A, VC2、 VC标签 1024和服务等级 0, VC3、 VC标签 1027 和服务等级 10, 参见图 5所示 LDP标签映射消息 mapl3。
303: 所述本地 PE接收所述远端 PE发送的所述 LDP标签映射 消息, 从所述 LDP 标签映射消息中获取所述 VSI 的所述所有本地 sub-VSI的 VC标识和出 VC标签, 将所述 VSI的标识、 所述所有本 地 sub-VSI的服务等级及其对应的 VC标识和出 VC标签的对应关系 保存到所述本地 PE的出标签映射表;
这样, 就为所述 VSI的所有本地 sub-VSI中每个本地 sub-VSI分 别建立起, 从所述本地 PE到所述远端 PE方向的一条 VC。
采用本发明实施例提供的方法, VPLS 中的所有 PE在相互之间 通告 sub-VSI, 进行 VC标签分配之后, 完成按照 sub-VSI建立 VC, 即, 为 VSI按照各个服务等级分别建立 VC, 从而实现基于服务等级 构建 VPLS。
举例来说, 承上, 当 PE3收到该 LDP标签映射消息 map 13后, 从中获取 PE1为所述两个本地 sub-VSI: sub-VSI 0, 即 VSI-A和服务 等级 0, 以及 sub-VSI 10, 即 VSI-A和服务等级 10, 分配的 VC标识 和 VC 标签, 即从该 LDP 标签映射消息 map 13 中获取两个本地 sub-VSI的 VC标识和出 VC标签; 具体地, PE3从该 LDP标签映射 消息 map 13获取到 VSI-A, VC2、 标签 1024和服务等级 0, VC3、 标 签 1027和服务等级 10; 并且将 VSI-A、 服务等级 0、 VC2和 VC标 签 1024的对应关系,以及 VSI-A、服务等级 10、 VC3和 VC标签 1027 的对应关系, 保存到 PE3的出标签分配表中。 这样, 就为 VSI-A的 两个本地 sub-VSI分别建立起从 PE3到 PE1方向的 VC,如图 5所示, sub-VSI 0对应的 VC2, sub-VSI 10对应的 VC3。
本实施例中, 以 PE3作为本地 PE, PE1作为远端 PE为例, 说明 采用 DoD方式分配 VC标识和 VC标签, 建立 PE3到 PE1方向 VC 的过程。 结合图 1所示 VPLS网络中用户 A的 VSI-A, 还有 PE3作 为本地 PE, PE2作为远端 PE分配 VC标识和 VC标签, 建立 PE3到 PE2方向 VC,如图 5中 req32和 map23所示; PE1作为本地 PE, PE3 作为远端 PE分配 VC标识和 VC标签, 建立 PE1到 PE3方向 VC, 如图 5中 reql3和 map31所示; PE1作为本地 PE, PE2作为远端 PE 分配 VC标识和 VC标签,建立 PE1到 PE2方向 VC,如图 5中 reql2 和 map21所示; PE2作为本地 PE, PE1作为远端 PE分配 VC标识和 VC标签,建立 PE2到 PE1方向 VC,如图 5中 req21和 mapl2所示; 以及 PE2作为本地 PE, PE3作为远端 PE分配 VC标识和 VC标签, 建立 PE2到 PE3方向 VC, 如图 5中 req23和 map32所示。 具体地, 可以参考本实施例中 PE3作为本地 PE, PE1作为远端 PE的过程,在 此不再赘述。 最后, 各个 PE的入标签映射表和出标签映射表分别保 存有 VSI-A的相应 sub-VSI的表项, 如下各表所示; 表 lb为 PE1的 入标签映射表, 表 lc为 PE1的出标签映射表; 表 2b为 PE2的入标 签映射表, 表 2c为 PE2的出标签映射表; 表 3b为 PE3的入标签映 射表, 表 3c为 PE3的出标签映射表。
表 lb
入 VC标签 VSI 服务等级 1026 VSI-A 5
1024 VSI-A 0
1025 VSI-A 10 表 lc
Figure imgf000026_0001
表 2b
Figure imgf000026_0002
表 2c
Figure imgf000026_0003
表 3b
Figure imgf000026_0004
表 3c
Figure imgf000026_0005
VC7 VSI-A 0 1026
VC6 VSI-A 10 1025 本实施例中, 采用 DoD方式进行 VC标签分配, PE 间建立的 VC是非对称的, 但是 DoD方式的 VC标签利用率比 DU方式更高。 参见图 7, 为本发明实施例提供的采用 DU方式基于服务等级分 配 VC标签的方法流程图, 所述方法包括:
701 : 本地 PE向远端 PE发送第一 LDP标签映射消息通告 VSI 的本地 sub-VSI,所述第一 LDP标签映射消息中包括所述 VSI的标识, 所述本地 sub-VSI的服务等级及其对应的第一 VC标识和第一 VC标 佥;
其中第一 VC标识和第一 VC标签, 是所述本地 PE向所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签。
所述本地 PE的入标签映射表中保存有所述 VSI的标识, 所述本 地 sub-VSI的服务等级, 第一 VC标识和第一 VC标签的对应关系。
同样,本实施例中通过新定义的服务等级 TLV,在所述第一 LDP 标签映射消息中携带 sub-VSI的服务等级信息, 参见图 6所示。
在 701之前, 所述本地 PE根据所述本地 PE的终端服务等级信 息表和出标签映射表, 确定需要向远端 PE通告的所述 VSI 的本地 sub-VSI。 以图 1所示 VPLS网络中 VSI-A为例, PE3首先根据 PE3 的终端服务等级信息表,如表 3a所示,确定需要向 PE1通告 sub-VSI 0和 sub-VSI 10, 然后 PE3根据 PE3的出标签映射表,发现 PE1已经 向 PE3通告了 sub-VSI 0, 即 PE3的出标签映射表中已经保存了 PE1 为 sub-VSI 0分配的 VC标签, 则 PE3最终确定需要向 PE1通告的本 地 sub-VSI只有 sub-VSI 10。或者,例如 PE3首先采用 DU方式向 PE1 通告了 sub-VSI 0和 sub-VSI 10,在 PE1的出标签映射表中保存了 PE3 为 sub-VSI 0和 sub-VSI 10分配的 VC标签, 然后 PE1根据 PE1的终 端服务等级信息表, 如表 la所示, 确定需要向 PE3通告 sub-VSI 0, 再根据 PE1的出标签映射表,发现已经保存了 PE3为 sub-VSI 0分配 的 VC标签, 则 PE1最终确定无需再向 PE3通告本地 sub-VSI, 即 sub-VSI 0。
举例来说, 结合图 1所示 VPLS网络中用户 A的 VSI-A, 以 PE3 作为所述本地 PE, PE1作为所述远端 PE为例, PE3为 VSI-A的两个 本地 sub-VSI向 PE1分配 VC标识和 VC标签;具体的,为 sub-VSI 0, 即 VSI-A和服务等级 0, 分配 VC6和 VC标签 1026; 为 sub-VSI 10, 即 VSI-A和服务等级 10, 分配 VC7和 VC标签 1027。 PE3将 VC标 签 1026、 VSI-A和服务等级 0的对应关系,以及 VC标签 1027、 VSI-A 和服务等级 10的对应关系保存到 PE3的入标签分配表中。 PE3向 PE1 发送第一 LDP标签映射消息, 通告 PE3上 VSI-A的两个 sub-VSI: sub-VSI 0和 sub-VSI 10, 以及为 sub-VSI 0分配的 VC6和 VC标签 1024, 为 sub-VSI 10分配的 VC7和 VC标签 1027; 该第一 LDP标签 映射消息中包括 VSI-A, VC6、 VC标签 1024和服务等级 0, 以及 VC7、 VC标签 1027和服务等级 10, 参见图 8中 map31所示; 图 8 为本发明实施例提供的 DU 方式通告服务等级和标签分配的信息交 互示意图。
702:所述远端 PE收到所述本地 PE发送的所述第一 LDP标签映 射消息后,从所述第一 LDP标签映射消息中获取所述本地 PE为所述 VSI的所述本地 sub-VSI分配的第一 VC标识和第一 VC标签, 并将 所述 VSI的标识、 本地 sub-VSI的服务等级、 第一 VC标识和第一 VC标签的对应关系保存到所述远端 PE的出标签映射表; 这样, 就为所述本地 sub-VSI建立起从所述远端 PE到所述本地 PE方向的一条 VC。
举例来说, 承上所述, 当 PE1 收到该第一 LDP 标签映射消息 map31后, 从中获取 PE3为 VSI-A的两个本地 sub-VSI向 PE1分配 的 VC标识和 VC标签,将 VSI-A,服务等级 0、 VC6和 VC标签 1026 的对应关系, 以及 VSI-A、 服务等级 10、 VC7和 VC标签 1027的对 应关系保存到 PE1的出标签分配表中。
703: 所述远端 PE在收到所述本地 PE发送的所述第一 LDP标 签映射消息之后, 向所述本地 PE发送第二 LDP标签映射消息, 响应 所述第一 LDP标签映射消息, 为所述 VSI的所述本地 sub-VSI分配 第二 VC标识和第二 VC标签,所述第二 LDP标签映射消息中包括所 述 VSI的标识, 所述 sub-VSI的服务等级、 第二 VC标识和第二 VC 标签;
具体地,所述远端 PE收到所述第一 LDP标签映射消息后, 为所 述 VSI的所述本地 sub-VSI分配第二 VC标识和第二 VC标签, 并保 存第二 VC标签和所述本地 sub-VSI的对应关系, 即, 所述第二 VC 标签、 所述 VSI的标识和所述本地 sub-VSI的服务等级的对应关系, 到所述远端 PE的入标签映射表中。然后,所述远端 PE生成第二 LDP 标签映射消息,所述第二 LDP标签映射消息中包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 所述第二 VC标识和所述第二 VC标 签, 并向所述本地 PE发送所述第二 LDP标签映射消息。
可以理解的是, 所述远端 PE可以并行执行 702和 703。
举例来说, 承上所述, 当 PE1 收到该第一 LDP 标签映射消息 map31后, 为 sub-VSI 0分配 VC8和 VC标签 1025, 为 sub-VSI 10 分配 VC9和 VC标签 1026; 并将 VC标签 1025、 VSI-A和服务等级 0的对应关系, 以及 VC标签 1026、 VSI-A和服务等级 10的对应关 系, 保存到 PE1的入标签分配表中。 PE1向 PE3发送第二 LDP标签 映射消息, 参见图 8 中 map31, 所示, 其中包括所述 VSI-A, VC8、 VC标签 1025和服务等级 0, VC9、 VC标签 1026和服务等级 10。
704: 所述本地 PE接收所述远端 PE发送的所述第二 LDP标签 映射消息,从所述第二 LDP标签映射消息中获取所述远端 PE为所述 VSI的所述本地 sub-VSI分配的第二 VC标识和第二 VC标签, 将所 述 VSI的标识、 所述本地 sub-VSI的服务等级、 第二 VC标识和第二 VC标签的对应关系保存到所述本地 PE的出标签映射表;
这样, 就为所述 VSI的所述本地 sub-VSI建立起从所述本地 PE 到所述远端 PE方向的一条 VC。
采用本发明实施例提供的方法, VPLS 中的所有 PE在相互之间 通告 sub-VSI, 进行 VC标签分配之后, 完成按照 sub-VSI建立 VC, 即, 为 VSI按照各个服务等级分别建立 VC, 从而实现基于服务等级 构建 VPLS。
举例来说, 承上所述, 如图 8所示, 当 PE3收到该第二 LDP标 签映射消息 map31,后, 从中获取 PE1 为所述两个本地 sub-VSI: sub-VSI O, 即 VSI-A和服务等级 0, 以及 sub-VSI 10, 即 VSI-A和服 务等级 10, 分配的 VC标识和 VC标签; 具体地, PE3从该 LDP标 签映射消息 map31,获取到 VSI-A, VC8、 标签 1025和服务等级 0, VC9、 标签 1026和服务等级 10; 并且将 VSI-A、 服务等级 0 、 VC8 和 VC标签 1025的对应关系, 以及 VSI-A、 服务等级 10、 VC9和 VC标签 1026的对应关系, 保存到 PE3的出标签分配表中。 这样, 就为 VSI-A的两个本地 sub-VSI分别建立起从 PE3到 PE1方向的 VC。
本实施例中, 以 PE3作为本地 PE, PE1作为远端 PE为例, 说明 采用 DU方式为 PE3的本地 sub-VSI分配 VC标签,建立 PE3与 PE1 间双向 VC的过程。 结合图 1所示 VPLS网络中用户 A的 VSI-A, 还 有 PE3作为本地 PE, PE2作为远端 PE, 为 PE3的本地 sub-VSI分配 VC标识和 VC标签, 建立 PE3与 PE1间双向 VC的过程, 如图 8中 map32和 map32,所示; PE1作为本地 PE, PE2作为远端 PE, 为 PE1 的本地 sub-VSI分配 VC标识和 VC标签, 建立 PE1与 PE2间双向 VC的过程, 如图 8中 mapl2和 mapl2,所示; PE2作为本地 PE, PE1 作为远端 PE分配 VC标识和 VC标签, 为 PE2的本地 sub-VSI分配 VC标签,建立 PE2与 PE1间双向 VC的过程,如图 8中 map21和 map21, 所示;以及 PE2作为本地 PE, PE3作为远端 PE,为 PE2的本地 sub-VSI 分配 VC标识和 VC标签, 建立 PE2与 PE3间双向 VC的过程, 如图 8中 map23和 map23,所示。 具体地, 可以参考本实施例中 PE3作为 本地 PE, PE1作为远端 PE的过程, 在此不再赘述。 结合图 8可以看 到, 本实施例中, PE3 先向 PE1 发送第一 LDP 标签映射消息通告 sub-VSI 0和 sub-VSI 10, PE1通过第二 LDP标签映射消息响应 PE3 的通告; PE1根据 PE1的终端服务等级信息表和出标签映射表,确定 无需再向 PE3发送第一 LDP标签映射消息通告 sub-VSI 0。 最后, 各 个 PE 的入标签映射表和出标签映射表分别保存 VSI-A 的相关 sub-VSI的表项, 如下各表所示; 表 lb,为 PE1的入标签映射表, 表 lc,为 PE1的出标签映射表; 表 2b,为 PE2的入标签映射表, 表 2c,为 PE2的出标签映射表; 表 3b,为 PE3的入标签映射表, 表 3c,为 PE3 的出标签映射表。
表 lb,
Figure imgf000031_0001
1025 VSI-A 0
1026 VSI-A 10 表 lc,
Figure imgf000032_0001
表 2b,
Figure imgf000032_0002
表 2c,
Figure imgf000032_0003
表 3b,
Figure imgf000032_0004
1027 VSI-A 0
1025 VSI-A 10
1024 VSI-A 0
1028 VSI-A 5 表 3c'
Figure imgf000033_0001
本实施例中采用 DU方式进行 VC标签分配, PE间建立的 VC是 对称的; DU方式下, PE间的 VC建立较快,并且在增加新的 sub-VSI 时较为简便快捷, 但是会浪费一些 VC标签。 在 PE按照 sub-VSI进行 VC标签分配、 建立 VC,基于服务等级 构建 VPLS之后, 可进一步基于服务等级进行 MAC地址学习, 实现
MAC地址仿冒攻击的自动识别和防范。
本发明实施例提供了一种 VPLS中 MAC地址学习的方法, 如图
9所示, 包括:
901: 本地 PE从第一接口接收第一报文;
所述第一报文可能来自 AC侧, 也可能来自 VC侧。
902: 获取所述第一报文的源 MAC地址, 以及所述第一报文所 属的第一虚拟交换实例 VSI的标识和第一子虚拟交换实例 sub-VSI的 服务等级;
当所述第一报文中包括第一 VC标签, 所述第一接口具体为第一 VC时; 相应地, 所述获取所述第一报文所属的第一 VSI的标识和第 一 sub-VSI的服务等级具体包括: 根据所述第一 VC标签, 查询所述 本地 PE的入标签映射表; 获取所述入标签映射表中入 VC标签与所 述第一 VC标签匹配的第一标签映射表项的 VSI标识和 sub-VSI的服 务等级,作为所述第一报文所属的第一 VSI的标识和第一 sub-VSI的 服务等级。 当所述第一接口具体为第一 AC时; 相应地, 所述获取所 述第一报文所属的第一 VSI的标识和第一 sub-VSI的服务等级具体包 括: 根据所述第一报文的源 MAC地址或者所述第一 AC的标识, 查 询所述本地 PE的终端服务等级信息表; 所述终端服务等级信息表中 包括终端标识、 VSI标识和 sub-VSI的服务等级的对应关系, 其中, 终端标识包括 MAC地址或 AC标识; 获取所述终端服务等级信息表 中终端标识与所述第一 文的源 MAC地址或者所述第一 AC的标识 匹配的表项的 VSI标识和 sub-VSI的服务等级,作为所述第一报文所 属的第一 VSI的标识和第一 sub-VSI的服务等级。
需要说明的是, PE设备上通常用端口号, 或者 VLAN标识和端 口号来标识一个 AC。
进一步可选地, 当 VPLS 中既根据 AC 划分服务等级, 又根据 MAC地址划分服务等级时, 所述根据所述第一报文的源 MAC地址 或者所述第一 AC的标识查询所述本地 PE的终端服务等级信息表, 获取所述终端服务等级信息表中终端标识与所述第一报文的源 MAC 地址或者所述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI的服 务等级具体包括:
根据所述第一报文的源 MAC 地址查询所述终端服务等级信息 表; 当所述终端服务等级信息表中第一终端服务等级信息表项的终端 标识与所述第一报文的源 MAC地址相同时, 获取所述第一终端服务 等级信息表项的 VSI标识和 sub-VSI的服务等级; 当所述终端服务等 级信息表中任一表项的终端标识与所述第一报文的源 MAC地址均不 相同时, 根据所述第一 AC的标识查询所述终端服务等级信息表, 获 取所述终端服务等级信息表中终端标识与所述第一 AC的标识相同的 第二终端服务等级信息表项的 VSI标识和 sub-VSI的服务等级。
903: 根据所述第一 VSI的标识和所述第一报文的源 MAC地址 查询所述本地 PE的 MAC转发表, 所述 MAC转发表包括 VSI标识, MAC地址, 出接口标识和 MAC服务等级的对应关系;
904: 当所述本地 PE的 MAC转发表中不存在与所述第一 VSI 的标识和所述第一 文的源 MAC 地址匹配的表项时, 将所述第一 VSI的标识、 所述第一报文的源 MAC地址、 所述第一接口的标识及 所述第一 sub-VSI的服务等级存入所述本地 PE的 MAC转发表中; MAC地址学习过程结束。
所述本地 PE在学习所述第一报文的源 MAC地址时, 将所述第 一 sub-VSI的服务等级作为所述源 MAC地址的 MAC服务等级保存 到所述本地 PE的 MAC转发表中, 这样可以在后续的 MAC地址学 习过程中, 根据 MAC服务等级判断 MAC地址学习是否异常, 以防 止 MAC仿冒攻击。
905: 当所述本地 PE的 MAC转发表中存在与所述第一 VSI的标 识和所述第一报文的源 MAC地址匹配的第一 MAC转发表项时, 获 取所述第一 MAC转发表项的 MAC服务等级;
具体地, 当所述本地 PE的 MAC转发表中的所述第一 MAC表 项的 VSI标识与所述第一 VSI的标识相同,且所述第一 MAC转发表 项的 MAC地址与所述第一报文的源 MAC地址相同时, 获取所述第 一 MAC转发表项的 MAC服务等级。 906: 判断所述第一 sub-VSI的服务等级是否高于或等于所述第 一 MAC转发表项的 MAC服务等级;
907: 若所述第一 sub-VSI的服务等级高于或等于所述第一 MAC 转发表项的 MAC 服务等级, 用所述第一接口的标识及所述第一 sub-VSI 的服务等级更新所述第一 MAC 转发表项的出接口标识和 MAC服务等级; MAC地址学习过程结束。
908:若所述第一 sub-VSI的服务等级低于所述第一 MAC转发表 项的 MAC服务等级, 所述本地 PE判定存在 MAC地址仿冒攻击, 不刷新所述第一 MAC转发表项。
具体地, 若所述第一 sub-VSI的服务等级低于所述第一 MAC转 发表项的 MAC服务等级, 所述本地 PE认为本次根据所述第一报文 进行的 MAC地址学习异常,存在 MAC地址仿冒攻击, 不刷新 MAC 转发表, 实现 MAC地址仿冒攻击的自动识别和防范, 提高了 VPLS 网络的安全性。 进一步可选地, 所述本地 PE可以执行: 发送告警信 息, 记录攻击日志, 攻击溯源, 阻断攻击中的一种或多种处理; 具体 地, 所述本地 PE可以根据 MAC地址仿冒攻击行为的入方向, 即, 接收携带仿冒源 MAC地址的第一报文的第一接口, 判断 MAC仿冒 攻击源的位置, 进行 MAC地址仿冒攻击溯源; 进一步地, 所述本地 PE可以根据被仿冒的 MAC地址,丟弃 MAC地址仿冒攻击行为的入 方向所接收的所有攻击报文, 即源 MAC地址为所述被仿冒的 MAC 地址的报文, 从而阻断攻击流量, 隔离攻击源, 进一步提高 VPLS网 络的安全性。 可以理解的是, VPLS中各个 PE都会进行 MAC学习, 如果 PE采取阻断攻击处理,则位于某个站点内的攻击源发出的 MAC 地址仿冒攻击报文, 会被该站点所接入的 PE阻断在该站点内, 而不 会被传输到 VPLS网络中其他 PE, 达到阻断攻击流量, 隔离攻击源 的目的, 进一步增强对 MAC地址仿冒攻击的防范。
可选的, 在 901之前, 所述本地 PE执行本发明如图 2, 图 3或 图 7所示的 VC标签分配的方法, 与远端 PE间建立 VC, 构建基于 服务等级的 VPLS网络; 具体包括: 所述本地 PE向远端 PE通告所 述第一 VSI的本地 sub-VSI; 获取所述远端 PE为所述本地 sub-VSI 分配的 VC标识和出 VC标签; 将所述第一 VSI的标识、 所述本地 sub-VSI的服务等级、 所述远端 PE为所述本地 sub-VSI分配的所述 VC标识和所述出 VC标签的对应关系保存到所述本地 PE的出标签 映射表。 所述本地 PE接收所述远端 PE通告的所述第一 VSI的远端 sub-VSI; 向所述远端 PE为所述远端 sub-VSI分配 VC标识和入 VC 标签; 在所述本地 PE的入标签映射表保存所述第一 VSI的标识、 所 述所有远端 sub-VSI的服务等级、 所述本地 PE为所述远端 sub-VSI 分配的所述 VC标识和所述入 VC标签的对应关系。 进一步地, 所述 方法还可以包括: 所述本地 PE转发所述第一报文; 具体地, 所述本 地 PE获取所述第一报文的目的 MAC地址, 当所述本地 PE的 MAC 转发表中存在与所述第一 VSI的标识和所述第一报文的目的 MAC地 址匹配的第二 MAC转发表项时, 获取所述第二 MAC转发表项的出 接口标识; 若所述第二 MAC 转发表项的出接口标识对应的接口为 VC时, 根据所述第一 VSI、 所述第一 sub-VSI的服务等级和所述第 二 MAC转发表项的出接口标识查询所述本地 PE的出标签映射表, 获取转发所述第一报文的出 VC标签,然后封装并转发所述第一报文; 若所述第二 MAC转发表项的出接口标识对应的接口为 AC时, 向所 述第二 MAC转发表项的出接口标识对应的 AC转发所述第一报文。 通常,如果所述第一报文是远端 PE发来的广播报文, 则所述本地 PE 只向同一 VPLS,即所述第一 VSI的所有直连端口转发所述第一报文, 而不会向其他 PE转发。 如果所述第一报文是本地用户, 即, 连接到 所述本地 PE的 CE,发来的广播报文,则所述本地 PE将向同一 VPLS, 即所述第一 VSI的所有其它直连端口以及所有其他 PE转发所述第一 报文。 如果所述第一报文的目的 MAC地址为非广播地址的报文, 且 所述本地 PE的 MAC转发表中还没有学习到所述目的 MAC地址, 则所述本地 PE将广播所述第一报文。
本发明实施例提供的 VPLS中 MAC地址学习的方法, 所述本地 PE 从第一接口收到第一报文后, 首先获取所述第一报文所属的第一 VSI和第一 sub-VSI的服务等级, 并根据所述第一报文的源 MAC地 址和第一 VSI查询 MAC转发表,在首次学习到该源 MAC地址, 即, MAC转发表中没有匹配的表项时, 将第一 sub-VSI的服务等级作为 该源 MAC地址的 MAC服务等级相应存入 MAC转发表中; 而在后 续又学习到该源 MAC地址,即, MAC转发表中存在匹配的第一 MAC 转发表项时, 通过比较第一 sub-VSI的服务等级和第一 MAC转发表 项中保存的 MAC服务等级, 来判断 MAC学习是否异常, 只有当第 一 sub-VSI服务等级高于或等于第一 MAC转发表项的 MAC服务等 级时, 才用第一接口及第一 sub-VSI的服务等级更新第一 MAC转发 表项的出接口和 MAC服务等级; 从而可以自动识别并防止来自低服 务等级的 sub-VSI的报文, 仿冒攻击高服务等级的 MAC地址。 可以 理解的是, 本发明实施例中, 可以将网关设备、 DHCP服务器、 DNS 服务器等重要设备的 AC或 MAC地址设置为高服务等级, 相应建立 高服务等级的 sub-VSI, 从而在 MAC地址学习过程中, 可以自动识 别并防止 MAC地址仿冒攻击, 避免因 MAC地址仿冒攻击引起网络 服务质量下降甚至中断。 本发明实施例提供了一种 VC标签分配装置, 位于 PE设备内, 用 于实施本发明图 2、 图 3或图 4所示的方法; 如图 10a所示, 所述装置 可以包括:
发送器 1001, 用于向远端 PE通告 VSI的本地 sub-VSI;
获取模块 1002, 用于获取所述远端 PE为所述 VSI的所述本地 sub-VSI分配的 VC标识和 VC标签, 将所述 VSI的标识、 所述本地 sub-VSI的服务等级, 及所述远端 PE为所述本地 sub-VSI分配的 VC标 识和 VC标签的对应关系保存到所述本地 PE的出标签映射表;
如图 10b所示, 所述装置还可以包括:
接收器 1003, 用于接收所述远端 PE通告所述 VSI的远端 sub-VSI; 标签分配模块 1004, 用于向所述远端 PE为所述远端 sub-VSI分配 VC标识和 VC标签。
本发明实施例中, 将一个 VSI分为不同服务等级的 sub-VSI (子 VSI ) , 并将 VSI内的终端划分到不同服务等级的 sub-VSI中, 一个 sub-VSI具体通过 VSI和一个 sub-VSI的服务等级来标识。 一个 PE上可 能有 VSI的所有 sub-VSI的服务等级, 也可能只有部分 sub-VSI的服务 等级, 具体与接入该 PE的 VSI内终端的服务等级相对应。 各个 PE上保 存终端服务等级信息表, 所述终端服务等级信息表中包括终端标识、 VSI和 sub-VSI的服务等级的对应关系,通常预先配置在各个 PE上。 结 合图 1所示 VPLS网络, 各个 PE上的服务等级信息表可参见表 la, 表 2a 和表 3a, 具体地可参考本发明实施例前述内容, 在此不再赘述。
如图 10c所示, 所述装置进一步还可以包括确定模块 1005, 用于 根据所述 PE的终端服务等级信息表, 确定向所述远端 PE通告的所述 VSI的本地 sub-VSI。 可选地, 当采用 DU方式分配 VC标签时, 所述确 定模块 1005具体用于根据所述 PE的终端服务等级信息表和出标签映 射表,确定向所述远端 PE通告的所述 VSI的本地 sub-VSI。具体可参考 201中所述, 在此不再赘述。
基于 LDP 协议的标签分配有两种方式: 下游按需分配 ( downstream on demand, 简称 DoD ) 方式和下游自主分配 ( downstream unsolicited, 简称 DU ) 方式。 所述 PE可以采用 DoD 方式, 也可以采用 DU方式, 向所述远端 PE通告所述 VSI的所述本 地 sub-VSI。
本发明 实施例 中 , 可以定义一种新的类型长度值 ( type-length- value, 简称 TLV ), 服务等级 TLV, 用于在 LDP标签请 求消息或 LDP标签映射消息中携带 sub-VSI的服务等级信息, 参见 图 4,为本发明实施例提供的 LDP标签请求消息的格式示意图; 参见 图 6,为本发明实施例提供的 LDP标签映射消息的格式示意图。可以 理解的是, 可以在 LDP标签请求消息或 LDP标签映射消息中携带多 个服务等级 TLV, 用于通告 VSI的多个 sub-VSI。
当采用 DoD方式进行标签分配时, 所述发送器 1001, 具体用于 向所述远端 PE发送第一 LDP标签请求消息通告所述 VSI的所述本地 sub-VSI, 所述第一 LDP标签请求消息中包括所述 VSI的标识和所述 本地 sub-VSI的服务等级。 所述接收器 1003, 还用于接收所述远端 PE发送的第一 LDP标签映射消息, 所述第一 LDP标签映射消息包 括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 所述第一 VC标 识和所述第一 VC标签。所述获取模块 1002,具体用于从所述接收器 1003接收的所述第一 LDP标签映射消息中获取所述第一 VC标识和 所述第一 VC标签, 并将所述 VSI的标识、 所述本地 sub-VSI的服务 等级、 所述第一 VC标识和所述第一 VC标签的对应关系保存到所述 PE的出标签映射表。
所述接收器 1003,具体用于接收所述远端 PE发送的第二 LDP标签 请求消息, 所述第二 LDP标签请求消息中包括所述 VSI的标识和所述 远端 sub-VSI的服务等级。 所述标签分配模块 1004, 具体用于根据所 述接收器 1003接收的所述第二 LDP标签请求消息, 为所述 VSI的所述 远端 sub-VSI分配第二 VC标识和第二 VC标签, 并将第二 VC标签和所 述远端 sub-VSI的对应关系, 即, 所述第二 VC标签、 所述 VSI的标识 和所述远端 sub-VSI的服务等级保存到所述 PE的入标签映射表中。 所 述发送器 1001,还用于向所述远端 PE发送第二 LDP标签映射消息, 响 应所述第二 LDP标签请求消息, 所述第二 LDP标签映射消息中包括所 述 VSI的标识, 所述远端 sub-VSI的服务等级、 所述第二 VC标识和所 述第二 VC标签。
结合图 1所示 VPLS网络中用户 A的 VSI-A, 采用 DoD方式进行 VC 标签分配, 建立 VC, 各个 PE上生成的入标签映射表分别如表 lb, 2b 和 3b所示, 出标签映射表分别如表 lc, 2c和 3c所示, 具体参见图 3所 示方法实施例, 在此不再赘述。
当采用 DU方式进行标签分配时, 所述发送器 1001, 具体用于向 所述远端 PE发送第一 LDP标签映射消息通告所述 VSI的所述本地 sub-VSI, 所述第一 LDP标签映射消息中包括所述 VSI的标识, 所述本 地 sub-VSI的服务等级、第一 VC标识和第一 VC标签; 所述标签分配模 块 1004,还可以用于向所述远端 PE为所述 VSI的所述本地 sub-VSI分配 所述第一 VC标识和所述第一 VC标签, 并将所述 VSI的标识、 所述本 地 sub-VSI的服务等级和第一 VC标签保存到所述 PE的入标签映射表 中。所述接收器 1003,还用于接收所述远端 PE发送的第二 LDP标签映 射消息, 所述第二 LDP标签映射消息包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、第二 VC标识和第二 VC标签;所述获取模块 1002, 具体用于从所述接收器 1003接收的所述第二 LDP标签映射消息中获 取所述本地 sub-VSI的第二 VC标识和第二 VC标, 将所述 VSI的标识、 所述本地 sub-VSI的服务等级、所述第二 VC标识和所述第二 VC标签的 对应关系保存到所述 PE的出标签映射表。
所述接收器 1003,具体用于接收所述远端 PE发送的第三 LDP标签 映射消息, 所述第三 LDP标签映射消息中包括所述 VSI的标识, 所述 远端 sub-VSI的服务等级、第三 VC标识和第三 VC标签; 所述获取模块 1002,还用于从所述第三 LDP标签映射消息中获取所述远端 PE为所述 远端 sub-VSI分配的第三 VC标识和第三 VC标签, 并将所述 VSI的标 识、所述远端 sub-VSI的服务等级、第三 VC标识和第三 VC标签的对应 关系保存到所述 PE的出标签映射表。所述标签分配模块 1004,具体用 于为所述 VSI的所述远端 sub-VSI分配第四 VC标识和第四 VC标签, 并 将所述第四 VC标签和所述远端 sub-VSI的对应关系, 即所述第四 VC 标签、 所述 VSI的标识和所述远端 sub-VSI的服务等级保存到所述 PE 的入标签映射表中。所述发送器 1001,还用于向所述远端 PE发送第四 LDP标签映射消息, 响应所述第三 LDP标签映射消息, 所述第四 LDP 标签映射消息中包括所述 VSI,所述远端 sub-VSI的服务,所述第四 VC 标识和所述第四 VC标签。
结合图 1所示 VPLS网络中用户 A的 VSI-A, 采用 DU方式进行 VC 标签分配, 建立 VC, 各个 PE上生成的入标签映射表分别如表 lb,, 2b' 和 3b,所示, 出标签映射表分别如表 lc,, 2c,和 3c,所示, 具体参见图 7 所示方法实施例, 在此不再赘述。
可选地, 在部署 VPLS时可以设置 VPLS服务等级特性, 使能该 特性, 则按照本发明提供的技术方案, 基于服务等级构建 VPLS; 去 使能该特性, 则按照 VSI构建 VPLS。 所述装置还可以包括特性控制 模块, 用于使能或去使能 VPLS服务等级特性。 需要说明的是, sub-VSI、 sub-VSI的服务等级本身并没有本地和 远端之分; 本发明实施例中, 为方便叙述, 将所述 PE上设置的所述 VSI 的 sub-VSI、 sub-VSI 的服务等级相应称为本地 sub-VSI、 本地 sub-VSI的服务等级; 将所述远端 PE上设置的所述 VSI的 sub-VSI、 sub-VSI的服务等级相应称为远端 sub-VSI、远端 sub-VSI的服务等级。
本发明实施例中, 所述 PE通过所述 VC标签分配装置, 与远端 PE间相互通告 sub-VSI的服务等级, 分配 VC标签, 建立起 VC, 从 而可以实现基于服务等级的 VPLS的构建。 本发明实施例提供了一种 MAC地址学习装置, 位于 PE设备内, 用于实施本发明图 9所示的方法; 如图 11a所示, 所述装置可以包括: 接收模块 1101, 用于从第一接口接收第一报文;
第一获取模块 1102, 用于获取所述第一报文的源 MAC地址, 以 及所述第一报文所属的第一虚拟交换实例 VSI的标识和第一子虚拟交 换实例 sub-VSI的服务等级;
查询模块 1103, 用于根据所述第一 VSI的标识和所述第一报文 的源 MAC地址查询所述 PE的 MAC转发表,所述 MAC转发表包括 VSI标识, MAC地址, 出接口标识和 MAC服务等级的对应关系; 第二获取模块 1104, 用于当所述 PE的 MAC转发表中存在与所 述第一 VSI的标识和所述第一报文的源 MAC地址匹配的第一 MAC 转发表项时, 获取所述第一 MAC转发表项的 MAC服务等级;
判断模块 1105, 用于判断所述第一获取模块 1102中获取的所述 第一 sub-VSI的服务等级是否高于或等于所述第二获取模块 1104中 获取的所述第一 MAC转发表项的 MAC服务等级;
更新模块 1106,用于当所述第一 sub-VSI的服务等级高于或等于 所述第一 MAC转发表项的 MAC服务等级时, 用所述第一接口的标 识及所述第一 sub-VSI的服务等级更新所述第一 MAC转发表项的出 接口标识和 MAC服务等级。
如图 lib所示, 所述装置还可以包括:
攻击判定模块 1107,用于当所述第一 sub-VSI的服务等级低于所 述第一 MAC转发表项的 MAC服务等级时, 判定存在 MAC地址仿 冒攻击;
地址存储模块 1108, 用于当所述 PE的 MAC转发表中不存在与 所述第一 VSI的标识和所述第一报文的源 MAC地址匹配的表项时, 将所述第一 VSI的标识、 所述第一报文的源 MAC地址、 所述第一接 口的标识及所述第一 sub-VSI的服务等级存入所述 PE的 MAC转发 表中。
本实施例中, 当所述攻击判定模块 1107判定存在 MAC地址仿 冒攻击时, 说明本次根据所述第一报文进行的 MAC地址学习异常, 则不刷新 MAC表项, 从而实现 MAC地址仿冒攻击的自动识别和防 范, 提高了 VPLS网络的安全性。
当所述第一报文中包括第一 VC标签, 所述第一接口具体为第一 VC时, 所述第一获取模块 1102, 具体用于根据所述第一 VC标签, 查询所述 PE的入标签映射表, 获取所述入标签映射表中入 VC标签 与所述第一 VC标签匹配的第一标签映射表项的 VSI标识和 sub-VSI 的服务等级, 作为所述第一报文所属的第一 VSI 的标识和第一 sub-VSI的服务等级。
当所述第一接口具体为第一 AC时,所述第一获取模块 1102,具 体用于根据所述第一报文的源 MAC地址或者所述第一 AC的标识, 查询所述 PE的终端服务等级信息表, 获取所述终端服务等级信息表 中终端标识与所述第一 文的源 MAC地址或者所述第一 AC的标识 匹配的表项的 VSI标识和 sub-VSI的服务等级,作为所述第一报文所 属的第一 VSI的标识和第一 sub-VSI的服务等级;所述终端服务等级 信息表中包括终端标识、 VSI标识和 sub-VSI的服务等级的对应关系, 终端标识包括 MAC地址或 AC标识。 进一步可选地, 所述第一获取 模块 1102,具体用于根据所述第一报文的源 MAC地址查询所述终端 服务等级信息表; 当所述终端服务等级信息表中第一终端服务等级信 息表项的终端标识与所述第一报文的源 MAC地址相同时, 获取所述 第一终端服务等级信息表项的 VSI标识和 sub-VSI的服务等级; 当所 述终端服务等级信息表中任一表项的终端标识与所述第一报文的源 MAC地址均不相同时, 根据所述第一 AC的标识查询所述终端服务 等级信息表, 获取所述终端服务等级信息表中终端标识与所述第一 AC的标识相同的第二终端服务等级信息表项的 VSI标识和 sub-VSI 的服务等级。
如图 11c所示, 所述 PE进一步还可以包括攻击处理模块 1109, 用于当所述攻击判定模块判定 1107存在 MAC地址仿冒攻击时, 执 行发送告警信息、 记录攻击日志、 进行攻击溯源、 阻断攻击行为等一 种或多种处理。 所述攻击处理模块 1109, 具体用于才艮据 MAC地址仿 冒攻击行为的入方向, 即, 接收携带仿冒源 MAC地址的所述第一报 文的第一接口, 判断 MAC仿冒攻击源的位置; 根据被仿冒的 MAC 地址,丟弃 MAC地址仿冒攻击行为的入方向所接收的所有攻击报文, 即源 MAC地址为所述被仿冒的 MAC地址的报文, 从而阻断攻击流 量, 隔离攻击源。
本发明实施例中, 所述 PE所述 MAC地址学习装置, 在判定存 在 MAC地址仿冒攻击后, 进行攻击处理, 进一步提高 VPLS网络的 安全性。 可以理解的是, VPLS中各个 PE都会进行 MAC学习, 如果 PE采取阻断攻击处理, 则位于某个站点内的攻击源发出的 MAC地 址仿冒攻击报文, 会被该站点所接入的 PE阻断在该站点内, 而不会 被传输到 VPLS网络中其他 PE, 达到阻断攻击流量, 隔离攻击源的 目的, 进一步增强对 MAC地址仿冒攻击的防范。
如图 11 d所示,所述装置进一步的还可以包括 VC建立模块 1110, 用于与远端 PE间基于服务等级为所述第一 VSI的 sub-VSI分配 VC 标识和 VC标签, 构建基于服务等级的 VPLS; 具体地, 所述 VC建 立模块 1110可以包括如本发明图 10a-10c所示 VC标签分配装置中的 各个模块, 用于实现本发明图 2、 图 3或图 4所示的方法, 在此不再 赘述。
所述装置进一步的还可以包括转发模块, 用于转发所述第一报 文; 所述转发模块, 具体用于获取所述第一报文的目的 MAC地址, 当所述本地 PE的 MAC转发表中存在与所述第一 VSI的标识和所述 第一报文的目的 MAC地址匹配的第二 MAC转发表项时, 获取所述 第二 MAC转发表项的出接口标识; 若所述第二 MAC转发表项的出 接口标识对应的接口为 VC时,根据所述第一 VSI、所述第一 sub-VSI 的服务等级和所述第二 MAC 转发表项的出接口标识查询所述本地 PE的出标签映射表, 获取转发所述第一报文的出 VC标签, 然后封 装并转发所述第一报文; 若所述第二 MAC转发表项的出接口标识对 应的接口为 AC时, 向所述第二 MAC转发表项的出接口标识对应的 AC转发所述第一报文。 所述转发模块, 具体还用于如果所述第一报 文是远端 PE发来的广播报文, 则向同一 VPLS, 即所述第一 VSI的 所有直连端口转发所述第一报文;如果所述第一报文是本地用户,即, 连接到所述本地 PE的 CE, 发来的广播报文, 则向同一 VPLS, 即所 述第一 VSI 的所有其它直连端口以及所有其他 PE转发所述第一报 文; 如果所述第一报文的目的 MAC地址为非广播地址的报文, 且所 述 PE的 MAC转发表中还没有学习到所述目的 MAC地址, 则广播 所述第一报文。
本发明实施例提供的 MAC地址学习装置, 通过构建基于服务等 级的 VPLS, 并在 MAC地址学习过程中, 基于服务等级判断 MAC 学习是否异常, 可以自动识别并防止来自低服务等级的 sub-VSI的报 文, 仿冒攻击高服务等级的 MAC地址。 可以理解的是, 本发明实施 例中, 可以将网关设备、 DHCP服务器、 DNS 服务器等重要设备的 AC或 MAC地址设置为高服务等级,相应建立高服务等级的 sub-VSI, 从而在 MAC地址学习过程中, 可以自动识别并防止 MAC地址仿冒 攻击, 避免因 MAC地址仿冒攻击引起网络服务质量下降甚至中断。 参见图 12,为本发明实施例提供的运营商边缘 PE设备的硬件结 构示意图, 所述 PE包括处理器 1201, 存储器 1202, 通信接口 1203 和总线 1204;其中 1201,存储器 1202,通信接口 1203通过总线 1204 相互连接; 总线 1204可以是 ISA总线、 PCI总线或 EISA总线等。 所 述总线可以分为地址总线、 数据总线、 控制总线等。 为便于表示, 图 12 中仅用一条粗线表示, 但并不表示仅有一根总线或一种类型的总 线。
存储器 1202, 用于存放程序。 具体地, 程序可以包括程序代码, 所述程序代码包括计算机操作指令。存储器 1202可能包含高速 RAM 存储器, 也可能还包括非易失性存储器 ( non- volatile memory ) , 例 如至少一个磁盘存储器。
处理器 1201 可以是通用处理器, 包括中央处理器 (Central Processing Unit, 简称 CPU ) 、 网络处理器(Network Processor, 简 称 NP )等;还可以是数字信号处理器(DSP )、专用集成电路(ASIC )、 现成可编程门阵列 (FPGA )或者其他可编程逻辑器件、 分立门或者 晶体管逻辑器件、 分立硬件组件。
处理器 1201执行所述程序代码, 用于向远端 PE通告 VSI的本 地 sub-VSI,获取所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签, 并将所述 VSI的标识、 所述本地 sub-VSI的服务等级、 所 述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签的对应关 系保存到所述 PE的出标签映射表;接收所述远端 PE通告的所述 VSI 的远端 sub-VSI,向所述远端 PE为所述远端 sub-VSI分配 VC标识和 VC标签。
所述通信接口 1203,用于与网络中设备通信, 包括所述远端 PE, 接入所述 PE的用户边缘 CE设备等。
本发明实施例中, 将一个 VSI分为不同服务等级的 sub-VSI (子 VSI ) , 并将 VSI内的终端划分到不同服务等级的 sub-VSI中, 一个 sub-VSI具体通过 VSI和一个 sub-VSI的服务等级来标识。 一个 PE上可 能有 VSI的所有 sub-VSI的服务等级, 也可能只有部分 sub-VSI的服务 等级,各个 PE上保存终端服务等级信息表,所述终端服务等级信息表 中包括终端标识、 VSI和 sub-VSI的服务等级的对应关系, 通常预先配 置在各个 PE上。 结合图 1所示 VPLS网络, 各个 PE上的服务等级信息 表可参见表 la, 表 2a和表 3a, 具体地可参考本发明实施例前述内容, 在此不再赘述。 可选地, 处理器 1201, 还用于根据所述 PE的终端服务 等级信息表, 确定向所述远端 PE通告的所述 VSI的所述所有本地 sub-VSI。
可选地,所述存储器 1202还用于保存所述 PE的终端服务等级信 息表, 以及所述 PE的入标签映射表和出标签映射表。
当采用 DoD方式进行标签分配时, 处理器 1201, 具体用于向所 述远端 PE发送第一 LDP 标签请求消息通告所述 VSI 的所述本地 sub-VSI, 所述第一 LDP标签请求消息中包括所述 VSI的标识和所述 本地 sub-VSI的服务等级,接收所述远端 PE发送的所述第一 LDP标 签映射消息, 所述第一 LDP标签映射消息包括所述 VSI的标识, 所 述本地 sub-VSI的服务等级、所述第一 VC标识和所述第一 VC标签, 从所述第一 LDP标签映射消息中获取所述第一 VC标识和所述第一 VC标签, 并将所述 VSI的标识、 所述本地 sub-VSI的服务等级、 所 述第一 VC标识和所述第一 VC标签的对应关系保存到所述 PE的出 标签映射表;具体还用于接收所述远端 PE发送的第二 LDP标签请求 消息, 所述第二 LDP标签请求消息中包括所述 VSI的标识和所述远 端 sub-VSI的服务等级, 为所述 VSI的所述远端 sub-VSI分配第二 VC标识和第二 VC标签, 并将所述第二 VC标签、 所述 VSI的标识 和所述远端 sub-VSI的服务等级保存到所述 PE的入标签映射表中, 向所述远端 PE发送第二 LDP标签映射消息, 响应所述第二 LDP标 签请求消息, 所述第二 LDP标签映射消息中包括所述 VSI的标识, 所述远端 sub-VSI的服务等级、 所述第二 VC标识和所述第二 VC标 签。
当采用 DU方式进行标签分配时, 处理器 1201, 具体用于向所 述远端 PE发送第一 LDP 标签映射消息通告所述 VSI 的所述本地 sub-VSI, 所述第一 LDP标签映射消息中包括所述 VSI的标识, 所述 本地 sub-VSI的服务等级、 第一 VC标识和第一 VC标签; 向所述远 端 PE为所述 VSI的所述本地 sub-VSI分配所述第一 VC标识和所述 第一 VC标签, 并将所述 VSI的标识、 所述本地 sub-VSI的服务等级 和第一 VC标签保存到所述 PE的入标签映射表中;接收所述远端 PE 发送的第二 LDP标签映射消息, 所述第二 LDP标签映射消息包括所 述 VSI的标识, 所述本地 sub-VSI的服务等级、 第二 VC标识和第二 VC标签,从所述第二 LDP标签映射消息中获取所述本地 sub-VSI的 第二 VC标识和第二 VC标, 将所述 VSI的标识、 所述本地 sub-VSI 的服务等级、 所述第二 VC标识和所述第二 VC标签的对应关系保存 到所述 PE的出标签映射表; 具体还用于接收所述远端 PE发送的第 三 LDP标签映射消息, 所述第三 LDP标签映射消息中包括所述 VSI 的标识, 所述远端 sub-VSI的服务等级、 第三 VC标识和第三 VC标 签, 从所述第三 LDP标签映射消息中获取所述远端 PE为所述远端 sub-VSI分配的第三 VC标识和第三 VC标签,并将所述 VSI的标识、 所述远端 sub-VSI的服务等级、 第三 VC标识和第三 VC标签的对应 关系保存到所述 PE的出标签映射表;为所述 VSI的所述远端 sub-VSI 分配第四 VC标识和第四 VC标签,并将所述第四 VC标签、所述 VSI 的标识和所述远端 sub-VSI的服务等级保存到所述 PE的入标签映射 表中; 向所述远端 PE发送第四 LDP标签映射消息, 响应所述第三 LDP标签映射消息, 所述第四 LDP标签映射消息中包括所述 VSI, 所述远端 sub-VSI的服务, 所述第四 VC标识和所述第四 VC标签。
进一步的, 所述处理器 1201, 还可以用于从第一接口接收第一 报文, 获取所述第一报文的源 MAC地址, 以及所述第一报文所属的 第一虚拟交换实例 VSI的标识和第一子虚拟交换实例 sub-VSI的服务 等级,根据所述第一 VSI的标识和所述第一报文的源 MAC地址查询 所述 PE的 MAC转发表, 所述 MAC转发表包括 VSI标识, MAC地 址, 出接口标识和 MAC服务等级的对应关系; 当所述 PE的 MAC 转发表中不存在与所述第一 VSI的标识和所述第一报文的源 MAC地 址匹配的表项时, 将所述第一 VSI的标识、 所述第一 文的源 MAC 地址、 所述第一接口的标识及所述第一 sub-VSI的服务等级存入所述 PE的 MAC转发表中; 当所述 PE的 MAC转发表中存在与所述第一 VSI的标识和所述第一报文的源 MAC地址匹配的第一 MAC转发表 项时, 获取所述第一 MAC转发表项的 MAC服务等级, 判断所述第 一 sub-VSI 的服务等级是否高于或等于所述第一 MAC 转发表项的 MAC服务等级, 若所述第一 sub-VSI的服务等级高于或等于所述第 一 MAC转发表项的 MAC服务等级, 用所述第一接口的标识及所述 第一 sub-VSI的服务等级更新所述第一 MAC转发表项的出接口标识 和 MAC服务等级;若所述第一 sub-VSI服务等级低于所述第一 MAC 转发表项的 MAC服务等级, 判定存在 MAC地址仿冒攻击, 不刷新 所述 MAC转发表。
可选地, 所述存储器 1202还用于保存所述 PE的 MAC转发表。 当所述第一报文中包括第一 VC标签, 所述第一接口具体为第一 VC时, 所述处理器 1201, 具体用于根据所述第一 VC标签, 查询所 述本地 PE的入标签映射表, 获取所述入标签映射表中入 VC标签与 所述第一 VC标签匹配的第一标签映射表项的 VSI标识和 sub-VSI的 服务等级, 作为所述第一报文所属的第一 VSI的标识和第一 sub-VSI 的服务等级。
当所述第一接口具体为第一 AC时,所述处理器 1201,具体用于 根据所述第一报文的源 MAC地址或者所述第一 AC的标识, 查询所 述 PE的终端服务等级信息表, 获取所述终端服务等级信息表中终端 标识与所述第 文的源 MAC地址或者所述第一 AC的标识匹配的 表项的 VSI标识和 sub-VSI的服务等级,作为所述第一报文所属的第 一 VSI的标识和第一 sub-VSI的服务等级;所述终端服务等级信息表 中包括终端标识、 VSI标识和 sub-VSI的服务等级的对应关系, 终端 标识包括 MAC地址或 AC标识。 进一步可选地, 所述处理器 1201, 具体用于根据所述第一报文的源 MAC地址查询所述终端服务等级信 息表; 当所述终端服务等级信息表中第一终端服务等级信息表项的终 端标识与所述第一报文的源 MAC地址相同时, 获取所述第一终端服 务等级信息表项的 VSI标识和 sub-VSI的服务等级; 当所述终端服务 等级信息表中任一表项的终端标识与所述第一报文的源 MAC地址均 不相同时, 根据所述第一 AC的标识查询所述终端服务等级信息表, 获取所述终端服务等级信息表中终端标识与所述第一 AC的标识相同 的第二终端服务等级信息表项的 VSI标识和 sub-VSI的服务等级。
进一步地, 所述处理器 1201,还可以用于当判定存在 MAC地址 仿冒攻击时, 执行发送告警信息、 记录攻击日志、 进行攻击溯源、 阻 断攻击中的一种或多种处理。 所述处理器 1201, 具体用于才艮据 MAC 地址仿冒攻击行为的入方向, 即, 接收携带仿冒源 MAC地址的第一 报文的第一接口,判断 MAC仿冒攻击源的位置;根据被仿冒的 MAC 地址,丟弃 MAC地址仿冒攻击行为的入方向所接收的所有攻击报文, 即源 MAC地址为所述被仿冒的 MAC地址的报文, 从而阻断攻击流 量, 隔离攻击源, 进一步提高 VPLS网络的安全性。
本发明实施例提供的 PE可以基于服务等级构建 VPLS, 并在基 于服务等级的 VPLS中进行 MAC地址学习, 实现 MAC地址仿冒攻 击的自动识别和防范, 避免因 MAC地址仿冒攻击引起网络服务质量 下降甚至中断。
参见图 13, 是本发明实施例提供的 VPLS 网络的系统示意图, 如图 13所示, 所述 VPLS网络包括至少两个 PE设备, 所述 PE设备 包括如本发明图 10a-10c、 图 l la-lle和图 12所示的装置, 可以实现 基于服务等级的 VC标签分配和 MAC地址学习。
需要说明的是, 本发明实施例主要以采用 LDP协议作为 PW信 令协议的 Martini方式 VPLS场景说明如何基于服务等级构建 VPLS 和 MAC地址学习,从而实现 MAC地址仿冒攻击的自动识别和防范; 本领域技术人员可以理解的是, 本发明技术方案在 Kompella 方式 VPLS场景下,通过对 BGP协议的适当扩展,其实现原理和过程相似。
以上所述, 仅为本发明较佳的具体实施方式, 但本发明的保护范 围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技 术范围内, 可轻易想到的变化或替换, 都应涵盖在本发明的保护范围 之内。

Claims

权 利 要 求
1、 一种 VPLS 中介质访问控制 MAC地址学习的方法, 其特征 在于, 包括:
本地运营商边缘 PE从第一接口接收第一报文;
获取所述第一报文的源 MAC地址, 以及所述第一报文所属的第 一虚拟交换实例 VSI的标识和第一子虚拟交换实例 sub-VSI的服务等 级;
根据所述第一 VSI的标识和所述第一报文的源 MAC地址查询所 述本地 PE的 MAC转发表, 所述 MAC转发表包括 VSI标识, MAC 地址, 出接口标识和 MAC服务等级的对应关系;
当所述本地 PE的 MAC转发表中存在与所述第一 VSI的标识和 所述第一报文的源 MAC地址匹配的第一 MAC转发表项时, 获取所 述第一 MAC转发表项的 MAC服务等级, 若所述第一 sub-VSI的服 务等级高于或等于所述第一 MAC转发表项的 MAC服务等级, 用所 述第一接口的标识及所述第一 sub-VSI 的服务等级更新所述第一 MAC转发表项的出接口标识和 MAC服务等级。
2、 根据权利要求 1所述的方法, 其特征在于, 还包括: 若所述第一 sub-VSI的服务等级低于所述第一 MAC转发表项的 MAC服务等级, 判定存在 MAC地址仿冒攻击。
3、 根据权利要求 2所述的方法, 其特征在于, 还包括: 所述本地 PE执行: 发送告警信息, 记录攻击日志, 攻击溯源, 阻断攻击中的一种或多种处理。
4、 根据权利要求 1至 3任一项所述的方法, 其特征在于, 还包 括:
当所述本地 PE的 MAC转发表中不存在与所述第一 VSI的标识 和所述第一 文的源 MAC地址匹配的表项时,将所述第一 VSI的标 识、 所述第一报文的源 MAC地址、 所述第一接口的标识及所述第一 sub-VSI的服务等级的对应关系存入所述本地 PE的 MAC转发表中。
5、 根据权利要求 1至 4任一项所述的方法, 其特征在于, 所述 第一报文中包括第一虚拟电路 VC 标签, 所述第一接口具体为第一 VC;
相应地, 所述获取所述第一报文所属的第一 VSI 的标识和第一 sub-VSI的服务等级具体包括:
根据所述第一 VC标签, 查询所述本地 PE的入标签映射表; 获取所述本地 PE的入标签映射表中入 VC标签与所述第一 VC 标签匹配的第一标签映射表项的 VSI标识和 sub-VSI的服务等级,作 为所述第一报文所属的第一 VSI的标识和第一 sub-VSI的服务等级。
6、 根据权利要求 1至 4任一项所述的方法, 其特征在于, 所述 第一接口具体为第一接入电路 AC;
相应地, 所述获取所述第一报文所属的第一 VSI 的标识和第一 sub-VSI的服务等级具体包括:
根据所述第一报文的源 MAC地址或者所述第一 AC的标识, 查 询所述本地 PE的终端服务等级信息表, 所述终端服务等级信息表中 包括终端标识、 VSI标识和 sub-VSI的服务等级的对应关系;
获取所述终端服务等级信息表中终端标识与所述第一报文的源 MAC地址或者所述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI 的服务等级, 作为所述第一报文所属的第一 VSI 的标识和第一 sub-VSI的服务等级。
7、 根据权利要求 6所述的方法, 其特征在于, 所述根据所述第 一才艮文的源 MAC地址或者所述第一 AC的标识, 查询所述本地 PE 的终端服务等级信息表,获取所述终端服务等级信息表中终端标识与 所述第一报文的源 MAC地址或者所述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI的服务等级具体包括:
根据所述第一报文的源 MAC 地址查询所述终端服务等级信息 表;
当所述终端服务等级信息表中第一终端服务等级信息表项的终 端标识与所述第一报文的源 MAC地址相同时, 获取所述第一终端服 务等级信息表项的 VSI标识和 sub-VSI的服务等级;
当所述终端服务等级信息表中任一表项的终端标识与所述第一 报文的源 MAC地址均不相同时, 根据所述第一 AC的标识查询所述 终端服务等级信息表,获取所述终端服务等级信息表中终端标识与所 述第一 AC 的标识相同的第二终端服务等级信息表项的 VSI标识和 sub-VSI的服务等级。
8、 根据权利要求 1至 7任一项所述的方法, 其特征在于, 在接 收第一报文之前, 还包括:
所述本地 PE向远端 PE通告所述第一 VSI的本地 sub-VSI; 获取所述远端 PE为所述本地 sub-VSI分配的所述 VC标识和出 VC标签;
将所述第一 VSI的标识、 所述本地 sub-VSI的服务等级、 所述远 端 PE为所述本地 sub-VSI分配的所述 VC标识和所述出 VC标签的 对应关系保存到所述本地 PE的出标签映射表。
9、 根据权利要求 1至 8任一项所述的方法, 其特征在于, 在接 收第一报文之前, 还包括:
所述本地 PE接收所述远端 PE 通告的所述第一 VSI 的远端 sub-VSI; 向所述远端 PE为所述远端 sub-VSI分配 VC标识和入 VC标签; 在所述本地 PE的入标签映射表保存所述第一 VSI的标识、 所述 所有远端 sub-VSI的服务等级、 所述本地 PE为所述远端 sub-VSI分 配的所述 VC标识和所述入 VC标签的对应关系。
10、 一种虚拟专用局域网业务 VPLS中虚拟电路 VC标签分配的 方法, 其特征在于, 包括:
本地运营商边缘 PE向远端 PE通告虚拟交换实例 VSI的本地子 虚拟交换实例 sub-VSI;
获取所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标 签;
将所述 VSI、 所述本地 sub-VSI的服务等级、 所述远端 PE为所 述本地 sub-VSI分配的 VC标识和 VC标签的对应关系保存到所述本 地 PE的出标签映射表。
11、 根据权利要求 10所述的方法, 其特征在于, 所述获取所述 远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签具体包括: 接收所述远端 PE发送的标签分发协议 LDP标签映射消息,从所 述 LDP标签映射消息中获取所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签,所述 LDP标签映射消息中包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 所述远端 PE为所述本地 sub-VSI分 配的 VC标识和 VC标签。
12、 根据权利要求 10或 11所述的方法, 其特征在于, 还包括: 所述本地 PE接收所述远端 PE通告的所述 VSI的远端 sub-VSI; 所述本地 PE向所述远端 PE为所述 VSI的所述远端 sub-VSI分 配 VC标识和 VC标签;
在所述本地 PE的入标签映射表保存所述 VSI的标识、 所述远端 sub-VSI的服务等级、 所述远端 PE为所述 VSI的所述远端 sub-VSI 分配的 VC标识和 VC标签的对应关系。
13、 根据权利要求 10至 12任一项所述的方法, 其特征在于, 所 述本地 PE向远端 PE通告 VSI的本地 sub-VSI具体包括:
所述本地 PE向所述远端 PE发送第一 LDP标签请求消息通告所 述 VSI的所述本地 sub-VSI,所述第一 LDP标签请求消息中包括所述 VSI的标识和所述本地 sub-VSI的服务等级。
14、 根据权利要求 10至 12任一项所述的方法, 其特征在于, 所 述本地 PE向远端 PE通告 VSI的所有本地 sub-VSI具体包括:
所述本地 PE向所述远端 PE发送第一 LDP标签映射消息通告所 述 VSI的所述本地 sub-VSI,所述第一 LDP标签映射消息中包括所述 VSI的标识,所述本地 sub-VSI的服务等级,第一 VC标识和第一 VC 标签。
15、 根据权利要求 14所述的方法, 其特征在于, 在所述本地 PE 向所述远端 PE发送所述第一 LDP标签映射消息通告所述 VSI的所述 本地 sub-VSI之前, 还包括:
所述本地 PE向所述远端 PE为所述本地 sub-VSI分配所述第一 VC标识和所述第一 VC标签;
在所述本地 PE的入标签映射表保存所述 VSI的标识、 所述本地 sub-VSI的服务等级、 所述第一 VC标识和所述第一 VC标签的对应 关系。
16、 根据权利要求 10至 15任一项所述的方法, 其特征在于, 在 所述本地 PE向远端 PE通告 VSI的所有本地 sub-VSI之前, 还包括: 所述本地 PE根据所述本地 PE的终端服务等级信息表确定向所 述远端 PE通告的所述 VSI的所述本地 sub-VSI。
17、 一种虚拟电路 VC标签分配装置, 其特征在于, 包括: 发送器, 用于向远端运营商边缘 PE通告虚拟交换实例 VSI的本 地子虚拟交换实例 sub-VSI;
获取模块,用于获取所述远端 PE为所述 VSI的所述本地 sub-VSI 分配的 VC标识和 VC标签, 将所述 VSI的标识、 所述本地 sub-VSI 的服务等级, 及所述远端 PE为所述本地 sub-VSI分配的 VC标识和 VC标签的对应关系保存到所述本地 PE的出标签映射表。
18、 根据权利要求 17所述的装置, 其特征在于, 还包括: 接收器, 用于接收所述远端 PE通告所述 VSI的远端 sub-VSI; 标签分配模块,用于向所述远端 PE为所述远端 sub-VSI分配 VC 标识和 VC标签。
19、 根据权利要求 18所述的装置, 其特征在于, 所述发送器, 具体用于向所述远端 PE发送 LDP标签请求消息通告所述 VSI的所述 本地 sub-VSI,所述 LDP标签请求消息中包括所述 VSI的标识和所述 本地 sub-VSI的服务等级;
所述接收器,还用于接收所述远端 PE发送的 LDP标签映射消息, 所述 LDP标签映射消息包括所述 VSI的标识, 所述本地 sub-VSI的 服务等级, 第一 VC标识和第一 VC标签;
所述获取模块具体用于从所述接收器接收的所述 LDP标签映射 消息中获取所述第一 VC标识和所述第一 VC标签, 并将所述 VSI的 标识、 所述本地 sub-VSI的服务等级、 所述第一 VC标识和所述第一 VC标签的对应关系保存到所述 PE的出标签映射表。
20、 根据权利要求 18所述的装置, 其特征在于, 所述发送器, 具体用于向所述远端 PE发送第一 LDP标签映射消息通告所述 VSI 的所述本地 sub-VSI, 所述第一 LDP标签映射消息中包括所述 VSI 的标识, 所述本地 sub-VSI的服务等级、 第一 VC标识和第一 VC标 签;
所述接收器,还用于接收所述远端 PE发送的第二 LDP标签映射 消息, 所述第二 LDP标签映射消息包括所述 VSI的标识, 所述本地 sub-VSI的服务等级、 第二 VC标识和第二 VC标签;
所述获取模块, 具体用于从所述接收器接收的所述第二 LDP标 签映射消息中获取所述第二 VC标识和第二 VC标签,将所述 VSI的 标识, 所述本地 sub-VSI的服务等级、 第二 VC标识和第二 VC标签 的对应关系保存到所述 PE的出标签映射表。
21、 根据权利要求 20所述的装置, 其特征在于, 所述标签分配 模块, 还用于向所述远端 PE为所述 VSI的所述本地 sub-VSI分别所 述第一 VC标识和所述第一 VC标签, 并在所述本地 PE的入标签映 射表保存所述 VSI的标识、 所述本地 sub-VSI的服务等级、 所述第一 VC标识和所述第一 VC标签的对应关系。
22、 根据权利要求 17至 21任一项所述的装置, 其特征在于, 还 包括确定模块, 用于根据所述 PE的终端服务等级信息表, 确定向所 述远端 PE通告的所述 VSI的所述本地 sub-VSI。
23、一种介质访问控制 MAC地址学习装置, 其特征在于, 包括: 接收器, 用于从第一接口接收第一报文;
第一获取模块, 用于获取所述第一报文的源 MAC地址, 以及所 述第一报文所属的第一虚拟交换实例 VSI的标识和第一子虚拟交换实 例 sub-VSI的服务等级;
所述查询模块,用于根据所述第一 VSI的标识和所述第一报文的 源 MAC地址查询 PE的 MAC转发表, 所述 MAC转发表包括 VSI 标识, MAC地址, 出接口标识和 MAC服务等级的对应关系; 第二获取模块, 用于当所述 PE的 MAC转发表中存在与所述第 一 VSI的标识和所述第一报文的源 MAC地址匹配的第一 MAC转发 表项时, 获取所述第一 MAC转发表项的 MAC服务等级;
判断模块, 用于判断所述第一获取模块中获取的所述第一 sub-VSI的服务等级是否高于或等于所述第二获取模块中获取的所述 第一 MAC转发表项的 MAC服务等级;
更新模块, 用于当所述第一 sub-VSI的服务等级高于或等于所述 第一 MAC转发表项的 MAC服务等级时, 用所述第一接口的标识及 所述第一 sub-VSI的服务等级更新所述第一 MAC转发表项的出接口 标识和 MAC服务等级。
24、 根据权利要求 23所述的装置, 其特征在于, 还包括: 攻击判定模块, 用于当所述第一 sub-VSI的服务等级低于所述第 一 MAC转发表项的 MAC服务等级时, 判定存在 MAC地址仿冒攻 击;
地址存储模块, 用于当所述 PE的 MAC转发表中不存在与所述 第一 VSI和所述第 文的源 MAC地址匹配的表项时,将所述第一 VSI、所述第一报文的源 MAC地址、所述第一接口及所述第一 sub-VSI 的服务等级的对应关系存入所述 PE的 MAC转发表中。
25、 根据权利要求 23或 24所述的装置, 其特征在于, 当所述第 一报文中包括第一虚拟电路 VC标签, 所述第一接口具体为第一 VC 时, 所述第一获取模块, 具体用于根据所述第一 VC标签, 查询所述 PE的入标签映射表, 获取所述入标签映射表中入 VC标签与所述第 一 VC标签匹配的第一标签映射表项的 VSI标识和 sub-VSI的服务等 级,作为所述第一报文所属的第一 VSI的标识和第一 sub-VSI的服务 等级。
26、 根据权利要求 23或 24所述的装置, 其特征在于, 当所述第 一接口具体为第一 AC时, 所述第一获取模块, 具体用于根据所述第 一才艮文的源 MAC地址或者所述第一 AC的标识, 查询所述本地 PE 的终端服务等级信息表,获取所述终端服务等级信息表中终端标识与 所述第一报文的源 MAC地址或者所述第一 AC的标识匹配的表项的 VSI标识和 sub-VSI的服务等级, 作为所述第一报文所属的第一 VSI 的标识和第一 sub-VSI的服务等级。
27、 根据权利要求 26所述的装置, 其特征在于, 所述第一获取 模块, 具体用于根据所述第一报文的源 MAC地址查询所述终端服务 等级信息表; 当所述终端服务等级信息表中第一终端服务等级信息表 项的终端标识与所述第一 文的源 MAC地址相同时, 获取所述第一 终端服务等级信息表项的 VSI标识和 sub-VSI的服务等级; 当所述终 端服务等级信息表中任一表项的终端标识与所述第一报文的源 MAC 地址均不相同时,根据所述第一 AC的标识查询所述终端服务等级信 息表, 获取所述终端服务等级信息表中终端标识与所述第一 AC的标 识相同的第二终端服务等级信息表项的 VSI标识和 sub-VSI的服务等 级。
28、 根据权利要求 24至 27任一项所述的装置, 其特征在于, 还 包括攻击处理模块, 用于当所述攻击判定模块判定存在 MAC地址仿 冒攻击时, 执行发送告警信息、 记录攻击日志、 进行攻击溯源、 阻断 攻击中的一种或多种处理。
29、 根据权利要求 23至 28任一项所述的装置, 其特征在于, 还 包括 VC建立模块, 用于与远端 PE间基于服务等级为所述第一 VSI 的 sub-VSI分配 VC标识和 VC标签, 建立 VC。
30、 一种虚拟专用局域网业务 VPLS网络, 其特征在于, 包括至 少两个运营商边缘 PE设备, 所述 PE设备包括如权利要求 17至 29 任一项所述的装置。
PCT/CN2012/087962 2012-12-31 2012-12-31 Vpls中vc标签分配和mac地址学习的方法,设备和系统 WO2014101155A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/087962 WO2014101155A1 (zh) 2012-12-31 2012-12-31 Vpls中vc标签分配和mac地址学习的方法,设备和系统
CN201280002587.9A CN104040965B (zh) 2012-12-31 2012-12-31 Vpls中vc标签分配和mac地址学习的方法,设备和系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/087962 WO2014101155A1 (zh) 2012-12-31 2012-12-31 Vpls中vc标签分配和mac地址学习的方法,设备和系统

Publications (1)

Publication Number Publication Date
WO2014101155A1 true WO2014101155A1 (zh) 2014-07-03

Family

ID=51019767

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/087962 WO2014101155A1 (zh) 2012-12-31 2012-12-31 Vpls中vc标签分配和mac地址学习的方法,设备和系统

Country Status (2)

Country Link
CN (1) CN104040965B (zh)
WO (1) WO2014101155A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1625144A (zh) * 2003-12-01 2005-06-08 华为技术有限公司 一种在二层虚拟专用网的骨干网中保证业务质量的方法
CN102255787A (zh) * 2010-05-19 2011-11-23 杭州华三通信技术有限公司 一种基于服务质量的报文处理方法和运营商网络边缘设备
CN102404179A (zh) * 2010-09-19 2012-04-04 杭州华三通信技术有限公司 一种报文处理的方法和装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945046B (zh) * 2010-09-15 2016-05-25 中兴通讯股份有限公司 一种vpls网络服务质量映射配置方法和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1625144A (zh) * 2003-12-01 2005-06-08 华为技术有限公司 一种在二层虚拟专用网的骨干网中保证业务质量的方法
CN102255787A (zh) * 2010-05-19 2011-11-23 杭州华三通信技术有限公司 一种基于服务质量的报文处理方法和运营商网络边缘设备
CN102404179A (zh) * 2010-09-19 2012-04-04 杭州华三通信技术有限公司 一种报文处理的方法和装置

Also Published As

Publication number Publication date
CN104040965A (zh) 2014-09-10
CN104040965B (zh) 2017-02-01

Similar Documents

Publication Publication Date Title
US8875233B2 (en) Isolation VLAN for layer two access networks
Del Piccolo et al. A survey of network isolation solutions for multi-tenant data centers
JP4960437B2 (ja) データ通信ネットワークに関する論理グループエンドポイントディスカバリ
US11290386B2 (en) FlowSpec message processing method and system, and apparatus
EP1816796B1 (en) Bi-directional forwarding in ethernet-based service domains over networks
WO2016101646A1 (zh) 以太虚拟网络的接入方法及装置
WO2009094928A1 (fr) Procédé et équipement de transmission d'un message basé sur le protocole de tunnel de niveau 2
WO2017186069A1 (zh) 一种数据传输方法及网络设备
EP2724508B1 (en) Preventing neighbor-discovery based denial of service attacks
WO2010072096A1 (zh) IPv6环境下提高邻居发现安全性的方法及宽带接入设备
WO2009033428A1 (fr) Procédé, système et dispositif pour retirer une adresse de commande d'accès au support
WO2018214809A1 (zh) 消息发送方法及装置、存储介质
WO2011072532A1 (zh) 报文处理方法、接入设备和通信系统
WO2007062592A1 (fr) Systeme, procede et routeur de l2vpn d'interconnexions point a multipoints, et multipoints a multipoints
CN111064596A (zh) 对于用于多宿主节点故障的bum流量的节点保护
WO2008058477A1 (fr) Procédé, appareil et système de gestion d'informations de localisation
CN102045250B (zh) Vpls中组播报文的转发方法和服务提供商边缘设备
WO2011107052A2 (zh) 一种防止地址冲突的方法及接入节点
WO2007076692A1 (fr) Procédé, système et dispositif permettant le transport de services vpls dans un réseau
WO2009135422A1 (zh) 一种QinQ内广播的实现方法和装置
WO2015074423A1 (zh) 一种接入网关中数据报文的转发处理方法
US9654304B2 (en) Method and apparatus for sending transparent interconnection of lots of links data frame
US9025606B2 (en) Method and network node for use in link level communication in a data communications network
WO2012146139A1 (zh) 一种报文的过滤方法和接入设备
CN101252456B (zh) 组播业务批发的方法、系统及其装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12891266

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12891266

Country of ref document: EP

Kind code of ref document: A1