CN113254202A - 5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port - Google Patents
5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port Download PDFInfo
- Publication number
- CN113254202A CN113254202A CN202110539749.3A CN202110539749A CN113254202A CN 113254202 A CN113254202 A CN 113254202A CN 202110539749 A CN202110539749 A CN 202110539749A CN 113254202 A CN113254202 A CN 113254202A
- Authority
- CN
- China
- Prior art keywords
- port
- packet
- thread task
- data packet
- turning
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
- H04Q11/0001—Selecting arrangements for multiplex systems using optical switching
- H04Q11/0005—Switch and router aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
- H04Q11/0001—Selecting arrangements for multiplex systems using optical switching
- H04Q11/0062—Network aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
- H04Q11/0001—Selecting arrangements for multiplex systems using optical switching
- H04Q11/0062—Network aspects
- H04Q2011/0086—Network resource allocation, dimensioning or optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a forward transmission lossless packet capturing method of a 5G base station based on a gigabit Ethernet port, which comprises the following steps: setting a first thread task and a second thread task; the optical switch is connected with the network equipment; copying the data packets arriving at the first port and the second port to a third port; capturing data packets reaching a first port and a second port by a Capturer server; and executing the first thread task and the second thread task, and capturing a data packet of an optical network port on the Capturer server. The invention realizes the lossless capture of the gigabit Ethernet port data packet, can realize the capture of the gigabit Ethernet port data packet with zero packet loss rate, and provides debugging guarantee for a high-speed network transmission scene; the port mirror image function of the gigabit switch is utilized to realize the capture of the data packet under the condition of not influencing the running states of the base station and the radio frequency equipment; the use of lock-free queues reduces the overhead required for inter-thread synchronization, allowing CPU resources to be focused on packet reception and processing tasks.
Description
Technical Field
The invention relates to a forward transmission lossless packet capturing method for a 5G base station based on a gigabit Ethernet port.
Background
In order to meet the requirements of low time delay and large throughput, the 5G communication system requires high throughput forward data transmission between the base station and the radio frequency device. The use of an enhanced Common Radio interface (eCPRI) protocol packet transmission based on a gigabit Ethernet port is one of the mainstream schemes for realizing forward data interaction between a base station and Radio frequency equipment. Under the condition, data packet capture between the base station and the radio frequency equipment is often an important debugging means of the forwarding function module, on one hand, the traditional packet capturing tool cannot meet the requirement of real-time capture due to the defect of high packet loss rate under the condition of large flow, and on the other hand, in order not to influence the real-time processing efficiency of the base station equipment, a packet capturing program should be operated on other machines except the base station equipment.
In the current big data era, the market is full of various models and rates of gigabit ethernet port products, which provide data throughput capacity of more than 10Gbps from hardware, but contradict that, although the processing capacity of the current mainstream CPU is enough to process data with the rate of more than 10Gbps, most of data packet processing software is based on the operating system kernel protocol stack, thereby generating the following additional overhead: interrupt overhead, context switch overhead for migration between kernel and user modes, and multiple copies of data packets. In a full bandwidth scenario, the accumulated overhead is much higher than the parsing overhead of the data packet, that is, the efficiency of receiving, transmitting and processing the data packet based on the kernel protocol stack of the operating system is not enough to cope with data with a rate of more than 10Gbps, and the packet loss rate generated thereby makes the actual data throughput of the software layer only reach a giga level.
The network interface packet capturing is an indispensable debugging means of application software related to a network data transmission scene, and a common method is to capture all data packets of a specified network interface by using a wireshark, but the wireshark performs data packet transceiving and processing through a protocol stack provided by an operating system kernel, namely when capturing ten-million Ethernet interface data through the wireshark, a higher packet loss rate is generated under the condition that the network interface data is in a full bandwidth, which is not beneficial to software debugging.
Disclosure of Invention
The invention aims to solve the problems and provides a forward lossless packet capturing method for a 5G base station based on a gigabit Ethernet port, which comprises the following steps:
setting a first thread task and a second thread task; the first thread task and the second thread task are interacted through a shared data packet lock-free queue; the first thread task is used for acquiring a data packet from the shared lock-free queue and writing the acquired data packet into the pcap file; the second thread task is used for continuously polling and reading a receiving queue of the Ethernet port by using a DPDK polling driving interface and inserting a received data packet into the shared lock-free queue;
the optical switch is connected with the network equipment and is provided with a first port, a second port and a third port; the network equipment comprises a baseband processing unit, an extension unit and a packet capturing server; the first port is connected with the baseband processing unit; the second port is connected with the expansion unit; the third port is connected with a packet capturing server;
copying the data packets arriving at the first port and the second port to a third port through a port mirroring function of the optical switch; the packet capturing server captures data packets reaching the first port and the second port;
and executing the first thread task and the second thread task, and capturing a data packet of an optical network port on the packet capturing server.
Specifically, the first thread task is a persistent thread task, and includes:
s11, initializing;
s12, judging whether the task is finished, if yes, turning to S16, otherwise, turning to S13;
s13, reading the data packet from the lock-free queue;
s14, judging whether a data packet arrives, if so, turning to S15, otherwise, turning to S12;
s15, writing the data package into the pacp file, and turning to S16;
and S16, ending.
Specifically, the second thread task is a packet capturing thread task, and includes:
s21, initializing;
s22, judging whether the task is finished, if so, finishing, otherwise, turning to S23;
s23, continuously polling and reading the receiving queue of the Ethernet port by using a DPDK polling driving interface;
s24, judging whether a data packet arrives, if so, turning to S25, otherwise, turning to S22;
s25, inserting the received data packet into the shared lock-free queue;
and S26, ending.
The invention has the beneficial effects that: the invention adopts the Ethernet port polling drive based on DPDK to realize the lossless capture of the ten-million Ethernet port data packets, overcomes the defect that the traditional wireshark software captures the high packet loss rate of the ten-million Ethernet port data packets, and provides guarantee for the development and debugging of high-speed network equipment software; and capturing the forwarding data packet interacted between the BBU and the EU under the condition of not influencing the normal data interaction of the BBU and the EU through a port mirror image function of the switch.
The invention can meet the data packet capturing requirement of zero packet loss rate of the gigabit Ethernet port under the condition of full bandwidth throughput, and provides debugging guarantee for a high-speed network transmission scene; the port mirror image function of the gigabit switch is utilized to realize the capture of the data packet under the condition of not influencing the running states of the base station and the radio frequency equipment; the use of lock-free queues reduces the overhead required for inter-thread synchronization, allowing CPU resources to be focused on packet reception and processing tasks.
Drawings
FIG. 1 is a schematic diagram of the present invention;
FIG. 2 is a schematic diagram of a topology of an optical switch connected to a network device;
FIG. 3 is a flow chart of a first thread task;
FIG. 4 is a flow diagram of a second thread task.
Detailed Description
The invention will be further described with reference to the accompanying drawings in which:
as shown in fig. 1, the invention relates to a forward-transmission lossless packet capturing method for a 5G base station based on a gigabit ethernet port, which comprises the following steps:
setting a first thread task and a second thread task; the first thread task and the second thread task are interacted through a shared data packet lock-free queue; the first thread task is used for acquiring a data packet from the shared lock-free queue and writing the acquired data packet into the pcap file; the second thread task is used for continuously polling and reading a receiving queue of the Ethernet port by using a DPDK polling driving interface and inserting a received data packet into the shared lock-free queue;
the optical switch is connected with the network equipment and is provided with a first port, a second port and a third port; the network equipment comprises a baseband processing unit, an extension unit and a packet capturing server; the first port is connected with the baseband processing unit; the second port is connected with the expansion unit; the third port is connected with a packet capturing server;
copying the data packets arriving at the first port and the second port to a third port through a port mirroring function of the optical switch; the packet capturing server captures data packets reaching the first port and the second port;
the 10G optical switch shown in fig. 2 includes three optical network ports 1, 2, and 3, where a BBU (Base Band unit, baseband processing unit) is connected to port 1 of the optical switch, an EU (Extension unit, EU) is connected to port 3 of the optical switch for data interaction, and a packet capturing software is located on a packet capturing server (Capturer server), and the packet capturing server is connected to port 2 of the optical switch; the data packets arriving at the optical network ports 1 and 3 are copied to the optical network port 2 by using the port mirror function of the optical switch and the hardware capability of the optical switch, so that the packet capturing server can capture the data packets arriving at the optical network ports 1 or 3.
Taking capturing uplink data packets (data packets sent by the EU to the BBU) between the BBU and the EU as an example, in order to enable the optical network port 2 to transmit the uplink data packets, the optical network port 2 is configured to perform mirror image monitoring on the data packets in the input direction of the optical network port 3, so that all data packets which are sent from the EU and reach the optical network port 3 have corresponding copies and are output from the optical network port 2 to the packet capturing server.
And executing the first thread task and the second thread task, and capturing a data packet of an optical network port on the packet capturing server.
As shown in fig. 3, the first thread task is a persistent thread task, which includes:
s11, initializing;
s12, judging whether the task is finished, if yes, turning to S16, otherwise, turning to S13;
s13, reading the data packet from the lock-free queue;
s14, judging whether a data packet arrives, if so, turning to S15, otherwise, turning to S12;
s15, writing the data package into the pacp file, and turning to S16;
and S16, ending.
As shown in fig. 4, the second thread task is a packet capturing thread task, which includes:
s21, initializing;
s22, judging whether the task is finished, if so, finishing, otherwise, turning to S23;
s23, continuously polling and reading the receiving queue of the Ethernet port by using a DPDK polling driving interface;
s24, judging whether a data packet arrives, if so, turning to S25, otherwise, turning to S22;
s25, inserting the received data packet into the shared lock-free queue;
and S26, ending.
Specifically, the packet capturing thread task includes the following parameter option settings: the PCI address of the optical network port used for packet capturing by the current program, the CPU core bound by the set packet capturing thread, the CPU core bound by the persistence thread, the list of the destination MAC address of the Ethernet packet to be captured (playing a role in data packet filtering), and the size of the pcap file (the default value is 256, namely one pcap file is stored every 256 MB).
And in the process of executing the thread task, the number of the saved pcap files can be acquired in real time.
The invention adopts an open source data Plane Development tool DPDK (data Plane Development kit) and is based on UIO (Userspace I/O) provided by a Linux kernel, and is used for providing an Ethernet port data packet receiving and dispatching polling drive (PMD, Poll model Driver) interface in a user Mode. The large page memory space distributed in the user space is mapped to a receiving buffer area of an Ethernet port through mmap, so that when a data packet reaches the Ethernet port, DMA can move the data packet to the receiving buffer area of a user state appointed by a user, and a subsequent user can directly operate the data of the buffer area, thereby realizing zero copy and greatly improving the processing efficiency; in addition, the size of the physical continuous memory space is increased from 4KB under a non-large-page memory to 2MB or even 1GB through a large-page memory space, so that convenience is provided for receiving, transmitting and processing a Jumbo Frame, and the receiving and transmitting requirements of the gigabit Ethernet data can be met.
The method comprises the steps of copying the flow between the base station equipment and the radio frequency equipment to a specified mirror image monitoring port by using a port mirror image function of a ten-gigabit switch, and capturing the data packet of the monitoring port to realize the capture of the interactive data packet between the base station equipment and the radio frequency equipment.
The invention adopts the Ethernet port polling drive based on DPDK to realize the lossless capture of the ten-million Ethernet port data packets, overcomes the defect that the traditional wireshark software captures the high packet loss rate of the ten-million Ethernet port data packets, and provides guarantee for the development and debugging of high-speed network equipment software; and capturing the forwarding data packet interacted between the BBU and the EU under the condition of not influencing the normal data interaction of the BBU and the EU through a port mirror image function of the switch.
The invention can meet the data packet capturing requirement of zero packet loss rate of the gigabit Ethernet port under the condition of full bandwidth throughput, and provides debugging guarantee for a high-speed network transmission scene; the port mirror image function of the gigabit switch is utilized to realize the capture of the data packet under the condition of not influencing the running states of the base station and the radio frequency equipment; the use of lock-free queues reduces the overhead required for inter-thread synchronization, allowing CPU resources to be focused on packet reception and processing tasks.
The technical solution of the present invention is not limited to the limitations of the above specific embodiments, and all technical modifications made according to the technical solution of the present invention fall within the protection scope of the present invention.
Claims (3)
1. A forward transmission lossless packet capturing method for a 5G base station based on a gigabit Ethernet port is characterized by comprising the following steps:
setting a first thread task and a second thread task; the first thread task and the second thread task are interacted through a shared data packet lock-free queue; the first thread task is used for acquiring a data packet from the shared lock-free queue and writing the acquired data packet into the pcap file; the second thread task is used for continuously polling and reading a receiving queue of the Ethernet port by using a DPDK polling driving interface and inserting a received data packet into the shared lock-free queue;
the optical switch is connected with the network equipment and is provided with a first port, a second port and a third port; the network equipment comprises a baseband processing unit, an extension unit and a packet capturing server; the first port is connected with the baseband processing unit; the second port is connected with the expansion unit; the third port is connected with a packet capturing server;
copying the data packets arriving at the first port and the second port to a third port through a port mirroring function of the optical switch; the packet capturing server captures data packets reaching the first port and the second port;
and executing the first thread task and the second thread task, and capturing a data packet of an optical network port on the packet capturing server.
2. The method for lossless packet capture of forward transmission of 5G base station based on gigabit Ethernet port as claimed in claim 1, wherein the first thread task is a persistent thread task, and includes:
s11, initializing;
s12, judging whether the task is finished, if yes, turning to S16, otherwise, turning to S13;
s13, reading the data packet from the lock-free queue;
s14, judging whether a data packet arrives, if so, turning to S15, otherwise, turning to S12;
s15, writing the data package into the pacp file, and turning to S16;
and S16, ending.
3. The forward-transmission lossless packet capturing method for the 5G base station based on the gigabit Ethernet port according to claim 1, wherein the second thread task is a packet capturing thread task, and comprises:
s21, initializing;
s22, judging whether the task is finished, if so, finishing, otherwise, turning to S23;
s23, continuously polling and reading the receiving queue of the Ethernet port by using a DPDK polling driving interface;
s24, judging whether a data packet arrives, if so, turning to S25, otherwise, turning to S22;
s25, inserting the received data packet into the shared lock-free queue;
and S26, ending.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110539749.3A CN113254202A (en) | 2021-05-18 | 2021-05-18 | 5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110539749.3A CN113254202A (en) | 2021-05-18 | 2021-05-18 | 5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113254202A true CN113254202A (en) | 2021-08-13 |
Family
ID=77182487
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110539749.3A Pending CN113254202A (en) | 2021-05-18 | 2021-05-18 | 5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113254202A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105357151A (en) * | 2015-11-19 | 2016-02-24 | 成都科来软件有限公司 | DPDK-based packet capture and mirror image flow forwarding method |
CN110213198A (en) * | 2018-02-28 | 2019-09-06 | 中标软件有限公司 | The monitoring method and system of network flow |
US20190287176A1 (en) * | 2014-09-02 | 2019-09-19 | Nasdaq, Inc. | Data packet processing methods, systems, and apparatus |
CN110958193A (en) * | 2018-09-26 | 2020-04-03 | 英特尔公司 | Data plane semantics for software virtual switches |
CN111130859A (en) * | 2019-12-10 | 2020-05-08 | 中国电子科技网络信息安全有限公司 | Industrial control network topological graph generation method based on full flow |
CN111163116A (en) * | 2020-04-08 | 2020-05-15 | 成都新动力软件有限公司 | Equipment for extracting large-flow network data parameters |
CN112241535A (en) * | 2020-10-20 | 2021-01-19 | 福建奇点时空数字科技有限公司 | Server security policy configuration method based on flow data analysis |
-
2021
- 2021-05-18 CN CN202110539749.3A patent/CN113254202A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190287176A1 (en) * | 2014-09-02 | 2019-09-19 | Nasdaq, Inc. | Data packet processing methods, systems, and apparatus |
CN105357151A (en) * | 2015-11-19 | 2016-02-24 | 成都科来软件有限公司 | DPDK-based packet capture and mirror image flow forwarding method |
CN110213198A (en) * | 2018-02-28 | 2019-09-06 | 中标软件有限公司 | The monitoring method and system of network flow |
CN110958193A (en) * | 2018-09-26 | 2020-04-03 | 英特尔公司 | Data plane semantics for software virtual switches |
CN111130859A (en) * | 2019-12-10 | 2020-05-08 | 中国电子科技网络信息安全有限公司 | Industrial control network topological graph generation method based on full flow |
CN111163116A (en) * | 2020-04-08 | 2020-05-15 | 成都新动力软件有限公司 | Equipment for extracting large-flow network data parameters |
CN112241535A (en) * | 2020-10-20 | 2021-01-19 | 福建奇点时空数字科技有限公司 | Server security policy configuration method based on flow data analysis |
Non-Patent Citations (1)
Title |
---|
曹志伟: ""企业内部网络数据包捕获引擎的设计与实现"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10210113B2 (en) | SAN fabric online path diagnostics | |
EP3719657A1 (en) | Communication with accelerator via rdma-based network adapter | |
CN108600114B (en) | Flow control with reduced buffer usage for network devices | |
US9813283B2 (en) | Efficient data transfer between servers and remote peripherals | |
US20110058573A1 (en) | User selectable multiple protocol network interface device | |
García-Dorado et al. | High-performance network traffic processing systems using commodity hardware | |
EP2871580B1 (en) | Programmed input/output mode | |
CN108600053B (en) | Wireless network data packet capturing method based on zero copy technology | |
CN116018790A (en) | Receiver-based precise congestion control | |
US20070271401A1 (en) | Techniques to moderate interrupt transfer | |
US10609125B2 (en) | Method and system for transmitting communication data | |
CN112953967A (en) | Network protocol unloading device and data transmission system | |
CN103678203A (en) | Method and device for achieving zero copy of network card | |
CN102185833A (en) | Fiber channel (FC) input/output (I/O) parallel processing method based on field programmable gate array (FPGA) | |
CN110995507B (en) | Network acceleration controller and method | |
Leitao | Tuning 10Gb network cards on Linux | |
Yoshino et al. | Performance optimization of TCP/IP over 10 gigabit ethernet by precise instrumentation | |
CN106790162B (en) | Virtual network optimization method and system | |
CN113254202A (en) | 5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port | |
KR20140125311A (en) | Apparatus and method for processing traffic using network interface card with multi-core | |
Zabolotny | Low latency protocol for transmission of measurement data from FPGA to Linux computer via 10 Gbps Ethernet link | |
Barczyk et al. | High rate packets transmission on Ethernet LAN using commodity hardware | |
US11784929B2 (en) | Heterogeneous link data translation and distribution method, system and device, and storage medium | |
Zeng et al. | Middlenet: A high-performance, lightweight, unified nfv and middlebox framework | |
Boscia et al. | Comparison of 40G RDMA and Traditional Ethernet Technologies |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210813 |