CN102739553B - Identification and processing device for Ethernet data packet - Google Patents

Identification and processing device for Ethernet data packet Download PDF

Info

Publication number
CN102739553B
CN102739553B CN201210252265.1A CN201210252265A CN102739553B CN 102739553 B CN102739553 B CN 102739553B CN 201210252265 A CN201210252265 A CN 201210252265A CN 102739553 B CN102739553 B CN 102739553B
Authority
CN
China
Prior art keywords
ethernet
data
packet
layers
variable
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201210252265.1A
Other languages
Chinese (zh)
Other versions
CN102739553A (en
Inventor
黄元波
杨彦波
邹蕾
钟山
左越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan flying Microelectronics Technology Co., Ltd.
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201210252265.1A priority Critical patent/CN102739553B/en
Publication of CN102739553A publication Critical patent/CN102739553A/en
Application granted granted Critical
Publication of CN102739553B publication Critical patent/CN102739553B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to an identification and processing device for an Ethernet data packet, comprising a data packet identification parsing engine, an Ethernet two-layer packet packaging parsing engine and an Ethernet two-layer packet type field parsing engine; the three engines exist in a pipelined processing manner, and carry out identification and processing on the two-layer packaging of the Ethernet packet; a front engine outputs all variables to a back engine; and the back engine responds to the input variable related to the processing at the current level and outputs the corresponding result. The identification and processing device for the Ethernet data packet not only can identify the traditional Ethernet packaged data packet but also can flexibly expand for identifying various newly defined data packets based on Ethernet two-layer packaging structure at present, and can flexibly provide required characteristic field for subsequent processing.

Description

A kind of identification of Ethernet data bag and treating apparatus
Technical field
The present invention relates to the Ethernet bag identification analytic technique in data communication technology, is a kind of identification and treating apparatus of Ethernet data bag specifically.Espespecially two layers of encapsulation of Ethernet bag (packet) identify and treating apparatus.Described Ethernet data bag refers to the packet that various Ethernet encapsulates, such as: QINQ(also claims Stacked VLAN or Double VLAN) encapsulation, multi-VLAN (VLAN) mark encapsulation Ethernet bag etc.
Background technology
Various PDU(upper layer protocol data unit) there is typical package form below when being carried on Ethernet:
(1) Ethernet II(or DIX2.0)
Ethernet II packet format is the ethernet standard packet format formulated in nineteen eighty-two by Xerox and DEC, Intel, as shown in Figure 3.Wherein front 12 bytes are respectively mark and send " source node MAC Address " field of packet and " destination node MAC Address " field of reception packet.Ensuing 2 bytes are " ethernet type territory " fields, and the upper layer data type entrained by identification data packet, such as, 0x0800 represents IPv4 protocol data, and 0x8dDD represents IPv6 protocol data etc.4 bytes " bag effect sequence " field (Frame Check Sequence after " data " field of random length, FCS), 32 CRC cyclic redundancy effects are adopted to carry out effect to from " destination node MAC Address " field to the data of " data " field.
The Ethernet bag minimum length of Ethernet II type is 64 bytes (6+6+2+46+4), and maximum length is 1518 bytes (6+6+2+1500+4).
(2)Ethernet 802.3 raw
Ethernet 802.3 raw packet format is the dedicated ethernet standard packet format that Novell announced in nineteen eighty-three, as shown in Figure 4." ethernet type territory " field in Ethernet II type packet format is replaced with " length " field by Ethernet 802.3 raw type packet format, represent all field lengths arrived thereafter before " bag effect sequence " field, span is 46 ~ 1500.After " length " field, 2 bytes before " data " field are fixed as 0xFFFF, are Novell ethernet type packets for identifying this bag.
(3)Ethernet 802.3 SAP
Ethernet 802.3 SAP packet format is the SAP version ethernet packet format of the Ethernet802.3 that IEEE announced in 1985, as shown in Figure 5.0xFFFF in Ethernet 802.3 raw packet format is replaced with " source service access point " field (DSAP) of 1 byte and " destination service access point " field (SSAP) of 1 byte by Ethernet 802.3 SAP packet format, add " control " field of 1 byte, these 3 bytes constitute 802.2 logic link controls (LLC) stem simultaneously.DSAP and SSAP is for identifying the upper layer data type entrained by Ethernet bag." control " field is generally set as 0x03.
(4)Ethernet 802.3 SNAP
Ethernet 802.3 SNAP packet format, that is: Ethernet 802.3 SNAP PDU is packaged in ethernet packet format, as shown in Figure 6.DSAP and SSAP in Ethernet 802.3 SAP packet format is fixed as 0xAA by Ethernet 802.3 SNAP packet format, Control is fixed as 0x03, and add the PID field of 5 bytes, in RFC_1042 agreement, PID [39:16] is defined as 0X000000, and PID [15:0] is defined as " ethernet type " field (the EtherType territory with in Ethernet II) of 2 bytes.
The recognition methods of Ethernet data bag can carry out the identification of two layers of feature field, three layers of IP and four layers of TCP/UDP feature field according to above-mentioned specification, and characteristic feature field can be extracted be supplied to follow-up ACL(ACL) use or two layers, L3 Switching function uses.But along with the development of ethernet technology, the new data packet format at present based on Ethernet two layers encapsulation constantly occurs, below introduces the encapsulation technology that several main VLAN identifies:
(1) IEEE802.1Q and QINQ encapsulation
IEEE802.1Q(Virtual Bridged Local Area Networks) agreement, LAN is logically divided into multiple VLAN(VLAN), each VLAN adopts one No. VLAN_ID to carry out unique identification, and using vlan information as Tag(label) be inserted in basic Ethernet pack arrangement, its encapsulation format is (for Ethernet II type ethernet packet format) as shown in Figure 7.VLAN-Tag includes 4 bytes, and front 2 byte TPID are fixed as 0x8100, is be a kind of ethernet type of 802.1Q definition specially; In rear 2 bytes, Priority(3bit) represent the forwarding priority (defining in IEEE802.1p) of packet; VID(12bit) VLAN belonging to packet is represented.
It is nested that IEEE802.1ad agreement achieves VLAN on the basis of IEEE802.1Q, i.e. QinQ technology, and the encapsulation format (data packet format of band S-Tag, C-Tag) of packet as shown in Figure 7.According to the definition of IEEE802.1ad agreement, define the structure of the double layer VLAN of service provider VLAN (S-VLAN) and customer VLAN (C-VLAN), S-VLAN corresponds to service provider VLAN label (S-TAG), C-VLAN corresponds to customer VLAN tags (C-TAG), service provider uses S-VLAN, and client uses C-VLAN.Define the framework of service provider's bridge (Provider Bridge) and client bridge (Customer Bridge), client bridge is only responsive to C-VLAN, and service provider's bridge is only responsive to S-VLAN.
(2) multilayer VLAN treatment technology
Although in the definition of IEEE802.1ad agreement, define the structure of the double layer VLAN of service provider VLAN (S-VLAN) and customer VLAN (C-VLAN), but at some concrete service bearers with in realizing, also need to add extra mark in the packet and the information such as the logical links of bearer service in network are marked.Increase manageability and the QOS(Quality of Service of network).
Such as: the GPON(Gigabit-Capable PON current) in network and XGPON (10-Gigabit-capable passive optical networks) network.Up-downlink direction, Ethernet bag is directly encapsulated in GEM bag payload and carries.Before carrying out GEM encapsulation, lead code and SFD byte are dropped.Each Ethernet bag should be mapped to during an independent GEM bag or multiple GEM wrap, and when carrying out GEM and mapping, utilizes PORT_ID to carry out service identification.The mapping that Ethernet service wraps to GEM as shown in Figure 8.
At OLT(optical line terminal) on Ethernet bag is designated specific business and the problem being mapped to corresponding GEM port (PORT_ID) to solve.Often wrap again extra interpolation LLID (L-tag) at original Ethernet data.
Generally we take the data structure of VLAN field to LLID (L-tag), and figure is see Fig. 9 in definition.In order to systemic-function expansion and support more LLID, generally can insert two L_TAG at packet, can called after L0_TAG, L1_TAG.
At Ethernet service port, need the bag of reception and transmit band L0_TAG, L1_TAG, S-TAG, C_TAG tri-layers of VLAN mark and process according to different VLAN features.So abundant bag recognition capability must be possessed when carrying out the identification of Ethernet bag.
As can be seen from the Ethernet encapsulating structure of above-mentioned different technologies, the scene used along with ethernet port is different, two layers of encapsulation format of input packet there are differences, the number difference of VLAN mark, the difficulty all making packet resolve and complexity strengthen, and three layers of IP frame also has a variety of change in input packet side-play amount.
Therefore, in order to meet the demand of various application scenarios, be necessary the recognition device designing a kind of general ethernet frame, by the also unified recognition methods of this device specification.
Summary of the invention
For the defect existed in prior art, the object of the present invention is to provide a kind of identification and treating apparatus of Ethernet data bag, the packet of traditional Ethernet encapsulation can not only be identified, and can flexible expansion, for identifying the packet based on Ethernet two layers of encapsulating structure of various new definition at present, and required feature field can be proposed neatly carry out follow-up process, be a kind of recognition methods of general Ethernet data bag.
For reaching above object, the technical scheme that the present invention takes is:
A kind of identification of Ethernet data bag and treating apparatus, it is characterized in that, comprise: package identification analytics engine, Ethernet two layers encapsulating dress analytics engine and Ethernet two layers of Packet type field analytics engine, these three engines exist in the mode of stream treatment and identify two layers of encapsulation of Ethernet bag and process, prime engine exports whole variable to rear class engine, and rear class engine responds the input variable relevant with corresponding levels process and exports corresponding result.
On the basis of technique scheme, described package identification analytics engine comprises: Ethernet data bag input port, Ethernet data bag inputs from this input port, and carries out the dissection process of data frame identification, exports following variable to Ethernet two layers encapsulating dress analytics engine:
The nybble data of L0_Tag [31:0]: L0_Tag, first LLID variable,
The nybble data of L1_Tag [31:0]: L1_Tag, second LLID variable,
The nybble data of S_Tag [31:0]: S_Tag, service provider VLAN label variable,
The nybble data of C_Tag [31:0]: C_Tag, customer VLAN tags variable,
Tag_Code [3:0]: this variable is used to refer to the identification-state of input packet.
On the basis of technique scheme, Ethernet two layers encapsulating dress analytics engine is according to the variable Tag_Code [3:0] received, the side-play amount of the payload field beyond the mark synchronously deriving Frame, and complete the identification to Ethernet data bag, be divided into Four types:
The packet that Ethernet II encapsulates,
The packet that Ethernet 802.3 raw encapsulates,
The packet that Ethernet 802.3 SAP encapsulates,
The packet that Ethernet 802.3 SNAP encapsulates,
Then, Ethernet two layers encapsulating dress analytics engine exports following variable to Ethernet two layers of Packet type field analytics engine:
L2_package_data [39:0]: data relevant with packaging information in designation data frame,
Package_type [1:0]: indicative input bag is any of above-mentioned four kinds of Packet type,
L2_OFFSET_DATA [4:0]: the side-play amount of first data field in whole Frame in designation data frame beyond MAC_DA, MAC_SA, this side-play amount is different according to the difference of VLAN number.
On the basis of technique scheme, Ethernet two layers of Packet type field analytics engine receive the variable of Ethernet two layers encapsulating dress analytics engine output and the variable of package identification analytics engine output, add up to reception eight variablees, then according to the variable received, extract three layers of relevant information and port to after the whether enable control information of follow-up engine, processed in the processing engine of correspondence by Packet Generation, the processing engine of follow-up correspondence comprises:
IPV4 processing engine,
IPV6 processing engine,
Ethernet two layers of frame processing engine.
On the basis of technique scheme, Ethernet two layers of Packet type field analytics engine can according to analysis result, when the packet of correspondence is IPV4 or IPV6 packet, export L3_OFFSET_DATA [4:0]: indicate three layers of field relative to the side-play amount of two layers of field
Follow-up IPV4 processing engine, IPV6 processing engine can easily utilize L2_OFFSET_DATA [4:0] variable and L3_OFFSET_DATA [4:0] variable to determine IP bag accurate side-play amount in the packet, carry out parsing and the process of IP field.
The identification of Ethernet data bag of the present invention and treating apparatus, for solving identification and the process problem of various Ethernet bag encapsulation format, a kind of two layers of encapsulation identification and treating apparatus of novel Ethernet bag, it makes the intermediate equipment being positioned at backbone network, be positioned at the interface equipment of network edge, and some service adaptation interfaces correctly can both identify the encapsulation format of different Ethernet two layers, extract two layers of feature field in required packet, and correctly can provide the payload form of packet more than two layers, thus make intermediate equipment, interface equipment or service adaptation interface can successfully carry different business, the versatility of great lifting means and interface and compatibility, effectively meet the demand of operator network.
Accompanying drawing explanation
The present invention has following accompanying drawing:
Two layers of encapsulation recognition device schematic diagram of Fig. 1 Ethernet bag,
Fig. 2 package identification process of analysis figure,
Fig. 3 Ethernet II packet format,
Fig. 4 Ethernet 802.3 raw packet format,
Fig. 5 Ethernet 802.3 SAP packet format,
Fig. 6 Ethernet 802.3 SNAP packet format,
Fig. 7 IEEE 802.1Q and QINQ encapsulates,
The mapping that Fig. 8 Ethernet service wraps to GEM,
Fig. 9 L_VLAN identifies the field definition of L_TAG.
Detailed description of the invention
Below in conjunction with accompanying drawing, the present invention is described in further detail.
As shown in Figure 1, the identification of Ethernet data bag of the present invention and treating apparatus, comprise: package identification analytics engine, Ethernet two layers encapsulating dress analytics engine and Ethernet two layers of Packet type field analytics engine, these three engines exist in the mode of stream treatment and identify two layers of encapsulation of Ethernet bag and process, prime engine exports whole variable to rear class engine, and rear class engine responds the input variable relevant with corresponding levels process and exports corresponding result.
On the basis of technique scheme, described package identification analytics engine comprises: Ethernet data bag input port, Ethernet data bag inputs from this input port, and carries out the dissection process of data frame identification, exports following variable to Ethernet two layers encapsulating dress analytics engine:
The nybble data of L0_Tag [31:0]: L0_Tag, first LLID variable,
The nybble data of L1_Tag [31:0]: L1_Tag, second LLID variable,
The nybble data of S_Tag [31:0]: S_Tag, service provider VLAN label variable,
The nybble data of C_Tag [31:0]: C_Tag, customer VLAN tags variable,
Tag_Code [3:0]: this variable is used to refer to the identification-state of input packet.
On the basis of technique scheme, described Tag_Code [3:0] information coding is defined as follows table 3.1:
The definition of table 3.1Tag_Code [3:0] information coding
On the basis of technique scheme, Ethernet two layers encapsulating dress analytics engine is according to the variable Tag_Code [3:0] received, the side-play amount of the payload field beyond the mark synchronously deriving Frame, and complete the identification to Ethernet data bag, be divided into Four types:
The packet that Ethernet II encapsulates,
The packet that Ethernet 802.3 raw encapsulates,
The packet that Ethernet 802.3 SAP encapsulates,
The packet that Ethernet 802.3 SNAP encapsulates,
Then, Ethernet two layers encapsulating dress analytics engine exports following variable further to Ethernet two layers of Packet type field analytics engine:
L2_package_data [39:0]: data relevant with packaging information in designation data frame, the concrete description defined see table 3.3,
Package_type [1:0]: indicative input bag is any of above-mentioned four kinds of Packet type, specific coding defines the description see table 3.3,
L2OFFSET_DATA [4:0]: the side-play amount of first data field in whole Frame in designation data frame beyond MAC_DA, MAC_SA, this side-play amount is different according to the difference of VLAN number.
On the basis of technique scheme, the corresponding relation that described L2_OFFSET_DATA [4:0] and Tag_Code [3:0] encodes is as following table 3.2:
The corresponding relation of table 3.2L2_OFFSET_DATA and Tag_Code [3:0]
Tag_Code [3:0] encodes L2_OFFSET_DATA [4:0] encodes
0 13
1,2,4,8 17
3,5,6,9,10,12,14 21
7,11,13 25
15 29
On the basis of technique scheme, the definition of described L2_package_data [39:0] and Package_type [1:0] and corresponding relation are as following table 3.3:
The definition of table 3.3L2_package_data [39:0] and Package_type [1:0] and corresponding relation
On the basis of technique scheme, Ethernet two layers of Packet type field analytics engine receive the variable of Ethernet two layers encapsulating dress analytics engine output and the variable of package identification analytics engine output, add up to reception eight variablees, then according to the variable received, extract three layers of relevant information and port to after the whether enable control information of follow-up engine, processed in the processing engine of correspondence by Packet Generation, the processing engine of follow-up correspondence comprises:
IPV4 processing engine,
IPV6 processing engine,
Ethernet two layers of frame processing engine.
Ethernet two layers of frame processing engine are responsible for variables L 0_Tag [31:0], L1_Tag [31:0], S_Tag [31:0], and C_Tag [31:0] field processes, and identifies the content of each field and determines the process behavior that each field is corresponding; General behavior can comprise adds mark, deletes mark, replaces mark etc.;
IPV4 processing engine and IPV6 processing engine carry out the field process of IP layer respectively to the packet of IPV4 and IPV6.
Ethernet two layers of Packet type field analytics engine according to analysis result, when the packet of correspondence is IPV4 or IPV6 packet, can export L3_OFFSET_DATA [4:0]: indicate three layers of field relative to the side-play amount of two layers of field,
Follow-up IPV4 processing engine, IPV6 processing engine can easily utilize L2_OFFSET_DATA [4:0] variable and L3_OFFSET_DATA [4:0] variable to determine IP bag accurate side-play amount in the packet, carry out parsing and the process of IP field.
Above-mentioned Ethernet two layers of frame processing engine, IPV4 processing engine, the operation principle that IPV6 processing engine is concrete and device for carrying out said do not belong to this patent range of definition, therefore are no longer described in further detail.
The identification of Ethernet data bag of the present invention and the concrete working method for the treatment of apparatus as follows:
First package identification analytics engine resolves the mark of input packet.Concrete steps are as follows:
The port attribute Port_Mode [1:0] of the input port of setting data bag identification (RNC-ID) analytic engine and Ethernet bag VLAN identifies recognition template, and the input port shown in Fig. 1 refers in particular to the equipment input port that can receive ethernet data frame.
For different business or application model, equipment input port can work in different modes, receives the packet of different Ethernet encapsulated type.In the present invention, be equipment input port setting Port_Mode [1:0] variable, for setting the port attribute of this equipment input port.
The corresponding Three models of Port_Mode [1:0] variable:
Pattern 0:Port_Mode [1:0]=0, possesses the ability of the packet of resolving 802.1q encapsulation;
Pattern 1:Port_Mode [1:0]=1, possesses the analytic ability of pattern 0, can resolve the packet that two layers of Vlan mark (Qinq) encapsulate simultaneously;
Pattern 2:Port_Mode [1:0]=2, possesses the analytic ability of pattern 1, and can resolve multilayer Vlan mark, maximum analytic ability is four layers of Vlan simultaneously;
Under above 3 kinds of patterns, port can resolve the packet of traditional Ethernet encapsulation format, and the Packet analyzing ability of these 3 kinds of patterns strengthens successively, namely possesses the port of resolving QINQ encapsulated data packet, the sure packet parsing 802.1q encapsulation.
The setting of port attribute, relevant with the form of the port bearer service, according to its network attribute, different patterns can be selected.
If local terminal mouthpiece is used for the service adaptation port of XGPON network, then can select the pattern that is operated in 2, if the service needed of the port carrying supports the packet of QINQ, can selection mode 1, if be general terminal client port, selectable modes 0.
Ethernet bag VLAN identifies recognition template and comprises following database configuration:
Tpid_Data [3:0]: the TPID tag protocol identifier field of this optimum configurations 4 VLAN.Each TPID_DATA field 16 bit bit wide.In specifically arranging, this parameter must be greater than 0X0800.And can not overlap with traditional ethernet type (Ethertype) field.The definition of four TPID_DATA can be set as identical value.
To Tpid_Data [3:0] as given a definition:
Tpid_Data [0]: bit wide 16 bit, is defined as outermost VLAN field, corresponding to L0TAG.
Tpid_Data [1]: bit wide 16 bit, is defined as the VLAN field of second, corresponding to L1TAG.
Tpid_Data [2]: bit wide 16 bit, is defined as the VLAN field of the 3rd, corresponding to S TAG.
Tpid_Data [3]: bit wide 16 bit, is defined as the VLAN field of the 4th, corresponding to C TAG.
Package identification analytics engine workflow diagram as shown in Figure 2, in fig. 2:
Byte_1314: bit wide 16 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 13,14 bytes.
Byte_1718: bit wide 16 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 17,18 bytes.
Byte_2122: bit wide 16 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 21,22 bytes.
Byte_2526: bit wide 16 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 25,26 bytes.
When an Ethernet data bag inputs from port, according to Port_Mode [1:0] variable of port, carry out packet parsing, concrete steps are as follows:
If Port_Mode [1:0] equals 0, extract the 13rd of input packet the, 14 byte content Byte_1314, whether equal TPID_DATA [3], if not etc., then Tag_Code [3:0] assignment is 0.If equal, Tag_Code [3:0] assignment is 8.
Under Port_Mode [1:0] equals the prerequisite of 1:
If Byte_1314 equals TPID_DATA [3], Tag [3:0] assignment is 8.
If Byte_1314 is not equal to TPID_DATA [2], Byte_1314 is not equal to TPID_DATA [3], and Tag_Code [3:0] assignment is 0.
If Byte_1314 equals TPID_DATA [2], then continue 17,18 bytes extracting input packet, judge whether to equal TPID_DATA [3], if equal, then Tag_Code [3:0] assignment is 12.If etc., Tag_Code [3:0] assignment is not 4.
If Port_Mode [1:0] equals 2, carry out following condition judgment:
If Byte_1314 equal tpid_data [0] and Byte_1718 equal tpid_data [1] and Byte_2122 equal tpid_data [2] and
Byte_2324 equals tpid_data [3], then Tag_Code [3:0] assignment is 15.
If Byte_1314 equal tpid_data [0] and Byte_1718 equal tpid_data [1] and Byte_2122 equal tpid_data [2] and
Byte_2324 is not equal to tpid_data [3], and Tag_Code [3:0] assignment is 7.
If Byte_1314 equals tpid_data [0] and Byte_1718 equals tpid_data [1] and Byte_2122 equals tpid_data [3], Tag_Code [3:0] assignment is 11.
The estimate of situation of other branches of Fig. 2 is the same with above-mentioned, can carry out similar derivation, no longer describe in detail.
After completing above-mentioned derivation, obtain variable Tag_Code [3:0], according to Tag_Code [3:0], derive L0_Tag [31:0] in Ethernet data bag, L1_Tag [31:0], S_Tag [31:0], C_Tag [31:0] four variablees side-play amount in a data frame, carries out effective field extraction.Concrete side-play amount definition, see table 3.4.
In table 3.4,
Byte13TO16: bit wide 32 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 13 to 16 bytes.
Byte17TO20: bit wide 32 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 17 to 20 bytes.
Byte21TO24: bit wide 32 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 21 to 24 bytes.
Byte25TO28: bit wide 32 bit, be defined as input packet and calculate from packet header first character joint, side-play amount is the content of 25 to 28 bytes.
Table 3.4 marking variable assignment definition list
The variable that the work of package identification analytics engine exports all delivers to Ethernet two layers encapsulating dress analytics engine.Partial Variable is applied at Ethernet two layers encapsulating dress analytics engine, and Partial Variable does not use, and is sent by former state.
The job step of Ethernet two layers encapsulating dress analytics engine is as follows:
Obtain the identification information Tag_Code [3:0] of Frame from package identification analytics engine, read a L2_OFFEST database according to this information, the content of this database is see the definition of table 3.2.Extract the offset information L2_OFFSET_DATA of data packet length and type field, extract data packet length and type field (Ethertype/Length) in the position that packet is corresponding, carry out the parsing of two layers of information in accordance with the following steps.
Relatively the size of Ethertype/Length byte and 0x0600, if be greater than 0x0600, then thinks ethernet type territory, and this packet is the packet that Ethernet II encapsulates;
If be less than 0x0600, and byte is following closely 0xAAAA_0300_0000, then think that this packet is the packet (for 4 kinds that introduce traditional Ethernet encapsulation format, Ethernet II and SNAP applies more at present) of SNAP encapsulation above.Here, packet can be identified as SNAP encapsulation.
If be less than 0x0600, and the byte after following closely is 0XFFFF, being then identified as this packet is the packet that Ethernet 802.3 raw encapsulates.
Otherwise being identified as this packet is the packet that Ethernet 802.3 SAP encapsulates.
After Ethernet two layers encapsulating dress analytics engine completes above-mentioned steps, export L2_package_data [39:0], Package_type [1:0] and L2_OFFSET_DATA [4:0] variable to Ethernet two layers of Packet type field analytics engine.
The job step of Ethernet two layers of Packet type field analytics engine is as follows:
First according to input Package_type [1:0], L2_Package_Data [39:0] variable carry out a degree of depth be 128 list item search, that mainly searches list item L2_Package_Entry searches territory, obtains the resultant field in matched and searched territory.
The structure of table 3.5L2_Package_Entry is defined as follows:
After Ethernet two layers of Packet type field analytics engine complete matched and searched, export following variable:
IPV4_ENGINERER_EN:IPV4 processing engine activates enable, and this variable is high, and indicative input bag has been identified as an IPV4 frame, needs to activate IPV4 processing engine and processes.
IPV6_ENGINERER_EN:IPV6 processing engine activates enable, and this variable is high, and indicative input bag has been identified as an IPV6 frame, needs to activate IPV6 processing engine and processes.
L2_ENGINERER_En: Ethernet two layers of frame processing engine activate enable.This variable is high, and indicative input bag has been identified as two layers of frame, needs activation two layers of processing engine.
L3_OFFSET_DATA [4:0]: indicate three layers of field relative to the side-play amount of two layers of field.This field can be carried out derivation according to Package_type variable and be obtained.Such as
Package_type equals 0, and be the packet that Ethernet II encapsulates, L3_OFFSET_DATA [4:0] assignment is 2.Indicate three layers of field immediately following after second byte of two layers of field.
Package_type equals 1, is the packet that Ethernet 802.3 SNAP encapsulates,
L3_OFFSET_DATA [4:0] assignment is 5, indicates three layers of field immediately following after second byte of two layers of field.
Input packet is by above-mentioned three large engines, and whole device exports following variable and processes to follow-up data packet processing engine:
Ipv4_Enginerer_En:IPV4 processing engine activates enable.
Ipv6_Enginerer_En:IPV6 processing engine activates enable.
L2_ENGINERER_En: Ethernet two layers of frame processing engine activate enable.
Package_type [1:0]: the type of indicative input bag.Specific coding definition is see the description of table 3.3.
Tag_Code [3:0]: the identification-state of indicative input bag.Table 3.1 is participated in specific coding definition.
The nybble data of L0_Tag [31:0]: L0_Tag.
The nybble data of L1_Tag [31:0]: L1_Tag.
The nybble data of S_Tag [31:0]: S_Tag.
The nybble data of C_Tag [31:0]: C_Tag.
L2_Package_Data [39:0]: concrete signal definition is see table 3.3.
L3_OFFSET_DATA [4:0]: indicate three layers of field relative to the side-play amount of two layers of field.
L2_OFFSET_DATA [4:0]: the side-play amount of instruction two layers of field.
According to above-mentioned field, follow-up can very easily with ethernet ip V4 processing engine, or IPV6 processing engine, Ethernet two layers of frame processing engine carry out interface.Complete the depth recognition of packet, resolve and process.
According to this device, for the various forms of Ethernet data bags of input, only by engine configuration database corresponding to this device of amendment, all two layers of parsings having packet under application scenarios just can be completed, and export the side-play amount of two layers of field, the side-play amount of three layers of field.
Follow-up engine can carry out the extraction of deep analysis and critical field automatically according to side-play amount.
Be below a specific embodiment:
In the HGU home gateway type unit of a FTTH application scenarios, there is the first line of a couplet port of a uni port (User Network Interface) and NNI (SNI).
For the ethernet frame of uni port ethernet port input, need to carry out following identifying processing:
1) can identify and receive the packet of 802.1q.Four kinds of Ethernet net encapsulation format can be supported.
2) to the DHCPV4 in the packet of input, DHCPV6, PPPOE agreement, can carry out deep analysis.
3) need to possess IPV4, the dissection process ability of IPV6 frame.
For above-mentioned application scenarios, can separate to arrange as follows and implement:
For the ethernet frame inputted from uni port ethernet port, first determine VLAN recognition capability, carry out following configuration:
PORT_MODE<=00, supports the identification of 802.1q encapsulated data packet.
The mark of Tpid_DATA [0] <=0X8100: configuration 802.1q encapsulation.
L2_offset_data such as table 3.6 configures, and accurately can identify the side-play amount of two layers of field.
Table 3.6L2_offset_data side-play amount allocation list
Tag_Code [3:0] encodes L2_OFFSET_DATA [4:0] encodes
0 13
1,2,4,8 17
3,5,6,9,10,12,14 21
7,11,13 25
15 29
To the following entry of L2_Package_ENTRY table definition:
Entry 1: identify PPPOE Discovery bag, PPPOE frame is that typical EthernetII encapsulates, and ETHETTYPE field is 0x8863.
The then following configuration of L2_Package_ENTRY table:
Package_type[1:0]<=“0001”,
Package_type_CODE_Mask [3:0] <=" 0000 ", does not carry out mask
L2_Package_Data[39:0]<=0X0000008863,
L2_Package_Data [39:0] _ Mask<=0X0000000000, does not carry out mask.
Ipv4_Enginerer_En<=0, is not IP frame, does not start follow-up engine.
Ipv6_Enginerer_En<=0, is not IP frame, does not start follow-up engine.
L2_Enginerer_En<=1, enable Ethernet two layers of frame processing engine.
After completing above-mentioned configuration, when the ethernet frame of from then on port input untag and CTAG, can be accurately identified and be 13, CTAG packet by the side-play amount untag packet of two layers of field be 17.Pass to Ethernet two layers of Packet type field analytics engine.
Ethernet two layers of Packet type field analytics engine can identify ETHETTYPE field according to configuration and are 0x8863 frame and activate follow-up two layers of field processing engine.
For PPPOE Session Packet (PPPOE session packet), ETHETTYPE field is 0x8864.Can be configured in increase entry 2 in then L2_Package_ENTRY table and identify.
Configure as follows:
Entry 2: identify PPPOE Session Packet, ETHETTYPE field is the 0x8864. then following configuration of L2_Package_ENTRY table:
Package_type[1:0]<=“0001”,
L2_Package_Data[39:0]<=0X0000008863,
L2_Package_Data [39:0] _ Mask<=0X0000000000, does not carry out mask.
Ipv4_Enginerer_En<=0, is not IP frame, does not start follow-up engine.
Ipv6_Enginerer_En<=0, is not IP frame, does not start follow-up engine.
L3_OFFSET_DATA<=0, be not IP frame, L3_OFFSET_DATA variable is invalid.
L2_Enginerer_En<=1, enable Ethernet two layers of frame processing engine.
For the disposal ability activating IPV4 and IPV6, need configuring corresponding entry respectively in L2_Package_ENTRY table.
For IPV4 bag, configure as follows in the entry 3 of L2_Package_ENTRY table:
Package_type[1:0]<=“0011”,
L2_Package_Data[39:0]<=0X0000000800,
L2_Package_Data [39:0] _ Mask<=0X0000000000, does not carry out mask.
Ipv4_Enginerer_En<=1 is IPV4 frame, starts follow-up engine.
Ipv6_Enginerer_En<=0, is not IPV6 frame, does not start follow-up engine.
For IPV6 bag, configure as follows in the entry 4 of L2_Package_ENTRY table:
Package_type[1:0]<=“0011”,
L2_Package_Data[39:0]<=0X00000086DD,
L2_Package_Data [39:0] _ Mask<=0X0000000000, does not carry out mask.
Ipv4_Enginerer_En<=0, is not IPV4 frame, does not start follow-up engine.
Ipv6_Enginerer_En<=1 is IPV6 frame, starts follow-up engine.
After completing above configuration, this engine carries out two layers automatically, and the identification of three layer data frames also activates the work for the treatment of that corresponding engine carries out being correlated with.
The content be not described in detail in this description belongs to the known prior art of professional and technical personnel in the field.

Claims (3)

1. the identification of an Ethernet data bag and treating apparatus, it is characterized in that, comprise: package identification analytics engine, Ethernet two layers encapsulating dress analytics engine and Ethernet two layers of Packet type field analytics engine, these three engines exist in the mode of stream treatment and identify two layers of encapsulation of Ethernet bag and process, prime engine exports whole variable to rear class engine, and rear class engine responds the input variable relevant with corresponding levels process and exports corresponding result;
Ethernet data bag input port, Ethernet data bag inputs from this input port, and carries out the dissection process of data frame identification, exports following variable to Ethernet two layers encapsulating dress analytics engine:
The nybble data of L0_Tag [31:0]: L0_Tag, first LLID variable,
The nybble data of L1_Tag [31:0]: L1_Tag, second LLID variable,
The nybble data of S_Tag [31:0]: S_Tag, service provider VLAN label variable,
The nybble data of C_Tag [31:0]: C_Tag, customer VLAN tags variable,
Tag_Code [3:0]: this variable is used to refer to the identification-state of input packet;
Ethernet two layers encapsulating dress analytics engine is according to the variable Tag_Code [3:0] received, and the side-play amount of the payload field beyond the mark synchronously deriving Frame, and complete the identification to Ethernet data bag, is divided into Four types:
The packet that Ethernet II encapsulates,
The packet that Ethernet 802.3raw encapsulates,
The packet that Ethernet 802.3SAP encapsulates,
The packet that Ethernet 802.3SNAP encapsulates,
Then, Ethernet two layers encapsulating dress analytics engine exports following variable to Ethernet two layers of Packet type field analytics engine:
L2_package_data [39:0]: data relevant with packaging information in designation data frame,
Package_type [1:0]: indicative input bag is any of above-mentioned four kinds of Packet type,
L2_OFFSET_DATA [4:0]: the side-play amount of first data field in whole Frame in designation data frame beyond MAC_DA, MAC_SA, this side-play amount is different according to the difference of VLAN number;
Ethernet two layers of Packet type field analytics engine receive the variable of Ethernet two layers encapsulating dress analytics engine output and the variable of package identification analytics engine output, add up to reception eight variablees, then according to the variable received, extract three layers of relevant information and port to after the whether enable control information of follow-up engine, Packet Generation is processed in the processing engine of correspondence.
2. the identification of Ethernet data bag as claimed in claim 1 and treating apparatus, is characterized in that: the processing engine of follow-up correspondence comprises:
IPV4 processing engine,
IPV6 processing engine,
Ethernet two layers of frame processing engine.
3. the identification of Ethernet data bag as claimed in claim 2 and treating apparatus, it is characterized in that: Ethernet two layers of Packet type field analytics engine can according to analysis result, when the packet of correspondence is IPV4 or IPV6 packet, export L3_OFFSET_DATA [4:0]: indicate three layers of field relative to the side-play amount of two layers of field
Follow-up IPV4 processing engine, IPV6 processing engine can easily utilize L2_OFFSET_DATA [4:0] variable and L3_OFFSET_DATA [4:0] variable to determine IP bag accurate side-play amount in the packet, carry out parsing and the process of IP field.
CN201210252265.1A 2012-07-20 2012-07-20 Identification and processing device for Ethernet data packet Active CN102739553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210252265.1A CN102739553B (en) 2012-07-20 2012-07-20 Identification and processing device for Ethernet data packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210252265.1A CN102739553B (en) 2012-07-20 2012-07-20 Identification and processing device for Ethernet data packet

Publications (2)

Publication Number Publication Date
CN102739553A CN102739553A (en) 2012-10-17
CN102739553B true CN102739553B (en) 2015-04-29

Family

ID=46994365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210252265.1A Active CN102739553B (en) 2012-07-20 2012-07-20 Identification and processing device for Ethernet data packet

Country Status (1)

Country Link
CN (1) CN102739553B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105282114B (en) * 2014-07-18 2020-07-24 北京新岸线移动多媒体技术有限公司 Data frame transmission method, sending device and receiving device
US9961170B2 (en) * 2014-11-25 2018-05-01 Qualcomm Incorporated Ethertype packet discrimination data type
CN104506433B (en) * 2014-12-30 2018-07-06 盛科网络(苏州)有限公司 A kind of method and apparatus that PTP messages are identified in MPLS network
CN106549817A (en) * 2015-09-21 2017-03-29 深圳市中兴微电子技术有限公司 Packet identification method and device
CN107104737B (en) * 2017-03-01 2019-06-14 西安微电子技术研究所 A kind of node device port expansion system and method based on optical fiber interconnections
CN108337192B (en) * 2017-12-28 2021-02-23 华为技术有限公司 Message communication method and device in cloud data center
CN110798288B (en) * 2019-01-28 2021-01-15 通号城市轨道交通技术有限公司 Redundant communication method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585379A (en) * 2004-05-25 2005-02-23 华中科技大学 Rapid analyzing method for data pack
CN101958902A (en) * 2010-09-30 2011-01-26 北京锐安科技有限公司 Method and device for resolving network data packet
CN102195977A (en) * 2011-04-13 2011-09-21 北京恒光创新科技股份有限公司 Network protocol identification method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080080511A1 (en) * 2006-09-28 2008-04-03 Jian-Guo Chen Buffer cluster structure and arbiter scheme for multi-port upper-layer network processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585379A (en) * 2004-05-25 2005-02-23 华中科技大学 Rapid analyzing method for data pack
CN101958902A (en) * 2010-09-30 2011-01-26 北京锐安科技有限公司 Method and device for resolving network data packet
CN102195977A (en) * 2011-04-13 2011-09-21 北京恒光创新科技股份有限公司 Network protocol identification method and device

Also Published As

Publication number Publication date
CN102739553A (en) 2012-10-17

Similar Documents

Publication Publication Date Title
CN102739553B (en) Identification and processing device for Ethernet data packet
US20070098006A1 (en) Multilink trunking for encapsulated traffic
CN104092595B (en) Message processing method and device in virtualization system based on 802.1BR
CN108632098B (en) Flow classifier, service routing trigger, message processing method and system
US8144715B2 (en) Method and apparatus for interworking VPLS and ethernet networks
US8102876B2 (en) Client/server adaptation scheme for communications traffic
CN105515992B (en) Flow entry processing method and processing device in VXLAN network
CN101867523B (en) PON system middle width strip business collocation method and device
CN101316260B (en) Packaging conversion method and packaging conversion equipment
CN100555999C (en) A kind of method and apparatus of realizing edge-to-edge pseudo-line simulation
CN104010049A (en) Ethernet IP message packaging method based on SDN and network isolation and DHCP implementing method based on SDN
CN103973825B (en) Method, node device and the sending method of MAC Address accessibility are noticed in stacking network
CN101132365B (en) Message bypassed transmission method
CN106972946A (en) WiFi ONU automatic configuration WAN method and application
CN106330499A (en) Time division multiplexing data transmission method and device, as well as network-side edge devices
WO2012009893A1 (en) Flow based processing method and system in virtual local area network
CN106921437A (en) A kind of method and apparatus that virtual access node is set up in optical access network
WO2012095040A2 (en) Method for transmitting data in passive optical network, user-side equipment, and system
CN101325598A (en) Method for encapsulating data of transmission equipment receiving side and transmitting side as well as synchronous digital system
CN103107934A (en) Message processing control method and device
CN102857400B (en) The method for building up of broadcast domain and device in a kind of Layer 2 virtual private network
CN102325087B (en) Realize the method and system of Vlan QinQ
CN106302166A (en) A kind of data transmission method and device
CN102045607B (en) Method for enhancing QoS (Quality of Service) and VLAN (Virtual Local Area Network) processing capability in EPON (Ethernet Passive Optical Network) system
CN103457824A (en) Message processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20170626

Address after: 430074, Hubei Wuhan East Lake Development Zone, Kanto Industrial Park, beacon Road, optical communications building, industrial building, two floor

Patentee after: Wuhan flying Microelectronics Technology Co., Ltd.

Address before: China Science and Technology Park Dongxin road East Lake Development Zone 430074 Hubei Province, Wuhan City, No. 5

Patentee before: Fenghuo Communication Science &. Technology Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170803

Address after: 430000 East Lake high tech Development Zone, Hubei Province, No. 6, No., high and new technology development zone, No. four

Co-patentee after: Wuhan flying Microelectronics Technology Co., Ltd.

Patentee after: Fenghuo Communication Science &. Technology Co., Ltd.

Address before: 430074, Hubei Wuhan East Lake Development Zone, Kanto Industrial Park, beacon Road, optical communications building, industrial building, two floor

Patentee before: Wuhan flying Microelectronics Technology Co., Ltd.

TR01 Transfer of patent right