Patent Description:
An electronic device may process a data packet received from another electronic device. The electronic device may merge data packets received from a communication modem, and may transfer the merged data packets to a higher layer. <CIT> releates to a method that includes receiving multiple ingress Internet Protocol packets, each of the multiple ingress Internet Protocol packets having an Internet Protocol header and a Transmission Control Protocol segment having a Transmission Control Protocol header and a Transmission Control Protocol payload, where the multiple packets belonging to a same Transmission Control Protocol/Internet Protocol flow.

Upon initial network transmission, responses to packets that require responses may not be transmitted due to the time spent merging the same, and thus transmission speed may be decreased.

On the other hand, if the amount of data to be transmitted is small, transmission speed may be decreased due to packet merging. An aspect of the disclosure is to provide a method and apparatus for merging data packets in consideration of network throughput.

Another aspect of the disclosure is to provide a method and apparatus for flushing data packets at an effective point in time.

Another aspect of the disclosure is to provide a method and apparatus for performing a packet merge function based on network throughput in a wireless communication system.

Another aspect of the disclosure is to provide a method and apparatus for determining a flush time for controlling a packet merge function in a wireless communication system.

According to various embodiments of the disclosure, there are provided a method and apparatus for increasing network throughput by adaptively performing a packet merge function.

Advantageous effects obtainable from the disclosure may not be limited to the above mentioned effects, and other effects which are not mentioned may be clearly understood, through the following descriptions, by those skilled in the art to which the disclosure pertains.

Hereinafter, various embodiments will be described in detail with reference to attached drawings.

According to an embodiment, the electronic device <NUM> may includes a processor <NUM>, and a memory <NUM>, and may include an input device <NUM>, a sound output device <NUM>, a display device <NUM>, an audio module <NUM>, a sensor module <NUM>, an interface <NUM>, a haptic module <NUM>, a camera module <NUM>, a power management module <NUM>, a battery <NUM>, a communication module <NUM>, a subscriber identification module(SIM) <NUM>, or an antenna module <NUM>.

<FIG> is a diagram illustrating a hierarchical configuration for packet processing according to various embodiments.

Referring to <FIG>, an electronic device (e.g., the electronic device <NUM> of <FIG>) according to various embodiments includes a device area <NUM> for packet transmission or reception, a kernel area <NUM>, and a user area <NUM>. Operations performed in the kernel area <NUM> and the user area <NUM> may be implemented by a processor (e.g., the processor <NUM> of <FIG>). The processor <NUM> may perform operations and functions in the kernel area <NUM> and the user area <NUM> by implementing software <NUM> (e.g., the program <NUM> of <FIG>). The instructions related to the above functions may be stored in a memory (e.g., the memory <NUM> of <FIG>).

According to various embodiments, the device area <NUM> may provide operation of a hardware device for transmitting or receiving a packet. The device area <NUM> includes a network connection device <NUM> (e.g., a network interface controller (NIC)) or a modem. The network connection device <NUM> may be a hardware device for converting a packet to be transferred via a network into a signal or a bitstream, and physically transmitting or receiving the same. The packet may be a data packet that a transmission end desires to transfer to a reception end.

According to various embodiments, an application processor (AP) (e.g., the processor <NUM> of <FIG>) receives a packet via the network connection device <NUM> (e.g., the communication module <NUM> of <FIG>), and may transmit a packet via the network connection device <NUM>. For example, the network connection device <NUM> may be included in a communication processor (CP) (e.g., the sub-processor <NUM> of <FIG>). Via the network connection device <NUM>, an AP may transmit a packet to an external electronic device (e.g., the electronic device <NUM> or <NUM> of <FIG>, or a server (e.g., the server <NUM> of <FIG>)), and may receive a packet transmitted from an external electronic device or a server.

According to various embodiments, the kernel area (kernel layer) <NUM> may be included in an operating system (OS) (e.g., the operating system <NUM> of <FIG>) of the electronic device. The kernel area (kernel layer) <NUM> may provide a function for controlling packet processing. The kernel area (kernel layer) <NUM> may include various modules for processing a received packet. The kernel area <NUM> may include a device driver unit <NUM>, a packet merge unit <NUM>, and a network packet processor <NUM>.

According to various embodiments, the device driver unit <NUM> may process a received packet so that the received packet is processible in a higher layer. The device driver unit <NUM> may process a packet in a manner appropriate for the operating system that the electronic device <NUM> currently runs. The device driver unit <NUM> may include one, or two or more, network device drivers (network device driver #<NUM>, network device driver #<NUM>,. , to network device driver #N). A network device driver may receive a packet according to a communication protocol defined by the manufacturer of the network connection device <NUM>. Device drivers of network devices (e.g., a modem, a LAN card, Bluetooth, nearfield communication (NFC), Wi-Fi, a display, audio, and video) may be included in the network device driver. The network connection device <NUM> may generate an interrupt (e.g., a hardware interrupt request (HW IRQ)), when transmitting a packet(s) to the processor <NUM>. A network device driver may receive packets together with an interrupt. Each network device driver may process received packets into structures. The structures may be stored in a buffer for network processing. The buffer may be configured in the form of a list for a packet merge function described below. Hereinafter, the operation of processing a packet into a structure and storing the structure may be referred to by the name of "packet structuralization".

According to various embodiments, the packet merge unit <NUM> may perform a packet merge function. The packet merge unit <NUM> may transfer received packets to a higher layer (e.g., the network packet processor <NUM>). The packet merge unit <NUM> may transfer structuralized packets received from the device driver unit <NUM> to a higher layer. The packet merge unit <NUM> may merge received packets and may transmit the same. The packet merge function may be a scheme that merges (or binds) consecutive packet data, having the same IP/TCP header information, into a single packet when receiving network device driver packets, and delivers the merged packets to a network stack. The packet merge unit <NUM> may merge received packets, and may transfer the same to a higher layer all at once, thereby reducing the load on the network packet processor <NUM>. In addition, via the packet merge function, the number of responses (e.g., acknowledge (ACK)) to received packets is reduced, and thus, the load on the network connection device <NUM> may be reduced. As the overall load on a system is decreased, throughput efficiency may be increased. Accordingly, throughput (Tput) may be increased.

According to various embodiments, the packet merge unit <NUM> may immediately deliver received packets to a higher layer (e.g., a transmission control protocol (TPC)/Internet protocol (IP) layer). If a notification indicating that reception of packets is complete is received, or if a predetermined condition is satisfied, the packet merge unit <NUM> may immediately deliver the received packets to a higher layer.

According to various embodiments, the operation in which the packet merge unit <NUM> merges received packets and transmits the merged packets to a higher layer, or immediately delivers received packets to a higher layer, may be referred to as a "flush". A "flush" may be an operation of delivering structures stored in the buffer of the packet merge unit <NUM> to a higher layer. The packet merge unit <NUM> may store structures in the form of a list in the buffer so that the structures correspond to a stream (e.g., a TPC stream). The packet merge unit <NUM> includes a packet list corresponding to each stream.

According to various embodiments, the packet merge function may be referred to as "offload" or "receive offload". The packet merge function may be performed as a function defined in the OS that currently runs in the electronic device <NUM>. For example, the packet merge function may include "generic receiver offload (GRO)" of Linux™. As another example, the packet merge function may be "receive segment coalescing (RSC)" of Windows™.

According to various embodiments, the network packet processor <NUM> may process a packet received from the packet merge unit <NUM>. The network packet processor <NUM> may include a network stack. The network packet processor <NUM> may include a network layer (e.g., an internet protocol (IP) or an internet control message protocol (ICMP) layer) and a transport layer (a transmission control protocol (TCP) or a user datagram protocol (UDP) layer). The network packet processor <NUM> may receive a packet from the network connection device <NUM> via the device driver unit <NUM> and the packet merge unit <NUM>. The network packet processor <NUM> may process a received packet so that the received packet is processible in the user area, and may transfer the processed packet to the user area. For example, in the IP layer, the network packet processor <NUM> may perform IP routing. In addition, for example, in the TCP layer, the network packet processor <NUM> may identify a TCP control block. The network packet processor <NUM> may identify the IP and port number of a corresponding packet.

According to various embodiments, the user area (user layer) <NUM> may perform operations that use packets delivered from the kernel area <NUM>. In the user area (user layer) <NUM>, delivered packets may be used appropriately for the purpose of applications that operate in the user layer. For example, a message may be displayed to a user of the electronic device <NUM>, or a video streaming service may be provided. The user area <NUM> may include an application framework <NUM> and applications <NUM>.

According to various embodiments, the applications <NUM> may operate in an operating system (e.g., the operating system <NUM> of <FIG>) for controlling resources related to the electronic device and/or an operating system. The operating system may include, for example, Android™, Linux™, iOS™, Windows™, Symbian™, Tizen™, or Bada™. The application framework <NUM> may provide a function required by the applications <NUM> in common, or may provide various functions to the applications <NUM> to enable the applications <NUM> to use the limited system resources within the electronic device.

According to various embodiments, packets received from the network connection device <NUM> may be transferred to the packet merge unit <NUM> and the network stack <NUM> via the device driver unit <NUM> of the software <NUM> (e.g., the program <NUM>), and applications may use packets processed in the network stack.

According to various embodiments, the packet merge function provided in the packet merge unit <NUM> may bind many received packets into one and may transfer the same to the network stack all at once, thereby reducing the processing load on the network stack. A MTU may be the maximum transmission unit of a packet that is capable of being transmitted to a network layer (e.g., the IP layer of the network stack). If a packet merge function is not applied, a network device driver may transfer a packet having a size less than or equal to the MTU to the network stack. If the packet merge function is applied, the size of a packet flushed to the network stack may exceed the maximum transmission unit (MTU). If the packet merge function is applied, the load of the network stack of the system may be reduced, and a small number of responses (ACKs) to packets may be transferred to a server side, and thus the load on data transmission hardware, such as an NIC or a modem, and on all network processors may be reduced. However, if the packet merge unit <NUM> uniformly binds packets and transfers the same to a higher layer, the network speed may not be promptly increased when the network speed is low (e.g., initial packet transmission).

According to various embodiments, a transmission protocol, such as TCP, may increase the size of a window every time an ACK is received for congestion control. For example, upon initial transmission, the transmission protocol may exponentially increase a window size every time an ACK is received, until the window size exceeds a threshold value. For example, upon initial transmission, the more quickly a response to a transmitted packet is provided, the greater the increase in network speed. However, if the number of responses (ACK) to be transmitted is small, the network speed may be only slightly increased. Accordingly the time taken to start an initial screen when a streaming video is played may be long. For example, if an ACK is transmitted once for a plurality of packets which are merged, as opposed to transmitting an ACK for each received packet, the transmission end may increase the size of a window in consideration of the fact that the ACK is transmitted once. If a packet merge function is applied, the number of times that an ACK is produced may be reduced, and thus throughput may be lower than the case in which the packet merge function is not applied. With better network conditions, the number of times an ACK is produced is increased. Accordingly, throughput may be decreased by a packet merge function.

According to various embodiments of the disclosure, packets may be adaptively merged based on a network speed and may then be transferred to a higher layer, or received packets may be immediately transferred to a higher layer, and thus throughput may be improved. Hereinafter, an operation in which the packet merge unit <NUM> transfers packets (e.g., merged packets) to a higher layer may be referred to as a "flush" operation. According to various embodiments, the electronic device may measure network throughput. In addition, according to various embodiments, the electronic device may perform "flushing" based on the measured throughput. Hereinafter, <FIG> describes operations for performing flushing based on network throughput by an electronic device according to various embodiments.

<FIG> is a diagram illustrating an example <NUM> of throughput-based packet processing according to various embodiments.

Referring to <FIG>, the device driver unit <NUM> of an electronic device (e.g., the electronic device <NUM> of <FIG>) may include a flush time controller <NUM>. The network packet processor <NUM> of the electronic device <NUM> may provide network statistic information <NUM>. The electronic device <NUM> may include a web application <NUM>, a streaming application <NUM>, and a throughput measurement application <NUM> in the user area <NUM>. Although not illustrated, the user area <NUM> may further include various applications (e.g., a game application).

According to various embodiments, the electronic device <NUM> may measure network throughput using the throughput measurement application <NUM>. The network throughput may include the number of packets processed per unit time. The network throughput may include a network speed. The network speed may include the speed of packets that pass through a network layer. The throughput measurement electronic device <NUM> may use the network statistic information <NUM> in order to measure a network speed. The network statistic information <NUM> may include statistic information associated with packets processed in the network packet processor <NUM>. For example, the network statistic information <NUM> may include information associated with the throughput of packets in a predetermined interval, the size of packets transferred (e.g., whether the size exceeds the maximum transmit unit (MTU)), and the like. Network throughput may be measured periodically. For example, throughput may be measured every second.

According to various embodiments, a flush time may be determined based on a measured network throughput. The flush time may be a time for controlling a packet merge function. Every time a received packet is processed, the electronic device <NUM> may determine whether a flush time has elapsed (or arrived), and if the flush time has elapsed (or arrived), the electronic device <NUM> may perform flushing. A flush time value may be determined based on a throughput value measured by the throughput measurement application <NUM>. For example, a table that shows the relationship between a measured network throughput and a flush time may be defined. For example, the electronic device may store the table in the memory <NUM>.

According to various embodiments, the flush time controller <NUM> of the electronic device <NUM> may perform flushing based on a determined flush time. The flush time controller <NUM> may operate in a network device driver of the electronic device <NUM>. When processing a received packet, the flush time controller <NUM> may determine whether a flush time has elapsed from a previous flush time up to the current time. If the corresponding time has elapsed, that is, if a flush condition is satisfied, the flush time controller <NUM> may perform flushing. If flushing is performed, the packets processed (e.g., merged) in the packet merge unit <NUM> up to the current time may be transferred to a higher layer. If the corresponding flush time has not elapsed, that is, if the flush condition is not satisfied, the flush time controller <NUM> may not perform flushing. The packets may not be transferred to a higher layer. The packets may be merged with a subsequently received packet and may then be transferred to a higher layer.

According to various embodiments, the flush time controller <NUM> may determine whether to perform flushing every time a packet is received so as to determine whether to flush packets that are currently pending in a buffer as structures or to continuously maintain the packets in the pending state. The flush time controller <NUM> may control the point in time for performing flushing by determining whether the flush condition is satisfied.

According to various embodiments, although not illustrated in <FIG>, a network device driver (e.g., the flush time controller <NUM>) may be configured to receive a notification from the throughput measurement application <NUM>. For example, the electronic device <NUM> may register (or include in advance) a table that defines a network throughput range with the throughput measurement application <NUM>. If a throughput value measured by the throughput measurement application falls within a predetermined interval stored in the table, the flush time controller <NUM> may receive a notification.

According to various embodiments, the flush time controller <NUM> may obtain a flush time based on a throughput value via the notification. Subsequently, if the flush condition is satisfied (e.g., if the obtained flush time exceeds the interval between a previous flush time and the current time) during packet processing, the flush time controller <NUM> may control the packet merge unit <NUM> so as to perform flushing. If the flush condition is not satisfied, the flush time controller <NUM> may wait until the next packet is received in the state in which the corresponding packet has been added to a packet list. For example, the packet may not be transferred to a network stack, but may be maintained in the pending state. Subsequently, if a message indicating that transmission of all packets is complete is transmitted, if packets greater than or equal to a throughput value are added to the corresponding packet list via additional packet transmission, or if the flush condition is satisfied, the packet may be transmitted to a higher layer. According to various embodiments, by controlling the point in time at which packet flushing is to be performed via adjustment of the flush time, the electronic device <NUM> is capable of adaptively controlling whether to perform a packet merge function.

According to various embodiments, the electronic device <NUM> may control a flush time so as to control the point in time at which flushing is to be performed. In order to control a flush time based on a network speed, various embodiments of the disclosure may need to perform: measuring throughput, determining a flush time based on the throughput, and providing packets to a network stack based on the flush time.

The flush time controller <NUM> and the throughput measurement application <NUM> described in connection with <FIG> are merely examples of operations used to describe the disclosure, and the disclosure is not limited thereto. For example, an operation of measuring throughput may be performed by another layer in addition to a throughput measurement application. For example, a function for measuring throughput may be prepared and performed in the device driver unit <NUM> or the packet merge unit <NUM> of the kernel area <NUM>. In addition, although the flush time controller <NUM> is disposed in the device driver unit <NUM> and controls the packet merge unit <NUM> in a manner of calling a flush function, the flush time controller <NUM> may be disposed in the packet merge unit <NUM>, and may control a packet merge function and control whether to perform flushing.

Although <FIG> describes a function of measuring throughput and a function of determining whether to perform flushing together, the two functions may be performed independently. That is, determining a flush time based on throughput and determining whether to perform flushing may be performed in parallel. For example, a throughput measurement operation may be performed periodically based on a predetermined time unit (e.g., one second). Determining a flush time or updating a flush time may be performed every time that network throughput is measured, or when throughput is beyond a range stored in a predetermined table. Conversely, determining whether to perform flushing may be performed when a packet is received from the network connection device <NUM>. In order to determine whether to perform flushing, the electronic device <NUM> may make reference to a flush time.

According to the invention, the electronic device <NUM> includes the network connection device <NUM>, at least one processor <NUM>, and the memory <NUM> operatively connected to the at least one processor, wherein the memory <NUM> stores instructions that, when executed, enable the at least one processor to: receive a data packet from the network connection device <NUM> in operation <NUM>; add the data packet to a packet list corresponding to the data packet in operation <NUM>; and, if the number of data packets included in the packet list is less than a threshold value in operation <NUM>, flush the data packets to a network stack <NUM> based on a flush time value for controlling a packet merge function in operations <NUM>, <NUM>, and <NUM>, and wherein the flush time value is determined based on network throughput.

According to various embodiments of the disclosure, the instructions enable the at least one processor to: determine whether an interval between a previous processing time and a current time exceeds the flush time value, in order to flush the data packets, and flush the data packets to the network stack if the interval between the previous processing time and the current time exceeds the flush time value, wherein the previous processing time is the point in time at which flushing was last performed.

According to various embodiments of the disclosure, the instructions enable the at least one processor to store the current time in a variable buffer in which the previous processing time is stored in order to flush the data packets.

According to various embodiments of the disclosure, the instructions enable the at least one processor to wait until another data packet associated with the packet list is received if the interval between the previous processing time and the current time does not exceed the flush time value, in order to flush the data packets.

According to the invention, the network throughput is determined based on the number of packets processed per unit time in a network layer, and the flush time value is determined based on a table having stored therein information on a relationship between a network throughput range and a flush time.

According to the invention, the instructions enable the at least one processor to obtain the network throughput periodically and update the flush time value based on the obtained network throughput.

According to the invention, the instructions enable the at least one processor to: if the obtained network throughput falls within a predetermined range, generate a notification indicating that the obtained network throughput falls within the predetermined range, in order to update the flush time value; provide the generated notification to a network device driver of the electronic device; and update the flush time value via the network device driver, wherein the network device driver is configured to determine a flush time value for updating based on the notification. According to various embodiments of the disclosure, to add the data packet to the packet list corresponding to the data packet, the instructions enable the at least one processor to: structuralize the data packet; and store the structuralized data packet in the packet list in a buffer for the packet merge function.

According to various embodiments of the disclosure, the instructions enable the at least one processor to: identify the flush time value corresponding to the packet list among a plurality of flush time values, in order to flush the data packets, wherein the network throughput is determined based on the number of packets related to the packet list, which are processed per unit time in a network layer, and wherein the plurality of flush time values respectively correspond to a plurality of packet lists of the buffer.

According to various embodiments of the disclosure, the packet merge function may include generic receive offload (GRO) or receive segment coalescing (RSC), the network stack <NUM> may include a network layer and a transport layer, and the network connection device <NUM> may include a network interface controller (NIC) or a modem of the electronic device <NUM>.

According to various embodiments of the disclosure, the instructions enable the at least one processor to: increase the flush time if the network throughput exceeds a first threshold value; and decrease the flush time if the network throughput is less than a second threshold value.

<FIG> is a flowchart <NUM> illustrating an operation for packet processing according to various embodiments.

Referring to <FIG>, in operation <NUM>, an electronic device (e.g., the electronic device <NUM> of <FIG>) according to various embodiments receives a packet. The network connection device <NUM> (e.g., an NIC or a modem) of the electronic device <NUM> may transfer a packet received from a transmission end to a device driver unit (e.g., a network device driver) of the electronic device <NUM>. The device driver unit (e.g., the network device driver) of the electronic device <NUM> may deliver a packet from the network connection device <NUM>. Although not illustrated in <FIG>, the network connection device produces an interrupt (e.g., HW IRQ) in order to report the received packet to the processor <NUM>. Via the interrupt, the network device driver of the electronic device may recognize processing of the received packet. The processor <NUM> of the electronic device <NUM> may receive the packet from the network connection device <NUM> via the network device driver.

According to various embodiments, in operation <NUM>, the electronic device <NUM> may structuralize the packet in operation <NUM>. Packet structuralization may be an operation of converting a packet into a structure in a manner appropriate for processing in a higher layer. The electronic device <NUM> may manage the packet provided from the network connection device <NUM> as a structure. For example, in the case of Linux™, the electronic device may manage packets as kernel structures which are referred to as "SKB (sk_buffer)". All modules in a network stack may process packets based on SKB. Using the network device driver, the electronic device may structuralize packets received from the network connection device <NUM> and may transfer the same to the packet merge unit <NUM>.

According to various embodiments, in operation <NUM>, the electronic device <NUM> adds the structuralized packet to a packet list. The packet merge unit <NUM> of the electronic device <NUM> may manage the structuralized packets for each packet list. The packet merge unit <NUM> may be a program that provides a packet merge function. The packet merge unit <NUM> may provide a buffer in order to manage the structuralized packets. The electronic device <NUM> may store the structuralized packets using a buffer (e.g., in the form of a list). For example, the buffer may be a GRO list. The electronic device <NUM> may manage packets having the same destination using a list based on the destination of each packet (e.g., an address indicated by an IP address and a port). Hereinafter, a buffer in which packets having the same destination are stored is referred to as a packet list in the description.

According to various embodiments, based on a structuralized packet, the electronic device <NUM> may identify a packet list corresponding to the corresponding packet. For example, the electronic device <NUM> may process a structuralized packet, that is, a structure, and may identify a packet list corresponding to the structure. The electronic device <NUM> may perform hash calculation on the structure, and may identify the packet list. The electronic device <NUM> may add the structuralized packet to the identified packet list. If a packet list corresponding to the corresponding packet is not retrieved from a buffer for a packet merge function, the electronic device <NUM> may produce a new packet list. The electronic device <NUM> may add the structuralized packet to the produced packet list.

In operation <NUM>, the electronic device <NUM> determines whether the number of packets in the packet list is greater than or equal to a threshold value. A packet merge function may bind structured packets and may provide the same to the network stack all at once, thereby reducing the load of processing a packet in the network stack. The electronic device <NUM> determines whether the packets connected in the form of a list are greater than or equal to the threshold value. For example, the threshold value may be <NUM>. The electronic device <NUM> may merge a maximum of <NUM> packets per packet list. If a number of packets exceeding the maximum of <NUM> packets (i.e., if <NUM> packets) are included in the packet list, the electronic device <NUM> may transfer the connected packets to a higher layer (or may perform flushing).

When the number of packets in the packet list is less than the threshold value (No), the electronic device <NUM> proceeds with operation <NUM>. If the number of packets in the packet list is greater than or equal to the threshold value (Yes), the electronic device <NUM> may proceed with operation <NUM>.

According to the invention, in operation <NUM>, the electronic device <NUM> determines a threshold-based flush condition. Here, the threshold-based flush condition is a condition related to a flush time for controlling a packet merge function. The flush time is determined based on a measured throughput. In order to determine a flush condition, the electronic device <NUM> obtains a flush time value determined based on throughput. For example, a flush time value may be continuously updated. In order to update a flush time value, the electronic device <NUM> may identify the throughput using a network throughput measurer of a system, and may update a flush time value to correspond to the defined condition. An operation of updating a flush time value according to various embodiments will be described with reference to <FIG>.

According to various embodiments, the electronic device <NUM> may obtain a time value at which flushing was last performed in order to determine the period of time that has elapsed since flushing was performed. According to various embodiments, the electronic device <NUM> may determine whether a flush time is satisfied by determining whether the determined flush time has elapsed from the point in time at which flushing was last performed up to the current time. For example, in the state in which the number of SKB structures in a GRO list is less than <NUM> and the flush time has elapsed from the point in time at which the last flush is performed up to the current time, the electronic device <NUM> may perform control so as to call a flush function of the GRO and process the current structures in the network stack. Determining a flush condition according to various embodiments will be described with reference to <FIG>.

According to various embodiments, in operation <NUM>, the electronic device <NUM> may determine whether the flush condition is satisfied. If the flush condition is satisfied (Yes), the electronic device <NUM> may proceed with operation <NUM>. If the throughput-based flush condition is not satisfied (No), the electronic device <NUM> may not perform flushing. The electronic device <NUM> may wait until a packet is received. Subsequently, when a packet is received, the electronic device <NUM> may perform operations <NUM> to <NUM> again after performing operation <NUM>.

According to various embodiments, in operation <NUM>, the electronic device <NUM> may transfer packets to the network stack (or may perform flushing). The electronic device <NUM> may transfer packets, which are managed in the packet merge unit <NUM>, to the network stack. According to various embodiments, the electronic device <NUM> may flush all packets in the packet list of the corresponding packet. In addition, according to various embodiments, the electronic device <NUM> may flush all packets which are pending in the buffer of the packet merge unit <NUM>, irrespective of a port.

<FIG> is a flowchart <NUM> illustrating the operation for performing determination in association with packet flushing according to various embodiments. <FIG> is a part of operation <NUM> of <FIG>, and an electronic device (e.g., the electronic device <NUM> of <FIG>) or an element (e.g., the processor <NUM> of <FIG>) of the electronic device <NUM> may be understood as the subject of the flowchart <NUM>.

Referring to <FIG>, in operation <NUM>, the electronic device <NUM> (e.g., a device driver unit <NUM> or flush time controller <NUM>) according to various embodiments obtains a flush time value. The flush time value is determined based on a throughput value obtained by network throughput measurement. The electronic device <NUM> obtains the determined flush time value. According to various embodiments, if the measurement value provided from the throughput measurement application <NUM> is beyond a predetermined interval, the electronic device <NUM> may receive a notification via a network device driver. For example, in the situation in which the predetermined interval is less than or equal to <NUM> Mbps, the network device driver of the electronic device <NUM> may be configured to receive a notification from a network throughput measurer if the network throughput exceeds <NUM> Mbps. Based on the notification, the electronic device <NUM> may obtain a flush time value based on the throughput.

According to various embodiments, in operation <NUM>, the electronic device <NUM> may obtain a previous processing time. Here, the previous processing time may be the point in time at which flushing was previously performed. The electronic device <NUM> may be configured to store the point in time at which flushing is performed. According to an embodiment, the electronic device <NUM> may store the point in time at which flushing is performed in the same variable buffer every time that flushing is performed.

According to various embodiments, the electronic device <NUM> may identify, from the storage, the point in time at which flushing was last performed. The electronic device <NUM> may obtain the previous processing time in order to identify the period of time that has elapsed since flushing was performed. According to various embodiments, the previous flush time may be the point in time at which flushing was last performed in association with a packet list corresponding to a packet that is currently being processed, for example, a packet list corresponding to the same port. In addition, according to various embodiments, the point in time at which the flushing was previously performed may be the point in time at which flushing was last performed in the packet merge unit <NUM>.

According to various embodiments, in operation <NUM>, the electronic device <NUM> may determine whether the period of time between the previous processing time and the current time exceeds the flush time value. If flushing is not performed during a predetermined period of time, a response (ACK) is not produced with respect to a received packet, and a network speed may become slow. Accordingly, the electronic device <NUM> may identify the elapsed time. The electronic device <NUM> may determine the difference between the previous processing time, obtained in operation <NUM>, and the current time. The electronic device <NUM> may identify whether the difference value exceeds the flush time value obtained in operation <NUM>. That is, the electronic device <NUM> may identify whether the period of time up to the current time since flushing was last performed exceeds the flush time value.

According to various embodiments, if the period of time up to the current time since flushing was last performed exceeds the flush time value, the electronic device <NUM> may determine that the corresponding condition is satisfied in operation <NUM> of <FIG>. If the period of time up to the current time since flushing was last performed does not exceed the flush time value, the electronic device <NUM> may determine that the corresponding condition is not satisfied in operation <NUM> of <FIG>.

<FIG> is a flowchart <NUM> illustrating the operation for updating a flush time according to various embodiments.

Referring to <FIG>, in operation <NUM>, an electronic device (e.g., the electronic device <NUM> of <FIG>) obtains a throughput. According to various embodiments, the electronic device <NUM> may obtain the throughput using the throughput measurement application <NUM>. The throughput is network packet throughput, and is the number of packets that come from the network packet processor <NUM> per unit time. The throughput may be referred to as "network throughput" or "network speed". For example, the electronic device <NUM> may measure and obtain throughput in units such as bits per second (bps), megabits per second (Mbps), or the like. The electronic device <NUM> obtains a throughput value periodically, for example via the throughput measurement application <NUM>.

According to various embodiments, in some other embodiments, a function of measuring throughput may be included in the kernel area <NUM>. For example, the electronic device <NUM> may measure a network speed and obtain a throughput value using the packet merge unit <NUM>. As another example, the electronic device <NUM> may use a throughput measurement function via a network device driver.

According to various embodiments, the network throughput obtained in operation <NUM> may be a packet throughput in the entire network layer of the electronic device <NUM>. In addition, according to various other embodiments, a network throughput obtained in operation <NUM> may be a packet throughput for each port depending on each port of the electronic device <NUM>. A flush time value determined in operation <NUM> based on network throughput may be determined for each port. Here, a port may include a network socket port included in an IP destination address that is managed by an application allocated to the application.

According to various embodiments, in operation <NUM>, the electronic device <NUM> may determine a flush time value based on throughput. The electronic device <NUM> may determine a flush time value based on the throughput value obtained in operation <NUM>. According to various embodiments, a table that defines the relationship between a throughput value and a flush time value may be defined in advance. The table may be stored in, for example, a memory (e.g., the memory <NUM> of <FIG>) of the electronic device <NUM>. The table may be, for example, Table <NUM> provided below.

The number of intervals and a flush time value for each interval defined in Table <NUM> are examples, and the disclosure is not limited to the table. For example, the intervals in the table which define the relationship between a throughput value and a flush time value may be configured as two intervals, or four or more intervals, instead of three intervals as shown in Table <NUM>. In addition, other flush times, in addition to <NUM> and <NUM>, may be defined as a flush time.

According to various embodiments, network throughput may be measured for the entire network layer, irrespective of a port. In this instance, the electronic device <NUM> may determine a flush time corresponding to the measured network throughput. In addition, according to various other embodiments, network throughput may be measured for each port. The electronic device <NUM> may measure the network throughput for each port in operation <NUM>. The electronic device <NUM> may determine a flush time for each port.

According to various embodiments, in operation <NUM>, the electronic device <NUM> (e.g., the device driver unit <NUM> or flush time controller <NUM>) updates the flush time value. When a measured flush time value is changed, the electronic device <NUM> may update the flush time value. According to various embodiments, the electronic device <NUM> may update a flush time corresponding to the entire network layer. The electronic device <NUM> may control a packet merge function using the determined flush time. In addition, according to various other embodiments, a network throughput may be updated for each port. The electronic device <NUM> may control a packet merge function by applying a flush time for each port using a flush time determined for each port.

According to various embodiments, the electronic device <NUM> may increase or decrease a flush time. For example, according to Table <NUM>, if a network throughput exceeds <NUM> Mbps, the electronic device <NUM> may update a flush time from <NUM> to <NUM>. When a packet is received, the electronic device <NUM> may determine whether <NUM> has elapsed from the point in time at which flushing was last performed up to the current time, and may determine whether to flush the received packet or to wait until another packet is received after adding the packet to a packet list associated with the corresponding packet. If a network throughput is high, a large number of responses (ACK) is relatively less requested, and thus the electronic device <NUM> may increase throughput efficiency by increasing the flush time. The electronic device <NUM> according to various embodiments may increase the flush time if it is determined that the throughput is high (e.g., exceeding a first threshold value). The electronic device <NUM> according to various embodiments may decrease the flush time if it is determined that the throughput is low (e.g., less than or equal to a second threshold value). By increasing or decreasing a flush time, the interval of flushing performed by the electronic device <NUM> may be increased or decreased.

According to various embodiments, as another example, according to Table <NUM>, if a network throughput decreases to be less than or equal to 100Mbps, the electronic device <NUM> may update a flush time from <NUM> to <NUM>. If the flush time is <NUM>, the electronic device <NUM> may determine to perform flushing every time that the electronic device <NUM> determines whether a flush condition is satisfied upon reception of a packet. For example, the electronic device <NUM> may add a packet received from the network connection device <NUM> to a packet list, and may immediately transfer the packet to the network stack <NUM> without waiting for the next packet. If network throughput is low, a response (ACK or NACK) to a transmission end may be requested a relatively large number of times, so the network speed accords with the channel state. The electronic device <NUM> may perform control so as to transmit a response for each packet more frequently by decreasing a flush time to <NUM> or to be lower than before.

The electronic device <NUM> according to various embodiments of the disclosure may adaptively configure a flush time based on network throughput, and may adaptively configure the time at which packets are to be merged and transferred. In order to adaptively configure a flush time, an operation of measuring network throughput and an operation of providing a flush time based on the measured throughput may be needed.

According to various embodiments, the function of measuring throughput and the function of providing a flush time may be implemented in the user area <NUM>. For example, the electronic device <NUM> may measure a network throughput using the throughput measurement application <NUM> (e.g., Argos) of <FIG>, and may determine a flush time based on the measured throughput. In addition, if the flush time needs to be updated (i.e., if a flush time value is changed), the flush time controller <NUM> of a network device driver and the throughput measurement application <NUM> may be configured so that the throughput measurement application <NUM> provides a notification to the flush time controller <NUM> of the device driver unit <NUM>.

According to various embodiments, both the function of measuring throughput and the function of providing a flush time may be implemented in the kernel area <NUM>. For example, the function of measuring throughput and the function of providing a flush time may be implemented as a function of a network device driver of an operator. As another example, both the function of measuring throughput and the function of providing a flush time may be implemented in the packet merge unit <NUM>. The packet merge unit <NUM> may manage packets for each port, and thus, the electronic device <NUM> may easily calculate a throughput for each port. The electronic device <NUM> may additionally include a module for determining a flush time based on a throughput value obtained by the packet merge unit <NUM>.

According to various embodiments, the function of measuring throughput may be implemented in an application, and the function of providing a flush time may be implemented in the kernel area. For example, the throughput measurement application <NUM> of <FIG> may measure a network throughput, and the device driver unit <NUM> or the packet merge unit <NUM> may determine a flush time based on the measured throughput. Although the network throughputs are the same, different flush times may be used for respective ports. According to an embodiment, the table used for determining a flush time may differ depending on the features of the application that is used for each port.

According to various embodiments, the operations for performing flushing at a given flushing time are described, and the operation of determining a flush time based on network throughput is described in connection with <FIG>. According to various embodiments, the operations for performing flushing and the operation of determining a flush time may be performed in parallel. For example, although it is illustrated that flushing is performed based on an updated flush time value in <FIG>, <FIG>, and <FIG>, the scope of rights of the disclosure does not limit the order thereof. For example, after determining whether to perform flushing according to various embodiments, another flush time value may be updated.

According to the invention, an operation method of the electronic device <NUM> includes: an operation <NUM> of receiving a data packet from a network connection device <NUM>, an operation <NUM> of adding the data packet to a packet list corresponding to the data packet, and, if a number of data packets included in the packet list is less than a threshold value in operation <NUM>, operations <NUM>, <NUM>, and <NUM> for flushing the data packets to a network stack based on a flush time value for controlling a packet merge function, wherein the flush time value is determined based on network throughput.

According to various embodiments of the disclosure, the operation of flushing the data packets may include: an operation of determining whether an interval between a previous processing time and a current time exceeds the flush time value, and an operation of flushing the data packets to the network stack if the interval between the previous processing time and the current time exceeds the flush time value, wherein the previous processing time is the point in time at which flushing was last performed.

According to various embodiments of the disclosure, the operation of flushing the data packets may include an operation of storing the current time in a variable buffer in which the previous processing time is stored.

According to various embodiments of the disclosure, the operation of flushing the data packets may include an operation of waiting until another data packet associated with the packet list is received if the interval between the previous processing time and the current time does not exceed the flush time value.

According to various embodiments of the disclosure, the network throughput is determined based on the number of packets processed per unit time in a network layer, and the flush time value is determined based on a table including a relationship between a network throughput range and a flush time.

According to the invention, the method further includes: an operation of obtaining the network throughput periodically; and an operation of updating the flush time value based on the obtained network throughput.

According to the invention, the operation of updating the flush time value includes: if the obtained network throughput falls within a predetermined range, an operation of generating a notification indicating that the obtained network throughput falls within the predetermined range, an operation of providing the generated notification to a network device driver of the electronic device, and an operation of updating the flush time value via the network device driver, and the network device driver is configured to determine a flush time value for updating based on the notification.

According to various embodiments of the disclosure, the operation of adding the data packet to the packet list corresponding to the data packet may include an operation of structuralizing the data packet and an operation of storing the structuralized data packet in the packet list in a buffer for the packet merge function.

According to various embodiments of the disclosure, the operation of flushing the data packet may include an operation of identifying the flush time value corresponding to the packet list, among a plurality of flush time values, and the network throughput is determined based on the number of packets related to the packet list that are processed per unit time in a network layer, and the plurality of flush time values may respectively correspond to a plurality of packet lists of the buffer.

According to various embodiments of the disclosure, the method may further include: an operation of increasing the flush time if the network throughput exceeds a first threshold value; and an operation of decreasing the flush time if the network throughput is less than a second threshold value.

<FIG> is a diagram illustrating an example <NUM> of packet processing according to various embodiments. A network connection device (e.g., the network connection device <NUM> of <FIG>) may receive network data received from a transmission end, and may provide the same to a processor (e.g., the processor <NUM> of <FIG>). Hereinafter, <FIG> describes packet processing operations/functions <NUM> of the processor <NUM>, performed in order to control a flush time. The packet processing <NUM> may be implemented by the processor <NUM> (e.g., an AP or a CP) of the electronic device <NUM>, and may be stored in the form of software <NUM> in the memory <NUM> of the electronic device <NUM>.

Referring to <FIG>, the operations <NUM> performed in the electronic device <NUM> may include an operation performed in a network device driver <NUM>, an operation performed in a packet merge unit <NUM>, an operation performed in a network stack <NUM>, and operations performed in applications <NUM>.

According to various embodiments, the electronic device <NUM> may receive network data from the network connection device <NUM> using the network device driver <NUM>. Although not illustrated in <FIG>, the electronic device <NUM> may store received network data as a structure using the network device driver <NUM>. The electronic device <NUM> may produce a buffer for network processing in a kernel, and may store and manage structures in the corresponding buffer.

According to various embodiments, the electronic device <NUM> may manage pieces of network data as lists using the packet merge unit <NUM>. Using the packet merge unit <NUM>, the electronic device <NUM> may identify address information (e.g., a port and an IP address) included in the network data, and may manage the network data having the same destination as a single list. The electronic device <NUM> may include packet lists for storing pieces of network data in the packet merge unit <NUM>. The packet lists may include a first packet list <NUM>, a second packet list <NUM>, a third packet list <NUM>, and a fourth packet list <NUM>.

For example, pieces of network data corresponding to port #<NUM> may be connected (or added) to the first packet list <NUM>. Pieces of network data corresponding to port #<NUM> may be connected to the second packet list <NUM>. Pieces of network data corresponding to port #<NUM> may be connected to the third packet list <NUM>. If a flush condition is satisfied, the electronic device <NUM> may perform flushing, and may transfer pieces of network data connected to each packet list to a higher layer, for example, the network stack <NUM>.

According to various embodiments, in the network stack <NUM>, the electronic device <NUM> may process data transferred from a lower layer. For example, the electronic device <NUM> may process the header of an IP layer, and may perform IP routing. In addition, for example, the electronic device <NUM> may process the header of a TCP layer, and may identify a TCP control block. In the network stack <NUM>, the electronic device <NUM> may perform processing in each layer (e.g., a network layer and a transport layer), and may transfer processed packets to a higher layer (e.g., an application layer).

According to various embodiments, based on the result of processing in the network stack <NUM>, the electronic device <NUM> may obtain network statistic information (network statistics) <NUM>. The electronic device <NUM> may obtain the network statistic information <NUM> associated with at least one of network throughput, whether packet merging is performed, and the size of a transmitted packet. According to various embodiments, the statistic information <NUM> may be used to measure network throughput, which is to be described below.

According to various embodiments, the applications <NUM> may include a video application <NUM>, a short message service (SMS) application <NUM>, a web application <NUM>, and a throughput application <NUM>. Each application <NUM> may correspond to a destination port. For example, the first packet list <NUM> may correspond to the video application <NUM>, the second packet list <NUM> may correspond to the web application <NUM>, and the third packet list <NUM> may correspond to the SMS application <NUM>, respectively.

According to various embodiments, the electronic device <NUM> may measure network throughput using the throughput measurement application <NUM>. The electronic device <NUM> may determine the network throughput based on the statistic information <NUM> of the network stack <NUM>. The electronic device <NUM> may provide the determined network throughput to the network device driver <NUM>. According to various embodiments, if the network throughput falls within a predetermined range (e.g., an interval greater than <NUM> Mbps defined in Table <NUM>), the electronic device <NUM> may inform the network device driver <NUM> of the same.

According to various embodiments, the electronic device <NUM> may obtain a flush time corresponding to a current network throughput via the network device driver <NUM>. The network device driver <NUM> may be configured to update a flush time based on network throughput. The electronic device <NUM> may control whether to perform flushing using a flush time. The electronic device <NUM> may control a packet merge function by controlling whether to perform flushing. If the electronic device <NUM> determines that flushing needs to be performed, for example, if the electronic device <NUM> determines that a flush time has elapsed since the point in time at which flushing was last performed up to the current time, the electronic device <NUM> may perform flushing.

According to various embodiments, the electronic device <NUM> may measure the overall throughput of a network layer using the throughput application <NUM>. For example, the electronic device <NUM> may measure the network throughput of all applications in the network stack <NUM>. In addition, according to various embodiments, the electronic device <NUM> may measure the throughput for each port using the throughput application <NUM>. For example, the electronic device <NUM> may measure the network throughput of the video application <NUM> at port #<NUM>. In addition, for example, the electronic device <NUM> may measure the network throughput of the SMS application <NUM> at port #<NUM>. The electronic device <NUM> may manage a flush time for each port differently based on the throughput of the corresponding port. For example, the electronic device <NUM> may use <NUM> as a flush time for port #<NUM>, and may use <NUM> as a flush time for port #<NUM>. In this instance, the electronic device <NUM> may receive a packet corresponding to port #<NUM>. If the number of structures included in a packet list corresponding to port #<NUM> is less than <NUM>, which is a threshold value, the electronic device <NUM> may determine whether to perform flushing by determining whether <NUM> has elapsed from the point in time at which flushing was last performed at port # <NUM> up to the current time.

<FIG> is a diagram illustrating an example <NUM> of the performance of packet processing according to a comparative example and various embodiments. The electronic device <NUM> may capture network data using an application (e.g., Tcpdump). In addition, using an analysis tool (e.g., WireShark), a graph associated with the TCP throughput and the length of a TCP segment may be obtained from the captured network data.

Referring to <FIG>, graph <NUM> shows throughput performance when a fixed flush time (e.g., <NUM>) is applied according to the comparative example. The bar graph in the graph <NUM> indicates the length of a segment over time. The line graph in the graph <NUM> indicates throughput performance over time. The horizontal axis <NUM> indicates time (unit: second). The first vertical axis <NUM> indicates a segment length (unit: byte). The first vertical axis is related to the bar graph. The second vertical axis <NUM> indicates an average throughput (unit: bps). The second vertical axis is related to the line graph.

Graph <NUM> shows throughput performance when a flush time based on network throughput (e.g., a flush time of Table <NUM>, hereinafter referred to as an adaptive flush time) is applied according to various embodiments of the disclosure. The bar graph in the graph <NUM> indicates the length of a segment over time. The line graph in the graph <NUM> indicates throughput performance over time. The horizontal axis <NUM> indicates time (unit: seconds). The first vertical axis <NUM> indicates a segment length (unit: bytes). The second vertical axis <NUM> indicates an average throughput (unit: bps).

The segment length may indicate how many packets are merged per unit time. For example, the segment length may correspond to the number of packets merged in the packet merge unit <NUM>. For example, in the case of GRO, a maximum of <NUM> SKB structures may be merged at a time. Within a short time, as many packets as possible are merged, and thus network throughput may be further improved.

Referring to the graph <NUM>, if a fixed flush time is applied according to the comparative example, a segment length may be gradually increased for <NUM> to <NUM> seconds. The segment length may be increased up to <NUM> bytes. Referring to the graph <NUM>, if an adaptive flush time is applied according to various embodiments of the disclosure, the segment length may be increased in stages for <NUM> to <NUM> seconds. At the initial stage, the segment length may have a length less than <NUM> bytes. Subsequently, the segment length may be increased up to <NUM> bytes.

According to various embodiments of the disclosure, at the initial transmission, network throughput is low and a flush time may be set to <NUM>. For example, the electronic device <NUM> may transfer every received packet to a higher layer via flushing. Since the electronic device <NUM> transmits an ACK to a transmission end in response to each received packet, the number of packets transmitted from the transmission end may also be increased. Conversely, in the case in which a fixed flush time is applied according to the comparative example, if packets are merged and transmitted at a fixed interval, the number of responses to the packets is decreased and the increase in speed may be small. Since the transmission end does not receive sufficient ACKs, the number of packets transmitted from the transmission end may be smaller than the case in which an adaptive flush time is applied. As described above, whether the disclosure is implemented may be identified based on a change in a segment length over time, as shown via the graphs <NUM> and <NUM>.

According to various embodiments, a segment length, that is, the size of packets that are merged and transmitted, may be determined based on how long flushing is delayed every time a packet is received. Flushing may not be performed via operations <NUM> and <NUM>, in addition to operation <NUM> of <FIG>. The electronic device <NUM> may wait for the reception of subsequent packets. Subsequently, when packets are received, the packets may be stored in a buffer via a packet merge function, and whether to perform flushing may be determined again. For example, if a throughput-based flush condition is not satisfied in operation <NUM>, packets that are pending may be merged with subsequently received packets.

According to various embodiments, as network throughput is lower, the flush time becomes zero or is decreased, so that packets may not be merged. As network throughput is higher, the flush time is increased, so that packets may be merged more. If packets are not merged, the size of a transmitted packet may be limited to an MTU (e.g., <NUM> bytes). Therefore, whether the disclosure is implemented may be identified based on a segment length less than the MTU and a segment length greater than or equal to the MTU, which are obtained before and after a change in the network throughput. While the network throughput changes, the packet merge function may be turned on.

According to various embodiments of the disclosure, the electronic device <NUM> may include the network connection device <NUM>, at least one processor, and a memory that is operatively connected to the at least one processor, and the memory may store instructions that, when executed, enable the at least one processor to: obtain a first network throughput; flush first data packets received from the network connection device to a network stack based on the first network throughput; obtain a second network throughput, which is higher than the first network throughput; and merge second data packets received from the network connection device based on the second network throughput and flush the same to the network stack.

According to various embodiments of the disclosure, the size of the second data packets may be larger than a maximum transmission unit (MTU), and the size of the first data packets may be smaller than or equal to the MTU.

Claim 1:
An electronic device (<NUM>) comprising:
a network connection device (<NUM>);
at least one processor (<NUM>); and
a memory (<NUM>) operatively connected to the at least one processor (<NUM>),
wherein the memory (<NUM>) stores instructions that, when executed, enable the at least one processor (<NUM>) to:
receive a data packet from the network connection device (<NUM>);
add the data packet to a packet list corresponding to the data packet; and
if a number of data packets included in the packet list is less than a threshold value, flush the data packets to a network stack based on a flush time value for controlling a packet merge function, and
wherein the flush time value is determined based on a network throughput, wherein the network throughput is determined based on a number of packets processed per unit time in a network layer, characterized in that
the instructions enable the at least one processor (<NUM>) to:
obtain the network throughput periodically;
update the flush time value based on the obtained network throughput;
if the obtained network throughput falls within a predetermined range, generate a notification in order to update the flush time value indicating that the obtained network throughput falls within the predetermined range;
provide the generated notification to a network device driver of the electronic device; and
update the flush time value via the network device driver, and
wherein the network device driver is configured to determine a flush time value for updating based on the notification.