KR100636369B1 - Method for processing network data with a priority scheduling in operating system - Google Patents

Method for processing network data with a priority scheduling in operating system Download PDF

Info

Publication number
KR100636369B1
KR100636369B1 KR1020050045767A KR20050045767A KR100636369B1 KR 100636369 B1 KR100636369 B1 KR 100636369B1 KR 1020050045767 A KR1020050045767 A KR 1020050045767A KR 20050045767 A KR20050045767 A KR 20050045767A KR 100636369 B1 KR100636369 B1 KR 100636369B1
Authority
KR
South Korea
Prior art keywords
server
priority
queue
network data
operating system
Prior art date
Application number
KR1020050045767A
Other languages
Korean (ko)
Other versions
KR20060060530A (en
Inventor
김성훈
김중배
유민수
Original Assignee
한국전자통신연구원
한양대학교 산학협력단
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 한국전자통신연구원, 한양대학교 산학협력단 filed Critical 한국전자통신연구원
Publication of KR20060060530A publication Critical patent/KR20060060530A/en
Application granted granted Critical
Publication of KR100636369B1 publication Critical patent/KR100636369B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs

Abstract

1. 청구범위에 기재된 발명이 속한 기술분야1. TECHNICAL FIELD OF THE INVENTION

본 발명은, 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 관한 것임.The present invention relates to a network data processing method based on priority on an operating system.

2. 발명이 해결하려고 하는 기술적 과제2. The technical problem to be solved by the invention

본 발명은, 리눅스와 같은 범용 운영체제 및 임베디드 시스템 등에 사용되는 실시간 운영체제의 커널 내부에서 응용 프로세스의 우선순위에 기반하여 네트워크 프로토콜을 처리함으로써, 네트워크 패킷들의 우선순위를 보장하고, 네트워크 패킷의 지연 처리를 방지하며, 우선순위가 높은 프로세스가 CPU 사용시간을 독점하는 것을 방지하기 위한, 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법을 제공하는데 그 목적이 있음.The present invention processes network protocols based on the priority of an application process in the kernel of a real-time operating system used in a general-purpose operating system such as Linux and an embedded system, thereby ensuring the priority of network packets and delaying the processing of network packets. Its purpose is to provide a priority based network data processing method on the operating system to prevent high priority processes from monopolizing the CPU usage time.

3. 발명의 해결방법의 요지3. Summary of Solution to Invention

본 발명은, 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 있어서, 응용 프로세스가 사용하는 네트워크 연결마다 송신큐와 수신큐 및 송신서버와 수신서버를 할당하는 단계; 상기 송신서버와 상기 수신서버에 해당 응용 프로세스의 우선순위를 승계시키는 단계; CPU(Central Processing Unit) 사용권을 할당한 상태에서 상기 송신큐 또는 상기 수신큐에 해당 응용 프로세스로부터의 네트워크 데이터가 입력됨에 따라 상기 송신서버 또는 상기 수신서버를 운영체제의 런큐(Run Queue)에 삽입하는 단계; 우선순위에 따라 CPU 사용시간 동안 네트워크 데 이터를 처리하도록 해당 서버를 활성화시키는 활성화 단계; 및 CPU 사용시간이 경과함에 따라 상기 런큐에서 해당 서버를 삭제하는 단계를 포함함.The present invention provides a network data processing method based on priority on an operating system, the method comprising: allocating a transmission queue, a reception queue, a transmission server, and a reception server for each network connection used by an application process; Inheriting a priority of a corresponding application process to the sending server and the receiving server; Inserting the sending server or the receiving server into a run queue of an operating system as network data from a corresponding application process is input to the transmitting queue or the receiving queue with a CPU (Central Processing Unit) usage right assigned; ; An activation step of activating a corresponding server to process network data during CPU usage time according to a priority; And deleting the server from the run queue as the CPU usage time elapses.

4. 발명의 중요한 용도4. Important uses of the invention

본 발명은 리눅스와 같은 범용 운영체제 및 임베디드 시스템 등에 이용됨.The present invention is used in general purpose operating systems such as Linux and embedded systems.

운영체제, 커널, 우선순위 기반, 네트워크 데이터, 송신큐, 수신큐, 송신서버, 수신서버, CPU 사용권 OS, kernel, priority based, network data, send queue, receive queue, send server, receive server, CPU usage right

Description

운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법{Method for processing network data with a priority scheduling in operating system}Method for processing network data with a priority scheduling in operating system}

도 1 은 본 발명에 따른 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 구조의 일예시도,1 is an exemplary diagram of a network data processing structure based on priority on an operating system according to the present invention;

도 2 는 본 발명에 따른 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 대한 일실시예 설명도,2 is a diagram illustrating an embodiment of a network data processing method based on priority on an operating system according to the present invention;

도 3 은 본 발명에 따른 운영체제 상에서 우선순위에 기반한 네트워크 송신 데이터 처리 방법에 대한 일실시예 흐름도이다.3 is a flowchart illustrating a method for processing network transmission data based on priority on an operating system according to the present invention.

* 도면의 주요 부분에 대한 부호의 설명* Explanation of symbols for the main parts of the drawings

11 : 송신큐 12 : 송신서버11: send queue 12: send server

13 : 수신서버 14 : 수신큐13: receiving server 14: receiving queue

본 발명은 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 관한 것으로, 더욱 상세하게는 운영체제의 CPU(Central Processing Unit) 스케줄러와 네트워크 프로토콜 처리를 통합함으로써, 운영체제의 커널 상에서 네트워크 데이터의 QoS(Quality of Service)를 보장하기 위한, 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 관한 것이다.The present invention relates to a network data processing method based on priorities on an operating system. More specifically, by integrating the central processing unit (CPU) scheduler of the operating system and network protocol processing, the quality of service (QoS) of network data on the kernel of the operating system is integrated. To a network data processing method based on priority on an operating system.

현재 사용되고 있는 일반적인 운영체제는 인터럽트에 기반을 두고 네트워크 데이터(패킷)를 처리한다. 이러한 인터럽트 기반 네트워크 데이터 처리 방법은 우선순위 역전현상(낮은 우선순위를 갖는 프로세스의 네트워크 데이터를 먼저 처리)을 초래하여 응용 프로세스의 실시간성을 저해하는 한편 공평성(fairness)을 제공하지 못한다. Common operating systems in use today handle network data (packets) based on interrupts. This interrupt-based network data processing method results in priority reversal (processing network data of low priority processes first), which impairs the real-time of the application process and does not provide fairness.

즉, 시스템에 도착한 네트워크 패킷을 FIFO(First-In First-Out) 순서에 따라 인터럽트 핸들러를 통해 처리한다. 이때, 운영체제에서 인터럽트 핸들러는 항상 최고의 우선순위를 가지기 때문에, 하기와 같은 두가지 형태의 우선순위 역전현상을 발생시킨다. In other words, network packets arriving at the system are processed through the interrupt handler in the FIFO (First-In First-Out) order. In this case, since the interrupt handler always has the highest priority in the operating system, the following two types of priority inversion occur.

첫째, 우선순위가 낮은 프로세스로 전달할 네트워크 데이터 또는 우선순위가 낮은 프로세스가 생성한 네트워크 데이터의 처리로 인하여 우선순위가 높은 프로세스의 네트워크 데이터 처리가 지연될 수 있다. First, network data processing of a high priority process may be delayed due to processing of network data to be delivered to a low priority process or network data generated by a low priority process.

둘째, FIFO 순서에 의해 우선순위가 낮은 프로세스의 네트워크 데이터를 먼저 처리함으로써, 우선순위가 높은 프로세스로 전달될 네트워크 데이터의 처리가 지연될 수 있다. Second, by processing the network data of the lower priority process first in the FIFO order, the processing of the network data to be delivered to the higher priority process may be delayed.

따라서, 인터럽트 기반 네트워크 데이터 처리 방법은 리시브 라이브락(Receive Livelock : 네트워크 인터럽트 처리에 모든 CPU 시간을 소모하여 필요한 태스크를 처리하지 못하는 현상)을 유발하여 시스템의 가용성을 크게 저하시키고 네트워크 데이터의 손실을 초래하는 문제점이 있었다. Therefore, interrupt-based network data processing method causes Receive Livelock, which consumes all the CPU time for processing network interrupts and fails to process the necessary tasks, resulting in significantly reduced system availability and loss of network data. There was a problem.

이러한 인터럽트 기반 네트워크 데이터 처리 방법의 문제점을 해결하기 위하여 "Fred Kuhns"가 1999년 6월, 논문집 "IEEE Real Time Technology and Applications Symposium", 154~163페이지에 "The Design and Performance of a Real-time I/O Subsystem"이라는 제목으로 게재한 논문에 네트워크 패킷을 우선순위에 따라 처리하는 방법을 제안하였다. In order to solve this problem of interrupt-based network data processing, "Fred Kuhns" published the paper "The Design and Performance of a Real-time I" in June 1999, "IEEE Real Time Technology and Applications Symposium", pp. 154-163. In the paper titled "O / O Subsystem", we proposed a method to process network packets in order of priority.

상기 논문에 게재된 종래의 우선순위에 따른 네트워크 데이터 처리 방법은 응용 프로그램에서 사용하는 네트워크 채널(Channel 또는 Connection)의 개수만큼 운영체제 내부에 패킷 큐를 생성하고, 수신한 패킷을 분류하여 관련 응용 프로세스(패킷을 생성한 프로세스 또는 패킷이 전달될 프로세스)의 우선순위에 따라 처리한다.The network data processing method according to the priorities published in the above paper creates a packet queue in the operating system as many as the number of network channels (Channels or Connections) used in an application program, classifies the received packets, and classifies the received packets. Process according to the priority of the packet generating process or the process to which the packet is delivered.

이러한 종래의 우선순위에 따른 네트워크 데이터 처리 방법은 각 채널마다 하나의 패킷 큐를 두고 상기 패킷 큐에 입력된 네트워크 데이터 처리를 위한 커널 쓰레드를 할당한다. 이때, 각 커널 쓰레드는 자신이 관리하는 패킷 큐를 사용하는 응용 프로세스의 우선순위에 따라 스케줄링된다. 또한, 각 커널 쓰레드는 주기적(periodic)으로 수행되는 태스크로 취급된다. The network data processing method according to the priorities of the prior art allocates a kernel thread for processing network data input to the packet queue with one packet queue for each channel. At this time, each kernel thread is scheduled according to the priority of the application process using the packet queue managed by it. In addition, each kernel thread is treated as a task that is performed periodically.

따라서, 하기와 같은 문제점을 발생시킨다. Therefore, the following problems arise.

첫째, 네트워크 패킷 처리를 불필요하게 지연(delay)시키는 문제점이 있다. 즉, 네트워크 프로토콜 처리를 수행하는 커널 쓰레드는 주기적으로 활성화(activate)되어 자신이 담당한 패킷 큐에 처리되어야 할 패킷이 들어 왔는지 검사한다. 이때, 처리할 패킷이 있으면 커널 쓰레드는 큐에 도착한 모든 패킷을 처리하고 다음 주기가 도래할 때까지 비활성화된다. 만약, 처리할 패킷이 없으면 커널 쓰레드는 즉시 비활성화된다. First, there is a problem of unnecessarily delaying network packet processing. In other words, a kernel thread that performs network protocol processing is periodically activated to check whether a packet that needs to be processed is in its own packet queue. At this point, if there are packets to process, the kernel thread processes all the packets arriving in the queue and becomes inactive until the next cycle. If there are no packets to process, the kernel thread is deactivated immediately.

따라서, 비활성화된 시간구간에 처리해야 될 패킷이 도착하면, 이 패킷은 커널 쓰레드가 활성화될 때까지 처리가 지연될 수 밖에 없다.Therefore, when a packet arrives to be processed in the inactive time period, the packet is delayed until the kernel thread becomes active.

둘째, 우선순위가 높은 커널 쓰레드가 CPU를 독점하는 문제점이 있다. 즉, 우선 순위가 높은 커널 쓰레드가 활성화되어 패킷을 처리하는 동안에 계속해서 패킷이 도착하면 상기 커널 쓰레드는 중단없이 패킷을 처리하게 된다. Second, there is a problem that high priority kernel threads monopolize the CPU. That is, if a high priority kernel thread is activated and the packet arrives continuously while processing the packet, the kernel thread will process the packet without interruption.

따라서, 우선순위가 낮은 다른 응용 프로세스와 이에 해당되는 커널 쓰레드들은 우선순위가 높은 커널 쓰레드의 활성화로 인해 자신의 네트워크 데이터를 전혀 처리하지 못할 수 있다. Therefore, other low priority application processes and corresponding kernel threads may not be able to process their network data at all due to the activation of high priority kernel threads.

또한, 멀티태스킹 환경에서 병렬성(concurrency)을 크게 저하시키는 결과를 초래할 뿐만 아니라, 리시브 라이브락을 발생시킬 수도 있다. In addition, in a multitasking environment, not only does it significantly reduce the concurrency, but also generates a live livelock.

본 발명은 상기 문제점을 해결하기 위하여 제안된 것으로, 리눅스와 같은 범용 운영체제 및 임베디드 시스템 등에 사용되는 실시간 운영체제의 커널 내부에서 응용 프로세스의 우선순위에 기반하여 네트워크 프로토콜을 처리함으로써, 네트워크 패킷들의 우선순위를 보장하고, 네트워크 패킷의 지연 처리를 방지하며, 우선순위가 높은 프로세스가 CPU 사용시간을 독점하는 것을 방지하기 위한, 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법을 제공하는데 그 목적이 있다.The present invention has been proposed to solve the above problems, by processing the network protocol based on the priority of the application process in the kernel of the real-time operating system used in a general-purpose operating system, such as Linux and embedded systems, the priority of network packets The purpose of the present invention is to provide a method for processing network data based on priority on an operating system, to guarantee delay prevention of network packets, and to prevent a high priority process from monopolizing CPU usage time.

본 발명의 다른 목적 및 장점들은 하기의 설명에 의해서 이해될 수 있으며, 본 발명의 실시예에 의해 보다 분명하게 알게 될 것이다. 또한, 본 발명의 목적 및 장점들은 특허 청구 범위에 나타낸 수단 및 그 조합에 의해 실현될 수 있음을 쉽게 알 수 있을 것이다.Other objects and advantages of the present invention can be understood by the following description, and will be more clearly understood by the embodiments of the present invention. Also, it will be readily appreciated that the objects and advantages of the present invention may be realized by the means and combinations thereof indicated in the claims.

상기 목적을 달성하기 위한 본 발명의 방법은, 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 있어서, 응용 프로세스가 사용하는 네트워크 연결마다 송신큐와 수신큐 및 송신서버와 수신서버를 할당하는 단계; 상기 송신서버와 상기 수신서버에 해당 응용 프로세스의 우선순위를 승계시키는 단계; CPU(Central Processing Unit) 사용권을 할당한 상태에서 상기 송신큐 또는 상기 수신큐에 해당 응용 프로세스로부터의 네트워크 데이터가 입력됨에 따라 상기 송신서버 또는 상기 수신서버를 운영체제의 런큐(Run Queue)에 삽입하는 단계; 우선순위에 따라 CPU 사용시간 동안 네트워크 데이터를 처리하도록 해당 서버를 활성화시키는 활성화 단계; 및 CPU 사용시간이 경과함에 따라 상기 런큐에서 해당 서버를 삭제하는 단계를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided a network data processing method based on priority on an operating system, the method comprising: allocating a transmission queue, a reception queue, a transmission server, and a reception server for each network connection used by an application process; Inheriting a priority of a corresponding application process to the sending server and the receiving server; Inserting the sending server or the receiving server into a run queue of an operating system as network data from a corresponding application process is input to the transmitting queue or the receiving queue with a CPU (Central Processing Unit) usage right assigned; ; An activation step of activating the corresponding server to process network data during the CPU usage time according to the priority; And deleting the corresponding server from the run queue as the CPU usage time elapses.

상술한 목적, 특징 및 장점은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 보다 분명해 질 것이며, 그에 따라 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명의 기술적 사상을 용이하게 실시할 수 있을 것이다. 또한, 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에 그 상세한 설명을 생략하기로 한다. 이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명하기로 한다.The above objects, features and advantages will become more apparent from the following detailed description taken in conjunction with the accompanying drawings, whereby those skilled in the art may easily implement the technical idea of the present invention. There will be. In addition, in describing the present invention, when it is determined that the detailed description of the known technology related to the present invention may unnecessarily obscure the gist of the present invention, the detailed description thereof will be omitted. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1 은 본 발명에 따른 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 구조의 일예시도이다.1 is an exemplary diagram of a network data processing structure based on priority on an operating system according to the present invention.

도 1에 도시된 바와 같이, 커널 내부에 네트워크를 이용하는 각각의 응용 프로세스에 대해 2개의 네트워크 큐(송신큐 및 수신큐)와 2개의 프로토콜 처리 서버를 할당한다. 이때, 송신을 담당하는 프로토콜 서버를 송신서버(SPS : Sending Protocol Server)라 하고, 수신을 담당하는 프로토콜 서버를 수신서버( RSP : Receiving Protocol Server)라 한다. 여기서, 상기 프로토콜 서버들은 운영체제의 특성에 따라 커널 쓰레드 또는 커널 프로세스로 구현될 수 있으며, DS(Deferrable Server) 방식에 의해 스케줄링된다. As shown in Fig. 1, two network queues (send queue and receive queue) and two protocol processing servers are allocated for each application process using a network inside the kernel. At this time, the protocol server in charge of transmission is called a sending server (SPS), and the protocol server in charge is called a receiving server (RSP: Receiving Protocol Server). In this case, the protocol servers may be implemented as kernel threads or kernel processes according to characteristics of an operating system, and are scheduled by a deferrable server (DS) method.

한편, 상기 DS 스케줄링 방식에 대해 좀 더 상세히 살펴보면, DS는 소정의 주기(P)로 활성화되어 지정된 수행시간(E) 동안에 비주기적인 태스크들을 처리한다. On the other hand, the DS scheduling scheme in more detail, the DS is activated at a predetermined period (P) to process aperiodic tasks during a specified execution time (E).

즉, DS가 활성화된 시점에 처리해야 할 태스크가 없으면 바로 비활성화되지 만, 자신에게 허락된 시간(E)을 유지하고 있다가 언제든지 새로운 태스크가 도착하면 즉시 활성화되어 태스크를 처리한다. 이때, 한 주기 내에서 DS가 사용할 수 있는 CPU 사용시간은 제한되며, 수행시간(E)을 다 소모한 경우에는 다음 주기에 E만큼의 수행시간이 다시 충전된다. In other words, if there is no task to be processed at the time of DS activation, it is deactivated immediately. However, it maintains the time (E) allowed for it and is activated whenever the new task arrives at any time to process the task. At this time, the CPU usage time that the DS can use within one cycle is limited, and when the execution time (E) is exhausted, the execution time of E is charged again in the next cycle.

따라서, 수행시간(E)이 허락하는 범위 내에서 임의의 시간에 도착하는 태스크의 처리를 즉시 수행할 수 있으며, 아울러 CPU 사용시간을 매 주기마다 E로 제한할 수 있다.Therefore, processing of a task arriving at an arbitrary time can be performed immediately within the range allowed by the execution time E, and the CPU usage time can be limited to E every cycle.

도 2 는 본 발명에 따른 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 대한 일실시예 설명도이다.2 is a diagram illustrating an embodiment of a network data processing method based on priority on an operating system according to the present invention.

도 2에 도시된 바와 같이, k개의 응용 프로세스가 k개의 네트워크 연결(Connection)을 가질 때, 각 연결마다 송신을 위한 패킷 큐와 수신을 위한 패킷 큐를 할당한다. 그리고, 송신큐(SQi)와 수신큐(RQi)의 처리를 위해 송신서버(SPSi)와 수신서버(RPSi)를 생성한다. 이때, 송신서버와 수신서버는 사용자가 지정하는 우선순위 즉, 응용 프로세스의 우선순위를 승계하며, 도 1에서 설명한 DS 방식에 의해 스케줄링된다. As shown in FIG. 2, when k application processes have k network connections, a packet queue for transmission and a packet queue for reception are allocated to each connection. Then, for the processing of the transmission queue SQi and the reception queue RQi, a transmission server SPSi and a reception server RPSi are generated. At this time, the transmitting server and the receiving server inherit the priority designated by the user, that is, the priority of the application process, and are scheduled by the DS method described with reference to FIG. 1.

이를 좀 더 상세히 살펴보면 하기와 같다.Looking at this in more detail as follows.

먼저, 송신의 경우에 있어서, 송신서버의 수행시간(E)이 0보다 클 때, 응용 프로세스가 보낼 네트워크 패킷이 송신큐에 입력되면 이를 처리하기 위해 송신서버를 운영체제의 런큐(Run Queue)에 삽입한다. 이때, 운영체제 스케줄러는 고정우선순위에 기반하므로, 만약 송신서버의 우선순위가 런큐에서 가장 높다면 즉시 CPU 사용권을 할당받는다. First, in the case of transmission, when the execution time (E) of the transmission server is greater than zero, when a network packet to be sent by the application process is input to the transmission queue, the transmission server is inserted into the run queue of the operating system to process it. do. At this time, since the operating system scheduler is based on a fixed priority, if the priority of the sending server is the highest in the run queue, the CPU usage right is allocated immediately.

반면, 그렇지 않다면 우선순위가 높은 다른 응용 프로세스 또는 프로토콜 서버(송신서버 또는 수신서버)의 수행이 모두 끝난 후에 CPU 사용권을 할당받는다. 이때, 송신큐가 비어 있지 않은데도 불구하고 지정된 수행시간(E)을 모두 사용한 경우에는 송신서버를 강제로 비활성화시키고 런큐에서 삭제한다. 이후에 송신서버의 수행시간(E)이 재충전되면 송신서버를 다시 런큐에 삽입한다.Otherwise, CPU usage is allocated after all other high-priority application processes or protocol servers (sending or receiving servers) have finished running. At this time, even if the transmission queue is not empty, if all of the specified execution time E have been used, the transmission server is forcibly deactivated and deleted from the run queue. After that, when the execution time E of the transmission server is recharged, the transmission server is inserted into the run queue again.

다음으로, 수신의 경우에 있어서, 네트워크 디바이스에 패킷이 도착하면, 헤더 정보에 따라 수신할 응용 프로세스를 결정한 후 수신큐에 삽입한다. 이때, 수신서버의 수행시간이 0보다 크다면 운영체제의 런큐에 삽입한다. 또한, 수신서버의 우선순위가 런큐에서 가장 높다면 즉시 CPU 사용권을 할당받는다. Next, in the case of reception, when a packet arrives at the network device, the application process to be received is determined according to the header information and then inserted into the reception queue. At this time, if the execution time of the receiving server is greater than zero, it is inserted into the run queue of the operating system. Also, if the receiving server has the highest priority in the run queue, it is immediately assigned CPU usage.

반면, 그렇지 않다면 우선순위가 높은 다른 응용 프로세스 또는 프로토콜 서버의 수행이 모두 끝난 후에 CPU 사용권을 할당받는다. 이때, 수신큐가 비어 있지 않은데도 불구하고 지정된 수행시간을 모두 사용한 경우에는 수신서버를 강제로 비활성화시키고 런큐에서 삭제한다. 이후에 수신서버의 수행시간이 재충전되면 수신서버를 다시 런큐에 삽입한다.Otherwise, CPU usage is allocated after all other high-priority application processes or protocol servers have finished running. At this time, even though the receiving queue is not empty, if the specified execution time is used up, the receiving server is forcibly deactivated and deleted from the run queue. After that, when the execution time of the receiving server is recharged, the receiving server is inserted into the run queue again.

여기서, 수행시간이 0보다 크다는 것은 할당받은 CPU 사용시간이 남아 있음을 의미한다.Here, if the execution time is greater than zero, the allocated CPU usage time remains.

본 발명에서 운영체제는 고정우선순위(static priority CPU scheduling)에 기반하여 CPU를 스케줄링한다. In the present invention, the operating system schedules the CPU based on the static priority CPU scheduling.

도 3 은 본 발명에 따른 운영체제 상에서 우선순위에 기반한 네트워크 송신 데이터 처리 방법에 대한 일실시예 흐름도이다.3 is a flowchart illustrating a method for processing network transmission data based on priority on an operating system according to the present invention.

먼저, 응용 프로세스가 사용하는 네트워크 연결마다 송신큐와 수신큐 및 송신서버와 수신서버를 할당한다(301).First, a transmission queue, a reception queue, a transmission server, and a reception server are allocated to each network connection used by an application process (301).

이후, 상기 송신서버와 상기 수신서버에 해당 응용 프로세스의 우선순위를 승계시킨다(302).Thereafter, the priority of the application process is inherited to the sending server and the receiving server (302).

이후, CPU 사용권을 할당한 상태에서 상기 송신큐 또는 상기 수신큐에 해당 응용 프로세스로부터의 네트워크 데이터가 입력되면 상기 송신서버 또는 상기 수신서버를 운영체제의 런큐(Run Queue)에 삽입한다(303).Subsequently, when network data from the application process is input to the transmission queue or the reception queue while the CPU usage right is allocated, the transmission server or the reception server is inserted into a run queue of an operating system (303).

이후, 우선순위에 따라 CPU 사용시간 동안 네트워크 데이터를 처리하도록 해당 서버를 활성화시킨다(304). 이때, CPU 사용시간 이내에 상기 네트워크 데이터의 처리가 완료된 후 해당 큐에 새로운 네트워크 데이터가 입력됨에 따라 즉시 상기 해당 서버를 활성화시켜 새로운 네트워크 데이터를 처리한다.Thereafter, the server is activated 304 to process network data during CPU usage time according to the priority. At this time, as the new network data is input to the corresponding queue after the processing of the network data is completed within the CPU usage time, the corresponding server is immediately activated to process the new network data.

이후, CPU 사용시간이 경과함에 따라 상기 런큐에서 해당 서버를 삭제한다(305).Thereafter, as the CPU usage time elapses, the server is deleted from the run queue (305).

이후, 상기 CPU 사용시간 동안 네크워크 데이터를 모두 처리하지 못한 경우에 CPU 사용권을 재할당받아 해당 서버를 상기 런큐에 재삽입한다.Thereafter, when the network data cannot be processed during the CPU usage time, CPU usage rights are reassigned and the server is reinserted into the run queue.

상술한 바와 같은 본 발명의 방법은 프로그램으로 구현되어 컴퓨터로 읽을 수 있는 형태로 기록매체(씨디롬, 램, 롬, 플로피 디스크, 하드 디스크, 광자기 디스크 등)에 저장될 수 있다. 이러한 과정은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있으므로 더 이상 상세히 설명하지 않기 로 한다.As described above, the method of the present invention may be implemented as a program and stored in a recording medium (CD-ROM, RAM, ROM, floppy disk, hard disk, magneto-optical disk, etc.) in a computer-readable form. Since this process can be easily carried out by those skilled in the art will not be described in more detail.

이상에서 설명한 본 발명은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 있어 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니다.The present invention described above is capable of various substitutions, modifications, and changes without departing from the technical spirit of the present invention for those skilled in the art to which the present invention pertains. It is not limited by the drawings.

상기와 같은 본 발명은, 리눅스와 같은 범용 운영체제 및 임베디드 시스템 등에 사용되는 실시간 운영체제의 커널 내부에서 응용 프로세스의 우선순위에 기반하여 네트워크 프로토콜을 처리함으로써, 네트워크 패킷들의 우선순위를 보장하고, 네트워크 패킷의 지연 처리를 방지하며, 우선순위가 높은 프로세스가 CPU 사용시간을 독점하는 것을 방지할 수 있는 효과가 있다.The present invention as described above, by processing the network protocol based on the priority of the application process in the kernel of the real-time operating system used in a general-purpose operating system, such as Linux and embedded systems, to ensure the priority of network packets, This prevents delayed processing and prevents high priority processes from monopolizing CPU usage.

Claims (3)

운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법에 있어서, In the network data processing method based on the priority on the operating system, 응용 프로세스가 사용하는 네트워크 연결마다 송신큐와 수신큐 및 송신서버와 수신서버를 할당하는 단계;Allocating a transmission queue and a reception queue and a transmission server and a reception server for each network connection used by the application process; 상기 송신서버와 상기 수신서버에 해당 응용 프로세스의 우선순위를 승계시키는 단계;Inheriting a priority of a corresponding application process to the sending server and the receiving server; CPU(Central Processing Unit) 사용권을 할당한 상태에서 상기 송신큐 또는 상기 수신큐에 해당 응용 프로세스로부터의 네트워크 데이터가 입력됨에 따라 상기 송신서버 또는 상기 수신서버를 운영체제의 런큐(Run Queue)에 삽입하는 단계;Inserting the sending server or the receiving server into a run queue of an operating system as network data from a corresponding application process is input to the transmitting queue or the receiving queue with a CPU (Central Processing Unit) usage right assigned; ; 우선순위에 따라 CPU 사용시간 동안 네트워크 데이터를 처리하도록 해당 서버를 활성화시키는 활성화 단계; 및An activation step of activating the corresponding server to process network data during the CPU usage time according to the priority; And CPU 사용시간이 경과함에 따라 상기 런큐에서 해당 서버를 삭제하는 단계Deleting the server from the run queue as CPU usage time elapses 를 포함하는 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법.Network data processing method based on priority on the operating system including. 제 1 항에 있어서,The method of claim 1, CPU 사용시간 동안 네크워크 데이터를 모두 처리하지 못한 경우에 CPU 사용권을 재할당받아 해당 서버를 상기 런큐에 재삽입하는 단계Re-inserting the server into the run queue when CPU usage is reassigned if the network data has not been processed during CPU usage time 를 더 포함하는 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법.Network data processing method based on the priority on the operating system further comprising. 제 1 항 또는 제 2 항에 있어서,The method according to claim 1 or 2, 상기 활성화 단계는,The activation step, CPU 사용시간 이내에 상기 네트워크 데이터의 처리가 완료된 후 해당 큐에 새로운 네트워크 데이터가 입력됨에 따라 즉시 상기 해당 서버를 활성화시켜 새로운 네트워크 데이터를 처리하는 것을 특징으로 하는 운영체제 상에서 우선순위에 기반한 네트워크 데이터 처리 방법.And processing new network data by immediately activating the corresponding server as new network data is input to a corresponding queue after processing of the network data is completed within a CPU usage time.
KR1020050045767A 2004-11-30 2005-05-30 Method for processing network data with a priority scheduling in operating system KR100636369B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20040099537 2004-11-30
KR1020040099537 2004-11-30

Publications (2)

Publication Number Publication Date
KR20060060530A KR20060060530A (en) 2006-06-05
KR100636369B1 true KR100636369B1 (en) 2006-10-19

Family

ID=37157359

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020050045767A KR100636369B1 (en) 2004-11-30 2005-05-30 Method for processing network data with a priority scheduling in operating system

Country Status (1)

Country Link
KR (1) KR100636369B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268623B (en) * 2021-12-29 2024-04-05 深圳前海同益网络技术有限公司 Method and system for realizing application network priority setting

Also Published As

Publication number Publication date
KR20060060530A (en) 2006-06-05

Similar Documents

Publication Publication Date Title
Kulkarni et al. NFVnice: Dynamic backpressure and scheduling for NFV service chains
Buttazzo Rate monotonic vs. EDF: Judgment day
US11575607B2 (en) Dynamic load balancing for multi-core computing environments
US20190155656A1 (en) Method and system for scheduling threads for execution
US10282229B2 (en) Asynchronous task management in an on-demand network code execution environment
US7716668B2 (en) System and method for scheduling thread execution
Lee et al. Predictable communication protocol processing in real-time Mach
Masrur et al. VM-based real-time services for automotive control applications
Buttazzo Rate monotonic vs. EDF: Judgment day
Kostrzewa et al. Dynamic control for mixed-critical networks-on-chip
Bernat et al. Multiple servers and capacity sharing for implementing flexible scheduling
KR101226177B1 (en) System and method for efficient data transmission in a multi-processor environment
CN115167996A (en) Scheduling method and device, chip, electronic equipment and storage medium
Zhang et al. Dynamic scheduling with service curve for QoS guarantee of large-scale cloud storage
CN115237556A (en) Scheduling method and device, chip, electronic equipment and storage medium
Li et al. Prioritizing soft real-time network traffic in virtualized hosts based on xen
US20230096461A1 (en) Method to process data in multicore system on chip processing architecture, multicore system on chip device and storage medium
KR100636369B1 (en) Method for processing network data with a priority scheduling in operating system
Mercer et al. On predictable operating system protocol processing
US20040226014A1 (en) System and method for providing balanced thread scheduling
CN115766582A (en) Flow control method, device and system, medium and computer equipment
CN109062706B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
US10251194B2 (en) Efficient scheduling in asynchronous contention-based system
JP2012094944A (en) Communication band control device
Jabbour et al. SAF-PS: starvation avoidance for priority scheduling

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee