CN111198595A - DPDK-based time synchronization method - Google Patents

DPDK-based time synchronization method Download PDF

Info

Publication number
CN111198595A
CN111198595A CN201911297651.0A CN201911297651A CN111198595A CN 111198595 A CN111198595 A CN 111198595A CN 201911297651 A CN201911297651 A CN 201911297651A CN 111198595 A CN111198595 A CN 111198595A
Authority
CN
China
Prior art keywords
time synchronization
data packet
user
sends
dpdk
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
Application number
CN201911297651.0A
Other languages
Chinese (zh)
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.)
Henan Normal University
CERNET Corp
Original Assignee
Henan Normal University
CERNET Corp
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 Henan Normal University, CERNET Corp filed Critical Henan Normal University
Priority to CN201911297651.0A priority Critical patent/CN111198595A/en
Publication of CN111198595A publication Critical patent/CN111198595A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0644External master-clock
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Abstract

The invention discloses a DPDK-based time synchronization method, which comprises the following steps: 1) after receiving a time synchronization request packet of a client, the network card firstly triggers the network card to be interrupted and then sends the request packet to a kernel space; 2) the kernel space directly sends the data packet into the user space through an EAL abstraction layer; 3) a user space user layer directly obtains a time synchronization UDP data packet through equipment mapping; 4) wrapping data through a kernel protocol stack provided by a system, entering a user protocol stack, and passing through a logic layer; and 5) the application layer time synchronization service program starts to add the timestamp into the data packet according to the ntp protocol requirement, sends the data packet to the client, realizes network communication through the DPDK, can be used for network operators and ICP to optimize the gateway program, optimizes user experience and improves forwarding efficiency.

Description

DPDK-based time synchronization method
Technical Field
The present invention relates to the field of internet communication technologies, and in particular, to a time synchronization method based on a data plane Development Kit (DPDK for short).
Background
Network Time synchronization refers to providing Time synchronization service through the internet, so that devices on the internet are consistent with Universal Time Coordinated (UTC) Time. The hardware and software required to synchronize clocks on large-scale systems (Internet) have emerged in recent years using technology that can achieve millions of clocks with a few UTC milliseconds, with Network Time Protocol (NTP) being the most common and important protocol for achieving time synchronization.
The current time synchronization technology cannot meet the requirement of distributed application on time accuracy under large-scale mass requests. In addition, the traditional time synchronization service cannot bear large-scale mass service requests and falls into a paralyzed state under DDOS attack due to the limitation of an architecture. The whole internet system depends on time synchronization service seriously, once the time correction service is disordered, huge risks are brought to politics, economy, culture, social life and national safety of the whole society, and the data processing performance of the service system is tested seriously.
According to the technical scheme, the DPDK is used for processing the network processing flow, so that interruption is reduced, the forwarding efficiency of the message is improved, the performance of a service system is improved, DDOS attack can be effectively resisted, and the stability of time synchronization service under the high-load condition is guaranteed.
Disclosure of Invention
In order to solve the technical problems, the invention provides a time synchronization method for processing a network processing flow based on DPDK, wherein after a network card receives a time synchronization request packet of a client, the request packet is sent to a kernel space, the kernel space directly sends a data packet to a user space through an EAL abstraction layer, the user space user layer directly obtains a time synchronization UDP data packet through equipment mapping, the data packet is wrapped by a kernel protocol stack provided by a system, enters the user protocol stack, and is added with the data packet through a logic layer and a timestamp, and the data packet is sent to the client.
In order to achieve the purpose, the invention adopts the following technical scheme: a DPDK-based time synchronization method, the flow of which comprises the following steps:
step 1: after receiving a time synchronization request packet of a client, the network card firstly triggers the network card to be interrupted and then sends the request packet to a kernel space;
step 2: the kernel space directly sends the data packet into the user space through an EAL abstraction layer;
and step 3: a user space user layer directly obtains a time synchronization UDP data packet through equipment mapping;
and 4, step 4: wrapping data through a kernel protocol stack provided by a system, entering a user protocol stack, and passing through a logic layer;
and 5: and the application layer time synchronization service program starts to add the timestamp into the data packet according to the ntp protocol requirement and sends the data packet to the client.
The time service server uses one time of a Beidou satellite, a GPS satellite and a GLONASS satellite as a reference time source.
The invention has the beneficial effects that: due to the switching between Kernel Space (Kernel Space) and User Space (User Space) and the multiple memory copying of the packet processing task, the system consumption becomes large, and a time synchronization system using a CPU as a core has a great processing bottleneck. Especially, under the condition of a large number of high-load requests of clients, the system overhead is extremely high, so that the service capability of the time synchronization service system is obviously reduced or the service is directly refused. In order to improve the service performance of the time synchronization server, the Linux kernel space protocol stack needs to be bypassed to improve the data packet processing efficiency, thereby improving the performance of the time synchronization service. Obviously, the new time synchronization service data packet bypasses the kernel space and directly enters the user space program, so that interrupt calling and memory copying are reduced, the system performance is used for processing the time synchronization request, no extra overhead is generated, and the system service performance can be improved in a large scale.
Drawings
Fig. 1 is a block diagram of a conventional network time setting service flow.
Fig. 2 is a flow chart of a DPDK network time synchronization service.
Fig. 3 is a block diagram of a time synchronization service flow.
Detailed Description
According to the technical scheme, the server uses the time of the Beidou satellite, the GPS satellite and the GLONASS satellite as a reference time source, a DPDK network mode is adopted for processing time synchronization users, a DPDK application program runs in the UserSpace of an operating system, a data surface provided by the server is used for receiving and sending packets, a Linux kernel protocol stack is bypassed, and the message processing efficiency can be greatly improved.
At present, the traditional time synchronization service flow is as follows:
step 1: after receiving a time synchronization request packet of a client, a network card triggers hardware interruption of the network card firstly, and then sends the request packet to a kernel space;
step 2: the data packet is distributed and copied to the kernel thread for processing, and the data packet completes one memory copy during distribution;
and step 3: the kernel thread calls a cpu kernel thread to process hardware interrupt through software interrupt;
and 4, step 4: informing the user layer after the kernel thread finishes processing;
and 5: the user layer starts to receive the time synchronization data packet and copies the data packet to the user space;
step 6: the analysis of the data packet is realized by calling a network layer and a logic layer of a Tcp/IP protocol stack;
and 7: the application layer time synchronization service program starts to add the time stamp to the data packet according to the ntp protocol requirement. And sends the data packet to the client.
The technical scheme of the application processes through a DPDK network mode, and the improved time synchronization service flow comprises the following steps:
step 1: after receiving a time synchronization request packet of a client, the network card firstly triggers the network card to be interrupted and then sends the request packet to a kernel space;
step 2: the kernel space directly sends the data packet into the user space through an EAL abstraction layer;
and step 3: a user space user layer directly obtains a time synchronization UDP data packet through equipment mapping;
and 4, step 4: wrapping data through a kernel protocol stack provided by a system, entering a user protocol stack, and passing through a logic layer;
and 5: and the application layer time synchronization service program starts to add the timestamp into the data packet according to the ntp protocol requirement and sends the data packet to the client.
The specific process of the time synchronization service program is as follows:
step 1: the network card acquires a time synchronization data packet, puts the time synchronization data packet into a non-blocking annular queue and waits for the next processing;
step 2: the server program inquires whether the protocol number of the IP message header is a UDP protocol with the value of 17 or not in a polling mode, judges whether the data packet is an NTP time synchronization protocol or not if the protocol number is the UDP protocol and is the NTP data packet, directly discards the data packet if the protocol number is not the UDP protocol with the value of 17 or is not the NTP data packet, and takes the data packet from the non-blocking ring queue again to restart the judgment.
And step 3: if the data packet is an NTP data packet, the data packet is analyzed, and a packet receiving timestamp is added into the data packet;
and 4, step 4: obtaining a source address and a source port of the analyzed data packet, and preparing to return the data packet to a sending time synchronization request client;
and 5: and putting the data packet into a lock-free sending queue, and adding a data packet sending timestamp into the data packet, so that after the client receives the data packet, an accurate time value is calculated through four time variables of client packet sending time, server packet receiving time, server packet sending time and client packet receiving time, and the accurate time is set into the client system.

Claims (2)

1. A time synchronization method based on DPDK is characterized in that: the flow of the time synchronization method comprises the following steps:
step 1: after receiving a time synchronization request packet of a client, the network card firstly triggers the network card to be interrupted and then sends the request packet to a kernel space;
step 2: the kernel space directly sends the data packet into the user space through an EAL abstraction layer;
and step 3: a user space user layer directly obtains a time synchronization UDP data packet through equipment mapping;
and 4, step 4: wrapping data through a kernel protocol stack provided by a system, entering a user protocol stack, and passing through a logic layer;
and 5: and the application layer time synchronization service program starts to add the timestamp into the data packet according to the ntp protocol requirement and sends the data packet to the client.
2. The DPDK-based time synchronization method of claim 1, wherein: the time service server uses one time of a Beidou satellite, a GPS satellite and a GLONASS satellite as a reference time source.
CN201911297651.0A 2019-12-17 2019-12-17 DPDK-based time synchronization method Pending CN111198595A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911297651.0A CN111198595A (en) 2019-12-17 2019-12-17 DPDK-based time synchronization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911297651.0A CN111198595A (en) 2019-12-17 2019-12-17 DPDK-based time synchronization method

Publications (1)

Publication Number Publication Date
CN111198595A true CN111198595A (en) 2020-05-26

Family

ID=70744446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911297651.0A Pending CN111198595A (en) 2019-12-17 2019-12-17 DPDK-based time synchronization method

Country Status (1)

Country Link
CN (1) CN111198595A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112881794A (en) * 2021-03-23 2021-06-01 长春市吉佳通达信息技术有限责任公司 Invasive low-frequency electric energy consumption data acquisition system
CN114124503A (en) * 2021-11-15 2022-03-01 北京邮电大学 Intelligent network sensing method for optimizing efficiency of progressive concurrent cache
CN114710529A (en) * 2022-03-25 2022-07-05 广州小鹏汽车科技有限公司 Data transmission method, device, system, vehicle and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112881794A (en) * 2021-03-23 2021-06-01 长春市吉佳通达信息技术有限责任公司 Invasive low-frequency electric energy consumption data acquisition system
CN114124503A (en) * 2021-11-15 2022-03-01 北京邮电大学 Intelligent network sensing method for optimizing efficiency of progressive concurrent cache
CN114710529A (en) * 2022-03-25 2022-07-05 广州小鹏汽车科技有限公司 Data transmission method, device, system, vehicle and storage medium
CN114710529B (en) * 2022-03-25 2024-03-12 广州小鹏汽车科技有限公司 Data transmission method, device, system, vehicle and storage medium

Similar Documents

Publication Publication Date Title
CN111198595A (en) DPDK-based time synchronization method
EP3079313B1 (en) Data splitting method and splitter
JP7177548B2 (en) Load Balancing Method Based on NAT in DPDK Environment
CN109257293B (en) Speed limiting method and device for network congestion and gateway server
Laufer et al. Climb: Enabling network function composition with click middleboxes
JP2020113924A (en) Monitoring program, programmable device, and monitoring method
EP2838243B1 (en) Capability aggregation and exposure method and system
CN112631788B (en) Data transmission method and data transmission server
CN113364809B (en) Offloading network data to perform load balancing
CN113037862B (en) Service request processing method, device, equipment and storage medium
WO2011130940A1 (en) Multi-service integration processing method and service integration platform
CN103873523A (en) Client cluster access method and device
CN112583895B (en) TCP communication method, system and device
CN106331184A (en) Big data distribution method and distribution platform based on internet
CN109547162A (en) Data communications method based on two sets of unidirectional boundaries
Zhang et al. Optimization of traditional Snort intrusion detection system
Yamamoto et al. Hardware implementation of mqtt broker and precise time synchronization using iot devices
CN107918877B (en) Data acquisition method and device
WO2023143579A1 (en) Flow table entry control method and apparatus
Baltas et al. Ultra low delay switching for networked music performance
US8060568B2 (en) Real time messaging framework hub to intercept and retransmit messages for a messaging facility
WO2022160714A1 (en) Communication method, apparatus, and system
US20170099333A1 (en) Requesting and receiving a media stream within a networked system
CN110519397B (en) SIP terminal access load balancing system and method based on NGINX
CN104901783B (en) Data transmission method and server system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200526

WD01 Invention patent application deemed withdrawn after publication