WO2014190843A1 - 生成输入参数的方法及设备 - Google Patents

生成输入参数的方法及设备 Download PDF

Info

Publication number
WO2014190843A1
WO2014190843A1 PCT/CN2014/076856 CN2014076856W WO2014190843A1 WO 2014190843 A1 WO2014190843 A1 WO 2014190843A1 CN 2014076856 W CN2014076856 W CN 2014076856W WO 2014190843 A1 WO2014190843 A1 WO 2014190843A1
Authority
WO
WIPO (PCT)
Prior art keywords
parameter
network device
packet
rule
message
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.)
Ceased
Application number
PCT/CN2014/076856
Other languages
English (en)
French (fr)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP14803900.1A priority Critical patent/EP2996303A4/en
Priority to JP2016515622A priority patent/JP6222505B2/ja
Publication of WO2014190843A1 publication Critical patent/WO2014190843A1/zh
Priority to US14/949,144 priority patent/US20160080532A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • Embodiments of the present invention relate to communication technologies, and in particular, to a method and device for generating input parameters. Background technique
  • optical communication is a commonly used data communication method.
  • the interface of high-speed network equipment usually adopts the line mode of optical modules connected to optical fibers to realize network devices. Communication connection. Due to the large price difference between optical modules of different speeds (high-speed optical modules are much more expensive than low-speed optical modules), high-density and low-speed lines are often used in the prior art to achieve connection between network devices.
  • an application specific integrated circuit is generally used for load balancing.
  • Parameter extraction and calculation specifically extracting the outermost quintuple of the packet flow as the load balancing input parameter and performing load balancing calculation, and distributing the received packet flow to the corresponding link for transmission according to the calculation result.
  • Embodiments of the present invention provide a method and a device for generating an input parameter, so as to implement flexible extraction of input parameters of a message.
  • an embodiment of the present invention provides a method for generating an input parameter, including: Receiving, by the first network device, a message;
  • the rule inventory is stored in the first network device, or the rule inventory is stored in the second network device.
  • the method further includes: before determining whether the first packet header is included in the packet, the method further includes: the first network device receiving the rule base from a third network device.
  • the rule base further includes a second rule, where the second rule includes an identifier of the second packet header and a second operation Information, the second operation information includes extracting a second parameter from the second packet header;
  • the method further includes:
  • the determining the input parameter according to the first parameter includes:
  • the determining the input parameter according to the first parameter includes:
  • the first parameter is determined as the input parameter.
  • an embodiment of the present invention provides a network device, including a receiving module and a processing module, where the receiving module is configured to receive a packet;
  • the processing module is configured to determine, according to the identifier of the first packet header in the rule base, whether the first packet header is included in the packet, where the rule base includes a first rule, where the first Rules include The identifier of the first packet header and the first operation information, where the first operation information includes extracting a first parameter from the first packet header;
  • the network device further includes:
  • a storage module configured to store the rule base.
  • the receiving module is further configured to: receive the rule base.
  • the rule base further includes a second rule, where the second rule includes an identifier of the second packet header and a second operation Information, the second operation information includes extracting a second parameter from the second packet header;
  • the processing module is further configured to:
  • the processing module is specifically configured to:
  • the processing module is specifically configured to:
  • the first parameter is determined as the input parameter.
  • the method and the device for generating an input parameter are provided by the network device, and the network device receives the packet, and determines whether the first packet header is included in the packet according to the identifier of the first packet header in the rule base.
  • the packet includes the first packet header, extracting the first parameter from the first packet header, determining an input parameter according to the first parameter, thereby implementing flexible input parameters of the extracted packet To adapt to different message formats.
  • FIG. 1 is a flowchart of a method for generating an input parameter according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for generating an input parameter according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of obtaining input parameters according to rules according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a format of a customized packet according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a 0SS configuration rule base provided to a network device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of generating input parameters according to rules according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a network device 10 according to an embodiment of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • FIG. 1 is a flowchart of a method for generating an input parameter according to an embodiment of the present invention. As shown in FIG. 1, the method in this embodiment may include:
  • Step 101 The first network device receives the packet.
  • Step 102 The first network device determines, according to the identifier of the first packet header in the rule base, whether the first packet header is included in the packet, where the rule base includes a first rule, where The first rule includes an identifier of the first packet header and first operation information, where the first operation information includes extracting a first parameter from the first packet header.
  • An implementation scenario may be that the rule inventory is stored in the first network device in advance, gp, the rule inventory is stored locally in the first network device; or the rule inventory is stored in the second network device in advance, and the first network device passes Accessing the second network device, the rule base can be read from the second network device, and the second network device can be, for example, a router.
  • the first network device receives the rule base from the third network device, and the third network device may be an Operation Support System (OSS).
  • OSS Operation Support System
  • the rule base includes the identifier of the packet header, which is used to identify different types of packet headers, gp, and the first network.
  • the device may determine, according to the identifier of the first packet header in the rule base, whether the packet includes the first packet header, and if the packet includes the first packet header, if the first packet header is the packet of the Ethernet packet, The header, that is, the Ethernet header, the corresponding first operation information is to obtain the source MAC address and/or the destination MAC address of the Ethernet packet as the first parameter; if the first packet header is the packet header of the IP packet, That is, the IP header, the corresponding first operation information is the source IP address and/or the destination IP address of the IP packet as the first parameter; if the first packet header is the packet header of the TCP packet, the gpTCP header, Or the packet header of the UDP packet, the g ⁇ DP header, and the corresponding first operation information is the source port information and/or the destination port information of the TCP packet or the UDP packet as the first
  • Step 103 When the packet includes the first packet header, the first network device extracts the first parameter from the first packet header.
  • the first network device extracts the first parameter from the first packet header according to the first operation information, and if the packet does not include the first packet header, the first packet The network device can extract the parameters of the message as input parameters according to the default rules.
  • Step 104 The first network device determines an input parameter according to the first parameter.
  • the first network device extracts the first parameter in the first packet header, and determines the first parameter as the input. parameter.
  • the rule base may further include a second rule, where the second rule includes the identifier of the second packet header and the second operation information, and the second operation information may include extracting the second packet from the second packet header parameter. If the rule base includes the second rule, correspondingly, after step 102 or step 103, the first network device may determine the message according to the identifier of the second packet header in the rule base. Whether the second packet header is included in the second packet header, and the first network device extracts the second parameter from the second packet header, where the packet includes the second packet header
  • the extraction process of the two parameters can refer to the extraction process of the first parameter, and will not be described here.
  • the determining, by the first network device, the input parameter according to the first parameter may be:
  • the first network device combines the first parameter and the second parameter to obtain the input parameter.
  • Combining the first parameter and the second parameter may directly combine the first parameter and the second parameter to obtain the input parameter.
  • the result of the direct merge may be 10101111 or 11111010.
  • the first parameter is merged with the processed second parameter to obtain the input parameter.
  • the method for generating an input parameter is provided by the network device, and the network device receives the packet, and determines whether the first packet header is included in the packet according to the identifier of the first packet header in the rule base.
  • the message includes the first packet header, and the first parameter is extracted from the first packet header, and the input parameter is determined according to the first parameter, so that the input parameter of the packet can be flexibly extracted, thereby Adapt to different message formats when generating input parameters.
  • FIG. 2 is a flowchart of a method for generating an input parameter according to an embodiment of the present invention.
  • the method provided in this embodiment may include:
  • Step 201 The first network device receives the packet, and determines, according to the identifier of the first packet header in the rule base, whether the packet includes the first packet header, and if yes, executing step 202, if not, executing the step 207.
  • Step 202 The first network device extracts the first parameter from the first packet header.
  • Step 203 The first network device determines, according to the identifier of the second packet header in the rule base, whether the packet includes a second packet header, and if yes, executing step 204, and if not, performing step 206.
  • Step 204 The first network device extracts a second parameter from the second packet header.
  • Step 205 The first network device combines the first parameter and the second parameter to obtain an input parameter, and the process of generating the input parameter ends.
  • Step 206 The first network device determines the first parameter as an input parameter, and generates an input parameter process end.
  • Step 207 The first network device determines, according to the identifier of the second packet header in the rule base, whether the packet includes the second packet header, and if yes, executing step 208, and if no, executing step 209.
  • Step 208 The first network device extracts a second parameter from the second packet header, and determines the second parameter as Enter the parameters and the process of generating the parameters ends.
  • Step 209 The first network device extracts a parameter of the packet as an input parameter according to a default rule, and the process of generating the input parameter ends.
  • This embodiment can implement flexible extraction of input parameters of a message, so that different input message formats can be adapted when generating input parameters.
  • the application scenario of the method for generating an input parameter provided by the embodiment of the present invention may include: storing a rule base for the first network device, that is, configuring a rule base for the network device in advance; or storing the rule inventory in the second network device in advance,
  • the first network device can read the rule base from the second network device by accessing the second network device; or the oss delivery message format is defined to the network device; or the third network device sends the rule base to the first network device.
  • a network device, gp, OSS configuration rule base is provided to the network device, which is not limited in this embodiment.
  • a rule base is configured for the network device in advance, as shown in Table 1, and Table 1 is a list of operation information for different packet headers.
  • Table 1 is a list of operation information for different packet headers.
  • at least one rule may be included, and not limited to the first rule and the second rule.
  • at least one rule is used to describe different messages in the rule base, and each rule describes a single report.
  • the rule base may include any one of the following rules or a combination thereof:
  • the first rule Ij "key Ethernet src-mac l dst-mac l " : For Ethernet Ethernet, extract the source media access control (Media Access Control, MAC address) address and / or destination MAC address as the first Parameter key 1 ;
  • the second rule lj"key ip src-ip l dst_ipl, for the Internet Protocol (Internet Protocol, referred to as: IP) message extraction source IP address and / or destination IP address as the second parameter key2;
  • IP Internet Protocol
  • the third rule "key vxlan vni” for the virtual extensible local area network (VXLAN) message extraction "VNI" field value as the third parameter key3 ;
  • the fourth rule "key vxlan src-mac2 dst_mac2" extracts the source MAC address and/or the destination MAC address of the Ethernet in the load of the VXLAN message as the fourth parameter key4 ;
  • the fifth rule “key vxlan src-ip2 dst_ip2” extracting the VXLAN message
  • the source IP address and/or destination IP address of the Ethernet in the load of the VXLAN packet is used as the fifth parameter key5
  • the sixth rule "key nvgre vsid” Network Virtualization using Generic Routing Encapsulation (Network Virtualization using Generic Routing Encapsulation, Jane: NVGRE)
  • the message extracts the value of the "VSID" field as the sixth parameter key6;
  • the seventh rule "key nvgre src-mac2 dst_mac2" extracts the source MAC address and/or the destination MAC address of the Ethernet in the load of the NVGRE packet as the seventh parameter key7;
  • the eighth rule "key nvgre src-ip2 dst_ip2" extracts the source IP address and/or the destination IP address of the Ethernet in the load of the NVGRE packet as the eighth parameter key8; the ninth rule “key gtp” Teid” : For General Packet Radio Service Tunneling Protocol (GPRS)
  • GPRS General Packet Radio Service Tunneling Protocol
  • the tunneling protocol (GTP) packet extracts the value of the TEID field as the ninth parameter key9; the tenth rule "key nvgre src-ip2 dst_ip2": extracts the load of the GTP packet from the GTP packet.
  • the source IP address and/or the destination IP address are used as the tenth parameter keyl0.
  • the port of the network device to which the rule base is applied matches the identifier of the packet header of the packet with the ten rules, if the identifier of the packet header of the packet is the same as the above If any one of the ten rules matches, the parameters are extracted from the message header of the message according to the operation information in the corresponding rule, and the input parameter is determined according to the extracted parameter.
  • the first rule of the rule base "wanl” is "key Ethernet src-mac 1 dst-macl", that is, for Ethernet packets, the source MAC address (“src-macl") and the destination MAC address are extracted ( Dst-macl” ) is used as an input parameter.
  • the received packet is an Ethernet packet
  • the source MAC address and destination MAC address of the packet are extracted as input parameters.
  • Key vxlan src - ip2 dst - ip2 Extract the source of the Ethernet in the payload of the VXLAN packet
  • nvgre src-mac2 dst-mac2 extracts the source of the Ethernet in the payload of the NVGRE packet.
  • Key gtp teid extracts the value of the "TEID" field key nvgre src - ip2 dst - ip2 extracts the source IP address and/or destination IP address of the Ethernet in the payload of the GTP packet
  • FIG. 3 is a schematic diagram of obtaining input parameters according to rules according to an embodiment of the present invention.
  • the operation information in the rule extracts a plurality of sets of parameters from the packet header of the packet, and the number of the extracted parameters is the same as the number of rules that the identifier of the packet header meets, the network
  • the device combines the extracted at least one set of parameters of the message to obtain an input parameter.
  • the first rule of the ruler lj "wanl” is "key Ethernet src-mac l dst-mac l ", that is, for the Ethernet message, the source MAC address ("src-mac l") and the destination MAC address are extracted.
  • the address (“dst-mac l") is used as a parameter.
  • the network device will use the source MAC address and the destination MAC address. The address is used as the first parameter key1, and the network device determines the key1 as an input parameter;
  • the second rule is "key ip src-ipl dst-ipl", that is, the source IP address ("src-ipl") and the destination IP address (“dst-ipl") are extracted as parameters for the IP packet. And if the packet is an IP packet, the source IP address and the destination IP address are extracted as the second parameter key2, and if the packet meets the first rule and the second rule, and the IP packet is If it is carried on the Ethernet, the network device combines key1 and key2 to obtain the input parameter.
  • the third rule is "key vxlan vni", that is, the value of the "VNI" field is extracted as a parameter for the VXLAN message.
  • the message is a VXLAN message
  • the value of the "VNI" field is extracted as the first.
  • the three-parameter key3 if the packet meets the first rule, the second rule, and the third rule, the VXLAN is an IP packet, and the IP packet is carried on the Ethernet.
  • the network device combines key1, key2, and key3 to obtain the input parameter.
  • the fourth rule is "key vxlan src-mac2 dst-mac2", that is, the source MAC address ("src_mac2") and the destination MAC address of the Ethernet in the load of extracting the VXLAN message for the VXLAN message (" Dst-mac2 " ) as a parameter, if the message is a VXLAN message, the source MAC address and the destination MAC address of the Ethernet in the load of the VXLAN message are extracted as the fourth parameter key4, if the message is The first rule, the second rule, the third rule, and the fourth rule are met.
  • the The network device Since the VXLAN is an IP packet, and the IP packet is carried on the Ethernet, the The network device combines keyl, key2, key3, and key4 to obtain the input parameter. Further, the fifth rule is "key vxlan src-ip2 dst-ip2", that is, the VXLAN message is extracted for the VXLAN message. The source IP address (“src-ip2”) and the destination IP address ("dst-ip2”) of the Ethernet are used as parameters. In this case, if the message is a VXLAN message, the VXLAN message is extracted. The source IP address and destination IP address of the Ethernet in the load are used as the fifth parameter.
  • the VXLAN is an IP packet
  • the IP packet is carried on the Ethernet, and the network device combines key1, key2, key3, key4, and key5 to obtain the input parameter.
  • the sixth rule is "key nvgre vsid", that is, the value of the "VSID" field is extracted as a parameter for the NVGRE message.
  • the message is an NVGRE message
  • the value of the "VSID” field is extracted as the first
  • the six-parameter key6 if the packet meets the first rule, the second rule, and the sixth rule, the NVGRE packet is an IP packet, and the IP packet is carried on the Ethernet.
  • the network device combines key1, key2, and key6 to obtain the input parameter.
  • the seventh rule is "key nvgre src-mac2 dst-mac2", that is, the source MAC address ("src_mac2") and the destination MAC address of the Ethernet in the load of extracting the NVGRE message for the NVGRE message (" Dst-mac2 " ) as a parameter, if the message is an NVGRE message, the source MAC address and the destination MAC address of the Ethernet in the load of the NVGRE message are extracted as the seventh parameter key7, if the message meets the same
  • the network device combines keyl, key2, key6, and key7 to obtain the input parameter.
  • the eighth rule is "key nvgre src-ip2 dst_ip2", that is, the source IP address ("src-ip2") and the destination IP address of the Ethernet in the load of extracting the NVGRE message for the NVGRE message (" Dst-ip2 ") as a parameter, if the message is an NVGRE message, extracting the NVGRE message
  • the source IP address and the destination IP address of the Ethernet are used as the eighth parameter key8, and if the packet meets the first rule, the second rule, the sixth rule, the seventh rule, and the The eighth rule is that, because the NVGRE packet is an IP packet, and the IP packet is carried on the Ethernet, the network device combines key1, key2, key6, key7, and key8 to obtain the input.
  • the ninth rule is "key gtp teid", that is, the value of the "TEID" field is extracted as a parameter for the GTP message. If the message is a GTP message, the value of the "TEID” field is extracted as the ninth.
  • the parameter key9 if the packet meets the first rule, the second rule, and the ninth rule, the GTP packet is an IP packet, and the IP packet is carried on the Ethernet. The network device combines keyU key2 and key9 to obtain the input parameter.
  • the tenth rule is "key nvgre src-ip2 dst_ip2", that is, the source IP address ("src-ip2") and the destination IP address of the Ethernet in the load of extracting the GTP message for the GTP message (" Dst-ip2 " ) as a parameter, if the packet is a GTP packet, the source IP address and the destination IP address of the Ethernet in the load of the GTP packet are extracted as the tenth parameter keylO, if the packet meets the same
  • the network device combines keyl, key2, key9, and keylO to obtain the input parameters.
  • combining the extracted parameters may directly combine the obtained group parameters to obtain the input parameters, or may perform CRC processing or XOR processing on each group of parameters respectively. After processing each group of parameters, the processed group parameters are combined to obtain the input parameters. This embodiment does not limit the manner in which parameters are combined.
  • the first network device can read the rule base from the second network device by accessing the second network device, when the first network device reads by accessing the second network device.
  • the process of generating the input parameters by the first network device refer to the method described in any of the foregoing embodiments, and details are not described herein again.
  • FIG. 4 is an implementation of the present invention.
  • A. B specifically, offset.
  • the meaning of A. B is: A is the number after the Ethernet Type field.
  • a byte, B is B bytes starting from A.
  • the process of identifying the custom packet format may be: First, if the value of the Ethernet header type field is 0x 0800, the next judgment is performed, otherwise, No next judgment is made; secondly, if the field value of the first byte after the Ethernet Type field lasts 1 byte is 0 x 2F (that is, a message of GRE type), the next judgment is made, otherwise Returning; third, if the field value of the 23th byte from the Ethernet Type field lasts 2 bytes is 0 x 6558 (that is, the message of the NVGRE type), the next judgment is made, otherwise it returns; ⁇ , find the field that lasts 3 bytes from the 25th byte of the Ethernet Type field, and take the field value to the virtual virtual subnet identifier (Virtual Subnet Identifier, VSID for short) and return.
  • the method for generating an input parameter in this embodiment is the same as the method embodiment described above, and details are not described herein again.
  • FIG. 5 is a schematic diagram of the 0SS configuration rule base provided to the network device according to the embodiment of the present invention.
  • the at least one rule is used to describe different packets, and each rule describes a single packet or a collection of packets, for example, all the packet flows on the VXLAN tunnel and all the packets on the NVGRE tunnel. Stream, and then apply the configured rules to the network device port.
  • the port of the network device to which the rule base is applied matches the identifier of the packet header of the packet with the ten rules.
  • the identifier of the packet header of the packet may be matched with any one of the ten rules, and a set of parameters is extracted from the packet header of the packet according to the operation information in the corresponding rule, and according to the The extracted parameters determine the input parameters; the identifier of the packet header of the packet may also match the plurality of the ten rules, and the packets of the packet are respectively received according to the operation information in the corresponding rule.
  • FIG. 6 is a schematic diagram of generating an input parameter according to a rule according to an embodiment of the present invention.
  • the processing method is the same as the foregoing method embodiment, and details are not described herein again.
  • the network device receives the packet, and extracts at least one set of parameters of the packet according to the preset rule base, and the network device merges at least one set of parameters of the extracted packet, and A set of input parameters can be obtained, which can flexibly extract the input parameters of the message, so that different input message formats can be adapted when generating the input parameters.
  • FIG. 7 is a schematic structural diagram of a network device 10 according to an embodiment of the present invention.
  • the network device 10 in this embodiment may be a network device in the embodiment corresponding to FIG.
  • the network device 10 provided in this embodiment may include a receiving module 11 and a processing module 12.
  • the receiving module 11 is configured to receive a message.
  • the processing module 12 is configured to determine, according to the identifier of the first packet header in the rule base, whether the first packet header is included in the packet, where the rule base includes a first rule, and the first rule
  • the identifier includes the first packet header and the first operation information, where the first operation information includes: extracting a first parameter from the first packet header; and when the packet includes the first packet header Extracting the first parameter from the first packet header; determining an input parameter according to the first parameter.
  • the processing module 12 is specifically configured to determine the first parameter as the input parameter.
  • the network device 10 may further include a storage module for storing a rule base received by the receiving module 11.
  • the second rule may further include a second rule, where the second rule includes an identifier of the second packet header and second operation information, where the second operation information includes the second packet header Extracting the second parameter; correspondingly, the processing module 12 is further configured to determine, according to the identifier of the second packet header in the rule base, whether the second packet header is included in the packet; The packet includes the second packet header, and the second parameter is extracted from the second packet header, and the extracted first parameter and the second parameter are combined to obtain a The input parameters are described.
  • the receiving module 11 receives the message, and then the processing module 12 extracts at least one set of parameters of the packet according to the preset rule base, if the identifier of the packet header of the packet is in the preset rule. If a match is made, a set of parameters is extracted from the message header of the packet as an input parameter according to the operation information in the corresponding rule; if the identifier of the packet header of the packet is in a plurality of phases in the preset rule If the matching is performed, the multiple sets of parameters are extracted from the packet header of the packet according to the operation information in the corresponding rule, and the number of the extracted parameters is the same as the number of rules that the packet meets. .
  • the processing module 12 combines at least one set of parameters of the extracted packet, such as directly combining the parameters of each group, or performing CRC processing or XOR processing on each group of parameters respectively, obtaining multiple sets of processed parameters, and then Multiple sets of processed parameters are combined to form a set of input parameters.
  • the function of the receiving module 11 may be specifically implemented by a physical receiving port, and the function of the processing module 12 may be specifically implemented by a processor, and the function of the storage module may be specifically implemented by a memory.
  • the network device provided by this embodiment may be used to implement the technical solution of the foregoing method embodiment, and the principle and the technical effect are similar, and details are not described herein again.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the above method embodiments;
  • the storage medium includes: various media that can store program codes, such as R0M, RAM, disk, or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

本发明实施例提供一种生成输入参数的方法及设备。本发明实施例的生成输入参数的方法包括:第一网络设备接收报文,所述第一网络设备根据规则库中的第一报文头的标识,确定所述报文中是否包括所述第一报文头,其中,所述规则库包括第一规则,所述第一规则包括所述第一报文头的标识和第一操作信息,所述第一操作信息包括从所述第一报文头中提取第一参数;当所述报文包括所述第一报文头,所述第一网络设备从所述第一报文头中提取所述第一参数;所述第一网络设备根据所述第一参数确定输入参数,从而实现灵活的提取报文的输入参数,以适应不同的报文格式。

Description

技术领域
本发明实施例涉及通信技术, 尤其涉及一种生成输入参数的方法及设备。 背景技术
随着通信技术的不断发展, 对通信速率的要求也越来越来高, 采用光通信 是目前普遍采用的数据通信方式, 高速网络设备接口通常采用光模块接光纤的 线路模式实现网络设备之间的通信连接。 由于不同速率的光模块间的价格差异 大(高速光模块比低速光模块的价格要高很多), 因而现有技术中常采用高密低 速线路来实现网络设备间的连接。
两个网络设备之间一般具有多条链路进行数据传输, 为均衡各链路的负载, 现有技术中, 普遍采用特定应用集成电路 (Appl ication Specific Integrated Circuit , 简称: ASIC ) 实现负载均衡的参数提取和计算, 具体是提取报文流的 最外层五元组作为负载均衡的输入参数并进行负载均衡计算, 根据计算结果将 接收到的报文流分配到对应的链路进行传输。
由于隧道技术被广泛使用, 在一个隧道上可以存在多个报文流, 同一个隧 道上的报文流具有相同的最外层的报文头, 而内层的报文头可能会有不同, 但 现有技术中是将报文流的最外层五元组作为输入参数为报文流分配链路, 在提 取报文流的输入参数时没有考虑到其他的因素, 因此现有的这种提取报文流的 输入参数的方法不够灵活。 发明内容
本发明实施例提供一种生成输入参数的方法及设备, 以实现灵活的提取报 文的输入参数。
第一方面, 本发明实施例提供一种生成输入参数的方法, 包括: 第一网络设备接收报文;
根据规则库中的第一报文头的标识, 确定所述报文中是否包括所述第一报 文头, 其中, 所述规则库包括第一规则, 所述第一规则包括所述第一报文头的 标识和第一操作信息, 所述第一操作信息包括从所述第一报文头中提取第一参 数;
当所述报文包括所述第一报文头, 从所述第一报文头中提取所述第一参数; 根据所述第一参数确定输入参数。
在第一方面的第一种可能的实现方式中, 所述规则库存储于所述第一网络 设备中, 或者, 所述规则库存储于第二网络设备中。
根据第一方面的第一种可能的实现方式, 在第二种可能的实现方式中, 当 所述规则库存储于所述第一网络设备中时, 在根据规则库中的第一报文头的标 识, 确定所述报文中是否包括所述第一报文头之前, 所述方法还包括: 所述第 一网络设备从第三网络设备接收所述规则库。
结合第一方面至第二种可能的实现方式, 在第三种可能的实现方式中, 所 述规则库还包括第二规则, 所述第二规则包括第二报文头的标识和第二操作信 息, 所述第二操作信息包括从所述第二报文头中提取第二参数;
所述方法还包括:
根据规则库中的所述第二报文头的标识, 确定所述报文中是否包括所述第 二报文头;
当所述报文包括所述第二报文头, 从所述第二报文头中提取所述第二参数。 根据第一方面的第三种可能的实现方式, 在第四种可能的实现方式中, 所 述根据所述第一参数确定输入参数包括:
对所述第一参数和所述第二参数进行合并, 得到所述输入参数。
结合第一方面至第二种可能的实现方式, 在第五种可能的实现方式中, 所 述根据所述第一参数确定输入参数包括:
将所述第一参数确定为所述输入参数。
第二方面, 本发明实施例提供一种网络设备, 包括接收模块和处理模块, 所述接收模块用于接收报文;
所述处理模块用于根据规则库中的第一报文头的标识, 确定所述报文中是 否包括所述第一报文头, 其中, 所述规则库包括第一规则, 所述第一规则包括 所述第一报文头的标识和第一操作信息, 所述第一操作信息包括从所述第一报 文头中提取第一参数;
当所述报文包括所述第一报文头, 从所述第一报文头中提取所述第一参数; 根据所述第一参数确定输入参数。
在第二方面的第一种可能的实现方式中, 所述网络设备还包括:
存储模块, 用于存储所述规则库。
根据第二方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所 述接收模块还用于: 接收所述规则库。
结合第二方面至第二种可能的实现方式, 在第三种可能的实现方式中, 所 述规则库还包括第二规则, 所述第二规则包括第二报文头的标识和第二操作信 息, 所述第二操作信息包括从所述第二报文头中提取第二参数;
所述处理模块还用于:
根据规则库中的所述第二报文头的标识, 确定所述报文中是否包括所述第 二报文头; 当所述报文包括所述第二报文头, 从所述第二报文头中提取所述第 二参数。
根据第二方面的第三种可能的实现方式, 在第四种可能的实现方式中, 所 述处理模块具体用于:
对所述第一参数和所述第二参数进行合并, 得到所述输入参数。
结合第二方面至第二种可能的实现方式, 在第五种可能的实现方式中, 所 述处理模块具体用于:
将所述第一参数确定为所述输入参数。
本发明实施例提供的生成输入参数的方法及设备, 通过网络设备接收报文, 根据规则库中的第一报文头的标识, 确定所述报文中是否包括所述第一报文头, 当所述报文包括所述第一报文头, 从所述第一报文头中提取所述第一参数, 根 据所述第一参数确定输入参数, 从而实现灵活的提取报文的输入参数, 以适应 不同的报文格式。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描 述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出 创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的生成输入参数的方法的流程图;
图 2为本发明实施例提供的生成输入参数的方法的流程图;
图 3为本发明实施例提供的根据规则获得输入参数的示意图;
图 4为本发明实施例提供的自定义报文格式示意图;
图 5为本发明实施例提供的 0SS配置规则库给网络设备的示意图;
图 6为本发明实施例提供的根据规则生成输入参数的示意图;
图 7为本发明实施例提供的网络设备 10的结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明 实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中 的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其 他实施例, 都属于本发明保护的范围。
图 1为本发明实施例提供的生成输入参数的方法的流程图, 如图 1所示, 本 实施例的方法可以包括:
歩骤 101、 第一网络设备接收报文。
歩骤 102、 第一网络设备根据规则库中的第一报文头的标识, 确定所述报文 中是否包括所述第一报文头, 其中, 所述规则库包括第一规则, 所述第一规则 包括所述第一报文头的标识和第一操作信息, 所述第一操作信息包括从所述第 一报文头中提取第一参数。
一种实施场景可以为预先将规则库存储于第一网络设备中, gp, 将规则库 存储在第一网络设备本地; 或是预先将规则库存储于第二网络设备中, 第一网 络设备通过访问第二网络设备, 可以从第二网络设备中读取到规则库, 第二网 络设备例如可以为路由器。 另一种实施场景可以为第一网络设备从第三网络设 备中接收规则库, 第三网络设备具体可以是运营支持系统 (Operat ion Support System , 简称: OSS ) 。
规则库中包括报文头的标识, 用于标识不同类型的报文头, gp, 第一网络 设备可以根据规则库中的第一报文头的标识确定报文中是否包括第一报文头, 若报文中包括第一报文头, 若第一报文头为 Ethernet报文的报文头,即以太网 头, 其相应的第一操作信息为获取该 Ethernet报文的源 MAC地址和 /或目的 MAC地 址作为第一参数; 若第一报文头为 IP报文的报文头, 即 IP头, 其相应的第一操 作信息为获取该 IP报文的源 IP地址和 /或目的 IP地址作为第一参数; 若第一报文 头为 TCP报文的报文头, gpTCP头, 或者 UDP报文的报文头, g叩 DP头, 其相应的 第一操作信息为获取该 TCP报文或者 UDP报文的源端口信息和 /或目的端口信息 作为第一参数; 若第一报文头为 GRE报文的报文头, gpGRE头, 或 VXLAN报文的报 文头, 即 VXLAN头, 或 NVGRE报文的报文头, 即 NVGRE头, 其相应的第一操作信息 为获取该 GRE报文或 VXLAN报文或 NVGRE报文内层负荷的源 MAC地址、 和 /或目的 MAC地址、 和 /或源 IP地址、 和 /或目的 IP地址作为第一参数, 或者, 若第一报文 头为 GTP报文的报文头, 即 GTP头, 其相应的第一操作信息为获取该 GTP报文内层 负荷的源 IP地址、 和 /或目的 IP地址、 源端口信息和 /或目的端口信息作为第一 参数。
歩骤 103、 当所述报文包括所述第一报文头, 第一网络设备从所述第一报文 头中提取所述第一参数。
若所述报文包括第一报文头, 则第一网络设备按照第一操作信息从第一报 文头中提取第一参数, 若所述报文不包括第一报文头, 则第一网络设备可以按 照默认的规则提取报文的参数作为输入参数。
歩骤 104、 第一网络设备根据所述第一参数确定输入参数。
一种可行的方式, 若规则库中包括第一报文头的标识, 则所述第一网络设 备提取第一报文头中的第一参数, 并将所述第一参数确定为所述输入参数。
进一歩的, 规则库还可以包括第二规则, 所述第二规则包括第二报文头的 标识和第二操作信息, 所述第二操作信息可以包括从第二报文头中提取第二参 数。 若所述规则库包括第二规则, 相应的, 在歩骤 102或歩骤 103之后, 所述第 一网络设备可以根据规则库中的所述第二报文头的标识, 确定所述报文中是否 包括所述第二报文头, 当所述报文包括所述第二报文头, 所述第一网络设备从 所述第二报文头中提取所述第二参数, 所述第二参数的提取过程可参照第一参 数的提取过程, 此处不再赘述。
相应的, 本歩骤中, 第一网络设备根据所述第一参数确定输入参数可以为: 所述第一网络设备对所述第一参数和所述第二参数进行合并, 得到所述输入参 数。 对第一参数和第二参数进行合并可以为将第一参数与第二参数直接进行合 并, 从而得到所述输入参数。 例如, 第一参数为 1010, 第二参数为 1111, 那么 直接合并的结果可以为 10101111或者 11111010。 此外, 也可以为分别对第一参 数和 /或第二参数做预处理, 然后对对经过预处理的参数进行合并。 例如对第一 参数和第二参数进行循环冗余校验 (Cycl ic Redundancy Check , 简称: CRC ) 处理或者异或处理, 获取处理后的第一参数和处理后的第二参数, 再将处理后 的第一参数和处理后的第二参数进行合并, 从而得到所述输入参数。 本实施例 不对参数的合并方式进行限制。
本发明实施例提供的生成输入参数的方法, 通过网络设备接收报文, 根据 规则库中的第一报文头的标识, 确定所述报文中是否包括所述第一报文头, 当 所述报文包括所述第一报文头, 从所述第一报文头中提取所述第一参数, 根据 所述第一参数确定输入参数, 可以实现灵活的提取报文的输入参数, 从而在生 成输入参数时适应不同的报文格式。
在上述实施例的基础上, 本实施例以规则库包括第一规则和第二规则为例 对生成输入参数的方法进行说明。 如图 2所示, 图 2为本发明实施例提供的生成 输入参数的方法的流程图, 本实施例提供的方法可以包括:
歩骤 201、 第一网络设备接收报文, 根据规则库中的第一报文头的标识, 确 定报文中是否包括第一报文头, 若是, 执行歩骤 202, 若否, 执行歩骤 207。
歩骤 202、 第一网络设备从第一报文头中提取第一参数。
歩骤 203、 第一网络设备根据规则库中的第二报文头的标识, 确定报文中是 否包括第二报文头, 若是, 执行歩骤 204, 若否执行歩骤 206。
歩骤 204、 第一网络设备从第二报文头中提取第二参数。
歩骤 205、 第一网络设备对第一参数和第二参数进行合并, 得到输入参数, 生成输入参数流程结束。
歩骤 206、 第一网络设备将第一参数确定为输入参数, 生成输入参数流程结 束。
歩骤 207、 第一网络设备根据规则库中的第二报文头的标识, 确定报文中是 否包括第二报文头, 若是, 执行歩骤 208, 若否, 执行歩骤 209。
歩骤 208、 第一网络设备从第二报文头中提取第二参数, 将第二参数确定为 输入参数, 生成参数流程结束。
歩骤 209、 第一网络设备按照默认的规则提取报文的参数作为输入参数, 生 成输入参数流程结束。
本实施例可以实现灵活的提取报文的输入参数, 从而在生成输入参数时可 以适应不同的报文格式。
本发明实施例提供的生成输入参数的方法的应用场景可以包括: 为第一网 络设备中存储规则库, 即预先为网络设备配置规则库; 或是预先将规则库存储 于第二网络设备中, 第一网络设备通过访问第二网络设备, 可以从第二网络设 备中读取到规则库; 或是由 oss下发报文格式定义给网络设备; 或是由第三网络 设备发送规则库给第一网络设备, gp, OSS配置规则库给网络设备, 本实施例不 对此进行限制。 下面以为预先为网络设备配置规则库为例, 对本实施例提供的 生成输入参数的方法进行详细说明。
首先, 预先为网络设备配置规则库, 如表 1所示, 表 1为针对不同报文头的 操作信息列表。 在所述规则库中, 可以包括至少一条规则, 而不仅仅局限于第 一规则和第二规则, 具体的, 在规则库中通过至少一条规则针对不同报文进行 描述, 每条规则描述单个报文或报文的集合, 如, VXLAN隧道上所有的报文流、 NVGRE隧道上所有的报文流, 然后将配置的规则应用到所述网络设备端口上。
其中, 所述规则库中可以包括以下规则中的任意一条或其组合:
第一规贝 Ij " key Ethernet src-mac l dst-mac l " : 对于以太网 Ethernet^艮 文, 提取源媒体访问控制 (Media Access Control , 简称: MAC ) 地址和 /或目 的 MAC地址作为第一参数 key 1 ;
第二规贝 lj"key ip src-ip l dst_ipl,, :对于互联网协议( Internet Protocol , 简称: IP ) 报文提取源 IP地址和 /或目的 IP地址作为第二参数 key2 ;
第三规则 " key vxlan vni " : 对于虚拟化可扩展的局域网 (Virtual extensible Local Area Network , 简称: VXLAN ) 报文提取 "VNI "字段的值作 为第三参数 key3 ;
第四规则 " key vxlan src-mac2 dst_mac2 " : 对于所述 VXLAN报文提取所 述 VXLAN报文的负荷中 Ethernet的源 MAC地址和 /或目的 MAC地址作为第四参数 key4;
第五规则 " key vxlan src-ip2 dst_ip2 " : 对于所述 VXLAN报文提取所述 VXLAN报文的负荷中 Ethernet的源 IP地址和 /或目的 IP地址作为第五参数 key5; 第六规则 "key nvgre vsid" : 对于使用通用路由封装实现的网络虚拟化 (Network Virtualization using Generic Routing Encapsulation , 简禾尔: NVGRE) 报文提取 "VSID"字段的值作为第六参数 key6;
第七规则 "key nvgre src-mac2 dst_mac2" : 对于所述 NVGRE报文提取所 述 NVGRE报文的负荷中 Ethernet的源 MAC地址和 /或目的 MAC地址作为第七参数 key7;
第八规则 "key nvgre src-ip2 dst_ip2" : 对于所述 NVGRE报文提取所述 NVGRE报文的负荷中 Ethernet的源 IP地址和 /或目的 IP地址作为第八参数 key8; 第九规则 "key gtp teid" : 对于通用分组无线服务隧道协议 (GPRS
Tunneling Protocol,简称: GTP)报文提取" TEID"字段的值作为第九参数 key9; 第十规则 "key nvgre src-ip2 dst_ip2" : 对于所述 GTP报文提取所述 GTP 报文的负荷中 Ethernet的源 IP地址和 /或目的 IP地址作为第十参数 keyl0。
应用了所述规则库的网络设备的端口在接收到报文后, 将所述报文的报文 头的标识与上述十个规则进行匹配, 如果所述报文的报文头的标识与上述十个 规则中的任一个相匹配, 则按照相应的规则中的操作信息从所述报文的报文头 中提取参数, 并根据所述提取的参数确定输入参数。
例如表 1中, 规则库 " wanl " 的第一规则是 " key Ethernet src-mac 1 dst-macl" , 即对于 Ethernet报文, 提取源 MAC地址( "src-macl" )和目的 MAC 地址 ( "dst-macl" ) 作为输入参数, 此时, 如果接收到的报文是 Ethernet报 文, 就提取该报文的源 MAC地址和目的 MAC地址作为输入参数。
Figure imgf000009_0001
Figure imgf000009_0002
key vxlan src - ip2 dst - ip2 提取 VXLAN报文的负荷中 Ethernet的源
IP地址和 /或目的 IP地址
key nvgre vsid 提取 "VSID "字段的值
key nvgre src-mac2 dst-mac2 提取 NVGRE报文的负荷中 Ethernet的源
MAC地址和 /或目的 MAC地址
key nvgre src - ip2 dst - ip2 提取 NVGRE报文的负荷中 Ethernet的源
IP地址和 /或目的 IP地址
key gtp teid 提取 "TEID "字段的值 key nvgre src - ip2 dst - ip2 提取 GTP报文的负荷中 Ethernet的源 IP 地址和 /或目的 IP地址
图 3为本发明实施例提供的根据规则获得输入参数的示意图, 如图 3所示, 若所述报文的报文头的标识与上述十个规则中的多个相匹配, 分别按照相应的 规则中的操作信息从所述报文的报文头中提取多组参数, 且所提取的所述参数 的组数与所述报文头的标识所符合的规则的条数相同, 所述网络设备对所提取 的所述报文的至少一组参数进行合并, 得到输入参数。
例如图 3中,规贝 lj"wanl "的第一规则是 " key Ethernet src-mac l dst-mac l " , 即对于 Ethernet报文, 提取源 MAC地址 ( " src-mac l " ) 和目的 MAC地址 ( " dst-mac l " ) 作为参数, 此时, 若所述报文仅符合所述第一规则, 即所述 报文是 Ethernet报文, 则所述网络设备将源 MAC地址和目的 MAC地址作为第一参 数 keyl , 所述网络设备将所述 keyl确定为输入参数;
进一歩, 第二规则是 " key ip src-ipl dst-ipl " , 即对于 IP报文提取源 IP地址( " src-ipl " )和目的 IP地址( " dst-ipl " )作为参数, 此时, 若所述报 文是 IP报文, 提取源 IP地址和目的 IP地址作为第二参数 key2, 若所述报文同时 符合所述第一规则和所述第二规则, 且所述 IP报文是承载在 Ethernet上的, 则 所述网络设备对 keyl和 key2进行合并, 得到所述输入参数;
进一歩, 第三规则是 "key vxlan vni " , 即对于 VXLAN报文提取 "VNI "字 段的值作为参数, 此时, 若所述报文是 VXLAN报文, 提取 "VNI "字段的值作为 第三参数 key3, 若所述报文同时符合所述第一规则、 所述第二规则和所述第三 规则, 由于 VXLAN是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则所述 网络设备对 keyl、 key2和 key3进行合并, 得到所述输入参数; 进一歩, 第四规则是 " key vxlan src-mac2 dst-mac2 " , 即对于所述 VXLAN 报文提取所述 VXLAN报文的负荷中 Ethernet的源 MAC地址 ( " src_mac2 " ) 和目 的 MAC地址 ( "dst-mac2 " ) 作为参数, 此时, 若所述报文是 VXLAN报文, 提取 所述 VXLAN报文的负荷中 Ethernet的源 MAC地址和目的 MAC地址作为第四参数 key4, 若所述报文同时符合所述第一规则、 所述第二规则、 所述第三规则和所 述第四规则, 由于 VXLAN是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则所述网络设备对 keyl、 key2、 key3和 key4进行合并, 得到所述输入参数; 进一歩, 第五规则是 "key vxlan src- ip2 dst- ip2 " , 即对于所述 VXLAN 报文提取所述 VXLAN报文的负荷中 Ethernet的源 IP地址( " src-ip2 " )和目的 IP 地址( "dst-ip2 " )作为参数, 此时, 若所述报文是 VXLAN报文, 提取所述 VXLAN 报文的负荷中 Ethernet的源 IP地址和目的 IP地址作为第五参数 key5, 若所述报 文同时符合所述第一规则、 所述第二规则、 所述第三规则、 所述第四规则和所 述第五规则, 由于 VXLAN是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则所述网络设备对 keyl、 key2、 key3 、 key4和 key5进行合并, 得到所述输入参 数;
进一歩, 第六规则是 "key nvgre vsid" , 即对于 NVGRE报文提取 "VSID" 字段的值作为参数, 此时, 若所述报文是 NVGRE报文, 提取 "VSID"字段的值作 为第六参数 key6, 若所述报文同时符合所述第一规则、 所述第二规则和所述第 六规则, 由于 NVGRE报文是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则所述网络设备对 keyl、 key2和 key6进行合并, 得到所述输入参数;
进一歩, 第七规则是 " key nvgre src-mac2 dst-mac2 " , 即对于所述 NVGRE 报文提取所述 NVGRE报文的负荷中 Ethernet的源 MAC地址 ( " src_mac2 " ) 和目 的 MAC地址( "dst-mac2 " )作为参数, 若所述报文是 NVGRE报文, 提取所述 NVGRE 报文的负荷中 Ethernet的源 MAC地址和目的 MAC地址作为第七参数 key7, 若所述 报文同时符合所述第一规则、 所述第二规则、 所述第六规则和所述第七规则, 由于 NVGRE报文是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则所述网 络设备对 keyl、 key2、 key6和 key7进行合并, 得到所述输入参数;
进一歩, 第八规则是 "key nvgre src-ip2 dst_ip2 " , 即对于所述 NVGRE 报文提取所述 NVGRE报文的负荷中 Ethernet的源 IP地址( " src-ip2 " )和目的 IP 地址( "dst-ip2 " )作为参数, 若所述报文是 NVGRE报文, 提取所述 NVGRE报文的 负荷中 Ethernet的源 IP地址和目的 IP地址作为第八参数 key8, 若所述报文同时 符合所述第一规则、 所述第二规则、 所述第六规则、 所述第七规则和所述第八 规则, 由于 NVGRE报文是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则 所述网络设备对 keyl、 key2、 key6、 key7和 key8进行合并, 得到所述输入参数; 进一歩, 第九规则是 "key gtp teid" , 即对于 GTP报文提取 "TEID"字段 的值作为参数,若所述报文为 GTP报文,提取" TEID"字段的值作为第九参数 key9, 若所述报文同时符合所述第一规则、 所述第二规则和所述第九规则, 由于 GTP报 文是一种 IP报文, 且所述 IP报文是承载在 Ethernet上的, 则所述网络设备对 keyU key2和 key9进行合并, 得到所述输入参数;
进一歩, 第十规则是 "key nvgre src-ip2 dst_ip2 " , 即对于所述 GTP报 文提取所述 GTP报文的负荷中 Ethernet的源 IP地址( " src-ip2 " )和目的 IP地址 ( "dst-ip2 " )作为参数, 若所述报文为 GTP报文, 提取所述 GTP报文的负荷中 Ethernet的源 IP地址和目的 IP地址作为第十参数 keylO, 若所述报文同时符合所 述第一规则、 所述第二规则、 所述第九规则和所述第十规则, 由于 GTP报文是一 种 IP报文,且所述 IP报文是承载在 Ethernet上的,则所述网络设备对 keyl、 key2、 key9和 keylO进行合并, 得到所述输入参数。
在实际的应用过程中, 对提取到的参数进行合并可以为将得到的各组参数 直接进行合并, 从而得到所述输入参数, 也可以为分别对各组参数进行 CRC处理 或者异或处理, 获取处理后的各组参数, 再将处理后的各组参数进行合并, 从 而得到所述输入参数。 本实施例不对参数的合并方式进行限制。
若是预先将规则库存储于第二网络设备中, 第一网络设备通过访问第二网 络设备, 可以从第二网络设备中读取到规则库, 当第一网络设备通过访问第二 网络设备读取到规则库后, 第一网络设备生成输入参数的过程具体可以参照上 述任一实施例所述的方法, 此处不再赘述。
若是由 0SS下发报文格式定义给网络设备, 网络设备根据下发的报文格式定 义来识别协议报文格式, 自定义报文格式的一个示例如图 4所示, 图 4为本发明 实施例提供的自定义报文格式示意图, 其中, 例如在图 4中的 Outer IP Header 中指明 off set. A. B, 具体, offset. A. B的含义是: A是自 Ethernet Type字段后 的第 A个字节, B为自 A开始持续 B个字节。 所述自定义报文格式识别过程可以为: 第一歩, 如果以太头类型字段值为 0x 0800, 则进行下一歩判断, 否则返回, 即 不进行下一歩判断; 第二歩, 若自 Ethernet Type字段后第 10个字节持续 1个字 节的字段值为 0 x 2F (即为 GRE类型的报文) , 则进行下一歩判断, 否则返回; 第 三歩,若自 Ethernet Type字段后第 23个字节持续 2个字节的字段值为 0 x 6558 (即 为 NVGRE类型的报文),则进行下一歩判断,否则返回;第四歩,找到自 Ethernet Type字段后第 25个字节持续 3个字节的字段, 取出所述字段值给变量虚拟子网标 识符 (Virtual Subnet Identifier, 简称: VSID) , 返回。 本实施例生成输入 参数的方法与上述方法实施例相同, 此处不再赘述。
若是由 0SS配置规则库给网络设备, 如图 5所示, 图 5为本发明实施例提供的 0SS配置规则库给网络设备的示意图。 在所述规则库中, 通过至少一条规则针对 不同的报文进行描述, 每条规则描述单个报文或报文的集合, 如, VXLAN隧道上 所有的报文流、 NVGRE隧道上所有的报文流, 然后将配置的规则应用到所述网络 设备端口上。
应用了所述规则库的网络设备的端口在接收到报文后, 将所述报文的报文 头的标识与上述十个规则进行匹配。 所述报文的报文头的标识可能与上述十个 规则中的任一个相匹配, 则按照相应的规则中的操作信息从所述报文的报文头 中提取一组参数, 并根据所述提取的参数确定输入参数; 所述报文的报文头的 标识也可能与上述十个规则中的多个相匹配, 则分别按照相应的规则中的操作 信息从所述报文的报文头中提取多组参数, 且所提取的所述参数的组数与所述 报文头的标识所符合的规则的条数相同, 所述网络设备对所提取的所述报文的 至少一组参数进行合并, 得到输入参数, 如图 6所示, 图 6为本发明实施例提供 的根据规则生成输入参数的示意图, 其处理方法与上述方法实施例相同, 此处 不再赘述。
本实施例提供的生成输入参数的方法, 通过网络设备接收报文, 根据预设 的规则库提取报文的至少一组参数, 网络设备对所提取的报文的至少一组参数 进行合并, 并得到一组输入参数, 可以实现灵活的提取报文的输入参数, 从而 可以在生成输入参数时适应不同的报文格式。
图 7为本发明实施例提供的网络设备 10的结构示意图。 本实施例中的网络设 备 10可以为与图 1对应的实施例中的网络设备。 如图 7所示, 本实施例提供的网 络设备 10可以包括接收模块 11和处理模块 12。
其中, 接收模块 11用于接收报文; 处理模块 12用于根据规则库中的第一报文头的标识, 确定所述报文中是否 包括所述第一报文头, 其中, 所述规则库包括第一规则, 所述第一规则包括所 述第一报文头的标识和第一操作信息, 所述第一操作信息包括从所述第一报文 头中提取第一参数; 当所述报文包括所述第一报文头, 从所述第一报文头中提 取所述第一参数; 根据所述第一参数确定输入参数。
处理模块 12具体可以用于将所述第一参数确定为所述输入参数。
网络设备 10还可以包括存储模块, 所述存储模块用于存储接收模块 11接收 到的规则库。
在所述规则库中, 进一歩还可以包括第二规则, 所述第二规则包括第二报 文头的标识和第二操作信息, 所述第二操作信息包括从所述第二报文头中提取 第二参数; 相应的, 所述处理模块 12还可以用于根据规则库中的所述第二报文 头的标识, 确定所述报文中是否包括所述第二报文头; 当所述报文包括所述第 二报文头, 从所述第二报文头中提取所述第二参数, 并对提取到的所述第一参 数和所述第二参数进行合并, 得到所述输入参数。
在具体实现过程中, 由接收模块 11接收报文, 再由处理模块 12根据预设的 规则库提取报文的至少一组参数, 若报文的报文头的标识与预设的规则中的一 个相匹配, 则按照相应规则中的操作信息从所述报文的报文头中提取一组参数, 作为输入参数; 若报文的报文头的标识与预设的规则中的多个相匹配, 则分别 按照相应的规则中的操作信息从所述报文的报文头中提取多组参数, 且所提取 的所述参数的组数与所述报文所符合的规则的条数相同。
处理模块 12对所提取的报文的至少一组参数进行合并, 如对各组参数直接 进行合并, 或对各组参数分别进行 CRC处理或者异或处理, 获得多组经过处理的 参数, 再将多组处理过的参数合并形成一组输入参数。
需要说明的是, 接收模块 11的功能具体可以由物理的接收端口实现, 处理 模块 12的功能具体可以由处理器实现, 存储模块的功能具体可以由存储器实现。
本实施例提供的网络设备, 可用于执行上述方法实施例的技术方案, 其原 理和技术效果类似, 此处不再赘述。
本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分歩骤 可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算机可读取 存储介质中。 该程序在执行时, 执行包括上述各方法实施例的歩骤; 而前述的 存储介质包括: R0M、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。 最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者 对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并不使相 应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求 书
1、 一种生成输入参数的方法, 其特征在于, 包括:
第一网络设备接收报文;
所述第一网络设备根据规则库中的第一报文头的标识, 确定所述报文中是 否包括所述第一报文头, 其中, 所述规则库包括第一规则, 所述第一规则包括 所述第一报文头的标识和第一操作信息, 所述第一操作信息包括从所述第一报 文头中提取第一参数;
当所述报文包括所述第一报文头, 所述第一网络设备从所述第一报文头中 提取所述第一参数;
所述第一网络设备根据所述第一参数确定输入参数。
2、 根据权利要求 1所述的方法, 其特征在于, 所述规则库存储于所述第一 网络设备中, 或者, 所述规则库存储于第二网络设备中。
3、 根据权利要求 2所述的方法, 其特征在于, 当所述规则库存储于所述第 一网络设备中时, 在所述第一网络设备根据规则库中的第一报文头的标识, 确 定所述报文中是否包括所述第一报文头之前, 所述方法还包括: 所述第一网络 设备从第三网络设备接收所述规则库。
4、 根据权利要求 1至 3中任一项所述的方法, 其特征在于, 所述规则库还包 括第二规则, 所述第二规则包括第二报文头的标识和第二操作信息, 所述第二 操作信息包括从所述第二报文头中提取第二参数;
所述方法还包括:
所述第一网络设备根据规则库中的所述第二报文头的标识, 确定所述报文 中是否包括所述第二报文头;
当所述报文包括所述第二报文头, 所述第一网络设备从所述第二报文头中 提取所述第二参数。
5、 根据权利要求 4所述的方法, 其特征在于, 所述第一网络设备根据所述 第一参数确定输入参数包括:
所述第一网络设备对所述第一参数和所述第二参数进行合并, 得到所述输 入参数。
6、 根据权利要求 1至 3中任一项所述的方法, 其特征在于, 所述第一网络设 备根据所述第一参数确定输入参数包括:
所述第一网络设备将所述第一参数确定为所述输入参数。
7、 一种网络设备, 其特征在于, 包括接收模块和处理模块,
所述接收模块用于接收报文;
所述处理模块用于:
根据规则库中的第一报文头的标识, 确定所述报文中是否包括所述第一报 文头, 其中, 所述规则库包括第一规则, 所述第一规则包括所述第一报文头的 标识和第一操作信息, 所述第一操作信息包括从所述第一报文头中提取第一参 数;
当所述报文包括所述第一报文头, 从所述第一报文头中提取所述第一参数; 根据所述第一参数确定输入参数。
8、 根据权利要求 7所述的网络设备, 其特征在于, 还包括:
存储模块, 用于存储所述规则库。
9、 根据权利要求 8所述的网络设备, 其特征在于, 所述接收模块还用于: 接收所述规则库。
10、 根据权利要求 7至 9中任一项所述的网络设备, 其特征在于, 所述规则 库还包括第二规则, 所述第二规则包括第二报文头的标识和第二操作信息, 所 述第二操作信息包括从所述第二报文头中提取第二参数;
所述处理模块还用于:
根据规则库中的所述第二报文头的标识, 确定所述报文中是否包括所述第 二报文头;
当所述报文包括所述第二报文头, 从所述第二报文头中提取所述第二参数。
11、 根据权利要求 10所述的网络设备, 其特征在于, 所述处理模块具体用 于:
对所述第一参数和所述第二参数进行合并, 得到所述输入参数。
12、 根据权利要求 7至 9中任一项所述的网络设备, 其特征在于, 所述处理 模块具体用于: 将所述第一参数确定为所述输入参数。
PCT/CN2014/076856 2013-05-31 2014-05-06 生成输入参数的方法及设备 Ceased WO2014190843A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP14803900.1A EP2996303A4 (en) 2013-05-31 2014-05-06 METHOD AND DEVICE FOR INPUT PARAMETER GENERATION
JP2016515622A JP6222505B2 (ja) 2013-05-31 2014-05-06 入力パラメータを生成するための方法および装置
US14/949,144 US20160080532A1 (en) 2013-05-31 2015-11-23 Method for generating input parameter and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310213602.0A CN104219160B (zh) 2013-05-31 2013-05-31 生成输入参数的方法及设备
CN201310213602.0 2013-05-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/949,144 Continuation US20160080532A1 (en) 2013-05-31 2015-11-23 Method for generating input parameter and device

Publications (1)

Publication Number Publication Date
WO2014190843A1 true WO2014190843A1 (zh) 2014-12-04

Family

ID=51987982

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/076856 Ceased WO2014190843A1 (zh) 2013-05-31 2014-05-06 生成输入参数的方法及设备

Country Status (5)

Country Link
US (1) US20160080532A1 (zh)
EP (1) EP2996303A4 (zh)
JP (1) JP6222505B2 (zh)
CN (2) CN108989311A (zh)
WO (1) WO2014190843A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789388B (zh) * 2016-03-25 2020-07-03 新华三技术有限公司 报文检测内容的确定方法及装置
CN107333332B (zh) * 2017-07-20 2020-05-12 中通服软件科技有限公司 一种运用预制规则分配接入型通信业务资源的方法
CN110324245B (zh) * 2018-03-31 2021-03-23 华为技术有限公司 一种基于集成流表转发报文的方法及装置
CN111030970B (zh) * 2019-03-21 2023-04-18 安天科技集团股份有限公司 一种分布式访问控制方法、装置及存储设备
CN117201639A (zh) * 2022-05-31 2023-12-08 中移(杭州)信息技术有限公司 一种报文传输方法、网络虚拟化边缘设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572644A (zh) * 2009-06-19 2009-11-04 杭州华三通信技术有限公司 一种数据封装方法和设备
CN102136987A (zh) * 2010-01-22 2011-07-27 杭州华三通信技术有限公司 一种mpls vpn中的报文转发方法和pe设备

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3193947B2 (ja) * 1997-01-08 2001-07-30 株式会社ディジタル・ビジョン・ラボラトリーズ データ送信システム及びデータ送信方法
JP3233353B2 (ja) * 1998-01-23 2001-11-26 日本電気株式会社 ヘッダ処理装置とそのヘッダ処理方法
JP2003018196A (ja) * 2001-04-27 2003-01-17 Fujitsu Ltd パケット転送装置、半導体装置、および、パケット転送システム
US20030007489A1 (en) * 2001-07-09 2003-01-09 Ram Krishnan Data extraction system for packet analysis
JP4392294B2 (ja) * 2004-06-15 2009-12-24 株式会社日立製作所 通信統計収集装置
US7760719B2 (en) * 2004-06-30 2010-07-20 Conexant Systems, Inc. Combined pipelined classification and address search method and apparatus for switching environments
US7599364B2 (en) * 2005-09-13 2009-10-06 Agere Systems Inc. Configurable network connection address forming hardware
CN101826976B (zh) * 2009-03-03 2014-03-12 中兴通讯股份有限公司 P2mp通信中故障指示方法及中间、宿节点的故障指示装置
CN101707617B (zh) * 2009-12-04 2012-08-15 福建星网锐捷网络有限公司 报文过滤方法、装置及网络设备
EP2897327B1 (en) * 2010-05-28 2016-09-14 NEC Corporation Communication system, node, control device, communication method, and program
CN101848161A (zh) * 2010-05-31 2010-09-29 杭州华三通信技术有限公司 一种mpls l2vpn和mpls l3vpn的通信方法和设备
CN102004673A (zh) * 2010-11-29 2011-04-06 中兴通讯股份有限公司 多核处理器负载均衡的处理方法及系统
CN102325347A (zh) * 2011-09-14 2012-01-18 中兴通讯股份有限公司 一种lte系统中的传输流模板匹配方法及装置
US8780914B2 (en) * 2011-10-17 2014-07-15 Xilinx, Inc. Parallel processing of network packets
CN103067276B (zh) * 2012-12-31 2016-09-21 华为技术有限公司 一种基于应用层协议选择链路的设备及其方法
US9674315B2 (en) * 2013-05-07 2017-06-06 Futurewei Technologies, Inc. Methods for dynamically binding header field identifiers in a network control protocol
US9225638B2 (en) * 2013-05-09 2015-12-29 Vmware, Inc. Method and system for service switching using service tags

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572644A (zh) * 2009-06-19 2009-11-04 杭州华三通信技术有限公司 一种数据封装方法和设备
CN102136987A (zh) * 2010-01-22 2011-07-27 杭州华三通信技术有限公司 一种mpls vpn中的报文转发方法和pe设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2996303A4 *

Also Published As

Publication number Publication date
CN104219160A (zh) 2014-12-17
CN104219160B (zh) 2018-08-14
JP2016523062A (ja) 2016-08-04
JP6222505B2 (ja) 2017-11-01
CN108989311A (zh) 2018-12-11
US20160080532A1 (en) 2016-03-17
EP2996303A1 (en) 2016-03-16
EP2996303A4 (en) 2016-05-11

Similar Documents

Publication Publication Date Title
US11979322B2 (en) Method and apparatus for providing service for traffic flow
US11716262B2 (en) Control method, apparatus, and system for collecting traffic statistics
US11909551B2 (en) Broadband remote access server (BRAS) system-based packet encapsulation
US9900238B2 (en) Overlay network-based original packet flow mapping apparatus and method therefor
EP4037267B1 (en) Method, apparatus and system for sending message
CN104144156B (zh) 报文处理方法和装置
CN105591982B (zh) 一种报文传输的方法和装置
US10601610B2 (en) Tunnel-level fragmentation and reassembly based on tunnel context
CN102333039B (zh) 一种转发报文的方法、生成表项的方法及装置
WO2019127134A1 (zh) 一种数据传送的方法和虚拟交换机
EP3618393B1 (en) Packet forwarding
CN112087381A (zh) 一种实现业务功能处理的方法及装置
CN105515992A (zh) Vxlan网络中的流表项处理方法及装置
WO2014190843A1 (zh) 生成输入参数的方法及设备
WO2016150205A1 (zh) 用于处理vxlan报文的方法、装置及系统
CN107135118B (zh) 一种单播通信方法、网关以及vxlan接入设备
CN110072257A (zh) 一种mec下用户互通的方法
WO2014067055A1 (zh) 流表刷新的方法及装置
CN109218176B (zh) 一种报文处理的方法及装置
CN103460675B (zh) 集群以及转发方法
WO2022227484A1 (zh) 数据通信方法、装置、计算机设备和存储介质
KR20160062688A (ko) 오버레이 네트워크 기반에서의 오리지널 패킷 플로우 매핑 장치 및 그 방법
WO2023005620A1 (zh) 报文处理方法、装置及通信系统
WO2017071350A1 (zh) 一种端口数据分离方法和装置
CN111182016B (zh) 一种PPPoE拨号报文传输方法及装置

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2016515622

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2014803900

Country of ref document: EP