WO2015102213A1 - Multithread-based session management method - Google Patents

Multithread-based session management method Download PDF

Info

Publication number
WO2015102213A1
WO2015102213A1 PCT/KR2014/010025 KR2014010025W WO2015102213A1 WO 2015102213 A1 WO2015102213 A1 WO 2015102213A1 KR 2014010025 W KR2014010025 W KR 2014010025W WO 2015102213 A1 WO2015102213 A1 WO 2015102213A1
Authority
WO
WIPO (PCT)
Prior art keywords
session
thread
packet
node
session node
Prior art date
Application number
PCT/KR2014/010025
Other languages
French (fr)
Korean (ko)
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 WO2015102213A1 publication Critical patent/WO2015102213A1/en

Links

Images

Classifications

    • 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
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • 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
    • G06F9/46Multiprogramming arrangements

Definitions

  • the present invention relates to a network system, and to a multi-threaded optimized session management method in a multi-threaded environment.
  • a session is a logical connection for dialogue between users or computers in a network environment.
  • the session refers to a period from when the processes recognize each other to perform the communication between the processes until the communication is completed. For example, if a user accesses a specific website through a user device, a session is created at the first connection, and the session is maintained while working through the website. At this time, the session is terminated when an operation such as the termination of the web browser occurs.
  • network equipment may include security equipment, Layer 3 (L3) switches, and the like.
  • the security equipment may include a web server that provides a service as well as a firewall, an intrusion detection system (for example, an intrusion prevention system (IPS), and an intrusion detection system (IDS) located in front of the web server. Etc.) and Anti-DDos (Anti-Distributed Denial of Service).
  • IPS intrusion prevention system
  • IDDS intrusion detection system
  • CPUs central processing units
  • applications are developed as a multi-threaded environment in which threads are created and processed for each core.
  • session information cannot exist per thread and must be shared by all threads, resulting in a multi-threaded synchronization issue. Due to such a multi-threaded synchronization issue, there is a problem in that performance due to the expansion of multi-cores cannot be obtained.
  • An object of the present invention is to provide a multi-threaded session management method that can ensure the scalability of multi-core in a multi-threaded environment.
  • Another object of the present invention is to provide a multi-threaded session management method that can provide an optimized session management technique.
  • the multi-threaded session management method comprises the steps of: receiving a packet; if the received packet is the first session packet, generating a session node using a memory pool of a thread corresponding to the packet; The session node registering at the first position of the header of the efriest of the thread, and registering the created session node in a session hash table, the memory pool storing a pre-occupied memory area, Each of the threads of the multi-core, the memory area is provided by providing a pointer, and the provided pointer is stored and returned.
  • the received packet is an existing session packet
  • retrieving a session node corresponding to the session packet from the session hash table and retrieving information corresponding to the retrieved session node from the session hash table. Updating at, retrieving a session node from the oane of the thread, and changing the retrieved session node to the first position of the header of the ephest.
  • Another multi-thread based session management method comprises the steps of: receiving a packet, implementing a session node using a memory allocated through a memory pool of a thread corresponding to the received packet, and session the session node. Managing via a hash table and an eprise of the thread that received the packet, wherein the memory pool stores a previously occupied memory area and allocates the memory area to each thread of a multi-core by providing a pointer. And store and return the provided pointer.
  • the eprest is characterized in that the session nodes are sequentially arranged on the basis of the head and the tail, and the session node according to the packet reception is located in the head.
  • implementing the session node includes creating a session node using the memory pool of the thread if the received packet is an initial session packet.
  • the managing step includes registering the generated session node at a first position with respect to the head of the efriest, and registering the generated session node in the session hash table. do.
  • the step of managing if the received packet is an existing session packet, updating the retrieved session node to the session hash table, retrieving the session node corresponding to the packet in the epris And changing the retrieved session node to a first position relative to the head of the expert.
  • receiving a request for a search of the session node for which the session is maintained, and searching using a MRU algorithm for searching in the tail direction from the head of the ephesian by the search request includes more.
  • receiving a request for searching for a session node whose session has expired, and searching using an LRU algorithm for searching from the tail of the clergy to the head by the search request includes more.
  • the multi-threaded session management method of the present invention can ensure the scalability of the multi-core as possible by providing a memory pool optimized for the multi-core.
  • the multi-threaded session management method may optimize the session management with the MRU (MRU) or LRU (LRU) algorithm.
  • MRU MRU
  • LRU LRU
  • FIG. 1 is a diagram illustrating a multithreaded session management operation upon packet inflow of an initial session according to an embodiment of the present invention
  • FIG. 2 is a diagram illustrating a multi-thread based session management operation upon packet inflow of an existing session according to an embodiment of the present invention
  • FIG. 3 illustrates a multi-thread based session management operation for optimizing a search speed of a session node according to an embodiment of the present invention
  • FIG. 5 is a diagram illustrating a multi-thread based session management operation according to an embodiment of the present invention.
  • the present invention provides a session management method that guarantees multi-core scalability in a multi-threaded environment.
  • the multi-threaded environment proposed in the present invention refers to an environment in which a plurality of threads are run at the same time.
  • a multi-core central processing unit may unite at least two independent cores. It is integrated into one package of integrated circuits.
  • FIG. 1 is a diagram illustrating a multithreaded session management operation upon packet inflow of an initial session according to an embodiment of the present invention.
  • a network device includes a multi-core unit 100 including a multi-core 110 and a memory unit 200 in which information for managing a plurality of sessions is stored.
  • the multi core part 100 includes a multi core 110 and a thread area 120.
  • the multi core 110 includes a plurality of cores, that is, a plurality of central processing units CPU 0, CPU 1, CPU 2, and CPU 3.
  • each of the CPUs CPU 0, CPU 1, CPU 2, and CPU 3 generates a thread to perform a task.
  • the thread refers to an execution path, that is, a series of execution codes that exist inside the central processing units CPU 0, CPU 1, CPU 2, and CPU 3.
  • the thread area 120 includes a plurality of threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3.
  • each of the plurality of threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3 may be generated by each of the central processing units CPU0, CPU1, CPU2, and CPU3 of the multi-core 110.
  • the network device uses a multi-threaded environment using a plurality of threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3.
  • the memory unit 200 includes an SM memory pool 210, an SFlist 220, and a session hash table 230.
  • S memory pool 210 is a plurality of memory pools (Mempool 0, Mempool 1, Mempool 2, Mempool 3) created for each thread (THREAD 0, THREAD 1, THREAD 2, THREAD 3) (or cores (CPU)) It includes.
  • Each of the memory pools Mempool 0, Mempool 1, Mempool 2, and Mempool 3 corresponds to each of the threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3. For example, it will be described based on the memory pool (Mempool).
  • the memory pool Mempool 0 stores information (eg, a pointer) about a previously occupied memory area.
  • the occupied memory area has a large size for creating a session node.
  • the memory pool (Mempool 0) provides a pointer to allocate a memory area to a thread (Thread 0), and stores only a pointer provided to the thread to return the memory area. Through this, the memory pool Mempool 0 may reduce the overload caused by the memory access of the thread 0.
  • the remaining memory pools (Mempool 1, Mempool 2, Mempool 3) also has a similar function to the memory pool (Mempool 0).
  • the ESPREST 220 corresponds to the equivalents (Flist 0, Flist 1, Flist 2, and Flist 3) for each thread (THREAD 0, THREAD 1, THREAD 2, and THREAD 3).
  • Data structure including
  • Flist 0 is a data structure implemented as a double linked list and has a pointer to a head and a tail.
  • Flist 1, Flist 2, Flist 3 also has a similar function to the frest (Flist 0).
  • the session hash table 230 is a hash table in which session nodes for managing a session are registered.
  • the fourth central processing unit (CPU3) 114 generates a fourth thread (THREAD 3) 124.
  • the fourth CPU 114 driving the fourth thread 124 receives the packet (step 11).
  • the fourth thread 124 determines whether the received packet is a packet for a new session. As a result, if the received packet is a packet for a new session, the fourth thread 124 is provided with a pointer through the memory pool 214 corresponding to the fourth thread 124 (step 12). The fourth thread 124 creates a session node with the memory allocated through the pointer.
  • the fourth thread 124 registers the newly created session node 2241 in the position of the head located at the top of its own frest (Flist3) 224 (step 13).
  • the fourth thread registers the session node created in the efriest, and then registers the newly created session node 231 on the session hash table 230 (step 14).
  • FIG. 2 is a diagram illustrating a multi-thread based session management operation when a packet is introduced into an existing session according to an embodiment of the present invention.
  • the network device includes a multi-core unit 100 including a multi-core 110 and a memory unit 200 in which information for managing a plurality of sessions is stored.
  • a multi-core unit 100 including a multi-core 110 and a memory unit 200 in which information for managing a plurality of sessions is stored.
  • the fourth central processing unit 114 driving the fourth thread 124 receives the packet (step 21).
  • the fourth thread 124 determines whether the received packet is a packet for a new session. As a result, if it is not a packet for a new session (ie, a packet for an existing session), the fourth thread 124 searches its session hash table and updates the retrieved session node's information.
  • the fourth thread 124 searches for a session node corresponding to the packet received in the innate (Flist3) 224 (step 22).
  • the fourth thread 124 updates the session node 2242 retrieved from the eprest 224 to the first position of the head (step 23). That is, the fourth thread 124 changes the position of the retrieved session node to the first position of the head.
  • FIG. 3 is a diagram illustrating a multi-thread based session management operation for optimizing a search speed of a session node according to an embodiment of the present invention.
  • the SFlist 220 includes responsibilities Flist 0, Flist 1, Flist 2, and Flist 3 corresponding to each core (ie, a thread).
  • the session node continuously receiving the packet is located at the top of the efriest 224, that is, the head node, and the session node not receiving the packet is located at the lower end of the efriest 224. It is located in the tail direction.
  • the session nodes to which packets are introduced are located toward the session node 2244 located at the tail based on the session node 2243 located at the head, and the session nodes at which packets are not introduced are referred to the node 2244 located at the tail. It is located in the direction of the session node 2243 located at the head.
  • each core may search for the session node through the ephesists without searching for the session node in the session hash table 230.
  • a search for a session node may be requested to the fourth thread 124.
  • the fourth thread 124 searches for a session node in the fourth direction 224 from the head to the tail direction 31.
  • 'MRU' search for a session node in which a current session is maintained
  • the fourth thread 124 searches for a session node in the fourth direction 224 from the head to the tail direction 31.
  • 'LRU' session node in the fourth direction 224 from the tail to the head direction 32.
  • FIG. 4 is a diagram illustrating a search method of a session node using a general session hash table by way of example.
  • each core when not using memory pools and frits, each core performs a full check of the session hash table 300. This retrieves the session node for which the session is maintained or the session node for which the session has expired.
  • the present invention can easily retrieve the session node through the MRU algorithm and the LRU algorithm through the eprisists.
  • FIG. 5 is a diagram illustrating a multi-thread based session management operation according to an embodiment of the present invention.
  • each core central processing unit may manage and retrieve session nodes through threads.
  • the thread determines whether a packet has been received (step 511). Threads can be driven by each core and receive packets received on each core.
  • the thread determines whether the received packet is a new packet (step 513).
  • step 513 If it is determined in step 513 that the received packet is a new packet, the thread proceeds to step 515.
  • the thread is allocated memory with the pointer provided through the corresponding memory pool (step 515).
  • the thread creates a session node through the allocated memory (step 517).
  • the thread registers the created session node at a first position based on the head of the efriest (step 519).
  • the thread registers the session node registered in the efriest in the session hash table and proceeds to step 529 (step 521).
  • step 513 if it is determined in step 513 that the received packet is not a new session packet, the thread proceeds to step 523.
  • the received packet is a session packet for an existing session.
  • the thread retrieves the session node from the session hash table and updates the retrieved session node (step 523).
  • the thread updates the information of the retrieved session node.
  • the thread looks up the session node in the ephesian (step 525).
  • the thread changes the retrieved session node to the first position based on the head of the efriest and proceeds to step 529 (step 527).
  • the thread checks whether a packet search is requested (step 529).
  • step 529 If it is determined in step 529 that a packet search is requested, the flow proceeds to step 531.
  • the thread determines whether a search for a session node for which a session is maintained is requested (step 531).
  • step 531 if a search for a session node maintained in the session is requested, the thread proceeds to step 533.
  • the thread searches for the session node based on the head of the efriest using the MRU algorithm, and proceeds to step 537 (step 533).
  • step 531 determines whether the session is not maintained, that is, a search for a session node whose session has expired is requested. If it is determined in step 531 that the session is not maintained, that is, a search for a session node whose session has expired is requested, the thread proceeds to step 535.
  • the thread searches for the session node based on the tail of the efriest using the LRU algorithm, and proceeds to step 537 (step 535).
  • the current session information provisioning performance can be secured using the MRU algorithm, and the memory can be secured by searching for a session to be expired and discarded by the LRU algorithm.
  • step 537 the thread determines whether the search is completed. In this case, when the search is completed, the thread may output the search result or perform an operation (eg, updating session information or discarding an expired session) corresponding to the search result.
  • an operation eg, updating session information or discarding an expired session
  • step 537 If the determination of step 537 is completed, the process proceeds to step 539.
  • step 537 if the search result of the determination of step 537 is not completed, the process proceeds to step 529.
  • step 529 determines whether the packet search is not requested. If it is determined in step 529 that the packet search is not requested, the process proceeds to step 539.
  • the thread determines 539 whether to terminate the operation of the current thread. As a result of the determination in step 539, when the operation ends, the thread ends. In this case, the thread may return a pointer provided through the memory pool.
  • step 539 determines whether the determination in step 539 has terminate the operation of the current thread. If the determination in step 539 does not terminate the operation of the current thread, the flow proceeds to step 511.
  • the session management method in the multi-threaded environment proposed in the present invention may have scalability according to multi-core by using a memory pool. Also, when searching for session nodes, there is no need to check the session hash table as before. Therefore, it is possible to reduce the load due to session node search by searching for the session node based on head and tail (eg, using MRU or LRU algorithm) through efriest.
  • head and tail eg, using MRU or LRU algorithm
  • multi-core unit 110 multi-core
  • SMempool 220 SFlist

Abstract

The present invention relates to a multithread-based session management method. The session management method of the present invention comprises the steps of: receiving a packet; generating a session node by using a memory pool of a thread corresponding to the packet when the received packet is the first session packet; registering the generated session node at a first position of a header on an F list of the thread; and registering the generated session node in a session hash table, wherein the memory pool stores a memory area that has been occupied in advance, allocates the memory area to the respective threads of a multi-core by providing a pointer, and stores and returns the provided pointer.

Description

멀티 스레드 기반 세션 관리 방법How to Manage Multithreaded Sessions
본 발명은 네트워크 시스템에 관한 것으로서, 멀티 스레드 환경에서 멀티 스레드 기반의 최적화된 세션 관리 방법에 관한 것이다.The present invention relates to a network system, and to a multi-threaded optimized session management method in a multi-threaded environment.
세션은 네트워크 환경에서 사용자들 간 또는 컴퓨터들 간의 대화를 위한 논리적인 연결을 의미한다. 여기서, 세션은 프로세스들 사이에 통신을 수행하기 위해 프로세스들 상호 간에 서로를 인식한 이후부터 통신을 마칠 때까지의 기간을 의미한다. 예를 들면, 사용자가 사용자 기기를 통해 특정 웹 사이트에 접속하는 경우, 최초 연결 시 세션이 생성되고, 웹 사이트를 통한 작업 중에는 세션이 유지된다. 이때, 웹 브라우저의 종료 등의 동작이 발생될 때 세션이 종료된다.A session is a logical connection for dialogue between users or computers in a network environment. Herein, the session refers to a period from when the processes recognize each other to perform the communication between the processes until the communication is completed. For example, if a user accesses a specific website through a user device, a session is created at the first connection, and the session is maintained while working through the website. At this time, the session is terminated when an operation such as the termination of the web browser occurs.
네트워크 시스템 상에서 대부분의 인터넷 서비스 구간에 존재하는 네트워크 장비들은 세션에 대한 관리를 수행하여야 한다. 예를 들어, 네트워크 장비는 보안 장비, 3계층(L3) 스위치 등을 포함할 수 있다. 여기서, 보안 장비는 서비스를 제공하는 웹 서버는 물론이고, 웹 서버 전단에 위치한 방화벽(firewall), 침입 탐지 시스템(예를 들어, 아이피에스(IPS: Intrusion Prevention System), 아이디에스(IDS: Intrusion Detection System) 등), 안티-디도스(Anti-DDos: Anti-Distributed Denial of Service) 등의 장비들을 모두 포함한다.Network devices existing in most internet service intervals on a network system must manage sessions. For example, network equipment may include security equipment, Layer 3 (L3) switches, and the like. Here, the security equipment may include a web server that provides a service as well as a firewall, an intrusion detection system (for example, an intrusion prevention system (IPS), and an intrusion detection system (IDS) located in front of the web server. Etc.) and Anti-DDos (Anti-Distributed Denial of Service).
현재 네트워크 장비들은 멀티 코어 중앙 처리 장치(CPU: Central Processing Unit)의 사용이 증가하고 있다. 이러한, 멀티 코어 중앙 처리 장치에서 성능 향상을 위해 대부분의 어플리케이션은 각 코어별로 스레드를 생성하여 일을 처리하는 멀티 스레드 환경으로 개발되고 있다.Today, network equipment is increasingly using multi-core central processing units (CPUs). In order to improve performance in such a multi-core central processing unit, most applications are developed as a multi-threaded environment in which threads are created and processed for each core.
하지만, 세션 정보는 스레드별로 존재할 수 없고, 모든 스레드가 공유하여야하기 때문에 멀티 스레드 동기화 이슈가 발생된다. 이러한, 멀티 스레드 동기화 이슈로 인해 멀티 코어의 확장에 따른 성능을 확보할 수 없다는 문제점이 있었다.However, session information cannot exist per thread and must be shared by all threads, resulting in a multi-threaded synchronization issue. Due to such a multi-threaded synchronization issue, there is a problem in that performance due to the expansion of multi-cores cannot be obtained.
본 발명의 목적은 멀티 스레드 환경에서 멀티 코어의 확장성을 보장할 수 있는 멀티 스레드 기반 세션 관리 방법을 제공함에 있다.An object of the present invention is to provide a multi-threaded session management method that can ensure the scalability of multi-core in a multi-threaded environment.
본 발명의 다른 목적은 최적화된 세션 관리 기법을 제공할 수 있는 멀티 스레드 기반 세션 관리 방법을 제공함에 있다.Another object of the present invention is to provide a multi-threaded session management method that can provide an optimized session management technique.
본 발명에 따른 멀티 스레드 기반 세션 관리 방법은 패킷을 수신하는 단계, 상기 수신된 패킷이 최초의 세션 패킷이면, 상기 패킷에 대응되는 스레드의 메모리 풀을 이용하여 세션 노드를 생성하는 단계, 상기 생성된 세션 노드는 상기 스레드의 에프리스트의 헤더의 첫 번째 위치에 등록하는 단계, 및 상기 생성된 세션 노드를 세션 해시 테이블에 등록하는 단계를 포함하고, 상기 메모리 풀은 미리 점유된 메모리 영역을 저장하고, 멀티 코어의 각 스레드들로 상기 메모리 영역을 포인터를 제공하여 할당하고, 상기 제공된 포인터를 저장하여 반납하는 것을 특징으로 한다.The multi-threaded session management method according to the present invention comprises the steps of: receiving a packet; if the received packet is the first session packet, generating a session node using a memory pool of a thread corresponding to the packet; The session node registering at the first position of the header of the efriest of the thread, and registering the created session node in a session hash table, the memory pool storing a pre-occupied memory area, Each of the threads of the multi-core, the memory area is provided by providing a pointer, and the provided pointer is stored and returned.
이 실시예에 있어서, 상기 수신된 패킷이 기존에 존재하는 세션 패킷이면, 상기 세션 해시 테이블에서 상기 세션 패킷에 대응되는 세션 노드를 검색하는 단계, 상기 검색된 세션 노드에 대응되는 정보를 상기 세션 해시 테이블에서 업데이트하는 단계, 상기 스레드의 에프리스트에서 세션 노드를 검색하는 단계, 및 상기 검색된 세션 노드를 상기 에프리스트의 헤더의 첫 번째 위치로 변경시키는 단계를 더 포함한다.In the present embodiment, if the received packet is an existing session packet, retrieving a session node corresponding to the session packet from the session hash table, and retrieving information corresponding to the retrieved session node from the session hash table. Updating at, retrieving a session node from the esprit of the thread, and changing the retrieved session node to the first position of the header of the ephest.
이 실시예에 있어서, 세션이 유지되고 있는 세션 노드의 검색을 요청받는 단계, 및 상기 검색 요청에 의해 각 스레드들의 에프리스트의 헤더를 기준으로 테일 방향으로 상기 요청된 세션 노드를 검색하는 엠알유(MRU) 알고리즘을 이용하여 검색하는 단계를 더 포함한다.In this embodiment, receiving a request for a search of a session node for which a session is maintained, and MRL for searching for the requested session node in a tail direction based on the header of the esprit of each thread by the search request ( Searching using the MRU) algorithm.
이 실시예에 있어서, 세션이 만료된 세션 노드의 검색을 요청받는 단계, 및 상기 검색 요청에 의해 각 스레드들의 에프리스트의 테일을 기준으로 헤드 방향으로 상기 요청된 세션 노드를 검색하는 엘알유(LRU) 알고리즘을 이용하여 검색하는 단계를 더 포함한다.In this embodiment, receiving a request for the retrieval of a session node whose session has expired, and an LRU for retrieving the requested session node in a heading direction based on the tail of the esprit of each thread by the search request. Searching by using an algorithm).
본 발명에 따른 다른 멀티 스레드 기반 세션 관리 방법은 패킷을 수신하는 단계, 상기 수신된 패킷에 대응되는 스레드의 메모리 풀을 통해 할당받은 메모리를 이용하여 세션 노드를 구현하는 단계, 및 상기 세션 노드를 세션 해시 테이블과 상기 패킷을 수신한 스레드의 에프리스트를 통해 관리하는 단계를 포함하고, 상기 메모리 풀은 미리 점유된 메모리 영역을 저장하고, 멀티 코어의 각 스레드들로 상기 메모리 영역을 포인터를 제공하여 할당하고, 상기 제공된 포인터를 저장하여 반납하는 것을 특징으로 한다.Another multi-thread based session management method according to the present invention comprises the steps of: receiving a packet, implementing a session node using a memory allocated through a memory pool of a thread corresponding to the received packet, and session the session node. Managing via a hash table and an eprise of the thread that received the packet, wherein the memory pool stores a previously occupied memory area and allocates the memory area to each thread of a multi-core by providing a pointer. And store and return the provided pointer.
이 실시예에 있어서, 상기 에프리스트는 헤드와 테일을 기준으로 세션 노드들이 순차적으로 나열되고, 패킷 수신에 따른 세션 노드를 상기 헤드에 위치시키는 것을 특징으로 한다.In this embodiment, the eprest is characterized in that the session nodes are sequentially arranged on the basis of the head and the tail, and the session node according to the packet reception is located in the head.
이 실시예에 있어서, 상기 세션 노드를 구현하는 단계는 상기 수신된 패킷이 최초 세션 패킷이면, 상기 스레드의 메모리 풀을 이용하여 세션 노드를 생성하는 단계를 포함한다.In this embodiment, implementing the session node includes creating a session node using the memory pool of the thread if the received packet is an initial session packet.
이 실시예에 있어서, 상기 관리하는 단계는 상기 생성된 세션 노드를 상기 에프리스트의 헤드를 기준으로 첫 번째 위치에 등록하는 단계, 및 상기 생성된 세션 노드를 상기 세션 해시 테이블에 등록하는 단계를 포함한다.In this embodiment, the managing step includes registering the generated session node at a first position with respect to the head of the efriest, and registering the generated session node in the session hash table. do.
이 실시예에 있어서, 상기 관리하는 단계는 상기 수신된 패킷이 기존의 세션 패킷이면, 상기 검색된 세션 노드를 상기 세션 해시 테이블에 업데이트하는 단계, 상기 패킷에 대응되는 세션 노드를 상기 에프리스에서 검색하는 단계, 및 상기 검색된 세션 노드를 상기 에프리트의 헤드를 기준으로 첫 번째 위치로 변경하는 단계를 포함한다.In this embodiment, the step of managing, if the received packet is an existing session packet, updating the retrieved session node to the session hash table, retrieving the session node corresponding to the packet in the epris And changing the retrieved session node to a first position relative to the head of the expert.
이 실시예에 있어서, 상기 세션이 유지되는 세션 노드의 검색을 요청받는 단계, 및 상기 검색 요청에 의해 상기 에프리스트의 헤드부터 테일 방향으로 검색하는 엠알유(MRU) 알고리즘을 이용하여 검색하는 단계를 더 포함한다.In this embodiment, receiving a request for a search of the session node for which the session is maintained, and searching using a MRU algorithm for searching in the tail direction from the head of the ephesian by the search request. It includes more.
이 실시예에 있어서, 상기 세션이 만료된 세션 노드의 검색을 요청받는 단계, 및 상기 검색 요청에 의해 상기 에프리스트의 테일부터 헤드 방향으로 검색하는 엘알유(LRU) 알고리즘을 이용하여 검색하는 단계를 더 포함한다.In this embodiment, receiving a request for searching for a session node whose session has expired, and searching using an LRU algorithm for searching from the tail of the priest to the head by the search request. It includes more.
본 발명의 멀티 스레드 기반 세션 관리 방법은 멀티 코어에 최적화된 메모리 풀을 제공하여 멀티 코어의 확장성을 최대한 보장할 수 있다. 또한, 멀티 스레드 기반 세션 관리 방법은 엠알유(MRU) 또는 엘알유(LRU) 알고리즘으로 세션 관리를 최적화할 수 있다.The multi-threaded session management method of the present invention can ensure the scalability of the multi-core as possible by providing a memory pool optimized for the multi-core. In addition, the multi-threaded session management method may optimize the session management with the MRU (MRU) or LRU (LRU) algorithm.
도 1은 본 발명의 실시예에 따른 최초 세션의 패킷 유입 시 멀티스레드 기반 세션 관리 동작을 도시한 도면,1 is a diagram illustrating a multithreaded session management operation upon packet inflow of an initial session according to an embodiment of the present invention;
도 2는 본 발명의 실시예에 따른 기존 세션의 패킷 유입 시 멀티 스레드 기반 세션 관리 동작을 도시한 도면,2 is a diagram illustrating a multi-thread based session management operation upon packet inflow of an existing session according to an embodiment of the present invention;
도 3은 본 발명의 실시예에 따른 세션 노드의 검색 속도를 최적화하기 위한 멀티 스레드 기반 세션 관리 동작을 도시한 도면,3 illustrates a multi-thread based session management operation for optimizing a search speed of a session node according to an embodiment of the present invention;
도 4는 일반적인 세션 해시 테이블을 사용한 세션 노드의 검색 방식을 예시적으로 도시한 도면, 및4 exemplarily illustrates a search method of a session node using a general session hash table; and
도 5는 본 발명의 실시예에 따른 멀티 스레드 기반 세션 관리 동작을 도시한 도면이다.5 is a diagram illustrating a multi-thread based session management operation according to an embodiment of the present invention.
이하, 본 발명에 따른 바람직한 실시 예를 첨부한 도면을 참조하여 상세히 설명한다. 하기의 설명에서는 본 발명에 따른 동작을 이해하는데 필요한 부분만이 설명되며 그 이외 부분의 설명은 본 발명의 요지를 모호하지 않도록 하기 위해 생략될 것이라는 것을 유의하여야 한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that in the following description, only parts necessary for understanding the operation according to the present invention will be described, and descriptions of other parts will be omitted so as not to obscure the gist of the present invention.
본 발명은 멀티 스레드 환경에서 멀티 코어(multi-core)의 확장성을 보장하는 세션 관리 방법을 제공한다. 본 발명에서 제안된 멀티 스레드 환경은 복수의 스레드들이 동시에 구동되는 환경을 의미하고, 일예로, 멀티 코어 중앙 처리 장치(multi-core CPU: multi-core central processing unit)는 적어도 두 개의 독립 코어를 단일 집적 회로로 이루어진 하나의 패키지로 통합한 것이다.The present invention provides a session management method that guarantees multi-core scalability in a multi-threaded environment. The multi-threaded environment proposed in the present invention refers to an environment in which a plurality of threads are run at the same time. For example, a multi-core central processing unit (multi-core CPU) may unite at least two independent cores. It is integrated into one package of integrated circuits.
도 1은 본 발명의 실시예에 따른 최초 세션의 패킷 유입 시 멀티스레드 기반 세션 관리 동작을 도시한 도면이다.1 is a diagram illustrating a multithreaded session management operation upon packet inflow of an initial session according to an embodiment of the present invention.
도 1을 참조하면, 네트워크 기기는 멀티 코어(110)를 포함한 멀티 코어부(100)와 복수의 세션들을 관리하는 정보가 저장되는 메모리부(200)를 포함한다.Referring to FIG. 1, a network device includes a multi-core unit 100 including a multi-core 110 and a memory unit 200 in which information for managing a plurality of sessions is stored.
멀티 코어부(100)는 멀티 코어(110)와 스레드 영역(120)을 포함한다.The multi core part 100 includes a multi core 110 and a thread area 120.
멀티 코어(110)는 복수개의 코어들, 즉 복수개의 중앙 처리 장치들(CPU 0, CPU 1, CPU 2, CPU 3)을 포함한다. 여기서, 중앙 처리 장치들(CPU 0, CPU 1, CPU 2, CPU 3) 각각은 스레드를 생성하여 일을 수행한다. 여기서, 스레드는 중앙 처리 장치들(CPU 0, CPU 1, CPU 2, CPU 3) 내부에 존재하는 수행 경로, 즉 일련의 실행 코드를 의미한다.The multi core 110 includes a plurality of cores, that is, a plurality of central processing units CPU 0, CPU 1, CPU 2, and CPU 3. Here, each of the CPUs CPU 0, CPU 1, CPU 2, and CPU 3 generates a thread to perform a task. Here, the thread refers to an execution path, that is, a series of execution codes that exist inside the central processing units CPU 0, CPU 1, CPU 2, and CPU 3.
스레드 영역(120)은 복수의 스레드들(THREAD 0, THREAD 1, THREAD 2, THREAD 3)을 포함한다. 일예로, 복수의 스레드들(THREAD 0, THREAD 1, THREAD 2, THREAD 3) 각각은 멀티 코어(110)의 중앙 처리 장치들(CPU0, CPU1, CPU2, CPU3) 각각에 의해 생성될 수 있다.The thread area 120 includes a plurality of threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3. For example, each of the plurality of threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3 may be generated by each of the central processing units CPU0, CPU1, CPU2, and CPU3 of the multi-core 110.
이와 같이, 네트워크 기기는 복수의 스레드들(THREAD 0, THREAD 1, THREAD 2, THREAD 3)을 이용한 멀티 스레드 환경을 이용한다.As such, the network device uses a multi-threaded environment using a plurality of threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3.
한편, 메모리부(200)는 에스메모리 풀(SMempool)(210), 에스에프리스트(SFlist)(220), 및 세션 해시 테이블(Session Hash Table)(230)을 포함한다.Meanwhile, the memory unit 200 includes an SM memory pool 210, an SFlist 220, and a session hash table 230.
에스메모리 풀(210)은 스레드들(THREAD 0, THREAD 1, THREAD 2, THREAD 3)(또는 코어(CPU)들) 마다 생성된 복수의 메모리 풀들(Mempool 0, Mempool 1, Mempool 2, Mempool 3)을 포함한다. S memory pool 210 is a plurality of memory pools (Mempool 0, Mempool 1, Mempool 2, Mempool 3) created for each thread (THREAD 0, THREAD 1, THREAD 2, THREAD 3) (or cores (CPU)) It includes.
메모리 풀들(Mempool 0, Mempool 1, Mempool 2, Mempool 3) 각각은 스레드들(THREAD 0, THREAD 1, THREAD 2, THREAD 3) 각각에 대응된다. 예를 들어, 메모리 풀(Mempool)을 기준으로 설명한다. 메모리 풀(Mempool 0)은 미리 점유된 메모리 영역에 대한 정보(일예로, 포인터)를 저장한다. 여기서, 점유된 메모리 영역은 세션 노드 생성을 위해 대량의 크기를 갖는다. 메모리 풀(Mempool 0)은 스레드(Thread 0)로 메모리 영역을 할당하기 위해 포인터를 제공하고, 메모리 영역의 반납을 위해 스레드에 제공된 포인터만 저장한다. 이를 통해, 메모리 풀(Mempool 0)은 스레드(Thread 0)의 메모리 액세스에 따른 과부하를 감소시킬 수 있다. 한편, 나머지 메모리 풀들(Mempool 1, Mempool 2, Mempool 3)도 메모리 풀(Mempool 0)과 유사한 기능을 갖는다.Each of the memory pools Mempool 0, Mempool 1, Mempool 2, and Mempool 3 corresponds to each of the threads THREAD 0, THREAD 1, THREAD 2, and THREAD 3. For example, it will be described based on the memory pool (Mempool). The memory pool Mempool 0 stores information (eg, a pointer) about a previously occupied memory area. Here, the occupied memory area has a large size for creating a session node. The memory pool (Mempool 0) provides a pointer to allocate a memory area to a thread (Thread 0), and stores only a pointer provided to the thread to return the memory area. Through this, the memory pool Mempool 0 may reduce the overload caused by the memory access of the thread 0. On the other hand, the remaining memory pools (Mempool 1, Mempool 2, Mempool 3) also has a similar function to the memory pool (Mempool 0).
에스에프리스트(220)는 멀티 코어에 따른 동기화 문제를 해결하기 위해 스레드들(THREAD 0, THREAD 1, THREAD 2, THREAD 3) 마다 대응되는 에프리스트들(Flist 0, Flist 1, Flist 2, Flist 3)을 포함한 자료 구조이다.In order to solve the synchronization problem according to the multi-cores, the ESPREST 220 corresponds to the equivalents (Flist 0, Flist 1, Flist 2, and Flist 3) for each thread (THREAD 0, THREAD 1, THREAD 2, and THREAD 3). Data structure, including
예를 들어, 에프리스트(Flist0)를 기준으로 설명한다. 에프리스트(Flist 0)는 이중 링크드 리스트(doubly linked list)로 구현된 자료 구조로서 헤드(Head)와 테일(Tail)의 포인터를 갖는다. 한편, 나머지 에프리스트들(Flist 1, Flist 2, Flist 3)도 에프리스트(Flist 0)와 유사한 기능을 갖는다.For example, description will be made based on the frist Flist0. Flist 0 is a data structure implemented as a double linked list and has a pointer to a head and a tail. On the other hand, the rest of the fries (Flist 1, Flist 2, Flist 3) also has a similar function to the frest (Flist 0).
세션 해시 테이블(230)은 세션을 관리하기 위한 세션 노드들이 등록되는 해시 테이블이다.The session hash table 230 is a hash table in which session nodes for managing a session are registered.
다음으로, 본 발명에서 최초의 세션 패킷이 유입될 때, 스레드의 동작을 하기에 설명한다.Next, when the first session packet is introduced in the present invention, the operation of the thread will be described below.
예를 들어, 제 4 중앙 처리 장치(CPU3)(114)는 제 4 스레드(THREAD 3)(124)를 생성한다. 이때, 제 4 스레드(124)를 구동하는 제 4 중앙 처리 장치(114)는 패킷을 수신한다(11단계).For example, the fourth central processing unit (CPU3) 114 generates a fourth thread (THREAD 3) 124. In this case, the fourth CPU 114 driving the fourth thread 124 receives the packet (step 11).
제 4 스레드(124)는 수신된 패킷이 신규 세션에 대한 패킷인지 판단한다. 판단결과, 수신된 패킷이 신규 세션에 대한 패킷이면, 제 4 스레드(124)는 제 4 스레드(124)에 대응되는 메모리 풀(214)을 통해 포인터를 제공받는다(12단계). 제 4 스레드(124)는 포인터를 통해 할당받은 메모리로 세션 노드를 생성한다.The fourth thread 124 determines whether the received packet is a packet for a new session. As a result, if the received packet is a packet for a new session, the fourth thread 124 is provided with a pointer through the memory pool 214 corresponding to the fourth thread 124 (step 12). The fourth thread 124 creates a session node with the memory allocated through the pointer.
제 4 스레드(124)는 자신의 에프리스트(Flist3)(224)의 가장 상단에 위치한 헤드의 위치에 새로 생성된 세션 노드(2241)를 등록한다(13단계).The fourth thread 124 registers the newly created session node 2241 in the position of the head located at the top of its own frest (Flist3) 224 (step 13).
제 4 스레드는 에프리스트에 생성된 세션 노드를 등록한 후, 세션 해시 테이블(230) 상에 새로 생성된 세션 노드(231)를 등록한다(14단계).The fourth thread registers the session node created in the efriest, and then registers the newly created session node 231 on the session hash table 230 (step 14).
도 2는 본 발명의 실시예에 따른 기존 세션의 패킷 유입 시 멀티 스레드 기반 세션 관리 동작을 도시한 도면이다.2 is a diagram illustrating a multi-thread based session management operation when a packet is introduced into an existing session according to an embodiment of the present invention.
도 2를 참조하면, 네트워크 기기에서 멀티 코어(110)를 포함한 멀티 코어부(100)와 복수의 세션들을 관리하는 정보가 저장되는 메모리부(200)를 포함한다. 여기서, 멀티 코어부(100)와 메모리부(200)에 대한 상세 설명은 도 1을 참조하기로 한다.Referring to FIG. 2, the network device includes a multi-core unit 100 including a multi-core 110 and a memory unit 200 in which information for managing a plurality of sessions is stored. Here, a detailed description of the multi core unit 100 and the memory unit 200 will be described with reference to FIG. 1.
다음으로, 본 발명에서 기존에 존재하는 세션 패킷이 유입될 때 스레드의 동작을 하기에 설명한다.Next, the operation of the thread when the existing session packet is introduced in the present invention will be described below.
예를 들어, 제 4 스레드(124)를 구동하는 제 4 중앙 처리 장치(114)는 패킷을 수신한다(21단계).For example, the fourth central processing unit 114 driving the fourth thread 124 receives the packet (step 21).
제 4 스레드(124)는 수신된 패킷이 신규 세션에 대한 패킷인지 판단한다. 판단결과, 신규 세션에 대한 패킷이 아니면(즉, 기존에 존재하는 세션에 대한 패킷이면) 제 4 스레드(124)는 자신의 세션 해시 테이블을 검색하고, 검색된 세션 노드의 정보를 업데이트한다.The fourth thread 124 determines whether the received packet is a packet for a new session. As a result, if it is not a packet for a new session (ie, a packet for an existing session), the fourth thread 124 searches its session hash table and updates the retrieved session node's information.
다음으로, 제 4 스레드(124)는 에프리스트(Flist3)(224)에서 수신된 패킷에 대응되는 세션 노드를 검색한다(22단계).Next, the fourth thread 124 searches for a session node corresponding to the packet received in the esprit (Flist3) 224 (step 22).
세션 노드의 검색이 완료되면, 제 4 스레드(124)는 에프리스트(224)에서 검색된 세션 노드(2242)를 헤드의 첫 번째 위치로 업데이트한다(23단계). 즉, 제 4 스레드(124)는 검색된 세션 노드의 위치를 헤드의 첫 번째 위치로 변경한다.When the search for the session node is complete, the fourth thread 124 updates the session node 2242 retrieved from the eprest 224 to the first position of the head (step 23). That is, the fourth thread 124 changes the position of the retrieved session node to the first position of the head.
도 3은 본 발명의 실시예에 따른 세션 노드의 검색 속도를 최적화하기 위한 멀티 스레드 기반 세션 관리 동작을 도시한 도면이다.3 is a diagram illustrating a multi-thread based session management operation for optimizing a search speed of a session node according to an embodiment of the present invention.
도 3을 참조하면, 에스에프리스트(SFlist)(220)에는 각 코어(즉, 스레드)에 대응되는 에프리스트들(Flist 0, Flist 1, Flist 2, Flist 3)이 포함된다.Referring to FIG. 3, the SFlist 220 includes esprit Flist 0, Flist 1, Flist 2, and Flist 3 corresponding to each core (ie, a thread).
도 1과 도 2를 통해, 지속적으로 패킷이 유입되는 세션 노드는 에프리스트(224)의 상단, 즉 헤드 방향에 위치하게 되고, 패킷이 유입되지 않는 세션 노드는 에프리스트(224)의 하단 즉, 테일 방향에 위치하게 된다.1 and 2, the session node continuously receiving the packet is located at the top of the efriest 224, that is, the head node, and the session node not receiving the packet is located at the lower end of the efriest 224. It is located in the tail direction.
즉, 패킷이 유입된 세션 노드들은 헤드에 위치한 세션 노드(2243)를 기준으로 테일에 위치한 세션 노드(2244) 방향으로 위치하고, 패킷이 유입되지 않은 세션 노드들은 테일에 위치한 노드(2244)를 기준으로 헤드에 위치한 세션 노드(2243) 방향으로 위치한다.That is, the session nodes to which packets are introduced are located toward the session node 2244 located at the tail based on the session node 2243 located at the head, and the session nodes at which packets are not introduced are referred to the node 2244 located at the tail. It is located in the direction of the session node 2243 located at the head.
한편, 현재 세션이 유지되는 세션 노드 또는 세션이 종료된 세션 노드의 검색이 요청될 수 있다. 이때, 각 코어(스레드)들은 세션 해시 테이블(230)에서 세션 노드를 검색하지 않고, 에프리스트들을 통해 세션 노드를 검색할 수 있다.Meanwhile, a search for a session node for which a current session is maintained or a session node for which a session is terminated may be requested. In this case, each core (thread) may search for the session node through the ephesists without searching for the session node in the session hash table 230.
예를 들어, 제 4 스레드(124)로 세션 노드의 검색이 요청될 수 있다. 이때, 현재 세션이 유지되고 있는 세션 노드의 검색이 요청되면, 제 4 스레드(124)는 제 4 에프리스트(224)에서 헤드부터 테일 방향(31)으로 세션 노드를 검색하는 엠알유(Most Recently Used, 이하 'MRU'라 칭하기로 함) 알고리즘을 이용한다. 이와 달리, 세션이 만료된 세션 노드의 검색이 요청되면, 제 4 스레드(124)는 제 4 에프리스트(224)에서 테일부터 헤드 방향(32)으로 세션 노드를 검색하는 엘알유(Least Recently Used, 이하 'LRU'라 칭하기로 함) 알고리즘을 이용한다.For example, a search for a session node may be requested to the fourth thread 124. In this case, when a search for a session node in which a current session is maintained is requested, the fourth thread 124 searches for a session node in the fourth direction 224 from the head to the tail direction 31. , Hereinafter referred to as 'MRU'). In contrast, when a session node is requested to search for an expired session node, the fourth thread 124 searches for a session node in the fourth direction 224 from the tail to the head direction 32. Hereinafter referred to as 'LRU') algorithm.
도 4는 일반적인 세션 해시 테이블을 사용한 세션 노드의 검색 방식을 예시적으로 도시한 도면이다.4 is a diagram illustrating a search method of a session node using a general session hash table by way of example.
도 4를 참조하면, 메모리 풀(Mempool)들과 에프리스트(Flist)들을 이용하지 않는 경우, 각 코어들은 세션 해시 테이블(300)을 전수 검사한다. 이를 통해, 세션이 유지되는 세션 노드를 검색하거나 세션이 만료된 세션 노드를 검색한다.Referring to FIG. 4, when not using memory pools and frits, each core performs a full check of the session hash table 300. This retrieves the session node for which the session is maintained or the session node for which the session has expired.
일반적으로 세션 해시 테이블의 경우, 성능 확보를 위하여 크기를 최소 400만 버킷의 크기를 확보한다. 이때, 전수 검사를 하는 경우에는 현재 세션이 1개만 존재하여도 세션 해시 테이블(300)의 크기에 따라 최소 400만 버킷을 전수 조사해야 한다.In general, in the case of session hash table, at least 4 million buckets are sized for performance. In this case, in the case of full inspection, even if there is only one current session, at least 4 million buckets should be fully investigated according to the size of the session hash table 300.
하지만, 본 발명은 에프리스트들을 통해 MRU 알고리즘과 LRU 알고리즘을 통해 세션 노드를 쉽게 검색할 수 있다.However, the present invention can easily retrieve the session node through the MRU algorithm and the LRU algorithm through the eprisists.
도 5는 본 발명의 실시예에 따른 멀티 스레드 기반 세션 관리 동작을 도시한 도면이다.5 is a diagram illustrating a multi-thread based session management operation according to an embodiment of the present invention.
도 5를 참조하면, 각 코어(중앙 처리 장치)는 스레드를 통해 세션 노드를 관리 및 검색할 수 있다.Referring to FIG. 5, each core (central processing unit) may manage and retrieve session nodes through threads.
스레드는 패킷이 수신되었는지 판단한다(511단계). 스레드는 각 코어에 의해 구동될 수 있으며, 각 코어에 수신된 패킷을 전달받는다.The thread determines whether a packet has been received (step 511). Threads can be driven by each core and receive packets received on each core.
스레드는 수신된 패킷이 신규 패킷인지 판단한다(513단계).The thread determines whether the received packet is a new packet (step 513).
513단계의 판단결과, 수신된 패킷이 신규 패킷이면 스레드는 515단계로 진행한다.If it is determined in step 513 that the received packet is a new packet, the thread proceeds to step 515.
스레드는 대응되는 메모리 풀을 통해 제공받은 포인터로 메모리를 할당받는다(515단계).The thread is allocated memory with the pointer provided through the corresponding memory pool (step 515).
스레드는 할당된 메모리를 통해 세션 노드를 생성한다(517단계).The thread creates a session node through the allocated memory (step 517).
스레드는 생성된 세션 노드를 에프리스트의 헤드를 기준으로 첫 번째 위치에 등록한다(519단계).The thread registers the created session node at a first position based on the head of the efriest (step 519).
스레드는 에프리스트에 등록된 세션 노드를 세션 해시 테이블에 등록하고, 529단계로 진행한다(521단계).The thread registers the session node registered in the efriest in the session hash table and proceeds to step 529 (step 521).
하지만, 513단계의 판단결과, 수신된 패킷이 신규 세션 패킷이 아니면, 스레드는 523단계로 진행한다. 이때, 수신된 패킷은 기존에 존재하는 세션에 대한 세션 패킷이다.However, if it is determined in step 513 that the received packet is not a new session packet, the thread proceeds to step 523. In this case, the received packet is a session packet for an existing session.
스레드는 세션 해시 테이블에서 세션 노드를 검색하고, 검색된 세션 노드를 업데이트한다(523단계). 스레드는 검색된 세션 노드의 정보를 업데이트한다.The thread retrieves the session node from the session hash table and updates the retrieved session node (step 523). The thread updates the information of the retrieved session node.
스레드는 에프리스트에서 세션 노드를 검색한다(525단계).The thread looks up the session node in the ephesian (step 525).
스레드는 검색된 세션 노드를 에프리스트의 헤드를 기준으로 첫 번째 위치로 변경하고 529단계로 진행한다(527단계).The thread changes the retrieved session node to the first position based on the head of the efriest and proceeds to step 529 (step 527).
이후, 스레드는 패킷 검색이 요청되었는지 확인한다(529단계).Thereafter, the thread checks whether a packet search is requested (step 529).
529단계의 확인결과, 패킷 검색이 요청되면, 531단계로 진행한다.If it is determined in step 529 that a packet search is requested, the flow proceeds to step 531.
스레드는 세션이 유지되는 세션 노드의 검색이 요청되는지 판단한다(531단계).The thread determines whether a search for a session node for which a session is maintained is requested (step 531).
531단계의 판단결과, 세션 유지되는 세션 노드의 검색이 요청되면, 스레드는 533단계로 진행한다.As a result of the determination in step 531, if a search for a session node maintained in the session is requested, the thread proceeds to step 533.
스레드는 MRU 알고리즘을 이용하여 에프리스트의 헤드를 기준으로 세션 노드를 검색하고, 537단계로 진행한다(533단계).The thread searches for the session node based on the head of the efriest using the MRU algorithm, and proceeds to step 537 (step 533).
하지만, 531단계의 판단결과, 세션이 유지되지 않는 즉, 세션이 만료된 세션 노드의 검색이 요청되면, 스레드는 535단계로 진행한다.However, if it is determined in step 531 that the session is not maintained, that is, a search for a session node whose session has expired is requested, the thread proceeds to step 535.
스레드는 LRU 알고리즘을 이용하여 에프리스트의 테일을 기준으로 세션 노드를 검색하고, 537단계로 진행한다(535단계).The thread searches for the session node based on the tail of the efriest using the LRU algorithm, and proceeds to step 537 (step 535).
이와 같이, 본 발명에서는 MRU 알고리즘을 사용하여 현재 세션 정보 제공 성능을 확보할 수 있고, LRU 알고리즘으로 만료되어 폐기될 세션을 검색하고, 폐기하여 메모리를 확보할 수 있다.As described above, according to the present invention, the current session information provisioning performance can be secured using the MRU algorithm, and the memory can be secured by searching for a session to be expired and discarded by the LRU algorithm.
537단계에서 스레드는 검색이 완료되었는지 판단한다. 이때, 스레드는 검색이 완료되면, 검색 결과를 출력하거나 검색 결과에 대응되는 동작(세션 정보 업데이트 또는 만료된 세션의 폐기 등)을 수행할 수 있다.In step 537, the thread determines whether the search is completed. In this case, when the search is completed, the thread may output the search result or perform an operation (eg, updating session information or discarding an expired session) corresponding to the search result.
537단계의 판단결과 검색이 완료되면 539단계로 진행한다.If the determination of step 537 is completed, the process proceeds to step 539.
하지만, 537단계의 판단결과 검색이 완료되지 않으면 529단계로 진행한다.However, if the search result of the determination of step 537 is not completed, the process proceeds to step 529.
한편, 529단계의 확인결과, 패킷 검색이 요청되지 않으면, 539단계로 진행한다.On the other hand, if it is determined in step 529 that the packet search is not requested, the process proceeds to step 539.
스레드는 현재 스레드의 동작을 종료할 것인지를 판단한다(539). 539단계의 판단결과, 동작을 종료하는 경우, 스레드는 종료한다. 이때, 스레드는 메모리 풀을 통해 제공받은 포인터 등을 반납할 수 있다.The thread determines 539 whether to terminate the operation of the current thread. As a result of the determination in step 539, when the operation ends, the thread ends. In this case, the thread may return a pointer provided through the memory pool.
하지만, 539단계의 판단결과, 현재 스레드의 동작을 종료하지 않을 경우, 511단계로 진행한다.However, if the determination in step 539 does not terminate the operation of the current thread, the flow proceeds to step 511.
여기서는 복수의 스레드들 중에서 하나의 스레드를 기준으로 설명하였으나, 나머지 스레드들에서도 이와 유사한 동작을 수행할 수 있다.Although the description has been made based on one thread among a plurality of threads, similar operations may be performed on the remaining threads.
이와 같이, 본 발명에서 제안된 멀티 스레드 환경에서의 세션 관리 방법은 메모리 풀을 이용함으로써 멀티 코어에 따른 확장성을 가질 수 있다. 또한, 세션 노드 검색 시 기존과 같이 세션 해시 테이블을 전수 검사할 필요가 없다. 그러므로, 에프리스트를 통해 헤드와 테일을 기준으로 세션 노드를 검색(일예로, MRU 또는 LRU 알고리즘을 이용)함으로써 세션 노드 검색에 따른 부하를 감소시킬 수 있다.As such, the session management method in the multi-threaded environment proposed in the present invention may have scalability according to multi-core by using a memory pool. Also, when searching for session nodes, there is no need to check the session hash table as before. Therefore, it is possible to reduce the load due to session node search by searching for the session node based on head and tail (eg, using MRU or LRU algorithm) through efriest.
한편, 본 발명의 상세한 설명에서는 구체적인 실시 예에 관하여 설명하였으나, 본 발명의 범위에서 벗어나지 않는 한도 내에서 여러 가지 변형이 가능함은 물론이다. 그러므로 본 발명의 범위는 상술한 실시 예에 국한되어 정해져서는 안되며 후술하는 특허청구범위뿐만 아니라 이 발명의 특허청구범위와 균등한 것들에 의해 정해져야 한다.Meanwhile, in the detailed description of the present invention, specific embodiments have been described, but various modifications are possible without departing from the scope of the present invention. Therefore, the scope of the present invention should not be limited to the above-described embodiments, but should be defined by the equivalents of the claims of the present invention as well as the following claims.
(부호의 설명) (Explanation of the sign)
100: 멀티 코어부 110: 멀티 코어100: multi-core unit 110: multi-core
120: 스레드 영역 200: 메모리부120: thread area 200: memory part
210: 에스메모리 풀(SMempool) 220: 에스에프리스트(SFlist)210: SMempool 220: SFlist
230; 세션 해시 테이블230; Session hash table

Claims (11)

  1. 멀티 스레드 기반 세션 관리 방법에 있어서,In the multi-threaded session management method,
    패킷을 수신하는 단계;Receiving a packet;
    상기 수신된 패킷이 최초의 세션 패킷이면, 상기 패킷에 대응되는 스레드의 메모리 풀을 이용하여 세션 노드를 생성하는 단계;If the received packet is the first session packet, creating a session node using a memory pool of a thread corresponding to the packet;
    상기 생성된 세션 노드는 상기 스레드의 에프리스트의 헤더의 첫 번째 위치에 등록하는 단계; 및Registering the created session node in a first position of a header of an eprest of the thread; And
    상기 생성된 세션 노드를 세션 해시 테이블에 등록하는 단계를 포함하고,Registering the created session node in a session hash table,
    상기 메모리 풀은 미리 점유된 메모리 영역을 저장하고, 멀티 코어의 각 스레드들로 상기 메모리 영역을 포인터를 제공하여 할당하고, 상기 제공된 포인터를 저장하여 반납하는 것을 특징으로 하는 세션 관리 방법.The memory pool stores a memory area occupied in advance, allocates the memory area to each thread of the multi-core by providing a pointer, and stores and returns the provided pointer.
  2. 제 1 항에 있어서,The method of claim 1,
    상기 수신된 패킷이 기존에 존재하는 세션 패킷이면, 상기 세션 해시 테이블에서 상기 세션 패킷에 대응되는 세션 노드를 검색하는 단계;If the received packet is an existing session packet, searching for a session node corresponding to the session packet in the session hash table;
    상기 검색된 세션 노드에 대응되는 정보를 상기 세션 해시 테이블에서 업데이트하는 단계;Updating information corresponding to the retrieved session node in the session hash table;
    상기 스레드의 에프리스트에서 세션 노드를 검색하는 단계; 및Retrieving a session node in the efriest of the thread; And
    상기 검색된 세션 노드를 상기 에프리스트의 헤더의 첫 번째 위치로 변경시키는 단계를 더 포함하는 세션 관리 방법.And changing the retrieved session node to a first position of the header of the efriest.
  3. 제 2 항에 있어서,The method of claim 2,
    세션이 유지되고 있는 세션 노드의 검색을 요청받는 단계; 및Receiving a request for searching for a session node in which a session is maintained; And
    상기 검색 요청에 의해 각 스레드들의 에프리스트의 헤더를 기준으로 테일 방향으로 상기 요청된 세션 노드를 검색하는 엠알유(MRU) 알고리즘을 이용하여 검색하는 단계를 더 포함하는 세션 관리 방법.And retrieving using the MRU algorithm for retrieving the requested session node in a tail direction based on the header of the efriest of each thread by the retrieval request.
  4. 제 2 항에 있어서,The method of claim 2,
    세션이 만료된 세션 노드의 검색을 요청받는 단계; 및Receiving a request for searching for a session node whose session has expired; And
    상기 검색 요청에 의해 각 스레드들의 에프리스트의 테일을 기준으로 헤드 방향으로 상기 요청된 세션 노드를 검색하는 엘알유(LRU) 알고리즘을 이용하여 검색하는 단계를 더 포함하는 세션 관리 방법.And searching using the LRU algorithm for searching for the requested session node in the head direction based on the tail of the efriest of each thread by the search request.
  5. 멀티 스레드 기반 세션 관리 방법에 있어서,In the multi-threaded session management method,
    패킷을 수신하는 단계;Receiving a packet;
    상기 수신된 패킷에 대응되는 스레드의 메모리 풀을 통해 할당받은 메모리를 이용하여 세션 노드를 구현하는 단계; 및Implementing a session node using memory allocated through a memory pool of a thread corresponding to the received packet; And
    상기 세션 노드를 세션 해시 테이블과 상기 패킷을 수신한 스레드의 에프리스트를 통해 관리하는 단계를 포함하고,Managing the session node through a session hash table and an eprise of a thread that has received the packet;
    상기 메모리 풀은 미리 점유된 메모리 영역을 저장하고, 멀티 코어의 각 스레드들로 상기 메모리 영역을 포인터를 제공하여 할당하고, 상기 제공된 포인터를 저장하여 반납하는 것을 특징으로 하는 세션 관리 방법.The memory pool stores a memory area occupied in advance, allocates the memory area to each thread of the multi-core by providing a pointer, and stores and returns the provided pointer.
  6. 제 5 항에 있어서,The method of claim 5,
    상기 에프리스트는 헤드와 테일을 기준으로 세션 노드들이 순차적으로 나열되고, 패킷 수신에 따른 세션 노드를 상기 헤드에 위치시키는 것을 특징으로 하는 세션 관리 방법.The eprist is a session management method characterized in that the session nodes are sequentially arranged on the basis of the head and the tail, and the session node in the head according to the packet reception.
  7. 제 6 항에 있어서,The method of claim 6,
    상기 세션 노드를 구현하는 단계는Implementing the session node
    상기 수신된 패킷이 최초 세션 패킷이면, 상기 스레드의 메모리 풀을 이용하여 세션 노드를 생성하는 단계를 포함하는 세션 관리 방법.If the received packet is an initial session packet, creating a session node using the memory pool of the thread.
  8. 제 7 항에 있어서,The method of claim 7, wherein
    상기 관리하는 단계는The managing step
    상기 생성된 세션 노드를 상기 에프리스트의 헤드를 기준으로 첫 번째 위치에 등록하는 단계; 및Registering the created session node in a first position with respect to the head of the efriest; And
    상기 생성된 세션 노드를 상기 세션 해시 테이블에 등록하는 단계를 포함하는 세션 관리 방법.Registering the created session node with the session hash table.
  9. 제 6 항에 있어서,The method of claim 6,
    상기 관리하는 단계는The managing step
    상기 수신된 패킷이 기존의 세션 패킷이면, 상기 검색된 세션 노드를 상기 세션 해시 테이블에 업데이트하는 단계;If the received packet is an existing session packet, updating the retrieved session node in the session hash table;
    상기 패킷에 대응되는 세션 노드를 상기 에프리스에서 검색하는 단계; 및Searching for the session node corresponding to the packet in the epris; And
    상기 검색된 세션 노드를 상기 에프리트의 헤드를 기준으로 첫 번째 위치로 변경하는 단계를 포함하는 세션 관리 방법.Changing the retrieved session node to a first position relative to the head of the expert.
  10. 제 6 항에 있어서,The method of claim 6,
    상기 세션이 유지되는 세션 노드의 검색을 요청받는 단계; 및Receiving a request for searching for a session node in which the session is maintained; And
    상기 검색 요청에 의해 상기 에프리스트의 헤드부터 테일 방향으로 검색하는 엠알유(MRU) 알고리즘을 이용하여 검색하는 단계를 더 포함하는 세션 관리 방법.And searching using a MRU algorithm for searching in the tail direction from the head of the ephesian by the search request.
  11. 제 6 항에 있어서,The method of claim 6,
    상기 세션이 만료된 세션 노드의 검색을 요청받는 단계; 및Receiving a request for searching for a session node whose session has expired; And
    상기 검색 요청에 의해 상기 에프리스트의 테일부터 헤드 방향으로 검색하는 엘알유(LRU) 알고리즘을 이용하여 검색하는 단계를 더 포함하는 세션 관리 방법.And searching using an LRU algorithm for searching from the tail of the efriest to the head by the search request.
PCT/KR2014/010025 2013-12-30 2014-10-23 Multithread-based session management method WO2015102213A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2013-0167521 2013-12-30
KR1020130167521A KR101571802B1 (en) 2013-12-30 2013-12-30 Method for managing session based on multi thread

Publications (1)

Publication Number Publication Date
WO2015102213A1 true WO2015102213A1 (en) 2015-07-09

Family

ID=53493534

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2014/010025 WO2015102213A1 (en) 2013-12-30 2014-10-23 Multithread-based session management method

Country Status (2)

Country Link
KR (1) KR101571802B1 (en)
WO (1) WO2015102213A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102125791B1 (en) 2019-01-23 2020-06-23 주식회사 윈스 Method and apparatus for managing network session in multi-core environment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123436A (en) * 2000-10-13 2002-04-26 Toshiba Corp System and method for managing session and computer program
KR100640004B1 (en) * 2005-08-19 2006-11-01 한국전자통신연구원 Apparatus and method for managing session state
JP2007249295A (en) * 2006-03-13 2007-09-27 Fujitsu Ltd Session management program, session management method, and session management apparatus
JP2009218778A (en) * 2008-03-10 2009-09-24 Nec Engineering Ltd Packet transmission system
KR20130019567A (en) * 2011-08-17 2013-02-27 삼성전자주식회사 Memory system including migration manager

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3791921B2 (en) 2003-07-04 2006-06-28 インターナショナル・ビジネス・マシーンズ・コーポレーション Method for analyzing network trace, processing device for analyzing network trace, computer-executable program for controlling computer as processing device, and method for correcting time difference between nodes in network
US7907948B2 (en) 2005-04-22 2011-03-15 Telefonaktiebolaget L M Ericsson (Publ) Providing anonymity to a mobile node in a session with a correspondent node

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123436A (en) * 2000-10-13 2002-04-26 Toshiba Corp System and method for managing session and computer program
KR100640004B1 (en) * 2005-08-19 2006-11-01 한국전자통신연구원 Apparatus and method for managing session state
JP2007249295A (en) * 2006-03-13 2007-09-27 Fujitsu Ltd Session management program, session management method, and session management apparatus
JP2009218778A (en) * 2008-03-10 2009-09-24 Nec Engineering Ltd Packet transmission system
KR20130019567A (en) * 2011-08-17 2013-02-27 삼성전자주식회사 Memory system including migration manager

Also Published As

Publication number Publication date
KR20150078283A (en) 2015-07-08
KR101571802B1 (en) 2015-11-25

Similar Documents

Publication Publication Date Title
US8543754B2 (en) Low latency precedence ordering in a PCI express multiple root I/O virtualization environment
EP2406723B1 (en) Scalable interface for connecting multiple computer systems which performs parallel mpi header matching
US8185896B2 (en) Method for data processing using a multi-tiered full-graph interconnect architecture
US8108545B2 (en) Packet coalescing in virtual channels of a data processing system in a multi-tiered full-graph interconnect architecture
US7793158B2 (en) Providing reliability of communication between supernodes of a multi-tiered full-graph interconnect architecture
US20080013532A1 (en) Apparatus for hardware-software classification of data packet flows
US8140731B2 (en) System for data processing using a multi-tiered full-graph interconnect architecture
US7958182B2 (en) Providing full hardware support of collective operations in a multi-tiered full-graph interconnect architecture
US7904590B2 (en) Routing information through a data processing system implementing a multi-tiered full-graph interconnect architecture
US7769891B2 (en) System and method for providing multiple redundant direct routes between supernodes of a multi-tiered full-graph interconnect architecture
US8874838B2 (en) Providing dynamic databases for a TCAM
WO2011053038A2 (en) Method and system for processing data for preventing deadlock
US20090063728A1 (en) System and Method for Direct/Indirect Transmission of Information Using a Multi-Tiered Full-Graph Interconnect Architecture
US20090063445A1 (en) System and Method for Handling Indirect Routing of Information Between Supernodes of a Multi-Tiered Full-Graph Interconnect Architecture
WO2014142553A1 (en) Interconnection fabric switching apparatus capable of dynamically allocating resources according to workload and method therefor
JP2014527733A (en) Data plane packet processing tool chain
TW201737669A (en) Nodes managing system, nodes managing method and computer-readable storage device
WO2015102372A1 (en) Apparatus and method for virtualizing network interface
WO2021060957A1 (en) Method and device for performing asynchronous operations in a communication system
US20110173483A1 (en) Fast resource recovery after thread crash
WO2014112831A1 (en) Method and system for dynamically changing page allocator
WO2018062614A1 (en) Metering data management system and computer-readable recording medium
Potluri et al. Optimizing MPI one sided communication on multi-core infiniband clusters using shared memory backed windows
WO2015102213A1 (en) Multithread-based session management method
WO2015068929A1 (en) Operation method of node considering packet characteristic in content-centered network and node

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14877307

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14877307

Country of ref document: EP

Kind code of ref document: A1