Method and apparatus for reading data of protocol stack of transmission control protocol/internet protocol
A technology of transmission control protocol and Internet Protocol, which is applied in the field of communication, can solve problems such as low ability, time-consuming, multi-central processing units, etc., to reduce the number of system calls, reduce the time occupied by system calls, and improve network input and output effect of ability
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0037] Embodiment one, such as figure 1 As shown, a method for reading data by a transmission control protocol / internet protocol protocol stack provided by an embodiment of the present invention includes:
[0038] Step 101: Obtaining an identifier; the identifier specifies reading a plurality of User Datagram Protocol UDP packets in the protocol stack of Transmission Control Protocol / Internet Protocol TCP / IP;
[0039] Step 102: Get the length; the length specifies the total length of the UDP packet to be read
[0040] Step 103: read the corresponding number of UDP packets from the protocol stack according to the total length of the specified UDP packets;
[0041] Step 104: Copy the above number of UDP data packets to the user mode.
[0042] Specify to read multiple UDP packets by identification, and specify the number of UDP packets that can be read by length, so that multiple UDP packets can be read at one time; when reading the same number of UDP packets, the system is red...
Embodiment 2
[0055] Embodiment 2. This embodiment will describe in more detail the implementation idea of Embodiment 1. This embodiment will take the linux-2.6.15 kernel as an example for the application environment of the embodiment of the present invention. It can be understood that this The embodiment of the invention can also be used in other environments, and the above-mentioned linux-2.6.15 kernel should not be construed as a limitation to the embodiment of the invention. like figure 2 shown, including the following steps:
[0056]Step 201: the application program uses the system call function to receive the UDP data packet from the UDP socket;
[0057] The above system call function can be: recv(), recvfrom() or recvmsg();
[0058] The functions of recv, recvfrom or recvmsg in the receiving process of UDP data packets are: to receive a UDP data packet from the socket corresponding to the UDP port, the difference is that the input parameters are different, such as:
[0059] ssi...
Embodiment 3
[0085] Embodiment three, such as Figure 4 As shown, the embodiment of the present invention also provides a data reading device, including:
[0086] The identification obtaining unit 401 is used to obtain the identification; the identification specifies to read multiple User Datagram Protocol UDP packets in the protocol stack of the Transmission Control Protocol / Internet Protocol TCP / IP;
[0087] The length obtaining unit 402 is used for obtaining the length; the length has specified the total length of the UDP packet to be read
[0088] A reading unit 403, configured to read a corresponding number of UDP packets from the protocol stack according to the total length of the specified UDP packets;
[0089] The copying unit 404 is configured to copy the aforementioned number of UDP data packets to the user state.
[0090] The reading unit 403 is further configured to read a UDP data packet from the protocol stack when the identification obtaining unit 401 does not obtain the i...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com