WO2012109864A1 - 报文转发方法和装置 - Google Patents

报文转发方法和装置 Download PDF

Info

Publication number
WO2012109864A1
WO2012109864A1 PCT/CN2011/077818 CN2011077818W WO2012109864A1 WO 2012109864 A1 WO2012109864 A1 WO 2012109864A1 CN 2011077818 W CN2011077818 W CN 2011077818W WO 2012109864 A1 WO2012109864 A1 WO 2012109864A1
Authority
WO
WIPO (PCT)
Prior art keywords
mac address
packet
virtual mac
user
virtual
Prior art date
Application number
PCT/CN2011/077818
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/CN2011/077818 priority Critical patent/WO2012109864A1/zh
Priority to CN201180001348.7A priority patent/CN102318290B/zh
Publication of WO2012109864A1 publication Critical patent/WO2012109864A1/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/4604LAN interconnection over a backbone network, e.g. Internet, Frame Relay
    • H04L12/462LAN interconnection over a bridge based backbone
    • H04L12/4625Single bridge functionality, e.g. connection of two networks over a single bridge
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2596Translation of addresses of the same type other than IP, e.g. translation from MAC to MAC addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Definitions

  • the present invention relates to the field of local area networks, and in particular, to a packet forwarding method and apparatus.
  • VPLS Virtual Private LAN Service
  • MPLS Multi-Protocol Label Switching
  • L2VPN Layer 2 Virtual Private Network
  • HVPLS Hierarchical VPLS
  • HVPLS Hierarchical VPLS
  • the usual method is to increase the capacity of the device's MAC address memory.
  • an embodiment of the present invention provides a packet forwarding method and apparatus.
  • the technical solution is as follows:
  • a packet forwarding method includes:
  • the source MAC address of the user packet is converted into a virtual MAC address, and the converted user packet is forwarded according to the destination address of the user packet.
  • a packet forwarding method includes:
  • the corresponding MAC address is forwarded according to the virtual MAC address.
  • the publication forwards the user message.
  • a message forwarding device includes:
  • a receiving module configured to receive a user message
  • a conversion module configured to convert a source MAC address of the user packet into a virtual MAC address
  • the forwarding module is configured to forward the converted user packet according to the destination address of the user packet.
  • a message forwarding device includes:
  • a receiving module configured to receive a user message
  • a determining module configured to determine whether a destination address of the user packet is a virtual MAC address
  • a forwarding module configured to: when the determining module determines that the destination address of the user packet is a virtual MAC address, forwarding the user packet according to the forwarding table corresponding to the virtual MAC address.
  • FIG. 1 is a schematic structural diagram of a PLS metropolitan area network according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a packet forwarding method according to an embodiment of the present invention.
  • FIG. 3 is a diagram showing an example of a virtual MAC address provided by an embodiment of the present invention.
  • FIG. 4 is a flowchart of a packet forwarding method according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a packet forwarding method according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a packet forwarding method according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention. detailed description
  • a packet forwarding party according to an embodiment of the present invention is provided by using the HVPLS scenario shown in FIG. 1 as an example.
  • the method is introduced.
  • the method execution body is a DSLAM (Digital Subscriber Line Access Multiplexer). It can be understood by those skilled in the art that the execution body of the packet forwarding method provided in this embodiment is not limited to the DSLAM, and may be performed by other Layer 2 aggregation devices, such as a switch having an aggregation function.
  • DSLAM Digital Subscriber Line Access Multiplexer
  • the packet forwarding method includes:
  • the network generally includes: an access device, an intermediate device, and a network side device, where the intermediate device is generally a VPLS-capable router.
  • the access device in the embodiment of the present invention is a DSLAM
  • the intermediate device is a UPE (Underlayer Provider Edge) or an SPE (Superstratum Provider Edge).
  • UPE Underlayer Provider Edge
  • SPE Superstratum Provider Edge
  • BRAS Broadband Remote Access Server, Broadband Remote Access Server
  • the user packet described in this embodiment may be a data packet or a protocol packet.
  • the DSLAM receives a user message from a connected user equipment, where the user message includes a source MAC source MAC address and a destination MAC destination address.
  • the DSLAM translates the source MAC source MAC address into a virtual MAC address as shown in FIG. 3, the virtual MAC address including: VMAC FLAG (Virtual MAC Address Identifier), U/L (Global/Local) field, and I/G ( Multicast address flag field, access device identification (DSLAM ID) field, slot number (SLOT ID) field, interface number field (PORT ID), and MAC ID (MAC ID) field.
  • the virtual MAC address is 48 bits, which is the same length as a normal MAC address.
  • the 42-47 bits in the virtual MAC address are VMAC FLAGs, which are used to identify the local address as a virtual MAC address.
  • This identifier can be arbitrarily set by the user.
  • the address can be identified as a virtual MAC address by setting the first bit of the VMAC FLAG, that is, the value of the 47th bit of the entire virtual MAC address to 1.
  • the 41st bit of the virtual MAC address is a U/L bit, and the bit is set to 1 to identify the address as a local management address, and setting the bit to 0 identifies the address as a global common address.
  • the 40th bit is the multicast address flag (I/G field). When the bit is set to 0, the address is a unicast address.
  • the bit is set to 1 to identify the address as a multicast address.
  • the above two fields are in accordance with the IEEE definition, and are not specifically limited in this embodiment.
  • the 24-39 bit in the virtual MAC address is a DSLAM ID identifier, and the value of the identifier can be arbitrarily set according to convenient deployment and maintenance in actual work, only a name given to the device, for example, the first station is 0X0001, the second one is 0X0002 and so on.
  • the 0-23 bits in the virtual MAC address are the slot identifier SLOT ID field, the port identifier PORT ID field, and the MAC ID field.
  • the value of the SLOT ID field and the port identifier PORT ID field may be automatically generated by the DSLAM according to the interface from which the received user message is received.
  • the value of the user MAC ID may be determined by the DSLAM according to the user equipment from which the user message is sent. For example, for the user message from the user equipment 1, the field is The value is set to 1, and the value of this field is set to 2 for user messages from user device 2.
  • the MAC ID may also be determined according to the access sequence of the user equipment.
  • the field is set to 1 for the first accessed user equipment, and is set to 2 for the second accessed user equipment.
  • the setting method is preset by the technician when the DSLAM is configured.
  • the setting method of the MAC ID may be multiple, which is not specifically limited in the embodiment of the present invention. It can be understood by those skilled in the art that the format of the above virtual MAC address is only one of many formats that can implement the present invention, and can be any one-to-one correspondence with the MAC address of the user from the user equipment, and can be less than 48 bits in length.
  • the format of the virtual MAC address to identify the DSLAM identity performing the method is ok.
  • a DSLAM is connected to a home gateway (such as a home router), and a home gateway can be used to connect multiple user equipments, such as a Voip phone, a PC, an IPTV set-top box, and the like.
  • the source MAC address of the user packet is converted into a virtual MAC address, which includes:
  • the DSLAM After receiving the user packet from the user equipment, the DSLAM reads the value of the source MAC address field of the user packet, and then reports the user according to the identifier of the DSLAM itself and the interface from which the user packet comes from.
  • the source MAC address of the text is converted to a virtual MAC address. Since the SLOT ID, PORT ID, and MAC ID in the virtual MAC address are unique to each DSLAM, the generated virtual MAC address is also unique.
  • the DSLAM also needs to store the MAC address of the user packet, the converted virtual MAC address, and the corresponding relationship between the DSLAM for subsequent use.
  • the DSLAM may also perform mapping of the MAC address and the virtual MAC address for the user equipment when the user equipment is accessed, and the MAC address of the user packet, the converted virtual MAC address, and the second The correspondence between the two is stored for subsequent use.
  • the virtual MAC address of the user packet after the same DSLAM is converted.
  • the first 24 bits are the same. In this way, for the intermediate device in the VPLS network, for example, the UPE and the SPE in the embodiment, in the process of performing address learning, only the first 24 bits of the source MAC address field of the received user packet need to be learned, and the generated 24-bit address forwarding table.
  • the intermediate device can be based on the destination address field of the user message.
  • the first 24 bits of the virtual MAC address forward the user message to the corresponding DSLAM. Since each intermediate device, such as UPE and SPE, only needs to learn a 24-bit address for each DSLAM, only one forwarding entry needs to be generated for user packets from the same DSLAM, as opposed to each user device connected to the same DSLAM.
  • the message forwarding method provided in this embodiment saves the storage space of the MAC address memory of the intermediate device, which saves the MAC address of the MAC address.
  • the cost of hardware expansion of the intermediate equipment reduces the cost and maintenance cost while ensuring communication efficiency.
  • the packet forwarding method provided by the embodiment of the present invention further includes:
  • the destination address of the received user packet is a virtual MAC address
  • the virtual MAC address in the destination address is translated into a corresponding MAC address, and the user packet is forwarded according to the MAC address.
  • each DSLAM in the network is connected to multiple user equipments, after the DSLAM receives the user packet from the intermediate device, for example, the UPE, it is determined whether the destination address of the user packet is a virtual MAC address.
  • the address for example, may be determined by determining whether the first bit of the destination address field of the user packet is 1, and if it is 1, indicating that the destination address field is a virtual MAC address.
  • the DSLAM queries the mapping between the locally stored virtual MAC address and the MAC address, obtains the MAC address of the user equipment corresponding to the virtual MAC address, and uses the MAC address according to the MAC address. The packet is forwarded to the corresponding user equipment.
  • each DSLAM in the network is connected to multiple user equipments, only the specified bits of the source MAC address are learned on the intermediate device UPE and the SPE, for example, the first 24 bits in this embodiment are learned, and The forwarding table is generated.
  • the packet is forwarded, the packet is forwarded to the DSLAM to which the user equipment belongs, and is sent by the DSLAM.
  • the forwarding of the DSLAM may include: querying the correspondence between the local virtual MAC address and the MAC address, and obtaining the MAC address of the user equipment corresponding to the virtual MAC address in the destination address of the current user packet, and according to the MAC address Packet forwarding, Example 2
  • Embodiment 2 of the present invention provides a packet forwarding method.
  • the execution subject is an intermediate device, and the intermediate device is, for example, the UPE and the SPE shown in Fig. 1.
  • the packet forwarding method provided in this embodiment includes:
  • the packet may be a data packet or a protocol packet from the user equipment, or may be a packet from the network side.
  • the UPE or the SPE receives the user packet from the DSLAM, it is determined whether the destination address field of the user packet is a virtual MAC address, for example, by determining the first destination address of the user packet. If the bit is 1, it is judged. If it is 1, it indicates that the destination address field is a virtual MAC address.
  • the user packet is forwarded according to the forwarding table corresponding to the virtual MAC address; if the destination address of the user packet is a virtual MAC address, Receive the UPE or SPE of the user packet. Find the local address forwarding table. For example, if a forwarding entry corresponding to the first 24 bits of the virtual address is found in the address forwarding table, the user packet is forwarded according to the forwarding entry. If the forwarding address entry corresponding to the first 24 bits of the virtual address is not found in the local address forwarding table, the UPE or the SPE broadcasts the user packet, so that the user packet is received.
  • the DSLAM can translate the virtual MAC address in the user packet into a corresponding normal MAC address, and then forward it to the corresponding user equipment according to the MAC address. If the destination address of the user packet is a normal MAC address, the UPE or the SPE of the user packet is forwarded to perform normal user packet forwarding, and details are not described herein.
  • the virtual MAC address in the source MAC address field of the received user packet is not, if the forwarding table does not have a forwarding entry corresponding to the virtual MAC address, the virtual MAC address is learned to generate the virtual MAC address. Forwarding entry for the address.
  • the learning process is the same as the normal MAC address learning process.
  • the difference is that only the first 24 bits of the virtual MAC address need to be learned, so that the first 24 bits corresponding to the virtual address are locally generated. Publish the item.
  • the forwarding table entry corresponding to the first 24 bits of the virtual MAC address generated by the learning may be User packets are forwarded.
  • the bits of the learning MAC address in the virtual MAC address learning process are related to the manner in which the source MAC address of the user packet is converted into a virtual MAC address on the DSLAM, if the DSLAM is up-converted.
  • the virtual MAC address uses more or less than 24 bits to correspond to the DSLAM, and the corresponding bit may also be learned in this implementation.
  • the intermediate device when receiving the packet from the access device, the intermediate device only learns the specific bit of the packet, and generates a packet forwarding table according to the specified bit, so that the device in the network It is not limited by the capacity or capacity of the hardware device, which saves the storage space of the MAC address memory of the intermediate device, thereby reducing the cost of hardware expansion of the intermediate device, and reducing the cost and maintenance cost while ensuring communication efficiency.
  • Example 3
  • FIG. 5 is a flowchart of a packet forwarding method according to an embodiment of the present invention.
  • the process of sending and forwarding a packet is described in detail.
  • the packet is a data packet.
  • the device that interacts in the process includes: a user equipment that sends a packet, and a user equipment.
  • DSLAM, intermediate device UPE, SPE, and BRAS referring to FIG. 5, the method of this embodiment includes:
  • the user equipment sends a user packet.
  • the source MAC address of the user packet is the MAC address of the user equipment
  • the destination address is the communication.
  • the MAC address of the peer It should be noted that, in this embodiment, the description is based on the premise that the user equipment has learned the MAC address of the communication peer, and the case where the user equipment does not know the MAC address of the communication peer is described in the following embodiments.
  • FIG. 1 an example of the virtual MAC address format is shown in FIG.
  • the meanings of the fields of the virtual MAC address are the same as those in the implementation 1 and will not be described here.
  • the DSLAM receives the user packet sent by the user equipment, and converts the source MAC address of the user packet into a virtual MAC address, and forwards the converted user packet to the UPE.
  • the DSLAM learns the source MAC address of the user equipment, and maps the source MAC address of the user to a virtual MAC address according to a preset rule, where the virtual MAC address and the actual MAC address are For one-to-one correspondence.
  • the preset rule may be represented by a correspondence table that stores a one-to-one correspondence between the source MAC address and the virtual MAC address.
  • mapping conversion process and the converted virtual MAC address are the same as those in the foregoing embodiments 1 and 2, and details are not described herein again. It should be noted that the DSLAM does not need to map the source MAC address of the user packet sent from the network side device.
  • the UPE receives the converted user packet, and determines whether the source MAC address included in the user packet includes a virtual MAC address. If yes, the source MAC address is a virtual MAC address, and step 504 is performed. The source MAC address is not a virtual MAC address, and step 505 is performed;
  • the step of judging may be unnecessary, and some of the DSLAMs or other Layer 2 aggregation devices in the network do not support.
  • the method needs to include the step of determining.
  • the UPE learns the specified bit of the virtual MAC address of the user packet, generates a forwarding table including the specified bit of the virtual MAC address, and continues to forward the user packet to the SPE, and executes 506;
  • the UPE searches for the entry corresponding to the specified bit of the virtual MAC address in the forwarding table that includes the specified bit of the virtual MAC address, and if the corresponding entry is found, the user is used according to the corresponding entry.
  • the packet is forwarded out; if the corresponding entry is not found, the specified bit of the virtual MAC address of the user packet is learned, a forwarding table including the specified bit of the virtual MAC address is generated, and the forwarding is continued to the SPE.
  • User message execute 506;
  • the forwarding entry included in the forwarding table stores the correspondence between the interface of the UPE from which the user packet is received and the specified bit of the virtual MAC address, and subsequently receives the user whose destination address includes the specified bit.
  • Newspaper In this case, the user message is forwarded through the interface corresponding to the specified bit.
  • the destination address of the user packet of the UPE forwards the user packet to the SPE, and the step 506 is performed.
  • the destination address of the user packet is a normal MAC address instead of a virtual MAC address, according to the MAC address. The address forwards the user message.
  • the SPE receives the user packet, determines whether the source MAC address included in the user packet is a virtual MAC address, and if so, executes 507, if not, proceeds to step 508;
  • the SPE learns a specified bit of the virtual MAC address, generates a forwarding table, and forwards the user packet to the BRAS according to the destination address of the user packet, and ends.
  • the network side BRAS After receiving the converted user packet, the network side BRAS performs IP forwarding through the routing table.
  • the SPE forwards the user packet to the BRAS according to the destination address of the user packet.
  • the intermediate device that receives the user packet determines whether the received destination address of the user packet is a virtual MAC address, and if yes, learns according to the above step 504.
  • the forwarding table forwards the user packet, and when the DSLAM receives the user packet, the virtual MAC address in the user packet is converted into a corresponding MAC address, and the user is forwarded according to the MAC address forwarding table.
  • the message is forwarded to the user equipment indicated by the MAC address. If the destination address of the user packet received by the intermediate device is not the virtual MAC address, the packet is forwarded according to the normal forwarding process, and details are not described here.
  • Each node (or intermediate device) in the VPLS metropolitan area network in the embodiment of the present invention learns only the specified bit in the virtual MAC address, and generates a forwarding entry, that is, aggregates the MAC address, and specifies the virtual MAC address.
  • the bit represents a carrier edge access device (DSLAM), and when forwarding user messages, the user message is forwarded to the corresponding operator edge access device (DSLAM) according to the forwarding entry, and the MAC address is greatly reduced.
  • DLAM carrier edge access device
  • the intermediate device when receiving the user packet from the access device, the intermediate device only learns a specific bit of the source MAC address in the user packet, and generates a user packet according to the specified bit. It is published that the devices in the network are not limited by the capacity or capacity of the hardware devices, which saves the storage space of the MAC address memory of the intermediate device, avoids the expansion of the MAC address table of the device, and reduces the cost and maintenance while ensuring communication efficiency.
  • FIG. 6 is a flowchart of a packet forwarding method according to an embodiment of the present invention.
  • the user packet is a protocol packet
  • the protocol packet is an ARP (Address Resolution Protocol) protocol packet
  • the source MAC address field in the packet needs to be converted. It is a virtual MAC address to ensure the normal operation of the ARP protocol.
  • the ARP protocol is used to obtain the MAC address of the peer end, and the MAC address of the peer end is included in the packet as the destination address.
  • this embodiment includes:
  • the user equipment sends a user packet.
  • the source MAC address of the user packet is the MAC address of the user equipment
  • the destination address is the IP address of the communication peer.
  • the user equipment does not know the MAC address of the communication peer, and therefore needs to obtain the MAC address through the ARP protocol packet.
  • the DSLAM receives the user packet sent by the user equipment, and converts the source MAC address in the user packet into a corresponding virtual MAC address, and forwards the converted user packet to the UPE.
  • the data content carried in the user packet needs to be detected, and the source MAC address in the user packet is converted.
  • the UPE receives the converted user packet, and determines whether the source MAC address included in the converted user packet is a virtual MAC address. If yes, step 604 is performed. If not, the source MAC address is executed. Step 605;
  • the method for determining whether the source MAC address included in the converted user packet includes the virtual MAC address in the embodiment is the same as that in the embodiment 1-3, and details are not described herein again.
  • the 604 the UPE learns the specified bit of the translated source message source MAC address, generates a forwarding table, and forwards the converted user message to the SPE, and performs step 606;
  • the forwarding table includes a correspondence between the user packet entry and the specified bit.
  • the destination packet includes the user packet of the specified bit
  • the user packet passes the user packet corresponding to the specified bit. Ingress forwarding.
  • the method of generating the forwarding table by using the specified bit of the UPE learning source MAC address is the same as that of the previous embodiments 2 and 3, and details are not described herein again.
  • the UPE forwards the user packet to the SPE according to the destination MAC address of the converted user packet, and performs step 606.
  • the SPE receives the converted user packet, determines whether the source MAC address included in the converted user packet is a virtual MAC address, and if yes, step 607 is performed, and if no, step 608 is performed;
  • the SPE learns the specified bit of the virtual MAC address, generates a forwarding table, and forwards the user packet to the BRAS according to the destination address of the converted user packet, and ends.
  • the SPE forwards the converted user packet to the BRAS according to the destination MAC address of the converted user packet.
  • the steps 604-608 are similar to the steps 504-508, and are not described herein again.
  • the user packet is an ARP request packet
  • the BRAS generates an ARP response packet for the ARP request packet, and feeds the ARP response packet to the user equipment.
  • the process of the ARP reply message being fed back from the BRAS to the DSLAM is similar to the process of learning and forwarding by the UPE or the SPE, and is not described here.
  • the DSLAM applies the message to the user. Both the packet header and the MAC address in the packet are translated. Therefore, when the DSLAM receives the ARP reply packet fed back by the BRAS, it also needs to convert the destination address in the response packet.
  • the process further includes the following steps:
  • the DSLAM When receiving the response message, the DSLAM converts the virtual MAC address of the response packet header and the virtual MAC address in the response packet to a MAC address, and forwards the converted response message to the user equipment.
  • FIG. 7 is a structural diagram of a packet forwarding apparatus according to an embodiment of the present invention.
  • the packet forwarding apparatus may be, for example, a DSLAM or another Layer 2 aggregation device, such as a switch having an aggregation function.
  • the message forwarding device includes:
  • the receiving module 701 is configured to receive a user message.
  • the conversion module 702 is configured to convert the source MAC address of the user packet into a virtual MAC address, and the forwarding module 703 is configured to forward the converted user packet according to the destination MAC address of the user packet.
  • the conversion module 702 may specifically include:
  • a first determining sub-module configured to determine whether a source MAC address of the user packet is a virtual MAC address, where the first determining sub-module is configured to determine, by the first determining sub-module, a source MAC address of the user packet When the address is a normal MAC address, the source MAC address of the user packet is converted into a virtual MAC address.
  • the conversion module 702 may specifically include:
  • a second determining sub-module configured to determine whether the destination MAC address included in the user packet is a virtual MAC address
  • a second converting sub-module configured to determine, in the second determining sub-module, the purpose of the user packet
  • the conversion module 702 can further include:
  • a third conversion sub-module configured to: when the user packet is a protocol packet, if the source MAC address in the protocol packet is a normal MAC address, convert the source MAC address in the packet header of the protocol packet a virtual MAC address, and the source MAC address in the protocol packet is converted into the virtual MAC address; if the source MAC address in the protocol packet is a virtual MAC address, the protocol packet header is The virtual MAC address in the protocol is translated into a normal MAC address, and the virtual MAC address in the protocol packet is converted into a normal MAC address.
  • This embodiment is a forwarding device corresponding to the packet forwarding method in Embodiment 1.
  • FIG. 8 is a structural diagram of a packet forwarding apparatus according to an embodiment of the present invention.
  • the packet forwarding apparatus may be, for example, an intermediate device or a router such as a UPE and an SPE shown in FIG.
  • the message forwarding device includes:
  • the receiving module 801 is configured to receive a user message.
  • the determining module 802 is configured to determine whether the destination MAC address of the user packet is a virtual MAC address, and the forwarding module 803 is configured to: when the determining module 802 determines that the destination MAC address of the user packet is virtual
  • the MAC address is forwarded according to the forwarding table corresponding to the virtual MAC address.
  • the forwarding module 803 is further configured to: when the determining module 802 determines that the destination MAC address of the user packet is a normal MAC address, the user is configured according to the forwarding table corresponding to the normal MAC address. The message is forwarded.
  • the forwarding module 803 may specifically include:
  • a forwarding sub-module configured to: when the determining module 802 determines that the destination MAC address of the user packet is a virtual MAC address, searching for a virtual MAC address forwarding table, if the virtual MAC address forwarding table is found to correspond to the virtual MAC address The forwarding entry of the address is forwarded according to the forwarding entry of the virtual MAC address, and if the forwarding entry corresponding to the virtual MAC address is not found, the user packet is broadcasted. send.
  • a virtual MAC address learning sub-module configured to learn the virtual state if there is no forwarding entry corresponding to the virtual MAC address in the forwarding table for the virtual MAC address in the source MAC address field in the received user packet.
  • the MAC address generates a forwarding entry corresponding to the virtual MAC address.
  • the virtual MAC address in this embodiment includes: a virtual MAC address field, an access device identification field, a slot number field, an interface number field, and a MAC identification field. Since the values of the VMAC FLAG, U/L, I/G, and DSLAM ID fields of the virtual MAC address are the same for the same DSLAM, the virtual MAC address of the user packet after the same DSLAM is converted. The first 24 bits (bits 24-47 of the virtual MAC address) are the same.
  • the intermediate device in the VPLS network for example, the UPE and the SPE in the embodiment, in the process of performing address learning, only the first 24 bits of the source MAC address field of the received user packet need to be learned, and the generated 24-bit address forwarding table. Because the 24 bits can uniquely identify the DSLAM from which the received user message is received, when the intermediate device receives the user message from the network side device, the intermediate device can be based on the destination address field of the user message. The first 24 bits of the virtual MAC address forward the user message to the corresponding DSLAM.
  • each intermediate device such as UPE and SPE
  • UPE and SPE only needs to learn a 24-bit address for each DSLAM
  • only one forwarding entry needs to be generated for user packets from the same DSLAM, as opposed to connecting to the same DSLAM.
  • the packet forwarding method provided in this embodiment saves the storage space of the MAC address memory of the intermediate device, and saves the cost of hardware expansion of the intermediate device. Communication efficiency reduces both cost and maintenance costs.
  • the forwarding device in this embodiment is the forwarding device corresponding to the packet forwarding method in Embodiment 1.
  • the specific process and steps in the process of forwarding a message and the format of the virtual MAC address refer to the description of Embodiment 1. This will not be repeated here.
  • the user equipment of the present invention may be a personal computer PC, a GPRS (General Packet Radio Service) service support node, a mobile terminal, etc. in the network, which is not specifically limited in the embodiment of the present invention.
  • GPRS General Packet Radio Service
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Abstract

本发明实施例提供了一种报文转发方法和装置,涉及领域局域网,该方法包括:接收用户报文;将所述用户报文的源MAC地址转换为虚拟MAC地址,并根据所述用户报文的目的MAC地址将转换后的用户报文转发出去。。该装置包括:接收模块、转换模块和转发模块。还提供了一种报文转发方法,该方法包括:接收用户报文,判断所述用户报文的目的MAC地址是否为虚拟MAC地址;如果所述用户报文的目的MAC地址为虚拟MAC地址,则根据所述虚拟MAC地址对应的转发表对所述用户报文进行转发。本发明通过中间设备在接收到来自接入设备的报文时,仅学习该报文的特定比特位,并根据该指定比特位生成报文转发表,使得网络中的设备不受硬件设备容量或能力的限制,节省了中间设备MAC地址存储器的存储空间,从而降低了中间设备硬件扩容所需的费用,在保证通信效率的同时降低成本和维护费用。

Description

报文转发方法和装置 技术领域
本发明涉及局域网领域, 特别涉及一种报文转发方法和装置。 背景技术 说
VPLS ( Virtual Private Lan Service , 虚拟专用局域网业务) 是一种基于 MPLS (Multi-Protocol Label Switching, 多协议标签交换) 和二层虚拟专用网 L2VPN (Layer 2 Virtual Private Network) 的技术, 通过 VPLS技术可虚拟出一个很大的以太网交换机, 基于 MAC (Media Access ControU, 介质访问控制) 地址进书行报文转发, 从而可以实现多点到多 点的 VPN组网。 目前基于 MAC转发的 HVPLS (Hierarchical VPLS, 分层虚拟专用局域网 业务) 在很多地方已经部署, 随着用户的增加, MAC 地址表大小也在增加, 网络需要扩 容, 对设备的 MAC地址存储器容量和性能要求也越来越高。 为了确保接入设备、 中间设备 以及网络侧设备的 MAC地址存储器容量和性能与不断扩容的网络相匹配,提高 VPLS城域 以太网的容量, 通常的做法就是提高设备的 MAC地址存储器的容量。
在实现本发明的过程中, 发明人发现现有技术至少存在以下问题:
为了增加设备 MAC地址表容量,需重新设计或修改硬件和软件,增加研发和制造成本, 网络扩容不仅要更换或者更新软件, 还需要更换或者扩容硬件, 费用很高。 发明内容
为了在保证通信效率的同时降低成本和维护, 本发明实施例提供了一种报文转发方法 和装置。 所述技术方案如下:
一种报文转发方法, 包括:
接收用户报文;
将所述用户报文的源 MAC地址转换为虚拟 MAC地址, 并根据所述用户报文的目的地 址将转换后的用户报文转发出去。
一种报文转发方法, 包括:
接收用户报文, 判断所述用户报文的目的地址是否为虚拟 MAC地址;
如果所述用户报文的目的地址为虚拟 MAC地址, 则根据所述虚拟 MAC地址对应的转 发表对所述用户报文进行转发。
一种报文转发装置, 包括:
接收模块, 用于接收用户报文;
转换模块, 用于将所述用户报文的源 MAC地址转换为虚拟 MAC地址;
转发模块, 用于根据所述用户报文的目的地址将转换后的用户报文转发出去。
一种报文转发装置, 包括:
接收模块, 用于接收用户报文;
判断模块, 用于判断所述用户报文的目的地址是否为虚拟 MAC地址;
转发模块, 用于当所述判断模块判断所述用户报文的目的地址为虚拟 MAC地址, 则根 据所述虚拟 MAC地址对应的转发表对所述用户报文进行转发。
本发明实施例提供的技术方案的有益效果是:
通过在接收到报文时, 仅学习地址的指定比特位, 并根据该指定比特位进行转发, 使 得在用户设备较多的网络中进行报文转发时, 不受硬件设备容量或能力的限制, 避免了对 设备 MAC地址表的扩容, 简化了对各个用户设备无规律的 MAC地址的学习过程, 在保证 通信效率的同时降低成本和维护。 附图说明
图 1是本发明实施例提供的 PLS城域网的一种简化的架构示意图;
图 2是本发明实施例提供的 种报文转发方法的流程图;
图 3是本发明实施例提供的 种虚拟 MAC地址的示例图;
图 4是本发明实施例提供的 种报文转发方法的流程图;
图 5是本发明实施例提供的 种报文转发方法的流程图;
图 6是本发明实施例提供的 种报文转发方法的流程图;
图 7是本发明实施例提供的 种报文转发装置的结构示意图;
图 8是本发明实施例提供的 种报文转发装置的结构示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明实施方式作 步地详细描述。
实施例 1
在该实施例中, 以图 1所示的 HVPLS场景为例对本发明实施例提供的一种报文转发方 法进行介绍, 所述方法执行主体为 DSLAM (Digital Subscriber Line Access Multiplexer, 数 字用户线接入复用器)。 本领域技术人员可以理解, 本实施例提供的所述报文转发方法的执 行主体不只限于 DSLAM, 也可以由其他二层汇聚设备, 如具有汇聚功能的交换机来执行。
参见图 2, 所述报文转发方法包括:
201、 接收用户报文;
在本实施例中, 网络中一般部署有: 接入设备、 中间设备和网络侧设备, 其中, 中间 设备一般为具有 VPLS能力的路由器。 参见图 1, 本发明实施例中的接入设备为 DSLAM, 中间设备为 UPE (Underlayer Provider Edge,下层服务提供商边缘设备)或 SPE ( Superstratum Provider Edge, 上层服务提供商边缘设备), 网络侧设备为 BRAS ( Broadband Remote Access Server, 宽带远程接入服务器)。 需要说明的是, 本实施例中所述的用户报文可以为数据报 文或协议报文。
202、 将所述用户报文的源 MAC地址转换为虚拟 MAC地址, 并根据所述用户报文的 目的 MAC地址, 将转换后的的用户报文转发出去。
举例来说, DSLAM从连接的用户设备接收用户报文,该用户报文包含源 MAC源 MAC 地址和目的 MAC 目的地址。 DSLAM将所述源 MAC源 MAC地址转换为如图 3所示的虚 拟 MAC地址, 该虚拟 MAC地址包含: VMAC FLAG (虚拟 MAC地址标识)、 U/L (全球 / 本地)字段和 I/G (组播地址标志位)字段、接入设备标识(DSLAM ID)字段、槽位号(SLOT ID) 字段、 接口号字段 (PORT ID) 和 MAC标识 (MAC ID) 字段。 该虚拟 MAC地址为 48 比特, 与普通的 MAC地址长度相同。 其中, 所述虚拟 MAC地址中的第 42-47比特为 VMAC FLAG,用于标识本地址为虚拟 MAC地址。此标识可以由用户任意设置,举例来说, 可以通过将 VMAC FLAG的第 1位, 也就是整个虚拟 MAC地址的第 47比特的值置为 1来 标识该地址为虚拟 MAC地址。 所述虚拟 MAC地址的第 41 比特为 U/L比特, 该比特置 1 标识该地址为本地管理地址, 该比特置 0则标识此地址为全球通用地址。 第 40比特为组播 地址标志位 (I/G字段), 当该比特置 0标识此地址为单播地址, 该比特置 1标识此地址为 组播地址。 上述两个字段遵从 IEEE定义, 本实施例不做特殊限定。 所述虚拟 MAC地址中 的第 24-39比特为 DSLAM ID标识, 该标识的值可在实际工作中根据方便部署和维护随意 以任意设置, 仅是给设备起的一个名字, 如第一台为 0X0001, 第二台为 0X0002等。
所述虚拟 MAC地址中的第 0-23比特为槽位标识 SLOT ID字段、端口标识 PORT ID字 段和 MAC ID字段。 其中, SLOT ID字段和端口标识 PORT ID字段的值可以由 DSLAM根 据接收的所述用户报文来自的接口自动生成。 而用户 MAC ID的值可以由 DSLAM根据所 述用户报文来自的用户设备来确定, 例如, 对于来自用户设备 1 的用户报文就将该字段的 值设置为 1, 对于来自用户设备 2的用户报文就将该字段的值设置为 2。 该 MAC ID还可以 根据用户设备的接入顺序来确定, 例如, 对于第一个接入的用户设备就将该字段设置为 1, 对于第二个接入的用户设备就将该字段设置为 2,该设置方法由技术人员在配置 DSLAM的 时候进行预设, 该 MAC ID的设置方法可以有多种, 本发明实施例不做具体限定。 本领域 技术人员可以理解, 上述虚拟 MAC地址的格式只是诸多的可以实现本发明的格式之一, 对 于任何能和来自用户设备的用户的 MAC地址一一对应, 并且能以少于 48比特的长度来标 识执行本方法的 DSLAM身份的虚拟 MAC地址的格式都是可以的。
需要说明的是, 目前一般部署方式, DSLAM—个接口下连接一个家庭网关 (如家庭路 由器), 再用家庭网关可联接多个用户设备, 如 Voip电话, PC, IPTV机顶盒等用户设备。
举例来说, 在本实施例中, 将所述用户报文的源 MAC地址转换为虚拟 MAC地址, 具 体包括:
当 DSLAM收到来自用户设备的用户报文后,读取所述用户报文的源 MAC地址字段的 值, 然后根据本 DSLAM 自身的标识, 以及所述用户报文来自的接口将所述用户报文的源 MAC地址转换为虚拟 MAC地址。由于所述虚拟 MAC地址中的 SLOT ID、 PORT ID、 MAC ID 对于每一个 DSLAM 都是唯一的, 因此生成的所述虚拟 MAC 地址也是唯一的。 所述 DSLAM还需要将所述用户报文的 MAC地址、 转换后的虚拟 MAC地址以及二者之间的对 应关系储存下来, 以便后续使用。
另外, 需要说明的是, DSLAM还可以是在用户设备接入时, 为用户设备进行 MAC地 址和虚拟 MAC地址的映射, 并将所述用户报文的 MAC地址、 转换后的虚拟 MAC地址以 及二者之间的对应关系储存下来, 以便后续使用。
由于对于同一个 DSLAM,所述虚拟 MAC地址的 VMAC FLAG、 U/L、 I/G字段和 DSLAM ID字段的值都是相同的, 因此经过同一个 DSLAM转换后的用户报文的虚拟 MAC地址的 前 24比特 (虚拟 MAC地址的第 24-47位) 都是相同的。 这样, 对于 VPLS网络中的中间 设备, 例如本实施例中的 UPE和 SPE, 在进行地址学习的过程中只需要学习接收到的用户 报文的源 MAC地址字段的前 24比特, 并生成包含这 24比特的地址转发表。 由于这 24比 特就可以唯一地标识所述接收的用户报文来自的 DSLAM,从而当所述中间设备从网络侧设 备收到用户报文后, 就可以根据所述用户报文的目的地址字段中的虚拟 MAC地址的前 24 比特将用户报文转发到相应的 DSLAM。 由于每个中间设备, 例如 UPE和 SPE对于每个 DSLAM只需要学习 24比特的地址, 从而对于来自同一 DSLAM的用户报文只需要生成一 条转发表项,相对于对同一 DSLAM连接的每个用户设备的 MAC地址都生成一条转发表项 而言, 本实施例提供的报文转发方法节省了中间设备 MAC地址存储器的存储空间, 节省了 中间设备硬件扩容所需的费用, 在保证通信效率的同时降低成本和维护费用。 本发明实施例提供的所述报文转发方法进一步包括:
203、当收到的用户报文的目的地址为虚拟 MAC地址时,将所述目的地址中的虚拟 MAC 地址转换为对应的 MAC地址, 并根据所述 MAC地址将所述用户报文转发出去。
在本实施例中, 由于网络中的每个 DSLAM都连接多个用户设备, 当所述 DSLAM从 中间设备, 例如 UPE接收到用户报文后, 判断所述用户报文的目的地址是否为虚拟 MAC 地址, 例如, 可以通过判断所述用户报文的目的地址字段的第一位是否为 1, 如果为 1则表 明目的地址字段为虚拟 MAC地址。 当所述目的地址字段为虚拟 MAC地址时, DSLAM查 询本地存储的虚拟 MAC地址与 MAC地址的对应关系, 得到所述虚拟 MAC地址对应的用 户设备的 MAC地址, 并根据该 MAC地址将所述用户报文转发给对应的用户设备。
在本实施例中, 由于网络中的每个 DSLAM都连接多个用户设备, 在中间设备 UPE和 SPE上仅对源 MAC地址的指定比特位例如, 本实施例中为前 24比特进行学习, 并生成转 发表, 在后续转发报文时, 仅根据转发表向报文目的地址中指定比特位所指示的地址进行 转发, 就可以直接将报文发送到用户设备所属的 DSLAM上, 并由 DSLAM进行进一步的 转发, DSLAM的转发可以包括: 查询本地的虚拟 MAC地址与 MAC地址的对应关系, 得 到当前用户报文的目的地址中的虚拟 MAC地址对应的用户设备 MAC地址,并根据该 MAC 地址对该报文进行转发, 实施例 2
本发明实施例 2提供一种报文转发方法。 在该实施例中, 执行主体为中间设备, 所述 中间设备例如为图 1中所示的 UPE和 SPE。
参见图 4, 本实施例提供的报文转发方法包括:
401、 接收用户报文, 判断所述用户报文的目的地址是否为虚拟 MAC地址; 该报文可以是来自用户设备的数据报文或协议报文, 还可以是来自网络侧的报文。 在本实施例中, 当 UPE或者 SPE从 DSLAM接收到用户报文后, 判断所述用户报文的 目的地址字段是否为虚拟 MAC地址,例如可以通过判断所述用户报文的目的地址的第一位 是否为 1来进行判断, 如果为 1则表明目的地址字段为虚拟 MAC地址。
402、 如果所述用户报文的目的地址为虚拟 MAC地址, 则根据所述虚拟 MAC地址对 应的转发表对所述用户报文进行转发; 如果所述用户报文的目的地址为虚拟 MAC地址,则收到所述用户报文的 UPE或者 SPE 查找本地的地址转发表。 举例来说, 如果在地址转发表中查找到了对应所述虚拟地址的前 24 比特的转发表项, 则根据所述转发表项将所述用户报文转发出去。 如果在本地的地址转 发表中没有查找到对应所述虚拟地址的前 24比特的转发表项, 则所述 UPE或者 SPE将所 述用户报文广播发送出去, 这样收到所述用户报文的 DSLAM可以将所用户报文中的虚拟 MAC地址转换为对应的正常 MAC地址, 然后根据所述 MAC地址转发给对应的用户设备。 如果所述用户报文的目的地址为正常的 MAC地址, 则收到所述用户报文的 UPE或者 SPE 进行正常的用户报文转发, 在此不再赘述。
本实施例提供的报文转发方法可以进一步包括:
403、 对于接收到的用户报文中的源 MAC地址字段中的虚拟 MAC地址, 如果转发表 中没有对应所述虚拟 MAC地址的转发表项时, 学习所述虚拟 MAC地址生成对应所述虚拟 MAC地址的转发表项。
具体来说, 所述学习过程跟正常的 MAC地址学习过程相同, 区别就是只需要学习所述 虚拟 MAC地址的前 24比特就可以了,从而在本地生成对应所述虚拟地址的前 24比特的转 发表项。 这样, 当所述 UPE或者 SPE再次接收到目的地址字段为所述虚拟 MAC地址的用 户报文时, 就可以根据上述学习生成的对应所述虚拟 MAC地址的前 24比特的转发表项对 所述用户报文进行转发。本领域技术人员可以理解, 本实施例中进行虚拟 MAC地址学习过 程中学习 MAC地址的哪些比特跟 DSLAM上将用户报文的源 MAC地址转换成虚拟 MAC 地址的方式有关, 如果 DSLAM上转换后的虚拟 MAC地址使用多于或者少于 24比特来对 应所述 DSLAM, 则本实施中也学习相应的比特位即可。
本发明实施例提供的方法, 通过中间设备在接收到来自接入设备的报文时, 仅学习该 报文的特定比特位, 并根据该指定比特位生成报文转发表, 使得网络中的设备不受硬件设 备容量或能力的限制, 节省了中间设备 MAC地址存储器的存储空间, 从而降低了中间设备 硬件扩容所需的费用, 在保证通信效率的同时降低成本和维护费用。 实施例 3
图 5是本发明实施例提供的一种报文转发方法的流程图。 在该实施例中, 对报文发送、 转发的过程进行详细的描述, 报文为数据报文, 进一步参见图 5, 该过程中发生交互的设备 包括: 发送报文的用户设备、 用户设备所属 DSLAM, 中间设备 UPE、 SPE、 以及 BRAS, 参见图 5, 该实施例的方法包括:
501、 用户设备发送用户报文;
具体来说, 该用户报文包含的源 MAC地址为用户设备的 MAC地址, 目的地址为通信 对端的 MAC地址。 需要说明的是, 本实施例中, 是以用户设备已经获知通信对端的 MAC 地址为前提进行描述的,针对户设备不知道通信对端的 MAC地址时的情况在后续实施例中 进行说明。
在本实施例中, 该虚拟 MAC地址格式的一个例子如图 3所示。 该虚拟 MAC地址各字 段的含义和实施 1中相同, 在此不再赘述。
502、 DSLAM接收用户设备发送的用户报文, 将所述用户报文中的源 MAC地址转换 为虚拟 MAC地址, 并将转换后的用户报文向 UPE转发;
举例来说, DSLAM在用户设备入网时, 对该用户设备的源 MAC地址进行学习, 并根 据预设规则将用户的源 MAC地址映射为虚拟 MAC地址, 其中所述虚拟 MAC地址与实际 的 MAC地址为一对一对应。 例如所述预设的规则可以以保存源 MAC地址和虚拟 MAC地 址一一对应关系的对应表体现出来。 这样, 当 DSLAM接收到来自该用户设备的用户报文 时, 就可以根据该保存的对应表中的源 MAC地址和虚拟 MAC地址的对应关系将所述用户 报文的从源 MAC地址映射转换为虚拟 MAC地址, 然后将完成映射转换的所述用户报文转 发出去。 上述映射转换过程和转换后的虚拟 MAC地址的格式和上述实施例 1和 2中相同, 在此不再赘述。 需要说明的是, DSLAM对从网络侧设备发来的用户报文的源 MAC地址不 需要进行映射。
503、 UPE接收到转换后的所述用户报文, 判断该用户报文中包含的源 MAC地址是否 包含虚拟 MAC地址, 如果是, 则该源 MAC地址为虚拟 MAC地址, 执行步骤 504, 如果 否, 则该源 MAC地址不是虚拟 MAC地址, 执行步骤 505;
需要说明的是,对于网络中的 DSLAM或者其他的二层汇聚设备都支持虚拟 MAC地址 的情况, 可以不需要判断的步骤, 而当网络中的 DSLAM或者其他的二层汇聚设备中有的 不支持 MAC映射的情况, 则该方法需包括判断的步骤。
504、 UPE学习所述用户报文的虚拟 MAC地址的指定比特位, 生成包括虚拟 MAC地 址的指定比特位的转发表, 并继续向 SPE转发所述用户报文, 执行 506;
具体地, UPE在包含虚拟 MAC地址指定比特位的转发表中查找对应所述虚拟 MAC地 址指定比特位的表项, 如果查找到对应的表项, 则根据所述对应的表项将所述用户报文转 发出去;如果没有查找到对应的表项,则学习所述用户报文的虚拟 MAC地址的指定比特位, 生成包括虚拟 MAC地址的指定比特位的转发表, 并继续向 SPE转发所述用户报文, 执行 506;
其中, 该转发表包含的转发表项保存接收到的所述用户报文来自的 UPE的接口与所述 虚拟 MAC地址指定比特位的对应关系,当后续接收到目的地址包括该指定比特位的用户报 文时, 将该用户报文通过该指定比特位对应的所述接口转发出去。
505、 UPE所述用户报文的目的地址向 SPE正常转发该用户报文, 执行步骤 506; 由于经过判断, 所述用户报文的目的地址为正常的 MAC地址而不是虚拟 MAC地址, 则根据 MAC地址转发所述用户报文。
506; SPE接收所述用户报文,判断所述用户报文中包含的源 MAC地址是否为虚拟 MAC 地址, 如果是, 则执行 507, 如果否, 则执行步骤 508;
507、 SPE学习虚拟 MAC地址的指定比特位, 生成转发表, 并根据所述用户报文的目 的地址向 BRAS转发该用户报文, 结束;
网络侧 BRAS接收到该转换后的用户报文后, 通过路由表, 进行 IP转发。
508、 SPE根据所述用户报文的目的地址向 BRAS转发所述用户报文。
当用户报文从 BRAS 向用户设备转发时, 接收到用户报文的中间设备, 判断接收到的 所述用户报文的目的地址是否为虚拟 MAC地址, 如果是, 则根据在上述步骤 504学习到的 转发表转发所述用户报文, 当 DSLAM接收到所述用户报文时, 将所述用户报文中的虚拟 MAC地址转换为对应的 MAC地址, 并根据 MAC地址转发表, 将所述用户报文转发给该 MAC地址指示的用户设备。 对于中间设备接收到的用户报文的目的地址不是虚拟 MAC地 址时, 按照正常的转发流程进行转发, 在此不再赘述。本发明实施例中的 VPLS城域网中的 各个节点 (或中间设备)只学习虚拟 MAC地址中指定比特位, 生成一个转发表项, 也就是 将 MAC地址进行聚合, 每个虚拟 MAC地址的指定比特位代表一个运营商边缘接入设备 (DSLAM), 且在转发用户报文时, 根据该转发表项将用户报文转发到相应运营商边缘接 入设备 (DSLAM), 同时大大降低了 MAC地址表容量。
本发明实施例提供的方法, 通过中间设备在接收到来自接入设备的用户报文时, 仅学 习该用户报文中源 MAC地址的特定比特位, 并根据该指定比特位生成用户报文转发表, 使 得网络中的设备不受硬件设备容量或能力的限制,节省了中间设备 MAC地址存储器的存储 空间, 避免了对设备 MAC地址表的扩容, 在保证通信效率的同时降低成本和维护。
图 6 是本发明实施例提供的一种报文转发方法的流程图。 在该实施例中, 用户报文为 协议报文, 以该协议报文为 ARP (Address Resolution Protocol, 地址解析协议)协议报文为 例进行描述, 还需要将报文中的源 MAC地址字段转换为虚拟 MAC地址, 从而保证 ARP 协议的正常工作。在通信时, 当用户设备只知道通信对端的 IP地址, 需要通过 ARP协议来 获取对端的 MAC地址,并将对端的 MAC地址作为目的地址包含在报文中。在此种场景下, 参见图 6, 该实施例包括:
601、 用户设备发送用户报文; 举例来说, 该用户报文包含的源 MAC地址为用户设备的 MAC地址, 目的地址为通信 对端的 IP地址。 在该实施例中, 用户设备并不知道通信对端的 MAC地址, 因此需要通过 ARP协议报文获取 MAC地址。
602、 DSLAM接收用户设备发送的用户报文, 将所述用户报文中的源 MAC地址转换 为对应的虚拟 MAC地址, 并将转换后的用户报文向 UPE转发;
需要说明的是, 由于协议报文的特殊性, 需要对用户报文携带的数据内容进行检测, 并将用户报文包内的源 MAC地址进行转换。
603、 UPE接收到所述转换后的用户报文, 判断该转换后的用户报文中包含的源 MAC 地址是否为虚拟 MAC地址, 如果是, 则执行步骤 604, 如果否, 则源 MAC地址执行步骤 605;
本实施例中判断该转换后的用户报文中包含的源 MAC地址是否包含虚拟 MAC地址的 方法和实施例 1-3中相同, 在此不再赘述。
604、 UPE学习所述转换后的用户报文源 MAC地址的指定比特位, 生成转发表, 并向 SPE转发该转换后的用户报文, 执行步骤 606;
其中, 该转发表包含用户报文入口与指定比特位的对应关系, 当后续接收到目的地址 包括该指定比特位的用户报文时, 将该用户报文通过该指定比特位对应的用户报文入口转 发。 UPE学习源 MAC地址的指定比特位生成转发表的方法和在前的实施例 2和 3中的方法 相同, 在此不再赘述。
605、 UPE根据所述转换后的用户报文的目的 MAC地址向 SPE正常转发该用户报文, 执行步骤 606;
606; SPE接收转换后的用户报文, 判断该转换后的用户报文中包含的源 MAC地址是 否为虚拟 MAC地址, 如果是, 则执行步骤 607, 如果否, 则执行步骤 608;
607、 SPE学习所述虚拟 MAC地址的指定比特位, 生成转发表, 并根据该转换后的用 户报文的目的地址向 BRAS转发该用户报文, 结束;
608、 SPE根据转换后的用户报文的目的 MAC地址向 BRAS正常转发该转换后的用户 报文。
该步骤 604-608与步骤 504-508原理类似, 在此不再赘述。
609: 当网络侧 BRAS接收到该转换后的用户报文时, 生成应答报文, 并将该应答报文 反馈给用户设备;
具体地, 该用户报文为 ARP请求报文, BRAS生成针对该 ARP请求报文的 ARP应答 报文, 并将该 ARP应答报文反馈给用户设备。 在本实施例中, ARP应答报文从 BRAS反馈至 DSLAM的过程与 UPE或 SPE进行学习 和转发的过程相似, 在此不再赘述, 需要说明的是, 在步骤 603时, DSLAM对用户报文包 头和包内的 MAC地址都进行了转换, 因此, 当 DSLAM接收到 BRAS反馈的 ARP应答报 文时, 也需要对应答报文中的目的地址进行转换, 则该过程还包括以下步骤:
610: 当 DSLAM接收到应答报文时, 将应答报文包头的虚拟 MAC地址预和应答报文 包内的虚拟 MAC地址转换为 MAC地址, 并将转换后的应答报文转发给该用户设备。
通过在接收到报文时, 仅学习地址的指定比特位, 并根据该指定比特位进行报文转发, 使得在用户设备较多的网络中进行报文转发时, 不受硬件设备容量或能力的限制, 避免了 对设备 MAC地址表的扩容, 简化了对各个用户设备无规律的 MAC地址的学习过程, 在保 证通信效率的同时降低成本和维护。
图 7 是本发明实施例提供的一种报文转发装置的结构图, 所述报文转发装置例如可以 为 DSLAM, 也可以为其他二层汇聚设备, 如具有汇聚功能的交换机。
参见图 7, 该报文转发装置包括:
接收模块 701, 用于接收用户报文;
转换模块 702, 用于将所述用户报文的源 MAC地址转换为虚拟 MAC地址; 转发模块 703, 用于根据所述用户报文的目 MAC地址将转换后的用户报文转发出去。 举例来说, 所述转换模块 702可以具体包括:
第一判断子模块, 用于判断所述用户报文的源 MAC地址是否为虚拟 MAC地址; 第一转换子模块,用于当所述第一判断子模块判断出所述用户报文的源 MAC地址为正 常的 MAC地址时, 将所述用户报文的源 MAC地址转换为虚拟 MAC地址。
举例来说, 所述转换模块 702可以具体包括:
第二判断子模块,用于判断所述用户报文包含的目的 MAC地址是否为虚拟 MAC地址; 第二转换子模块,用于在所述第二判断子模块判断出所述用户报文的目的 MAC地址为 虚拟 MAC地址时, 根据预设的映射转换规则将所述虚拟 MAC地址转换为正常的 MAC地 址。
举例来说, 所述转换模块 702可以进一步包括:
第三转换子模块, 用于所述用户报文为协议报文时, 如果所述协议报文中的源 MAC地 址为正常的 MAC地址时, 将所述协议报文包头中的源 MAC地址转换为虚拟 MAC地址, 并将所述协议报文包内的源 MAC地址转换为所述虚拟 MAC地址; 如果所述协议报文中的 源 MAC地址为虚拟 MAC地址时, 将所述协议报文包头中的虚拟 MAC地址转换为正常的 MAC地址, 并将所述协议报文包内的虚拟 MAC地址转换为正常的 MAC地址。 本实施例为对应实施例 1 中的所述报文转发方法的转发装置, 对于转发报文过程中的 具体流程和步骤以及虚拟 MAC地址的格式可以参考实施例 1的描述, 在此不再赘述。 图 8 是本发明实施例提供的一种报文转发装置的结构图, 所述报文转发装置例如可以 为图 1中所示的 UPE和 SPE等中间设备或路由器, 本发明不做具体限定。
参见图 8, 该报文转发装置包括:
接收模块 801, 用于接收用户报文;
判断模块 802, 用于判断所述用户报文的目的 MAC地址是否为虚拟 MAC地址; 转发模块 803, 用于当所述判断模块 802判断所述用户报文的目的 MAC地址为虚拟
MAC地址时, 根据所述虚拟 MAC地址对应的转发表对所述用户报文进行转发。
进一步地,所述转发模块 803还用于当所述判断模块 802判断所述用户报文的目的 MAC 地址为正常的 MAC地址时, 则根据所述正常的 MAC地址对应的转发表对所述用户报文进 行转发。
举例来说, 所述转发模块 803可以具体包括:
转发子模块,用于当所述判断模块 802判断所述用户报文的目的 MAC地址为虚拟 MAC 地址时, 查找虚拟 MAC地址转发表, 如果在虚拟 MAC地址转发表中查找到对应所述虚拟 MAC地址的转发表项, 则根据所述虚拟 MAC地址的转发表项对所述用户报文进行转发, 如果没有查找到对应所述虚拟 MAC地址的转发表项, 则对所述用户报文进行广播发送。
虚拟 MAC地址学习子模块, 用于如果对于接收到的用户报文中的源 MAC地址字段中 的虚拟 MAC地址, 如果转发表中没有对应所述虚拟 MAC地址的转发表项时, 学习所述虚 拟 MAC地址生成对应所述虚拟 MAC地址的转发表项。
举例来说, 本实施例中的所述虚拟 MAC地址包含: 虚拟 MAC地址字段、 接入设备标 识字段、 槽位号字段、 接口号字段和 MAC标识字段。 由于对于同一个 DSLAM, 所述虚拟 MAC地址的 VMAC FLAG、 U/L、 I/G字段和 DSLAM ID字段的值都是相同的, 因此经过 同一个 DSLAM转换后的用户报文的虚拟 MAC地址的前 24比特(虚拟 MAC地址的第 24-47 位) 都是相同的。 这样, 对于 VPLS网络中的中间设备, 例如本实施例中的 UPE和 SPE, 在进行地址学习的过程中只需要学习接收到的用户报文的源 MAC地址字段的前 24比特, 并生成包含这 24比特的地址转发表。 由于这 24比特就可以唯一地标识所述接收的用户报 文来自的 DSLAM, 从而当所述中间设备从网络侧设备收到用户报文后, 就可以根据所述用 户报文的目的地址字段中的虚拟 MAC地址的前 24比特将用户报文转发到相应的 DSLAM。 由于每个中间设备, 例如 UPE和 SPE对于每个 DSLAM只需要学习 24比特的地址, 从而 对于来自同一 DSLAM的用户报文只需要生成一条转发表项, 相对于对同一 DSLAM连接 的每个用户设备的 MAC地址都生成一条转发表项而言,本实施例提供的报文转发方法节省 了中间设备 MAC地址存储器的存储空间, 节省了中间设备硬件扩容所需的费用, 在保证通 信效率的同时降低成本和维护费用。
该实施例中的转发装置为对应实施例 1 中的所述报文转发方法的转发装置, 对于转发 报文过程中的具体流程和步骤以及虚拟 MAC地址的格式可以参考实施例 1的描述,在此不 再赘述。
本发明所述的用户设备可以为网络中的个人电脑 PC、 GPRS ( General Packet Radio Service, 通用分组无线服务技术) 服务支持节点、 移动终端等, 本发明实施例不做具体限 定。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完 成, 也可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计算机可读存储 介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神和原则 之内, 所作的任何修改、 等同转换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种报文转发方法, 其特征在于, 包括:
接收用户报文;
将所述用户报文的源 MAC地址转换为虚拟 MAC地址, 并根据所述用户报文的目的地 址将转换后的用户报文转发出去。
2、 根据权利要求 1所述的方法, 其特征在于, 所述将所述用户报文的源 MAC地址转 换为虚拟 MAC地址, 具体包括:
接收到来自用户设备的用户报文后, 读取所述用户报文的源 MAC地址字段的值, 根据 所述用户报文来自的接口将所述用户报文的源 MAC地址转换为虚拟 MAC地址。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 当所述报文为协议报文时, 将所述 用户报文的源 MAC地址转换为虚拟 MAC地址, 具体包括:
将所述协议报文包头的源 MAC地址转换为虚拟 MAC地址, 并将所述所述协议报文包 内的源 MAC地址转换为所述虚拟 MAC地址。
4、 根据权利要求 1-3任一项所述的方法, 其特征在于, 所述接收用户报文之后, 还包 括:
当所述用户报文的目的 MAC地址为虚拟 MAC地址时,将所述用户报文中的虚拟 MAC 地址转换为对应的 MAC地址, 并根据所述对应的 MAC地址将所述用户报文转发出去。
5、 根据权利要求 1-4任一项所述的方法, 其特征在于, 所述虚拟 MAC地址包含: 虚 拟 MAC地址标识、 U/L全球 /本地字段和 I/G组播地址标志位字段、 接入设备标识字段、 槽 位号字段、 接口号字段和 MAC标识字段。
6、 一种报文转发方法, 其特征在于, 包括:
接收用户报文, 判断所述用户报文的目的 MAC地址是否为虚拟 MAC地址; 如果所述用户报文的目的 MAC地址为虚拟 MAC地址, 则根据所述虚拟 MAC地址对 应的转发表对所述用户报文进行转发。
7、 根据权利要求 6所述的方法, 其特征在于, 所述方法还包括: 对于接收到的用户报文中的源 MAC地址字段中的虚拟 MAC地址, 如果转发表中没有 对应所述虚拟 MAC地址的转发表项时, 学习所述虚拟 MAC地址生成对应所述虚拟 MAC 地址的转发表项。
8、根据权利要求 6或 7所述的方法,其特征在于,所述虚拟 MAC地址包含:虚拟 MAC 地址标识、 U/L全球 /本地字段和 I/G组播地址标志位字段、 接入设备标识字段、 槽位号字 段、 接口号字段和 MAC标识字段。
9、 根据权利要求 7或 8所述的方法, 其特征在于, 所述学习所述虚拟 MAC地址生成 对应所述虚拟 MAC地址的转发表项具体为:
学习所述用户报文的源 MAC地址字段中虚拟 MAC地址的虚拟 MAC地址标识、 U/L 全球 /本地字段和 I/G组播地址标志位字段。
10、 根据权利要求 9所述的方法, 其特征在于, 所述虚拟 MAC地址的虚拟 MAC地址 标识、 U/L全球 /本地字段和 I/G组播地址标志位字段对于同一接入设备将源 MAC地址转换 到虚拟 MAC地的用户报文都是相同的。
11、 根据权利要求 8-10任意一项所述的方法, 其特征在于, 其中所述虚拟 MAC地址 标识、 U/L全球 /本地字段和 I/G组播地址标志位字段总长度小于 48比特。
12、 根据权利要求 8-10任意一项所述的方法, 其特征在于, 其中所述虚拟 MAC地址 标识、 U/L全球 /本地字段和 I/G组播地址标志位字段总长度为 24比特。
13、 一种报文转发装置, 其特征在于, 包括:
接收模块, 用于接收用户报文;
转换模块, 用于将所述用户报文的源 MAC地址转换为虚拟 MAC地址;
转发模块, 用于根据所述用户报文的目的 MAC地址将转换后的用户报文转发出去。
14、 根据权利要求 13所述的报文转发装置, 其特征在于, 所述转换模块包括: 第一判断子模块, 用于判断所述用户报文的源 MAC地址是否为虚拟 MAC地址; 第一转换子模块,用于当所述第一判断模块判断出所述用户报文的源 MAC地址为正常 的 MAC地址时, 将所述用户报文的源 MAC地址转换为虚拟 MAC地址。
15、 根据权利要求 13或 14所述的报文转发装置, 其特征在于, 所述转换模块包括: 第二判断子模块,用于判断所述用户报文包含的目的 MAC地址是否为虚拟 MAC地址; 第二转换子模块,用于在所述第二判断子模块判断出所述用户报文的目的 MAC地址为 虚拟 MAC地址时, 根据预设的映射转换规则将所述虚拟 MAC地址转换为正常的 MAC地 址。
16、根据权利要求 13-15任意一项所述的报文转发装置, 其特征在于, 当所述报文为协 议报文时, 所述转换模块进一步包括:
第三转换子模块, 用于所述用户报文为协议报文时, 如果所述协议报文中的源 MAC地 址为正常的 MAC地址时, 将所述协议报文包头中的源 MAC地址转换为虚拟 MAC地址, 并将所述协议报文包内的源 MAC地址转换为所述虚拟 MAC地址; 如果所述协议报文中的 源 MAC地址为虚拟 MAC地址时, 将所述协议报文包头中的虚拟 MAC地址转换为正常的 MAC地址, 并将所述协议报文包内的虚拟 MAC地址转换为正常的 MAC地址。
17、 一种报文转发装置, 其特征在于, 包括:
接收模块, 用于接收用户报文;
判断模块, 用于判断所述用户报文的目的 MAC地址是否为虚拟 MAC地址; 转发模块,用于当所述判断模块判断所述用户报文的目的 MAC地址为虚拟 MAC地址, 则根据所述虚拟 MAC地址对应的转发表对所述用户报文进行转发。
18、 根据权利要求 17所述的报文转发装置, 其特征在于, 所述转发模块具体用于当所 述判断模块判断所述用户报文的目的 MAC地址为虚拟 MAC地址时, 查找虚拟 MAC地址 转发表, 如果在虚拟 MAC地址转发表中查找到对应所述虚拟 MAC地址的转发表项, 则根 据所述虚拟 MAC地址的转发表项对所述用户报文进行转发,如果没有查找到对应所述虚拟 MAC地址的转发表项, 则对所述用户报文进行广播发送。
19、 根据权利要求 17或 18所述的报文转发装置, 其特征在于, 所述转发模块进一步 包括:
虚拟 MAC地址学习子模块, 用于如果对于接收到的用户报文中的源 MAC地址字段中 的虚拟 MAC地址, 如果转发表中没有对应所述虚拟 MAC地址的转发表项时, 学习所述虚 拟 MAC地址生成对应所述虚拟 MAC地址的转发表项。
PCT/CN2011/077818 2011-07-29 2011-07-29 报文转发方法和装置 WO2012109864A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2011/077818 WO2012109864A1 (zh) 2011-07-29 2011-07-29 报文转发方法和装置
CN201180001348.7A CN102318290B (zh) 2011-07-29 2011-07-29 报文转发方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/077818 WO2012109864A1 (zh) 2011-07-29 2011-07-29 报文转发方法和装置

Publications (1)

Publication Number Publication Date
WO2012109864A1 true WO2012109864A1 (zh) 2012-08-23

Family

ID=45429438

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/077818 WO2012109864A1 (zh) 2011-07-29 2011-07-29 报文转发方法和装置

Country Status (2)

Country Link
CN (1) CN102318290B (zh)
WO (1) WO2012109864A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428091A (zh) * 2012-05-15 2013-12-04 中兴通讯股份有限公司 Mac地址学习的控制方法及转发设备
CN103944826B (zh) * 2013-01-22 2017-03-15 杭州华三通信技术有限公司 Spbm网络中的表项聚合方法及设备
US9350607B2 (en) * 2013-09-25 2016-05-24 International Business Machines Corporation Scalable network configuration with consistent updates in software defined networks
US9112794B2 (en) 2013-11-05 2015-08-18 International Business Machines Corporation Dynamic multipath forwarding in software defined data center networks
CN104660509B (zh) * 2013-11-19 2017-11-21 中国科学院声学研究所 一种接入网关中数据报文的转发处理方法
US9930009B2 (en) * 2015-03-13 2018-03-27 Intel IP Corporation Systems and methods to enable network coordinated MAC randomization for wi-fi privacy
CN109636256B (zh) * 2019-01-30 2022-04-12 四川长虹电器股份有限公司 一种mes系统的mac地址管理方法

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968184A (zh) * 2005-11-18 2007-05-23 杭州华为三康技术有限公司 区域网络的链路层通信方法及其应用的网络设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1492268B1 (en) * 2003-06-25 2007-07-25 Alcatel Lucent Method and device for Ethernet MAC address translation in ethernet access networks
CN1545265A (zh) * 2003-11-25 2004-11-10 港湾网络有限公司 数字用户线接入服务器设备实现虚拟媒体访问控制地址的方法
CN101645904A (zh) * 2009-09-09 2010-02-10 中兴通讯股份有限公司 一种降低交换机中央处理器使用率的方法的装置

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968184A (zh) * 2005-11-18 2007-05-23 杭州华为三康技术有限公司 区域网络的链路层通信方法及其应用的网络设备

Also Published As

Publication number Publication date
CN102318290B (zh) 2014-12-10
CN102318290A (zh) 2012-01-11

Similar Documents

Publication Publication Date Title
US7483439B2 (en) VPN services using address translation over an IPv6 network
US7848333B2 (en) Method of multi-port virtual local area network (VLAN) supported by multi-protocol label switch (MPLS)
WO2012109864A1 (zh) 报文转发方法和装置
US9705706B2 (en) Multiple prefix connections with translated virtual local area network
US9467376B2 (en) Method and device for sending internet protocol packets
EP1903723A1 (en) Method and apparatus for transmitting message
WO2009033428A1 (fr) Procédé, système et dispositif pour retirer une adresse de commande d'accès au support
WO2018214809A1 (zh) 消息发送方法及装置、存储介质
JP2013504959A (ja) バーチャルプライベートネットワークの実現方法及びシステム
WO2012051884A1 (zh) 一种虚拟机移动性的实现方法及系统
WO2011160367A1 (zh) 网络地址转换转发方法及装置
WO2011113393A2 (zh) 一种实现虚拟局域网标识转换的方法及装置
WO2009094928A1 (fr) Procédé et équipement de transmission d'un message basé sur le protocole de tunnel de niveau 2
WO2007076678A1 (fr) Procede de transfert de donnees et appareil de commutation
WO2012119390A1 (zh) 虚拟机迁移通知方法和系统
WO2006122502A1 (fr) Méthode de transmission de message en couche 2 et dispositif d’accès
WO2012106935A1 (zh) 数据通信网络配置方法、网关网元及数据通信系统
WO2013071866A1 (zh) 一种传递主机名的方法和装置
WO2014110737A1 (zh) 网络中的设备配置方法、设备和系统
WO2012013126A1 (zh) 主机间的访问方法、设备及系统
US20060182120A1 (en) IP to VPLS interworking
WO2009076839A1 (zh) 供应商边缘设备之间传送报文的方法、系统及设备
WO2014067328A1 (zh) 二层转发方法及转发设备
WO2009117923A1 (zh) 数据发送的方法、装置及通信设备
WO2012068854A1 (zh) 一种mac地址更新方法及装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180001348.7

Country of ref document: CN

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

Ref document number: 11858626

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: 11858626

Country of ref document: EP

Kind code of ref document: A1