WO2023093726A1 - 针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备 - Google Patents

针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备 Download PDF

Info

Publication number
WO2023093726A1
WO2023093726A1 PCT/CN2022/133542 CN2022133542W WO2023093726A1 WO 2023093726 A1 WO2023093726 A1 WO 2023093726A1 CN 2022133542 W CN2022133542 W CN 2022133542W WO 2023093726 A1 WO2023093726 A1 WO 2023093726A1
Authority
WO
WIPO (PCT)
Prior art keywords
hash
information
message
data
layer
Prior art date
Application number
PCT/CN2022/133542
Other languages
English (en)
French (fr)
Inventor
周伟
方沛昱
龚海东
Original Assignee
苏州盛科通信股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州盛科通信股份有限公司 filed Critical 苏州盛科通信股份有限公司
Publication of WO2023093726A1 publication Critical patent/WO2023093726A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the embodiments of the present invention relate to the field of network technologies, and in particular to a method and system for flexibly generating hash values for network load sharing applications, storage media and electronic devices.
  • ECMP Equal Cost Multi-path Routing, Equal Cost Multi-path Routing
  • ECMP technology is a basic and commonly used load sharing method. Multiple routing paths are bound into an ECMP group. Based on the received message, the Hash (hash) value is calculated to decide which path to forward to the ECMP group.
  • Hash determines the load burden efficiency of the entire network.
  • Many manufacturers now use more templates with fixed Hash data, and the templates of each manufacturer are different.
  • the fixed template method has great limitations and cannot meet the complex and numerous network application data types.
  • each system manufacturer has its own special application requirements for this, and they are different, which brings challenges to the chip design here.
  • the purpose of the embodiments of the present invention is to provide a method and system for flexibly generating a hash value, a storage medium, and an electronic device for network load sharing applications.
  • a method for flexibly generating hash values aimed at network load sharing applications comprising:
  • the input message data is classified and processed to form Hash data information
  • Hash calculation is performed based on the Hash data information to obtain a final hash value, which is used by the chip ECMP processing logic to select a forwarding path.
  • obtaining information in each layer header in the message data and message processing information includes:
  • the information in the headers of each layer in the message data is obtained through the parser Parser of the chip;
  • the message processing information is obtained through the forwarding and processing logic of the chip.
  • the classifying and processing the input message data to form Hash data information includes: classifying and processing the input message data through a ternary content addressable memory TCAM to form the Hash data information.
  • the matchable information when the TCAM classifies the input message data includes:
  • the three-layer header type includes IPv4, IPv6, MPLS; and/or,
  • the four-layer header type of the message includes UDP, TCP; and/or,
  • the forwarding type includes Layer 2 FDB forwarding, Layer 3 IP/MPLS forwarding; and/or,
  • a message Tunnel type includes VxLAN, IPinIP; and,
  • the polyProfileID includes one or more of XOR, CRC8, CRC16 and CRC32.
  • the classification processing of the input message data to form the Hash data information includes: reading the memory selected by the field according to the fieldSelectProfileID, and outputting the field information required for calculating the hash to form the Hash
  • the template and the corresponding Hash data read the mask memory of the field according to the fieldMaskProfileID, and output the mask mask of the field; perform an "AND" operation on the Hash data and mask to form the Hash data information; and/or,
  • Carry out Hash calculation based on the Hash data information to obtain a final hash value for the chip ECMP processing logic to select a forwarding path including: using the polyProfileID to select a Hash algorithm to calculate the Hash data information to obtain a final hash value , for the ECMP processing logic of the chip to select a forwarding path.
  • the present invention also provides a system for flexibly generating hash values aimed at network load sharing applications, including:
  • the obtaining module is configured to obtain the information in the headers of each layer in the message data and the message processing information;
  • the processing module is configured to classify and process the input message data based on the information in the headers of each layer and the message processing information to form Hash data information;
  • the output module is configured to perform Hash calculation based on the Hash data information to obtain a final hash value for the chip ECMP processing logic to select a forwarding path.
  • the acquisition module includes:
  • a first acquisition module the first acquisition module is configured to obtain the information in the headers of each layer in the message data through the parser Parser of the chip;
  • a second obtaining module is configured to obtain message processing information through the forwarding and processing logic of the chip.
  • An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor.
  • the processor executes the program, the method described above is implemented. A step of.
  • An embodiment of the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
  • the hash calculation can be flexibly performed according to the hash requirements, thereby obtaining the final hash value, and the flexibility It is fully handed over to upper-level users to form a differentiated design to better meet the needs of ECMP hash.
  • FIG. 1 is a schematic flow diagram of a method for flexibly generating hash values for network load sharing applications according to an embodiment of the present invention
  • Fig. 2 is a scene flowchart of a method for flexibly generating a hash value for a network load sharing application according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of the relationship between hash entries of a method for flexibly generating hash values for network load sharing applications according to an embodiment of the present invention
  • FIG. 4 is a block diagram of a system for flexibly generating hash values for network load sharing applications according to an embodiment of the present invention
  • FIG. 5 is a hardware structural diagram of a computing device for flexibly generating hash values for network load sharing applications according to an embodiment of the present invention.
  • the usual hard-coded design corresponds to a fixed Hash data template.
  • the five-tuple information is fixed as a template, and the Hash is calculated by configuring the field mask. This method may not be applicable in some scenarios, for example:
  • Hash For a certain packet type, it is not possible to flexibly select fields to calculate Hash. For example, IP packets cannot use the Mac (MediaAccess Control, Media Access Control) address field in the layer-2 header and the IP address field in the layer-3 header to calculate Hash together.
  • Mac MediaAccess Control, Media Access Control
  • Hash cannot be flexibly combined with the information in the inner header and the outer header.
  • VxLAN Virtual eXtensible Local Area Network, virtual extended local area network
  • the method includes:
  • the method for flexibly generating hash values for network load sharing applications in the embodiments of the present invention is usually applied in network chips.
  • the information in the headers of each layer in the message data may be obtained through the chip's parser Parser, and the message processing information may be obtained through the chip's forwarding and processing logic.
  • the embodiment of the present invention is based on the programmable angle, and tries to propose a flexible mechanism. From the design of the network chip, it can flexibly map and configure different application types, and select the message information and forwarding information that need to participate in Hash. , so here it may be to obtain all the information in the headers of each layer and the message processing information in the message data. However, in some embodiments, it is also possible to obtain only the information and message processing information in the headers of each layer in the specified range in the message data according to the needs of different application scenarios.
  • Hash data (hash data) information.
  • the input message data can be classified and processed by setting TCAM (ternary content addressable memory, ternary content addressable memory), so as to form the Hash data information here.
  • TCAM can be used to quickly find ACL (Access Control List, access control list), routing and other entries.
  • the matchable information when the TCAM classifies the input message data includes:
  • the three-layer header type includes IPv4 (Internet Protocol Version 4, Internet Protocol Version 4), IPv6 (Internet Protocol Version 6, Internet Protocol Version 6), MPLS (Multi-Protocol Label Switching, multi-protocol label switching); and/or,
  • the four-layer header type includes UDP (User Datagram Protocol, User Datagram Protocol), TCP (Transmission Control Protocol, Transmission Control Protocol); and/or,
  • Forwarding type described forwarding type comprises two-layer FDB (Forwarding Data Base, forwarding database) forwarding, three-layer IP/MPLS forwarding; And/or,
  • a message Tunnel type includes VxLAN, IPinIP; and,
  • the polyProfileID here may include one or more of XOR (Exclusive OR, exclusive OR), CRC (Cyclic Redundancy Check, cyclic redundancy check code) 8, CRC16 and CRC32.
  • the detailed process of forming Hash data information after classifying the input message data may include: reading the memory memory selected by the field according to fieldSelectProfileID, outputting the field information needed for calculating the hash, forming the Hash template and Corresponding Hash data; and read the mask memory of the field according to fieldMaskProfileID, and output the mask mask of the field.
  • On the basis of obtaining Hash data and mask perform "AND (&)" operation on Hash data and mask to form Hash data information.
  • the field information needed to calculate the hash is selected through fieldSelectProfileID, and the mask of the output field through fieldMaskProfileID can be flexibly set according to actual needs.
  • other forms of logic operations can be used for Hash data and mask according to requirements, thereby forming Hash data information.
  • polyProfileID may be used to select a Hash algorithm to calculate the Hash data information to obtain a final hash value for use by the chip ECMP processing logic to select a forwarding path.
  • the Hash algorithm here can be one or a combination of the above-mentioned XOR, CRC8, CRC16 and CRC32.
  • the fieldSelectProfileID is indexed to the DsFieldSelectProfile table, and then the field selection configuration is output, and the field that needs to be hashData0 (or called, hash data 0) is selected from the pre-prepared field set according to the configuration.
  • the field set here is a fixed-length Bus (bus), the information source, the result of message analysis, and some message processing information.
  • the fields in the field set are 16bits (bits) fixed length, and for some fields exceeding 16bits such as MacDa[47:0], it can be divided into three 16bits fields; or some fields are not enough 16bits, such as VLANID[11:0] , you can add 0 to make up 16bits, or add Cos (Class Of Service, business category) and CFI (Canonical Format Indicator, canonical format identifier) information in VLANTag (virtual local area network tag) to reach 16bits.
  • the Action table will also output the fieldMaskProfileID and index the DsFieldMaskProfile table at the same time.
  • This table will output the mask per-field, and form a hashDataMask (or called, hash data mask) with the same bit width as hashData0 according to the per-field mask configuration. And perform bitwise "AND" operation on hashData0 and hashDataMask to form the input hashData1 (or called, hash data 1) sent to the hash algorithm.
  • the Action table will also generate polyProfileID and index the DsHashPoly table.
  • This embodiment mainly aims at the complex, flexible, and differentiated hash requirements of system manufacturers, and proposes a hardware design method for flexibly calculating ECMP hash values, fully handing over the flexibility to upper-level users, forming differentiated designs, and better meeting ECMP hash requirements need.
  • the entire flexible hash mechanism includes solving flexible traffic classification through TCAM, selecting the fields required by hashData based on the profile (configuration) method based on the flow, and flexible field Mask and hash poly (hash polynomial).
  • FIG. 4 another embodiment of the present application provides a system for flexibly generating hash values for network load sharing applications, including:
  • the obtaining module is configured to obtain the information in the headers of each layer in the message data and the message processing information;
  • the processing module is configured to classify and process the input message data based on the information in the headers of each layer and the message processing information to form Hash data information;
  • the output module is set to carry out Hash calculation based on the Hash data information to obtain the final hash value for the chip ECMP processing logic to select the forwarding path.
  • the acquisition module includes:
  • a first acquisition module the first acquisition module is configured to obtain the information in the headers of each layer in the message data through the parser Parser of the chip;
  • a second obtaining module is configured to obtain message processing information through the forwarding and processing logic of the chip.
  • the processing module is configured to classify and process the input message data through the TCAM to form Hash data information.
  • the matchable information when the TCAM classifies the input message data includes:
  • the three-layer header type includes IPv4, IPv6, MPLS; and/or,
  • the four-layer header type of the message includes UDP, TCP; and/or,
  • the forwarding type includes Layer 2 FDB forwarding, Layer 3 IP/MPLS forwarding; and/or,
  • a message Tunnel type includes VxLAN, IPinIP; and,
  • the polyProfileID includes one or more of XOR, CRC8, CRC16 and CRC32.
  • processing module is set to:
  • the output module is set to:
  • FIG. 5 shows a hardware structure diagram of a computing device 30 for flexibly generating hash values for network load sharing applications according to an embodiment of the present specification.
  • computing device 30 may include at least one processor 301, memory 302 (such as non-volatile memory), memory 303 and communication interface 304, and at least one processor 301, memory 302, memory 303 and communication interface 304 are connected together via a bus 305 .
  • At least one processor 301 executes at least one computer readable instruction stored or encoded in memory 302 .
  • computing device 30 may include, but is not limited to, a personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smart phone, tablet computer, cellular phone, Personal Digital Assistant (PDA), Handheld Devices, Messaging Devices, Wearable Computing Devices, Consumer Electronics Devices, and more.
  • PDA Personal Digital Assistant
  • a program product such as a machine-readable medium
  • the machine-readable medium may have instructions (that is, the aforementioned elements implemented in software), which, when executed by a machine, cause the machine to perform various operations and functions described above in conjunction with FIGS. 1-3 in various embodiments of this specification.
  • a system or device equipped with a readable storage medium may be provided, on which a software program code for realizing the functions of any of the above embodiments is stored, and the computer of the system or device may Or the processor reads and executes the instructions stored in the readable storage medium.
  • the program code itself read from the readable medium can realize the function of any one of the above-mentioned embodiments, so the machine-readable code and the readable storage medium storing the machine-readable code constitute this description a part of.
  • Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM (compact disc read-only memory, CD-ROM), CD-R (Compact Disk-Recordable, write once, permanently read) standard), CD-RW (Compact Disk-Rewritable, rewritable disc), DVD-ROM (Digital Video Disc-read-only memory, digital versatile disc), DVD-RAM (Digital Versatile Disc-Random Access Memory, DVD random access memory), DVD-RW (DVD-Re-Writable, rewritable DVD), tape, non-volatile memory card and ROM.
  • it can be downloaded from the server computer or cloud by the communication network Download the program code.
  • the execution order of each step is not fixed, and can be determined as required.
  • the device structures described in the above embodiments may be physical structures or logical structures, that is, some units may be realized by the same physical client, or some units may be realized by multiple physical clients, or may be realized by multiple Certain components in individual devices are implemented together.
  • the hardware units or modules may be implemented mechanically or electrically.
  • a hardware unit, module, or processor may include permanently dedicated circuits or logic (such as a dedicated processor, FPGA (Field Programmable Gate Array, Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit, dedicated integrated circuit) circuit) to complete the corresponding operations.
  • Hardware units or processors can also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which can be temporarily set by software to complete corresponding operations.
  • Detailed implementation Mechanical means, or dedicated permanent circuits, or temporarily installed circuits) can be determined based on cost and time considerations.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供了一种针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备,其中,该方法包括:获取报文数据中的各层头中的信息和报文处理信息;基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data信息;基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。本发明实施例提出一种灵活计算ECMP hash值的硬件设计方法,将灵活性充分交给上层用户,形成差异化设计,更好的满足ECMP hash的需求。

Description

针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备
本申请要求于2021年11月26日提交中国专利局、申请号为202111423833.5、发明名称“针对网络负载分担应用的灵活产生hash值的方法和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及网络技术领域,特别涉及一种针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备。
背景技术
随着网络规模变大,用户的带宽需求剧增,负载分担应用越来越普遍,成为网络的必选,比如ECMP(等价多路径路由,Equal Cost Multi-path Routing)技术。ECMP技术是基本并常用的负载分担方式,将多条路由路径绑定成ECMP组,基于收到的报文,计算Hash(哈希)值来决策转发到该ECMP组走哪条路径。
ECMP技术的关键点之一在于Hash如何产生,这决定了整个网络的负载负担效率。现在很多厂商更多的采用固定Hash数据的模板方式,而且各厂商的模板也不同。固定模板方式存在较大的局限性,无法满足复杂众多的网络应用数据类型,同时各系统厂商针对这里有自己特殊的应用需求,而且各不相同,对芯片这里的设计带来挑战。
发明内容
有鉴于此,本发明实施例的目的在于提供针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备。
为了实现上述目的,本发明实施例提供的技术方案如下:
一种针对网络负载分担应用的灵活产生hash值的方法,所述方法包括:
获取报文数据中的各层头中的信息和报文处理信息;
基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data信息;
基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
在本发明的一实施例中,获取报文数据中的各层头中的信息和报文处理信息,包括:
经过芯片的解析器Parser得到报文数据中的各层头中的信息;
经过芯片的转发和处理逻辑得到报文处理信息。
在本发明的一实施例中,所述对输入的报文数据进行分类处理,形成Hash data信息,包括:通过三态内容寻址存储器TCAM对输入的报文数据进行分类处理,形成所述Hash data信息。
在本发明的一实施例中,所述TCAM对输入的报文数据进行分类处理时的可匹配信息包括:
三层头类型,所述三层头类型包括IPv4、IPv6、MPLS;和/或,
报文四层头类型,所述四层头类型包括UDP、TCP;和/或,
转发类型,所述转发类型包括二层FDB转发、三层IP/MPLS转发;和/或,
报文Tunnel类型,所述报文Tunnel类型包括VxLAN、IPinIP;以及,
TCAM的动态记忆输出字段选择的配置fieldSelectProfileID,字段Hash MASK配置fieldMaskProfileID;以及Hash多项式polyProfileID。
在本发明的一实施例中,所述polyProfileID包括XOR、CRC8、CRC16以及CRC32中的一种或多种。
在本发明的一实施例中,所述对输入的报文数据进行分类处理,形成Hash data信息,包括:根据所述fieldSelectProfileID读取字段选择的内存,输出选取计算hash需要的字段信息,组成Hash模板和对应的Hash data根据所述fieldMaskProfileID读取字段的掩码内存,输出字段的掩码mask;对所述Hash data和mask做“与”操作,形成所述Hash data信息;和/或,
基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用,包括:用所述polyProfileID选取Hash算法对所述Hash data信息进行计算,得到最终的hash值,以供所述芯片ECMP处理逻辑选转发路径使用。
本发明还提供一种针对网络负载分担应用的灵活产生hash值的系统,包括:
获取模块,被设置为获取报文数据中的各层头中的信息和报文处理信息;
处理模块,被设置为基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data信息;
输出模块,被设置为基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
在本发明的一实施例中,所述获取模块包括:
第一获取模块,所述第一获取模块被设置为经过芯片的解析器Parser得到报文数据中的各层头中的信息;
第二获取模块,所述第二获取模块被设置为经过芯片的转发和处理逻辑得到报文处理信息。
本发明实施例还提供一种电子设备,包括存储器、处理器及存储在所 述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如上所述方法的步骤。
本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述方法的步骤。
本发明实施例通过获取报文数据中各层头中的信息和报文处理信息,通过对这些数据分类处理,从而可以灵活地根据hash需求进行hash计算,从而得到最终的hash值,将灵活性充分交给上层用户,形成差异化设计,更好的满足ECMP hash的需求。
附图说明
图1为本发明一实施方式针对网络负载分担应用的灵活产生hash值的方法的流程示意图;
图2为本发明一实施方式针对网络负载分担应用的灵活产生hash值的方法的场景流程图;
图3为本发明一实施方式针对网络负载分担应用的灵活产生hash值的方法的hash表项关系示意图;
图4为本发明一实施方式针对网络负载分担应用的灵活产生hash值的系统的模块图;
图5为本发明一实施方式针对网络负载分担应用的灵活产生hash值的计算设备的硬件结构图。
具体实施方式
下面结合附图,对本发明实施例的详细实施方式进行详细描述,但应当理解本实用新型的保护范围并不受详细实施方式的限制。
除非另有其它明确表示,否则在整个说明书和权利要求书中,术语“包括”或其变换如“包含”或“包括有”等等将被理解为包括所陈述的元件 或组成部分,而并未排除其它元件或其它组成部分。
针对不同报文类型,通常的硬编码设计对应一个固定的Hash数据模板。如针对IP(Internet Protocol,互联网协议)报文,固定用五元组信息作为模板,通过配置字段掩码来计算Hash。这样的方式可能存在一些场景的不适用情况,例如:
(1)对于某个报文类型,无法灵活选字段计算Hash。比如IP报文,无法用二层头中的Mac(MediaAccess Control,媒体存取控制)地址字段和三层头中的IP地址字段共同计算Hash。
(2)对于Tunnel(隧道)格式的报文,无法灵活结合内层头和外层头中的信息计算Hash。比如VxLAN(Visual eXtensible Local Area Network,虚拟扩展本地局域网)报文,无法用内层二层头中Mac地址字段和外层三层头中的IP地址字段共同计算Hash。
(3)无法应对各系统厂商客户对不同报文格式和Hash字段对应的复杂需求。
参考图1-2,介绍本发明实施例的针对网络负载分担应用的灵活产生hash值的方法的一个可选的实施例。在本实施例中,该方法包括:
S11、获取报文数据中的各层头中的信息和报文处理信息。
本发明实施例的针对网络负载分担应用的灵活产生hash值的方法通常应用于网络芯片中。一实施例中,这里可以是经过芯片的解析器Parser得到报文数据中的各层头中的信息、以及经过芯片的转发和处理逻辑得到报文处理信息。
当然,本发明实施例是基于可编程角度出发,试图提出一种灵活的机制,从网络芯片设计上,可以针对不同应用类型,灵活映射配置,选取需要参与Hash的报文信息和转发信息的方式,因此这里可以是获取报文数据中的全部的各层头中的信息和报文处理信息。而在一些实施例中,还可 以是根据应用场景的需要不同,只获取报文数据中指定范围的各层头中的信息和报文处理信息。
S12、基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data(哈希数据)信息。
在芯片的设计上,可以通过设置TCAM(ternary content addressable memory,三态内容寻址存储器)对输入的报文数据进行分类处理,从而形成这里的Hash data信息。TCAM可以用于快速查找ACL(Access Control List,访问控制列表)、路由等表项。
一实施例中,TCAM对输入的报文数据进行分类处理时的可匹配信息包括:
三层头类型,所述三层头类型包括IPv4(Internet Protocol Version 4,互联网协议第四版)、IPv6(Internet Protocol Version 6,互联网协议第六版)、MPLS(Multi-Protocol Label Switching,多协议标签交换);和/或,
报文四层头类型,所述四层头类型包括UDP(User Datagram Protocol,用户数据报协议)、TCP(Transmission Control Protocol,传输控制协议);和/或,
转发类型,所述转发类型包括二层FDB(Forwarding Data Base,转发数据库)转发、三层IP/MPLS转发;和/或,
报文Tunnel类型,所述报文Tunnel类型包括VxLAN、IPinIP;以及,
TCAM的动态记忆输出字段选择的配置fieldSelectProfileID,字段Hash MASK配置fieldMaskProfileID;以及Hash多项式polyProfileID。
示范性地,这里的polyProfileID可以包括XOR(Exclusive OR,异或)、CRC(Cyclic Redundancy Check,循环冗余校验码)8、CRC16以及CRC32中的一种或多种。
一实施例中,在对输入的报文数据进行分类处理,形成Hash data信 息的详细过程可以是包括:根据fieldSelectProfileID读取字段选择的内存memory,输出选取计算hash需要的字段信息,组成Hash模板和对应的Hash data;以及根据fieldMaskProfileID读取字段的掩码内存Mask memory,输出字段的掩码mask。在获得了Hash data和mask的基础上,再对Hash data和mask做“与(&)”操作,形成Hash data信息。
这里通过fieldSelectProfileID选取计算hash需要的字段信息、以及通过fieldMaskProfileID输出字段的mask可以是根据实际的需求进行灵活设定。并且,在一些替换的实施例中对Hash data和mask还可以是根据需求采用其它形式的逻辑操作,从而形成Hash data信息。
S13、基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
一实施例中,可以是用polyProfileID选取Hash算法对Hash data信息进行计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。这里的Hash算法可以是上述的XOR、CRC8、CRC16以及CRC32中的一种或几种的组合。
参考图3,从表项串联关系角度对本申请的针对网络负载分担应用的灵活产生hash值的方法进行详细说明。
首先,通过TCAM匹配将对应类型的报文分类出来,配置操作表(Action表)中对应匹配的输入entry。
随后,出fieldSelectProfileID索引DsFieldSelectProfile表,进而输出字段选择配置,并根据配置在预先准备的字段集合中挑选需要作为hashData0(或称为,哈希数据0)的字段。这里字段集合是固定长度的Bus(总线)、信息来源与报文解析的结果、以及部分报文处理的信息。字段集合中字段是16bits(比特)固定长度,而对于一些超过16bits的字段比如MacDa[47:0],可以将其分成3个16bits字段;又或者一些字段不够16bits,比如VLANID[11:0],可以通过补0来补足16bits、或者增加 VLANTag(虚拟局域网标签)中Cos(Class Of Service,业务类别),CFI(Canonical Format Indicator,规范格式标识符)信息来达到16bits。
需要说明的是,这里如果是增加VLANTag中Cos,CFI信息来达到16bits,在Mask设计时,需要区分字段来出mask。
Action表还会同时会出fieldMaskProfileID,索引DsFieldMaskProfile表,该表会per-field的出mask,根据per-field mask配置形成和hashData0相同bit宽度的hashDataMask(或称为,哈希数据掩码)。并将hashData0和hashDataMask做按位“与”操作,形成送给hash算法的输入hashDatal(或称为,哈希数据1)。
Action表同时还会出polyProfileID,索引DsHashPoly表,这里可预先设计一些备选hash算法供选择,取到hash poly(或称为,哈希多项式)配置,根据输入的hashDatal计算,最终得到hash值(hashValue,或称为,哈希值),给芯片ECMP处理模块选路使用。
本实施例主要针对系统厂商复杂、灵活、差异的hash需求,提出一种灵活计算ECMP hash值的硬件设计方法,将灵活性充分交给上层用户,形成差异化设计,更好的满足ECMP hash的需求。整个灵活hash的机制,包括通过TCAM解决灵活的流分类,基于流采用profile(配置)方式挑选hashData需要的字段,同时灵活字段的Mask和hash poly(哈希多项式)。
参图4,本申请的另一个实施例提供一种针对网络负载分担应用的灵活产生hash值的系统,包括:
获取模块,被设置为获取报文数据中的各层头中的信息和报文处理信息;
处理模块,被设置为基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data信息;
输出模块,被设置为基于所述Hash data信息进行Hash计算,得到最 终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
在一个可选的实施例中,所述获取模块包括:
第一获取模块,所述第一获取模块被设置为经过芯片的解析器Parser得到报文数据中的各层头中的信息;
第二获取模块,所述第二获取模块被设置为经过芯片的转发和处理逻辑得到报文处理信息。
在一个可选的实施例中,处理模块被设置为通过TCAM对输入的报文数据进行分类处理,形成Hash data信息。
一实施例中,所述TCAM对输入的报文数据进行分类处理时的可匹配信息包括:
三层头类型,所述三层头类型包括IPv4、IPv6、MPLS;和/或,
报文四层头类型,所述四层头类型包括UDP、TCP;和/或,
转发类型,所述转发类型包括二层FDB转发、三层IP/MPLS转发;和/或,
报文Tunnel类型,所述报文Tunnel类型包括VxLAN、IPinIP;以及,
TCAM的动态记忆输出字段选择的配置fieldSelectProfileID,字段Hash MASK配置fieldMaskProfileID;以及Hash多项式polyProfileID。
在一个可选的实施例中,所述polyProfileID包括XOR、CRC8、CRC16以及CRC32中的一种或多种。
在一个可选的实施例中,处理模块被设置为:
根据fieldSelectProfileID读取字段选择的内存,输出选取计算hash需要的字段信息,组成Hash模板和对应的Hash data;
根据fieldMaskProfileID读取字段的掩码内存,输出字段的掩码mask;
对所述Hash data和mask做“与”操作,形成Hash data信息;
输出模块被设置为:
用polyProfileID选取Hash算法对Hash data信息进行计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
图5示出了根据本说明书的实施例的针对网络负载分担应用的灵活产生hash值的计算设备30的硬件结构图。如图5所示,计算设备30可以包括至少一个处理器301、存储器302(例如非易失性存储器)、内存303和通信接口304,并且至少一个处理器301、存储器302、内存303和通信接口304经由总线305连接在一起。至少一个处理器301执行在存储器302中存储或编码的至少一个计算机可读指令。
应该理解,在存储器302中存储的计算机可执行指令当执行时使得至少一个处理器301进行本说明书的各个实施例中以上结合图1-3描述的各种操作和功能。
在本说明书的实施例中,计算设备30可以包括但不限于:个人计算机、服务器计算机、工作站、桌面型计算机、膝上型计算机、笔记本计算机、移动计算设备、智能电话、平板计算机、蜂窝电话、个人数字助理(Personal Digital Assistant,PDA)、手持装置、消息收发设备、可佩戴计算设备、消费电子设备等等。
根据一个可选的实施例,提供了一种比如机器可读介质的程序产品。机器可读介质可以具有指令(即,上述以软件形式实现的元素),该指令当被机器执行时,使得机器执行本说明书的各个实施例中以上结合图1-3描述的各种操作和功能。可选地,可以提供配有可读存储介质的系统或者装置,在该可读存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算机或处理器读出并执行存储在该可读存储介质中的指令。
在这种情况下,从可读介质读取的程序代码本身可实现上述实施例中 任何一项实施例的功能,因此机器可读代码和存储机器可读代码的可读存储介质构成了本说明书的一部分。
可读存储介质的实施例包括软盘、硬盘、磁光盘、光盘(如CD-ROM(compact disc read-only memory,只读光盘存储器)、CD-R(Compact Disk-Recordable,一次写入、永久读的标准)、CD-RW(Compact Disk-Rewritable,可重复录写光盘)、DVD-ROM(Digital Video Disc-read-only memory,只读数字通用光盘)、DVD-RAM(Digital Versatile Disc-Random Access Memory,DVD随机存储器)、DVD-RW(DVD-Re-Writable,可重写式DVD)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机上或云上下载程序代码。
本领域技术人员应当理解,上面公开的各个实施例可以在不偏离发明实质的情况下做出各种变形和修改。因此,本说明书的保护范围应当由所附的权利要求书来限定。
需要说明的是,上述各流程和各系统结构图中不是所有的步骤和单元都是必须的,可以根据实际的需要忽略某些步骤或单元。各步骤的执行顺序不是固定的,可以根据需要进行确定。上述各实施例中描述的装置结构可以是物理结构,也可以是逻辑结构,即,有些单元可能由同一物理客户实现,或者,有些单元可能分由多个物理客户实现,或者,可以由多个独立设备中的某些部件共同实现。
以上各实施例中,硬件单元或模块可以通过机械方式或电气方式实现。例如,一个硬件单元、模块或处理器可以包括永久性专用的电路或逻辑(如专门的处理器,FPGA(Field Programmable Gate Array,现场可编程逻辑门阵列)或ASIC(Application Specific Integrated Circuit,专用集成电路)来完成相应操作。硬件单元或处理器还可以包括可编程逻辑或电路(如通用处理器或其它可编程处理器),可以由软件进行临时的设置以完成相应操作。详细的实现方式(机械方式、或专用的永久性电路、或者临时设置的电路)可以基于成本和时间上的考虑来确定。
上面结合附图阐述的实施方式描述了示例性实施例,但并不表示可以实现的或者落入权利要求书的保护范围的所有实施例。在整个本说明书中使用的术语“示例性”意味着“用作示例、实例或例示”,并不意味着比其它实施例“优选”或“具有优势”。出于提供对所描述技术的理解的目的,详细实施方式包括详细细节。然而,可以在没有这些详细细节的情况下实施这些技术。在一些实例中,为了避免对所描述的实施例的概念造成难以理解,公知的结构和装置以框图形式示出。
本发明实施例内容的上述描述被提供来使得本领域任何普通技术人员能够实现或者使用本发明实施例内容。对于本领域普通技术人员来说,对本发明实施例内容进行的各种修改是显而易见的,并且,也可以在不脱离本发明实施例内容的保护范围的情况下,将本文所对应的一般性原理应用于其它变型。因此,本发明实施例内容并不限于本文所描述的示例和设计,而是与符合本文公开的原理和新颖性特征的最广范围相一致。

Claims (10)

  1. 一种针对网络负载分担应用的灵活产生hash值的方法,所述方法包括:
    获取报文数据中的各层头中的信息和报文处理信息;
    基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data信息;
    基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
  2. 根据权利要求1所述的方法,其中,获取报文数据中的各层头中的信息和报文处理信息,包括:
    经过芯片的解析器Parser得到报文数据中的各层头中的信息;
    经过芯片的转发和处理逻辑得到所述报文处理信息。
  3. 根据权利要求2所述的方法,其中,所述对输入的报文数据进行分类处理,形成Hash data信息,包括:
    通过三态内容寻址存储器TCAM对输入的报文数据进行分类处理,形成所述Hash data信息。
  4. 根据权利要求3所述的针对网络负载分担应用的灵活产生hash值的方法,其中,所述TCAM对输入的报文数据进行分类处理时的可匹配信息包括:
    三层头类型,所述三层头类型包括IPv4、IPv6、MPLS;和/或,
    报文四层头类型,所述四层头类型包括UDP、TCP;和/或,
    转发类型,所述转发类型包括二层FDB转发、三层IP/MPLS转发;和/或,
    报文Tunnel类型,所述报文Tunnel类型包括VxLAN、IPinIP;以及,
    TCAM的动态记忆输出字段选择的配置fieldSelectProfileID,字段Hash MASK配置fieldMaskProfileID;以及Hash多项式 polyProfileID。
  5. 根据权利要求4所述的方法,其中,所述polyProfileID包括XOR、CRC8、CRC16以及CRC32中的一种或多种。
  6. 根据权利要求4所述的方法,其中,
    所述对输入的报文数据进行分类处理,形成Hash data信息,包括:根据所述fieldSelectProfileID读取字段选择的内存,输出选取计算hash需要的字段信息,组成Hash模板和对应的Hash data;根据所述fieldMaskProfileID读取字段的掩码内存,输出字段的掩码mask;对所述Hash data和mask做“与”操作,形成所述Hash data信息;和/或,
    基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用,包括:用所述polyProfileID选取Hash算法对所述Hash data信息进行计算,得到所述最终的hash值,以供所述芯片ECMP处理逻辑选转发路径使用。
  7. 一种针对网络负载分担应用的灵活产生hash值的系统,包括:
    获取模块,被设置为获取报文数据中的各层头中的信息和报文处理信息;
    处理模块,被设置为基于所述各层头中的信息和报文处理信息,对输入的报文数据进行分类处理,形成Hash data信息;
    输出模块,被设置为基于所述Hash data信息进行Hash计算,得到最终的hash值,以供芯片ECMP处理逻辑选转发路径使用。
  8. 根据权利要求7所述的系统,其中,所述获取模块包括:
    第一获取模块,所述第一获取模块被设置为经过芯片的解析器Parser得到报文数据中的各层头中的信息;
    第二获取模块,所述第二获取模块被设置为经过芯片的转发和处理逻辑得到所述报文处理信息。
  9. 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所 述处理器上运行的计算机程序,所述处理器执行所述程序时实现如权利要求1至6任一项所述方法的步骤。
  10. 一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述方法的步骤。
PCT/CN2022/133542 2021-11-26 2022-11-22 针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备 WO2023093726A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111423833.5A CN116192730A (zh) 2021-11-26 2021-11-26 针对网络负载分担应用的灵活产生hash值的方法和系统
CN202111423833.5 2021-11-26

Publications (1)

Publication Number Publication Date
WO2023093726A1 true WO2023093726A1 (zh) 2023-06-01

Family

ID=86442787

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/133542 WO2023093726A1 (zh) 2021-11-26 2022-11-22 针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备

Country Status (2)

Country Link
CN (1) CN116192730A (zh)
WO (1) WO2023093726A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143074A (zh) * 2011-03-25 2011-08-03 中兴通讯股份有限公司 网络负荷的分担方法、系统及网络处理器
US9237100B1 (en) * 2008-08-06 2016-01-12 Marvell Israel (M.I.S.L.) Ltd. Hash computation for network switches
CN105282133A (zh) * 2014-06-19 2016-01-27 凯为公司 从分组内容形成哈希输入的方法及其装置
CN108418765A (zh) * 2018-04-08 2018-08-17 盛科网络(苏州)有限公司 远程流量监控负载分担的芯片实现方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868631B (zh) * 2012-09-28 2016-09-21 华为技术有限公司 负载分担方法和装置
CN104184676B (zh) * 2013-05-27 2017-08-11 华为技术有限公司 一种数据中心网络及其流量均衡方法和控制器
US10958770B2 (en) * 2018-10-15 2021-03-23 Fungible, Inc. Realization of a programmable forwarding pipeline through packet header summaries in a data processing unit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9237100B1 (en) * 2008-08-06 2016-01-12 Marvell Israel (M.I.S.L.) Ltd. Hash computation for network switches
CN102143074A (zh) * 2011-03-25 2011-08-03 中兴通讯股份有限公司 网络负荷的分担方法、系统及网络处理器
CN105282133A (zh) * 2014-06-19 2016-01-27 凯为公司 从分组内容形成哈希输入的方法及其装置
CN108418765A (zh) * 2018-04-08 2018-08-17 盛科网络(苏州)有限公司 远程流量监控负载分担的芯片实现方法和装置

Also Published As

Publication number Publication date
CN116192730A (zh) 2023-05-30

Similar Documents

Publication Publication Date Title
US10764181B2 (en) Pipelined evaluations for algorithmic forwarding route lookup
US10764170B2 (en) Generation of path failure message at forwarding element based on message path
US10749794B2 (en) Enhanced error signaling and error handling in a network environment with segment routing
US9098601B2 (en) Ternary content-addressable memory assisted packet classification
TWI521922B (zh) 擴展網橋之系統及其方法
US10389632B1 (en) Non-recirculating label switching packet processing
US11687594B2 (en) Algorithmic TCAM based ternary lookup
WO2020182156A1 (zh) 网络中报文转发的方法、网络节点、网络系统
CN102868631B (zh) 负载分担方法和装置
CN103918246B (zh) 用于使用网络地址转换功能对ip分段进行数据分组处理的系统和方法
WO2020073685A1 (zh) 转发路径确定方法、装置、系统、计算机设备及存储介质
US8938579B2 (en) Method and system for using range bitmaps in TCAM access
CN105337881A (zh) 一种数据报文的处理方法、业务节点以及引流点
CN108600109A (zh) 一种报文转发方法和装置
CN110808924B (zh) 芯片环回报文处理方法、装置及存储介质
CN107294856A (zh) 确定拓扑变化的方法、设备及系统
CN116545921A (zh) 基于ecmp的报文转发方法、装置、设备及存储介质
WO2023093726A1 (zh) 针对网络负载分担应用的灵活产生hash值的方法和系统、存储介质和电子设备
CN110661713B (zh) 一种报文转发方法及装置
CN110741610A (zh) 具有本地交换的端口扩展器
US11811901B2 (en) Platform agnostic abstraction for forwarding equivalence classes with hierarchy
CN116939035A (zh) 数据处理方法、装置、电子设备以及存储介质
US10205658B1 (en) Reducing size of policy databases using bidirectional rules
Jeuk et al. Universal cloud classification (ucc) and its evaluation in a data center environment
CN115348202A (zh) 基于网络切片的数据传输方法、装置、设备及存储介质

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

Country of ref document: EP

Kind code of ref document: A1