CN116455795A - Network message packet capturing method - Google Patents

Network message packet capturing method Download PDF

Info

Publication number
CN116455795A
CN116455795A CN202310439528.8A CN202310439528A CN116455795A CN 116455795 A CN116455795 A CN 116455795A CN 202310439528 A CN202310439528 A CN 202310439528A CN 116455795 A CN116455795 A CN 116455795A
Authority
CN
China
Prior art keywords
message
network
special
splitter
processing
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
CN202310439528.8A
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.)
Beijing Institute of Computer Technology and Applications
Original Assignee
Beijing Institute of Computer Technology and Applications
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 Computer Technology and Applications filed Critical Beijing Institute of Computer Technology and Applications
Priority to CN202310439528.8A priority Critical patent/CN116455795A/en
Publication of CN116455795A publication Critical patent/CN116455795A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • 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
    • 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/14Multichannel or multilink protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a network message packet capturing method, and belongs to the technical field of communication. The method is convenient for a developer to process special network messages in a user mode, can also process common network protocol messages by utilizing an operating system network protocol stack, is easy to debug programs, reduces the research and development cost of special network equipment, and shortens the project period. Therefore, the method for capturing the packets of the application program has the characteristics of high efficiency, low time delay, autonomy and controllability and the like, and can fully utilize the network protocol stack of the operating system to process some common messages. The method is suitable for being applied to various network devices and has good market prospect.

Description

Network message packet capturing method
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a network message packet grabbing method.
Background
With the development of information technology, the kinds of network devices are new every day and every month, and the functions of the network devices are continuously enhanced. The main network device message processing software technologies in the market in the past mainly include two types:
(1) network message processing based on netfilter framework, which is developed in kernel state, has high requirement on technical storage of researchers, is not easy to debug and position, has high research and development cost and long project period;
(2) the technology is mainly developed in a user mode based on network message processing of a virtual network card, but a network protocol stack of an operating system cannot be used, and common messages of the technology need to be processed by themselves (such as ARP, RARP, neighbor discovery, IGMP and the like), so that a certain technical reserve is needed for researchers, and the research and development cost is high.
Disclosure of Invention
First, the technical problem to be solved
The invention aims to solve the technical problems that: how to design a method for autonomously controlling and grabbing any needed message without affecting the work of the network protocol stack itself and other application programs.
(II) technical scheme
In order to solve the technical problems, the invention provides a network message packet capturing method, which comprises the following steps:
the first step: creating a virtual network bridge, adding a network card for receiving special messages to the virtual network bridge, switching the network card to a hybrid mode, receiving all messages passing through the network card, and handing the messages to the bound virtual network bridge for processing;
and a second step of: registering a message splitter at a buried point for preprocessing a message on a virtual network bridge, wherein the message splitter is a specific kernel module, and the virtual network bridge can give the message to the message splitter for processing after receiving the message;
and a third step of: two channels are established between the special message processing application program and the message splitter, wherein one channel is used for sending a control command, the other channel is used for transmitting a special message, when the special message processing application program starts to work, the control command is sent to the message splitter, and after the message splitter receives the starting command, the updating state is started and the special message parameters are updated;
fourth step: the message received by the network card is delivered to the virtual network bridge for processing, the message received by the virtual network bridge is delivered to the message splitter for processing, and the message splitter judges whether the message is a special message according to the received control command: if the message is a special message, the message is transmitted to a special message application program for processing through a special channel, and if the message is not the special message, the message is returned to a system network protocol stack for processing;
fifth step: the special message processing application program reads the special message belonging to the application program and carries out service processing; the system network protocol stack continues to process the non-special message;
sixth step: when the special message processing application program stops working, a stop command is sent to the message splitter, and the message splitter updates the state to stop after receiving the stop command.
Preferably, one virtual bridge may add multiple network cards.
Preferably, for the linux operating system, the burial point is located at nf_br_pre_routing hook point of netfilter.
Preferably, the control command includes a special message parameter and a start command.
The invention also provides network equipment applying the method.
Preferably, the network device is a special network device.
Preferably, the special network device is a network crypto-engine.
Preferably, the special network device is a network tester.
The invention also provides application of the method in the technical field of communication.
The invention also provides application of the network equipment in the technical field of communication.
(III) beneficial effects
The invention provides a network message grabbing method, which is a method that an application program based on an operating system network protocol stack frame can autonomously control and grab any required message, and does not influence the work of the network protocol stack and other application programs. The method is convenient for a developer to process special network messages in a user mode, can also process common network protocol messages by utilizing an operating system network protocol stack, is easy to debug programs, reduces the research and development cost of special network equipment, and shortens the project period. Therefore, the method for capturing the packets of the application program has the characteristics of high efficiency, low time delay, autonomy and controllability and the like, and can fully utilize the network protocol stack of the operating system to process some common messages. The method is suitable for being applied to various network devices (especially special network devices such as a network cipher machine, a network tester and the like), and has good market prospect.
Drawings
FIG. 1 is a schematic diagram of a method design of the present invention;
fig. 2 is a flow chart of the message splitter process in the present invention.
Detailed Description
To make the objects, contents and advantages of the present invention more apparent, the following detailed description of the present invention will be given with reference to the accompanying drawings and examples.
Referring to fig. 1 and 2, the method for capturing packets of network messages provided by the invention comprises the following steps:
the first step: creating a virtual network bridge, adding a network card for receiving special messages to the virtual network bridge, wherein one bridge can add a plurality of network cards. Then the network card will switch to PromiscuousMode (promiscuous mode) to receive all the messages passing through it and deliver the messages to the binding virtual network bridge for processing;
and a second step of: the message splitter (nf_br_pre_routing hook point of the linux operating system at the embedded point of the netfilter) is registered at the embedded point of the virtual bridge for preprocessing the message, and is a specific kernel module. The virtual network bridge receives the message and then gives the message to the message splitter for processing.
And a third step of: two channels are established between the special message processing application program and the message splitter, wherein one channel is used for sending a control command, the other channel is used for transmitting a special message, when the special message processing application program starts to work, the control command (comprising a special message parameter, a starting command and the like) is sent to the message splitter, and the message splitter updates the state to be started after receiving the starting command and updates the special message parameter;
fourth step: the message received by the network card is delivered to the virtual network bridge for processing, and the message received by the virtual network bridge is delivered to the message splitter for processing. The message splitter judges whether the message is a special message according to the received control command: if the message is a special message, the message is transmitted to a special message application program for processing through a special channel, and if the message is not the special message, the message is returned to a system network protocol stack for processing;
fifth step: the special message processing application program reads the special message belonging to the application program and carries out service processing; the system network protocol stack continues to process the non-special message;
sixth step: when the special message processing application program stops working, a stop command is sent to the message splitter, and the message splitter updates the state to stop after receiving the stop command.
It can be seen that the present invention adds the network card for receiving the special message to the virtual network bridge, registers the message splitter in the virtual network bridge, establishes two channels between the special message processing application program and the message splitter for respectively transmitting the control command and the special message, and the message splitter directly transmits the special message to the application program through the special channel according to the received control command, and returns other messages to the system network protocol stack for continuous processing, thereby realizing autonomous control and grasping of any required message.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.

Claims (10)

1. The network message packet grabbing method is characterized by comprising the following steps of:
the first step: creating a virtual network bridge, adding a network card for receiving special messages to the virtual network bridge, switching the network card to a hybrid mode, receiving all messages passing through the network card, and handing the messages to the bound virtual network bridge for processing;
and a second step of: registering a message splitter at a buried point for preprocessing a message on a virtual network bridge, wherein the message splitter is a specific kernel module, and the virtual network bridge can give the message to the message splitter for processing after receiving the message;
and a third step of: two channels are established between the special message processing application program and the message splitter, wherein one channel is used for sending a control command, the other channel is used for transmitting a special message, when the special message processing application program starts to work, the control command is sent to the message splitter, and after the message splitter receives the starting command, the updating state is started and the special message parameters are updated;
fourth step: the message received by the network card is delivered to the virtual network bridge for processing, the message received by the virtual network bridge is delivered to the message splitter for processing, and the message splitter judges whether the message is a special message according to the received control command: if the message is a special message, the message is transmitted to a special message application program for processing through a special channel, and if the message is not the special message, the message is returned to a system network protocol stack for processing;
fifth step: the special message processing application program reads the special message belonging to the application program and carries out service processing; the system network protocol stack continues to process the non-special message;
sixth step: when the special message processing application program stops working, a stop command is sent to the message splitter, and the message splitter updates the state to stop after receiving the stop command.
2. The method of claim 1, wherein a virtual bridge may add multiple network cards.
3. The method of claim 1, wherein for a linux operating system, the embedded point is located at nf_br_pre_routing hook point of netfilter.
4. The method of claim 1, wherein the control command comprises a special message parameter, a start command.
5. A network device applying the method of any one of claims 1 to 4.
6. The network device of claim 5, wherein the network device is a specialty network device.
7. The network device of claim 6, wherein the special network device is a network crypto-engine.
8. The network device of claim 6, wherein the special network device is a network tester.
9. Use of a method according to any one of claims 1 to 4 in the field of communication technology.
10. Use of a network device according to any of claims 5 to 8 in the field of communication technology.
CN202310439528.8A 2023-04-23 2023-04-23 Network message packet capturing method Pending CN116455795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310439528.8A CN116455795A (en) 2023-04-23 2023-04-23 Network message packet capturing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310439528.8A CN116455795A (en) 2023-04-23 2023-04-23 Network message packet capturing method

Publications (1)

Publication Number Publication Date
CN116455795A true CN116455795A (en) 2023-07-18

Family

ID=87127174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310439528.8A Pending CN116455795A (en) 2023-04-23 2023-04-23 Network message packet capturing method

Country Status (1)

Country Link
CN (1) CN116455795A (en)

Similar Documents

Publication Publication Date Title
CN101442513B (en) Method for implementing various service treatment function and multi-nuclear processor equipment
CN102025616B (en) Method, device and switch for realizing BFD (Bidirectional Forwarding Detection)
CN103139157B (en) A kind of based on the network communication method of socket, Apparatus and system
CN111614631B (en) User mode assembly line framework firewall system
CN104158868B (en) A kind of document transmission method and management server
CN102892089A (en) Message pushing method, device and system
EP2883123B1 (en) Forwarding packet in stacking system
WO2022032984A1 (en) Mqtt protocol simulation method and simulation device
CN105162702A (en) AC current guide method and device
CN106302536B (en) The method and apparatus communicated between all-in-one machine multisystem based on interchanger
CN103517164B (en) A kind of optical network unit data configuration control method
CN102307141B (en) Message forwarding method and device
CN113315665B (en) Message sending method, device, equipment and medium of dual-network-card terminal equipment
EP3989386A1 (en) Communication and interaction method and system
CN105049162A (en) Public network information high-efficiency transmission method based on Epoll model
CN102752188A (en) Transmission control protocol connection migratory method and system
CN110213320A (en) Method, apparatus, electronic equipment and the computer readable storage medium of communication connection
CA2413509A1 (en) Architecture and run-time environment for network filter drivers
CN107682384A (en) Virtual desktop multicast control method, terminal, proxy terminal and cloud desktop server
CN101184032B (en) Stacked system equipment communication method
CN116455795A (en) Network message packet capturing method
CN102681969B (en) Based on the long frame data transmission method of CAN
CN103379130A (en) Network access system and method based on application layer data
CN105471718B (en) A kind of implementation method of full duplex message queue
CN101335610B (en) ARP synchronization method in high-side Ethernet network switch

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