CN116095195B - A method and device for generating industrial Ethernet data packets based on a localized platform - Google Patents

A method and device for generating industrial Ethernet data packets based on a localized platform Download PDF

Info

Publication number
CN116095195B
CN116095195B CN202310354423.2A CN202310354423A CN116095195B CN 116095195 B CN116095195 B CN 116095195B CN 202310354423 A CN202310354423 A CN 202310354423A CN 116095195 B CN116095195 B CN 116095195B
Authority
CN
China
Prior art keywords
data
serialization
sending
serialized
industrial ethernet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310354423.2A
Other languages
Chinese (zh)
Other versions
CN116095195A (en
Inventor
龚俊
罗森林
李龙杰
李竞择
欧阳迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Institute of Technology BIT
China South Industries Group Automation Research Institute
Original Assignee
Beijing Institute of Technology BIT
China South Industries Group Automation Research Institute
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 Beijing Institute of Technology BIT, China South Industries Group Automation Research Institute filed Critical Beijing Institute of Technology BIT
Priority to CN202310354423.2A priority Critical patent/CN116095195B/en
Publication of CN116095195A publication Critical patent/CN116095195A/en
Application granted granted Critical
Publication of CN116095195B publication Critical patent/CN116095195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/12Protocol engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种基于国产化平台的工业以太网数据包生成方法及装置,该方法可覆盖典型工业以太网协议特征数据包持续生成,为工业以太网流量分析研究,工业以太网安全分析、测试验证提供直接支持,具有良好的应用前景。同时,利用时间戳计数器(TSC)进行高分辨率时间测量来解决操作系统定时精度较低带来的无法精准依据记录给定时间点进行发送的问题。

Figure 202310354423

The invention discloses a method and device for generating industrial Ethernet data packets based on a localized platform. The method can cover the continuous generation of typical industrial Ethernet protocol characteristic data packets, and is useful for industrial Ethernet traffic analysis research, industrial Ethernet security analysis, Test verification provides direct support and has a good application prospect. At the same time, the time stamp counter (TSC) is used for high-resolution time measurement to solve the problem of inability to accurately record a given time point caused by the low timing accuracy of the operating system.

Figure 202310354423

Description

一种基于国产化平台的工业以太网数据包生成方法及装置A method and device for generating industrial Ethernet data packets based on a localized platform

技术领域technical field

本发明涉及网络测试技术领域,特别是涉及一种可覆盖典型工业以太网协议特征数据包持续生成的基于国产化平台的工业以太网数据包生成方法及装置。The invention relates to the technical field of network testing, in particular to a method and device for generating industrial Ethernet data packets based on a localized platform that can cover the continuous generation of characteristic data packets of typical industrial Ethernet protocols.

背景技术Background technique

网络安全就是网络上的信息安全,是指网络系统的硬件、软件及其系统中的数据受到保护,不受偶然的或者恶意的原因而遭到破坏、更改、泄露,系统连续可靠正常地运行,网络服务不中断。Network security is information security on the network, which means that the hardware, software and data in the network system are protected from being damaged, changed, or leaked due to accidental or malicious reasons, and the system runs continuously and reliably. Network services are not interrupted.

随着国家信息化和工业化的深度融合,大量信息化、智能化产品及先进技术手段被应用到各类工控系统中,打破了传统工业企业网络原本的物理隔离状态。各类技术被引入的同时信息技术安全风险也随之引入,为工业以太网安全防护带来了极大的挑战。为此,国内大量信息安全厂商也随之加大投入,推出了众多工业以太网安全设备及软件。With the deep integration of national informatization and industrialization, a large number of informatization, intelligent products and advanced technical means have been applied to various industrial control systems, breaking the original physical isolation of traditional industrial enterprise networks. When various technologies are introduced, information technology security risks are also introduced, which brings great challenges to the security protection of industrial Ethernet. For this reason, a large number of domestic information security manufacturers have also increased their investment and launched many industrial Ethernet security devices and software.

工业以太网安全设备及软件在研发完成后,需要对其性能进行验证,为了保证性能验证的准确性,通常需要将工业以太网安全设备及软件接入正常运行的相应工业以太网内。然而,由于工业以太网属于高价值网络,任何操作中断都将直接影响企业生产节奏,而常规的安全设备测试验证手段多会对网络数据监听处理后分析,由于安全设备及软件接入正常运行的以太网可能会影响以太网正常的时序,从而带来对工业网络正常数据实时性、时序性影响,对工业设备运转带来不可预期影响,而缺乏验证的工业以太网安全设备又无法体现其有效性。After the development of industrial Ethernet security equipment and software is completed, its performance needs to be verified. In order to ensure the accuracy of performance verification, it is usually necessary to connect industrial Ethernet security equipment and software to the corresponding industrial Ethernet in normal operation. However, because industrial Ethernet is a high-value network, any interruption of operation will directly affect the production rhythm of the enterprise. Conventional security equipment testing and verification methods will mostly monitor and analyze network data. Ethernet may affect the normal timing of Ethernet, which will affect the real-time and timing of normal data in the industrial network, and have unpredictable effects on the operation of industrial equipment, and the lack of verification of industrial Ethernet security equipment cannot reflect its effectiveness. sex.

为了解决上述问题,网络数据包生成器被提出,网络数据包生成器(又称网络测试仪,可以简称数据包生成器)通过生成特定的网络数据包,将该网络数据包发往待测网络安全设备中,并接收待测网络设备返回的数据包来实现性能测试、功能测试和网络连通性测试等功能。然而,现有技术中的网络数据包生成器普遍存在功能单一,由于模拟的工业以太网的数据量较大,传统的网络数据包生成器还存在数据包生成速度慢,数据发送存在中断以及卡断的问题。In order to solve the above problems, a network data packet generator is proposed. The network data packet generator (also known as a network tester, which can be referred to as a data packet generator) generates a specific network data packet and sends the network data packet to the network to be tested. In the security device, it receives the data packet returned by the network device to be tested to realize functions such as performance test, function test and network connectivity test. However, the network data packet generators in the prior art generally have a single function. Due to the large amount of data in the simulated industrial Ethernet, the traditional network data packet generators still have slow data packet generation speed, data transmission interruption and card failure. broken problem.

另外,当前国内使用的网络数据包生成装置多为基于国外硬件平台,由国外工程师研发而成,鉴于目前国际形势,其数据安全性、技术可获得性无法得到保障。随着国产化技术的不断发展,未来基于国产化平台的网络数据包生成装置也需要深入研究。因此亟需一种基于国产化平台,且能够对工业以太网特征数据全覆盖模拟生成的装置,为工业以太网安全技术发展、工业以太网性能检测提供基础支撑。In addition, most of the network data packet generation devices currently used in China are based on foreign hardware platforms and developed by foreign engineers. In view of the current international situation, their data security and technical availability cannot be guaranteed. With the continuous development of localization technology, the future network packet generation device based on the localization platform also needs in-depth research. Therefore, there is an urgent need for a device based on a localized platform that can simulate and generate full coverage of industrial Ethernet feature data to provide basic support for the development of industrial Ethernet security technology and industrial Ethernet performance testing.

发明内容Contents of the invention

鉴于上述问题,本发明提供用于克服上述问题或者至少部分地解决上述问题的一种基于国产化平台的工业以太网数据包生成方法及装置。可覆盖典型工业以太网协议特征数据包持续生成,为工业以太网流量分析研究,工业以太网安全分析、测试验证提供直接支持,具有良好的应用前景。In view of the above problems, the present invention provides a method and device for generating industrial Ethernet data packets based on a localized platform for overcoming the above problems or at least partially solving the above problems. It can cover typical industrial Ethernet protocol characteristic data packets and continuously generate, providing direct support for industrial Ethernet traffic analysis research, industrial Ethernet security analysis, test verification, and has a good application prospect.

本发明提供了如下方案:The present invention provides following scheme:

一种基于国产化平台的工业以太网数据包生成方法,包括:A method for generating industrial Ethernet data packets based on a localization platform, comprising:

获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;Obtain several data files stored in the file system, each of which includes industrial Ethernet data to be simulated in a data frame type;

将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;storing the data frame loads contained in the plurality of data files in a plurality of ring buffers in a one-to-one correspondence;

采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式;Using the multi-core parallel serialization model to serialize the data frame loads in the ring buffer one by one to obtain a number of serialization records, and push some of the serialization records into a multi-producer and multi-consumer lock-free queue; The multi-core parallel serialization model includes several first parallel worker threads, and the serialization record includes a target serialization format;

采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。Using the parallel sending model to take out some of the serialized records in the multi-producer and multi-consumer lock-free queue, and send them out through the network card in a direct memory access mode; the parallel sending model includes several second parallel jobs thread.

优选地:所述目标序列化格式包括从左向右依次排列的length域、timestamp域以及data payload域;所述length域用于表示数据包负载的长度,所述timestamp域用于表示数据包未来发送时刻,所述data payload域用于表示数据包发送时直接发送的数据负载。Preferably: the target serialization format includes a length field, a timestamp field, and a data payload field arranged in sequence from left to right; the length field is used to indicate the length of the data packet load, and the timestamp field is used to indicate the future of the data packet At the time of sending, the data payload field is used to indicate the data payload directly sent when the data packet is sent.

优选地:所述数据文件中存储的内容包括同一数据帧类型的所述待模拟工业以太网数据中OSI七层协议中物理层以上的所有数据帧负载。Preferably: the content stored in the data file includes all data frame loads above the physical layer in the OSI seven-layer protocol in the industrial Ethernet data to be simulated of the same data frame type.

优选地:采用数据创建线程创建获得若干所述环形缓冲区,若干所述环形缓冲区的数量与若干所述数据文件的数量相同,每个所述环形缓冲区包含的节点个数与每个所述数据文件包含的数据个数相同,所述节点的内容包括数据负载内容、数据负载长度、数据发送速度。Preferably: using a data creation thread to create and obtain several ring buffers, the number of several ring buffers is the same as the number of data files, and the number of nodes contained in each ring buffer is the same as that of each ring buffer The number of data contained in the data file is the same, and the content of the node includes the content of the data load, the length of the data load, and the speed of data transmission.

优选地:每个所述第一并行工作线程按所述环形缓冲区链表的串联顺序以多倍于所述多生产者多消费者无锁队列的消费速度,依次将所述环形缓冲区内的数据帧负载取出进行列化获得序列化记录。Preferably: each of the first parallel worker threads successively transfers the data in the ring buffer according to the serial order of the ring buffer linked list at a consumption speed that is multiple times that of the multi-producer and multi-consumer lock-free queue. The data frame load is taken out and serialized to obtain serialized records.

优选地:所述多核并行序列化模型单线程工作方法包括:Preferably: the multi-core parallel serialization model single-threaded working method includes:

确定所述多生产者多消费者无锁队列空信号量后,从对应的所述环形缓冲区取出数据负载内容、数据负载长度及数据发送速度相关信息;After determining the empty semaphore of the multi-producer and multi-consumer lock-free queue, fetch the data load content, data load length and data transmission speed related information from the corresponding ring buffer;

从内存池分配内存创建所述序列化记录并将数据长度填入所述序列化记录,所述内存池由所述数据创建线程创建获得。Allocating memory from a memory pool to create the serialization record and filling the data length into the serialization record, the memory pool being created by the data creation thread.

优选地:确定所述序列化记录为所述第一并行工作线程生成的首条序列化记录;Preferably: determining that the serialized record is the first serialized record generated by the first parallel worker thread;

获取系统时间戳计数器值以及计算首条所述序列化记录的第一发送时间戳并存入全局变量,作为后续生成所有所述序列化记录的基准参考点;Obtaining the system timestamp counter value and calculating the first sending timestamp of the first serialized record and storing it in a global variable as a benchmark reference point for subsequent generation of all the serialized records;

根据首条所述序列化记录的数据帧未来发送时间戳、所述系统时间戳计数器值以及第一发送时间戳计算获取首条所述序列化记录的数据帧未来发送时刻,并将所述数据帧未来发送时刻填入所述序列化记录;Calculate and obtain the future sending time of the data frame of the first serialized record according to the future sending timestamp of the data frame of the first serialized record, the value of the system timestamp counter, and the first sending timestamp, and store the data Fill in the serialization record at the time when the frame is sent in the future;

拷贝数据帧负载内容到所述序列化记录;Copy the data frame payload content to the serialized record;

将所述序列化记录推入多生产者多消费者无锁队列中。Push the serialized record into a multi-producer and multi-consumer lock-free queue.

优选地:所述采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送,包括:Preferably: using the parallel sending model to take out several of the serialized records in the multi-producer and multi-consumer lock-free queue, and send them out through the network card in the form of direct memory access, including:

确定本次发送为首次发送;Confirm that this sending is the first sending;

记录数据第二发送时间戳,将所述第二发送时间戳以及所述系统时间戳计数器值作为后续所有单线程发送数据的基准参考点。Record the second sending time stamp of the data, and use the second sending time stamp and the system time stamp counter value as a benchmark reference point for all subsequent single-thread sending data.

优选地:所述文件系统布置于基于国产化的飞腾平台中,所述网卡为基于飞腾平台的DMA网卡。Preferably: the file system is arranged on a Feiteng platform based on localization, and the network card is a DMA network card based on the Feiteng platform.

一种基于国产化平台的工业以太网数据包生成装置,包括:An industrial Ethernet data packet generation device based on a localized platform, comprising:

数据文件获取单元,获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;The data file acquisition unit acquires several data files stored in the file system, each of which includes industrial Ethernet data to be simulated in a data frame type;

缓存单元,用于将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;采用数据创建线程创建获得若干所述环形缓冲区,若干所述环形缓冲区的数量与若干所述数据文件的数量相同,每个所述环形缓冲区包含的节点个数与每个所述数据文件包含的数据个数相同,所述节点的内容包括数据负载内容、数据负载长度、数据发送速度;The cache unit is used to store the data frame loads contained in the plurality of data files in a plurality of ring buffers in a one-to-one correspondence; the data creation thread is used to create and obtain a plurality of the ring buffers, and the number of the plurality of ring buffers is The same as the number of several data files, the number of nodes contained in each ring buffer is the same as the number of data contained in each data file, and the content of the nodes includes data load content, data load length, data transmission speed;

序列化记录单元,用于采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式,每个所述第一并行工作线程按所述环形缓冲区链表的串联顺序以多倍于所述多生产者多消费者无锁队列的消费速度,依次将所述环形缓冲区内的数据帧负载取出进行序列化获得序列化记录;所述多核并行序列化模型单线程工作方法包括:The serialization recording unit is used to serialize the data frame loads in the ring buffer one by one by using the multi-core parallel serialization model to obtain a number of serialization records, and push the number of serialization records into the multi-producer multiple Consumer lock-free queue; the multi-core parallel serialization model includes several first parallel worker threads, the serialization records include the target serialization format, each of the first parallel worker threads is connected in series according to the ring buffer linked list Sequentially take out the data frame load in the ring buffer at a consumption speed that is multiple times that of the multi-producer multi-consumer lock-free queue and serialize to obtain serialized records; the multi-core parallel serialization model is single-threaded Working methods include:

确定所述多生产者多消费者无锁队列空信号量后,从对应的所述环形缓冲区取出负载内容、数据负载长度、数据发送速度相关信息;After determining the empty semaphore of the multi-producer multi-consumer lock-free queue, take out the load content, data load length, and data transmission speed related information from the corresponding ring buffer;

从内存池分配内存创建所述序列化记录并将数据长度填入所述序列化记录,所述内存池由所述数据创建线程创建获得;Allocating memory from a memory pool to create the serialized record and filling the data length into the serialized record, the memory pool being created and obtained by the data creation thread;

发送单元,用于采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。根据本发明提供的具体实施例,本发明公开了以下技术效果:A sending unit, configured to take out several of the serialized records in the multi-producer and multi-consumer lock-free queue by using a parallel sending model, and send them outward through the network card in a direct memory access mode; the parallel sending model includes A number of second parallel worker threads. According to the specific embodiments provided by the invention, the invention discloses the following technical effects:

本申请实施例提供的一种基于国产化平台的工业以太网数据包生成方法及装置,可覆盖典型工业以太网协议特征数据包持续生成,为工业以太网流量分析研究,工业以太网安全分析、测试验证提供直接支持,具有良好的应用前景。同时,利用时间戳计数器(TSC)进行高分辨率时间测量来解决操作系统定时精度较低带来的无法精准依据记录给定时间点进行发送的问题。The embodiment of the present application provides a method and device for generating industrial Ethernet data packets based on a localized platform, which can cover the continuous generation of characteristic data packets of typical industrial Ethernet protocols, and is used for industrial Ethernet traffic analysis research, industrial Ethernet security analysis, Test verification provides direct support and has a good application prospect. At the same time, the time stamp counter (TSC) is used for high-resolution time measurement to solve the problem of inability to accurately record a given time point caused by the low timing accuracy of the operating system.

序列化线程使用TSC结合产生的首个发送时间戳Tg作为后续生产记录时间基准,跨多个生产线程以相同的时间基准生成所有发送数据记录,解决了跨多个线程生成记录时间的一致性问题。The serialization thread uses the first sending timestamp Tg generated by TSC combination as the time reference for subsequent production records, and generates all sending data records with the same time reference across multiple production threads, which solves the consistency problem of generating record time across multiple threads .

发送单线程中使用TSC结合首个发送时间戳T0作为后续发送记录时间基准,并将发送时间点以相对量为表示形态,解决了单线程中所有发送记录时间同步的问题,同时解决了以往流量生成器无法持续发送速率可变的网络流量,具有更高的应用价值以及对更广的工业以太网实网流量应用场景的覆盖。In the sending single thread, TSC is used in combination with the first sending time stamp T0 as the time reference for subsequent sending records, and the sending time point is expressed as a relative quantity, which solves the problem of time synchronization of all sending records in a single thread, and solves the problem of previous traffic The generator cannot continuously send network traffic with a variable rate, which has higher application value and covers a wider range of industrial Ethernet real network traffic application scenarios.

通过将生成数据以及发送流量大小以及发送速率存于基于国产化平台文件系统,并采用数据内容全开放为可编辑的模式,使数据包生成器可覆盖基于以太网的全协议、全包长、全数据内容、全数据帧混合比例、全流量大小自定义工业以太网数据帧生成的应用场景。By storing the generated data, the size of the sent traffic and the sending rate in the file system based on the localization platform, and adopting an editable mode with the data content fully open, the data packet generator can cover the full protocol based on Ethernet, the full packet length, Full data content, full data frame mixing ratio, and full flow size customize the application scenarios for industrial Ethernet data frame generation.

当然,实施本发明的任一产品并不一定需要同时达到以上所述的所有优点。Of course, any product implementing the present invention does not necessarily need to achieve all the above-mentioned advantages at the same time.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings required in the embodiments. Apparently, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings according to these drawings without creative efforts.

图1是本发明实施例提供的一种基于国产化平台的工业以太网数据包生成方法的流程图;Fig. 1 is a flow chart of a method for generating industrial Ethernet data packets based on a localization platform provided by an embodiment of the present invention;

图2是本发明实施例提供的数据生成器架构示意图;Fig. 2 is a schematic diagram of the architecture of the data generator provided by the embodiment of the present invention;

图3是本发明实施例提供的序列化记录格式示意图;Fig. 3 is a schematic diagram of a serialized record format provided by an embodiment of the present invention;

图4是本发明实施例提供的多核并行序列化模型单线程工作流程图;FIG. 4 is a single-thread workflow diagram of the multi-core parallel serialization model provided by the embodiment of the present invention;

图5是本发明实施例提供的并行发送模型工作流程图;Fig. 5 is a working flowchart of the parallel transmission model provided by the embodiment of the present invention;

图6是本发明实施例提供的飞腾硬件平台示意图;Fig. 6 is a schematic diagram of the Feiteng hardware platform provided by the embodiment of the present invention;

图7是本发明实施例提供的一种基于国产化平台的工业以太网数据包生成装置的示意图;Fig. 7 is a schematic diagram of an industrial Ethernet data packet generating device based on a localization platform provided by an embodiment of the present invention;

图8是本发明实施例提供的一种基于国产化平台的工业以太网数据包生成设备的示意图。Fig. 8 is a schematic diagram of an industrial Ethernet data packet generation device based on a localized platform provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention belong to the protection scope of the present invention.

参见图1,为本发明实施例提供的一种基于国产化平台的工业以太网数据包生成方法,如图1所示,该方法可以包括:Referring to Fig. 1, a kind of industrial Ethernet packet generation method based on the localization platform provided by the embodiment of the present invention, as shown in Fig. 1, the method may include:

S101:获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;具体的,所述数据文件中存储的内容包括同一数据帧类型的所述待模拟工业以太网数据中OSI七层协议中物理层以上的所有数据帧负载。S101: Obtain several data files stored in the file system, each of which includes a data frame type of industrial Ethernet data to be simulated; specifically, the content stored in the data file includes the same data frame type All data frame loads above the physical layer in the OSI seven-layer protocol in the industrial Ethernet data to be simulated.

S102:将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;具体的,采用数据创建线程创建获得若干所述环形缓冲区,若干所述环形缓冲区的数量与若干所述数据文件的数量相同,每个所述环形缓冲区包含的节点个数与每个所述数据文件包含的数据个数相同,所述节点的内容包括数据负载内容、数据负载长度、数据发送速度。S102: Store the data frame loads contained in the plurality of data files in a plurality of ring buffers in one-to-one correspondence; specifically, use the data creation thread to create and obtain a plurality of the ring buffers, and the number of the plurality of ring buffers The same as the number of several data files, the number of nodes contained in each ring buffer is the same as the number of data contained in each data file, and the content of the nodes includes data load content, data load length, Data sending speed.

S103:采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式;具体的,所述目标序列化格式包括从左向右依次排列的length域、timestamp域以及data payload域;所述length域用于表示数据包负载的长度,所述timestamp域用于表示数据包未来发送时刻,所述data payload域用于表示数据包发送时直接发送的数据负载。S103: Use the multi-core parallel serialization model to serialize the data frame loads in the ring buffer one by one to obtain a number of serialized records, and push the serialized records into a multi-producer and multi-consumer lock-free queue ; The multi-core parallel serialization model includes several first parallel worker threads, and the serialization record includes a target serialization format; specifically, the target serialization format includes a length field, a timestamp field and data payload field; the length field is used to indicate the length of the data packet payload, the timestamp field is used to indicate the future sending time of the data packet, and the data payload field is used to indicate the data payload directly sent when the data packet is sent.

在实际应用中,每个所述第一并行工作线程按所述环形缓冲区链表的串联顺序以多倍于所述多生产者多消费者无锁队列的消费速度,依次将所述环形缓冲区内的数据帧负载取出进行列化获得序列化记录。In practical applications, each of the first parallel worker threads sequentially converts the ring buffer into the ring buffer at a consumption speed that is multiple times that of the multi-producer multi-consumer lock-free queue according to the serial order of the ring buffer linked list. The data frame load within is fetched and serialized to obtain serialized records.

所述多核并行序列化模型单线程工作方法包括:The single-thread working method of the multi-core parallel serialization model includes:

确定所述多生产者多消费者无锁队列空信号量后,从对应的所述环形缓冲区取出数据负载内容、数据负载长度及数据发送速度相关信息;After determining the empty semaphore of the multi-producer and multi-consumer lock-free queue, fetch the data load content, data load length and data transmission speed related information from the corresponding ring buffer;

从内存池分配内存创建所述序列化记录并将数据长度填入所述序列化记录,所述内存池由所述数据创建线程创建获得。Allocating memory from a memory pool to create the serialization record and filling the data length into the serialization record, the memory pool being created by the data creation thread.

确定所述序列化记录为所述第一并行工作线程生成的首条序列化记录;determining that the serialization record is the first serialization record generated by the first parallel worker thread;

获取系统时间戳计数器值以及计算首条所述序列化记录的第一发送时间戳并存入全局变量,作为后续生成所有所述序列化记录的基准参考点;Obtaining the system timestamp counter value and calculating the first sending timestamp of the first serialized record and storing it in a global variable as a benchmark reference point for subsequent generation of all the serialized records;

根据首条所述序列化记录的数据帧未来发送时间戳、所述系统时间戳计数器值以及第一发送时间戳计算获取首条所述序列化记录的数据帧未来发送时刻,并将所述数据帧未来发送时刻填入所述序列化记录;Calculate and obtain the future sending time of the data frame of the first serialized record according to the future sending timestamp of the data frame of the first serialized record, the value of the system timestamp counter, and the first sending timestamp, and store the data Fill in the serialization record at the time when the frame is sent in the future;

拷贝数据帧负载内容到所述序列化记录;Copy the data frame payload content to the serialized record;

将所述序列化记录推入多生产者多消费者无锁队列中。Push the serialized record into a multi-producer and multi-consumer lock-free queue.

S104:采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。具体的,确定本次发送为首次发送;S104: Use the parallel sending model to take out several of the serialized records in the multi-producer and multi-consumer lock-free queue, and use direct memory access to send them out through the network card; the parallel sending model includes several second Parallel worker threads. Specifically, it is determined that this sending is the first sending;

记录数据第二发送时间戳,将所述第二发送时间戳以及所述系统时间戳计数器值作为后续所有单线程发送数据的基准参考点。Record the second sending time stamp of the data, and use the second sending time stamp and the system time stamp counter value as a benchmark reference point for all subsequent single-thread sending data.

为了可以使得本申请实施例提供的基于国产化平台的工业以太网数据包生成方法可以基于国产化软件使用,本申请实施例还可以提供所述文件系统布置于基于国产化的飞腾平台中,所述网卡为基于飞腾平台的DMA网卡。In order to make the industrial Ethernet data packet generation method based on the localization platform provided by the embodiment of the present application can be used based on the localization software, the embodiment of the present application can also provide that the file system is arranged in the Feiteng platform based on the localization, so The network card mentioned above is a DMA network card based on the Phytium platform.

本申请实施例提供的基于国产化平台的工业以太网数据包生成方法,能够对工业以太网特征数据全覆盖模拟生成,测试设备时无需将安全设备直接接入已经运行的工业以太网内,通过本申请实施例提供的方法可以快速生成用于模拟相关工业以太网的数据包,在不破坏已经运行工业以太网正常实时性、时序性的前提下,实现对网络安全设备的高仿真度测试。为工业以太网安全技术发展、工业以太网性能检测提供基础支撑。The industrial Ethernet data packet generation method based on the localization platform provided by the embodiment of the present application can simulate and generate full coverage of industrial Ethernet characteristic data. When testing equipment, it is not necessary to directly connect the security device to the already running industrial Ethernet. The method provided by the embodiment of the present application can quickly generate data packets for simulating related industrial Ethernet, and realize high-simulation testing of network security equipment without destroying the normal real-time performance and timing of the already running industrial Ethernet. Provide basic support for the development of industrial Ethernet security technology and industrial Ethernet performance testing.

可以理解的是,本申请实施例提供的基于国产化平台的工业以太网数据包生成方法可以用于与网络数据包生成器中,网络数据包生成器(又称网络测试仪,可以简称数据包生成器)通过生成特定的网络数据包,将该网络数据包发往待测网络设备中,并接收待测网络设备返回的数据包来实现性能测试、功能测试和网络连通性测试等功能。数据包生成器在网络研究、开发和运维等方面具有重要的作用。网络研究人员可以利用数据包生成器测试网络原型系统的性能和功能,找到系统瓶颈;网络运维人员可利用数据包调试网络故障,检测网络服务质量。数据包生成器是不可或缺的网络工具,具有重要的社会经济效益和学术研究价值。It can be understood that the industrial Ethernet data packet generation method based on the localization platform provided by the embodiment of the present application can be used in the network data packet generator, the network data packet generator (also known as the network tester, can be referred to as the data packet The generator) generates a specific network data packet, sends the network data packet to the network device to be tested, and receives the data packet returned by the network device to be tested to realize functions such as performance test, function test and network connectivity test. Packet generators play an important role in network research, development, and operation and maintenance. Network researchers can use the data packet generator to test the performance and functions of the network prototype system and find system bottlenecks; network operation and maintenance personnel can use data packets to debug network faults and test network service quality. Packet generator is an indispensable network tool with important socio-economic benefits and academic research value.

下面以基于飞腾平台应用本申请实施例提供的方法为例,进行详细说明。The following uses the method provided by the embodiment of the present application based on the Feiteng platform as an example to describe in detail.

本申请实施例可以采用全国产化飞腾硬件平台设计,如图6所示,硬件平台采用的FT-2000/4 通用计算处理器芯片集成4个飞腾自主研发的处理器核心FTC663,兼容64位ARMv8指令集,16nm制程,主频最高3.0GHz,两个72位(支持ECC)DDR4-3200存储接口,两路16lane(每个可分拆为2个x8)、两路1lane PCIe3.0,最多支持6个PCIe3.0接口两个千兆以太网接口。FCBGA封装,引脚个数1144,封装尺寸35mmx35mm,最大功耗10W。The embodiment of this application can adopt the national production Feiteng hardware platform design, as shown in Figure 6, the FT-2000/4 general-purpose computing processor chip adopted by the hardware platform integrates 4 processor cores FTC663 independently developed by Feiteng, and is compatible with 64-bit ARMv8 Instruction set, 16nm process, main frequency up to 3.0GHz, two 72-bit (support ECC) DDR4-3200 storage interfaces, two 16lane (each can be split into 2 x8), two 1lane PCIe3.0, support up to 6 PCIe3.0 ports and two Gigabit Ethernet ports. FCBGA package, the number of pins is 1144, the package size is 35mmx35mm, and the maximum power consumption is 10W.

如图2所示为数据包生成器的架构,生成器由数据生产模块、多核并行序列化模型和多核并行序列化模型组成,下面分别对这四个组成部分进行详细介绍。Figure 2 shows the architecture of the packet generator. The generator consists of a data production module, a multi-core parallel serialization model and a multi-core parallel serialization model. The following four components are described in detail.

数据生产模块:由数据文件、数据创建线程和环形缓冲区组成。Data production module: consists of data files, data creation threads and ring buffers.

数据文件存储在基于国产化飞腾平台的文件系统的数据文件中,每个数据文件代表了一种工业以太网数据帧类型,数据文件存储的内容为OSI七层协议中物理层以上的所有数据帧负载。当需要生成不同类型工业以太网数据时,将不同帧类型的数据分别存储于不同文件之中。当需要生成同种类型不同长度、不同内容的工业以太网数据帧时,将数据帧负载存储于同一文件之中。The data files are stored in the data files of the file system based on the localized Feiteng platform, each data file represents a type of industrial Ethernet data frame, and the content stored in the data file is all data frames above the physical layer in the OSI seven-layer protocol load. When different types of industrial Ethernet data need to be generated, the data of different frame types are stored in different files. When it is necessary to generate industrial Ethernet data frames of the same type with different lengths and different contents, store the data frame load in the same file.

数据创建线程负责在生成器初始化时创建内存池供MPMC队列分配内存,此种设计可大大加快MPMC队列节点的创建速度。同时创建环形缓冲区,读取数据文件内容并将其复制到环形缓冲区。The data creation thread is responsible for creating a memory pool for the MPMC queue to allocate memory when the generator is initialized. This design can greatly speed up the creation of MPMC queue nodes. Also create a ring buffer, read the data file content and copy it to the ring buffer.

环形缓冲区存储从数据文件提取的数据帧负载,由基于双向循环链表的数据块组成。环形缓冲区由数据创建线程创建,数量取决于数据文件个数,每个环形缓冲区的节点数取决于每个数据文件的数据个数,节点内容包括数据负载内容、数据负载长度、数据发送速度。The ring buffer stores data frame payloads extracted from data files, consisting of data blocks based on a doubly linked list. The ring buffer is created by the data creation thread. The number depends on the number of data files. The number of nodes in each ring buffer depends on the number of data in each data file. The content of the nodes includes the content of the data load, the length of the data load, and the speed of sending data .

多核并行序列化模型:由多个第一并行工作线程组成,第一并行工作线程的数量取决于环形缓冲区的数量。每个线程按环形缓冲区链表的串联顺序、以多倍于MPMC无锁队列消费速度依次将数据取出后按照图3所示的目标序列化格式将其列化为记录,并将其推入MPMC无锁队列。这里以多倍于发送线程的速度取数据并序列化为记录,可保障MPMC无锁队列的生产速率始终大于消费速率,不会造成发送数据中断或卡顿。Multi-core parallel serialization model: composed of multiple first parallel worker threads, the number of first parallel worker threads depends on the number of ring buffers. Each thread sequentially fetches the data according to the concatenation order of the ring buffer linked list at a consumption speed many times faster than that of the MPMC lock-free queue, and then serializes it into a record according to the target serialization format shown in Figure 3, and pushes it into the MPMC Lock-free queue. Here, the data is fetched and serialized into records at a speed that is multiple times that of the sending thread, which can ensure that the production rate of the MPMC lock-free queue is always greater than the consumption rate, and will not cause interruption or lag in sending data.

其中该目标序列化格式包括从左向右依次排列的length域、timestamp域以及data payload域。The target serialization format includes a length field, a timestamp field, and a data payload field arranged in sequence from left to right.

length域:2字节,代表数据包负载的长度。length field: 2 bytes, representing the length of the data packet payload.

timestamp域:8个字节,高四字节为秒,低四字节为微秒,同linux系统下structtimeval结构体兼容,代表数据包未来发送时刻。timestamp field: 8 bytes, the high four bytes are seconds, and the low four bytes are microseconds, compatible with the structtimeval structure under the Linux system, representing the future sending time of the data packet.

data payload域:实际上的数据负载,数据包发送时直接发送的数据。data payload field: the actual data payload, the data sent directly when the data packet is sent.

多核并行序列化模型单线程工作流程如图4所示:The single-thread workflow of the multi-core parallel serialization model is shown in Figure 4:

步骤1:全局变量MPMC队列长度清零,等待发送线程完成初始化并通过信号量告知MPMC无锁队列为空,接收到MPMC无锁队列空信号量后,进入步骤2,否则继续执行步骤1。Step 1: the global variable MPMC queue length is cleared to zero, wait for the sending thread to complete initialization and inform MPMC by semaphore that the lock-free queue is empty, after receiving the empty semaphore of MPMC lock-free queue, enter step 2, otherwise continue to execute step 1.

步骤2:从对应的环形缓冲区取出数据、数据长度及发送速度相关信息,从内存池分配内存创建序列化记录并将数据长度填入序列化记录。Step 2: Take out data, data length and sending speed related information from the corresponding ring buffer, allocate memory from the memory pool to create a serialized record and fill the data length into the serialized record.

步骤3:探测记录是否为所有序列化线程生成的首条记录,若是首条记录,则首先执行步骤3-1,再执行步骤3-2,若不是首条记录,则直接执行步骤3-2。Step 3: Detect whether the record is the first record generated by all serialization threads. If it is the first record, first execute step 3-1, and then execute step 3-2. If it is not the first record, then directly execute step 3-2 .

步骤3-1:获取时间戳计数器的系统时间戳计数器值TSC (Ch)以及计算首条发送时间戳Tg(第一发送时间戳)并存入全局变量,作为后续生成所有序列化记录的基准参考点。Step 3-1: Obtain the system timestamp counter value TSC (Ch) of the timestamp counter and calculate the first sent timestamp Tg (first sent timestamp) and store it in a global variable as a benchmark reference for subsequent generation of all serialized records point.

步骤3-2:根据数据帧未来发送时间戳Tn结合系统时间戳计数器值TSC(Ch)以及第一发送时间戳Tg计算该数据帧未来发送时刻,发送时刻T=TSC(Ch)+(Tn-Tg),并将该发送时刻填入序列化记录。Step 3-2: Calculate the future sending time of the data frame according to the future sending time stamp Tn of the data frame in conjunction with the system time stamp counter value TSC (Ch) and the first sending time stamp Tg, sending time T=TSC(Ch)+(Tn- Tg), and fill the sending time into the serialized record.

步骤4:拷贝数据帧负载内容到序列化记录。Step 4: Copy the data frame payload content to the serialized record.

步骤5:将序列化记录推入MPMC无锁队列之中。Step 5: Push the serialized record into the MPMC lock-free queue.

步骤6:检测此次创建的队列数是否达到最大队列数,若达到最大队列数,则回到步骤1,若未达到最大队列数,则回到步骤2。Step 6: Detect whether the number of queues created this time reaches the maximum number of queues. If the maximum number of queues is reached, then return to step 1. If the maximum number of queues is not reached, then return to step 2.

由序列化线程创建的基于链表的无锁队列,队列的每个节点包含了序列化线程创建的序列化记录。无锁队列的个数由序列化线程数决定,队列最大长度为可配置。无锁数据结构的消费者为发送线程,由发送线程获取并释放。A linked list-based lock-free queue created by the serialization thread, each node of the queue contains the serialized records created by the serialization thread. The number of lock-free queues is determined by the number of serialization threads, and the maximum length of the queue is configurable. The consumer of the lock-free data structure is the sending thread, which is acquired and released by the sending thread.

多核并行序列化模型: 由多个第二并行工作线程组成,负责将MPMC队列中的数据取出并采用直接存储器访问(DMA)的方式通过飞腾平台网卡发送出去,是无锁数据结构的消费者。多核并行序列化模型工作流程如图5所示:Multi-core parallel serialization model: It is composed of multiple second parallel worker threads, which are responsible for taking out the data in the MPMC queue and sending them out through the Feiteng platform network card by means of direct memory access (DMA). It is a consumer of the lock-free data structure. The workflow of the multi-core parallel serialization model is shown in Figure 5:

步骤1:本轮发送记录数清零,向序列化线程发送无锁队列为空的信号量,通知序列化线程向MPMC无锁队列推送需要发送的数据。Step 1: the number of records sent in this round is cleared, and the semaphore that the lock-free queue is empty is sent to the serialization thread, and the serialization thread is notified to push the data that needs to be sent to the MPMC lock-free queue.

步骤2:探测MPMC无锁队列是否为空,若不为空,则执行步骤3,若为空,则休眠10ms,继续执行步骤2。Step 2: detect whether the MPMC lock-free queue is empty, if not empty, then perform step 3, if empty, then sleep for 10ms, and continue to perform step 2.

步骤3:取出MPMC无锁队列头中的数据,本轮发送帧计数自增加1。Step 3: Take out the data in the MPMC lock-free queue head, and the current round of sending frame counts increases by 1.

步骤4:探测本轮待发送MPMC无锁队列中的节点是否即将耗尽,耗尽条件为本轮发送记录计数达到最大队列长度数。若耗尽,则执行步骤4-1,若未耗尽,则执行步骤5。Step 4: detect whether the nodes in the MPMC lock-free queue to be sent in this round are about to be exhausted, and the exhaustion condition is that the sending record count of the current round reaches the maximum queue length number. If it is exhausted, go to step 4-1, if not, go to step 5.

步骤4-1:本轮发送记录计数清零,并向序列化线程发送无锁队列为空的信号量,通知序列化线程向MPMC无锁队列推送下一轮需要发送的数据。Step 4-1: The record count of this round is cleared, and the semaphore that the lock-free queue is empty is sent to the serialization thread, and the serialization thread is notified to push the data to be sent in the next round to the MPMC lock-free queue.

步骤5:从发送记录提取出需要发送的数据负载以及该数据的未来发送时间戳Tn,并释放该数据记录使用的内存到内存池。Step 5: Extract the data load to be sent and the future sending timestamp Tn of the data from the sending record, and release the memory used by the data record to the memory pool.

步骤6:探测本次发送是否为数据发生器启动后的首次发送,若为首次发送,则执行步骤6-1,若不是首次发送,则执行步骤7。Step 6: Detect whether this transmission is the first transmission after the data generator is started, if it is the first transmission, then perform step 6-1, if it is not the first transmission, then perform step 7.

步骤6-1:记录数据发送时间戳为T0(第二发送时间戳),获取并记录系统时间戳计数器值TSC(Ch),这两个值作为后续所有单线程发送数据的基准参考点。Step 6-1: Record the data sending time stamp as T0 (second sending time stamp), obtain and record the system time stamp counter value TSC(Ch), these two values are used as the benchmark reference point for all subsequent single-thread sending data.

步骤7:根据步骤5提取的数据未来发送时间戳Tn,并以T0为基准参考点计算出理论发送时间点TSC(Cd)=Tn-T0,并获取当前主机时间戳计数器值TSC(Cn)。Step 7: Send the time stamp Tn in the future according to the data extracted in step 5, and calculate the theoretical sending time point TSC(Cd)=Tn-T0 with T0 as the reference point, and obtain the current host time stamp counter value TSC(Cn).

步骤8:计算当前主机时间戳计数器值Cn与系统时间戳计数器值Ch +计算出理论发送时间点Cd大小关系;Step 8: Calculate the current host time stamp counter value Cn and the system time stamp counter value Ch+calculate the theoretical sending time point Cd size relationship;

若Cn>Ch +Cd,则执行步骤8-1;If Cn>Ch +Cd, perform step 8-1;

若Cn=>Ch +Cd,则执行步骤8-2;If Cn=>Ch +Cd, execute step 8-2;

若Cn=Ch +Cd,则执行步骤8-3。If Cn=Ch+Cd, perform step 8-3.

步骤8-1:未到发送时间点,跳转至步骤7等待Cn=>Ch +Cd。Step 8-1: before the sending time point, skip to step 7 and wait for Cn=>Ch +Cd.

步骤8-2:超出发送时间点,数据包违规,将该帧丢弃,跳转至步骤3执行。Step 8-2: If the sending time point is exceeded, the data packet violates the rules, the frame is discarded, and the execution is skipped to step 3.

步骤8-3:发送时间点到,将数据帧发送至基于飞腾平台的DMA网卡。Step 8-3: When the sending time is up, send the data frame to the DMA network card based on the Feiteng platform.

可见,本申请实施例提供的方法,利用时间戳计数器(TSC)进行高分辨率时间测量来解决操作系统定时精度较低带来的无法精准依据记录给定时间点进行发送的问题。It can be seen that the method provided by the embodiment of the present application uses a time stamp counter (TSC) for high-resolution time measurement to solve the problem that the operating system cannot accurately send at a given time point due to the low timing accuracy of the operating system.

发送单线程中使用TSC结合首个发送时间戳T0作为后续发送记录时间基准,并将发送时间点以相对量为表示形态,解决了单线程中所有发送记录时间同步的问题,同时解决了以往流量生成器无法持续发送速率可变的网络流量,具有更高的应用价值以及对更广的工业以太网实网流量应用场景的覆盖。In the sending single thread, TSC is used in combination with the first sending time stamp T0 as the time reference for subsequent sending records, and the sending time point is expressed as a relative quantity, which solves the problem of time synchronization of all sending records in a single thread, and solves the problem of previous traffic The generator cannot continuously send network traffic with a variable rate, which has higher application value and covers a wider range of industrial Ethernet real network traffic application scenarios.

序列化线程使用TSC结合产生的首个发送时间戳Tg作为后续生产记录时间基准,跨多个生产线程以相同的时间基准生成所有发送数据记录,解决了跨多个线程生成记录时间的一致性问题。The serialization thread uses the first sending timestamp Tg generated by TSC combination as the time reference for subsequent production records, and generates all sending data records with the same time reference across multiple production threads, which solves the consistency problem of generating record time across multiple threads .

通过将生成数据以及发送流量大小以及发送速率存于基于国产化平台文件系统,并采用数据内容全开放为可编辑的模式,使数据包生成器可覆盖基于以太网的全协议、全包长、全数据内容、全数据帧混合比例、全流量大小自定义工业以太网数据帧生成的应用场景。By storing the generated data, the size of the sent traffic and the sending rate in the file system based on the localization platform, and adopting an editable mode with the data content fully open, the data packet generator can cover the full protocol based on Ethernet, the full packet length, Full data content, full data frame mixing ratio, and full flow size customize the application scenarios for industrial Ethernet data frame generation.

参见图7,本申请实施例还可以提供一种基于国产化平台的工业以太网数据包生成装置,如图7所示,该装置可以包括:Referring to FIG. 7, the embodiment of the present application can also provide a device for generating industrial Ethernet data packets based on a localized platform. As shown in FIG. 7, the device can include:

数据文件获取单元701,获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;The data file obtaining unit 701 obtains several data files stored in the file system, each of which includes a data frame type of industrial Ethernet data to be simulated;

缓存单元702,用于将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;采用数据创建线程创建获得若干所述环形缓冲区,若干所述环形缓冲区的数量与若干所述数据文件的数量相同,每个所述环形缓冲区包含的节点个数与每个所述数据文件包含的数据个数相同,所述节点的内容包括数据负载内容、数据负载长度、数据发送速度;The cache unit 702 is used to store the data frame loads contained in the plurality of data files in a plurality of ring buffers in a one-to-one correspondence; use the data creation thread to create and obtain a plurality of the ring buffers, and the number of the ring buffers The number is the same as the number of several data files, the number of nodes included in each ring buffer is the same as the number of data included in each data file, and the content of the nodes includes data load content, data load length , data transmission speed;

序列化记录单元703,用于采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式,每个所述第一并行工作线程按所述环形缓冲区链表的串联顺序以多倍于所述多生产者多消费者无锁队列的消费速度,依次将所述环形缓冲区内的数据帧负载取出进行序列化获得序列化记录;所述多核并行序列化模型单线程工作方法包括:The serialization recording unit 703 is used to serialize the data frame loads in the ring buffer one by one by using the multi-core parallel serialization model to obtain a number of serialization records, and push the number of serialization records into the multi-producer Multi-consumer lock-free queue; the multi-core parallel serialization model includes a number of first parallel worker threads, the serialization record includes a target serialization format, and each of the first parallel worker threads follows the ring buffer linked list The series sequence is multiple times faster than the multi-producer multi-consumer lock-free queue, sequentially taking out the data frame load in the ring buffer for serialization to obtain serialized records; the multi-core parallel serialization model unit Thread work methods include:

确定所述多生产者多消费者无锁队列空信号量后,从对应的所述环形缓冲区取出负载内容、数据负载长度、数据发送速度相关信息;After determining the empty semaphore of the multi-producer multi-consumer lock-free queue, take out the load content, data load length, and data transmission speed related information from the corresponding ring buffer;

从内存池分配内存创建所述序列化记录并将数据长度填入所述序列化记录,所述内存池由所述数据创建线程创建获得;Allocating memory from a memory pool to create the serialized record and filling the data length into the serialized record, the memory pool being created and obtained by the data creation thread;

发送单元704,用于采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。The sending unit 704 is configured to use a parallel sending model to take out several of the serialized records in the multi-producer and multi-consumer lock-free queue, and send them outward through the network card in a direct memory access mode; the parallel sending model A number of second parallel worker threads are included.

本申请实施例还可以提供一种基于国产化平台的工业以太网数据包生成设备,所述设备包括处理器以及存储器:The embodiment of the present application can also provide an industrial Ethernet data packet generation device based on a localization platform, the device includes a processor and a memory:

所述存储器用于存储程序代码,并将所述程序代码传输给所述处理器;The memory is used to store program codes and transmit the program codes to the processor;

所述处理器用于根据所述程序代码中的指令执行上述的基于国产化平台的工业以太网数据包生成方法的步骤。The processor is configured to execute the steps of the above-mentioned method for generating industrial Ethernet data packets based on a localized platform according to instructions in the program code.

如图8所示,本申请实施例提供的一种基于国产化平台的工业以太网数据包生成设备,该设备可以包括:处理器10、存储器11、通信接口12和通信总线13。处理器10、存储器11、通信接口12均通过通信总线13完成相互间的通信。As shown in FIG. 8 , the embodiment of the present application provides an industrial Ethernet data packet generation device based on a localized platform, which may include: a processor 10 , a memory 11 , a communication interface 12 and a communication bus 13 . The processor 10 , the memory 11 , and the communication interface 12 all communicate with each other through the communication bus 13 .

在本申请实施例中,处理器10可以为中央处理器(Central Processing Unit,CPU)、特定应用集成电路、数字信号处理器、现场可编程门阵列或者其他可编程逻辑器件等。In the embodiment of the present application, the processor 10 may be a central processing unit (Central Processing Unit, CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic devices.

处理器10可以调用存储器11中存储的程序,具体的,处理器10可以执行基于国产化平台的工业以太网数据包生成方法的实施例中的操作。The processor 10 can call the program stored in the memory 11, specifically, the processor 10 can execute the operations in the embodiment of the method for generating an industrial Ethernet data packet based on a localized platform.

存储器11中用于存放一个或者一个以上程序,程序可以包括程序代码,程序代码包括计算机操作指令,在本申请实施例中,存储器11中至少存储有用于实现以下功能的程序:The memory 11 is used to store one or more programs. The programs may include program codes, and the program codes include computer operation instructions. In the embodiment of the present application, the memory 11 stores at least programs for realizing the following functions:

获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;Obtain several data files stored in the file system, each of which includes industrial Ethernet data to be simulated in a data frame type;

将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;storing the data frame loads contained in the plurality of data files in a plurality of ring buffers in a one-to-one correspondence;

采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式;Using the multi-core parallel serialization model to serialize the data frame loads in the ring buffer one by one to obtain a number of serialization records, and push some of the serialization records into a multi-producer and multi-consumer lock-free queue; The multi-core parallel serialization model includes several first parallel worker threads, and the serialization record includes a target serialization format;

采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。Using the parallel sending model to take out some of the serialized records in the multi-producer and multi-consumer lock-free queue, and send them out through the network card in a direct memory access mode; the parallel sending model includes several second parallel jobs thread.

在一种可能的实现方式中,存储器11可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统,以及至少一个功能(比如文件创建功能、数据读写功能)所需的应用程序等;存储数据区可存储使用过程中所创建的数据,如初始化数据等。In a possible implementation manner, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function (such as file creation function, data reading and writing function) Programs, etc.; the storage data area can store data created during use, such as initialization data.

此外,存储器11可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件或其他易失性固态存储器件。In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage devices.

通信接口12可以为通信模块的接口,用于与其他设备或者系统连接。The communication interface 12 may be an interface of a communication module, and is used for connecting with other devices or systems.

当然,需要说明的是,图8所示的结构并不构成对本申请实施例中基于国产化平台的工业以太网数据包生成设备的限定,在实际应用中基于国产化平台的工业以太网数据包生成设备可以包括比图8所示的更多或更少的部件,或者组合某些部件。Of course, it should be noted that the structure shown in Figure 8 does not constitute a limitation to the industrial Ethernet data packet generation device based on the localization platform in the embodiment of the application. In practical applications, the industrial Ethernet data packet based on the localization platform The generating device may include more or fewer components than shown in FIG. 8, or combine certain components.

本申请实施例还可以提供一种计算机可读存储介质,所述计算机可读存储介质用于存储程序代码,所述程序代码用于执行上述的基于国产化平台的工业以太网数据包生成方法的步骤。The embodiment of the present application can also provide a computer-readable storage medium, the computer-readable storage medium is used to store program code, and the program code is used to execute the above-mentioned industrial Ethernet data packet generation method based on the localization platform step.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加上必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。It can be known from the above description of the implementation manners that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , CD, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments of the present application.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的系统及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to part of the description of the method embodiment. The systems and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is It can be located in one place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.

Claims (7)

1.一种基于国产化平台的工业以太网数据包生成方法,其特征在于,包括:1. A method for generating industrial Ethernet data packets based on a localization platform, characterized in that, comprising: 获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;Obtain several data files stored in the file system, each of which includes industrial Ethernet data to be simulated in a data frame type; 将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;采用数据创建线程创建获得若干所述环形缓冲区,若干所述环形缓冲区的数量与若干所述数据文件的数量相同,每个所述环形缓冲区包含的节点个数与每个所述数据文件包含的数据个数相同,所述节点的内容包括数据负载内容、数据负载长度、数据发送速度;Store the data frame loads contained in several of the data files in a number of ring buffers in a one-to-one correspondence; use the data creation thread to create and obtain a number of the ring buffers, the number of the number of the ring buffers and the number of the data The number of files is the same, the number of nodes contained in each ring buffer is the same as the number of data contained in each data file, and the content of the nodes includes data load content, data load length, and data transmission speed; 采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式;每个所述第一并行工作线程按所述环形缓冲区链表的串联顺序以多倍于所述多生产者多消费者无锁队列的消费速度,依次将所述环形缓冲区内的数据帧负载取出进行序列化获得序列化记录;所述多核并行序列化模型单线程工作方法包括:Using the multi-core parallel serialization model to serialize the data frame loads in the ring buffer one by one to obtain some serialized records, and push some of the serialized records into a multi-producer and multi-consumer lock-free queue; The multi-core parallel serialization model includes several first parallel worker threads, and the serialization records include the target serialization format; each of the first parallel worker threads is multiple times the The consumption speed of multi-producer and multi-consumer lock-free queue, sequentially take out the data frame load in the ring buffer and serialize to obtain serialized records; the single-threaded working method of the multi-core parallel serialization model includes: 确定所述多生产者多消费者无锁队列空信号量后,从对应的所述环形缓冲区取出数据负载内容、数据负载长度及数据发送速度相关信息;After determining the empty semaphore of the multi-producer and multi-consumer lock-free queue, fetch the data load content, data load length and data transmission speed related information from the corresponding ring buffer; 从内存池分配内存创建所述序列化记录并将数据长度填入所述序列化记录,所述内存池由所述数据创建线程创建获得;Allocating memory from a memory pool to create the serialized record and filling the data length into the serialized record, the memory pool being created and obtained by the data creation thread; 采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。Using the parallel sending model to take out some of the serialized records in the multi-producer and multi-consumer lock-free queue, and send them out through the network card in a direct memory access mode; the parallel sending model includes several second parallel jobs thread. 2.根据权利要求1所述的基于国产化平台的工业以太网数据包生成方法,其特征在于,所述目标序列化格式包括从左向右依次排列的length域、timestamp域以及data payload域;所述length域用于表示数据包负载的长度,所述timestamp域用于表示数据包未来发送时刻,所述data payload域用于表示数据包发送时直接发送的数据负载。2. the industrial ethernet packet generation method based on the localization platform according to claim 1, is characterized in that, described target serialization format comprises length domain, timestamp domain and data payload domain that are arranged successively from left to right; The length field is used to indicate the length of the data packet payload, the timestamp field is used to indicate the future sending time of the data packet, and the data payload field is used to indicate the data payload directly sent when the data packet is sent. 3.根据权利要求1所述的基于国产化平台的工业以太网数据包生成方法,其特征在于,所述数据文件中存储的内容包括同一数据帧类型的所述待模拟工业以太网数据中OSI七层协议中物理层以上的所有数据帧负载。3. the method for generating industrial Ethernet data packets based on the localization platform according to claim 1, wherein the content stored in the data file includes the OSI data in the industrial Ethernet data to be simulated of the same data frame type All data frame loads above the physical layer in the seven-layer protocol. 4.根据权利要求1所述的基于国产化平台的工业以太网数据包生成方法,其特征在于,确定所述序列化记录为所述第一并行工作线程生成的首条序列化记录;4. the industrial Ethernet packet generation method based on the localization platform according to claim 1, is characterized in that, it is determined that the serialization record is the first serialization record that the first parallel worker thread generates; 获取系统时间戳计数器值以及计算首条所述序列化记录的第一发送时间戳并存入全局变量,作为后续生成所有所述序列化记录的基准参考点;Obtaining the system timestamp counter value and calculating the first sending timestamp of the first serialized record and storing it in a global variable as a benchmark reference point for subsequent generation of all the serialized records; 根据首条所述序列化记录的数据帧未来发送时间戳、所述系统时间戳计数器值以及第一发送时间戳计算获取首条所述序列化记录的数据帧未来发送时刻,并将所述数据帧未来发送时刻填入所述序列化记录;Calculate and obtain the future sending time of the data frame of the first serialized record according to the future sending timestamp of the data frame of the first serialized record, the value of the system timestamp counter, and the first sending timestamp, and store the data Fill in the serialization record at the time when the frame is sent in the future; 拷贝数据帧负载内容到所述序列化记录;Copy the data frame payload content to the serialized record; 将所述序列化记录推入多生产者多消费者无锁队列中。Push the serialized record into a multi-producer and multi-consumer lock-free queue. 5.根据权利要求4所述的基于国产化平台的工业以太网数据包生成方法,其特征在于,所述采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送,包括:5. the industrial ethernet packet generation method based on the localization platform according to claim 4, is characterized in that, described employing parallel transmission model will be described in some described sequences in the multi-producer multi-consumer lock-free queue The records are taken out and sent out through the network card in the way of direct memory access, including: 确定本次发送为首次发送;Confirm that this sending is the first sending; 记录数据第二发送时间戳,将所述第二发送时间戳以及所述系统时间戳计数器值作为后续所有单线程发送数据的基准参考点。Record the second sending time stamp of the data, and use the second sending time stamp and the system time stamp counter value as a benchmark reference point for all subsequent single-thread sending data. 6.根据权利要求5所述的基于国产化平台的工业以太网数据包生成方法,其特征在于,所述文件系统布置于基于国产化的飞腾平台中,所述网卡为基于飞腾平台的DMA网卡。6. the method for generating industrial ethernet packets based on the localization platform according to claim 5, wherein the file system is arranged in the Feiteng platform based on the localization, and the network card is a DMA network card based on the Feiteng platform . 7.一种基于国产化平台的工业以太网数据包生成装置,其特征在于,包括:7. A device for generating industrial Ethernet data packets based on a localization platform, characterized in that it comprises: 数据文件获取单元,获取存储于文件系统中的若干数据文件,每个所述数据文件包括一种数据帧类型的待模拟工业以太网数据;The data file acquisition unit acquires several data files stored in the file system, each of which includes industrial Ethernet data to be simulated in a data frame type; 缓存单元,用于将若干所述数据文件中包含的数据帧负载一一对应的存储于若干环形缓冲区内;采用数据创建线程创建获得若干所述环形缓冲区,若干所述环形缓冲区的数量与若干所述数据文件的数量相同,每个所述环形缓冲区包含的节点个数与每个所述数据文件包含的数据个数相同,所述节点的内容包括数据负载内容、数据负载长度、数据发送速度;The cache unit is used to store the data frame loads contained in the plurality of data files in a plurality of ring buffers in a one-to-one correspondence; the data creation thread is used to create and obtain a plurality of the ring buffers, and the number of the plurality of ring buffers is The same as the number of several data files, the number of nodes contained in each ring buffer is the same as the number of data contained in each data file, and the content of the nodes includes data load content, data load length, data transmission speed; 序列化记录单元,用于采用多核并行序列化模型将若干所述环形缓冲区内的数据帧负载一一进行序列化获得若干序列化记录,并将若干所述序列化记录推入多生产者多消费者无锁队列;所述多核并行序列化模型包括若干第一并行工作线程,所述序列化记录包括目标序列化格式,每个所述第一并行工作线程按所述环形缓冲区链表的串联顺序以多倍于所述多生产者多消费者无锁队列的消费速度,依次将所述环形缓冲区内的数据帧负载取出进行序列化获得序列化记录;所述多核并行序列化模型单线程工作方法包括:The serialization recording unit is used to serialize the data frame loads in the ring buffer one by one by using the multi-core parallel serialization model to obtain a number of serialization records, and push the number of serialization records into the multi-producer multiple Consumer lock-free queue; the multi-core parallel serialization model includes several first parallel worker threads, the serialization records include the target serialization format, each of the first parallel worker threads is connected in series according to the ring buffer linked list Sequentially take out the data frame load in the ring buffer at a consumption speed that is multiple times that of the multi-producer multi-consumer lock-free queue and serialize to obtain serialized records; the multi-core parallel serialization model is single-threaded Working methods include: 确定所述多生产者多消费者无锁队列空信号量后,从对应的所述环形缓冲区取出负载内容、数据负载长度、数据发送速度相关信息;After determining the empty semaphore of the multi-producer multi-consumer lock-free queue, take out the load content, data load length, and data transmission speed related information from the corresponding ring buffer; 从内存池分配内存创建所述序列化记录并将数据长度填入所述序列化记录,所述内存池由所述数据创建线程创建获得;Allocating memory from a memory pool to create the serialized record and filling the data length into the serialized record, the memory pool being created and obtained by the data creation thread; 发送单元,用于采用并行发送模型将所述多生产者多消费者无锁队列中的若干所述序列化记录取出,并采用直接存储器访问的方式通过网卡向外发送;所述并行发送模型包括若干第二并行工作线程。A sending unit, configured to take out several of the serialized records in the multi-producer and multi-consumer lock-free queue by using a parallel sending model, and send them outward through the network card in a direct memory access mode; the parallel sending model includes A number of second parallel worker threads.
CN202310354423.2A 2023-04-06 2023-04-06 A method and device for generating industrial Ethernet data packets based on a localized platform Active CN116095195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310354423.2A CN116095195B (en) 2023-04-06 2023-04-06 A method and device for generating industrial Ethernet data packets based on a localized platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310354423.2A CN116095195B (en) 2023-04-06 2023-04-06 A method and device for generating industrial Ethernet data packets based on a localized platform

Publications (2)

Publication Number Publication Date
CN116095195A CN116095195A (en) 2023-05-09
CN116095195B true CN116095195B (en) 2023-06-20

Family

ID=86202908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310354423.2A Active CN116095195B (en) 2023-04-06 2023-04-06 A method and device for generating industrial Ethernet data packets based on a localized platform

Country Status (1)

Country Link
CN (1) CN116095195B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114050979A (en) * 2021-11-19 2022-02-15 成都卓源网络科技有限公司 Industrial control protocol safety test system and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102531645B1 (en) * 2020-02-24 2023-05-11 주식회사 마키나락스 Computer program for performance testing of models
CN111488219B (en) * 2020-04-07 2022-08-02 中国科学院自动化研究所 Ethernet data flow recording method for high-speed data acquisition system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114050979A (en) * 2021-11-19 2022-02-15 成都卓源网络科技有限公司 Industrial control protocol safety test system and device

Also Published As

Publication number Publication date
CN116095195A (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN104615477B (en) Analyze FPGA method and system
CN110352588B (en) Method and apparatus for collecting telemetry data
WO2016090908A1 (en) Memory simulation testing board system and testing method for embedded application of intelligent electric meter
US12001317B2 (en) Waveform based reconstruction for emulation
US7861070B2 (en) Trace compression method for debug and trace interface wherein differences of register contents between logically adjacent registers are packed and increases of program counter addresses are categorized
CN111600760B (en) Quality detection system, method and equipment of power grid operation monitoring system
TWI731898B (en) Serial i/o functional tester
US11176018B1 (en) Inline hardware compression subsystem for emulation trace data
CN116095195B (en) A method and device for generating industrial Ethernet data packets based on a localized platform
CN104780123B (en) A kind of network pack receiving and transmitting processing unit and its design method
CN107783760B (en) A visual development method of protection device based on functional components
CN115622896A (en) AXI4 high-speed bus and multi-queue simulation verification method and simulation verification device
CN103415085A (en) Automatic generation method of general MAC protocol processor
US11477101B2 (en) Communication time calculation method and recording medium recording communication time calculation program
Brown et al. Tracing data movements within MPI collectives
CN115865645A (en) Link determination method, device, equipment, medium and product
CN114944998A (en) Internet of things system testing method and device based on simulator
CN113867890A (en) Log collection method, device and medium
CN114461350A (en) Container usability testing method and device
WO2020232682A1 (en) Parallel compression system and method employing hardware
CN115684897B (en) Chip testing methods and devices
Huang Hardware nanosecond‐precision timestamping for line‐rate packet capture
CN109445805A (en) A kind of multiplexing method and device of JTAG
CN118519860B (en) Interface call control method and device, storage medium and electronic equipment
US11573883B1 (en) Systems and methods for enhanced compression of trace data in an emulation system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant