WO2011057570A1 - Data transmission method, device and system for virtual local area networks - Google Patents

Data transmission method, device and system for virtual local area networks Download PDF

Info

Publication number
WO2011057570A1
WO2011057570A1 PCT/CN2010/078635 CN2010078635W WO2011057570A1 WO 2011057570 A1 WO2011057570 A1 WO 2011057570A1 CN 2010078635 W CN2010078635 W CN 2010078635W WO 2011057570 A1 WO2011057570 A1 WO 2011057570A1
Authority
WO
WIPO (PCT)
Prior art keywords
index
local area
virtual local
port
router
Prior art date
Application number
PCT/CN2010/078635
Other languages
French (fr)
Chinese (zh)
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 华为技术有限公司
Publication of WO2011057570A1 publication Critical patent/WO2011057570A1/en

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 present invention relates to the field of communications technologies, and in particular, to a data transmission method, device, and system for a virtual local area network.
  • Ethernet technology is simple and easy to use, low in price, and scalable in bandwidth. Whether it is a service or a network structure, it has been widely applied in enterprise networks, metropolitan area networks, and wide area networks. . However, traditional Ethernet can be maintained and has poor operational capabilities. As the scope of Ethernet promotion expands, operators are increasingly demanding Ethernet OAM (Operations, Administration and Maintenance) functions.
  • OAM Operations, Administration and Maintenance
  • Ethernet OAM IEEE (Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers) conducted research on Ethernet OAM.
  • the current Ethernet OAM can be implemented by two protocol solutions: an IEEE 802. lag protocol based scheme and an IEEE 802.3ah protocol based scheme.
  • the scheme based on the IEEE 802.1ag protocol focuses on the management and maintenance of the end-to-end Ethernet link
  • the IEEE 802.3ah protocol scheme focuses on the management and maintenance of the point-to-point (only the user side does not involve the network side).
  • the combination of the two can provide a complete Ethernet OAM network solution.
  • VLAN Virtual LAN
  • the primary VLAN and the backup VLAN are transmitted through different Layer 2 channels.
  • the Layer 2 here refers to TCP/IP (Transmission).
  • the backup needs to be able to switch VLANs to complete the backup function.
  • the Layer 3 here refers to the L3 of the TCP/IP protocol stack, that is, the IP layer.
  • VLAN + route For the VLAN backup, you can use the VLAN + route to implement Layer 2 backup.
  • the physical connection of the networking is shown in Figure 1.
  • the two ports of the terminal device 10 use different VLANs, and each VLAN configures an IP address of a different network segment, and the gateway and the route are also different.
  • a link is faulty, you can switch the port and use the VLAN corresponding to the other IP address to communicate.
  • the effective route used to send data to the outside uses the route of the other network segment.
  • Embodiments of the present invention provide a data transmission method, device, and system for a virtual local area network, which can implement connection of a device port and multiple virtual local area networks at low cost, and pass multiple virtual local area networks. Send data to the router.
  • the embodiment of the present invention provides a data transmission method for a virtual local area network, where the method includes: establishing a corresponding index for multiple virtual local area networks connected to the same port of the device; selecting an established index as a primary index, establishing a The binding relationship between the device port and the primary index is performed; the data packet of the device port is sent to the router through a virtual local area network corresponding to the primary cable 1.
  • the embodiment of the present invention provides a device, where the device includes: an establishing unit, configured to respectively establish a corresponding index for multiple virtual local area networks connected to the same port of the device; and a binding unit, configured to select an established The index is used as a primary index to establish a binding relationship between the device port and the primary index.
  • the sending unit is configured to send the data packet of the device port to the router through a virtual local area network corresponding to the primary index.
  • the embodiment of the present invention further provides a data transmission system of a virtual local area network, where the system includes the device provided by the foregoing embodiment.
  • the system further includes: a plurality of virtual local area networks connected to the same port of the terminal device, and a router connected to the plurality of virtual local area networks;
  • the device provided by the foregoing embodiment is a switch device
  • the system further includes: a terminal device, the terminal device, and the The switch is connected to a plurality of virtual local area networks connected to the same port of the switch, and a router connected to the plurality of virtual local area networks.
  • the technical solution of the embodiment of the present invention is to establish a corresponding index for multiple VLANs connected to the same port of the device, and select a primary index to select the actually used VLAN, so that the connection between the device port and multiple virtual local area networks can be realized at a low cost. And send data to the router through multiple virtual local area networks.
  • FIG. 1 is a schematic diagram of a VLAN backup system in the prior art
  • FIG. 2a is a second flowchart of a method according to Embodiment 1 of the present invention.
  • FIG. 3 is a third flowchart of a method according to Embodiment 1 of the present invention.
  • FIG. 4 is a functional block diagram of a device 10 according to Embodiment 2 of the present invention.
  • FIG. 5 is a second functional block diagram of a device 10 according to Embodiment 2 of the present invention.
  • FIG. 6 is a schematic diagram of a data transmission system of a virtual local area network according to Embodiment 3 of the present invention
  • FIG. 7 is a schematic diagram of a data transmission system of a virtual local area network according to Embodiment 3 of the present invention
  • FIG. 8 is a schematic diagram of a virtual local area network according to Embodiment 3 of the present invention
  • the schematic of the data transmission system is three. detailed description
  • Embodiment 1 This embodiment provides a data transmission method for a virtual local area network.
  • FIG. 2 is a flowchart of a method in this embodiment, as shown in FIG. 2: The method includes:
  • a corresponding index is established for each of multiple virtual local area networks connected to the same port of the device; the same port refers to the same device port of the device.
  • a port index matching entry may be established for multiple virtual local area networks connected to the same port of the device, and different indexes correspond to different VLANs.
  • the method in this embodiment may further include storing a router address resolution protocol ARP entry, and/or an index content entry of each index.
  • Table 1 to Table 3 are the router ARP table, the port index matching table, and the index content table of the embodiment, where Table 2 and Table 3 can also be combined into one table. It is to be understood that the contents of Tables 1 to 3 are only for explaining the present embodiment, and are not intended to limit the scope of the claims.
  • Table 3 Index Table of Contents Cable VLAN quotation mark
  • Router ARP entries (Table 1) of this embodiment include: the IP address of the router, the MAC address of the router, and the device port connecting multiple VLANs.
  • the port index matching entry in this embodiment (Table 2) includes: an index of multiple virtual local area networks corresponding to the device port, where multiple indexes include a primary index bound to the device port, for example, the main EthO in Table 2.
  • the index is 1.
  • the index value in the index content table (Table 3) of this embodiment is the VLAN ID (virtual area network identifier), and each VLAN ID corresponds to one VLAN.
  • the data packet sent from EthO in this embodiment is sent to the router shown in Table 1 through VLAN 100 corresponding to index 1.
  • Table 3 of this embodiment may also be Table 3a.
  • Table 3a Index Table of Contents
  • the index value of this embodiment may also be the DSCP of the IP address.
  • a DSCP value corresponds to a VLAN, so each index can correspond to a group of VLANs.
  • AF sured Forwarding
  • EF Expedited Forwarding
  • VLAN priority is optional, which indicates the data transmission priority of different VLANs.
  • the AF1 priority level of the index 1 corresponds to the VLAN 100.
  • the AF3 priority corresponds to the VLAN 200, and the EF priority level corresponds to the VLAN 300.
  • the AF1 priority level of the index 2 corresponds to the VLAN 400 and the AF3 priority level corresponds to the VLAN 500.
  • under different DSCP values corresponding to the same index may be the same VLAN ID, for VLAN priority determined by The priority of data transmission for different VLANs.
  • FIG. 2a is a second flowchart of the method of the embodiment, as shown in FIG. 2a: The method further includes the following steps on the basis of FIG. 2:
  • This embodiment can use two ways to reselect the primary index.
  • An optional method is: detecting whether the communication link of the virtual local area network corresponding to the primary index can communicate normally; when detecting that the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, Re-select one of the indexes as the primary index, for example, it can be a random selection, or it can be re-selected from other indexes than the current primary index.
  • Another optional method is: detecting whether the communication link of all the virtual local area networks connected to the same port of the device can communicate normally, and reselecting one of the indexes corresponding to the communication link capable of normal communication as the primary index.
  • the binding relationship between EthO and index 1 can be modified to the binding relationship with index 2.
  • the index 2 corresponds to VLAN 200, and the packet sent from EthO carries the packet header of VLAN 200. After that, it is sent to the router according to the router's ARP table.
  • FIG. 3 is a third flowchart of the method of the embodiment, which is a detailed flowchart of the method of the embodiment. As shown in Figure 3: The method includes:
  • the index of this embodiment may be a VLAN ID, and each VLAN ID corresponds to one VLAN.
  • the index of this embodiment may also be a DSCP field of the IP. Different DSCP priorities correspond to different VLANs, so each index can correspond to multiple VLANs.
  • index 1 As shown in Table 2, you can select index 1 as the primary index of EthO.
  • the data packet of the device port is sent to the router through the VLAN corresponding to the primary index. As shown in Table 1 to Table 3, the data packet sent by the EthO is sent to the corresponding router by using the VLAN 100 corresponding to the index 1.
  • S304. Detect the connectivity of the VLAN connected to the same port of the device, that is, whether the communication link where the virtual local area network is located can communicate normally.
  • the connectivity of the VLAN corresponding to the primary index may be detected; or, for the reliability of the VLAN handover, that is, the switched VLAN is available, the connectivity of all VLANs may also be detected.
  • step S306 can also be implemented in two ways: if the VLAN corresponding to the primary index is not connected, and the connectivity of all VLANs is detected in step S304, the detected from the detected Re-selecting the index corresponding to the Unicom VLAN (can be randomly selected, or selected according to priority, or according to the length of the Unicom time length), etc.)
  • a primary index establish a binding relationship between the device port and the reselected primary index. The method is high in reliability because it is known in advance that the re-selected primary index is connected;
  • step S304 detects only the connectivity of the VLAN corresponding to the primary index, then selecting any other VLAN as the primary index is a relatively simple manner. Real-time detection of connectivity of all VLANs is not required.
  • the data packet of the device port is sent to the router through the VLAN corresponding to the reselected primary index.
  • the data packet sent by EthO is corresponding to index 2.
  • VLAN 200 is sent to the corresponding router.
  • the method in this embodiment is to establish a corresponding index for multiple VLANs connected to the same port of the device, and select a primary index to select the actually used VLAN.
  • This method can implement ports and ports without increasing the number of ports and the number of IP addresses.
  • the method in this embodiment performs port and VLAN index binding on the device.
  • the VLAN index corresponding to the communication port can be changed to switch the VLAN without changing the IP address.
  • the method of this embodiment can implement switching of multiple VLANs by using only one port.
  • the router ARP entry (Table 1) and the port index binding entry (Table 2) can be separately stored.
  • EthO first establishes a binding relationship with index 1.
  • Index 1 corresponds to VLAN 100.
  • Packets sent from EthO are sent to the router according to the router ARP table after the packet header of VLAN 100 is sent.
  • EthO and index 1 are The binding relationship is modified to the binding relationship with index 2.
  • the index 2 corresponds to VLAN 200.
  • the data packet sent from EthO is sent to the router according to the ARP table of the router.
  • the method of this embodiment can be applied to a network of the IEEE 802.1ag protocol.
  • the IEEE 802. lag protocol supports connectivity detection on Ethernet, enabling timely detection, recovery, and management of network anomalies or abnormalities such as downgrading and failure of Ethernet services.
  • the method of the embodiment of the present invention can detect the link and trigger the switching of the VLAN through the IEEE 802. lag to complete the switching of the Layer 2 link, and achieve the purpose of link backup and switching. Since 802.1ag can be set very short The link switching detection time can be quickly switched. This type of backup switching can be implemented as long as the primary link or the primary and backup links of the Layer 2 link support 802.1ag.
  • Embodiment 2 This embodiment provides a device capable of implementing the data transmission method of the virtual local area network in Embodiment 1.
  • the device in this embodiment may be a terminal device (such as a base station or a PC server) in different network applications, or may be a switch device or other communication device capable of implementing equivalent functions.
  • FIG. 4 is a functional block diagram of the device 10 of the embodiment.
  • the device 10 includes: an establishing unit 101, configured to respectively establish corresponding indexes for multiple virtual local area networks connected to the same device port of the device.
  • the binding unit 102 is configured to select an index established by the establishing unit 101 as a primary index, and establish a binding relationship between the device port and the primary index.
  • the sending unit 103 is configured to: pass the data packet of the device port to the virtual node corresponding to the primary index.
  • the LAN is sent to the router.
  • the establishing unit 101 of the embodiment is configured to establish a port index matching entry for each of multiple virtual local area networks connected to the same port of the device.
  • the port index matching entry includes: an index of multiple virtual local area networks corresponding to the device port, and the index of multiple virtual local area networks includes a primary index bound to the device port.
  • the device 10 of this embodiment may further include: a storage unit 104, configured to store a router address resolution protocol ARP entry, as shown in Table 1, the router ARP entry in this embodiment may include: an IP address of the router The media access control MAC address of the router and the device port connecting multiple virtual local area networks.
  • the storage unit 104 of the device 10 of the embodiment is further configured to store an index content table of each index, as shown in Table 3 or Table 3a, where the index content table of the embodiment includes a virtual local area network.
  • the index value corresponding to the index; the index value may be a virtual local area network identifier VLAN ID; or the index value may also be a differential service code point field DSCP of the IP address, and one DSCP value corresponds to one VLAN.
  • the establishment unit 101 of the device 10 establishes Table 1 to Table 3; the binding unit 102 selects the primary index in Table 2 as the index 1; and the transmitting unit 103 transmits the data packet sent by the EthO.
  • the VLAN 100 corresponding to index 1 is sent to the router shown in Table 1.
  • FIG. 5 is a second functional block diagram of the device 10 of the embodiment.
  • the device 10 of the present embodiment includes a detecting unit 105 and an updating unit 106 in addition to the unit of FIG. 4, and these two units cooperate to implement VLAN switching.
  • the detecting unit 105 is configured to detect whether the communication link where the virtual local area network corresponding to the primary index is incapable of communicating normally
  • the updating unit 106 configured to: when the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, reselect one
  • the established index is used as the primary index, and the binding relationship is updated to the binding relationship between the device port and the reselected primary index.
  • the sending unit 103 is configured to pass the data packet of the device port to the primary index corresponding to the reselected primary index.
  • the virtual LAN is sent to the router.
  • the detecting unit 105 and the updating unit 106 cooperate to reselect the main index.
  • An optional method is: the detecting unit 105 detects only whether the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally; and the updating unit 106, when the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, Reselect one of the established indexes as the primary index. This method only needs to detect the connectivity of the VLAN corresponding to the primary index, which is an efficient and convenient method.
  • the detecting unit 105 detects whether the communication link of all the virtual local area networks connected to the same port of the device can communicate normally; the updating unit 106, from the index corresponding to the communication link capable of normal communication Reselect one as the primary index. This method needs to be checked It is a reliable way to measure the connectivity of all VLANs and ensure that the switched VLANs are available.
  • the establishment unit 101 of the device 10 establishes Table 1 to Table 3; the binding unit 102 selects the primary index in Table 2 as the index 1; and the transmitting unit 103 transmits the data packet sent by the EthO.
  • the VLAN 100 corresponding to the index 1 is sent to the router shown in Table 1.
  • the detecting unit 105 and the updating unit 106 cooperate to complete the VLAN switching: when detecting that the link of the VLAN 100 corresponding to the index 1 cannot communicate normally, perform VLAN switching, and then perform EthO.
  • the primary index is modified to index 2; the sending unit 103 sends the data packet sent by the EthO to the router shown in Table 1 through the VLAN 200 corresponding to the index 2 according to the modified primary index.
  • the device in this embodiment separately establishes corresponding indexes for multiple VLANs connected to the same port, and selects a primary index to select an actual used VLAN.
  • the device can implement multiple ports without increasing the number of ports and the number of IP addresses.
  • the connection of the virtual local area network and the sending of data to the router through multiple virtual local area networks reduces the need for ports and IP, and has no effect on the upper layer application.
  • the device in the embodiment of the present invention binds the device port and the VLAN index.
  • the VLAN index of the communication port can be changed to switch the VLAN without changing the IP address.
  • the device of this embodiment can implement switching of multiple VLANs by using only one port.
  • the device in this embodiment separately stores the router ARP entry (Table 1) and the port index binding entry (Table 2). The advantage is that once the VLAN is switched, only the port index matching entry needs to be modified. 2), without updating the router ARP entry (Table 1).
  • the device of this embodiment is also applicable to the network of the IEEE 802.1ag protocol.
  • Example 3 This embodiment provides a data transmission system of a virtual local area network.
  • the system includes the apparatus of Embodiment 2 and is capable of implementing the data transmission method of Embodiment 1.
  • This embodiment provides various system architectures, which respectively correspond to the terminal device and the switch device of Embodiment 2.
  • the system includes the device of the foregoing device embodiment, and when the device is a terminal device, the system further includes: a plurality of virtual local area networks connected to the same port of the terminal device, a router connected to the plurality of virtual local area networks; and the device is a switch In the case of the device, the system further includes: a terminal device connected to the switch, a plurality of virtual local area networks connected to the same port of the switch, and a router connected to the plurality of virtual local area networks. The details are described below separately.
  • FIG. 6 is a schematic diagram of a data transmission system of a virtual local area network according to an embodiment of the present invention.
  • the schematic diagram uses two VLANs as an example for description.
  • the system includes a terminal device 10 (see FIG. 4 to FIG. 5 for a block diagram), a switch 20 connected to the terminal device 10, a router 60, and a switch 50 connected to the router 60, a switch 20, and a switch 50.
  • VLAN 30 and VLAN 40 With VLAN 30 and VLAN 40 connected, you can set VLAN 30 as the primary link and VLAN 40 as the standby link.
  • the Lanswitch (Ethernet switch) in VLAN 30 and VLAN 40 is responsible for supporting networking and forwarding packets.
  • the terminal device 10 uses one port to connect VLAN 30 and VLAN 40.
  • the port between the terminal device 10 and the switch 20 is a TRUNK port, and the port between the router 60 and the switch 50 is also a TRUNK port.
  • the TRUNK port can transmit packets carrying different VLAN headers, and can receive and send multiple types of packets. VLAN ID packet.
  • MEP Maintenance Association End Point
  • Alliance edge node selectively set MIP in the detection domain (Maintenance association Intermediate) Point, maintain the federation edge node) or MEP.
  • MEP1 may be set in switch 50
  • MEP4 may be set in the terminal device
  • MIP1 is set in VLAN 30
  • MIP2 is set in VLAN 40.
  • the connectivity between VLAN 30 and VLAN 40 is detected by these maintenance points.
  • FIG. 7 is a second schematic diagram of a data transmission system of a virtual local area network according to the embodiment.
  • VLAN 30 and VLAN 40 of Figure 7 are connected to different routers 60 and routers 70, respectively.
  • the terminal device 10 needs to store the ARP tables of the router 60 and the router 70, respectively.
  • the corresponding router is switched at the same time. For example, when switching from VLAN 30 to VLAN 40, the next hop address of the IP packet is simultaneously changed from the IP address of the router 60 to the IP address of the router 70.
  • FIG. 8 is a third schematic diagram of the data transmission system of the virtual local area network according to the embodiment. Different from FIG. 6 and FIG. 7 , the VLAN switching work in this embodiment is completed by the switch, and the terminal device only needs to complete simple data transmission with the switch.
  • the system includes a terminal device 10, a switch 20 connected to the terminal device 10 (see FIG. 4 to FIG. 5 for details), and a router 60.
  • a VLAN 30 and a VLAN 40 are connected between the switch 20 and the router 60, and can be set.
  • VLAN 30 is the standby link VLAN 40.
  • Switch 20 uses the same port to connect VLAN 30 and VLAN 40.
  • the port between the switch device 20 and the terminal device 10 is an ACCESS port.
  • the terminal device does not need to know the connectivity of the VLAN, so it does not need to be in the terminal.
  • a maintenance point is set.
  • MEP4 can be set in the switch 20
  • MEP2 and MIP1 are set in the VLAN 30, and MEP3 and MIP2 are set in the VLAN 40.
  • the maintenance points of the VLAN 1 and the VLAN 2 are detected through the maintenance points.
  • the system of this embodiment is a plurality of systems connected to the same port of the terminal device or the switch device.
  • VLANs respectively establish corresponding indexes.
  • the system can connect the device ports to multiple virtual local area networks without adding the number of ports and the number of IP addresses on the device.
  • the virtual local area network sends data to the router, which reduces the need for ports and IP, and has no effect on the upper layer application.
  • the system in this embodiment binds the device port and the VLAN index.
  • the VLAN index of the communication port can be changed to switch the VLAN without changing the IP address.
  • the device of this embodiment can implement switching of multiple VLANs by using only one port.
  • the program may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, which, when executed, may include the flow of an embodiment of the methods described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (Random Access Memory, RAM).

Abstract

A data transmission method, device and system for virtual local area networks(VLANs) are provided. The method comprises: the corresponding indices are established respectively for multiple VLANs linked with the same port of a device; one of the established indices is selected as the main index, and the binding relation is established between the device port and the main index; a data packet of the device port is transmitted to a router via the VLAN corresponding to the main index. The method, device and system select the VLAN actually used by selecting the main index, and they are enabled to realize the linking of the port and multiple VLANs without increasing the number of device ports and IP addresses, and transmit the data to the router via multiple VLANs, thus reducing the need for the ports and IPs and having no influence on the upper layer applications.

Description

虚拟局域网的数据传输方法、 设备与系统  Virtual local area network data transmission method, device and system
本申请要求于 2009 年 11 月 13 日提交中国专利局、 申请号为 200910221837.8 , 发明名称为"虚拟局域网的数据传输方法、 设备与系统" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 This application claims priority to Chinese Patent Application No. 200910221837.8, entitled "Virtual LAN Data Transmission Method, Equipment and System", filed on November 13, 2009, the entire contents of which are incorporated by reference. In this application. Technical field
本发明涉及通信技术领域, 特别涉及一种虚拟局域网的数据传输方法、 设备与系统。  The present invention relates to the field of communications technologies, and in particular, to a data transmission method, device, and system for a virtual local area network.
背景技术 Background technique
以太网 (Ethernet) 技术简单易用、 价格低廉、 且带宽可扩展性强, 无 论是作为一种业务还是作为一种网络结构, 在企业网、 城域网、 广域网范 围内都已经得到大规模应用。 但是, 传统以太网可维护、 可运营能力比较 差, 随着以太网推广的范围逐渐扩大, 运营商对以太网 OAM (Operations, Administration and Maintenance, 操作维护和管理) 功能的需求也越来越强 烈  Ethernet technology is simple and easy to use, low in price, and scalable in bandwidth. Whether it is a service or a network structure, it has been widely applied in enterprise networks, metropolitan area networks, and wide area networks. . However, traditional Ethernet can be maintained and has poor operational capabilities. As the scope of Ethernet promotion expands, operators are increasingly demanding Ethernet OAM (Operations, Administration and Maintenance) functions.
IEEE (Institute of Electrical and Electronics Engineers , 电气与电子工程 师学会)对 Ethernet OAM进行了相应的研究工作。 目前的 Ethernet OAM可 以由两种协议的解决方案来实现: 基于 IEEE 802. lag 协议的方案和基于 IEEE 802.3ah协议的方案。 其中, 基于 IEEE 802.1ag协议的方案, 侧重端 到端以太网链路的管理维护, 而基于 IEEE 802.3ah协议方案, 则侧重点到 点的管理维护 (只关注用户侧不涉及网络侧)。 两者的结合可以提供完整的 Ethernet OAM全网解决方案。 在具体网络应用过程中, 由于组网多平面、 租用费用不同、 或者不同 网络提供商等原因, 需要通过 2个 VLAN (Virtual LAN , 虚拟局域网) 来 进行备份, 主 VLAN和备份 VLAN通过不同的层二通道进行数据的传送, 这里的层二指的是 TCP/IP ( Transmission Control Protocol/Internet Protocol, 传输控制协 i /因特网互联协议) 协议栈的 L2, 即数据链路层。 在这种情况 下的备份, 需要能够进行 VLAN的切换, 才能完成备份的功能。 IEEE (Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers) conducted research on Ethernet OAM. The current Ethernet OAM can be implemented by two protocol solutions: an IEEE 802. lag protocol based scheme and an IEEE 802.3ah protocol based scheme. Among them, the scheme based on the IEEE 802.1ag protocol focuses on the management and maintenance of the end-to-end Ethernet link, while the IEEE 802.3ah protocol scheme focuses on the management and maintenance of the point-to-point (only the user side does not involve the network side). The combination of the two can provide a complete Ethernet OAM network solution. In a specific network application process, due to different planes, different lease fees, or different For network providers and other reasons, backup is required through two VLANs (Virtual LAN, Virtual LAN). The primary VLAN and the backup VLAN are transmitted through different Layer 2 channels. The Layer 2 here refers to TCP/IP (Transmission). Control Protocol/Internet Protocol, L2 of the protocol stack, ie the data link layer. In this case, the backup needs to be able to switch VLANs to complete the backup function.
要实现 VLAN的备份, 则一般需要终端设备支持 2个物理端口, 每个 物理端口连接一个 VLAN, 通过在 2个物理端口之间进行倒换实现 VLAN 的切换。 如果终端设备需要在一个物理端口上进行 VLAN倒换, 则需要给 每个 VLAN配置对应的 IP地址, 然后通过切换 IP地址来切换 VLAN , 以 达到备份的目的。 由于需要改变 IP地址, 采用一个端口进行 VLAN倒换将 导致对层三的业务产生影响, 这里的层三指的是 TCP/IP 协议栈的 L3, 即 IP层。  To implement VLAN backup, you need to support two physical ports on the terminal device. Each physical port is connected to a VLAN. Switching between the two physical ports is implemented. If the terminal device needs to perform VLAN switching on one physical port, you need to configure a corresponding IP address for each VLAN, and then switch the VLAN by switching the IP address to achieve the backup. Because the IP address needs to be changed, VLAN switching using one port will affect the services of Layer 3. The Layer 3 here refers to the L3 of the TCP/IP protocol stack, that is, the IP layer.
现有技术对于 VLAN 备份可以采用 "VLAN +路由"方式实现二层的备 份,组网物理连接如图 1所示。终端设备 10的 2个端口使用不同的 VLAN , 每个 VLAN配置不同网段的 IP地址, 网关和路由也不同。 在一个链路发生 问题的时候, 可以切换端口并使用另一个 IP地址对应的 VLAN进行通讯, 向外发送数据使用的生效路由也使用另一个网段的路由。  For the VLAN backup, you can use the VLAN + route to implement Layer 2 backup. The physical connection of the networking is shown in Figure 1. The two ports of the terminal device 10 use different VLANs, and each VLAN configures an IP address of a different network segment, and the gateway and the route are also different. When a link is faulty, you can switch the port and use the VLAN corresponding to the other IP address to communicate. The effective route used to send data to the outside uses the route of the other network segment.
该方案的缺点是: 在实现 VLAN切换时需要使用多个端口, 多个端口 需要连接多个物理线路, 会直接增加传输成本; 在实现 VLAN切换时还必 须使用多个 IP地址, 增加了 IP地址的消耗。 发明内容  The disadvantages of this solution are as follows: Multiple ports are required to implement VLAN switching. Multiple ports need to be connected to multiple physical lines, which directly increases the transmission cost. When implementing VLAN switching, multiple IP addresses must be used, and IP addresses are added. Consumption. Summary of the invention
本发明实施例提供一种虚拟局域网的数据传输方法、 设备与系统, 可 以低成本实现设备端口与多个虚拟局域网的连接, 并通过多个虚拟局域网 向路由器发送数据。 Embodiments of the present invention provide a data transmission method, device, and system for a virtual local area network, which can implement connection of a device port and multiple virtual local area networks at low cost, and pass multiple virtual local area networks. Send data to the router.
一方面, 本发明实施例提供一种虚拟局域网的数据传输方法, 该方法包 括: 为与设备的同一端口连接的多个虚拟局域网分别建立对应的索引; 选择 一个建立的索引作为主索引, 建立所述设备端口与所述主索引的绑定关系; 将所述设备端口的数据包通过与所述主索 1对应的虚拟局域网发送给路由 器。  In one aspect, the embodiment of the present invention provides a data transmission method for a virtual local area network, where the method includes: establishing a corresponding index for multiple virtual local area networks connected to the same port of the device; selecting an established index as a primary index, establishing a The binding relationship between the device port and the primary index is performed; the data packet of the device port is sent to the router through a virtual local area network corresponding to the primary cable 1.
另一方面, 本发明实施例提供一种设备, 该设备包括: 建立单元, 用 于为与设备的同一端口连接的多个虚拟局域网分别建立对应的索引; 绑定 单元, 用于选择一个建立的索引作为主索引, 建立所述设备端口与所述主 索引的绑定关系; 发送单元, 用于将所述设备端口的数据包通过与所述主 索引对应的虚拟局域网发送给路由器。  In another aspect, the embodiment of the present invention provides a device, where the device includes: an establishing unit, configured to respectively establish a corresponding index for multiple virtual local area networks connected to the same port of the device; and a binding unit, configured to select an established The index is used as a primary index to establish a binding relationship between the device port and the primary index. The sending unit is configured to send the data packet of the device port to the router through a virtual local area network corresponding to the primary index.
又一方面, 本发明实施例还提供一种虚拟局域网的数据传输系统, 该 系统包括前述实施例提供的设备, 当前述实施例提供的设备为终端设备时, 所述系统还包括: 与所述终端设备同一端口连接的多个虚拟局域网, 与所 述多个虚拟局域网连接的路由器; 当前述实施例提供的设备为交换机设备 时, 所述系统还包括: 终端设备, 所述终端设备与所述交换机连接, 与所 述交换机同一端口连接的多个虚拟局域网, 与所述多个虚拟局域网连接的 路由器。  In another aspect, the embodiment of the present invention further provides a data transmission system of a virtual local area network, where the system includes the device provided by the foregoing embodiment. When the device provided by the foregoing embodiment is a terminal device, the system further includes: a plurality of virtual local area networks connected to the same port of the terminal device, and a router connected to the plurality of virtual local area networks; when the device provided by the foregoing embodiment is a switch device, the system further includes: a terminal device, the terminal device, and the The switch is connected to a plurality of virtual local area networks connected to the same port of the switch, and a router connected to the plurality of virtual local area networks.
本发明实施例的技术方案, 为与设备同一端口连接的多个 VLAN分别 建立对应的索引, 通过选择一个主索引来选择实际使用的 VLAN , 可以低 成本实现设备端口与多个虚拟局域网的连接, 并通过多个虚拟局域网向路 由器发送数据。 附图说明 The technical solution of the embodiment of the present invention is to establish a corresponding index for multiple VLANs connected to the same port of the device, and select a primary index to select the actually used VLAN, so that the connection between the device port and multiple virtual local area networks can be realized at a low cost. And send data to the router through multiple virtual local area networks. DRAWINGS
图 1为现有技术的一种 VLAN备份系统原理图;  1 is a schematic diagram of a VLAN backup system in the prior art;
图 2为本发明实施例 1的方法流程图之一;  2 is a flowchart of a method according to Embodiment 1 of the present invention;
图 2a为本发明实施例 1的方法流程图之二;  2a is a second flowchart of a method according to Embodiment 1 of the present invention;
图 3为本发明实施例 1的方法流程图之三;  3 is a third flowchart of a method according to Embodiment 1 of the present invention;
图 4为本发明实施例 2设备 10的功能框图之一;  4 is a functional block diagram of a device 10 according to Embodiment 2 of the present invention;
图 5为本发明实施例 2设备 10的功能框图之二;  5 is a second functional block diagram of a device 10 according to Embodiment 2 of the present invention;
图 6为本发明实施例 3虚拟局域网的数据传输系统的原理图之一; 图 7为本发明实施例 3虚拟局域网的数据传输系统的原理图之二; 图 8为本发明实施例 3虚拟局域网的数据传输系统的原理图之三。 具体实施方式  6 is a schematic diagram of a data transmission system of a virtual local area network according to Embodiment 3 of the present invention; FIG. 7 is a schematic diagram of a data transmission system of a virtual local area network according to Embodiment 3 of the present invention; FIG. 8 is a schematic diagram of a virtual local area network according to Embodiment 3 of the present invention; The schematic of the data transmission system is three. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。 实施例 1 : 本实施例提供了一种虚拟局域网的数据传输方法。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention. Embodiment 1 This embodiment provides a data transmission method for a virtual local area network.
图 2为本实施例的方法流程图之一, 如图 2所示: 该方法包括: FIG. 2 is a flowchart of a method in this embodiment, as shown in FIG. 2: The method includes:
S201、 为与设备的同一端口连接的多个虚拟局域网分别建立对应的索 引; 同一端口指的是设备的同一设备端口。 S201: A corresponding index is established for each of multiple virtual local area networks connected to the same port of the device; the same port refers to the same device port of the device.
S202、 选择一个建立的索引作为主索引, 建立设备端口与主索引的绑 定关系; S202. Select an established index as a primary index, and establish a binding between the device port and the primary index. Relationship
S203、 将设备端口的数据包通过与主索引对应的虚拟局域网发送给路 由器。  S203. Send a data packet of the device port to the router through a virtual local area network corresponding to the primary index.
在本发明实施例的方案中, 可以为与设备的同一端口连接的多个虚拟 局域网分别建立端口索引匹配表项, 不同的索引对应了不同的 VLAN。  In the solution of the embodiment of the present invention, a port index matching entry may be established for multiple virtual local area networks connected to the same port of the device, and different indexes correspond to different VLANs.
可选地, 本实施例的方法还可以包括存储路由器地址解析协议 ARP表 项, 和 /或, 每个索引的索引内容表项。  Optionally, the method in this embodiment may further include storing a router address resolution protocol ARP entry, and/or an index content entry of each index.
表 1〜表 3为本实施例的路由器 ARP表、端口索引匹配表和索引内容表, 其中表 2和表 3也可以合并为一张表。 可以理解的是, 表 1〜表 3的内容仅 用于对本实施例进行说明, 而不用于对权利要求保护范围进行限定。  Table 1 to Table 3 are the router ARP table, the port index matching table, and the index content table of the embodiment, where Table 2 and Table 3 can also be combined into one table. It is to be understood that the contents of Tables 1 to 3 are only for explaining the present embodiment, and are not intended to limit the scope of the claims.
表 1 : 路由器 ARP表  Table 1: Router ARP Table
Figure imgf000007_0001
表 2 : 端口索引匹配表
Figure imgf000007_0001
Table 2: Port Index Match Table
Figure imgf000007_0002
表 3 : 索引内容表 索 VLAN 引号 号
Figure imgf000007_0002
Table 3: Index Table of Contents Cable VLAN quotation mark
1 VLAN 1 VLAN
100  100
2 VLAN  2 VLAN
200 本实施例的路由器 ARP表项 (表 1 ) 包括: 路由器的 IP地址、 路由器 的 MAC地址以及连接多个 VLAN的设备端口。 本实施例的端口索引匹配 表项 (表 2) 包括: 设备端口对应的多个虚拟局域网的索引, 多个索引中包 含了与该设备端口绑定的主索引, 比如, 表 2 中 EthO的主索引为 1。 本实 施例的索引内容表 (表 3) 中的索引值为 VLAN ID (虚拟局域网标识), 每 个 VLAN ID对应一个 VLAN。 如表 1〜表 3所示: 本实施例从 EthO发出的 数据包通过索引 1对应的 VLAN100发送给表 1所示的路由器。  200 Router ARP entries (Table 1) of this embodiment include: the IP address of the router, the MAC address of the router, and the device port connecting multiple VLANs. The port index matching entry in this embodiment (Table 2) includes: an index of multiple virtual local area networks corresponding to the device port, where multiple indexes include a primary index bound to the device port, for example, the main EthO in Table 2. The index is 1. The index value in the index content table (Table 3) of this embodiment is the VLAN ID (virtual area network identifier), and each VLAN ID corresponds to one VLAN. As shown in Table 1 to Table 3, the data packet sent from EthO in this embodiment is sent to the router shown in Table 1 through VLAN 100 corresponding to index 1.
可选地, 本实施例的表 3还可以为表 3a。 表 3a: 索引内容表  Optionally, Table 3 of this embodiment may also be Table 3a. Table 3a: Index Table of Contents
Figure imgf000008_0001
如表 3a 所示, 本实施例的索引值还可以是 IP 地址的 DSCP (Differentiated Services Code Point, 区分服务码点) 字段, 一个 DSCP值 对应一个 VLAN, 这样每个索引可以对应一组 VLAN。 其中: AF (Assured Forwarding,保证转发)、 EF (Expedited Forwarding,无阻碍转发)表示 DSCP
Figure imgf000008_0001
As shown in Table 3a, the index value of this embodiment may also be the DSCP of the IP address. (Differentiated Services Code Point) field, a DSCP value corresponds to a VLAN, so each index can correspond to a group of VLANs. Among them: AF (Assured Forwarding) and EF (Expedited Forwarding) indicate DSCP
( differentiated services code point, 区分服务码点) 的优先级, 位于 IP头的 QoS字段。 VLAN优先级是可选项, 它表示不同 VLAN的数据发送优先级 另^ ( differentiated services code point, the priority of the service code point), located in the QoS field of the IP header. VLAN priority is optional, which indicates the data transmission priority of different VLANs.
如表 3a 所示, 本实施例可以设置索引 1 的 AF1 优先级别对应 VLAN 100 ^ AF3优先级对应 VLAN200、 EF优先级别对应 VLAN300 ; 索引 2的 AF1优先级别对应 VLAN400、 AF3优先级别对应 VLAN500。 在切换 前使用 VLAN100、 VLAN200 和 VLAN300 , 在切换后使用 VLAN400 和 VLAN500o 可选地, 本实施例中, 相同索引下的不同 DSCP优先级也可以 对应相同的 VLAN ID,并由 VLAN优先级来决定不同 VLAN的数据发送优 先级别。 As shown in Table 3a, in this embodiment, the AF1 priority level of the index 1 corresponds to the VLAN 100. The AF3 priority corresponds to the VLAN 200, and the EF priority level corresponds to the VLAN 300. The AF1 priority level of the index 2 corresponds to the VLAN 400 and the AF3 priority level corresponds to the VLAN 500. Use before switching VLAN100, VLAN200 and VLAN300, and use VLAN400 VLAN500 o Alternatively, in the present embodiment, after the handover, under different DSCP values corresponding to the same index may be the same VLAN ID, for VLAN priority determined by The priority of data transmission for different VLANs.
图 2a为本实施例的方法流程图之二, 如图 2a所示: 该方法在图 2的 基础上还包括以下步驟:  2a is a second flowchart of the method of the embodiment, as shown in FIG. 2a: The method further includes the following steps on the basis of FIG. 2:
S204、 检测主索引对应的虚拟局域网所在的通信链路是否无法正常通 信;  S204. Check whether the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally.
S205、 当主索引对应的虚拟局域网所在的通信链路无法正常通信时, 重新选择一个建立的索引作为主索引, 将绑定关系更新为设备端口与重新 选择的主索引之间的绑定关系;  S205. When the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, re-select an established index as a primary index, and update the binding relationship to a binding relationship between the device port and the reselected primary index.
S206, 将设备端口的数据包通过与重新选择的主索引对应的虚拟局域 网发送给路由器。  S206. Send the data packet of the device port to the router through the virtual local area network corresponding to the reselected primary index.
本实施例可以采用两种方式来重新选择主索引。 一种可选的方式为: 检测与主索引对应的虚拟局域网所在的通信链路 是否能够正常通信; 当检测到与主索引对应的虚拟局域网所在的通信链路 无法正常通信时, 从建立的全部索引中重新选择一个作为主索引, 比如可 以是随机选择, 也可以是从当前主索引之外的其他索引中重新选择一个。 This embodiment can use two ways to reselect the primary index. An optional method is: detecting whether the communication link of the virtual local area network corresponding to the primary index can communicate normally; when detecting that the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, Re-select one of the indexes as the primary index, for example, it can be a random selection, or it can be re-selected from other indexes than the current primary index.
另一种可选的方式为: 检测与设备的同一端口连接的所有虚拟局域网 所在的通信链路是否能够正常通信, 从能够正常通信的通信链路所对应的 索引中重新选择一个作为主索引。  Another optional method is: detecting whether the communication link of all the virtual local area networks connected to the same port of the device can communicate normally, and reselecting one of the indexes corresponding to the communication link capable of normal communication as the primary index.
结合表 2的内容, 当检测到 VLAN100断开时, 可以将 EthO与索引 1 的绑定关系修改为与索引 2 的绑定关系, 索引 2对应 VLAN200 , 从 EthO 发出的数据包带上 VLAN200的包头后根据路由器的 ARP表发往路由器。  In combination with the content of Table 2, when the VLAN 100 is disconnected, the binding relationship between EthO and index 1 can be modified to the binding relationship with index 2. The index 2 corresponds to VLAN 200, and the packet sent from EthO carries the packet header of VLAN 200. After that, it is sent to the router according to the router's ARP table.
图 3 为本实施例方法的流程图之三, 该流程图为本实施例方法的详细 流程图。 如图 3所示: 该方法包括:  FIG. 3 is a third flowchart of the method of the embodiment, which is a detailed flowchart of the method of the embodiment. As shown in Figure 3: The method includes:
5301 , 为与设备的同一端口连接的多个 VLAN分别建立对应的索引。 可选地,如表 3所示,本实施例的索引可以是 VLAN ID,每个 VLAN ID 对应一个 VLAN; 可选地, 如表 3a所示, 本实施例的索引还可以是 IP的 DSCP字段, 不同的 DSCP优先级对应了不同的 VLAN, 这样每个索引可以 对应多个 VLAN。  5301. Create a corresponding index for multiple VLANs connected to the same port of the device. Optionally, as shown in Table 3, the index of this embodiment may be a VLAN ID, and each VLAN ID corresponds to one VLAN. Optionally, as shown in Table 3a, the index of this embodiment may also be a DSCP field of the IP. Different DSCP priorities correspond to different VLANs, so each index can correspond to multiple VLANs.
5302 , 选择一个建立的索引作为主索引, 建立设备端口与主索引的绑 定关系。  5302. Select an established index as the primary index to establish a binding relationship between the device port and the primary index.
如表 2所示, 可以选择索引 1作为 EthO的主索引。  As shown in Table 2, you can select index 1 as the primary index of EthO.
S303, 设备端口的数据包通过主索引对应的 VLAN发给路由器; 如表 1〜表 3所示, EthO发出的数据包采用与索引 1对应的 VLAN100 发给相应的路由器。 S304, 检测与设备同一端口连接的 VLAN的联通性, 即虚拟局域网所 在的通信链路是否能够正常通信。 S303. The data packet of the device port is sent to the router through the VLAN corresponding to the primary index. As shown in Table 1 to Table 3, the data packet sent by the EthO is sent to the corresponding router by using the VLAN 100 corresponding to the index 1. S304. Detect the connectivity of the VLAN connected to the same port of the device, that is, whether the communication link where the virtual local area network is located can communicate normally.
另外一种方式是, 仅检测与主索引对应的 VLAN的联通性; 或者, 为 了 VLAN切换的可靠性, 即切换后的 VLAN可用, 也可以对所有 VLAN的 联通性进行检测。  Alternatively, only the connectivity of the VLAN corresponding to the primary index may be detected; or, for the reliability of the VLAN handover, that is, the switched VLAN is available, the connectivity of all VLANs may also be detected.
5305 , 判断与主索引对应的 VLAN 是否联通? 如果与主索引对应的 VLAN联通, 则保持当前的端口索引绑定关系, 返回步驟 S304继续检测; 如果不联通则进入步驟 S306。  5305. Determine whether the VLAN corresponding to the primary index is connected. If the VLAN corresponding to the primary index is connected, the current port index binding relationship is maintained, and the process returns to step S304 to continue the detection. If not, the process proceeds to step S306.
5306 , 重新选择一个建立的索引作为主索引, 将绑定关系更新为设备 端口与重新选择的主索引之间的绑定关系;  5306. Reselect an established index as a primary index, and update the binding relationship to a binding relationship between the device port and the reselected primary index.
对应于步驟 S304的两种方式, 步驟 S306也可以采用两种方式来实现: 如果与主索引对应的 VLAN不联通,并且步驟 S304中是对所有 VLAN 的联通性进行了检测, 则从检测出的联通的 VLAN所对应的索引中重新选 择 (可以采用随机选择, 或根据优先级选择, 或根据联通时间长度选择等) 一个作为主索引, 建立设备端口与重新选择的主索引的绑定关系, 这种方 式由于事先已经知道重新选择的主索引是联通的, 因此可靠性较高;  Corresponding to the two modes of step S304, step S306 can also be implemented in two ways: if the VLAN corresponding to the primary index is not connected, and the connectivity of all VLANs is detected in step S304, the detected from the detected Re-selecting the index corresponding to the Unicom VLAN (can be randomly selected, or selected according to priority, or according to the length of the Unicom time length), etc.) As a primary index, establish a binding relationship between the device port and the reselected primary index. The method is high in reliability because it is known in advance that the re-selected primary index is connected;
如果与主索引对应的 VLAN不联通,并且步驟 S304仅对与主索引对应 的 VLAN的联通性进行了检测时, 则选择其他的任意一个 VLAN作为主索 引, 该方式是一种相对简便的方式, 不需要对所有 VLAN的联通性都进行 实时的检测。  If the VLAN corresponding to the primary index is not connected, and step S304 detects only the connectivity of the VLAN corresponding to the primary index, then selecting any other VLAN as the primary index is a relatively simple manner. Real-time detection of connectivity of all VLANs is not required.
5307 , 设备端口的数据包通过与重新选择的主索引对应的 VLAN发给路由 器。  5307. The data packet of the device port is sent to the router through the VLAN corresponding to the reselected primary index.
如, 主索引修改为索引 2后, EthO发出的数据包采用与索引 2对应的 VLAN200发给相应的路由器。 For example, after the primary index is modified to index 2, the data packet sent by EthO is corresponding to index 2. VLAN 200 is sent to the corresponding router.
本实施例的方法为与设备同一端口连接的多个 VLAN分别建立对应的 索引, 通过选择一个主索引来选择实际使用的 VLAN , 该方法不需要增加 端口数目和 IP地址数量就能够实现端口与多个虚拟局域网的连接, 并通过 多个虚拟局域网向路由器发送数据, 减少了对端口、 IP 的需求, 对上层应 用也没有影响。  The method in this embodiment is to establish a corresponding index for multiple VLANs connected to the same port of the device, and select a primary index to select the actually used VLAN. This method can implement ports and ports without increasing the number of ports and the number of IP addresses. A virtual LAN connection, and sending data to the router through multiple virtual local area networks, reduces the need for ports and IP, and has no effect on the upper layer application.
进一步, 本实施例的方法在设备上进行端口和 VLAN索引的绑定, 当 采用某个 VLAN无法正常通信时, 可以只变更通信端口对应的 VLAN索引 来切换 VLAN , 而不需要变换 IP地址。 本实施例的方法只采用一个端口就 能实现多个 VLAN的切换。  Further, the method in this embodiment performs port and VLAN index binding on the device. When a VLAN cannot communicate normally, the VLAN index corresponding to the communication port can be changed to switch the VLAN without changing the IP address. The method of this embodiment can implement switching of multiple VLANs by using only one port.
并且, 本实施例可以将路由器 ARP表项 (表 1 ) 和端口索引绑定表项 (表 2) 分开存储, 其好处是, 一旦 VLAN进行了切换, 只需要修改端口 索引匹配表项 (表 2), 而不需要对路由器 ARP表项 (表 1 ) 进行更新。 例 如, EthO首先与索引 1建立绑定关系, 索引 1对应 VLAN100 , 从 EthO发 出的数据包带上 VLAN100的包头后根据路由器 ARP表发往路由器; 当检 测到 VLAN100断开时, 将 EthO与索引 1 的绑定关系修改为与索引 2的绑 定关系, 索引 2对应 VLAN200, 从 EthO发出的数据包带上 VLAN200的包 头后根据路由器的 ARP表发往路由器。  In addition, in this embodiment, the router ARP entry (Table 1) and the port index binding entry (Table 2) can be separately stored. The advantage is that once the VLAN is switched, only the port index matching entry needs to be modified (Table 2). ), without updating the router ARP entry (Table 1). For example, EthO first establishes a binding relationship with index 1. Index 1 corresponds to VLAN 100. Packets sent from EthO are sent to the router according to the router ARP table after the packet header of VLAN 100 is sent. When it is detected that VLAN 100 is disconnected, EthO and index 1 are The binding relationship is modified to the binding relationship with index 2. The index 2 corresponds to VLAN 200. The data packet sent from EthO is sent to the router according to the ARP table of the router.
本实施例的方法可以适用于 IEEE 802.1ag协议的网络。 IEEE 802. lag 协议支持在以太网上进行连通性检测, 能够对一些以太网业务降级和失败 等网络异常错误或者异常问题进行及时检测、 恢复和管理。 本发明实施例 的方法可以通过 IEEE 802. lag进行链路的检测并触发 VLAN的切换以完成 二层链路的切换, 达到链路备份和倒换的目的。 由于 802.1ag可以设置很短 的链路通断检测时间, 可以实现迅速的倒换, 只要二层链路中的主链路或 者主、 备链路都支持 802.1ag, 则可以实现这种备份倒换。 实施例 2 : 本实施例提供一种设备, 该设备能够实现实施例 1 中虚拟局域网的数 据传输方法。 本实施例的设备在不同网络应用中可以为终端设备 (如基站 或者 PC服务器等), 也可以是交换机设备或者其他能实现同等功能的其他 通信设备。 The method of this embodiment can be applied to a network of the IEEE 802.1ag protocol. The IEEE 802. lag protocol supports connectivity detection on Ethernet, enabling timely detection, recovery, and management of network anomalies or abnormalities such as downgrading and failure of Ethernet services. The method of the embodiment of the present invention can detect the link and trigger the switching of the VLAN through the IEEE 802. lag to complete the switching of the Layer 2 link, and achieve the purpose of link backup and switching. Since 802.1ag can be set very short The link switching detection time can be quickly switched. This type of backup switching can be implemented as long as the primary link or the primary and backup links of the Layer 2 link support 802.1ag. Embodiment 2: This embodiment provides a device capable of implementing the data transmission method of the virtual local area network in Embodiment 1. The device in this embodiment may be a terminal device (such as a base station or a PC server) in different network applications, or may be a switch device or other communication device capable of implementing equivalent functions.
图 4为本实施例的设备 10的功能框图之一, 如图 4所示: 该设备 10 包括: 建立单元 101, 用于为与设备的同一设备端口连接的多个虚拟局域网 分别建立对应的索引; 绑定单元 102, 用于选择一个建立单元 101建立的索 引作为主索引, 建立设备端口与主索引的绑定关系; 发送单元 103, 用于将 设备端口的数据包通过与主索引对应的虚拟局域网发送给路由器。  FIG. 4 is a functional block diagram of the device 10 of the embodiment. As shown in FIG. 4, the device 10 includes: an establishing unit 101, configured to respectively establish corresponding indexes for multiple virtual local area networks connected to the same device port of the device. The binding unit 102 is configured to select an index established by the establishing unit 101 as a primary index, and establish a binding relationship between the device port and the primary index. The sending unit 103 is configured to: pass the data packet of the device port to the virtual node corresponding to the primary index. The LAN is sent to the router.
可选地, 本实施例的建立单元 101, 用于为与设备的同一端口连接的多 个虚拟局域网分别建立端口索引匹配表项。 如表 2 所示, 该端口索引匹配 表项包括: 设备端口对应的多个虚拟局域网的索引, 多个虚拟局域网的索 引中包含与设备端口绑定的主索引。  Optionally, the establishing unit 101 of the embodiment is configured to establish a port index matching entry for each of multiple virtual local area networks connected to the same port of the device. As shown in Table 2, the port index matching entry includes: an index of multiple virtual local area networks corresponding to the device port, and the index of multiple virtual local area networks includes a primary index bound to the device port.
可选地, 本实施例的设备 10还可以包括: 存储单元 104, 用于存储路 由器地址解析协议 ARP表项,如表 1所示, 本实施例的路由器 ARP表项可 以包括: 路由器的 IP地址、 路由器的媒体访问控制 MAC地址以及连接多 个虚拟局域网的设备端口。  Optionally, the device 10 of this embodiment may further include: a storage unit 104, configured to store a router address resolution protocol ARP entry, as shown in Table 1, the router ARP entry in this embodiment may include: an IP address of the router The media access control MAC address of the router and the device port connecting multiple virtual local area networks.
可选地, 本实施例的设备 10的存储单元 104, 还用于存储每个索引的 索引内容表, 如表 3或表 3a所示, 本实施例的索引内容表包含虚拟局域网 的索引对应的索引值; 该索引值可以是虚拟局域网标识 VLAN ID; 或者该 索引值也可以为 IP地址的差分服务代码点字段 DSCP, 一个 DSCP值对应 一个 VLAN。 Optionally, the storage unit 104 of the device 10 of the embodiment is further configured to store an index content table of each index, as shown in Table 3 or Table 3a, where the index content table of the embodiment includes a virtual local area network. The index value corresponding to the index; the index value may be a virtual local area network identifier VLAN ID; or the index value may also be a differential service code point field DSCP of the IP address, and one DSCP value corresponds to one VLAN.
以表 1〜表 3的内容为例: 设备 10的建立单元 101建立了表 1〜表 3 ; 绑 定单元 102将表 2中的主索引选择为索引 1 ; 发送单元 103将 EthO发出的 数据包通过索引 1对应的 VLAN100发送给表 1所示的路由器。  Taking the contents of Table 1 to Table 3 as an example: the establishment unit 101 of the device 10 establishes Table 1 to Table 3; the binding unit 102 selects the primary index in Table 2 as the index 1; and the transmitting unit 103 transmits the data packet sent by the EthO. The VLAN 100 corresponding to index 1 is sent to the router shown in Table 1.
图 5为本实施例设备 10的功能框图之二。 如图 5所示, 本实施例的设 备 10除了包含图 4的单元之外, 还包括检测单元 105和更新单元 106, 这 两个单元配合实现 VLAN 的切换。 其中: 检测单元 105, 用于检测主索引 对应的虚拟局域网所在的通信链路是否无法正常通信; 更新单元 106, 用于 当主索引对应的虚拟局域网所在的通信链路无法正常通信时, 重新选择一 个建立的索引作为主索引, 并将绑定关系更新为设备端口与重新选择的主 索引之间的绑定关系; 发送单元 103, 用于将设备端口的数据包通过与重新 选择的主索引对应的虚拟局域网发送给路由器。  FIG. 5 is a second functional block diagram of the device 10 of the embodiment. As shown in FIG. 5, the device 10 of the present embodiment includes a detecting unit 105 and an updating unit 106 in addition to the unit of FIG. 4, and these two units cooperate to implement VLAN switching. The detecting unit 105 is configured to detect whether the communication link where the virtual local area network corresponding to the primary index is incapable of communicating normally, and the updating unit 106, configured to: when the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, reselect one The established index is used as the primary index, and the binding relationship is updated to the binding relationship between the device port and the reselected primary index. The sending unit 103 is configured to pass the data packet of the device port to the primary index corresponding to the reselected primary index. The virtual LAN is sent to the router.
本实施例由检测单元 105和更新单元 106共同配合来重新选择主索引。 一种可选方式是, 检测单元 105, 仅检测主索引对应的虚拟局域网所在的通 信链路是否无法正常通信; 更新单元 106, 当主索引对应的虚拟局域网所在 的通信链路无法正常通信时, 从建立的全部索引中重新选择一个作为主索 引。 该方式仅需检测与主索引对应 VLAN的联通性, 是一种高效简便的方 式。  In this embodiment, the detecting unit 105 and the updating unit 106 cooperate to reselect the main index. An optional method is: the detecting unit 105 detects only whether the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally; and the updating unit 106, when the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, Reselect one of the established indexes as the primary index. This method only needs to detect the connectivity of the VLAN corresponding to the primary index, which is an efficient and convenient method.
另一种可选方式是, 检测单元 105, 检测与设备的同一端口连接的所有 虚拟局域网所在的通信链路是否能够正常通信; 更新单元 106, 从能够正常 通信的通信链路所对应的索引中重新选择一个作为主索引。 该方式需要检 测所有 VLAN的联通性, 能够确保切换后的 VLAN可用, 是一种可靠的方 式。 Alternatively, the detecting unit 105 detects whether the communication link of all the virtual local area networks connected to the same port of the device can communicate normally; the updating unit 106, from the index corresponding to the communication link capable of normal communication Reselect one as the primary index. This method needs to be checked It is a reliable way to measure the connectivity of all VLANs and ensure that the switched VLANs are available.
以表 1〜表 3的内容为例: 设备 10的建立单元 101建立了表 1〜表 3 ; 绑 定单元 102将表 2中的主索引选择为索引 1 ; 发送单元 103将 EthO发出的 数据包通过索引 1 对应的 VLAN100发送给表 1 所示的路由器; 检测单元 105和更新单元 106配合完成 VLAN切换:当检测到索引 1对应的 VLAN100 所在的链路无法正常通信时, 进行 VLAN切换, 将 EthO的主索引修改为索 引 2 ;发送单元 103根据修改后的主索引, 将 EthO发出的数据包通过索引 2 对应的 VLAN200发送给表 1所示的路由器。  Taking the contents of Table 1 to Table 3 as an example: the establishment unit 101 of the device 10 establishes Table 1 to Table 3; the binding unit 102 selects the primary index in Table 2 as the index 1; and the transmitting unit 103 transmits the data packet sent by the EthO. The VLAN 100 corresponding to the index 1 is sent to the router shown in Table 1. The detecting unit 105 and the updating unit 106 cooperate to complete the VLAN switching: when detecting that the link of the VLAN 100 corresponding to the index 1 cannot communicate normally, perform VLAN switching, and then perform EthO. The primary index is modified to index 2; the sending unit 103 sends the data packet sent by the EthO to the router shown in Table 1 through the VLAN 200 corresponding to the index 2 according to the modified primary index.
本实施例的设备为与同一端口连接的多个 VLAN 分别建立对应的索 引, 通过选择一个主索引来选择实际使用的 VLAN , 该设备不需要增加端 口数目和 IP地址数量就能够实现端口与多个虚拟局域网的连接, 并通过多 个虚拟局域网向路由器发送数据, 减少了对端口、 IP 的需求, 对上层应用 也没有影响。  The device in this embodiment separately establishes corresponding indexes for multiple VLANs connected to the same port, and selects a primary index to select an actual used VLAN. The device can implement multiple ports without increasing the number of ports and the number of IP addresses. The connection of the virtual local area network and the sending of data to the router through multiple virtual local area networks reduces the need for ports and IP, and has no effect on the upper layer application.
进一步, 本发明实施例的设备进行设备端口和 VLAN索引的绑定, 当 采用某个 VLAN无法正常通信时, 可以只变更通信端口对应的 VLAN索引 来切换 VLAN, 而不需要变换 IP地址。 本实施例的设备只采用一个端口就 能实现多个 VLAN的切换。 并且, 本实施例的设备将路由器 ARP表项 (表 1 ) 和端口索引绑定表项 (表 2) 分开存储, 其好处是, 一旦 VLAN进行了 切换, 只需要修改端口索引匹配表项 (表 2), 而不需要对路由器 ARP表项 (表 1 ) 进行更新。 本实施例的设备同样适用于 IEEE 802.1ag协议的网络。 实施例 3: 本实施例提供一种虚拟局域网的数据传输系统。该系统包含了实施例 2 的设备, 并能够实现实施例 1 的数据传输方法。 本实施例提供了多种系统 架构, 分别对应于实施例 2 的终端设备和交换机设备。 该系统包括前述设 备实施例的设备, 而且, 当上述设备为终端设备时, 系统还包括: 与终端 设备同一端口连接的多个虚拟局域网, 与该多个虚拟局域网连接的路由器; 当设备为交换机设备时, 系统还包括: 与该交换机连接的终端设备, 与该 交换机同一端口连接的多个虚拟局域网, 与多个虚拟局域网连接的路由器。 以下分别进行详细描述。 Further, the device in the embodiment of the present invention binds the device port and the VLAN index. When a certain VLAN cannot communicate normally, the VLAN index of the communication port can be changed to switch the VLAN without changing the IP address. The device of this embodiment can implement switching of multiple VLANs by using only one port. In addition, the device in this embodiment separately stores the router ARP entry (Table 1) and the port index binding entry (Table 2). The advantage is that once the VLAN is switched, only the port index matching entry needs to be modified. 2), without updating the router ARP entry (Table 1). The device of this embodiment is also applicable to the network of the IEEE 802.1ag protocol. Example 3: This embodiment provides a data transmission system of a virtual local area network. The system includes the apparatus of Embodiment 2 and is capable of implementing the data transmission method of Embodiment 1. This embodiment provides various system architectures, which respectively correspond to the terminal device and the switch device of Embodiment 2. The system includes the device of the foregoing device embodiment, and when the device is a terminal device, the system further includes: a plurality of virtual local area networks connected to the same port of the terminal device, a router connected to the plurality of virtual local area networks; and the device is a switch In the case of the device, the system further includes: a terminal device connected to the switch, a plurality of virtual local area networks connected to the same port of the switch, and a router connected to the plurality of virtual local area networks. The details are described below separately.
图 6 为本实施例虚拟局域网的数据传输系统的原理图之一, 该原理图 以两个 VLAN为例进行说明。  FIG. 6 is a schematic diagram of a data transmission system of a virtual local area network according to an embodiment of the present invention. The schematic diagram uses two VLANs as an example for description.
如图 6所示: 该系统包括终端设备 10 (原理框图可参见图 4〜图 5), 与 终端设备 10连接的交换机 20, 路由器 60, 和路由器 60连接的交换机 50, 交换机 20和交换机 50之间连接有 VLAN30和 VLAN40,可以设定 VLAN30 为主链路, VLAN40为备用链路, VLAN30和 VLAN40中的 Lanswitch (以 太网交换机) 负责支持组网和转发报文。 终端设备 10 采用一个端口连接 VLAN30和 VLAN40。 终端设备 10与交换机 20之间的端口为 TRUNK (汇 聚链接)端口,路由器 60与交换机 50之间的端口也为 TRUNK端口, TRUNK 端口可以传送携带不同 VLAN头的报文,可以接收和发送多种 VLAN ID的 报文。  As shown in FIG. 6, the system includes a terminal device 10 (see FIG. 4 to FIG. 5 for a block diagram), a switch 20 connected to the terminal device 10, a router 60, and a switch 50 connected to the router 60, a switch 20, and a switch 50. With VLAN 30 and VLAN 40 connected, you can set VLAN 30 as the primary link and VLAN 40 as the standby link. The Lanswitch (Ethernet switch) in VLAN 30 and VLAN 40 is responsible for supporting networking and forwarding packets. The terminal device 10 uses one port to connect VLAN 30 and VLAN 40. The port between the terminal device 10 and the switch 20 is a TRUNK port, and the port between the router 60 and the switch 50 is also a TRUNK port. The TRUNK port can transmit packets carrying different VLAN headers, and can receive and send multiple types of packets. VLAN ID packet.
为了检测 VLAN30和 VLAN40的联通性, 可以设置联通性的检测域, 根据 802. lag协议来检测 VLAN30和 VLAN40的联通性, 具体包括: 在检 测域的两端分别设置 MEP (Maintenance association End Point, 维护联盟边 缘节点), 在检测域内选择性设置 MIP (Maintenance association Intermediate Point, 维护联盟边缘节点) 或 MEP。 可选地, 在图 6中, 可以在交换机 50 中设置 MEP1 , 在终端设备设置 MEP4 , 在 VLAN30 内部设置 MIP1 , 在 VLAN40 内部设置 MIP2。 通过设置的这些维护点来检测 VLAN30 和 VLAN40的联通性。 To check the connectivity of VLAN 30 and VLAN 40, you can set the connectivity detection domain and check the connectivity of VLAN 30 and VLAN 40 according to the 802. lag protocol. The details include: Setting the MEP (Maintenance Association End Point) on both ends of the detection domain. Alliance edge node), selectively set MIP in the detection domain (Maintenance association Intermediate) Point, maintain the federation edge node) or MEP. Optionally, in FIG. 6, MEP1 may be set in switch 50, MEP4 may be set in the terminal device, MIP1 is set in VLAN 30, and MIP2 is set in VLAN 40. The connectivity between VLAN 30 and VLAN 40 is detected by these maintenance points.
图 7 为本实施例虚拟局域网的数据传输系统的原理图之二。 和图 6不 同的是, 图 7的 VLAN30和 VLAN40分别连接不同的路由器 60和路由器 70。终端设备 10需要分别存储路由器 60和路由器 70的 ARP表。 当 VLAN 发生切换时, 同时切换对应的路由器。 如, 当从 VLAN30切换到 VLAN40 时,同时将 IP包的下一跳地址从路由器 60的 IP地址修改为路由器 70的 IP 地址。  FIG. 7 is a second schematic diagram of a data transmission system of a virtual local area network according to the embodiment. Different from Figure 6, VLAN 30 and VLAN 40 of Figure 7 are connected to different routers 60 and routers 70, respectively. The terminal device 10 needs to store the ARP tables of the router 60 and the router 70, respectively. When the VLAN is switched, the corresponding router is switched at the same time. For example, when switching from VLAN 30 to VLAN 40, the next hop address of the IP packet is simultaneously changed from the IP address of the router 60 to the IP address of the router 70.
图 8为本实施例虚拟局域网的数据传输系统的原理图之三。 和图 6、 图 7 不同的是, 本实施例的 VLAN切换工作由交换机完成, 终端设备只需要 和交换机之间完成简单的数据传输即可。 如图 8 所示: 该系统包括终端设 备 10, 与终端设备 10连接的交换机 20 (原理参见图 4〜图 5) 和路由器 60, 交换机 20和路由器 60之间连接有 VLAN30和 VLAN40,可以设定 VLAN30 为主链路 VLAN40为备用链路。 交换机 20采用同一端口连接 VLAN30和 VLAN40。 交换机设备 20与终端设备 10之间的端口为 ACCESS端口。  FIG. 8 is a third schematic diagram of the data transmission system of the virtual local area network according to the embodiment. Different from FIG. 6 and FIG. 7 , the VLAN switching work in this embodiment is completed by the switch, and the terminal device only needs to complete simple data transmission with the switch. As shown in FIG. 8, the system includes a terminal device 10, a switch 20 connected to the terminal device 10 (see FIG. 4 to FIG. 5 for details), and a router 60. A VLAN 30 and a VLAN 40 are connected between the switch 20 and the router 60, and can be set. VLAN 30 is the standby link VLAN 40. Switch 20 uses the same port to connect VLAN 30 and VLAN 40. The port between the switch device 20 and the terminal device 10 is an ACCESS port.
为了检测 VLAN30和 VLAN40的联通性, 可以设置联通性的检测域, 根据 802. lag协议来检测 VLAN30和 VLAN40的联通性, 图 8中由于终端 设备不需要了解 VLAN的联通性,因此不需要在终端设备 10中设置维护点, 图 8 中, 可以在交换机 20 中设置 MEP4 , 在 VLAN30 内部设置 MEP2和 MIP1 , 在 VLAN40 内部设置 MEP3和 MIP2 , 通过设置的这些维护点来检 测 VLAN1和 VLAN2的联通性。 本实施例的系统为与终端设备或交换机设备的同一端口连接的多个In order to check the connectivity of VLAN 30 and VLAN 40, you can set the connectivity detection domain and check the connectivity between VLAN 30 and VLAN 40 according to the 802. lag protocol. In Figure 8, the terminal device does not need to know the connectivity of the VLAN, so it does not need to be in the terminal. In the device 10, a maintenance point is set. In Figure 8, MEP4 can be set in the switch 20, MEP2 and MIP1 are set in the VLAN 30, and MEP3 and MIP2 are set in the VLAN 40. The maintenance points of the VLAN 1 and the VLAN 2 are detected through the maintenance points. The system of this embodiment is a plurality of systems connected to the same port of the terminal device or the switch device.
VLAN 分别建立对应的索引, 通过选择一个主索引来选择实际使用的 VLAN , 该系统不需要在设备上增加端口数目和 IP地址数量就能够实现设 备端口与多个虚拟局域网的连接, 并通过多个虚拟局域网向路由器发送数 据, 减少了对端口、 IP的需求, 对上层应用也没有影响。 VLANs respectively establish corresponding indexes. By selecting a primary index to select the actual VLAN to be used, the system can connect the device ports to multiple virtual local area networks without adding the number of ports and the number of IP addresses on the device. The virtual local area network sends data to the router, which reduces the need for ports and IP, and has no effect on the upper layer application.
进一步, 本实施例的系统将设备端口和 VLAN索引的绑定, 当采用某 个 VLAN无法正常通信时, 可以只变更通信端口对应的 VLAN索引来切换 VLAN , 而不需要变换 IP地址。 本实施例的设备只采用一个端口就能实现 多个 VLAN的切换。 程, 是可以通过计算机程序来指令相关的硬件来完成, 该程序可存储于一 计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。 其中, 该存储介质可为磁碟、 光盘、 只读存储记忆体(Read-Only Memory, ROM) 或随机存储己†乙体 (Random Access Memory, RAM) 等。  Further, the system in this embodiment binds the device port and the VLAN index. When a VLAN cannot communicate normally, the VLAN index of the communication port can be changed to switch the VLAN without changing the IP address. The device of this embodiment can implement switching of multiple VLANs by using only one port. The program may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, which, when executed, may include the flow of an embodiment of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (Random Access Memory, RAM).
以上实施例仅用以说明本发明实施例的技术方案, 而非对其限制; 尽 管参照前述实施例对本发明实施例进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相 应技术方案的本质脱离本发明实施例各实施例技术方案的范围。  The above embodiments are only used to explain the technical solutions of the embodiments of the present invention, and are not limited thereto; although the embodiments of the present invention are described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the embodiments are modified, or some of the technical features are replaced by equivalents; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the embodiments of the present invention.

Claims

权利要求 Rights request
1、 一种虚拟局域网的数据传输方法, 其特征在于, 所述方法包括: 为与设备的同一设备端口连接的多个虚拟局域网分别建立对应的索 引;  A data transmission method for a virtual local area network, the method comprising: establishing a corresponding index for each of a plurality of virtual local area networks connected to the same device port of the device;
选择一个建立的索引作为主索引, 建立所述设备端口与所述主索引的 绑定关系;  Selecting an established index as a primary index, and establishing a binding relationship between the device port and the primary index;
将所述设备端口的数据包通过与所述主索引对应的虚拟局域网发送给 路由器。  The data packet of the device port is sent to the router through a virtual local area network corresponding to the primary index.
2、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括; 检测所述主索引对应的虚拟局域网所在的通信链路是否无法正常通 信;  The method according to claim 1, wherein the method further comprises: detecting whether a communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally;
当所述主索引对应的虚拟局域网所在的通信链路无法正常通信时, 重 新选择一个建立的索引作为主索引, 将所述绑定关系更新为所述设备端口 与重新选择的主索引之间的绑定关系;  When the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, re-select an established index as a primary index, and update the binding relationship between the device port and the reselected primary index. Binding relationship
将所述设备端口的数据包通过与重新选择的主索引对应的虚拟局域网 发送给路由器。  The data packet of the device port is sent to the router through a virtual local area network corresponding to the reselected primary index.
3、 根据权利要求 2所述的方法, 其特征在于, 所述重新选择一个建立 的索引作为主索引, 包括:  The method according to claim 2, wherein the re-selecting an established index as a primary index comprises:
从建立的全部索引中重新选择一个建立的索引作为主索引。  Re-select an established index from the established index as the primary index.
4、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 检测 与所述设备的同一端口连接的所有虚拟局域网所在的通信链路是否能够正 常通信;  The method according to claim 2, wherein the method further comprises: detecting whether a communication link of all virtual local area networks connected to the same port of the device is capable of normal communication;
所述重新选择一个建立的索引作为主索引, 包括: 从能够正常通信的通信链路所对应的索引中重新选择一个建立的索引 作为主索引。 The re-selecting an established index as a primary index includes: Re-select an established index as the primary index from the index corresponding to the communication link capable of normal communication.
5、 根据权利要求 1至 4任一项所述的方法, 其特征在于,  5. A method according to any one of claims 1 to 4, characterized in that
所述为与设备的同一设备端口连接的多个虚拟局域网分别建立对应的 索引包括: 为与设备的同一设备端口连接的多个虚拟局域网分别建立端口 索引匹配表项, 所述端口索引匹配表项包括: 所述设备端口对应的多个虚 拟局域网的索引, 所述多个虚拟局域网的索引中包含与所述设备端口绑定 的主索引;  The establishing a corresponding index for the multiple virtual local area networks connected to the same device port of the device includes: establishing a port index matching entry for the plurality of virtual local area networks connected to the same device port of the device, where the port index matching entry The index of the plurality of virtual local area networks corresponding to the device port, where the indexes of the plurality of virtual local area networks include a primary index bound to the device port;
所述方法还包括: 存储路由器地址解析协议 ARP 表项, 所述路由器 ARP表项包括: 所述路由器的 IP地址、 所述路由器的媒体访问控制 MAC 地址以及连接所述多个虚拟局域网的设备端口。  The method further includes: storing a router address resolution protocol ARP entry, where the router ARP entry includes: an IP address of the router, a media access control MAC address of the router, and a device port connecting the multiple virtual local area networks .
6、 根据权利要求 5所述的方法, 其特征在于,  6. The method of claim 5, wherein
所述方法还包括: 存储每个索引的索引内容表, 所述索引内容表包含 所述虚拟局域网的索引对应的索引值; 所述索引值为虚拟局域网标识; 或 者, 所述索引值为 IP地址的差分服务代码点字段, 其中, 一个差分服务代 码点值对应一个虚拟局域网。  The method further includes: storing an index content table of each index, where the index content table includes an index value corresponding to an index of the virtual local area network; the index value is a virtual local area network identifier; or the index value is an IP address. A differential service code point field, where a differential service code point value corresponds to a virtual local area network.
7、 一种设备, 其特征在于, 所述设备包括:  7. A device, wherein the device comprises:
建立单元, 用于为与设备的同一设备端口连接的多个虚拟局域网分别 建立对应的索引;  Establishing a unit, configured to respectively establish a corresponding index for multiple virtual local area networks connected to the same device port of the device;
绑定单元, 用于选择一个所述建立单元建立的索引作为主索引, 建立 所述设备端口与所述主索引的绑定关系;  a binding unit, configured to select an index established by the establishing unit as a primary index, and establish a binding relationship between the device port and the primary index;
发送单元, 用于将所述设备端口的数据包通过与所述主索引对应的虚 拟局域网发送给路由器。 And a sending unit, configured to send, by the virtual local area network corresponding to the primary index, the data packet of the device port to the router.
8、 根据权利要求 7所述的设备, 其特征在于, 所述设备还包括: 检测单元, 用于检测所述主索引对应的虚拟局域网所在的通信链路是 否无法正常通信; The device according to claim 7, wherein the device further comprises: a detecting unit, configured to detect whether a communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally;
更新单元, 用于当所述主索引对应的虚拟局域网所在的通信链路无法 正常通信时, 重新选择一个建立的索引作为主索引, 并将所述绑定关系更 新为所述设备端口与重新选择的主索引之间的绑定关系;  And an updating unit, configured to: when the communication link where the virtual local area network corresponding to the primary index is located cannot communicate normally, reselect an established index as a primary index, and update the binding relationship to the device port and reselect The binding relationship between the primary indexes;
所述发送单元, 用于将所述设备端口的数据包通过与重新选择的主索 ^ I对应的虚拟局域网发送给路由器。  The sending unit is configured to send the data packet of the device port to the router through a virtual local area network corresponding to the reselected primary cable.
9、 根据权利要求 8所述的设备, 其特征在于,  9. Apparatus according to claim 8 wherein:
所述更新单元, 用于从建立的全部索引中重新选择一个建立的索引作 为主索引。  The updating unit is configured to reselect an established index from the established indexes as a primary index.
10、 根据权利要求 8所述的设备, 其特征在于,  10. Apparatus according to claim 8 wherein:
所述检测单元, 还用于检测与所述设备的同一端口连接的所有虚拟局 域网所在的通信链路是否能够正常通信;  The detecting unit is further configured to detect whether a communication link where all virtual local area networks connected to the same port of the device are located can communicate normally;
所述更新单元, 还用于从能够正常通信的通信链路所对应的索引中重 新选择一个建立的索引作为主索引。  The updating unit is further configured to reselect an established index as a primary index from an index corresponding to a communication link capable of normal communication.
11、 根据权利要求 7-10任一项所述的设备, 其特征在于,  11. Apparatus according to any of claims 7-10, characterized in that
所述建立单元, 用于为与设备的同一端口连接的多个虚拟局域网分别 建立端口索引匹配表项, 所述端口索引匹配表项包括: 所述设备端口对应 的多个虚拟局域网的索引, 所述多个虚拟局域网的索引中包含与所述设备 端口绑定的主索引;  The establishing unit is configured to establish a port index matching entry for the plurality of virtual local area networks connected to the same port of the device, where the port index matching entry includes: an index of multiple virtual local area networks corresponding to the device port, where The index of the plurality of virtual local area networks includes a primary index bound to the device port;
所述装置还包括:存储单元,用于存储路由器地址解析协议 ARP表项, 所述路由器 ARP表项包括: 所述路由器的 IP地址、 所述路由器的媒体访问 控制 MAC地址以及连接所述多个虚拟局域网的设备端口。 The device further includes: a storage unit, configured to store a router address resolution protocol ARP entry, where the router ARP entry includes: an IP address of the router, and media access of the router Controlling the MAC address and the device port connecting the plurality of virtual local area networks.
12、 根据权利要求 11所述的设备, 其特征在于,  12. Apparatus according to claim 11 wherein:
所述存储单元, 还用于存储每个索引的索引内容表, 所述索引内容表 包含所述虚拟局域网的索引对应的索引值; 所述索引值为虚拟局域网标识; 或者所述索引值为 IP地址的差分服务代码点字段, 其中, 一个差分服务代 码点值对应一个虚拟局域网。  The storage unit is further configured to store an index content table of each index, where the index content table includes an index value corresponding to an index of the virtual local area network; the index value is a virtual local area network identifier; or the index value is an IP value. The differential service code point field of the address, where a differential service code point value corresponds to a virtual local area network.
13、 根据权利要求 12所述的设备, 其特征在于, 所述设备为终端设备 或交换机设备。  13. The device according to claim 12, wherein the device is a terminal device or a switch device.
14、 一种虚拟局域网的数据传输系统, 其特征在于, 包括如权利要求 7-12任一项所述的设备,  A data transmission system for a virtual local area network, comprising: the apparatus according to any one of claims 7-12,
当所述的设备为终端设备时, 所述系统还包括: 与所述终端设备同一 端口连接的多个虚拟局域网, 以及, 与所述多个虚拟局域网连接的路由器; 当所述的设备为交换机设备时, 所述系统还包括: 终端设备, 所述终 端设备与所述交换机设备连接, 与所述交换机设备同一端口连接的多个虚 拟局域网, 以及与所述多个虚拟局域网连接的路由器。  When the device is a terminal device, the system further includes: a plurality of virtual local area networks connected to the same port of the terminal device, and a router connected to the plurality of virtual local area networks; when the device is a switch In the device, the system further includes: a terminal device, the terminal device is connected to the switch device, a plurality of virtual local area networks connected to the same port of the switch device, and a router connected to the plurality of virtual local area networks.
PCT/CN2010/078635 2009-11-13 2010-11-11 Data transmission method, device and system for virtual local area networks WO2011057570A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910221837.8 2009-11-13
CN2009102218378A CN101702664B (en) 2009-11-13 2009-11-13 Data transmission method, device and system of virtual local area network

Publications (1)

Publication Number Publication Date
WO2011057570A1 true WO2011057570A1 (en) 2011-05-19

Family

ID=42157559

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/078635 WO2011057570A1 (en) 2009-11-13 2010-11-11 Data transmission method, device and system for virtual local area networks

Country Status (2)

Country Link
CN (1) CN101702664B (en)
WO (1) WO2011057570A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702664B (en) * 2009-11-13 2012-04-25 华为技术有限公司 Data transmission method, device and system of virtual local area network
CN102412978B (en) * 2010-09-21 2014-04-16 杭州华三通信技术有限公司 Method for carrying out network configuration for VM and system thereof
CN102752199B (en) * 2012-06-21 2014-12-24 中国科学院计算技术研究所 Method and system for constructing data forwarding plane of virtual router
CN105939309B (en) * 2015-07-28 2019-08-06 杭州迪普科技股份有限公司 A kind of virtual machine partition method and device
CN109889421B (en) * 2019-03-06 2021-04-30 乐鑫信息科技(上海)股份有限公司 Router management method, device, terminal, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540932A (en) * 2003-04-22 2004-10-27 华为技术有限公司 Implementing Method for sending datagram type message from assigned port
US20080013481A1 (en) * 2006-07-17 2008-01-17 Michael Terry Simons Wireless VLAN system and method
WO2008145677A1 (en) * 2007-05-29 2008-12-04 Packetfront Systems Ab Method of connecting vlan systems to other networks via a router
CN101702664A (en) * 2009-11-13 2010-05-05 华为技术有限公司 Data transmission method, device and system of virtual local area network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100454890C (en) * 2004-04-01 2009-01-21 华为技术有限公司 Data exchange method based on virtual local area network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540932A (en) * 2003-04-22 2004-10-27 华为技术有限公司 Implementing Method for sending datagram type message from assigned port
US20080013481A1 (en) * 2006-07-17 2008-01-17 Michael Terry Simons Wireless VLAN system and method
WO2008145677A1 (en) * 2007-05-29 2008-12-04 Packetfront Systems Ab Method of connecting vlan systems to other networks via a router
CN101702664A (en) * 2009-11-13 2010-05-05 华为技术有限公司 Data transmission method, device and system of virtual local area network

Also Published As

Publication number Publication date
CN101702664B (en) 2012-04-25
CN101702664A (en) 2010-05-05

Similar Documents

Publication Publication Date Title
CN110635935B (en) Using multiple EVPN routes for respective service interfaces of a user interface
US8861345B2 (en) Border gateway protocol extension for the host joining/leaving a virtual private network
US8121126B1 (en) Layer two (L2) network access node having data plane MPLS
JP5265785B2 (en) Scaled Ethernet OAM for mesh and hub-and-spoke networks
US8085791B1 (en) Using layer two control protocol (L2CP) for data plane MPLS within an L2 network access node
US8804723B2 (en) Efficient control packet replication in data plane
US20180139173A1 (en) Method and apparatus for implementing a fibre channel zone policy
PH12015502297B1 (en) A method and system for updating distributed resilient network interconnect (drni) states
WO2012088982A1 (en) Method, apparatus and virtual private network system for issuing routing information
EP2099180B1 (en) Switching device and method for Layer-2 forwarding of OAM frames with multicast Layer-3 addresses
WO2013182059A1 (en) Method and device for establishing multi-protocol label switching traffic engineering tunnel
WO2009056034A1 (en) Method, system and equipment to establish bfd detection for lsp tunnel
TW201134151A (en) RSVP-TE graceful restart under fast re-route conditions
WO2007141840A1 (en) Relay network system and terminal adapter
WO2005112350A1 (en) A METHOD FOR MANAGING THE ROUTE IN THE VIRTUAL PRIVATE NETWORK BASED ON IPv6
WO2008028382A1 (en) A method and apparatus for carrying out link detecting, routing strategy conversion of end-to-end
WO2008080427A1 (en) Method of providing data
WO2019223534A1 (en) Method and device for monitoring forwarding table entry
WO2011057570A1 (en) Data transmission method, device and system for virtual local area networks
WO2011120463A2 (en) Method, system and network device for quality of service (qos) negotiation in cross-medium networks
WO2011127849A2 (en) Method and network device for transmitting data stream
EP3750073B1 (en) A method for seamless migration of session authentication to a different stateful diameter authenticating peer
WO2007031006A1 (en) A virtual switching method which could be routed
WO2011047610A1 (en) Method for customer edge device auto management and provider edge device
Cisco Remote Access to MPLS VPN

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

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

Country of ref document: EP

Kind code of ref document: A1