WO2014146468A1 - 一种数据包调度和缓存的方法、装置和计算机存储介质 - Google Patents

一种数据包调度和缓存的方法、装置和计算机存储介质 Download PDF

Info

Publication number
WO2014146468A1
WO2014146468A1 PCT/CN2013/090594 CN2013090594W WO2014146468A1 WO 2014146468 A1 WO2014146468 A1 WO 2014146468A1 CN 2013090594 W CN2013090594 W CN 2013090594W WO 2014146468 A1 WO2014146468 A1 WO 2014146468A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
data
module
information
header
Prior art date
Application number
PCT/CN2013/090594
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 WO2014146468A1 publication Critical patent/WO2014146468A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control

Definitions

  • the present invention relates to the field of data communications, and in particular, to a method, an apparatus, and a computer storage medium for packet scheduling and caching. Background technique
  • the data packet needs to be determined according to the packet header information, the packet length information, and the Cyclic Redundancy Check (CRC). No need to save to the cache. Both the packet length information and the CRC check result need to be calculated after receiving the complete data packet, that is, it can be obtained at the end of the packet.
  • CRC Cyclic Redundancy Check
  • FIFO port data first in first out
  • embodiments of the present invention are directed to a method, a device, and a computer storage medium for scheduling and buffering data packets, which can save storage resources inside the chip and shorten the delay of the data packets in the chip.
  • An embodiment of the present invention provides a device for scheduling and buffering data packets, where the device includes a packet data FIFO module, a packet header data FIFO module, and a service processing module.
  • the packet data FIFO module is configured to: when the data packet data is scheduled to be read, extract packet header information of the data packet, and send the packet header information to a corresponding packet header data FIFO module for storage; and further configured to schedule the read packet.
  • the packet length information and the CRC check result are obtained, and the packet length information and the CRC check result are sent to the service processing module;
  • the packet header data FIFO module is configured to store packet header information sent by the packet data FIFO module; when the packet data FIFO module reads out the trailer header flag corresponding to the packet header information, the packet header information is read, and the packet header information is read The header information is sent to the service processing module;
  • the service processing module is configured to generate descriptor information according to the packet header information, the packet length information, and the CRC check result.
  • the device further includes a packet management module and an external storage module, where the packet management module is configured to receive descriptor information sent by the service processing module, and is further configured to apply for a logical address after receiving the data packet, And reserving a storage space for the descriptor information, performing polling scheduling on the data packet data and the descriptor information, and transmitting the data packet data and the descriptor information to an external storage module for storage;
  • the packet management module is configured to receive descriptor information sent by the service processing module, and is further configured to apply for a logical address after receiving the data packet, And reserving a storage space for the descriptor information, performing polling scheduling on the data packet data and the descriptor information, and transmitting the data packet data and the descriptor information to an external storage module for storage;
  • the external storage module is configured to store the packet data and the descriptor information; and is further configured to return a packet end data storage completion flag to the packet management module, and a descriptor information storage completion flag.
  • the packet data FIFO module is further configured to buffer the input data packet data before scheduling the read data packet data, and then perform polling scheduling on the data packet data.
  • the data packet data includes: a packet header flag, a data packet entity, and a trailer header identifier; the length of the packet header information is determined according to an amount of information required by the service processing module.
  • the device further includes a dequeue module configured to receive the identification information sent by the packet management module, and perform a team processing or discarding process on the data packet according to the identification information;
  • the packet management module is further configured to generate the identification information and send the identification information to the dequeue module after receiving the end-of-package data storage completion flag and the descriptor information storage completion flag.
  • the packet data FIFO module, the packet header data FIFO module, the service processing module, the packet management module, and the dequeue module are disposed in the traffic management chip;
  • the external storage module is a double rate synchronous dynamic random access memory (DDR SDRAM, Double Data Rate Synchronous Dynamic Random Access Memory ).
  • the embodiment of the invention further provides a method for scheduling and buffering data packets, and a packet data FIFO module and a packet header data FIFO module are provided for each input port; the method includes:
  • the packet data FIFO module schedules the reading of the packet data, the header information of the data packet is extracted, and the packet header information is sent to the corresponding packet header data FIFO module for storage;
  • the packet length information and the CRC check result are obtained, and the header information is read from the corresponding header data FIFO module; the descriptor information is generated based on the header information, the packet length information, and the CRC check result.
  • the method further includes:
  • the logical address is requested, and the storage space is reserved for the descriptor information, the data packet data and the descriptor information are polled and scheduled, and the data packet data and the descriptor information are sent to the external storage module.
  • the method before scheduling the reading of the data packet data from the packet data FIFO module, the method further comprises: when inputting the input data of the port, buffering the data packet data to the packet data FIFO module, and then The packet data is polled and scheduled.
  • the data packet data includes: a packet header flag, a data packet entity, and a trailer header identifier; the length of the packet header information is determined according to an amount of information required by the service processing module.
  • the method further includes:
  • the identifier information is generated, and the data packet is processed or discarded according to the identifier information.
  • the packet data FIFO module and the packet header data FIFO module are disposed in a traffic management chip; and the external storage module is a DDR SDRAM.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to execute the method for scheduling and buffering the data packet described above.
  • the data packet scheduling and buffering method, device and computer storage medium respectively set a packet data FIFO module and a packet header data FIFO module for each input port of the traffic management chip, and are read out from the packet data FIFO module.
  • Data packet data extracting packet header information of the data packet, and transmitting the packet header information to a corresponding packet header data FIFO module for storage; when reading the trailer tail flag, obtaining packet length information and CRC check result, and
  • the corresponding header data FIFO module reads the header information; and generates descriptor information according to the header information, the packet length information, and the CRC check result.
  • the technical solution of the embodiment of the present invention does not need to store a complete data packet for each input port, saves the storage resource of the traffic management chip, shortens the delay of the data packet in the chip, and describes the generated by the service processing module.
  • the information is stored in the external storage module, which also saves a lot of internal storage resources of the chip, reduces the cost of the chip, and greatly improves the area and power consumption of the chip.
  • FIG. 1 is a schematic structural diagram of a packet scheduling and buffering apparatus according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a function implementation of a packet management module according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an implementation process of a data packet scheduling and caching method according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a packet header information storage scheduling principle according to an embodiment of the present invention.
  • FIG. 1 is a schematic structural diagram of a packet scheduling and buffering apparatus according to an embodiment of the present invention. As shown in FIG. 1, the apparatus mainly includes a packet data FIFO module 11, a packet header data FIFO module 12, and a service processing module 13;
  • the packet data FIFO module 11 is configured to: when the data packet data is scheduled to be read, extract the header information of the data packet, and send the packet header information to the corresponding packet header data FIFO module 12 for storage; When the EOP (End Of Packet) is obtained, the packet length information and the CRC check result are obtained, and the packet length information and the CRC check result are sent to the service processing module 13;
  • EOP End Of Packet
  • the header data FIFO module 12 is configured to store header information sent by the packet data FIFO module 11; and is further configured to read out when the packet data FIFO module 11 reads out the trailer header corresponding to the header information Packet header information, and the header information is sent to the service processing module 13;
  • the packet data FIFO module 11 corresponds to the packet header data FIFO module 12, and corresponds to an input port of the traffic management chip, for storing data packet data and packet header information of the data packet.
  • the data packet data includes information such as a packet header information, a data packet entity, and a packet end flag, and the packet tail flag includes a packet length information and a CRC check result;
  • the header information is a piece of byte data starting from a packet header flag;
  • the service processing module 13 is configured to generate descriptor information based on the header information, the packet length information, and the CRC check result.
  • the packet scheduling and caching apparatus further includes: a package management module 14 and an external storage module 15;
  • the packet management module 14 is configured to receive the descriptor information sent by the service processing module 13; and is further configured to apply for a logical address after receiving the data packet, and reserve a storage space for the descriptor information, and then Descriptor information is subjected to polling scheduling, and the packet data and descriptor information are sent to the external storage module 15 for storage;
  • the external storage module 15 is configured to store packet data and descriptor information; and is further configured to return a packet end data storage completion flag to the packet management module 14, and a descriptor information storage completion flag.
  • the packet data FIFO module 11 is further configured to buffer the input data packet data before scheduling the read data packet data, and then perform polling scheduling on the data packet data.
  • the data packet data includes: a SOP (Start Of Packet), a data packet entity and a trailer identifier;
  • the length of the header information is determined according to the amount of information required by the service processing module 13.
  • the header information is the first 128 bytes of data of the data packet.
  • the packet scheduling and caching apparatus further includes a dequeue module 16, configured to receive the identification information sent by the packet management module 14, and perform a team processing or discarding process on the data packet according to the identification information;
  • the dequeuing process is to send the data read out from the external storage module 15 to the outside of the device through the network interface; the discarding process is not to send the data read from the external storage module 15 to the outside of the device, and the data is lost. Discard and not process;
  • the packet management module 14 is further configured to: after receiving the end-of-package data storage completion flag and the descriptor information storage completion flag, generate identification information, and send the identification information to the dequeue module 16.
  • the packet management module 14 indicates that the buffering of the data packet is completed; the packet management module determines that the data packet buffer is completed before the identifier can be generated. Information, and the identification information is sent to the dequeue module 16.
  • the packet data FIFO module 11, the packet header data FIFO module 12, the service processing module 13, the packet management module 14, and the dequeue module 16 are disposed in the traffic management chip.
  • the data packet scheduling and buffering device may be disposed in the traffic management chip; the packet data FIFO module 11, the packet header data FIFO module 12, the service processing module 13, the packet management module 14, and the dequeue module 16 may all be configured by the traffic.
  • the CPU Central Processing Unit
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • the external storage module 15 can be implemented in the traffic management chip. Storage media implementations, such as: Various types of memory.
  • the external storage module 15 can be a DDR SDRAM.
  • the function of the packet management module 14 is implemented as shown in FIG. 2; after receiving the data packet data, the packet management module 14 requests a logical address from the free list of the packet management module 14, and converts the logical address into a mapping. a physical address segment of the external storage module 15; and a storage space reserved for the descriptor information, that is, a storage space is reserved for the descriptor information by offsetting the fixed physical address; and then the received packet data and descriptor information are performed.
  • the scheduling is polled, and the packet data and descriptor information are sent to the external storage module 15 for storage.
  • the packet management module 14 can complete the establishment of the data link list according to the applied logical address while transmitting the data packet data and the descriptor information to the external storage module 15 for storage;
  • the completion of the completion of the data packet list is: creating a data link list in the idle linked list, so that the dequeue module dequeues or discards the data packet.
  • FIG. 3 is a schematic flowchart of an implementation process of a data packet scheduling and caching method according to an embodiment of the present invention. As shown in FIG. 3, the method mainly includes the following steps:
  • Step 301 Set a packet data FIFO module and a packet header data FIFO module for each input port. Piece;
  • the storage depth of the packet data FIFO module and the packet header data FIFO module are both shallow, that is, the capacity of the packet data FIFO module and the packet header data FIFO module are both small; because the present invention schedules from the packet data FIFO module When the data packet data is read, only the header information of the data packet data is extracted, and the packet header information is sent to the corresponding packet header data FIFO module for storage, and it is not necessary to store a complete data packet in advance, therefore, the required packet is required.
  • the data storage FIFO module has a small capacity; while the header information occupies a small amount of storage resources, the smaller header data FIFO module can satisfy the storage of the header information.
  • the packet data FIFO module is configured to buffer input data packet data; where the cached data packet data is data packet data read during polling scheduling, and does not need to store a complete data packet;
  • the packet data includes a header flag, a packet entity, and a trailer header.
  • the packet header data FIFO module is configured to buffer packet header information extracted from the packet data read and received by the packet data FIFO module, wherein the specific length of the extracted header information is determined by the service processing module according to the service data rule. The amount of information required is determined; in general, the extracted header information is the first 128 bytes of data of the packet.
  • Step 302 When the packet data FIFO module schedules the reading of the data packet data, extracting the packet header information of the data packet data, and sending the packet header information to the corresponding packet header data FIFO module for storage;
  • the method before scheduling the data packet data from the packet data FIFO module, the method further includes: when inputting the input data of the port, buffering the data packet data to the packet data FIFO module, and then performing polling scheduling on the data packet data.
  • the storage scheduling principle of the packet header information is as shown in FIG. 4, and the packet data FIFO module scheduling read packet data is sent to the packet management module; and when the packet data FIFO module is scheduled to read the packet data, the extraction is performed. Packet header information of the packet data, and sending the header information Store to the corresponding header data FIFO module. When the end-of-packet flag is read, the header information of the data packet is read from the header data FIFO of the corresponding port according to the port number of the data packet.
  • Step 303 When reading the package tail flag, obtaining the packet length information and the CRC check result, and reading the packet header information of the data packet from the corresponding packet header data FIFO module; according to the packet header information, the packet length information, and the CRC check The result generates descriptor information.
  • the packet data FIFO module reads the end-of-packet flag
  • the packet length information and the CRC check result are obtained by calculation; and, according to the port number of the data packet, the read-out is performed from the header data FIFO module of the corresponding port.
  • the packet header information of the packet is sent to the service processing module for processing together with the header information, the packet length information, and the CRC check result.
  • the service processing module processes the data according to a predetermined rule according to the packet header information, the packet length information, the CRC check result, and the like, and generates descriptor information about the packet processing result.
  • the method further includes: applying a logical address after receiving the data packet data, and reserving a storage space for the descriptor information, and then performing polling scheduling on the data packet data and the descriptor information, and the data packet is Data and descriptor information are sent to an external storage module for storage processing;
  • the packet management module receives data from two channels of the packet data and the descriptor information. Due to the processing delay relationship of the service processing module, the packet header flag of the packet data must arrive at the packet management module before the descriptor information. After the packet header of the packet data arrives at the packet management module, the packet management module starts to apply for a logical address from the free list, and starts to establish a packet data link table; the logical address needs to be mapped once to be converted into the physical address of the external storage module; When the data packet is sent to the external storage module for storage, it needs to be offset by a fixed physical address for storage, and the offset physical address space is reserved for the descriptor information of the data packet; then, the packet management module receives the data. The packet data and descriptor information are polled and dispatched, sent to an external storage module for storage, and the data can be completed according to the applied logical address. The establishment of the package list.
  • the data packet buffer is completed.
  • the method further includes: after receiving the packet end data storage completion flag and the descriptor information storage completion flag, generating identification information, and performing a team processing or discarding process on the data packet according to the identifier information.
  • the external storage module in order to avoid the case where the data packet is read out without being stored, the external storage module must return the end of the data storage completion flag and the descriptor information storage completion flag to indicate that the data packet is stored.
  • the packet management module can generate the flag information, and send the identification information to the dequeue module for processing.
  • the service processing module determines whether to discard the data packet according to the CRC check result and the predetermined rule. If the service processing module determines to discard the data packet, the dequeuing module discards the data packet.
  • the descriptor information generated by the service processing module includes information on whether the data packet is discarded.
  • the discarding process is not to send the data packet to the outside of the device, and the data packet is discarded; the dequeuing process is packet information read from an external storage module, and is sent to the device through a network interface. outer.
  • the embodiment of the present invention further describes a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to execute the data packet scheduling and caching method shown in FIG. 3 in the embodiment of the present invention.
  • packet data is separately set for each input port of the traffic management chip.
  • the FIFO module and the packet header data FIFO module extract the packet header information of the data packet when scheduling the packet data from the packet data FIFO module, and send the packet header information to the corresponding packet header data FIFO module for storage;
  • the tail flag is obtained, the packet length information and the CRC check result are obtained, and the header information is read from the corresponding packet header data FIFO module;
  • the descriptor information is generated according to the header information, the packet length information, and the CRC check result, thereby saving A large number of internal storage resources of the chip shorten the delay of the data packet within the chip, and improve the area and power consumption of the chip.

Landscapes

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

Abstract

本发明公开了一种数据包调度和缓存的方法、装置和计算机存储介质,其中,所述装置包括:包数据先入先出(FIFO)模块、包头数据FIFO模块和业务处理模块;其中,包数据FIFO模块,用于调度读出数据包数据时,提取数据包的包头信息,并将包头信息发送到包头数据FIFO模块进行存储;还用于调度读出包尾标志时,获得包长信息和循环冗余校验码(CRC)校验结果;包头数据FIFO模块,用于存储包头信息;当包数据FIFO模块读出与包头信息相对应的包尾标志时,读出所述包头信息;业务处理模块,用于根据包头信息、包长信息和CRC校验结果生成描述符信息。

Description

一种数据包调度和緩存的方法、 装置和计算机存储介庸 技术领域
本发明涉及数据通信领域, 尤其涉及一种数据包调度和緩存的方法、 装置和计算机存储介质。 背景技术
目前, 在传统的流量管理芯片中, 对于数据包的业务处理, 需要根据 数据包的包头信息、 包长信息和循环冗余校验码(CRC, Cyclic Redundancy Check )校验结果, 决定数据包需不需要存入緩存。 而包长信息和 CRC校 验结果均需要在接收到完整数据包后才能计算得出, 也就是说在包尾时才 能获得。
在实际应用中, 通常需要为每个输入端口开辟一个端口数据先入先出 ( FIFO, First In First Out )存储器, 用来存储至少一个完整数据包, 提取 包头信息并获知包长信息和 CRC校验结果后, 才将包头信息、 包长信息和 CRC校验结果发送到业务处理模块处理, 然后再在端口之间轮询调度输出 数据包数据。 如此, 不仅需要占用流量管理芯片内大量的存储资源, 也使 得数据包在流量管理芯片内的滞留时间较长。 随着网络业务的飞速增长, 流量管理芯片的输入端口数目越来越多, 并且数据包的长度越来越大, 对 芯片存储能力的要求也越来越高, 进而加大了芯片的成本。
另外, 数据包在业务处理模块中经过预定规则处理后, 会生成几十甚 至上百字节的描述符信息, 所述描述符信息通常存储在流量管理芯片内部, 无形中又增加了芯片的存储负担。 由于芯片所需存储资源越多, 芯片的面 积和功耗就越大, 因此, 如何节省大量片内存储资源、 降低芯片成本、 改 善芯片的面积和功耗, 是目前亟需解决的问题。 发明内容
有鉴于此, 本发明实施例期望提供一种数据包调度和緩存的方法、 装 置和计算机存储介质, 能够节省芯片内部的存储资源, 且缩短数据包在芯 片内的延时。
为达到上述目的, 本发明实施例的技术方案是这样实现的:
本发明实施例提供了一种数据包调度和緩存的装置, 所述装置包括包 数据 FIFO模块、 包头数据 FIFO模块和业务处理模块; 其中,
所述包数据 FIFO模块, 配置为调度读出数据包数据时, 提取所述数据 包的包头信息,并将所述包头信息发送到对应的包头数据 FIFO模块进行存 储; 还配置为调度读出包尾标志时, 获得包长信息和 CRC校验结果, 并将 所述包长信息和 CRC校验结果发送到业务处理模块;
所述包头数据 FIFO模块, 配置为存储包数据 FIFO模块发送的包头信 息; 当包数据 FIFO模块读出与所述包头信息相对应的包尾标志时, 读出所 述包头信息, 并将所述包头信息发送到业务处理模块;
所述业务处理模块, 配置为根据包头信息、 包长信息和 CRC校验结果 生成描述符信息。
优选地, 所述装置还包括包管理模块和外部存储模块; 其中, 所述包管理模块, 配置为接收业务处理模块发送的描述符信息; 还配 置为在收到数据包数据后申请逻辑地址, 并为描述符信息预留存储空间, 对数据包数据和描述符信息进行轮询调度, 将所述数据包数据和描述符信 息发送到外部存储模块进行存储;
所述外部存储模块, 配置为存储数据包数据和描述符信息; 还配置为 向包管理模块返回包尾数据存储完成标志, 以及描述符信息存储完成标志。
优选地,所述包数据 FIFO模块,还配置为在调度读出数据包数据之前, 对输入的数据包数据进行緩存, 然后对数据包数据进行轮询调度。 优选地, 所述数据包数据包括: 包头标志、 数据包实体和包尾标志; 所述包头信息的长度根据业务处理模块所需要的信息量决定。
优选地, 所述装置还包括出队模块, 配置为接收包管理模块发送的标 识信息, 并根据所述标识信息对数据包做出队处理或丟弃处理;
所述包管理模块, 还配置为在收到包尾数据存储完成标志和描述符信 息存储完成标志后, 生成标识信息并将所述标识信息发送到出队模块。
优选地, 所述包数据 FIFO模块、 包头数据 FIFO模块、 业务处理模块、 包管理模块、 出队模块设置于流量管理芯片中; 所述外部存储模块为双倍 速率同步动态随机存储器(DDR SDRAM, Double Data Rate Synchronous Dynamic Random Access Memory )。
本发明实施例还提供了一种数据包调度和緩存的方法, 为每个输入端 口设置包数据 FIFO模块和包头数据 FIFO模块; 所述方法包括:
从包数据 FIFO模块调度读出数据包数据时,提取所述数据包的包头信 息, 并将所述包头信息发送到对应的包头数据 FIFO模块进行存储;
读出包尾标志时, 获得包长信息和 CRC校验结果, 从对应的包头数据 FIFO模块读出包头信息; 根据所述包头信息、 包长信息和 CRC校验结果 生成描述符信息。
优选地, 所述方法还包括:
收到数据包数据后申请逻辑地址, 并为描述符信息预留存储空间, 对 数据包数据和描述符信息进行轮询调度, 并将所述数据包数据和描述符信 息发送到外部存储模块进行存储处理;
收到外部存储模块返回的包尾数据存储完成标志和描述符信息存储完 成标志后, 确定完成数据包緩存。
优选地,从包数据 FIFO模块调度读出数据包数据之前,该方法还包括: 输入端口输入数据时, 将数据包数据緩存至包数据 FIFO模块, 然后对 数据包数据进行轮询调度。
优选地, 所述数据包数据包括: 包头标志、 数据包实体和包尾标志; 所述包头信息的长度根据业务处理模块所需要的信息量决定。
优选地, 所述方法还包括:
收到包尾数据存储完成标志和描述符信息存储完成标志后, 生成标识 信息, 并根据所述标识信息对数据包做出队处理或丟弃处理。
优选地, 所述包数据 FIFO模块、 包头数据 FIFO模块设置于流量管理 芯片中; 所述外部存储模块为 DDR SDRAM。
本发明实施例还提供了一种计算机存储介质, 所述计算机存储介质中 存储有计算机程序, 所述计算机程序用于执行以上所述的数据包调度和緩 存的方法。
本发明实施例所提供的数据包调度和緩存的方法、 装置和计算机存储 介质,为流量管理芯片的每个输入端口分别设置包数据 FIFO模块和包头数 据 FIFO模块, 从包数据 FIFO模块调度读出数据包数据时, 提取所述数据 包的包头信息,并将所述包头信息发送到对应的包头数据 FIFO模块进行存 储; 读出包尾标志时, 获得包长信息和 CRC校验结果, 并从对应的包头数 据 FIFO模块读出包头信息; 根据所述包头信息、 包长信息和 CRC校验结 果生成描述符信息。 通过本发明实施例所述技术方案, 无需为每个输入端 口存储完整数据包, 节省了流量管理芯片的存储资源, 缩短了数据包在芯 片内的延时; 并且, 将业务处理模块生成的描述符信息存储在外部存储模 块中, 同样节省了大量的芯片内部存储资源, 降低了芯片成本, 大大改善 了芯片的面积和功耗。 附图说明
图 1为本发明实施例提供的数据包调度和緩存装置的组成结构示意图; 图 2为本发明实施例提供的包管理模块的功能实现示意图; 图 3为本发明实施例提供的数据包调度和緩存方法的实现流程示意图; 图 4为本发明实施例提供的包头信息存储调度原理示意图。 具体实施方式
以下结合附图对本发明的优选实施例进行详细说明, 应当理解, 以下 所说明的优选实施例仅用于说明和解释本发明, 并不用于限定本发明。
图 1为本发明实施例提供的数据包调度和緩存装置的组成结构示意图, 如图 1所示, 该装置主要包括包数据 FIFO模块 11、 包头数据 FIFO模块 12 和业务处理模块 13; 其中,
所述包数据 FIFO模块 11,配置为调度读出数据包数据时,提取所述数 据包的包头信息, 并将所述包头信息发送到对应的包头数据 FIFO模块 12 进行存储; 还配置为调度读出包尾标志(EOP, End Of Packet )时, 获得包 长信息和 CRC校验结果, 并将所述包长信息和 CRC校验结果发送到业务 处理模块 13 ;
所述包头数据 FIFO模块 12, 配置为存储包数据 FIFO模块 11发来的 包头信息; 还配置为当包数据 FIFO模块 11读出与所述包头信息相对应的 包尾标志时, 读出所述包头信息, 并将所述包头信息发送到业务处理模块 13;
其中, 所述包数据 FIFO模块 11与所述包头数据 FIFO模块 12——对 应, 且对应流量管理芯片的一个输入端口, 分别用于存储该输入端口传输 的数据包数据、 数据包的包头信息; 所述数据包数据中包括包头信息、 数 据包实体、 包尾标志等信息, 包尾标志中包括包长信息和 CRC校验结果; 所述包头信息是以包头标志为起点的一段字节数据;
所述业务处理模块 13, 配置为根据包头信息、 包长信息和 CRC校验结 果生成描述符信息。
这里, 所述生成描述符信息的过程与现有技术相同; 所述获得包长信 息和 CRC校验结果的方式与现有技术相同, 此处不再赘述。
进一步的, 所述数据包调度和緩存装置还包括: 包管理模块 14和外部 存储模块 15; 其中,
所述包管理模块 14, 配置为接收业务处理模块 13发送的描述符信息; 还配置为在收到数据包数据后申请逻辑地址, 并为描述符信息预留存储空 间, 然后对数据包数据和描述符信息进行轮询调度, 将所述数据包数据和 描述符信息发送到外部存储模块 15进行存储;
所述外部存储模块 15, 配置为存储数据包数据和描述符信息; 还配置 为向包管理模块 14返回包尾数据存储完成标志, 以及描述符信息存储完成 标志。
具体的,所述包数据 FIFO模块 11,还配置为在调度读出数据包数据之 前, 对输入的数据包数据进行緩存, 然后对数据包数据进行轮询调度。
其中, 所述数据包数据包括: 包头标志 (SOP, Start Of Packet ), 数据 包实体和包尾标志;
所述包头信息的长度根据业务处理模块 13所需要的信息量决定; 优选 的, 所述包头信息为数据包的前 128字节数据。
进一步的, 所述数据包调度和緩存装置还包括出队模块 16, 配置为接 收包管理模块 14发来的标识信息, 并根据所述标识信息对数据包做出队处 理或丟弃处理;
其中, 所述出队处理为将从外部存储模块 15读出的数据通过网络接口 发送到装置外; 所述丟弃处理为不向装置外发送从外部存储模块 15读出的 数据, 该数据丟弃不处理;
相应的, 所述包管理模块 14, 还配置为在收到包尾数据存储完成标志 和描述符信息存储完成标志后, 生成标识信息, 并将所述标识信息发送到 出队模块 16。 这里, 包管理模块 14在收到包尾数据存储完成标志和描述符信息存储 完成标志后, 表示对所述数据包的緩存完成; 包管理模块确定所述数据包 緩存完成后, 才可以产生标识信息, 并向出队模块 16发送所述标识信息。
具体的, 所述包数据 FIFO模块 11、 包头数据 FIFO模块 12、 业务处理 模块 13、 包管理模块 14、 出队模块 16设置于流量管理芯片中。
实际应用中, 所述数据包调度和緩存装置可设置于流量管理芯片中; 上述包数据 FIFO模块 11、 包头数据 FIFO模块 12、 业务处理模块 13、 包 管理模块 14、出队模块 16均可由流量管理芯片的中央处理器( CPU, Central Processing Unit ), 数字信号处理器(DSP, Digital Signal Processor )或现场 可编程门阵列 (FPGA, Field Programmable Gate Array ) 实现; 外部存储模 块 15可由流量管理芯片中的存储介质实现, 比如: 各种类型的存储器。
具体的, 所述外部存储模块 15可以为 DDR SDRAM。
具体的, 所述包管理模块 14的功能实现如图 2所示; 包管理模块 14 收到数据包数据后, 从包管理模块 14的空闲链表申请逻辑地址, 将所述逻 辑地址经过映射转换成外部存储模块 15的物理地址段; 并为描述符信息预 留存储空间, 即通过偏移固定的物理地址为描述符信息预留出存储空间; 然后对接收到的数据包数据和描述符信息进行轮询调度, 并将所述数据包 数据和描述符信息发送到外部存储模块 15进行存储。 这里, 包管理模块 14 在将所述数据包数据和描述符信息发送到外部存储模块 15 进行存储的同 时, 可根据所申请的逻辑地址完成数据包链表的建立;
其中, 所述完成数据包链表的建立为: 在空闲链表中创建一个数据包 链表, 以便于出队模块对数据包进行出队处理或丟弃处理。
图 3为本发明实施例提供的数据包调度和緩存方法的实现流程示意图, 如图 3所示, 该方法主要包括以下步骤:
步骤 301 : 为每个输入端口设置包数据 FIFO模块和包头数据 FIFO模 块;
这里,所述包数据 FIFO模块和包头数据 FIFO模块的存储深度均较浅, 也就是说, 所述包数据 FIFO模块和包头数据 FIFO模块的容量均较小; 因 为本发明从包数据 FIFO模块调度读出数据包数据时,仅提取所述数据包数 据的包头信息,并将所述包头信息发送到对应的包头数据 FIFO模块进行存 储, 无需预先存储一个完整的数据包, 因此, 所需的包数据存储 FIFO模块 的容量较小; 而包头信息所占的存储资源很少, 容量较小的包头数据 FIFO 模块即可满足包头信息的存储。
具体的, 所述包数据 FIFO模块, 用于緩存输入的数据包数据; 这里, 所述緩存的数据包数据是轮询调度时读出的数据包数据, 无需 存储完整的数据包; 其中, 所述数据包数据包括包头标志、 数据包实体和 包尾标志。
所述包头数据 FIFO模块, 用于緩存从包数据 FIFO模块轮询调度读出 的数据包数据中提取的包头信息; 其中, 所述提取的包头信息的具体长度 由业务处理模块根据业务数据规则所需的信息量决定; 一般来说, 提取的 包头信息为数据包的前 128字节数据。
步骤 302: 从包数据 FIFO模块调度读出数据包数据时, 提取所述数据 包数据的包头信息,并将所述包头信息发送到对应的包头数据 FIFO模块进 行存储;
具体的,从包数据 FIFO模块调度读出数据包数据之前,该方法还包括: 输入端口输入数据时, 将数据包数据緩存至包数据 FIFO模块, 然后对数据 包数据进行轮询调度。
具体的, 包头信息的存储调度原理如图 4所示, 将包数据 FIFO模块调 度读出数据包数据发送到包管理模块; 同时, 从包数据 FIFO模块调度读出 数据包数据时, 提取所述数据包数据的包头信息, 并将所述包头信息发送 到对应的包头数据 FIFO模块进行存储。 当读出包尾标志时, 根据所述数据 包的端口号, 从对应端口的包头数据 FIFO读出所述数据包的包头信息。
步骤 303: 读出包尾标志时, 获得包长信息和 CRC校验结果, 从对应 的包头数据 FIFO模块读出所述数据包的包头信息; 根据所述包头信息、 包 长信息和 CRC校验结果生成描述符信息。
这里, 当包数据 FIFO模块读出包尾标志时, 经计算可获得包长信息和 CRC校验结果; 同时, 根据所述数据包的端口号, 从对应端口的包头数据 FIFO模块读出所述数据包的包头信息, 将包头信息、 包长信息和 CRC校 验结果一起发送至业务处理模块进行处理。
这里, 包长信息和 CRC校验结果的计算方法与现有技术中的计算方法 相同。 业务处理模块根据包头信息、 包长信息、 CRC校验结果等按预定规 则对数据进行处理, 生成关于所述数据包处理结果的描述符信息。
进一步的, 所述方法还包括: 在接收到数据包数据后申请逻辑地址, 并为描述符信息预留存储空间, 然后对数据包数据和描述符信息进行轮询 调度, 并将所述数据包数据和描述符信息发送到外部存储模块进行存储处 理;
这里, 包管理模块会接收来自数据包数据和描述符信息两个通道的数 据, 由于业务处理模块的处理延时关系, 数据包数据的包头标志必定比描 述符信息先到达包管理模块。 数据包数据的包头标志到达包管理模块后, 包管理模块开始从空闲链表申请逻辑地址, 并开始建立数据包数据链表; 所述逻辑地址需要经过一次映射才能转换成外部存储模块的物理地 址; 将数据包数据发送到外部存储模块进行存储时, 需要偏移固定的物理 地址进行存储, 所偏移的物理地址空间为所述数据包的描述符信息作预留; 然后, 包管理模块对接收到的数据包数据和描述符信息进行轮询调度, 发送到外部存储模块进行存储, 同时能够根据所申请的逻辑地址完成数据 包链表的建立。
进一步的, 收到外部存储模块返回的包尾数据存储完成标志和描述符 信息存储完成标志后, 完成数据包緩存。
具体的, 所述方法还包括: 接收到包尾数据存储完成标志和描述符信 息存储完成标志后, 生成标识信息, 并根据所述标识信息对数据包做出队 处理或丟弃处理。
这里, 本实施例为了避免出现数据包没有存储完成即被读出的情况, 必须当外部存储模块返回包尾数据存储完成标志和描述符信息存储完成标 志后, 才表示这个数据包完成存储。 数据包完成存储后, 包管理模块才可 以产生标志信息, 将所述标识信息发送到出队模块处理。 业务处理模块根 据 CRC校验结果和预定规则判断对数据包是否做丟弃处理, 如果业务处理 模块判定对该数据包做丟弃处理时, 则在出队模块将该数据包做丟弃处理。 业务处理模块产生的描述符信息中包含了对所述数据包是否做丟弃处理的 信息。
其中, 所述丟弃处理为不向装置外发送所述数据包, 所述数据包丟弃 不处理; 所述出队处理为从外部存储模块读出来的数据包信息, 通过网络 接口发送到装置外。
本发明实施例还记载一种计算机存储介质, 所述计算机存储介质中存 储有计算机程序, 所述计算机程序用于执行本发明实施例中图 3 所示的数 据包调度和緩存方法。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 凡按照本发明原理所作的修改, 都应当理解为落入本发明的保护 范围。 工业实用性
本发明实施例中, 为流量管理芯片的每个输入端口分别设置包数据 FIFO模块和包头数据 FIFO模块,从包数据 FIFO模块调度读出数据包数据 时, 提取所述数据包的包头信息, 并将所述包头信息发送到对应的包头数 据 FIFO模块进行存储; 读出包尾标志时, 获得包长信息和 CRC校验结果, 并从对应的包头数据 FIFO模块读出包头信息; 根据所述包头信息、 包长信 息和 CRC校验结果生成描述符信息, 如此, 能节省大量的芯片内部存储资 源, 缩短了数据包在芯片内的延时, 改善了芯片的面积和功耗。

Claims

权利要求书
1、一种数据包调度和緩存的装置,所述装置包括包数据先入先出 FIFO 模块、 包头数据 FIFO模块和业务处理模块; 其中,
所述包数据 FIFO模块, 配置为调度读出数据包数据时, 提取所述数据 包的包头信息,并将所述包头信息发送到对应的包头数据 FIFO模块进行存 储; 还配置为调度读出包尾标志时, 获得包长信息和循环冗余校验码 CRC 校验结果, 并将所述包长信息和 CRC校验结果发送到业务处理模块;
所述包头数据 FIFO模块, 配置为存储包数据 FIFO模块发送的包头信 息; 当包数据 FIFO模块读出与所述包头信息相对应的包尾标志时, 读出所 述包头信息, 并将所述包头信息发送到业务处理模块;
所述业务处理模块, 配置为根据包头信息、 包长信息和 CRC校验结果 生成描述符信息。
2、 根据权利要求 1所述的装置, 其中, 所述装置还包括包管理模块和 外部存储模块; 其中,
所述包管理模块, 配置为接收业务处理模块发送的描述符信息; 还配 置为在收到数据包数据后申请逻辑地址, 并为描述符信息预留存储空间, 对数据包数据和描述符信息进行轮询调度, 将所述数据包数据和描述符信 息发送到外部存储模块进行存储;
所述外部存储模块, 配置为存储数据包数据和描述符信息; 还配置为 向包管理模块返回包尾数据存储完成标志, 以及描述符信息存储完成标志。
3、 根据权利要求 1所述的装置, 其中, 所述包数据 FIFO模块, 还配 置为在调度读出数据包数据之前, 对输入的数据包数据进行緩存, 然后对 数据包数据进行轮询调度。
4、 根据权利要求 1所述的装置, 其中, 所述数据包数据包括: 包头标 志、 数据包实体和包尾标志; 所述包头信息的长度根据业务处理模块所需要的信息量决定。
5、 根据权利要求 1所述的装置, 其中, 所述装置还包括出队模块, 配 置为接收包管理模块发送的标识信息, 并根据所述标识信息对数据包做出 队处理或丟弃处理;
所述包管理模块, 还配置为在收到包尾数据存储完成标志和描述符信 息存储完成标志后, 生成标识信息并将所述标识信息发送到出队模块。
6、 根据权利要求 5所述的装置, 其中, 所述包数据 FIFO模块、 包头 数据 FIFO模块、 业务处理模块、 包管理模块、 出队模块设置于流量管理芯 片中; 所述外部存储模块为双倍速率同步动态随机存储器 DDR SDRAM。
7、 一种数据包调度和緩存的方法, 为每个输入端口设置包数据 FIFO 模块和包头数据 FIFO模块; 所述方法包括:
从包数据 FIFO模块调度读出数据包数据时,提取所述数据包的包头信 息, 并将所述包头信息发送到对应的包头数据 FIFO模块进行存储;
读出包尾标志时, 获得包长信息和 CRC校验结果, 从对应的包头数据 FIFO模块读出包头信息; 根据所述包头信息、 包长信息和 CRC校验结果 生成描述符信息。
8、 根据权利要求 7所述的方法, 其中, 所述方法还包括:
收到数据包数据后申请逻辑地址, 并为描述符信息预留存储空间, 对 数据包数据和描述符信息进行轮询调度, 并将所述数据包数据和描述符信 息发送到外部存储模块进行存储处理;
收到外部存储模块返回的包尾数据存储完成标志和描述符信息存储完 成标志后, 确定完成数据包緩存。
9、 根据权利要求 7所述的方法, 其中, 从包数据 FIFO模块调度读出 数据包数据之前, 该方法还包括:
输入端口输入数据时, 将数据包数据緩存至包数据 FIFO模块, 然后对 数据包数据进行轮询调度。
10、 根据权利要求 7所述的方法, 其中, 所述数据包数据包括: 包头 标志、 数据包实体和包尾标志;
所述包头信息的长度根据业务处理模块所需要的信息量决定。
11、 根据权利要求 7所述的方法, 其中, 所述方法还包括:
收到包尾数据存储完成标志和描述符信息存储完成标志后, 生成标识 信息, 并根据所述标识信息对数据包做出队处理或丟弃处理。
12、 根据权利要求 7所述的方法, 其中, 所述包数据 FIFO模块、 包头 数据 FIFO 模块设置于流量管理芯片中; 所述外部存储模块为 DDR SDRAM。
13、 一种计算机存储介质, 所述计算机存储介质中存储有计算机可执 行指令, 所述计算机可执行指令用于执行权利要求 7至 12任一项所述的方 法。
PCT/CN2013/090594 2013-03-21 2013-12-26 一种数据包调度和缓存的方法、装置和计算机存储介质 WO2014146468A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310093886.4A CN104065588B (zh) 2013-03-21 2013-03-21 一种数据包调度和缓存的装置及方法
CN201310093886.4 2013-03-21

Publications (1)

Publication Number Publication Date
WO2014146468A1 true WO2014146468A1 (zh) 2014-09-25

Family

ID=51553126

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/090594 WO2014146468A1 (zh) 2013-03-21 2013-12-26 一种数据包调度和缓存的方法、装置和计算机存储介质

Country Status (2)

Country Link
CN (1) CN104065588B (zh)
WO (1) WO2014146468A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383313A (zh) * 2020-10-10 2021-02-19 中科驭数(北京)科技有限公司 一种并行数据解码装置及方法

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743810B (zh) * 2014-12-12 2018-09-14 北京永安信通科技股份有限公司 基于前向阀门的数据包传输调度方法和装置
CN113641612B (zh) * 2021-08-16 2022-07-26 中国科学院近代物理研究所 一种多通道数据实时处理设备
CN114125081B (zh) * 2021-10-27 2023-09-22 桂林长海发展有限责任公司 一种接收数据的处理方法、装置及存储介质
CN114785867A (zh) * 2022-04-25 2022-07-22 北京兴竹同智信息技术股份有限公司 一种绿通车道管理中业务数据的交互方法
CN115225586B (zh) * 2022-07-14 2024-04-26 中科驭数(北京)科技有限公司 数据包发送方法、装置、设备及计算机可读存储介质
CN116225999B (zh) * 2023-05-04 2023-07-21 太初(无锡)电子科技有限公司 一种dma数据传输方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1450767A (zh) * 2002-04-10 2003-10-22 深圳市中兴通讯股份有限公司 一种数据包转发控制装置和方法
CN1643872A (zh) * 2002-04-30 2005-07-20 思科技术公司 缓存流数据
CN101094176A (zh) * 2007-07-10 2007-12-26 杭州华三通信技术有限公司 多通道数据处理方法及装置
CN101194477A (zh) * 2005-06-09 2008-06-04 Nxp股份有限公司 通信系统节点的存储单元、数据存储方法及通信系统节点

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10260604B4 (de) * 2002-12-23 2006-09-21 Infineon Technologies Ag Multikanal-Prozessor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1450767A (zh) * 2002-04-10 2003-10-22 深圳市中兴通讯股份有限公司 一种数据包转发控制装置和方法
CN1643872A (zh) * 2002-04-30 2005-07-20 思科技术公司 缓存流数据
CN101194477A (zh) * 2005-06-09 2008-06-04 Nxp股份有限公司 通信系统节点的存储单元、数据存储方法及通信系统节点
CN101094176A (zh) * 2007-07-10 2007-12-26 杭州华三通信技术有限公司 多通道数据处理方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383313A (zh) * 2020-10-10 2021-02-19 中科驭数(北京)科技有限公司 一种并行数据解码装置及方法
CN112383313B (zh) * 2020-10-10 2023-08-04 中科驭数(北京)科技有限公司 一种并行数据解码装置及方法

Also Published As

Publication number Publication date
CN104065588B (zh) 2018-10-30
CN104065588A (zh) 2014-09-24

Similar Documents

Publication Publication Date Title
WO2014146468A1 (zh) 一种数据包调度和缓存的方法、装置和计算机存储介质
US11916781B2 (en) System and method for facilitating efficient utilization of an output buffer in a network interface controller (NIC)
WO2017067391A1 (zh) 虚拟机的数据共享方法及装置
US7751404B2 (en) Method, system, and computer program product for high performance bonding resequencing
WO2019024763A1 (zh) 报文处理
JP6340481B2 (ja) データキャッシング方法、装置及び記憶媒体
WO2016202120A1 (zh) 一种队列存储空间管理方法及装置、计算机存储介质
JP6189898B2 (ja) アクティブメッセージによるrmaapiのサポート
JP5094482B2 (ja) 処理装置及びその処理方法
WO2023124768A1 (zh) 图像采集卡、图像采集方法及图像采集系统
WO2016202158A1 (zh) 一种报文传输方法、装置及计算机可读存储介质
JP2010045767A (ja) ネットワーク処理装置及びその処理方法
WO2008003267A1 (fr) Système de transmission de paquets en rafales basé sur un réseau à commutation optique de rafales, et procédé correspondant
WO2014075489A1 (zh) 流量管理调度方法及装置
CN108614792B (zh) 1394事务层数据包存储管理方法及电路
CN107846328B (zh) 基于并发无锁环形队列的网络速率实时统计方法
US20160085683A1 (en) Data receiving device and data receiving method
CN115914130A (zh) 智能网卡的数据流量处理方法及装置
TW200404206A (en) Increasing memory access efficiency for packet applications
CN114205115B (zh) 一种数据包处理优化方法、装置、设备及介质
CN105307207B (zh) 无线联网装置中的数据传输的方法和无线联网装置
TWI689820B (zh) Usb傳輸系統、usb裝置與支援usb傳輸的主機
CN103856445A (zh) 基于udp的语音数据业务的数据传输方法、装置和系统
CN114285804B (zh) 一种控制数据发送的方法、装置及介质
WO2012106902A1 (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: 13878615

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13878615

Country of ref document: EP

Kind code of ref document: A1