WO2016062035A1 - Onu虚拟局域网标记处理装置、方法及计算机存储介质 - Google Patents

Onu虚拟局域网标记处理装置、方法及计算机存储介质 Download PDF

Info

Publication number
WO2016062035A1
WO2016062035A1 PCT/CN2015/076614 CN2015076614W WO2016062035A1 WO 2016062035 A1 WO2016062035 A1 WO 2016062035A1 CN 2015076614 W CN2015076614 W CN 2015076614W WO 2016062035 A1 WO2016062035 A1 WO 2016062035A1
Authority
WO
WIPO (PCT)
Prior art keywords
tag
data packet
uni
port number
local area
Prior art date
Application number
PCT/CN2015/076614
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 深圳市中兴微电子技术有限公司
Publication of WO2016062035A1 publication Critical patent/WO2016062035A1/zh

Links

Images

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

Definitions

  • the present invention relates to the field of optical network units (ONUs) of passive optical networks (PONs), and in particular, to an ONU packet processor and a virtual local area network tag processing apparatus, method and computer storage medium.
  • ONUs optical network units
  • PONs passive optical networks
  • EPON Ethernet Passive Optical Network
  • GPON Gigabit-Capable Passive Optical Network
  • Two-tier technology EPON adopts the Ethernet protocol on the second layer, and combines Ethernet technology and PON technology perfectly, which is very suitable for broadband access technology of IP services.
  • GPON adopts the general framing procedure defined by the International Telecommunication Union on the second layer to encapsulate and map various services such as Ethernet protocol, asynchronous transmission mode and time division multiplexing mode, and has powerful operation, maintenance and management functions.
  • EPON and GPON coexist on the market, and they are developing rapidly. In the future access network market, there are huge business opportunities and very broad market prospects.
  • the ONU chip should have the function of processing the input packet virtual local area network (VLAN) tag (Tag) domain, and must be able to prohibit/allow specific VLAN tag (VLAN tag).
  • VLAN tag virtual local area network
  • the user access can also add, delete, transparently transmit or modify the VLAN tag field carried by the package.
  • the virtual local area network is divided into a service Provider VLAN (S-VLAN) and a user VLAN (C-VLAN).
  • S-VLAN service Provider VLAN
  • C-VLAN user VLAN
  • S-VLAN service Provider VLAN
  • S-VLAN user VLAN
  • C-VLAN user VLAN
  • the ONU chip realizes the mark processing function by using the embedded Reduced Instruction Set Computer (RISC) or the Ternary Content Addressable Memory (TCAM) to detect and parse the data packet.
  • RISC Reduced Instruction Set Computer
  • TCAM Ternary Content Addressable Memory
  • the result of the detection and parsing modifies the virtual local area network tag of the packet.
  • RISC Reduced Instruction Set Computer
  • TCAM Ternary Content Addressable Memory
  • ONU chips are required to process data packets of 1 to 10 gigabits or more. Therefore, when RISC is adopted, multiple RISC core structures are required, thus increasing the design complexity, area and power consumption of the ONU chip; when using TCAM, the TCAM itself has a large area and power consumption, and needs to be purchased exclusively for TCAM manufacturers.
  • the TCAM core will increase the production cost of the ONU chip while increasing the area and power consumption of the ONU chip.
  • embodiments of the present invention are expected to provide an ONU virtual local area network mark processing device, method, and computer storage medium, which are simple in structure, low in power consumption, and low in cost.
  • An embodiment of the present invention provides an ONU virtual local area network tag processing apparatus, including: a tag conversion table module, a MAC address, an input/output port number, and a tag information extraction module, a tag conversion table reading module, a tag conversion module, and a UNI port. a register configuration module and a MAC address table management module; wherein
  • the tag conversion table module is configured to store a tag conversion table, where the correspondence between the user network interface UNI port number and the virtual local area network tag information and the tag conversion rule is pre-set in the tag conversion table;
  • the MAC address, the input/output port number, and the tag information extraction module are configured to receive a data packet header, obtain a source MAC address, a destination MAC address, an input/output UNI or PON port number, and a virtual local area network tag information of the data packet;
  • the tag conversion table reading module is configured to: after obtaining the tag information conversion manner corresponding to the data packet from the UNI port register configuration module according to the input/output UNI port number of the data packet, according to the data packet Input/output UNI port number and virtual local area network tag information, reading a tag conversion table corresponding to the data packet, and acquiring a tag conversion rule corresponding to the data packet;
  • a tag conversion module configured to transform virtual local area network tag information of the data packet according to the tag conversion rule
  • the UNI port register configuration module is configured to configure a value of a UNI port based register, where the value based on the UNI port register includes a label conversion manner corresponding to the UNI port;
  • the MAC address table management module is configured to save a correspondence between a source/destination MAC address of the data packet, a virtual local area network label VLAN ID, and a packet input/output port.
  • the mark conversion table module includes:
  • a tag conversion table sub-module based on a UNI port number, a virtual local area network label VLAN ID, and a tag priority configured to store a tag conversion table based on a UNI port number, a virtual local area network label VLAN ID, and a tag priority level, the UNI port number,
  • the correspondence between the UNI port number, the virtual local area network tag information, and the tag change rule is pre-configured in the tag conversion table of the virtual local area network label VLAN ID and the tag priority level;
  • a tag conversion table sub-module based on the UNI port number and the tag priority is configured to store a tag conversion table based on the UNI port number and the tag priority, and the tag conversion table based on the UNI port number and the tag priority is pre-configured with the UNI port.
  • a single layer tag packet tag conversion table submodule based on a UNI port number, configured to store a tag conversion table of a single layer tag packet, and the tag conversion table of the single layer tag packet is pre-configured with a single layer tag packet UNI Correspondence between the port number and the tag change rule;
  • a double-layer tagged packet tag conversion table sub-module based on a UNI port number, configured to store a tag conversion table of a double-layer tagged packet, the tag conversion table of the double-layer tagged packet being pre-configured with a double-layer tagged packet UNI port number and tag transform The correspondence of rules.
  • the label conversion table module includes:
  • the PON side output or the UNI loopback label conversion table submodule of the passive optical network is configured to store the PON side output or the UNI loopback label conversion table, and the PON side output or the UNI loopback label conversion table is pre-configured with the PON side output. Or a token transformation rule corresponding to the data packet of the UNI loopback and a stream number of the data packet;
  • the UNI side output tag conversion table sub-module is configured to store a UNI-side output tag conversion table, and the UNI-side output tag conversion table is provided with a tag conversion method corresponding to a packet output by the UNI side.
  • the MAC address, the input/output port number, and the tag information extraction module include:
  • a tag information obtaining submodule configured to receive a packet header and obtain virtual network local area tag information of the data packet
  • the port number acquisition submodule is configured to obtain the source and destination MAC addresses of the data packet, input the UNI port number, and output the UNI or PON port number.
  • the port number obtaining submodule includes:
  • the UNI obtaining unit is configured to obtain an input UNI port number of the input data packet of the UNI side, and send the input UNI port number to the MAC address table management module;
  • the source and destination MAC address obtaining units are configured to obtain the source MAC address and the destination MAC address of the UNI side input or the PON side input data packet, and send them to the MAC address management module;
  • Output UNI/PON acquisition unit configured to obtain the UNI side of the UNI side input data packet or The output port number of the PON side, or configured to obtain the UNI side output port number of the input packet of the PON side.
  • the tag information obtaining module sends the original outer VLAN ID of the obtained packet to the MAC address table management.
  • the module, for the data packet input by the UNI side, the tag conversion module sends the outer VLAN ID obtained after the tag conversion to the MAC address table management module, and receives the output UNI or PON port number of the data packet returned by the address table management module.
  • the tag conversion table reading module includes:
  • a tag information conversion mode obtaining submodule configured to acquire, according to the input/output UNI port number of the data packet, a tag information conversion manner corresponding to the data packet from the UNI port register configuration module;
  • a read address generation submodule configured to generate a tag conversion table read address corresponding to the data packet according to the tag information conversion manner, and the input/output UNI port number of the data packet and the virtual local area network tag information;
  • the table reading submodule is configured to read the tag conversion table corresponding to the data packet according to the read address, and obtain a tag conversion rule of the data packet.
  • the read address generation submodule includes:
  • the mode 1 read address generating unit is configured to generate the data packet corresponding to the UNI based port according to the input/output UNI port number of the data packet and the virtual local area network tag information when the method 1 includes the mode information conversion manner corresponding to the data packet.
  • the mode 2 read address generating unit is configured to generate the data packet corresponding to the UNI-based port according to the input/output UNI port number of the data packet and the virtual local area network tag information when the mode 2 includes the mode information conversion manner corresponding to the data packet.
  • a tag conversion table read address of the virtual local area network label VLAN ID and the tag priority level; wherein the virtual local area network tag information does not include tag priority information;
  • the mode 3 read address generating unit is configured to convert the tag information corresponding to the data packet.
  • the data packet is generated corresponding to the tag conversion table read address based on the UNI port number and the tag priority;
  • the mode 4 read address generating unit is configured to generate the data packet based on the UNI port number corresponding to the single layer mark packet according to the input/output UNI port number of the data packet when the mode 4 includes the mode 4
  • the tag conversion table read address of the single layer tag packet corresponds to the tag conversion table read address of the bilayer tag packet based on the UNI port number generated by the double layer tag packet.
  • the table reading submodule includes:
  • the tag conversion table reading unit based on the UNI port number, the virtual local area network label VLAN ID, and the tag priority level is configured to read the read address generated by the address generating unit according to the mode 1/mode 2, and read the UNI port number, the virtual local area network label VLAN a tag conversion table sub-module of an ID and a tag priority, and acquiring a tag conversion rule of the data packet;
  • a tag conversion table reading unit based on the UNI port number and the tag priority, configured to read the read address generated by the address generation unit according to the mode 3, and read the tag conversion table submodule based on the UNI port number and the tag priority, and obtain the Tag conversion rules for data packets;
  • the single layer/double layer mark packet mark conversion table reading unit based on the UNI port number is configured to read the read address generated by the address generation unit according to the mode 4, and read the single layer/double layer mark package mark conversion table submodule to obtain the The label conversion method of the data packet, wherein the single layer label packet reads a single layer label conversion table based on the UNI port number, and the double layer label packet reads the double layer label conversion table based on the UNI port number.
  • the embodiment of the invention further provides an ONU virtual local area network tag processing method, the method comprising:
  • Receiving a packet header obtaining a source MAC address, a destination MAC address, an input/output UNI or PON port number, and a virtual local area network tag information of the data packet;
  • the virtual local area network tag information of the data packet is transformed according to the tag conversion rule.
  • the acquiring the virtual local area network tag information of the data packet includes:
  • the reading the label conversion table corresponding to the data packet includes:
  • the marking information transformation manner includes:
  • Manner 1 Marker transformation based on UNI port number, virtual local area network label VLAN ID, and tag priority;
  • Mode 2 mark conversion based on the UNI port number and the virtual local area network label VLAN ID;
  • Method 4 Default tag processing, this method is only for single tagged packets and double tagged packets, not applicable to unmarked packets;
  • the data packet is generated according to the input/output UNI port number of the data packet and the virtual local area network tag information, and the data packet is generated according to the UNI port number, the virtual local area network label, the VLAN ID, and the tag.
  • Priority tag conversion table read address When mode 1 is included in the tag information conversion manner corresponding to the data packet, the data packet is generated according to the input/output UNI port number of the data packet and the virtual local area network tag information, and the data packet is generated according to the UNI port number, the virtual local area network label, the VLAN ID, and the tag.
  • the data packet is generated according to the input/output UNI port number of the data packet and the virtual local area network tag information, and the data packet is generated according to the UNI port number, the virtual local area network label, the VLAN ID, and the tag. a mark conversion table read address of the priority; wherein the virtual local area network mark information does not include mark priority information;
  • the data packet is generated according to the UNI port number and the tag priority based tag conversion according to the input/output UNI port number of the data packet and the virtual local area network tag priority. Table reading address;
  • the tag conversion table corresponding to the single layer tag packet or the tag conversion of the double layer tag packet is generated according to the input/output UNI port number of the data packet. Table read address.
  • the priority from the mode 1 to the mode 4 is successively decreased.
  • the result obtained by the highest priority tag conversion method is preferentially selected.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to execute the ONU virtual local area network mark processing method described above.
  • An embodiment of the present invention further provides a packet processor of an ONU, where the packet processor includes the ONU virtual local area network tag processing device described above.
  • the ONU virtual local area network mark processing device provided by the embodiment of the present invention can realize the data packet virtual local area network mark processing function by using simple digital logic, has the characteristics of low power consumption and low cost, and can satisfy the ONU chip 1 to 10 ⁇ .
  • the line rate data processing requirements above the bit can also achieve the following functions:
  • the TPID, Priority and VLAN ID of the VLAN domain can be modified/added/deleted according to the input or output port of the input packet and the VLAN domain of the input packet;
  • An N:1 VLAN aggregation function that can be configured to aggregate multiple VLAN services of different uplink input ports into one VLAN service output on the PON port;
  • a 1:N function capable of converting the same VLAN service into multiple VLAN services of different output ports
  • the VLAN domain-based packet processing mode can be implemented: modifying the forwarding of the VLAN domain, not modifying the forwarding of the VLAN domain, handing over the CPU, or discarding.
  • 1a is a schematic structural diagram of an unmarked packet processed by an ONU according to an embodiment of the present invention
  • FIG. 1b is a schematic structural diagram of a single layer tag packet processed by an ONU according to an embodiment of the present disclosure
  • FIG. 1c is a schematic structural diagram of a double-layer tag package processed by an ONU according to an embodiment of the present disclosure
  • FIG. 1 is a schematic structural diagram of a labeling protocol control domain in an unmarked packet, a single layer tagged packet, and a double layer tagged packet processed by an ONU according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of an ONU virtual local area network mark processing apparatus according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram showing the structure and connection relationship between a UNI port number acquisition submodule and an address management module of a tag information extraction module in an ONU virtual local area network tag processing apparatus according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of an implementation process of an ONU virtual local area network mark processing method according to an embodiment of the present invention
  • FIG. 5a is a flowchart of uplink direction tag identification in a virtual local area network tag processing method of an ONU according to an embodiment of the present disclosure
  • FIG. 5b is a flowchart of uplink direction tag identification in a virtual local area network tag processing method of an ONU according to an embodiment of the present invention.
  • the ONU chip there are three kinds of flow directions in the ONU chip: (1) input from the user network interface (UNI) side to the PON side, which is called the uplink direction; (2) from the optical line terminal (Optical Line) Terminal, OLT) data interface PON side input to the UNI side direction, called the downlink direction; (3) input from a port on the user network interface UNI side, through the ONU internal data exchange, sent to the UNI side another different from the input UNI The port output is called the loopback direction.
  • UNI user network interface
  • OLT optical Line Terminal
  • the ONU virtual local area network tag processing device receives the first 20 bytes of data of each verified data link layer Ethernet packet header output by the Media Access Control (MAC).
  • MAC Media Access Control
  • the packet header there is no Tag Protocol Identifier (TPID), one or two TPIDs, and the data packet is divided into: Un-tagged packet, Single-tagged packet. Package and double-tagged packages.
  • TPID Tag Protocol Identifier
  • the Ethernet packet single-layer tag data structure complies with the IEEE 802.1Q specification of the Institute of Electrical and Electronics Engineers
  • the Ethernet packet double-layer tag data structure complies with the IEEE 802.1ad specification of the Institute of Electrical and Electronics Engineers.
  • FIG. 1a-1d The structure of the data packet is shown in Figures 1a-1d, wherein Figures 1a-1c show the structure of Un-tagged, Single-tagged, and Double-tagged packets, respectively.
  • Figure 1d is a schematic diagram of the structure of the Labeled Protocol Control Domain (TCI) in Figures 1a-1c.
  • TCI Labeled Protocol Control Domain
  • the data packet may contain no more than two layers of TPID.
  • the outer TPID of the data packet is a service Provider Tag (Service Provider Tag).
  • Protocol Identifier S-TPID
  • the inner TPID of the data packet is the Customer Tag Protocol Identifier (C-TPID)
  • the data packet can be a single-layer S-TPID packet, or It is a single-layer C-TPID packet; when it does not contain a TPID, the data packet is an untagged packet.
  • the virtual local area network tag processing device identifies the S-TPID and the C-TPID in the data packet header, and further parses the TCI in the data packet header according to the identified S-TPID and C-TPID: when the TPID is In the case of the S-TPID, the VLAN ID in the TCI is the service virtual local area network label (S-VLAN ID) of the data packet, and the priority in the TCI is the priority of the label corresponding to the virtual local area network label of the data packet service; When the TPID is C-TPID, the VLAN ID in the TCI is the user virtual local area network label (C-VLAN ID) of the data packet, and the priority in the TCI is the label priority corresponding to the data packet user virtual local area network identifier. .
  • S-VLAN ID service virtual local area network label
  • C-VLAN ID user virtual local area network label
  • the ONU receives the data packet sent by the user network interface in the uplink direction, and receives the data packet sent by the PON dedicated interface in the downlink direction, and the data packet in the uplink direction is sent from the user network interface to the PON dedicated interface.
  • the transmission can also be output on another user network interface after the internal loopback of the ONU.
  • FIG. 2 is a schematic structural diagram of an ONU virtual local area network mark processing device according to an embodiment of the present invention.
  • the device includes: a MAC address table management module 20, a CPU interface module 21, a tag conversion table module 22, and a MAC address. And an input/output port number and tag information extraction module 23, a tag conversion table reading module 24, a tag conversion module 25, and a port register configuration module 26; wherein:
  • the MAC address table management module 20 in the uplink direction, is configured to learn and save the source MAC address of the data packet, input the UNI port number, and the outer VLAN ID obtained after the VLAN transformation, and obtain the destination MAC address and the VLAN.
  • the outer VLAN ID queries the MAC address table to obtain the output port of the data packet.
  • the module In the downstream direction, the module is configured according to the purpose of the data packet.
  • the MAC address table and the outer VLAN ID query the MAC address table to obtain the output UNI port number.
  • the CPU interface module 21 is configured to receive the CPU command by the ONU, and complete initialization of the virtual local area network tag processing device module.
  • the modules that need to be initialized are: a MAC address table management module 20, a tag conversion table module 22, a MAC address, an input/output port, and tag information. Extracting module 23, port register configuration module 26;
  • the tag conversion table module 22 is configured to store a tag conversion table, where the correspondence between the UNI port number and the virtual local area network tag information and the tag conversion rule is pre-configured;
  • the MAC address, the input/output port number, and the tag information extraction module 23 are configured to receive the data packet header, obtain the source MAC address, the destination MAC address, the input/output UNI or PON port number, and the virtual local area network tag information of the data packet;
  • the tag conversion table reading module 24 is configured to read the tag conversion table corresponding to the data packet according to the input/output UNI port number of the data packet and the virtual local area network tag information, and obtain a tag conversion rule corresponding to the data packet. ;
  • the tag conversion module 25 is configured to convert the virtual local area network tag information of the data packet according to the tag conversion rule
  • the UNI port-based register specifically includes: a port conversion unit register based on the port UNI, a UNI input terminal S-TPID and a C-TPID register, a PON input terminal S-TPID and a C-TPID register, and an unmarked input port UNI.
  • a port-based UNI-based tag change mode register is used to configure the tag change mode adopted by each port
  • the UNI input S-TPID and C-TPID registers are configured to respectively configure the values of the S-TPID and the C-TPID, and the upstream direction uses the configuration values of the two registers to identify the single-layer tag packet and the double-layer tag of the data packet.
  • the package is still an unmarked package;
  • the S-TPID and C-TPID registers of the PON input are configured to respectively configure the values of the S-TPID and the C-TPID, and the downstream direction uses the configuration values of the two registers to identify that the data packet is a single layer tag packet or a double layer tag packet. Still an unmarked package;
  • a port is an interface between an ONU and a UNI device.
  • An ONU device has a PON port and more than one UNI port. Each UNI port and PON port respectively correspond to a port number.
  • the bit width of the UNI port number is A positive integer. When the total number of UNI ports on the ONU is N, the bit width of the UNI port number and PON port number is For the uplink data packet or the loopback data packet, the ONU is input through the UNI side, and the MAC address table management module 20 records the source MAC address of the uplink data packet or the loopback data packet, the transformed outer VLAN ID, and the uplink data packet.
  • this process is regarded as a learning process of the MAC address table management module 20; further, in the downlink direction, the MAC address table management module 20 is based on the destination MAC address of the downlink data packet and The original outer VLAN ID table is obtained, and the output UNI port number of the data packet is obtained.
  • the MAC address management module 20 obtains the data packet according to the destination MAC address of the uplink data packet and the outer VLAN ID obtained after the conversion.
  • the UNI or PON port number is output, and both processes in the uplink direction and the downlink direction are regarded as the query process of the MAC address table management module 20.
  • the CPU interface module 21 is connected to the CPU in the ONU, and is capable of receiving an instruction of the CPU in the ONU, and the CPU interface module 21 is also connected to other modules in the ONU virtual local area network tag processing device.
  • the entire virtual local area network tag processing device is initialized by the CPU instruction, that is, the register and the random access memory (RAM) in the virtual local area network tag processing device are initialized, It includes configuration port register configuration module, MAC address table management module, tag conversion table, and so on.
  • the marking information conversion manner may be configured for each UNI port, and the marking information conversion manner corresponding to the data packet outputted by the UNI port in the uplink direction or the downlink direction is respectively set by the label conversion mode register based on the port UNI;
  • Each UNI input port and output port can be configured with one or more and four or less tag information conversion modes.
  • the four tag information configurable modes of the UNI input port or output port are:
  • Mode 4 the default mark conversion mode
  • the default tag conversion mode includes a single layer tag conversion based on the UNI port number and a double layer tag conversion based on the UNI port number, and the default conversion mode does not exist in the unmarked packet;
  • the above four conversion methods are prioritized, and the priority is reduced from mode 1 to mode 4. If one port is configured with more than two types of tag conversion methods, and these tag conversion methods can obtain valid tag conversion results. Next, the result of the highest priority mark conversion method is preferentially selected.
  • the mark conversion table module 22 includes:
  • a tag conversion table sub-module based on a UNI port number, a virtual local area network label VLAN ID, and a tag priority configured to store a tag conversion table based on a UNI port number, a VLAN ID, and a tag priority, the UNI port number, a VLAN ID, and The mapping between the UNI port number, the virtual local area network tag information, and the tag conversion rule is pre-set in the tag conversion table of the tag priority level;
  • a tag conversion table submodule based on a UNI port number and a tag priority configured to store a tag conversion table based on a UNI port number and a tag priority, the UNI port number, tag priority
  • the level tag conversion table is pre-set with the correspondence between the UNI port number, the tag priority level, and the tag conversion rule;
  • a single layer tag packet tag conversion table submodule based on a UNI port number, configured to store a tag conversion table of a single layer tag packet, wherein the tag conversion table of the single layer tag packet is pre-configured with a single layer tag packet UNI port number and tag transform Correspondence of rules;
  • a double-layer tagged packet tag conversion table sub-module based on a UNI port number, configured to store a tag conversion table of a double-layer tagged packet, the tag conversion table of the double-layer tagged packet being pre-configured with a double-layer tagged packet UNI port number and tag transform The correspondence of rules.
  • the virtual local area network tag information includes: S-VLAN information and/or C-VLAN information; wherein the S-VLAN information includes: whether an S-VLAN exists, an S-TPID value, an S-VLAN ID value, and an S-VLAN Priority value.
  • the C-VLAN information includes: C-VLAN presence, C-TPID value, C-VLAN ID value, and C-VLAN Priority value.
  • the tag conversion rules include: a VLAN ID conversion rule, a TPID conversion rule, a tag priority priority conversion rule, and a packet processing mode.
  • n-based UNI port numbers, input VLAN IDs, and tag priorities may be configured in the tag conversion table sub-module based on the UNI port number, VLAN ID, and tag priority.
  • Level mark conversion table, their address space is exactly the same, where n is an integer greater than 1; each table has a serial number, and the serial number ranges from 0 to n-1.
  • the tag conversion table module 22 includes:
  • the label conversion table sub-module of the PON side output or the UNI loopback is configured to store the label conversion table of the PON side output or the UNI loopback in the uplink direction, and the label conversion table of the PON side output or the UNI loopback is pre-configured via the PON side.
  • the tag conversion rule corresponding to the data packet of the output or UNI loopback and the stream number of the output packet of the uplink PON side, the loopback packet is only marked in the uplink direction, and the tag conversion is no longer performed at the UNI exit;
  • the UNI side output tag conversion table submodule is configured to store a tag conversion table outputted by the UNI side, and the UNI side output tag conversion table is provided with a tag conversion rule corresponding to the data packet outputted by the UNI side, and the tag conversion table configuration For downstream packets, it is not configured as a UNI loopback packet.
  • the tag conversion table module 22 includes a PON side output or UNI loopback tag conversion table submodule and a UNI side output tag conversion table submodule;
  • the PON side output or UNI loopback tag conversion table submodule includes:
  • the tag conversion table unit based on the input UNI port number, the virtual local area network label VLAN ID, and the tag priority is configured to store the tag conversion of the PON side output or the UNI loopback based on the input UNI port number, the virtual local area network label VLAN ID, and the tag priority level.
  • Table 1 is a data structure diagram of a label conversion table based on an input UNI port number, a virtual local area network label VLAN ID, and a label priority level according to an embodiment of the present invention
  • the label conversion table unit based on the input UNI port number and the label priority is configured to store a label conversion table of the PON side output or the UNI loopback that is only concerned with the input UNI port number and the label priority.
  • Table 3 is provided by the embodiment of the present invention.
  • the uplink is based on the data structure of the tag conversion table that inputs the UNI port number and the tag priority;
  • the single-layer tag packet tag conversion table is configured to be a PON-side output or a UNI loopback, and the uplink single-layer tag packet tag conversion is provided in the embodiment of the present invention.
  • the data structure of the table is indicated;
  • the double-layer tag packet tag conversion table unit based on the input UNI port number is configured as a double-layer tag packet tag conversion table of the PON side output or the UNI loopback, and the table 3 is the uplink double-layer tag packet tag conversion provided by the embodiment of the present invention.
  • the data structure of the table is indicated;
  • the UNI side output tag conversion table submodule includes:
  • the downlink label conversion table unit based on the output UNI port number, the virtual local area network label VLAN ID, and the label priority level is configured to store the UNI side output label conversion table based on the output UNI port number, the virtual local area network label VLAN ID, and the label priority level, and Table 2 is Provided by the embodiment of the present invention
  • Table 2 is Provided by the embodiment of the present invention
  • the downlink change flag table based on the output UNI port number and the tag priority is configured to store the UNI side output tag conversion table that is only concerned with the output UNI port number and the tag priority.
  • Table 4 is the downlink output UNI provided by the embodiment of the present invention. The data structure of the tag conversion table of the port number and the tag priority is indicated;
  • the single-layer tag packet tag conversion table unit is configured to output a UNI port number, and is configured as a single-layer tag packet tag conversion table outputted by the UNI side.
  • Table 4 is a downlink single-layer tag packet based on the output UNI port number provided by the embodiment of the present invention. The data structure of the mark conversion table is indicated;
  • the dual-layer tag packet tag conversion table unit based on the output UNI port number is configured as a dual-layer tag packet tag conversion table outputted by the UNI side.
  • Table 4 is a dual-layer tag packet based on the output UNI port number provided by the embodiment of the present invention. The data structure of the tag conversion table is indicated.
  • the above-mentioned tag conversion table module and sub-module can be implemented by a dual-port RAM memory, and the CPU in the ONU reads and writes the RAM through the CPU interface module 21.
  • the MAC address, the input/output port number, and the tag information extraction module 23 include:
  • a tag information obtaining submodule configured to receive a packet header and obtain virtual network local area tag information of the data packet
  • the port number acquisition submodule is configured to obtain the source/destination MAC address of the data packet, the input UNI port number, and the output UNI/PON port number.
  • the tag information obtaining submodule determines the class of the data packet, that is, determines whether the data packet is an unmarked packet, a single layer tag packet, or a double layer tag packet; and then according to the type of the data packet, combined with FIG.
  • the packet structure shown in -1d can determine the location of the virtual local area network tag information in the packet header, thereby obtaining the virtual local area network tag information of the data packet, that is, S-VLAN information and/or C-VLAN information (for double layer Tag package, virtual LAN tag information includes S-VLAN information and C-VLAN information; for single-layer S-VLAN packets, virtual LAN tag information includes S-VLAN information; for single-layer C-VLAN packets, virtual LAN tag packets.
  • the C-VLAN information includes: whether the S-VLAN exists, the S-TPID value, the S-VLAN ID value, and the S-VLAN Priority value; and the C-VLAN information includes: whether the C-VLAN exists, C-TPID value, C-VLAN ID value, and C-VLAN Priority value.
  • the method for judging the packet type is: uniformly assuming that the data packet is a double-layer mark packet, and reading the information in the outer TPID and the inner layer TPID corresponding position in the data packet header according to FIG. 1c, according to the preset S-TPID And the C-TPID value is further judged: if the outer TPID is equal to the S-TPID, the inner TPID is equal to the C-TPID, and the outer layer is the S-VLAN, and the inner layer is the S-VLAN.
  • the packet input on the PON side if its outer TPID is equal to S-TPID, the inner layer TPID is equal to C-TPID, it is a double-layer tag packet, the outer layer is S-VLAN, and the inner layer is C-VLAN; otherwise, if it The outer TPID is equal to the S-TPID, which is a single-labeled S-VLAN packet; otherwise, if its outer TPID is equal to the C-TPID, it is a single-labeled C-VLAN packet; if none of the above conditions are met, it is none
  • the tag package the tag recognition process is shown in Figure 5b.
  • the tag information acquisition sub-module configures a default tag priority based on the UNI port number of the packet, and is configured for subsequent processing.
  • the upstream untagged packet is configured with its default tag priority based on its input UNI port number
  • the downstream untagged packet is configured with its default tag priority based on its input PON port number.
  • the port number acquisition submodule in the MAC address, the input/output port number, and the tag information extraction module 23 includes:
  • the input UNI obtaining unit 31 is configured to acquire the input UNI port number of the UNI side input data packet, and send the UNI port number to the address table management module 20;
  • the output UNI/PON obtaining unit 32 is configured to obtain the UNI side or PON side output port number of the UNI side input data packet, or configured to acquire the UNI side output port number of the PON side input data packet, and for the data packet input by the PON side,
  • the tag information obtaining module sends the obtained original outer VLAN ID of the data packet to the MAC address table management module, and for the data packet input by the UNI side,
  • the tag conversion module sends the outer VLAN ID obtained after the tag conversion to the MAC address table management module, and receives the output UNI port number of the data packet returned by the address table management module 20;
  • the source and destination MAC address obtaining unit 33 is configured to obtain a source MAC address and a destination MAC address of the data packet.
  • the input UNI obtaining unit 31 may acquire the input UNI port number of the input packet through the UNI side from the packet processor of the ONU, and send it to the MAC address table management module 20, and the MAC address table management module 20 also receives the tag conversion.
  • the outer VLAN ID obtained after the VLAN transformation of the data packet output by the module 25, the source MAC address of the data packet acquired by the source and destination MAC address obtaining unit 33, in the uplink direction, the MAC address table management module 20 establishes and stores the data packet.
  • the original outer VLAN ID of the data packet obtained by the block is sent to the MAC address table management module 20 by the destination MAC address of the data packet input by the PON side and the original outer VLAN ID of the data packet, and the UNI port number output by the data report is obtained by querying.
  • the UNI port number is returned to the output UNI/PON acquisition unit 32.
  • the tag information conversion manner corresponding to the data packet different tag conversion tables corresponding to the query are read, that is, different tag conversion table sub-modules are read.
  • the label information conversion mode of the uplink or loopback data packet is determined by the input UNI port of the data packet, and the loopback data packet is only subjected to VLAN transformation in the uplink direction, and no VLAN transformation is required in the downlink direction, so the loopback data packet is in the downlink direction.
  • the downlink packet marking information transformation method is The output of the packet is determined by the UNI port.
  • the "input/output UNI port number" below refers to the input UNI port number for the upstream data packet and the output UNI port number for the downstream data packet.
  • the mark conversion table reading module 24 includes:
  • the tag information conversion mode acquisition submodule is configured to acquire, according to the input/output UNI port number of the data packet, a tag information conversion manner corresponding to the data packet by using a tag conversion mode register based on the port UNI;
  • a read address generation submodule configured to generate a tag conversion table read address corresponding to the data packet according to the tag information conversion manner, and an input/output UNI port number of the data packet and virtual local area network tag information;
  • the table reading submodule is configured to read the tag conversion table corresponding to the data packet according to the tag conversion table read address, and obtain a tag conversion rule of the data packet.
  • the label information conversion manner of each UNI port can be configured as any one of the following manners 1 to 4, and the label information conversion manner corresponding to the data packet is also any one of the manners 1 to 4. To four.
  • the tag conversion table reading module 24 will read more than one tag conversion table sub-module. Therefore, in the above-mentioned tag conversion table reading module 24, the read address generation sub-module includes:
  • the mode 1 read address generating unit is configured to generate, according to the input/output UNI port number of the data packet and the virtual local area network tag information, the data packet corresponds to the VLAN ID based on the mode 1 when the tag information conversion manner corresponding to the data packet is included. And the priority tag conversion table read address;
  • the mode 1 read address generating unit sets the input/output UNI port number, the S-VLAN ID, and/or the C-VLAN ID, the tag priority non-care bit (DontCarePri), and the tag priority (Priority) of the data packet from the high bit.
  • the lower bits are combined to form binary data ⁇ UNI port number, S-VLAN ID, C-VLAN ID, DontCarePri, Priority ⁇ ; wherein the UNI port number bit width is determined by the number of UNI ports of the ONU as described above; S-VLAN ID And C-VLAN ID each accounted for 12 Bit, if there is no corresponding S-VLAN ID and/or C-VLAN ID in the packet virtual tag information, the corresponding bit is padded to 0; DontCarePri occupies 1 bit, and the value is 0, indicating the priority of the tag; Priority Occupies 3 bits, filling the tag priority of the packet tag.
  • the dual-marker Priority can be set to the outer mark priority, or can be set to the inner mark priority.
  • the specific settings can be configured by the ONU user according to the actual situation, or can be set in the ONU chip.
  • the mode 1 read address generating unit hashes the data ⁇ UNI port number, S-VLAN ID, C-VLAN ID, 0, Priority ⁇ to obtain an address value, which is recorded as Addr0, and the address Addr0 is a data packet corresponding to the UNI-based port. Number, virtual LAN label VLAN ID, and the read address of the tag change table of the tag priority.
  • the mode 1 read address generation unit issues a read enable signal to the tag conversion table sub-module based on the UNI port number, the virtual local area network label VLAN ID, and the priority according to the read address.
  • the mode 2 read address generating unit is configured to generate the data packet corresponding to the UNI-based port according to the input/output UNI port number of the data packet and the virtual local area network tag information when the mode 2 includes the mode information conversion manner corresponding to the data packet.
  • the mode 2 read address generating unit combines the input/output UNI port number, the S-VLAN ID, the C-VLAN ID, the tag priority non-care bit (DontCarePri), and the placeholder of the data packet from a high bit to a low bit.
  • Binary data ⁇ UNI port number, S-VLAN ID, C-VLAN ID, DontCarePri, placeholder ⁇ ; where UNI port number bit width is determined by the number of UNI ports of the ONU as described above; S-VLAN ID and C- The VLAN IDs each occupy 12 bits.
  • the mode 2 read address generating unit hashes the data ⁇ UNI port number, S-VLAN ID, C-VLAN ID, 1,000 ⁇ to obtain an address value, which is recorded as Addr1, and the address Addr1 is a data packet corresponding to the UNI port number, The read address of the tag conversion table of the virtual LAN label VLAN ID and the tag priority.
  • Mode 2 read address generation unit according to the read The address issues a read enable signal to the tag conversion table sub-module based on the UNI port number, the virtual local area network label VLAN ID, and the tag priority level.
  • the mode 3 read address generating unit is configured to generate, according to the input/output UNI port number of the data packet and the virtual local area network tag information, the data packet corresponding to the UNI based port when the mode 3 includes the mode information conversion manner corresponding to the data packet.
  • the mode 3 read address generating unit combines the input/output UNI port number of the data packet and the priority of the flag from the high bit to the low bit ⁇ UNI port number, Priority ⁇ ; wherein, the UNI port number bit width As mentioned above, it is determined by the number of UNI ports of the ONU; Priority occupies 3 bits, and the tag priority of the packet marking is filled.
  • the dual-marker Priority can be set to the outer mark priority, or can be set to the inner mark priority.
  • the specific settings can be configured by the ONU user according to the actual situation, or can be set in the ONU chip.
  • the Priority value in the upstream direction is obtained by the untagged packet default tag priority register based on the input port UNI, and the Priority value in the downstream direction is obtained by the untagged packet default tag priority register based on the input port PON.
  • the mode 3 read address generation unit records the data ⁇ UNI port number, Priority ⁇ as an address, and is denoted as Addr2.
  • the address Addr2 is the read address of the packet corresponding to the tag conversion table based on the UNI port number and the tag priority.
  • the mode 3 read address generation unit issues a read enable signal to the tag conversion table sub-module based on the UNI port number and the tag priority based on the read address.
  • the mode 4 read address generating unit is configured to generate a tag conversion table corresponding to the single layer tag packet according to the input/output UNI port number of the data packet when the tag information conversion method corresponding to the data packet includes the mode 4 Or the mark conversion table read address of the double-layer mark packet;
  • the mode 4 read address generating unit records the packet input/output UNI port number obtained from the MAC address, the input/output port number, and the tag information extracting module 23 as an address, and records it as Addr3.
  • the address Addr3 is a read address of the tag conversion table corresponding to the single layer tag packet of the data packet; and the mode 4 read address generating unit is directed to the single layer according to the read address.
  • the tagged packet tag conversion table sub-module issues a read enable signal.
  • the address Addr3 is a read address of the mark conversion table corresponding to the double-layer markup packet of the data packet; and the mode 4 read address generation unit marks the conversion table to the double-layer markup packet according to the read address.
  • the module issues a read enable signal.
  • the table read sub-module can obtain more than one read address from the read address generation sub-module, and each read address corresponds to a different mark conversion table sub-module, and correspondingly, the above-mentioned mark conversion table reading module 24
  • the table reading submodule includes:
  • a tag conversion table reading unit based on a UNI port number, a virtual local area network label VLAN ID, and a tag priority level, configured to read a read address generated by the address generation unit according to mode 1/mode 2, and read based on the UNI port number, VLAN ID, and tag a mark conversion table sub-module of priority, acquiring a mark conversion rule of the data packet;
  • the mode 1 read address generating unit when the mode 1 read address generating unit generates the read address Addr0 or the mode 2 read address generating unit generates the read address Addr1, the mark conversion table based on the UNI port number, the virtual local area network label VLAN ID, and the mark priority level for the uplink data packet.
  • the reading unit reads the record corresponding to Addr0 or Addr1 in the tag conversion table unit based on the UNI port number, the virtual local area network label VLAN ID, and the tag priority level as shown in Table 1; for the downlink data packet, based on the UNI port number,
  • the tag conversion table reading unit of the virtual local area network label VLAN ID and the tag priority reads the record corresponding to Addr0 or Addr1 in the tag change table unit based on the VLAN ID and the tag priority shown in Table 2.
  • the tag conversion table sub-module based on the VLAN ID and the tag priority is configured with n tag conversion tables based on the VLAN ID and the tag priority, and thus one read address Addr0/Addr1 corresponds to n.
  • n is an integer greater than one. Comparing the input/output UNI port number and the virtual local area network identification information in the n records with the MAC address, the input/output port number, and the input/output UNI port number of the data packet acquired by the tag information extraction module 23 and the virtual local area network identification information.
  • the tag conversion table reading unit of the UNI port number, the virtual local area network label VLAN ID, and the tag priority level selects the record with the smallest/largest number of the tag conversion table serial number in the m records, and reads the preset tag conversion rule in the record, and will
  • the tag conversion rule is sent to the tag conversion module 25, where m is an integer greater than 0, and the record with the smallest or largest sequence number of the tag conversion table in the m records is selected, which can be configured by the CPU according to the situation, or can be solidified and designed on the ONU. In the chip.
  • the tag conversion table reading unit based only on the UNI port number and the tag priority is configured to read the read address generated by the address generation unit according to the mode 3, and read the tag conversion table submodule based on the UNI port number and the tag priority, and acquire the Describe the label transformation rules of the data packet;
  • the tag conversion table reading unit based on the UNI port number and the tag priority reads the uplink based UNI port number as shown in Table 3. Marking the record corresponding to Addr2 in the mark conversion table unit of the priority; for the downlink data packet, the mark conversion table reading unit based on the UNI port number and the mark priority reads the downlink based UNI port number and the mark as shown in Table 4 The record corresponding to Addr2 in the mark conversion table unit of the priority.
  • the tag conversion table reading unit based on the UNI port number and the tag priority reads the tag conversion rule preset in the record, and sends the tag conversion rule to the tag. Transform module 25.
  • the single-layer/double-layer mark packet mark conversion table reading unit based on the UNI port number is configured to read the read address generated by the address generation unit according to the mode 4, and read the single layer/double layer mark packet mark conversion table based on the UNI port number.
  • the single layer/double layer mark packet mark conversion table reading unit based on the UNI port number reads the uplink single layer as shown in Table 3.
  • / Double-layer mark packet marks the record corresponding to Addr3 in the conversion table unit; for the downlink data packet, the single layer/double-layer mark packet mark conversion table reading unit based on the UNI port number reads the downlink single layer as shown in Table 4.
  • / Double-layer tagged tag marks the record corresponding to Addr3 in the table unit.
  • the mark conversion manner corresponding to the read address acquired according to the different mark information conversion manner has a priority order: mode 1 takes precedence over mode 2, mode 2 takes precedence over mode 3, and mode 3 takes precedence over mode 4, that is, Addr0 corresponds to
  • the transformation rule in the record has priority over the transformation rule in the record corresponding to Addr1, the transformation rule in the record corresponding to Addr1 takes precedence over the transformation rule in the record corresponding to Addr2, and the transformation rule in the record corresponding to Addr2 takes precedence over the record corresponding to Addr3 Transformation rules in .
  • the tag conversion module 25 performs virtual local area network tag conversion of the data packet according to the highest priority conversion rule.
  • the tag conversion rules include: a VLAN ID conversion rule, a TPID conversion rule, a tag priority conversion rule, and a packet processing method.
  • the data packet processing mode includes: modifying the forwarding of the VLAN domain, not modifying the forwarding of the VLAN domain, handing over the CPU, or discarding.
  • the tag conversion module 25 modifies the VLAN ID, TPID, and TPID of the data packet according to the VLAN ID conversion rule, the TPID conversion rule, and the tag priority conversion rule acquired by the tag conversion table reading module 24.
  • the priority is marked to complete the transformation of the packet virtual local area network mark; the data packet transformed by the virtual local area network is forwarded by the ONU.
  • the tag conversion module 25 When the packet processing mode is that the forwarding of the VLAN domain is not modified, the tag conversion module 25 does not modify the virtual local area network tag information of the data packet, and directly forwards the data packet by the ONU.
  • the packet processing mode is the CPU handover or discarding
  • the tag conversion module 25 does not modify the virtual local area network tag information of the data packet, and directly delivers the data packet to the CPU or discards.
  • the PON side output tag conversion table includes the stream number of the uplink data packet, so the ONU can obtain the uplink GEMPORT ID value, the queue number, and the T-CONT value according to the stream number value of the data packet, thereby performing uplink packet flow. classification.
  • the MAC address table management module 20 the CPU interface module 21, the tag conversion table module 22, the MAC address, the input/output port number, and the tag information extraction module 23, the standard
  • the conversion table reading module 24, the tag conversion module 25, the port register configuration module 26, and the submodules of each of the above modules and each of the submodules can be centrally processed by the ONU virtual local area network tag processing device.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Array
  • the virtual local area network mark processing device of the ONU packet processor provided by the above embodiment can realize the virtual packet local area network mark processing function by using simple digital logic, has the characteristics of low power consumption and low cost, and can satisfy the ONU chip 1 to Data processing requirements for line speeds above 10 gigabits.
  • FIG. 4 is a schematic flowchart of an implementation process of an ONU virtual local area network mark processing method according to an embodiment of the present invention. As shown in FIG. 4, the method mainly includes:
  • Step 401 Receive a data packet header, obtain a source/destination MAC address of the data packet, and a virtual local area network tag information, obtain an input UNI port number of the data packet in an uplink direction, and obtain an output UNI port number of the data packet in a downlink direction;
  • the ONU virtual local area network tag processing device receives the data packet input by the packet processor, inputs the UNI port number and the data packet header, parses the data packet header, obtains the source/destination MAC address of the data packet, and the virtual local area network tag information, and uses the downlink direction.
  • the destination MAC address of the packet and the outer VLAN ID query the MAC address table to obtain the output UNI port number of the packet.
  • Step 402 Obtain a label information conversion manner corresponding to the data packet according to the input/output UNI port number of the data packet and/or virtual local area network tag information, and read a label conversion table corresponding to the data packet to obtain the The tag conversion rule corresponding to the data packet;
  • the ONU virtual local area network tag processing device acquires a tag information conversion manner corresponding to the data packet according to an input/output UNI port number of the data packet; and then, according to the tag information conversion manner corresponding to the data packet, according to the input of the data packet / output UNI port number and / or virtual local area network tag information generation data packet corresponding to the read address of the different tag conversion table; then read the corresponding tag conversion table according to the read address of the different tag conversion table, obtain the pre-marker in the tag conversion table Set Mark the transformation rules.
  • the label information conversion manner corresponding to the data packet may be configured to any one of the mode 1 to the mode 4 to the fourth mode, and the read address generated by the mode 1 corresponds to the obtained tag conversion rule.
  • the read address generated by the mode 2 corresponds to the obtained tag conversion rule, and the read address corresponding to the read address generated by the mode 2 is obtained in preference to the tag change rule obtained by the read address generated by the mode 3, and the read address generated by the mode 3 is obtained correspondingly.
  • the tag conversion rule takes precedence over the tag conversion rule obtained by the read address generated by the mode 4. Therefore, for one data packet, the virtual local area network tag processing device simultaneously generates the read address and the acquired mark conversion rule according to the mark information conversion manner.
  • the mark information conversion manner corresponding to the data packet X includes mode 1, mode 2, mode 3, and mode 4.
  • the virtual local area network tag processing apparatus generates read addresses Addr0, Addr1, Addr2, and Addr3 according to mode 1, mode 2, mode 3, and mode 4, respectively, based on the UNI port number, the virtual local area network label VLAN ID, and the tag priority level according to Addr0.
  • the token transformation mode is obtained in the transformation table, and the token transformation table based on the UNI port number, the virtual local area network label VLAN ID, and the label priority level is queried according to Addr1, and the UNI port number and the single layer labeling packet are queried according to the category of Addr3 and the data packet.
  • the mark conversion table or the mark conversion table of the double-layer mark package when the effective matching result is obtained in the above four methods, the result obtained by the highest priority mode 1 is preferentially selected.
  • the virtual local area network tag processing device when the packet processing mode is to modify the forwarding of the VLAN domain, the virtual local area network tag processing device respectively modifies the VLAN ID, the TPID, and the tag priority of the data packet according to the acquired VLAN ID conversion rule, the TPID conversion rule, and the tag priority conversion rule. Level, complete the transformation of the packet virtual local area network mark; the data packet transformed by the virtual local area network mark is forwarded by the ONU.
  • the packet processing mode is that the forwarding of the VLAN domain is not modified
  • the virtual local area network tag processing device does not modify the virtual local area network tag information of the data packet, and the ONU directly forwards the data packet.
  • the virtual local area network tag processing device does not modify when the packet processing mode is handed over to the CPU or discarded.
  • the virtual LAN tag information of the packet directly passes the packet to the CPU or discards it.
  • the PON side output tag conversion table includes the stream number of the uplink data packet, so the ONU can obtain the uplink GEMPORT ID value, the queue number, and the T-CONT value according to the stream number value of the data packet, thereby performing uplink packet flow. classification.
  • the method further includes:
  • the present invention further provides an ONU packet processor, which includes any of the ONU virtual local area network tag processing devices provided by the above embodiments.
  • the embodiment of the present invention further describes a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to execute the ONU virtual local area network mark processing method shown in FIG. 4 in the embodiment of the present invention.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the data packet header is received, and the source MAC address, the destination MAC address, the input/output UNI or PON port number, and the virtual local area network tag information of the data packet are obtained; and the UNI port number is obtained according to the input/output UNI port number of the data packet.
  • the preset tag conversion table corresponding to the data packet is read according to the input/output UNI port number of the data packet and/or the virtual local area network tag information. Obtaining a label transformation rule corresponding to the data packet; and transforming the virtual local area network tag information of the data packet according to the label transformation rule; thus, the ONU chip can satisfy the line rate data processing of 1 to 10 gigabits or more.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种ONU虚拟局域网标记处理方法,所述方法包括:接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;根据所述数据包的输入/输出UNI端口号获取所述数据包对应的预设的标记信息变换方式之后,再根据所述数据包的输入/输出UNI端口号和/或虚拟局域网标记信息,读取所述数据包对应的预设的标记变换表,获取所述数据包对应的标记变换规则;按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换。本发明还同时公开了一种ONU包处理器和其虚拟局域网标记处理装置及计算机存储介质。

Description

ONU虚拟局域网标记处理装置、方法及计算机存储介质 技术领域
本发明涉及无源光网络(Passive Optical Networks,PON)的光网络单元(Optical Network Unit,ONU)领域,尤其涉及一种ONU包处理器及其虚拟局域网标记处理装置、方法及计算机存储介质。
背景技术
当前无源光网络技术主要有以太无源光网络(Ethernet Passive Optical Network,EPON)和吉比特无源光网络(Gigabit-Capable Passive Optical Network,GPON)等几种,它们主要差异在于采用了不同的二层技术。EPON在二层采用以太网协议,将以太网技术与PON技术完美结合,非常适合IP业务的宽带接入技术。GPON在二层采用国际电信联盟定义的通用成帧规程对以太网协议、异步传输模式、时分复用模式等多种业务进行封装映射,具有强大的运行、维护和管理功能。目前市场上EPON和GPON并存,都在飞速发展,在未来的接入网络市场,具有巨大的商机和非常广阔的市场前景。
根据EPON和GPON的技术标准,ONU芯片应该具有对输入包虚拟局域网(Virtual Local Area Network,VLAN)标记(Tag)域进行处理的功能,必须能够禁止/允许带有特定虚拟局域网标记(VLAN Tag)的用户接入,也能添加、删除、透明传送或修改包所带的虚拟局域网标记(VLAN Tag)域。
虚拟局域网区分为业务虚拟局域网(Service Provider VLAN,S-VLAN)和用户虚拟局域网(Customer VLAN,C-VLAN),S-VLAN是用来区分数据、语音和IPTV业务的,由运行商提供,C-VLAN是用来区分用户及其端口的。实际应用中有S-VLAN数据包、C-VLAN数据包,也有既含S-VLAN 也含C-VLAN的数据包。
目前业界ONU芯片实现标记处理功能采用内嵌的精简指令集计算机(Reduced Instruction Set Computer,RISC)或者采用三态内容寻址存储器(Ternary Content Addressable Memory,TCAM),对数据包进行检测和解析,根据检测和解析的结果修改数据包的虚拟局域网标记。根据EPON和GPON的技术标准要求ONU芯片线速处理1到10吉比特以上的数据包。因此,当采用RISC时,需要多个RISC核结构,因而增加了ONU芯片的设计复杂度、面积和功耗;当采用TCAM时,TCAM本身面积和功耗较大,且需向TCAM厂家购买专用的TCAM核,因而在增加了ONU芯片的面积、功耗的同时,还将增加ONU芯片的生产成本。
发明内容
为解决现有存在的技术问题,本发明实施例期望提供一种ONU虚拟局域网标记处理装置、方法及计算机存储介质,它结构简单,低功耗并且低成本。
本发明实施例的技术方案是这样实现的:
本发明实施例提供一种ONU虚拟局域网标记处理装置,该装置包括:标记变换表模块,MAC地址、输入输出端口号和标记信息提取模块,标记变换表读取模块,标记变换模块,基于UNI端口寄存器配置模块和MAC地址表管理模块;其中,
所述标记变换表模块,配置为存储标记变换表,所述标记变换表中预设有用户网络接口UNI端口号和虚拟局域网标记信息与标记变换规则的对应关系;
所述MAC地址、输入输出端口号和标记信息提取模块,配置为接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;
所述标记变换表读取模块,配置为根据所述数据包的输入/输出UNI端口号从基于UNI端口寄存器配置模块中获取所述数据包对应的标记信息变换方式之后,再根据所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,读取所述数据包对应的标记变换表,获取所述数据包对应的标记变换规则;
标记变换模块,配置为按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换;
所述基于UNI端口寄存器配置模块,配置为配置基于UNI端口的寄存器的值,所述基于UNI端口寄存器的值中包括UNI端口对应的标记变换方式;
所述MAC地址表管理模块,配置为保存数据包的源/目的MAC地址、虚拟局域网标号VLAN ID和包输入/输出端口的对应关系。
上述方案中,按照对应的标记信息变换方式,所述标记变换表模块包括:
基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表子模块,配置为存储基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表,所述基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表中预设有UNI端口号、虚拟局域网标记信息与标记变换规则的对应关系;
基于UNI端口号和标记优先级的标记变换表子模块,配置为存储基于UNI端口号、标记优先级的标记变换表,所述基于UNI端口号、标记优先级的标记变换表预设有UNI端口号、标记优先级与标记变换规则的对应关系;
基于UNI端口号的单层标记包标记变换表子模块,配置为存储单层标记包的标记变换表,所述单层标记包的标记变换表预设有单层标记包UNI 端口号与标记变换规则的对应关系;
基于UNI端口号的双层标记包标记变换表子模块,配置为存储双层标记包的标记变换表,所述双层标记包的标记变换表预设有双层标记包UNI端口号与标记变换规则的对应关系。
上述方案中,按照对应的数据包流向,所述标记变换表模块包括:
无源光网络PON侧输出或UNI环回标记变换表子模块,配置为存储PON侧输出或UNI环回标记变换表,所述PON侧输出或UNI环回标记变换表预设有经PON侧输出或UNI环回的数据包对应的标记变换规则和所述数据包的流编号;
UNI侧输出标记变换表子模块,配置为存储UNI侧输出标记变换表,所述UNI侧输出标记变换表中预设有经UNI侧输出的数据包对应的标记变换方式。
上述方案中,所述MAC地址、输入输出端口号和标记信息提取模块包括:
标记信息获取子模块,配置为接收数据包包头,获取数据包的虚拟局域网标记信息;
端口号获取子模块,配置为获取数据包的源和目的MAC地址、输入UNI端口号、输出UNI或PON端口号。
上述方案中,所述端口号获取子模块包括:
输入UNI获取单元,配置为获取UNI侧输入数据包的输入UNI端口号,并将输入UNI端口号发送至MAC地址表管理模块;
源和目的MAC地址获取单元,配置为获取UNI侧输入或PON侧输入数据包的源MAC地址和目的MAC地址,并将它们发送到MAC地址管理模块;
输出UNI/PON获取单元,配置为获取UNI侧输入数据包的UNI侧或 PON侧输出端口号,或配置为获取PON侧输入数据包的UNI侧输出端口号,对于PON侧输入的数据包,标记信息获取模块将得到的数据包原始外层VLAN ID发送到MAC地址表管理模块,对于UNI侧输入的数据包,标记变换模块将标记变换之后得到的外层VLAN ID发送到MAC地址表管理模块,接收地址表管理模块返回的所述数据包的输出UNI或PON端口号。
上述方案中,所述标记变换表读取模块包括:
标记信息变换方式获取子模块,配置为根据所述数据包的输入/输出UNI端口号,从所述基于UNI端口寄存器配置模块中获取所述数据包对应的标记信息变换方式;
读地址生成子模块,配置为根据所述标记信息变换方式,以及所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,分别生成所述数据包对应的标记变换表读地址;
表读取子模块,配置为根据所述读地址,读取所述数据包对应的标记变换表,获取所述数据包的标记变换规则。
上述方案中,所述读地址生成子模块包括:
方式1读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式1时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;
方式2读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式2时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;其中,所述虚拟局域网标记信息中不包含标记优先级信息;
方式3读地址生成单元,配置为当数据包对应的标记信息变换方式中 包含方式3时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号和标记优先级的标记变换表读地址;
方式4读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式4时,根据数据包的输入/输出UNI端口号,对应于单层标记包生成所述数据包基于UNI端口号的单层标记包的标记变换表读地址,对应于双层标记包生成基于UNI端口号的双层标记包的标记变换表读地址。
上述方案中,所述表读取子模块包括:
基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读取单元,配置为根据方式1/方式2读地址生成单元生成的读地址,读取基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表子模块,获取所述数据包的标记变换规则;
基于UNI端口号和标记优先级的标记变换表读取单元,配置为根据方式3读地址生成单元生成的读地址,读取基于UNI端口号和标记优先级的标记变换表子模块,获取所述数据包的标记变换规则;
基于UNI端口号的单层/双层标记包标记变换表读取单元,配置为根据方式4读地址生成单元生成的读地址,读取单层/双层标记包标记变换表子模块,获取所述数据包的标记变换方式,其中单层标记包读取基于UNI端口号的单层标记变换表,双层标记包读取基于UNI端口号的双层标记变换表。
本发明实施例还提供一种ONU虚拟局域网标记处理方法,该方法包括:
接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;
根据所述数据包的输入/输出UNI端口号获取所述数据包对应的预设的 标记信息变换方式之后,再根据所述数据包的输入/输出UNI端口号和/或虚拟局域网标记信息,读取所述数据包对应的预设的标记变换表,获取所述数据包对应的标记变换规则;
按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换。
上述方案中,所述获取数据包的虚拟局域网标记信息包括:
根据所述数据包包头信息,判断所述数据包的类别;
根据所述数据包的类别确定所述数据包的数据结构;
根据所述数据包的数据结构,获取所述数据包的虚拟局域网标记信息。
上述方案中,所述读取所述数据包对应的标记变换表包括:
根据所述标记信息变换方式,以及所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应的标记变换表读地址;
根据所述标记变换表读地址,读取所述数据包对应的标记变换表,获取所述数据包的标记变换规则。
上述方案中,所述标记信息变换方式包括:
方式1:基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换;
方式2:基于UNI端口号和虚拟局域网标号VLAN ID的标记变换;
方式3:基于UNI端口号和标记优先级的标记变换;
方式4:缺省的标记处理,此方式仅针对单标记包和双标记包,对无标记包不适用;
所述生成所述数据包对应的标记变换表读地址包括:
当数据包对应的标记信息变换方式中包含方式1时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;
当数据包对应的标记信息变换方式中包含方式2时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;其中,所述虚拟局域网标记信息中不包含标记优先级信息;
当数据包对应的标记信息变换方式中包含方式3时,根据数据包的输入/输出UNI端口号和虚拟局域网标记优先级,生成所述数据包对应于基于UNI端口号和标记优先级的标记变换表读地址;
当数据包对应的标记信息变换方式中包含方式4时,根据数据包的输入/输出UNI端口号,生成所述数据包对应于单层标记包的标记变换表或是双层标记包的标记变换表读地址。
上述方案中,所述标记信息变换方式的之间有优先顺序;
从方式1到方式4优先级依次递减,当一个端口配置了2种以上的标记变换方式,且这些标记变换方式都能得到有效的标记变换结果时,优先选择优先级最高标记变换方式取得的结果。
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序用于执行上文所述的ONU虚拟局域网标记处理方法。
本发明实施例还提供一种ONU的包处理器,该包处理器中包括上文所述的ONU虚拟局域网标记处理装置。
本发明实施例所提供的ONU虚拟局域网标记处理装置,只需采用简单的数字逻辑即可实现数据包虚拟局域网标记处理功能,具有功耗低、低成本的特点,能满足ONU芯片1到10吉比特以上线速数据处理要求,还能实现如下功能:
(1)能够根据输入包的输入或输出端口以及输入包自带的VLAN域修改/添加/删除VLAN域的TPID、Priority和VLAN ID;
(2)能够实现GPON和EPON设备要求的1:1VLAN变换;
(3)能够实现上行不同输入端口的多个VLAN业务聚合为一个VLAN业务在PON口输出的N:1VLAN聚合功能;
(4)能够实现下行同一个VLAN业务变换成不同输出端口多个VLAN业务的1:N功能;
(5)能够实现基于VLAN域的上行流分类;
(6)能够实现基于VLAN域的包处理方式:修改VLAN域的转发、不修改VLAN域的转发、上交CPU或丢弃。
附图说明
图1a为本发明实施例提供的ONU处理的无标记包的结构示意图;
图1b为本发明实施例提供的ONU处理的单层标记包的结构示意图;
图1c为本发明实施例提供的ONU处理的双层标记包的结构示意图;
图1d为本发明实施例提供的ONU处理的无标记包、单层标记包和双层标记包中标记协议控制域结构示意图;
图2为本发明实施例提供的ONU虚拟局域网标记处理装置的组成结构示意图;
图3为本发明实施例提供的ONU虚拟局域网标记处理装置中标记信息提取模块的UNI端口号获取子模块与地址管理模块的组成结构和连接关系示意图;
图4为本发明实施例提供的ONU虚拟局域网标记处理方法的实现流程示意图;
图5a为本发明实施例提供的ONU的虚拟局域网标记处理方法中上行方向标记识别流程图;
图5b为本发明实施例提供的ONU的虚拟局域网标记处理方法中上行方向标记识别流程图。
具体实施方式
为了更清楚地说明本发明实施例和技术方案,下面将结合附图及实施例对本发明的技术方案进行更详细的说明,显然,所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明的实施例,本领域普通技术人员在不付出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
通常,数据包在ONU芯片内有三种流动方向:(1)从用户网络接口(User Network Interface,UNI)侧输入往PON侧方向流动,称为上行方向;(2)从光线路终端(Optical Line Terminal,OLT)数据接口PON侧输入往UNI侧方向流动,称为下行方向;(3)从用户网络接口UNI侧的一个端口输入,经过ONU内部数据交换,发往UNI侧另一个不同于输入UNI的端口输出,称为环回方向。
本发明实施例中,ONU虚拟局域网标记处理装置接收媒体接入控制层(Media Access Control,MAC)输出的每个经过校验处理的数据链路层以太网数据包包头的前20字节数据。根据数据包包头中:不含有标记协议识别符(Tag Protocol Identifier,TPID)、含有一个或两个TPID,数据包被区分为:无标记(Un-tagged)包、单层标记(Single-tagged)包和双层标记(Double-tagged)包。以太网数据包单层标记数据结构遵守电气电子工程师学会IEEE802.1Q规范标准,以太网数据包双层标记数据结构遵守电气电子工程师学会IEEE802.1ad规范标准。数据包的结构如图1a-1d所示,其中,图1a-1c分别表示无标记(Un-tagged)包、单层标记(Single-tagged)包和双层标记(Double-tagged)包的结构,图1d是图1a-1c中标记协议控制域(TCI)的结构示意图。
本发明实施例中,数据包可以含有不超过两层的TPID,当含有两层TPID时,数据包外层TPID为业务标记协议识别符(Service Provider Tag  Protocol Identifier,S-TPID),数据包内层TPID为用户标记协议识别符(Customer Tag Protocol Identifier,C-TPID);当含有单层TPID时,数据包可以是单层S-TPID包,也可以是单层C-TPID包;当不含有TPID时,数据包为无标记包。
本发明实施例中,虚拟局域网标记处理装置识别数据包包头中的S-TPID和C-TPID,并根据识别出的S-TPID和C-TPID进一步对数据包包头中TCI进行解析:当TPID为S-TPID时,其后TCI中的VLAN ID为数据包的业务虚拟局域网标号(S-VLAN ID),TCI中的优先级(Priority)为该数据包业务虚拟局域网标记对应的标记优先级;当TPID为C-TPID时,其后TCI中的VLAN ID为数据包的用户虚拟局域网标号(C-VLAN ID),TCI中的优先级(Priority)为该数据包用户虚拟局域网标记对应的标记优先级。
本发明实施例中,ONU在上行方向,接收用户网络接口发送的数据包,下行方向时,接收PON专用接口发送的数据包,上行方向的数据包从所述用户网络接口向所述PON专用接口传输,也可以经ONU内部环回之后在另一个用户网络接口输出。
图2为本发明实施例提供的ONU虚拟局域网标记处理装置的组成结构示意图,如图2所示,该装置包括:MAC地址表管理模块20、CPU接口模块21、标记变换表模块22、MAC地址、输入输出端口号和标记信息提取模块23、标记变换表读取模块24、标记变换模块25、端口寄存器配置模块26;其中:
MAC地址表管理模块20,在上行方向,该模块配置为学习和保存数据包的源MAC地址、输入UNI端口号和VLAN变换后得到的外层VLAN ID,利用目的MAC地址、VLAN变换后得到的外层VLAN ID查询MAC地址表,得到数据包的输出端口,在下行方向,该模块配置为根据数据包的目 的MAC地址和外层VLAN ID查询MAC地址表,得到输出UNI端口号;
CPU接口模块21,配置为ONU接收CPU指令,完成虚拟局域网标记处理装置模块的初始化,需要初始化的模块为:MAC地址表管理模块20、标记变换表模块22、MAC地址、输入输出端口和标记信息提取模块23、端口寄存器配置模块26;
标记变换表模块22,配置为存储标记变换表,所述标记变换表中预设有UNI端口号和虚拟局域网标记信息与标记变换规则的对应关系;
MAC地址、输入输出端口号和标记信息提取模块23,配置为接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;
标记变换表读取模块24,配置为根据所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,读取所述数据包对应的标记变换表,获取所述数据包对应的标记变换规则;
标记变换模块25,配置为按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换;
基于UNI端口寄存器配置模块26,配置为配置基于UNI端口的寄存器的值。其中,基于UNI端口的寄存器具体包括:基于端口UNI的标记变换方式寄存器、UNI输入端S-TPID和C-TPID寄存器和PON输入端S-TPID和C-TPID寄存器、基于输入端口UNI的无标记包缺省标记优先级寄存器以及基于输入端口PON的无标记包的缺省标记优先级寄存器;具体的,
基于端口UNI的标记变换方式寄存器,用来配置每个端口采用的标记变化方式;
UNI输入端S-TPID和C-TPID寄存器,配置为分别配置S-TPID和C-TPID的值,上行方向利用这两种寄存器的配置值来识别数据包的是单层标记包、双层标记包还是无标记包;
PON输入端S-TPID和C-TPID寄存器,配置为分别配置S-TPID和C-TPID的值,下行方向利用这两种寄存器的配置值来识别数据包是单层标记包、双层标记包还是无标记包;
基于输入端口UNI的无标记包缺省标记优先级寄存器,配置为配置基于输入端口UNI的无标记包缺省标记优先级;
基于输入端口PON的无标记包的缺省标记优先级寄存器,配置为配置基于输入端口PON的无标记包的缺省标记优先级。
具体的,端口是指ONU与UNI侧设备进行连接的接口,一个ONU设备有一个PON端口,一个以上的UNI端口,每个UNI端口和PON端口分别对应一个端口号,UNI端口号的位宽为正整数,当ONU的UNI端口总数为N时,UNI端口号和PON端口号的位宽为
Figure PCTCN2015076614-appb-000001
对于上行数据包或环回数据包,经由UNI侧输入ONU,MAC地址表管理模块20记录该上行数据包或环回数据包的源端MAC地址、变换后的外层VLAN ID与该上行数据包或环回数据包的输入UNI端口号的对应关系,这个过程被视为MAC地址表管理模块20的学习过程;此外,下行方向,MAC地址表管理模块20根据该下行数据包目的端MAC地址和原始外层VLAN ID查表,得到数据包的输出UNI端口号,上行方向,MAC地址管理模块20根据该上行数据包的目的MAC地址和变换后得到的外层VLAN ID查表,得到数据包的输出UNI或PON端口号,上行方向和下行方向的这两个过程都被视为MAC地址表管理模块20的查询过程。
具体的,上述虚拟局域网标记处理装置中,CPU接口模块21与ONU中的CPU相连,能够接收ONU中CPU的指令,该CPU接口模块21还与ONU虚拟局域网标记处理装置中的其它各模块相连,通过CPU指令对整个虚拟局域网标记处理装置进行初始化,即对虚拟局域网标记处理装置中的寄存器和随机存取存储器(Random Access Memory,RAM)进行初始化, 包括配置端口寄存器配置模块、MAC地址表管理模块、标记变换表等。在一个实施例中,可针对每个UNI端口配置标记信息变换方式,具体通过基于端口UNI的标记变换方式寄存器分别设置该UNI端口上行方向输入或下行方向输出的数据包对应的标记信息变换方式;每个UNI输入端口和输出端口分别可配置一种以上、四种以下的标记信息变换方式。UNI输入端口或输出端口可配置的四种标记信息变换方式分别是:
方式1,基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换;
方式2,基于UNI端口号、虚拟局域网标号VLAN ID的标记变换;
方式3,基于UNI端口号和标记优先级的标记变换;
方式4,缺省的标记变换方式;
其中缺省的标记变换方式包括基于UNI端口号的单层标记变换和基于UNI端口号的双层标记变换,无标记包不存在缺省变换方式;
以上四种变换方式是有优先级的,从方式1到方式4优先级依次递减,如果一个端口配置了2种以上的标记变换方式,并且这些标记变换方式都能得到有效的标记变换结果的情况下,优先选择优先级最高标记变换方式的结果。
进一步的,上述ONU虚拟局域网标记处理装置中,按照对应的标记信息变换方式,标记变换表模块22包括:
基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表子模块,配置为存储基于UNI端口号、VLAN ID和标记优先级的标记变换表,所述基于UNI端口号、VLAN ID和标记优先级的标记变换表中预设有UNI端口号、虚拟局域网标记信息与标记变换规则的对应关系;
基于UNI端口号和标记优先级的标记变换表子模块,配置为存储基于UNI端口号和标记优先级的标记变换表,所述基于UNI端口号、标记优先 级的标记变换表预设有UNI端口号、标记优先级与标记变换规则的对应关系;
基于UNI端口号的单层标记包标记变换表子模块,配置为存储单层标记包的标记变换表,所述单层标记包的标记变换表预设有单层标记包UNI端口号与标记变换规则的对应关系;
基于UNI端口号的双层标记包标记变换表子模块,配置为存储双层标记包的标记变换表,所述双层标记包的标记变换表预设有双层标记包UNI端口号与标记变换规则的对应关系。
这里,虚拟局域网标记信息包括:S-VLAN信息和/或C-VLAN信息;其中,S-VLAN信息包括:S-VLAN是否存在、S-TPID值、S-VLAN ID值和S-VLAN Priority值;C-VLAN信息包括:C-VLAN是否存在、C-TPID值、C-VLAN ID值和C-VLAN Priority值。标记变换规则包括:VLAN ID变换规则、TPID变换规则、标记优先级Priority变换规则和数据包处理方式。
为了减少哈希地址冲突带来的碰撞,在一个实施例中,基于UNI端口号、VLAN ID和标记优先级的标记变换表子模块中可配置n张基于UNI端口号、输入VLAN ID和标记优先级的标记变换表,它们的地址空间完全一样,其中n为大于1的整数;每张表有一个序列号,序列号的取值范围为0至n-1。
此外,按照对应的数据包流向,标记变换表模块22包括:
PON侧输出或UNI环回的标记变换表子模块,配置为存储上行方向PON侧输出或UNI环回的标记变换表,所述PON侧输出或UNI环回的标记变换表预设有经PON侧输出或UNI环回的数据包对应的标记变换规则和上行PON侧输出数据包的流编号,环回数据包只在上行方向进行标记变换,在UNI出口不再进行标记变换;
UNI侧输出标记变换表子模块,配置为存储UNI侧输出的标记变换表,所述UNI侧输出标记变换表中预设有经UNI侧输出的数据包对应的标记变换规则,该标记变换表配置为下行数据包,不配置为UNI环回的数据包。
在一个实施例中,上述标记变换表模块22包括PON侧输出或UNI环回的标记变换表子模块和UNI侧输出标记变换表子模块;其中,
PON侧输出或UNI环回的标记变换表子模块包括:
上行基于输入UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表单元,配置为存储基于输入UNI端口号、虚拟局域网标号VLANID和标记优先级的PON侧输出或UNI环回的标记变换表,表1为本发明实施例提供的上行基于输入UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表的数据结构示意;
上行基于输入UNI端口号和标记优先级的标记变换表单元,配置为存储只关心输入UNI端口号和标记优先级的PON侧输出或UNI环回的标记变换表,表3为本发明实施例提供的上行基于输入UNI端口号和标记优先级的标记变换表的数据结构示意;
上行基于输入UNI端口号的单层标记包标记变换表单元,配置为PON侧输出或UNI环回的单层标记包标记变换表,表3为本发明实施例提供的上行单层标记包标记变换表的数据结构示意;
上行基于输入UNI端口号的双层标记包标记变换表单元,配置为PON侧输出或UNI环回的双层标记包标记变换表,表3为本发明实施例提供的上行双层标记包标记变换表的数据结构示意;
UNI侧输出标记变换表子模块包括:
下行基于输出UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表单元,配置为存储基于输出UNI端口号、虚拟局域网标号VLANID和标记优先级的UNI侧输出标记变换表,表2为本发明实施例提供的下 行基于输出UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表的数据结构示意;
下行基于输出UNI端口号和标记优先级的标记变换表单元,配置为存储只关心输出UNI端口号和标记优先级的UNI侧输出标记变换表,表4为本发明实施例提供的下行基于输出UNI端口号和标记优先级的标记变换表的数据结构示意;
下行基于输出UNI端口号的单层标记包标记变换表单元,配置为UNI侧输出的单层标记包标记变换表,表4为本发明实施例提供的下行基于输出UNI端口号的单层标记包标记变换表的数据结构示意;
下行基于输出UNI端口号的双层标记包标记变换表单元,配置为UNI侧输出的双层标记包标记变换表,表4为本发明实施例提供的下行基于输出UNI端口号的双层标记包标记变换表的数据结构示意。
表1
Figure PCTCN2015076614-appb-000002
Figure PCTCN2015076614-appb-000003
表2
Figure PCTCN2015076614-appb-000004
表3
Figure PCTCN2015076614-appb-000005
Figure PCTCN2015076614-appb-000006
表4
Figure PCTCN2015076614-appb-000007
具体的,上述标记变换表模块和子模块都可由双端口的RAM存储器实现,ONU中的CPU通过CPU接口模块21对RAM进行读写配置。
进一步的,上述虚拟局域网标记处理装置中,MAC地址、输入输出端口号和标记信息提取模块23包括:
标记信息获取子模块,配置为接收数据包包头,获取数据包的虚拟局域网标记信息;
端口号获取子模块,配置为获取数据包的源/目的MAC地址、输入UNI端口号和输出UNI/PON端口号。
具体的,接收数据包包头后,标记信息获取子模块判断数据包的类别,即确定数据包是无标记包、单层标记包还是双层标记包;然后根据数据包的类别,再结合图1a-1d所示的数据包结构,即可确定虚拟局域网标记信息在数据包包头中的位置,从而获取数据包的虚拟局域网标记信息,即S-VLAN信息和/或C-VLAN信息(对于双层标记包,虚拟局域网标记信息包括S-VLAN信息和C-VLAN信息;对于单层S-VLAN包,虚拟局域网标记信息包括S-VLAN信息;对于单层C-VLAN包,虚拟局域网标记信息包 括C-VLAN信息);其中,S-VLAN信息包括:S-VLAN是否存在、S-TPID值、S-VLAN ID值和S-VLAN Priority值;C-VLAN信息包括:C-VLAN是否存在、C-TPID值、C-VLAN ID值和C-VLAN Priority值。其中,判断数据包类别的方法为:统一假设数据包是双层标记包,按照图1c读取数据包包头中的外层TPID和内层TPID对应位置中的信息,根据预设的S-TPID和C-TPID值进一步进行判断:UNI侧输入的包,如果它的外层TPID等于S-TPID,内层TPID等于C-TPID,它为双层标记包,外层为S-VLAN,内层为C-VLAN;否则,如果它的外层TPID等于C-TPID,它为单层标记C-VLAN包;否则,如果它的外层TPID等于S-TPID,它为单层标记S-VLAN包;如果以上条件都不满足,它就是无标记包,标记识别流程如图5a所示。PON侧输入的包,如果它的外层TPID等于S-TPID,内层TPID等于C-TPID,它为双层标记包,外层为S-VLAN,内层为C-VLAN;否则,如果它的外层TPID等于S-TPID,它为单标记S-VLAN包;否则,如果它的外层TPID等于C-TPID,它为单标记C-VLAN包;如果以上条件都不满足,它就是无标记包,标记识别流程如图5b所示。
特别的,对于无标记包,由于其包头中不含有效的虚拟局域网标记信息,标记信息获取子模块将基于该数据包的UNI端口号给它配置一个缺省的标记优先级,配置为后续处理;显然,对于上行无标记包基于其输入UNI端口号配置其缺省标记优先级,对于下行无标记包基于其输入PON端口号配置其缺省标记优先级。
更进一步的,如图3所示,上述MAC地址、输入/输出端口号和标记信息提取模块23中端口号获取子模块包括:
输入UNI获取单元31,配置为获取UNI侧输入数据包的输入UNI端口号,并将所述UNI端口号发送至地址表管理模块20;
输出UNI/PON获取单元32,配置为获取UNI侧输入数据包的UNI侧或PON侧输出端口号,或配置为获取PON侧输入数据包的UNI侧输出端口号,对于PON侧输入的数据包,标记信息获取模块将得到的数据包原始外层VLAN ID发送到MAC地址表管理模块,对于UNI侧输入的数据包, 标记变换模块将标记变换之后得到的外层VLAN ID发送到MAC地址表管理模块,接收地址表管理模块20返回的所述数据包的输出UNI端口号;
源和目的MAC地址获取单元33,配置为获取数据包的源MAC地址和目的MAC地址。
具体的,输入UNI获取单元31可从ONU的包处理器获取经UNI侧输入数据包的输入UNI端口号,并将其发送至MAC地址表管理模块20,MAC地址表管理模块20还接收标记变换模块25输出的该数据包VLAN变换之后得到的外层VLAN ID,接收源和目的MAC地址获取单元33获取的该数据包的源MAC地址,在上行方向,MAC地址表管理模块20建立并存储该UNI输入端口号与该源MAC地址、该外层VLAN ID的对应关系,完成MAC地址表管理模块20的学习过程;此外,在上行方向,MAC地址表管理模块接收源和目的MAC地址获取单元33获取的数据包的目的MAC地址,接收标记变换模块25输出的该数据包VLAN变换之后得到的外层VLAN ID,通过查询得到该数据包输出PON或UNI的端口号后,返回至输出UNI/PON获取单元32,下行方向,MAC地址表管理模块20接收MAC地址获取单元33获取的数据包目的MAC地址,接收标记信息获取子模块获取的数据包原始外层VLAN ID,将PON侧输入的数据包目的MAC地址和数据包的原始外层VLAN ID发送至MAC地址表管理模块20,通过查询得到数据报输出的UNI端口号,并将该UNI端口号返回至输出UNI/PON获取单元32。
本发明实施例中,根据数据包对应的标记信息变换方式,将对应查询不同的标记变换表,即读取不同的标记变换表子模块。上行或环回数据包的标记信息变换方式由该数据包的输入UNI端口决定,环回数据包只在上行方向进行VLAN变换,在下行方向不需要进行VLAN变换,所以环回数据包在下行方向不需要查询标记变换表;下行数据包标记信息变换方式由 该数据包的输出UNI端口决定。因而,下文中的“输入/输出UNI端口号”,对于上行数据包是指输入UNI端口号,对于下行数据包是指输出UNI端口号。
进一步的,上述虚拟局域网处理装置中,标记变换表读取模块24包括:
标记信息变换方式获取子模块,配置为根据所述数据包的输入/输出UNI端口号,通过基于端口UNI的标记变换方式寄存器获取所述数据包对应的标记信息变换方式;
读地址生成子模块,配置为根据所述标记信息变换方式,以及所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应的标记变换表读地址;
表读取子模块,配置为根据所述标记变换表读地址,读取所述数据包对应的标记变换表,获取所述数据包的标记变换规则。
具体的,由于每个UNI端口的标记信息变换方式可配置为方式1至方式4中的任意一种至四种,数据包对应的标记信息变换方式也为方式1至方式4中的任意一种至四种。当数据包对应一种以上标记信息变换方式时,标记变换表读取模块24将读取一个以上标记变换表子模块。因此,上述标记变换表读取模块24中,读地址生成子模块包括:
方式1读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式1时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于VLAN ID和优先级的标记变换表读地址;
具体的,方式1读地址生成单元将数据包的输入/输出UNI端口号、S-VLAN ID和/或C-VLAN ID、标记优先级不关心位(DontCarePri)和标记优先级(Priority)由高位到低位串起来组成二进制数据{UNI端口号,S-VLAN ID,C-VLAN ID,DontCarePri,Priority};其中,UNI端口号位宽如前所述由ONU的UNI端口数决定;S-VLAN ID和C-VLAN ID各占12 比特,若数据包虚拟标记信息中没有对应的S-VLAN ID和/或C-VLAN ID,则将对应的位填充为0;DontCarePri占1比特,取值为0,表示关心标记优先级;Priority占3比特,填充数据包标记的标记优先级。特别的,对于双标记包Priority可以设置为外层标记优先级,也可以设置为内层标记优先级,具体设置可由ONU用户根据实际情况配置,或者固化设置于ONU芯片中。方式1读地址生成单元对数据{UNI端口号,S-VLAN ID,C-VLAN ID,0,Priority}进行哈希运算得到地址值,记为Addr0,该地址Addr0为数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表的读地址。方式1读地址生成单元根据所述读地址向基于UNI端口号、虚拟局域网标号VLAN ID和优先级的标记变换表子模块发出读使能信号。
方式2读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式2时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;
具体的,方式2读地址生成单元将数据包的输入/输出UNI端口号、S-VLAN ID、C-VLAN ID、标记优先级不关心位(DontCarePri)和占位符由高位到低位串起来组成二进制数据{UNI端口号,S-VLAN ID,C-VLAN ID,DontCarePri,占位符};其中,UNI端口号位宽如前所述由ONU的UNI端口数决定;S-VLAN ID和C-VLAN ID各占12比特,若数据包虚拟标记信息中没有对应的S-VLAN ID和/或C-VLAN ID,则将对应的位填充为0;DontCarePri占1比特,取值为1,表示不关心标记优先级;占位符占3比特,填充为3个二进制0。方式2读地址生成单元对数据{UNI端口号,S-VLAN ID,C-VLAN ID,1,000}进行哈希运算得到地址值,记为Addr1,该地址Addr1为数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表的读地址。方式2读地址生成单元根据所述读 地址向基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表子模块发出读使能信号。
方式3读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式3时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号和标记优先级的标记变换表读地址;
具体的,方式3读地址生成单元将数据包的输入/输出UNI端口号和标记优先级(Priority)由高位到低位串起来组成的数据{UNI端口号,Priority};其中,UNI端口号位宽如前所述由ONU的UNI端口数决定;Priority占3比特,填充数据包标记的标记优先级。特别的,对于双标记包Priority可以设置为外层标记优先级,也可以设置为内层标记优先级,具体设置可由ONU用户根据实际情况配置,或者固化设置于ONU芯片中,对于无标记包,上行方向的Priority值通过基于输入端口UNI的无标记包缺省标记优先级寄存器得到,下行方向的Priority值通过基于输入端口PON的无标记包缺省标记优先级寄存器得到。方式3读地址生成单元将数据{UNI端口号,Priority}作为地址,记为Addr2。该地址Addr2为数据包对应于基于UNI端口号和标记优先级的标记变换表的读地址。方式3读地址生成单元根据所述读地址向基于UNI端口号和标记优先级的标记变换表子模块发出读使能信号。
方式4读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式4时,根据数据包的输入/输出UNI端口号,生成所述数据包对应于单层标记包的标记变换表或是双层标记包的标记变换表读地址;
具体的,方式4读地址生成单元将从MAC地址、输入输出端口号和标记记信息提取模块23得到的数据包输入/输出UNI端口号作为地址,记为Addr3。当数据包是单层标记包时,该地址Addr3为数据包对应于单层标记包的标记变换表的读地址;方式4读地址生成单元根据所述读地址向单层 标记包标记变换表子模块发出读使能信号。当数据包是双层标记包时,该地址Addr3为数据包对应于双层标记包的标记变换表的读地址;方式4读地址生成单元根据所述读地址向双层标记包标记变换表子模块发出读使能信号。
如上所述,表读取子模块可从读地址生成子模块获取到一个以上的读地址,每个读地址对应于不同的标记变换表子模块,相应的,上述标记变换表读取模块24中,表读取子模块包括:
基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读取单元,配置为根据方式1/方式2读地址生成单元生成的读地址,读取基于UNI端口号、VLAN ID和标记优先级的标记变换表子模块,获取所述数据包的标记变换规则;
具体的,当方式1读地址生成单元生成读地址Addr0或方式2读地址生成单元生成读地址Addr1后,对于上行数据包,基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读取单元读取如表1所示的上行基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表单元中与Addr0或Addr1对应的记录;对于下行数据包,基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读取单元读取如表2所示的下行基于VLAN ID和标记优先级的标记变换表单元中与Addr0或Addr1对应的记录。如前所述,在一个实施例中,基于VLAN ID和标记优先级的标记变换表子模块中配置有n张基于VLAN ID和标记优先级的标记变换表,因而一个读地址Addr0/Addr1对应n个记录,其中n为大于1的整数。将这n个记录中输入/输出UNI端口号和虚拟局域网标识信息逐一与MAC地址、输入输出端口号和标记信息提取模块23获取的数据包的输入/输出UNI端口号和虚拟局域网标识信息进行比较匹配,当n个记录中有m个记录匹配成功,且该m个记录的表项有效标识位为有效时,基于 UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读取单元选取m个记录中所在标记变换表序列号最小/最大的记录,读取该记录中预设的标记变换规则,将该标记变换规则发送至标记变换模块25,其中m为大于0的整数,选取m个记录中所在标记变换表序列号最小还是最大的记录,可根据情况通过CPU进行配置,也可以固化设计于ONU芯片中。
只基于UNI端口号和标记优先级的标记变换表读取单元,配置为根据方式3读地址生成单元生成的读地址,读取基于UNI端口号和标记优先级的标记变换表子模块,获取所述数据包的标记变换规则;
具体的,当方式3读地址生成单元生成读地址Addr2后,对于上行数据包,基于UNI端口号和标记优先级的标记变换表读取单元读取如表3所示的上行基于UNI端口号和标记优先级的标记变换表单元中与Addr2对应的记录;对于下行数据包,基于UNI端口号和标记优先级的标记变换表读取单元读取如表4所示的下行基于UNI端口号和标记优先级的标记变换表单元中与Addr2对应的记录。当Addr2对应的记录的表项有效标识位为有效时,基于UNI端口号和标记优先级的标记变换表读取单元读取该记录中预设的标记变换规则,将该标记变换规则发送至标记变换模块25。
基于UNI端口号的单层/双层标记包标记变换表读取单元,配置为根据方式4读地址生成单元生成的读地址,读取基于UNI端口号的单层/双层标记包标记变换表子模块,获取所述数据包的标记变换规则。
具体的,当方式4读地址生成单元生成读地址Addr3后,对于上行数据包,基于UNI端口号的单层/双层标记包标记变换表读取单元读取如表3所示的上行单层/双层标记包标记变换表单元中与Addr3对应的记录;对于下行数据包,基于UNI端口号的单层/双层标记包标记变换表读取单元读取如表4所示的下行单层/双层标记包标记变换表单元中与Addr3对应的记录。当Addr3对应的记录的表项有效标识位为有效时,单层/双层标记包标记变 换表读取单元读取该记录中预设的标记变换规则,将该标记变换方式发送至标记变换模块25。
在一个实施例中,上述按照不同标记信息变换方式获取的读地址对应的标记变换方式有优先顺序:方式1优先于方式2,方式2优先于方式3,方式3优先于方式4,即Addr0对应的记录中的变换规则优先于Addr1对应的记录中的变换规则,Addr1对应的记录中的变换规则优先于Addr2对应的记录中的变换规则,Addr2对应的记录中的变换规则优先于Addr3对应的记录中的变换规则。标记变换模块25按照优先级最高的变换规则进行数据包的虚拟局域网标记变换。
如前所述,标记变换规则包括:VLAN ID变换规则、TPID变换规则、标记优先级变换规则和数据包处理方式。其中,数据包处理方式有:修改VLAN域的转发、不修改VLAN域的转发、上交CPU或丢弃三种情况。当数据包处理方式为修改VLAN域的转发时,标记变换模块25按照标记变换表读取模块24获取的VLAN ID变换规则、TPID变换规则、标记优先级变换规则修改数据包的VLAN ID、TPID和标记优先级,完成对数据包虚拟局域网标记的变换;经过虚拟局域网标记变换的数据包由ONU进行转发。当数据包处理方式为不修改VLAN域的转发时,标记变换模块25不修改数据包的虚拟局域网标记信息,直接由ONU将数据包进行转发。当数据包处理方式为上交CPU或丢弃时,标记变换模块25不修改数据包的虚拟局域网标记信息,直接将数据包上交CPU或丢弃。特别的,在PON侧输出标记变换表中包括上行数据包的流编号,因此ONU可根据数据包的流编号值得到上行的GEMPORT ID值、队列号和T-CONT值,从而进行上行数据包流分类。
实际应用中,所述MAC地址表管理模块20、CPU接口模块21、标记变换表模块22、MAC地址、输入输出端口号和标记信息提取模块23、标 记变换表读取模块24、标记变换模块25、端口寄存器配置模块26、以及上述各个模块中的子模块、各子模块中的各个单元,均可由所述ONU虚拟局域网标记处理装置中的中央处理器(CPU,Central Processing Unit)、数字信号处理器(DSP,Digital Signal Processor)或现场可编程门阵列(FPGA,Field Programmable Gate Array)实现。
以上实施例提供的ONU包处理器的虚拟局域网标记处理装置,只需采用简单的数字逻辑即可实现数据包虚拟局域网标记处理功能,具有功耗低、低成本的特点,能满足ONU芯片1到10吉比特以上线速处理数据要求。
图4为本发明实施例提供的ONU虚拟局域网标记处理方法的实现流程示意图,如图4所示,该方法主要包括:
步骤401,接收数据包包头,获取数据包的源/目的MAC地址和虚拟局域网标记信息,上行方向获取数据包的输入UNI端口号,下行方向获取数据包的输出UNI端口号;
具体的,ONU虚拟局域网标记处理装置接收包处理器发送的数据包输入UNI端口号和数据包包头,解析数据包包头,从中获取数据包的源/目的MAC地址、虚拟局域网标记信息,下行方向利用数据包的目的MAC地址和外层VLAN ID查询MAC地址表,获取数据包的输出UNI端口号。
步骤402,根据所述数据包的输入/输出UNI端口号和/或虚拟局域网标记信息,获取所述数据包对应的标记信息变换方式,读取所述数据包对应的标记变换表,获取所述数据包对应的标记变换规则;
具体的,ONU虚拟局域网标记处理装置根据所述数据包的输入/输出UNI端口号,获取所述数据包对应的标记信息变换方式;然后根据数据包对应的标记信息变换方式,依据数据包的输入/输出UNI端口号和/或虚拟局域网标记信息生成数据包对应于不同的标记变换表的读地址;再根据不同的标记变换表的读地址读取对应的标记变换表,获取标记变换表中预设的 标记变换规则。在一个实施例中,如前所述,数据包对应的标记信息变换方式可配置为方式1至方式4中的任意一种至四种,且方式1生成的读地址对应获取的标记变换规则优先于方式2生成的读地址对应获取的标记变换规则,方式2生成的读地址对应获取的标记变换规则优先于方式3生成的读地址对应获取的标记变换规则,方式3生成的读地址对应获取的标记变换规则优先于方式4生成的读地址对应获取的标记变换规则。因此,对于一个数据包,虚拟局域网标记处理装置按照标记信息变换方式同时生成读地址和获取标记变换规则,例如:数据包X对应的标记信息变换方式包括方式1、方式2、方式3和方式4;虚拟局域网标记处理装置按照方式1、方式2、方式3和方式4分别生成的读地址Addr0、Addr1、Addr2、Addr3,根据Addr0在基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表中获取到标记变换方式,根据Addr1查询基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表,根据Addr3和数据包的类别,查询基于UNI端口号和单层标记包的标记变换表或是双层标记包的标记变换表,在以上4种方式都得到有效的匹配结果时,优先选取优先级最高方式1得到的结果。
步骤403,按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换;
具体的,当数据包处理方式为修改VLAN域的转发时,虚拟局域网标记处理装置按照获取的VLAN ID变换规则、TPID变换规则和标记优先级变换规则分别修改数据包的VLAN ID、TPID和标记优先级,完成对数据包虚拟局域网标记的变换;经过虚拟局域网标记变换的数据包由ONU进行转发。当数据包处理方式为不修改VLAN域的转发时,虚拟局域网标记处理装置不修改数据包的虚拟局域网标记信息,ONU直接将数据包进行转发。当数据包处理方式为上交CPU或丢弃时,虚拟局域网标记处理装置不修改 数据包的虚拟局域网标记信息,直接将数据包上交CPU或丢弃。特别的,在PON侧输出标记变换表中包括上行数据包的流编号,因此ONU可根据数据包的流编号值得到上行的GEMPORT ID值、队列号和T-CONT值,从而进行上行数据包流分类。
进一步的,上述ONU虚拟局域网标记处理方法中,对于上行方向数据包,在执行了步骤403之后,所述方法还包括:
将数据包的源MAC地址、VLAN变换之后的外层VLAN ID以及输入UNI端口号学习到MAC地址表中,同时利用数据包的目的MAC地址、经步骤403VLAN变换之后得到的外层VLAN ID查询MAC地址表,得到数据包的输出端口;其中,上行数据包的输出端口可以是PON端口也可以是UNI端口,后者对应于UNI环回包。
本发明还提供一种ONU包处理器,该ONU包处理器中包括上述实施例提供的任一种ONU虚拟局域网标记处理装置。
本发明实施例还记载一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序用于执行本发明实施例中图4所示的ONU虚拟局域网标记处理方法。
本领域内的技术人员应明白,本发明的实施例可提供为方法、***、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
工业实用性
本发明实施例中,接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;根据所述数据包的输入/输出UNI端口号获取所述数据包对应的预设的标记信息变换方式之后,再根据所述数据包的输入/输出UNI端口号和/或虚拟局域网标记信息,读取所述数据包对应的预设的标记变换表,获取所述数据包对应的标记变换规则;按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换;如此,能满足ONU芯片1到10吉比特以上线速数据处理。

Claims (15)

  1. 一种光网络单元ONU的虚拟局域网标记处理装置,所述装置包括:标记变换表模块、MAC地址、输入输出端口号和标记信息提取模块、标记变换表读取模块、标记变换模块、基于UNI端口寄存器配置模块和MAC地址表管理模块;其中,
    所述标记变换表模块,配置为存储标记变换表,所述标记变换表中预设有用户网络接口UNI端口号和虚拟局域网标记信息与标记变换规则的对应关系;
    所述MAC地址、输入输出端口号和标记信息提取模块,配置为接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;
    所述标记变换表读取模块,配置为根据所述数据包的输入/输出UNI端口号从基于UNI端口寄存器配置模块中获取所述数据包对应的标记信息变换方式之后,再根据所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,读取所述数据包对应的标记变换表,获取所述数据包对应的标记变换规则;
    所述标记变换模块,配置为按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换;
    所述基于UNI端口寄存器配置模块,配置为配置基于UNI端口的寄存器的值,所述基于UNI端口寄存器的值中包括UNI端口对应的标记变换方式;
    所述MAC地址表管理模块,配置为保存数据包的源/目的MAC地址、虚拟局域网标号VLAN ID和包输入/输出端口的对应关系。
  2. 根据权利要求1所述的ONU虚拟局域网标记处理装置,其中,按照对应的标记信息变换方式,所述标记变换表模块包括:
    基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表子模块,配置为存储基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表,所述基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表中预设有UNI端口号、虚拟局域网标记信息与标记变换规则的对应关系;
    基于UNI端口号和标记优先级的标记变换表子模块,配置为存储基于UNI端口号、标记优先级的标记变换表,所述基于UNI端口号、标记优先级的标记变换表预设有UNI端口号、标记优先级与标记变换规则的对应关系;
    基于UNI端口号的单层标记包标记变换表子模块,配置为存储单层标记包的标记变换表,所述单层标记包的标记变换表预设有单层标记包UNI端口号与标记变换规则的对应关系;
    基于UNI端口号的双层标记包标记变换表子模块,配置为存储双层标记包的标记变换表,所述双层标记包的标记变换表预设有双层标记包UNI端口号与标记变换规则的对应关系。
  3. 根据权利要求1所述的ONU虚拟局域网标记处理装置,其中,按照对应的数据包流向,所述标记变换表模块包括:
    无源光网络PON侧输出或UNI环回标记变换表子模块,配置为存储PON侧输出或UNI环回标记变换表,所述PON侧输出或UNI环回标记变换表预设有经PON侧输出或UNI环回的数据包对应的标记变换规则和所述数据包的流编号;
    UNI侧输出标记变换表子模块,配置为存储UNI侧输出标记变换表,所述UNI侧输出标记变换表中预设有经UNI侧输出的数据包对应的标记变换方式。
  4. 根据权利要求1所述的ONU虚拟局域网标记处理装置,其中,所 述MAC地址、输入输出端口号和标记信息提取模块包括:
    标记信息获取子模块,配置为接收数据包包头,获取数据包的虚拟局域网标记信息;
    端口号获取子模块,配置为获取数据包的源和目的MAC地址、输入UNI端口号、输出UNI或PON端口号。
  5. 根据权利要求4所述的ONU虚拟局域网标记处理装置,其中,所述端口号获取子模块包括:
    输入UNI获取单元,配置为获取UNI侧输入数据包的输入UNI端口号,并将输入UNI端口号发送至MAC地址表管理模块;
    源和目的MAC地址获取单元,配置为获取UNI侧输入或PON侧输入数据包的源MAC地址和目的MAC地址,并将它们发送到MAC地址管理模块;
    输出UNI/PON获取单元,配置为获取UNI侧输入数据包的UNI侧或PON侧输出端口号,或配置为获取PON侧输入数据包的UNI侧输出端口号,对于PON侧输入的数据包,标记信息获取模块将得到的数据包原始外层VLAN ID发送到MAC地址表管理模块,对于UNI侧输入的数据包,标记变换模块将标记变换之后得到的外层VLAN ID发送到MAC地址表管理模块,接收地址表管理模块返回的所述数据包的输出UNI或PON端口号。
  6. 根据权利要求1所述的ONU虚拟局域网标记处理装置,其中,所述标记变换表读取模块包括:
    标记信息变换方式获取子模块,配置为根据所述数据包的输入/输出UNI端口号,从所述基于UNI端口寄存器配置模块中获取所述数据包对应的标记信息变换方式;
    读地址生成子模块,配置为根据所述标记信息变换方式,以及所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,分别生成所述数据包 对应的标记变换表读地址;
    表读取子模块,配置为根据所述读地址,读取所述数据包对应的标记变换表,获取所述数据包的标记变换规则。
  7. 根据权利要求6所述的ONU虚拟局域网标记处理装置,其中,所述读地址生成子模块包括:
    方式1读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式1时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;
    方式2读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式2时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;其中,所述虚拟局域网标记信息中不包含标记优先级信息;
    方式3读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式3时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号和标记优先级的标记变换表读地址;
    方式4读地址生成单元,配置为当数据包对应的标记信息变换方式中包含方式4时,根据数据包的输入/输出UNI端口号,对应于单层标记包生成所述数据包基于UNI端口号的单层标记包的标记变换表读地址,对应于双层标记包生成基于UNI端口号的双层标记包的标记变换表读地址。
  8. 根据权利要求7所述的ONU虚拟局域网标记处理装置,其中,所述表读取子模块包括:
    基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换 表读取单元,配置为根据方式1/方式2读地址生成单元生成的读地址,读取基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表子模块,获取所述数据包的标记变换规则;
    基于UNI端口号和标记优先级的标记变换表读取单元,配置为根据方式3读地址生成单元生成的读地址,读取基于UNI端口号和标记优先级的标记变换表子模块,获取所述数据包的标记变换规则;
    基于UNI端口号的单层/双层标记包标记变换表读取单元,配置为根据方式4读地址生成单元生成的读地址,读取单层/双层标记包标记变换表子模块,获取所述数据包的标记变换方式,其中单层标记包读取基于UNI端口号的单层标记变换表,双层标记包读取基于UNI端口号的双层标记变换表。
  9. 一种ONU虚拟局域网标记处理方法,所述方法包括:
    接收数据包包头,获取数据包的源MAC地址、目的MAC地址、输入/输出UNI或PON端口号和虚拟局域网标记信息;
    根据所述数据包的输入/输出UNI端口号获取所述数据包对应的预设的标记信息变换方式之后,再根据所述数据包的输入/输出UNI端口号和/或虚拟局域网标记信息,读取所述数据包对应的预设的标记变换表,获取所述数据包对应的标记变换规则;
    按照所述标记变换规则,对所述数据包的虚拟局域网标记信息进行变换。
  10. 根据权利要求9所述的ONU虚拟局域网标记处理方法,其中,所述获取数据包的虚拟局域网标记信息包括:
    根据所述数据包包头信息,判断所述数据包的类别;
    根据所述数据包的类别确定所述数据包的数据结构;
    根据所述数据包的数据结构,获取所述数据包的虚拟局域网标记信息。
  11. 根据权利要求9所述的ONU虚拟局域网标记处理方法,其中,所述读取所述数据包对应的标记变换表包括:
    根据所述标记信息变换方式,以及所述数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应的标记变换表读地址;
    根据所述标记变换表读地址,读取所述数据包对应的标记变换表,获取所述数据包的标记变换规则。
  12. 根据权利要求11所述的ONU虚拟局域网标记处理方法,其中,所述标记信息变换方式包括:
    方式1:基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换;
    方式2:基于UNI端口号和虚拟局域网标号VLAN ID的标记变换;
    方式3:基于UNI端口号和标记优先级的标记变换;
    方式4:缺省的标记处理,此方式仅针对单标记包和双标记包,对无标记包不适用;
    所述生成所述数据包对应的标记变换表读地址包括:
    当数据包对应的标记信息变换方式中包含方式1时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;
    当数据包对应的标记信息变换方式中包含方式2时,根据数据包的输入/输出UNI端口号和虚拟局域网标记信息,生成所述数据包对应于基于UNI端口号、虚拟局域网标号VLAN ID和标记优先级的标记变换表读地址;其中,所述虚拟局域网标记信息中不包含标记优先级信息;
    当数据包对应的标记信息变换方式中包含方式3时,根据数据包的输入/输出UNI端口号和虚拟局域网标记优先级,生成所述数据包对应于基于UNI端口号和标记优先级的标记变换表读地址;
    当数据包对应的标记信息变换方式中包含方式4时,根据数据包的输入/输出UNI端口号,生成所述数据包对应于单层标记包的标记变换表或是双层标记包的标记变换表读地址。
  13. 根据权利要求12所述的ONU虚拟局域网标记处理方法,其中,所述标记信息变换方式的之间有优先顺序;
    从方式1到方式4优先级依次递减,当一个端口配置2种以上的标记变换方式,且该端口所配置的标记变换方式都能得到有效的标记变换结果时,优先选择优先级最高标记变换方式取得的结果。
  14. 一种ONU的包处理器,其中,该包处理器中包括权利要求1至8任一项所述的虚拟局域网标记处理装置。
  15. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求9至13任一项所述的方法。
PCT/CN2015/076614 2014-10-22 2015-04-15 Onu虚拟局域网标记处理装置、方法及计算机存储介质 WO2016062035A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410568601.2 2014-10-22
CN201410568601.2A CN105530156A (zh) 2014-10-22 2014-10-22 一种onu虚拟局域网标记处理装置和方法

Publications (1)

Publication Number Publication Date
WO2016062035A1 true WO2016062035A1 (zh) 2016-04-28

Family

ID=55760191

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/076614 WO2016062035A1 (zh) 2014-10-22 2015-04-15 Onu虚拟局域网标记处理装置、方法及计算机存储介质

Country Status (2)

Country Link
CN (1) CN105530156A (zh)
WO (1) WO2016062035A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020037484A1 (zh) * 2018-08-21 2020-02-27 华为技术有限公司 光网络单元的管理方法和装置
CN110830376B (zh) * 2019-11-05 2021-11-09 苏州盛科科技有限公司 一种int报文的处理方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1371202A (zh) * 2002-02-28 2002-09-25 威盛电子股份有限公司 数据包传送方法及应用此方法的网络交换机
EP1246408A1 (en) * 2001-03-27 2002-10-02 Tellabs Denmark A/S Mapping of data frames from a local area network into a synchronous digital telecommunications system
CN101697555A (zh) * 2009-11-12 2010-04-21 烽火通信科技股份有限公司 一种vlan id收敛转换的解决方法
CN104104571A (zh) * 2013-04-10 2014-10-15 中兴通讯股份有限公司 实现虚拟局域网域映射与访问控制的方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1185831C (zh) * 2001-12-13 2005-01-19 华为技术有限公司 一种在宽带城域网中管理用户的方法
CN101150446B (zh) * 2006-09-21 2010-12-08 中兴通讯股份有限公司 一种标记模式evplan地址学习功能的测试方法
CN102055669B (zh) * 2010-12-20 2012-11-21 武汉烽火网络有限责任公司 10gpon***中实现n:1 vlan映射的方法
CN103840996B (zh) * 2014-03-03 2017-08-01 烽火通信科技股份有限公司 光网络单元中实现用户端口vlan业务管理的方法及***

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1246408A1 (en) * 2001-03-27 2002-10-02 Tellabs Denmark A/S Mapping of data frames from a local area network into a synchronous digital telecommunications system
CN1371202A (zh) * 2002-02-28 2002-09-25 威盛电子股份有限公司 数据包传送方法及应用此方法的网络交换机
CN101697555A (zh) * 2009-11-12 2010-04-21 烽火通信科技股份有限公司 一种vlan id收敛转换的解决方法
CN104104571A (zh) * 2013-04-10 2014-10-15 中兴通讯股份有限公司 实现虚拟局域网域映射与访问控制的方法和装置

Also Published As

Publication number Publication date
CN105530156A (zh) 2016-04-27

Similar Documents

Publication Publication Date Title
US9608833B2 (en) Supporting multiple multicast trees in trill networks
US9806906B2 (en) Flooding packets on a per-virtual-network basis
US7697528B2 (en) Multilink trunking for encapsulated traffic
US9451056B2 (en) Method for mapping packets to network virtualization instances
US9628293B2 (en) Network layer multicasting in trill networks
US8369347B2 (en) Fiber channel over Ethernet and fiber channel switching based on Ethernet switch fabrics
US7646778B2 (en) Support of C-tagged service interface in an IEEE 802.1ah bridge
US8837481B2 (en) Inline packet replication in network devices
US9185035B2 (en) Apparatus and method for processing packet in MPLS-TP network
US20110299533A1 (en) Internal virtual network identifier and internal policy identifier
US20150222543A1 (en) Virtual mac address, mask-based, packet forwarding
WO2017181757A1 (zh) 报文转发方法及装置
WO2009127128A1 (zh) 一种防止以太无源光网络中下行数据洪泛的方法
US20100142537A1 (en) Packet transport layer apparatus
WO2007071153A1 (fr) Procede, systeme de reseau de donnees et noeud de reseau pour transmission de paquets de donnees
US20210392084A1 (en) Transmission Of Packets Over A TSN Aware Network
CN107968749A (zh) 实现QinQ路由终结的方法、交换芯片及交换机
KR20220007742A (ko) Evpn 패킷 포워딩 방법, 시스템, 저장 매체 및 단말기
CN103475559A (zh) 一种根据报文内容对报文进行处理并转发的方法和***
CN103200126B (zh) Xg-pon***流量管理装置及方法
WO2016062035A1 (zh) Onu虚拟局域网标记处理装置、方法及计算机存储介质
US9667539B2 (en) Method and apparatus for providing transport of customer QoS information via PBB networks
US9166819B2 (en) Method and device for realizing flexible QinQ
WO2014166267A1 (zh) 实现虚拟局域网域映射与访问控制的方法和装置
CN104202229A (zh) 一种无源光网络olt设备qinq报文处理方法及***

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/08/2017)

122 Ep: pct application non-entry in european phase

Ref document number: 15853225

Country of ref document: EP

Kind code of ref document: A1