Method for fast catching Ethernet card on Linux system

An Ethernet and network card technology, applied in the field of computer communication, can solve the problems of limited data packet cache queue length, large CPU resource consumption, and difficulty in ensuring no packet loss, so as to reduce the overhead of cache application and release, reduce scheduling overhead, The effect of reducing the number of copies

Inactive Publication Date: 2008-07-23
LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF0 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] (1) The non-NAPI method is completely triggered by the network card interrupt to receive the data packet. When the packet comes at a high frequency, the network card interrupt processing scheduling requires a large CPU resource consumption.
[0005] (2) The NAPI method combines network card interrupt triggering and active query reception. Although the number of interrupt scheduling is greatly reduced, each polling has a fixed time (1 system clock cycle) jiffies ) limit, exceeding this time value will end receiving, so it is difficult to guarantee that no packets will be lost after polling
[0007] (4) Regardless of the non-NAPI mode or the NAPI mode, the length of the received data packet cache queue is very limited. When the data packet processing speed is uneven, it is easy to cause the buffer area to be full and cause packet loss. make a copy

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
  • Method for fast catching Ethernet card on Linux system
  • Method for fast catching Ethernet card on Linux system
  • Method for fast catching Ethernet card on Linux system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0030] A kind of method that the present invention provides for fast packet capture of Ethernet card, concrete steps are:

[0031] 1) Map the Ethernet card DMA receiving buffer area to the user area to reduce the number of copies of data packets in the kernel area and from the kernel to the user area.

[0032] 2) Registering a hybrid device is used to map the DMA receiving buffer area of ​​the Ethernet card to the user area and provide setting and control of the receiving state of the network card.

[0033] 3) Close the interrupt and use the active query method to receive data packets, reducing the system overhead caused by the scheduling of interrupt processing.

[0034] 4) Start a thread for each network card to capture packets, so as to quickly capture packets for multiple network cards at the same time.

[0035] 5) Allocate a specified number of data packet buffers when the program starts to realize data packet caching and reduce the packet loss rate caused by uneven pack...

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 method for utilizing an Ethernet-card to rapidly capture packet on a Linux system, the method comprises mapping an Ethernet-card DMA receiving caching area on a user area, achieving the purpose of simultaneously capturing packets for a plurality of Ethernet cads through reducing data packets to reach a user area and copying times of a user program and starting a thread packet capture with every Ethernet card, reducing dispatching cost of interrupt handling through shutting interruption to actively enquire and receive, defining cache and management thereof which are repeatedly used, reducing cache application and releasing cost, reducing the conflict of visiting cache between the packet capture thread and packet processing thread, realizing the rapid capture of Ethernet data packets and ip packets which are transferred on the Ethernet data packets.

Description

1. Technical field [0001] The invention relates to the field of computer communication, in particular to a method for quickly capturing packets of an Ethernet card on a Linux system. 2. Technical background [0002] At present, LAN is widely used. Ethernet is a kind of LAN, and it is also the mainstream mode of LAN. The ip packet can be transmitted on the Ethernet to realize the connection with the tcp / ip Internet. In network management and network detection, it is necessary to capture the transmitted network data packets, and then analyze the network traffic, monitor and intrude the communication of the specified source address and destination address, etc. In order to improve performance such as monitoring speed, it is necessary to capture data packets completely or as completely as possible. [0003] On the Linux system, the traditional Ethernet card driver and the network processing stack of the kernel are affected by the interrupt scheduling of the Ethernet card, and ...

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
Patent Type & Authority Applications(China)
IPC IPC(8): H04L12/26H04L12/56H04L12/02H04L12/70
Inventor 黄景昌张会健吴庆民施培任
Owner LANGCHAO ELECTRONIC INFORMATION IND CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products