Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Network packet receiving and sending path optimization method and device and storage medium

A technology for path optimization and sending and receiving packets, which is applied in the field of network optimization, can solve problems affecting the performance of data sending and receiving, and achieve the effects of reducing data copying, optimizing paths, and improving performance

Pending Publication Date: 2022-01-28
BEIJING KEDONG ELECTRIC POWER CONTROL SYST +1
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Because the network sends and receives packets, it must be processed by the protocol stack, and memory copying is also involved during the processing, which affects the performance of data sending and receiving.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Network packet receiving and sending path optimization method and device and storage medium
  • Network packet receiving and sending path optimization method and device and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] This embodiment introduces a network sending and receiving packet path optimization method, which is applied to the user terminal, including:

[0031] When the network receives packets, call the recv interface to read the data packets stored in the pre-built ring queue, and return the address of the data packet to the user program, so that the user program can operate the data packet according to the address;

[0032] When the network sends a packet, first call the alloc interface, return the first available memory address from the ring queue, construct an Ethernet frame on the memory, and then call the send interface to send the data packet.

[0033] Such as figure 1 , figure 2 As shown, the application process of the network sending and receiving packet route optimization method provided in this embodiment specifically involves the following steps:

[0034] 1. In the initialization stage of the NIC (network card) driver, create two Ring buffers (ring queues) which ...

Embodiment 2

[0039] This embodiment provides a device for optimizing a path for network sending and receiving packets, including a processor and a storage medium;

[0040] The storage medium is used to store instructions;

[0041] The processor is configured to operate in accordance with the instructions to perform the steps of any of the following methods:

[0042] When the network receives packets, call the recv interface to read the data packets stored in the pre-built ring queue, and return the address of the data packet to the user program, so that the user program can operate the data packet according to the address;

[0043] When the network sends a packet, first call the alloc interface, return the first available memory address from the ring queue, construct an Ethernet frame on the memory, and then call the send interface to send the data packet.

Embodiment 3

[0045] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the following methods are implemented:

[0046] When the network receives packets, call the recv interface to read the data packets stored in the pre-built ring queue, and return the address of the data packet to the user program, so that the user program can operate the data packet according to the address;

[0047] When the network sends a packet, first call the alloc interface, return the first available memory address from the ring queue, construct an Ethernet frame on the memory, and then call the send interface to send the data packet.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a network packet receiving and sending path optimization method and device and a storage medium, and the method comprises the steps: calling a recv interface to read a data packet stored in a pre-constructed annular queue during network packet receiving, and returning the address of the data packet to a user program, so that the user program can operate the data packet according to the address; during network packet sending,calling an alloc interface, returning a first available memory address from the annular queue, constructing an Ethernet frame on the memory, and then calling a send interface to send a data packet. According to the invention, the packet is received in a polling mode during packet receiving, interruption processing is not needed any more, a kernel protocol stack is not bypassed any more, and data copying is reduced; according to the network packet receiving and sending method, the network packet receiving and sending path is optimized, and the network packet receiving and sending performance is effectively improved.

Description

technical field [0001] The invention relates to a method, a device and a storage medium for optimizing a network sending and receiving packet path, and belongs to the technical field of network optimization. Background technique [0002] When the network receives the packet, it is first cached in the ringbuffer, and then cached in the socket after being processed by the protocol stack, and finally the user obtains the data packet through a system call. When the network sends a contract, the user caches the data in the socket through the system call, and then caches the data in the ringbuffer after being processed by the protocol stack, and finally sends the contract through the network card. Because the network sends and receives packets, it must be processed by the protocol stack, and memory copying is also involved during the processing, which affects the performance of data sending and receiving. Contents of the invention [0003] The purpose of the present invention i...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): H04L49/90H04L49/901
CPCH04L49/90H04L49/9031H04L49/901
Inventor 徐萌马力王丹计士禹刘锦利马骁李勃高明慧张志军张广文修增哲刘壮佟文强赵梓辰杨泽宇刘新龙姜岩张嵩王会达
Owner BEIJING KEDONG ELECTRIC POWER CONTROL SYST
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products