KR100725921B1 - Apparatus for TCP and UDP Socket Search - Google Patents

Apparatus for TCP and UDP Socket Search Download PDF

Info

Publication number
KR100725921B1
KR100725921B1 KR1020060069952A KR20060069952A KR100725921B1 KR 100725921 B1 KR100725921 B1 KR 100725921B1 KR 1020060069952 A KR1020060069952 A KR 1020060069952A KR 20060069952 A KR20060069952 A KR 20060069952A KR 100725921 B1 KR100725921 B1 KR 100725921B1
Authority
KR
South Korea
Prior art keywords
socket
tree
command
value
information
Prior art date
Application number
KR1020060069952A
Other languages
Korean (ko)
Other versions
KR20070057640A (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 한국전자통신연구원
Priority to US11/605,801 priority Critical patent/US7751346B2/en
Publication of KR20070057640A publication Critical patent/KR20070057640A/en
Application granted granted Critical
Publication of KR100725921B1 publication Critical patent/KR100725921B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

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

본 발명은 전송 제어 프로토콜과 사용자 데이터그램 프로토콜의 소켓 검색 장치에 관한 것임.The present invention relates to a socket retrieval device of a transmission control protocol and a user datagram protocol.

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

본 발명은 소켓의 개수를 1만개까지 허용하는 하드웨어에서 소켓 검색 시간을 줄이기 위하여 이진 검색(Binary Search) 알고리듬을 사용하고, 상기 이진 검색 알고리듬을 하드웨어로 구현하여 소켓 검색을 빠르게 할 수 있도록 도와주고, TCP 및 UDP 프로토콜의 경우 이진 트리(Binary Tree)의 관리를 위해 필요한 소켓의 생성, 제거, 검색 기능 및 리슨(Listen)/컨넥트(Connect) 등의 함수에 따른 기능을 모두 지원하여 소켓 아이디(ID)를 찾아내는 시간을 줄여 빠른 프로토콜 처리를 수행하기 위한 TCP와 UDP의 소켓 검색을 위한 소켓 검색 장치를 제공하는데 그 목적이 있음.The present invention uses a binary search algorithm to reduce the socket search time in hardware that allows the number of sockets up to 10,000, and implements the binary search algorithm in hardware to help to speed up the socket search, In case of TCP and UDP protocols, socket IDs are supported by supporting all functions such as creation, removal, retrieval, and listen / connect functions necessary for managing binary trees. Its purpose is to provide a socket retrieval device for socket retrieval of TCP and UDP to perform fast protocol processing by reducing the time required to locate a.

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

본 발명은 전송 제어 프로토콜(TCP)과 사용자 데이터그램 프로토콜(UDP)의 소켓 검색 장치에 있어서, 프로세서로부터 받은 명령 정보를 해석하여 하기 브랜치 테이블 관리 수단과 트리 테이블 관리 수단으로 명령을 전달하고, 하기 브랜치 테이블 관리 수단과 트리 테이블 관리 수단으로부터 결과를 받아 상기 프로세서로 결과를 보고하기 위한 마스터 관리 수단; 상기 마스터 관리 수단으로부터 명령을 받 아 브랜치 테이블을 관리하기 위한 브랜치 테이블 관리 수단; 및 이진 트리를 관리하기 위한 트리 테이블 관리 수단을 포함함.The present invention relates to a socket retrieval apparatus of a transmission control protocol (TCP) and a user datagram protocol (UDP), in which command information received from a processor is interpreted and transmitted to a branch table managing means and a tree table managing means. Master management means for receiving results from table management means and tree table management means and reporting the results to the processor; Branch table management means for receiving a command from the master management means and managing a branch table; And tree table management means for managing the binary tree.

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

본 발명은 네트워크 시스템 등에 이용됨.The present invention is used in network systems and the like.

TCP, UDP, 소켓 검색, C10K, 브랜치, 노드, 이진 트리, 프로세서, TOE TCP, UDP, Socket Search, C10K, Branch, Node, Binary Tree, Processor, TOE

Description

전송 제어 프로토콜과 사용자 데이터그램 프로토콜의 소켓 검색 장치{Apparatus for TCP and UDP Socket Search}Apparatus for TCP and UDP Socket Search for Transmission Control Protocol and User Datagram Protocol

도 1 은 본 발명에 따른 TCP와 UDP의 소켓 검색 장치에 대한 일실시예 설명도.1 is a diagram illustrating an embodiment of a socket retrieval apparatus for TCP and UDP according to the present invention;

도 2 는 본 발명에 따른 TCP와 UDP의 소켓 검색 장치의 일실시예 구성도.2 is a block diagram of an embodiment of a socket retrieval apparatus for TCP and UDP according to the present invention;

도 3 은 상기 도 2의 마스터 모듈(Master Module)의 일실시예 상세 구성도.3 is a detailed block diagram of an embodiment of the master module of FIG.

도 4 는 상기 도 3의 명령 및 결과 레지스터의 일실시예 설명도.4 is an explanatory diagram of one embodiment of the command and result register of FIG. 3;

도 5 는 상기 도 3의 명령 및 결과 레지스터의 다른 실시예 설명도.FIG. 5 is a diagram explaining another embodiment of the command and result register of FIG. 3; FIG.

도 6 은 상기 도 2의 브랜치 테이블 모듈(Branch Table Module)의 일실시예 상세 구성도.6 is a detailed block diagram of an embodiment of a branch table module of FIG. 2.

도 7 은 상기 도 2의 트리 테이블 모듈(Tree Table Module)의 일실시예 상세 구성도.7 is a detailed block diagram of an embodiment of the tree table module of FIG. 2;

도 8 은 상기 도 7의 트리 테이블 모듈에서의 트리 노드 추가 과정을 나타낸 일실시예 순서도.FIG. 8 is a flowchart illustrating a process of adding a tree node in the tree table module of FIG. 7.

도 9 는 상기 도 7의 트리 테이블 모듈에서의 트리 노드 검색 과정을 나타낸 일실시예 순서도.9 is a flowchart illustrating a tree node search process in the tree table module of FIG. 7.

도 10a 및 도 10b 는 상기 도 7의 트리 테이블 모듈에서의 트리 노드 삭제 과정을 나타낸 일실시예 순서도.10A and 10B are flowcharts illustrating an example of deleting a tree node in the tree table module of FIG. 7.

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

201 : 마스터 모듈 202 : 브랜치 테이블 모듈201: master module 202: branch table module

203 : 트리 테이블 모듈203: Tree Table Module

본 발명은 전송 제어 프로토콜(Transmission Control Protocol : 이하, "TCP"라 함)과 사용자 데이터그램 프로토콜(User Datagram Protocol : 이하, "UDP"라 함) 처리시에 수신된 패킷의 소켓 아이디를 검색하기 위한 소켓 검색 장치에 관한 것으로, 더욱 상세하게는 TCP의 가속을 위하여 하드웨어를 사용하는 TCP 오프로드 엔진(TCP Offload Engine)에서의 패킷 처리를 위한 TCP와 UDP의 소켓 검색 장치에 관한 것이다.The present invention provides a method for retrieving a socket ID of a packet received during transmission control protocol (hereinafter referred to as "TCP") and user datagram protocol (hereinafter referred to as "UDP") processing. The present invention relates to a socket retrieval device, and more particularly, to a socket retrieval device for TCP and UDP for packet processing in a TCP offload engine using hardware for accelerating TCP.

TCP는 연결중심의 프로토콜로서, 호스트 장치의 한 포트(Port)와 상대 장치의 한 포트(Port)가 연결되어 통신을 하며 이를 하나의 소켓으로 구분한다. 즉, 소스 아이피(Source IP), 목적지 아이피(Destination IP), 소스 포트(Source Port), 목적지 포트(Destination Port)가 합쳐져서 하나의 소켓을 구성하게 된다. 이러한 한 개의 소켓이 구성되면 이 연결에서의 통신은 다른 소켓과는 구분되는 특성을 가진다. 여기서, 특성이란 윈도우 크기, 최대 세그먼트 크기 등 여러 가지가 있으며 이러한 값들을 저장하고 있는 블록은 TCB(TCP Control Block), CCB(Connection Control Block) 등 여러 가지로 불린다. 여기에서는 소켓자원블록(Socket Resource Block) 이라고 하겠다.TCP is a connection-oriented protocol. One port of a host device and one port of a counterpart device are connected to each other, and communication is divided into one socket. That is, the source IP, the destination IP, the source port, and the destination port are combined to form one socket. When one such socket is configured, the communication on this connection is distinguished from other sockets. Here, there are various characteristics such as window size and maximum segment size, and the block storing these values is called as TCB (TCP Control Block) or CCB (Connection Control Block). This is called a Socket Resource Block.

패킷이 수신되면 수신된 패킷의 헤더 정보 중 아이피(IP) 및 포트(Port) 정보를 보고 해당하는 소켓을 찾아야 한다. 그리고, 이 소켓 아이디(ID)에 해당하는 소켓자원블록을 읽어서 그에 해당하는 적합한 처리를 필요로 한다. 하지만, 이 소켓이 많아짐에 따라서 소켓 아이디(ID)를 찾아내는 것도 상당한 시간을 필요로 한다.When a packet is received, the corresponding socket should be found by looking at IP and port information of the header information of the received packet. In addition, the socket resource block corresponding to the socket ID may be read and appropriate processing corresponding thereto may be required. However, as the number of sockets increases, finding the socket ID also takes considerable time.

지금까지는 대부분의 프로토콜 처리가 중앙처리장치(CPU)에서 이루어지고 있다. 즉, 프로토콜의 처리는 중앙처리장치(CPU)에서 소프트웨어를 사용하여 처리하고 있으며, 주로 해시(Hash) 함수를 이용하여 소켓의 검색을 실시한다.Until now, most protocol processing has been done in the central processing unit (CPU). In other words, the protocol is processed by the central processing unit (CPU) using software, and the socket is searched mainly by using a hash function.

중앙처리장치(CPU)의 부하를 줄이기 위해 개발된 대부분의 TCP 오프로드 엔진(TCP Offload Engine)들 역시 프로세서를 포함하고 있는 경우가 대부분이고, 이 프로세서가 해시(Hash) 함수를 이용하여 소켓의 검색을 실시한다. 하지만, 연결된 소켓이 많을 경우, 이 해시(Hash) 함수의 결과값이 같은 소켓의 개수가 많아지게 되고, 그 결과 상당히 많은 메모리 접근과 비교를 수행하게 될 때도 있다. 프로세서에서 이루어지는 이러한 연산들은 많은 시간을 필요로 하게 되고 결과적으로 성능을 저하시키는 문제점이 있었다.Most TCP Offload Engines developed to reduce the CPU's load also include processors, which use a hash function to retrieve sockets. Is carried out. However, if there are many connected sockets, the number of sockets with the same result of this hash function will increase, resulting in a significant number of memory accesses and comparisons. These operations on the processor take a lot of time and consequently have a problem of degrading performance.

종래의 기술로서, "앨러크리테크(Alacritech)"사에서 개발한 TCP 오프로드 엔진(TOE)의 경우 저속 경로(Slow-Path)와 고속 경로(Fast-Path)를 구분하여 고속 경로(Fast-Path)의 경우에 빠른 검색을 할 수 있도록 해시(Hash) 함수와 내부 메모리 캐쉬(Cache)를 이용하는 방식을 사용하고 있으나, 이 역시 해시(Hash) 함수의 결과가 같은 소켓의 수를 4개까지만 허용하고 있으므로 모든 소켓에 대한 검색을 지원하지 못하는 문제점이 있었다.As a conventional technology, in the case of the TCP offload engine (TOE) developed by "Alacritech", a fast-path is distinguished by distinguishing a slow-path and a fast-path. ) Uses a hash function and an internal memory cache for fast searching, but this also allows only 4 sockets with the same result. Therefore, there was a problem that does not support the search for all sockets.

본 발명은 상기 문제점을 해결하기 위하여 제안된 것으로, 소켓의 개수를 1만개까지 허용하는 하드웨어에서 소켓 검색 시간을 줄이기 위하여 이진 검색(Binary Search) 알고리듬을 사용하고, 상기 이진 검색 알고리듬을 하드웨어로 구현하여 소켓 검색을 빠르게 할 수 있도록 도와주고, TCP 및 UDP 프로토콜의 경우 이진 트리(Binary Tree)의 관리를 위해 필요한 소켓의 생성, 제거, 검색 기능 및 리슨(Listen)/컨넥트(Connect) 등의 함수에 따른 기능을 모두 지원하여 소켓 아이디(ID)를 찾아내는 시간을 줄여 빠른 프로토콜 처리를 수행하기 위한 TCP와 UDP의 소켓 검색을 위한 소켓 검색 장치를 제공하는데 그 목적이 있다.The present invention has been proposed in order to solve the above problems, by using a binary search (Binary Search) algorithm to reduce the socket search time in hardware that allows the number of sockets up to 10,000, by implementing the binary search algorithm in hardware It helps to speed up socket search, and for TCP and UDP protocols, it is necessary to create, remove, and search sockets and connect / connect functions for sockets needed for binary tree management. Its purpose is to provide a socket retrieval device for socket retrieval of TCP and UDP for fast protocol processing by reducing the time to find the socket ID by supporting all functions.

본 발명의 다른 목적 및 장점들은 하기의 설명에 의해서 이해될 수 있으며, 본 발명의 실시예에 의해 보다 분명하게 알게 될 것이다. 또한, 본 발명의 목적 및 장점들은 특허 청구 범위에 나타낸 수단 및 그 조합에 의해 실현될 수 있음을 쉽게 알 수 있을 것이다.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.

상기 목적을 달성하기 위한 본 발명의 장치는, 전송 제어 프로토콜(TCP)과 사용자 데이터그램 프로토콜(UDP)의 소켓 검색 장치에 있어서, 프로세서로부터 받은 명령 정보를 해석하여 하기 브랜치 테이블 관리 수단과 트리 테이블 관리 수단으로 명령을 전달하고, 하기 브랜치 테이블 관리 수단과 트리 테이블 관리 수단으로부터 결과를 받아 상기 프로세서로 결과를 보고하기 위한 마스터 관리 수단; 상기 마스터 관리 수단으로부터 명령을 받아 브랜치 테이블을 관리하기 위한 브랜치 테이블 관리 수단; 및 이진 트리를 관리하기 위한 트리 테이블 관리 수단을 포함하는 것을 특징으로 한다.The apparatus of the present invention for achieving the above object is a socket retrieval apparatus of Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), the following branch table management means and tree table management by analyzing the command information received from the processor Master management means for delivering instructions to the means and for receiving the results from the branch table management means and the tree table management means and reporting the results to the processor; Branch table management means for receiving a command from the master management means and managing a branch table; And tree table management means for managing the binary tree.

상술한 목적, 특징 및 장점은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 보다 분명해 질 것이며, 그에 따라 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명의 기술적 사상을 용이하게 실시할 수 있을 것이다. 또한, 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에 그 상세한 설명을 생략하기로 한다. 이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명하기로 한다.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 은 본 발명에 따른 TCP와 UDP의 소켓 검색 장치에 대한 일실시예 설명도로서, 검색 알고리듬에 따른 메모리 관리 방식인 이진 트리(Binary Tree) 방식을 나타낸다.1 is a diagram illustrating an embodiment of a socket search apparatus for TCP and UDP according to the present invention, and illustrates a binary tree method, which is a memory management method according to a search algorithm.

본 발명은 검색 알고리듬으로 이진 트리(Binary Tree) 방식을 채택하였다.The present invention employs a binary tree scheme as a search algorithm.

TCP 패킷이 수신되면, 상기 패킷에는 저장되어 있는 정보로 소스 포트(Source Port), 목적지 포트(Destination Port), 소스 아이피(Source IP), 목적지 아이피(Destination IP)를 포함하고 있다.When the TCP packet is received, the packet includes a source port, a destination port, a source IP, and a destination IP as information stored therein.

본래 소켓 아이디(ID)는 이 네 개의 정보를 사용해서 구성하여야 하지만, 이 중에서 목적지 아이피(Destination IP)(반대로, 수신 TCP 오프로드 엔진(TOE)의 입장에서 보면 소스 아이피(Source IP))는 특이한 경우를 제외하고는 자신의 아이피(IP)이므로 나머지 3개를 가지고 소켓의 아이디(ID)를 찾아내는 방식을 사용한다.The original socket ID should be configured using these four pieces of information, but the destination IP (in contrast, the source IP from the perspective of the receiving TCP offload engine (TOE)) is unusual. Except in the case of your own IP (IP), take the remaining three to find the ID (ID) of the socket.

TCP의 경우, 서버로서 동작하게 되면 완전한 연결이 이루어지기 전까지 대기 큐(Waiting Queue)에서 대기하는 경우도 있고, 이 경우엔 목적지 포트(Destination Port)(반대로, 수신 TCP 오프로드 엔진(TOE)의 입장에서 보면 소스 포트(Source Port)) 만이 유일한 정보이며 이는 연결이 완료된 소켓과 중복이 일어날 수도 있다.In the case of TCP, when operating as a server, it may wait in a waiting queue until a complete connection is established. In this case, the destination port (in contrast, the entry of the receiving TCP offload engine (TOE)). In the case of Source port, the only information is the information, which may overlap with the completed socket.

따라서, 연결이 완료된 소켓과의 구분이 필요하다.Therefore, it is necessary to distinguish the socket from which the connection is completed.

디자인하고 있는 TCP 오프로드 엔진(TOE)은 효율성을 위하여 총 1,026개의 트리(Tree)를 관리하고 있다. 이 중 1개는 UDP, 1개는 TCP 대기 큐(Queue), 나머지 1,024개는 TCP의 경우로 연결이 완료된 소켓의 트리이다.The TCP Offload Engine (TOE) being designed manages a total of 1,026 Trees for efficiency. One of them is UDP, one is TCP waiting queue, and the other 1,024 is TCP.

도 1에 도시된 바와 같이, 브랜치 테이블(Branch Table)(110)은 각 트리의 루트(Root)에 위치한 소켓 아이디(ID)(111~11n)를 나타낸다.As shown in FIG. 1, a branch table 110 represents a socket ID 111-11n located at a root of each tree.

상기 브랜치 테이블(Branch Table)(110)은 일종의 해시(Hash) 테이블의 기능을 한다.The branch table 110 functions as a kind of hash table.

UDP 및 TCP 대기 큐(Waiting Queue)의 경우는 각각 1개씩이므로 나누는 기준이 필요치 않으나, 연결된 TCP의 경우는 1,024개의 트리를 나누는 기준, 해시(Hash) 함수가 필요하다. 이러한 해시(Hash) 함수는 여러 가지가 있으며 비교적 균등하게 분포될 수 있도록 결정되어야 성능이 향상된다.In the case of UDP and TCP Waiting Queues, there is no need for dividing criteria because there is one each. However, in case of connected TCP, a basis for dividing 1,024 trees and a hash function are required. There are many such hash functions, and they must be determined to be distributed relatively evenly to improve performance.

본 발명에서는 단순히 아이피(IP)의 하위 10 비트(bit)를 사용하고 있다.In the present invention, only the lower 10 bits of the IP are used.

10 비트(bit)의 인덱스(Index)를 이용하여, 브랜치 테이블(Branch Table)(110)을 만드는 이유는 다음과 같다.The reason for creating the branch table 110 using an index of 10 bits is as follows.

해시(Hash) 함수를 사용하는 것과 마찬가지로 인덱스(Index)를 이용하여 먼저 분류를 함으로써 하나의 루트(Root)를 이용하는 것보다 이진(Binary) 검색 시간을 절약할 수 있다는 장점이 첫 번째이다. 또한, 이를 이용하여 정보를 저장하는데 필요한 공간을 절약할 수 있다.As with the hash function, the first advantage is that classification can be done using indexes, which saves binary search time rather than using a single root. In addition, it can be used to save space required for storing information.

1만개의 연결(C10K)을 가정하고 있는 TCP 오프로드 엔진(TOE) 이므로 현재 소켓의 저장공간을 10,240개로 하고 있다.Since TCP Offload Engine (TOE) assumes 10,000 connections (C10K), the current socket storage is 10,240.

검색을 위하여 필요한 정보로는 소스 포트(Source Port), 목적지 포트(Destination Port), 목적지 아이피(Destination IP)(여기서는, TCP 오프로드 엔진(TOE)의 입장)의 3개이므로, 총 64비트(bit)가 필요하다.There are three pieces of information needed for the search: the source port, the destination port, and the destination IP (in this case, the entry of the TCP offload engine (TOE)). ) Is required.

이후 설명은 혼동을 없애기 위해 호스트 포트(Host Port)는 자신의 포트번호, 리모트 포트(Remote Port)는 상대방의 포트번호, 리모트 아이피(Remot IP)는 상대방의 아이피(IP) 번호를 사용하도록 하겠다.In the following description, in order to avoid confusion, a host port uses its own port number, a remote port uses its own port number, and a remote IP uses its partner's IP number.

10,240개의 소켓 아이디(ID)를 표시하려면 14비트(bit)가 필요하고, 이진 트리(Binary Tree) 관리를 위해서는 하이 포인터(High Pointer), 로우 포인터(Low Pointer)의 두 개가 필요하므로 28비트(bit)가 필요하다. 따라서, 한 소켓당 총 92 비트(bit)가 필요하게 된다.14 bits are required to display 10,240 socket IDs, and 28 bits are required for binary tree management, which requires two of a high pointer and a low pointer. ) Is required. Thus, a total of 92 bits per socket is required.

10,240개의 소켓공간이 필요하므로 트리(Tree) 관리를 위한 저장공간은 전체적으로 92 * 10,240 비트(bit)가 필요하게 된다.Since 10,240 socket spaces are required, the total storage space for tree management requires 92 * 10,240 bits.

64비트(bit)의 정보 중 일부분을 잘라내고, 이를 브랜치 테이블(Branch Table)(110)의 인덱스(Index)로 사용한다면 트리(Tree) 관리를 위한 저장공간은 그만큼 줄어들게 된다. 물론, 반대로 브랜치 테이블(Branch Table)(110)을 위한 공간이 늘어나게 된다.If a part of 64-bit information is cut out and used as an index of the branch table 110, the storage space for tree management is reduced by that amount. Of course, on the contrary, the space for the branch table 110 is increased.

잘라내는 비트의 수를 "n"이라고 하면 트리(Tree) 관리를 위한 저장공간은 총 10,240*n 비트(bit) 만큼을 절약할 수 있고, 늘어나는 브랜치 테이블(Branch Table)(110)의 공간은 2n * 14 비트(bit) 가 된다. 따라서, 절약할 수 있는 저장공간은 하기 [수학식 1]과 같이 된다.If the number of bits to be truncated is "n", the storage space for tree management can be saved as much as 10,240 * n bits, and the space of the branch table 110 to increase is 2 n * 14 bits. Therefore, the storage space that can be saved is as shown in Equation 1 below.

y=10,240n - 14·2n y = 10,240n-14 2n

상기 함수는 n = 10 일 경우 최대값을 가지므로 10비트(bit)를 사용하여 브 랜치 테이블(Branch Table)(110)을 구성하였다.Since the function has a maximum value when n = 10, a branch table 110 is configured using 10 bits.

도 2 는 본 발명에 따른 TCP와 UDP의 소켓 검색 장치의 일실시예 구성도이다.2 is a block diagram of an embodiment of a socket search apparatus for TCP and UDP according to the present invention.

도 2에 도시된 바와 같이, 본 발명에 따른 TCP와 UDP의 소켓 검색 장치는 프로세서와 연결되고, 상기 프로세서와 명령 레지스터로부터 받은 명령 정보를 해석하여 다른 모듈들로 명령을 전달하며, 상기 다른 모듈들로부터 결과를 받아 상기 프로세서로 결과를 보고하기 위한 마스터 모듈(Master Module)(201), 브랜치 테이블을 관리하기 위한 브랜치 테이블 모듈(Branch Table Module)(202), 그리고 이진 트리를 관리하기 위한 트리 테이블 모듈(Tree Table Module)(203)을 포함한다.As shown in FIG. 2, the TCP and UDP socket retrieval apparatus according to the present invention is connected to a processor, interprets the command information received from the processor and the command register, and transfers the command to other modules. A master module 201 for receiving results from the processor and reporting the results to the processor, a branch table module 202 for managing branch tables, and a tree table module for managing binary trees (Tree Table Module) 203.

마스터 모듈(Master Module)(201)은 프로세서 인터페이스를 가진다.Master module 201 has a processor interface.

두 개의 프로세서(송/수신) 버스와 연결되며 명령을 받고 결과를 알려주는 명령 및 결과 레지스터를 가지고 있다.It is connected to two processor (send / receive) buses and has command and result registers that receive instructions and inform the results.

프로세서로부터 받은 명령을 해석하여 다른 모듈들로 명령을 전달하며, 명령 레지스터로 받은 정보 또한 전달해 준다. 그리고, 다른 모듈들로부터 결과를 받아 프로세서로 그 결과를 보고하는 역할도 가지고 있다.It interprets the instructions received from the processor and passes the instructions to other modules. It also passes the information received in the instruction register. It also takes the results from other modules and reports the results to the processor.

브랜치 테이블 모듈(Branch Table Module)(202)은 서술한 브랜치 테이블(Branch Table)을 관리하는 모듈이며, 트리 테이블 모듈(Tree Table Module)(203)은 이진트리를 관리하는 모듈이다.The branch table module 202 is a module for managing the described branch tables, and the tree table module 203 is a module for managing binary trees.

본 발명은 TCP 프로토콜 가속을 위한 TCP 오프로드 엔진(TOE)의 디자인에서 소켓의 검색을 빠르게 처리하기 위한 구현방법을 제안하고 있다.The present invention proposes an implementation method for quickly processing a socket search in the design of the TCP offload engine (TOE) for TCP protocol acceleration.

본 발명에 따른 소켓 검색 장치는 송/수신 프로세서 2개를 사용하여 프로토콜을 처리하는 TCP 오프로드 엔진(TOE)에 사용되도록 설계되었다.The socket retrieval apparatus according to the present invention is designed for use in a TCP offload engine (TOE) that processes protocols using two transmit / receive processors.

소켓의 검색은 수신 프로세서에서 필요로 하지만 이 검색을 가능하게 해주도록 검색 하드웨어에 데이터를 입력해 주는 기능은 송신 프로세서에서 담당하고 있다. 또한, 송신 프로세서가 호스트 프로세서와 통신함에 있어서 소켓 아이디(ID)를 이용하여 소켓자원블록을 손쉽게 찾을 수 있도록 소켓 생성에도 관여하도록 설계되었다.The retrieval of sockets is required by the receiving processor, but the sending processor is responsible for entering data into the retrieval hardware to enable this retrieval. In addition, it is designed to be involved in socket creation so that the transmitting processor can easily find the socket resource block using the socket ID in communication with the host processor.

일반적으로 TCP 오프로드 엔진(TOE)은 TCP 프로토콜의 처리를 주로 한다. 하지만, UDP 프로토콜 역시 포트번호를 이용한 소켓을 가지고 있으며, 이 소켓을 검색하는 기능 역시 포함하여 TCP 오프로드 엔진(TOE)이 UDP 프로토콜까지 같이 처리할수 있도록 하였다. 또한, TCP 리슨(Listen) 상태에 있는 서버 소켓까지 검색할 수 있도록 하여 TCP 오프로드 엔진(TOE)에서 거의 모든 TCP 연결을 제어할 수 있는 환경을 제공하고자 한다.In general, the TCP offload engine (TOE) mainly deals with the TCP protocol. However, the UDP protocol also has a socket using a port number, and the socket offloading function is also included so that the TCP offload engine (TOE) can handle the UDP protocol as well. In addition, it is possible to search server sockets in the TCP Listen state so that the TCP Offload Engine (TOE) can control almost all TCP connections.

도 3 은 상기 도 2의 마스터 모듈(Master Module)의 일실시예 상세 구성도이다.3 is a detailed block diagram of an embodiment of the master module of FIG. 2.

도 3에 도시된 바와 같이, 상기 마스터 모듈(Master Module)은 상기 프로세서와 인터페이스하여 명령 정보를 저장하기 위한 명령 및 결과 레지스터(Command & Result Register)(301), 상기 명령 및 결과 레지스터(301)로부터 받은 명령 정보를 분석하여 해당 명령을 요청하기 위한 스케쥴 상태 머신(Schedule FSM)(302), 상기 명령 정보를 분석하여 수신 프로세서의 명령 레지스터 정보와 송신 프로세서의 명 령 레지스터 정보 중 하나를 선택하고, 브랜치 모듈(202)에서 사용할 주소를 선택하기 위한 인포 홀더(Info Holder)(303), 그리고 상기 스케쥴 상태 머신(302)으로부터 자리 할당 요청을 받아 주소값을 할당하기 위한 할당 테이블(Allocation Table)(304)을 포함한다.As shown in FIG. 3, the master module interfaces with the processor to store a command information from a command and result register 301 and the command and result register 301. A schedule state machine (Schedule FSM) 302 for analyzing the received command information and requesting the corresponding command, and analyzing the command information to select one of command register information of a receiving processor and command register information of a sending processor, and An Info Holder 303 for selecting an address to use in the module 202, and an Allocation Table 304 for receiving a seat allocation request from the Schedule State Machine 302 and assigning an address value. It includes.

명령 및 결과 레지스터(301)는 송신, 수신 프로세서와 인터페이스하는 레지스터 세트이다.The command and result register 301 is a set of registers that interface with the transmitting and receiving processors.

도 4 는 상기 도 3의 명령 및 결과 레지스터의 일실시예 설명도로서, 송신 프로세서에서 사용하는 레지스터 세트를 나타낸다.4 is a diagram illustrating an example of the instruction and result register of FIG. 3, and illustrates a register set used in a transmission processor.

도 5 는 상기 도 3의 명령 및 결과 레지스터의 다른 실시예 설명도로서, 수신 프로세서에서 사용하는 레지스터 세트를 나타낸다.FIG. 5 is an explanatory diagram of another embodiment of the instruction and result register of FIG. 3 and illustrates a register set used by a receiving processor.

이하, 도 3 내지 도 5를 이용하여 상기 마스터 모듈(Master Module)(201)에 대하여 좀 더 상세히 설명한다.Hereinafter, the master module 201 will be described in more detail with reference to FIGS. 3 to 5.

각 명령 레지스터(410, 510) 세트의 "오프셋(Offset) 0"의 하위 8비트(bit)가 명령 코드로 사용된다.The lower 8 bits of "Offset 0" of each set of command registers 410, 510 are used as the command code.

TCP/UDP 프로토콜은 생성되어 동작하고, 소멸 되기까지 다음과 같이 몇 가지의 과정을 거친다.The TCP / UDP protocol goes through several steps before it is created, operated, and destroyed.

먼저, UDP의 경우, 생성(Create), 바인드(Bind), 패킷송수신, 제거(Delete)의 순서대로 동작한다.First, in the case of UDP, it operates in the order of Create, Bind, Packet Transmit, and Delete.

생성(Create)은 소켓을 생성하는 과정이다.Create is the process of creating a socket.

바인드(Bind)는 소켓에 포트(Port)를 할당하며, 패킷을 전송 및 수신하는 상태를 지나서, 제거(Delete)에 의하여 소켓이 제거된다.Bind allocates a port to a socket, and passes a packet through a state in which a socket is removed by deleting.

TCP의 경우는 서버로 동작하느냐 클라이언트로 동작하느냐에 따라 달라진다.TCP depends on whether you are acting as a server or a client.

생성(Create)과 바인드(Bind)까지는 동일하나, 서버로 동작하는 경우에는 리슨(Listen), 액셉트(Accept)의 과정을 거치고, 클라이언트로 동작하는 경우는 컨넥트(Connect)의 동작을 한다.Create and Bind are the same, but if it is a server, it performs a process of Listen and Accept, and if it is a client, it connects.

그 후, 두 경우 다 패킷을 송/수신하다가 제거(Delete)에 의하여 소켓이 제거된다.Then, in both cases, the socket is removed by sending and receiving packets and deleting them.

생성(Create)은 사용자가 시스템에 자신이 사용할 소켓의 핸들(Handle)을 요청하는 명령이다.Create is a command for the user to ask the system for the handle of the socket to use.

일반적으로 이것은 시스템 내부에서 사용되는 소켓의 아이디(ID)와 동일하지 않다. 하지만, 본 발명에 따른 소켓 검색 장치는 생성(Create) 명령을 받아서 "0~10,239" 사이의 값 중 비어있는 값 하나를 알려주어서 이것을 사용자에게 소켓의 핸들(Handle)로 리턴 하도록 한다. 이렇게 함으로써 사용자가 명령을 내릴 때 사용하는 소켓의 핸들(Handle)이 그대로 소켓 아이디(Socket ID)가 되고 이를 이용해 별도의 변환 없이 그대로 소켓자원블록을 가져오는 인덱스로 사용할 수 있다.Typically this is not the same ID as the socket used inside the system. However, the socket retrieval apparatus according to the present invention receives a Create command and informs one of the empty values among the values between 0 and 10,239 to return this to the handle of the socket to the user. By doing so, the handle of the socket used when a user issues a command becomes the socket ID, and it can be used as an index to get the socket resource block without any conversion.

이 경우에 트리(Tree)구조의 변경은 일어나지 않는다(예를 들면, 도 4의 명령코드 0x20).In this case, the tree structure does not change (for example, command code 0x20 of FIG. 4).

상기 생성(Create) 명령의 처리를 가능하게 해주는 부분이 상기 도 3의 할당 테이블(Allocation Table)(304)이다.An allocation table 304 of FIG. 3 allows the processing of the create command.

명령 및 결과 레지스터(301)로 생성(Create) 명령이 들어오면 이를 스케쥴 상태 머신(302)이 분석하여 할당 테이블(Allocation Table)(304)에 자리를 할당할 것을 요청한다.When a Create command comes into the command and result register 301, the schedule state machine 302 analyzes and requests that a seat be allocated to the Allocation Table 304.

상기 할당 요청을 받으면 할당 테이블(Allocation Table)(304)은 "0 ~ 10,239" 사이의 값 중 사용되지 않고 있는 가장 작은 값을 출력하거나, 더 이상 빈 공간이 없음을 출력한다.When the allocation request is received, the allocation table 304 outputs the smallest unused value among the values between 0 and 10,239, or outputs that there is no more empty space.

값이 출력된 경우, 이 값은 명령 및 결과 레지스터(301)에 기록되어 송신 프로세서가 그 값을 소켓 아이디(Socket ID)로 사용하게 된다.If a value is output, this value is written to the command and result register 301 so that the sending processor uses that value as the Socket ID.

상기 할당 테이블(Allocation Table)(304)은 운영시스템(OS)의 파일 할당 테이블(File Allocation Table)과 비슷한 기능을 하드웨어로 구현한 것으로 한번에 하나만의 공간할당이 가능하지만 빠른 속도로 이를 처리할 수 있는 하드웨어이다.The allocation table 304 is a hardware implementation of a function similar to the file allocation table of the operating system (OS), and only one space allocation is possible at a time, but it can be processed at a high speed. It's hardware.

UDP의 바인드(Bind) 함수가 호출되면, UDP는 정상 동작 상태로 들어서게 된다. 따라서, 패킷 수신시에 검색이 가능하도록 호스트 포트(Host Port) 번호를 이용하여 트리(Tree) 구조에 소켓 정보를 추가해야 한다. 이때, 사용하는 트리(Tree)는 UDP를 위한 1개의 트리(Tree)이다(예를 들면, 도 4의 명령코드 0x09).When the bind function of UDP is called, UDP enters the normal operating state. Therefore, socket information should be added to a tree structure by using a host port number so that a packet can be searched when a packet is received. At this time, the tree to be used is one tree for UDP (for example, command code 0x09 of FIG. 4).

TCP의 경우는 바인드(Bind) 함수가 호출되어도 정상동작 상태가 된 것이 아니다.In the case of TCP, even if the bind function is called, it is not in the normal operation state.

먼저, 클라이언트(Client)의 경우에는 컨넥트(Connect) 함수가 호출되어야 상대방의 아이피(IP) 및 포트(Port) 번호를 알 수 있다. 따라서, 컨넥트(Connect) 함수가 호출되면 상대편의 아이피(IP) 및 포트(Port) 번호, 자신의 포트(Port) 번 호를 이용하여 트리(Tree) 구조에 소켓 정보에 추가하여야 한다. 이때, 사용되는 트리(Tree)는 1,024개의 TCP 트리(Tree) 중 상대편 아이피(IP)의 하위 10비트(bit)를 루트 인덱스(Index)로 가지는 트리(Tree)이다(예를 들면, 도 4의 명령코드 0x08).First, in the case of a client, a connect function must be called to know the IP and port number of the other party. Therefore, when the Connect function is called, it must be added to the socket information in the tree structure by using the other's IP, port number, and its own port number. In this case, the tree used is a tree having the lower 10 bits of the opposite IP of the 1,024 TCP trees as the root index (for example, in FIG. 4). Command code 0x08).

두 번째로, 서버(Server)의 경우는 리슨(Listen) 함수가 먼저 호출된다. 상기 리슨(Listen) 함수가 호출되면 해당 소켓은 대기(Wait) 상태로 들어서게 된다. 이때는 상대편의 아이피(IP) 및 포트(Port) 번호를 알 수 없다. 하지만, 수신되는 패킷은 자신의 포트(Port) 번호를 사용해서 검색하여야 한다. 따라서, 자신의 포트(Port) 번호만을 이용하여 트리(Tree) 구조에 소켓 정보를 추가하여야 한다. 이때, 사용하는 트리(Tree)는 TCP 대기(Wait) 상태의 소켓을 위한 1개의 대기 트리(Wait Tree)이다(예를 들면, 도 4의 명령코드 0x0A).Secondly, in the case of Server, the Listen function is called first. When the listen function is called, the socket enters a wait state. In this case, the other party's IP and port number are unknown. However, the received packet should be searched using its port number. Therefore, socket information should be added to the tree structure using only its port number. In this case, the tree to be used is one wait tree for a socket in a TCP wait state (for example, command code 0x0A of FIG. 4).

그 다음으로 상대편으로부터 패킷이 연결요청 패킷이 수신되면 그제서야 상대편의 아이피(IP) 및 포트(Port) 번호를 알 수 있다. 이 수신된 패킷의 정보는 동작의 통일성을 위하여 일단 송신 프로세서로 전달된 후, 송신 프로세서가 트리(Tree) 구조에 소켓 정보를 추가하는 방식을 이용한다. 이때, 송신 프로세서는 새로운 소켓을 하나 더 만들고, 즉 생성(Create)과 같은 동작을 한번 더 실행하고, 상대편의 아이피(IP) 및 포트(Port) 번호, 자신의 포트(Port) 번호를 이용하여 1,024개의 TCP 트리(Tree) 중 하나의 트리(Tree)에 소켓 정보를 추가하게 된다(예를 들면, 도 4의 명령코드 0x08).Next, if the packet is received from the other party, the connection request packet is not known until the IP and port numbers of the other party are known. The information of this received packet is delivered to the transmitting processor once for uniformity of operation, and then the transmitting processor uses a method of adding socket information to the tree structure. At this time, the sending processor creates another new socket, that is, executes an operation such as Create once more, and uses 1,024 IPs, port numbers, and port numbers of the other party. The socket information is added to one tree of the two TCP trees (for example, command code 0x08 of FIG. 4).

상기 대기 트리(Wait Tree) 안의 소켓은 사용자로부터 제거 명령이 들어오 기 전까지는 계속 남아서 새롭게 수신되는 연결 요청 패킷의 처리에 사용된다.The socket in the wait tree remains in use until a remove command is received from the user and is used for processing a newly received connection request packet.

사용자가 소켓의 제거(Delete)를 요청하면 소켓 정보가 저장되어 있는 트리(Tree) 구조에서 해당 노드를 제거하고, 할당 테이블(Allocation Table)(304)에 소켓 아이디(ID)와 함께 제거 요청을 하면 할당되어 있던 공간을 해제하여 다음에 생성(Create) 명령이 수신되면 그 아이디(ID)를 다시 사용할 수 있도록 한다. 이 때, 사용되는 명령 코드는 경우에 따라 다르다.When a user requests to delete a socket, the node is removed from the tree structure where the socket information is stored, and when the user requests the removal with the socket ID in the allocation table 304, Releases the allocated space so that the ID can be used again the next time a Create command is received. In this case, the command code used varies depending on the case.

연결이 완료되어 동작하고 있는 TCP 소켓의 제거는 명령코드 "0x14"를 사용하며, UDP 소켓의 경우는 "0x15", TCP 리슨(Listen) 상태의 소켓은 "0x16"을 사용하여 각각 해당되는 트리(Tree)를 구분하여 제거할 수 있도록 한다.For the removal of the TCP socket that is connected and working, use the command code "0x14". For UDP sockets, use "0x15" and for the TCP Listen state, use "0x16". Tree) can be separated and removed.

일반적인 경우는 아니지만 바인드(Bind) 되지 않은 UDP나 컨넥트(Connect) 명령을 받지 않은 TCP 클라이언트(Client) 소켓의 경우는 "0x10" 코드를 사용하여 할당 테이블(Allocation Table)(304)에서의 제거만을 실행하도록 한다.Although not common, for TCP client sockets that do not receive unbound UDP or Connect commands, only the removal from the Allocation Table 304 is performed using the "0x10" code. Do it.

이상은 송신 프로세서에서 내리는 명령들이었으며, 패킷이 수신되는 경우에는 수신된 패킷이 TCP 연결요청 패킷이면 대기 트리(Wait Tree)에서 소켓을 탐색하고(예를 들면, 도 5의 명령코드 0x02), UDP 패킷이면 UDP 트리(Tree)에서(예를 들면, 도 5의 명령코드 0x01), 기타 일반적인 TCP 패킷이면 TCP 트리에서 탐색을 수행하여야 한다(예를 들면, 도 5의 명령코드 0x04).The above is the instructions given by the transmitting processor. If the packet is received, if the received packet is a TCP connection request packet, the socket is searched in the wait tree (for example, command code 0x02 of FIG. 5), and UDP is used. If the packet is a UDP tree (for example, command code 0x01 of FIG. 5), and if it is another general TCP packet, the search should be performed in the TCP tree (for example, command code 0x04 of FIG. 5).

이는 수신 프로세서에서 내리는 명령으로 본 발명에 따른 소켓 검색 장치는 이 명령에 대하여 소켓 아이디(ID)를 응답해주거나 해당하는 소켓이 없음을 알려주게 된다.This is a command issued by the receiving processor. The socket search apparatus according to the present invention responds to the command with a socket ID, or informs that there is no corresponding socket.

명령 및 결과 레지스터(301)의 결과 레지스터는 송수신 모두 성공(결과코드 0x02), 실패(결과코드 0x03)의 두 개와 처리가 진행중임을 알리는 코드(0x01)를 가진다.The result register of the command and result register 301 has two of both transmission and reception success (result code 0x02), failure (result code 0x03), and code (0x01) indicating that processing is in progress.

송신 프로세서의 결과 코드의 경우에는 생성(Create) 명령에 대해 성공한 결과를 보여줄 때 소켓 아이디(Sock_ID) 필드가 유효한 값을 가지며, 수신 프로세서의 경우는 모든 명령이 검색이므로 성공한 결과를 보여줄 때는 항상 소켓 아이디(Sock_ID)가 유효한 값을 가진다.For the result code of the sending processor, the Socket ID (Sock_ID) field has a valid value when showing a successful result for the Create command, and for the receiving processor, every command is a search, so always a socket ID when showing a successful result. (Sock_ID) has a valid value.

명령 및 결과 레지스터(301)로 명령이 내려오면 이는 스케쥴 상태 머신(302)과 인포 홀더(Info Holder)(303)로 전달된다.When an instruction is issued to the instruction and result register 301, it is passed to the schedule state machine 302 and the info holder 303.

스케쥴 상태 머신(302)은 명령이 소켓 생성 및 제거 명령인 경우 할당 테이블(Allocation Table)(304)로 해당 요청을 하고, 기타 다른 명령의 경우는 트리 테이블 모듈(Tree Table Module)(203)로 해당 요청을 하게 된다. 제거 명령의 경우는 양쪽 모두에 요청을 하기도 한다.The schedule state machine 302 makes a request to the Allocation Table 304 if the command is a socket create and remove command, and to the Tree Table Module 203 for other commands. You will be asked. In the case of a remove command, both requests are made.

인포 홀더(Info Holder)(303)는 명령 정보를 보고 수신 프로세서의 명령 레지스터의 정보와 송신 프로세서의 정보 중 하나를 선택한다. 또한, 브랜치 테이블 모듈(Branch Table Module)(202)에서 사용할 주소를 선택한다. 그리고 아이피(IP)와 포트(Port) 정보를 모두 이용해서 트리를 검색할 것인지, 호스트 포트(Host Port) 만을 이용해서 트리를 검색할 것인지를 결정한다. 이 값들은 명령이 완료될 때까지 계속 유지된다.The info holder 303 selects one of the information of the instruction register of the receiving processor and the information of the transmitting processor based on the instruction information. In addition, an address to be used in the branch table module 202 is selected. It then decides whether to search the tree using both IP and Port information or to search the tree using only the host port. These values will persist until the command completes.

도 6 은 상기 도 2의 브랜치 테이블 모듈(Branch Table Module)의 일실시예 상세 구성도이다.FIG. 6 is a detailed block diagram illustrating an example of a branch table module of FIG. 2.

도 6에 도시된 바와 같이, 브랜치 테이블(Branch Table)(601)은 메모리 블록으로 총 1,026개의 엔트리를 가진다. 각 엔트리의 값은 선택된 트리의 루트(Root)에 위치한 소켓 아이디(ID)값을 가지고 있다.As shown in FIG. 6, the branch table 601 has a total of 1,026 entries in the memory block. The value of each entry has a socket ID located at the root of the selected tree.

"BT_Rdata"(603)는 메모리 블록인 브랜치 테이블(Branch Table)(601)의 출력값이다."BT_Rdata" 603 is an output value of the branch table 601 which is a memory block.

소켓 식별자 비교기(Sock_id Comparator)(602)는 명령 및 결과 레지스터(301)로 들어온 소켓 아이디(ID)의 값과 브랜치 테이블(Branch Table)(601)의 출력값인 "BT_Rdata"(603) 값을 비교하여 둘이 일치하는지 아닌지 또는 "BT_Rdata"(603) 값이 널(NULL) 값인지를 찾아내는 블록이다. 현재 널(NULL) 값은 14비트(bit)의 "3FF" 값을 사용하고 있으며, 이를 위해 브랜치 테이블(Branch Table)(601)의 값은 초기화 때 모든 비트(bit)가 "1"로 채워진다.The socket identifier comparator 602 compares the value of the socket ID to the command and result register 301 with the value of "BT_Rdata" 603, which is the output of the branch table 601. It is a block that finds whether the two match or whether the value "BT_Rdata" 603 is null. Currently, the null value uses a 14 bit "3FF" value, and for this purpose, the value of the branch table 601 is filled with all bits "1" at initialization.

도 7 은 상기 도 2의 트리 테이블 모듈(Tree Table Module)의 일실시예 상세 구성도로서, 본 발명에서 가장 큰 부분을 차지하는 트리 테이블 모듈(Tree Table Module)(203)의 내부 형태를 나타낸다.FIG. 7 is a detailed configuration diagram of an embodiment of the tree table module of FIG. 2, and illustrates an internal form of a tree table module 203 that occupies the largest portion of the present invention.

트리 테이블(Tree Table)(701)은 소켓 정보와 이진 트리(Binary Tree)의 포인터 정보를 가지고 있는 메모리 블록이다.The tree table 701 is a block of memory that contains socket information and pointer information of a binary tree.

읽기상태머신(702)과 쓰기상태머신(703)이 메모리 블록인 트리 테이블(Tree Table)(701) 내의 트리정보를 읽고 갱신하며 트리를 관리한다.The read state machine 702 and the write state machine 703 read and update tree information in the tree table 701 which is a memory block, and manage the tree.

읽기상태머신(702)이 명령을 받아 데이터를 찾은 후 갱신의 필요성이 있으 면 쓰기상태머신(703)으로 명령을 내리면 쓰기상태머신(703)이 트리정보를 갱신한다.If the read state machine 702 receives a command to find data and then needs to update, the read state machine 703 issues a command to the write state machine 703 to update the tree information.

쓰기상태머신(703)은 브랜치 테이블 모듈(Branch Table Module)(202)의 브랜치 테이블(Branch Table)(601)에 기록 요청신호를 보내기도 한다.The write state machine 703 may also send a write request signal to the branch table 601 of the branch table module 202.

Current_data(706)는 트리 테이블(Tree Table)(701)에서 읽은 정보를 잠시 저장해두는 레지스터이다.Current_data 706 is a register that temporarily stores information read from the tree table 701.

Prev_data(708)는 Current_data(706) 값이 변경될 때 Current_data(706) 값을 다시 저장해두며, Mother_Data(707)는 읽기상태 머신(702)의 지시에 따라서 Current_data(706) 값을 저장해두는 레지스터이다. 여기서, Mother_Data(707)의 "Sock_info"는 호스트 포트(Host Port), 리모트 포트(Remote Port), 리모트 아이피(Remote IP)(22비트(bit))를 붙여서 만든 54비트(bit) 데이터로 이를 한 개의 값으로 보고, 이진트리에서 값의 대/소를 비교한다.Prev_data 708 stores the Current_data 706 value again when the Current_data 706 value is changed, and Mother_Data 707 is a register that stores the Current_data 706 value according to the instruction of the read state machine 702. Here, "Sock_info" of Mother_Data (707) is 54-bit data created by attaching a host port, a remote port, and a remote IP (22 bits). As two values, and compares the values in the binary tree.

Mother_Data(707)의 "Low_pt"와 "high_pt"는 트리의 두 차일드 노드(Child Node)의 포인터값을 가리키며, 이 포인터값은 바로 소켓의 아이디(ID)이다."Low_pt" and "high_pt" of Mother_Data 707 indicate pointer values of two child nodes of the tree, which are IDs of sockets.

계산기(Calculator)(705)는 명령 및 결과 레지스터(301)의 명령 레지스터로 들어온 정보와 트리 테이블(Tree Table)(701)에서 읽어온 정보를 이용하여 여러가지 결과를 읽기상태머신(702)으로 알려준다. 그 결과란, "Sock_info"와 일치하는지 또는 더 크거나 작은지를 판단하며, "low_pt" 및 "high_pt" 가 널(NULL) 값인지, 또는 명령 레지스터의 소켓 아이디(ID)와 일치하는지 등을 판단하는 것이다.The calculator 705 informs the read state machine 702 of various results by using information entered into the command register of the command and result register 301 and information read from the tree table 701. The result is to determine whether it matches "Sock_info" or is larger or smaller, and whether "low_pt" and "high_pt" are null or match the socket ID in the command register, etc. will be.

트리 기록 데이터 생성기(Tw_data_Generator)(704)는 트리 테이블(Tree Table)(701)의 갱신이 필요할 때, 기록할 값을 만들어내는 역할을 한다. 이때, 수신프로세서의 명령인 검색의 경우에는 상기 트리 기록 데이터 생성기(704)와 쓰기상태 머신(703)은 관여하지 않는다.The tree record data generator (Tw_data_Generator) 704 generates a value to be recorded when the tree table 701 needs to be updated. In this case, the tree write data generator 704 and the write state machine 703 are not involved in the case of a search which is a command of the receiving processor.

명령에 따라 트리 테이블 모듈(203)에서 해야 할 일은 노드 추가, 노드 삭제, 검색의 세 가지이다.According to the command, the tree table module 203 needs to do three things: add a node, delete a node, and search.

노드의 추가나 삭제는 송신 프로세서가 내리는 명령에 따른 동작이며, 검색은 수신 프로세서가 내리는 명령에 따른 동작이다. 이 세 가지 동작의 절차는 다음과 같이 이루어진다. 이 절차는 이진 트리(Binary Tree)의 관리를 하드웨어로 구현하기 위해 레지스터값에 데이터를 저장하고, 메모리 블록의 읽기/쓰기 주소 및 쓰기 데이터를 결정하는 절차로 트리관리 방식의 특이점은 없다.Adding or deleting a node is an operation according to a command issued by a transmitting processor, and a search is an operation according to a command issued by a receiving processor. The procedures for these three operations are as follows. In order to implement binary tree management in hardware, this procedure stores data in register values and determines the read / write address and write data of the memory block.

도 8 은 상기 도 7의 트리 테이블 모듈에서의 트리 노드 추가 과정을 나타낸 일실시예 순서도이다.FIG. 8 is a flowchart illustrating a process of adding a tree node in the tree table module of FIG. 7.

먼저, 먼저 브랜치 테이블(Branch Table)(B_add)(601)을 읽는다(801). 여기서, "B_add"로 입력되는 주소는 명령의 종류에 따라서 다르다. 즉, 연결된 TCP 소켓의 경우는 상대편 IP(Remote IP)의 하위 10비트(bit)가 되고, 연결을 기다리는 리슨(Listen) 상태에 있는 TCP 소켓의 경우는 대기 브랜치(Wait Branch)를 위한 주소, UDP의 경우는 UDP 브랜치(UDP Branch)를 위한 주소가 된다.First, a branch table (B_add) 601 is first read (801). Here, the address input as "B_add" varies depending on the type of command. That is, in case of connected TCP socket, it becomes the lower 10 bits of remote IP, and in case of TCP socket in listen state waiting for connection, the address for Wait Branch, UDP Is the address for the UDP branch.

다음으로, 읽어낸 값(BT_Rdata)과 지금 추가할 소켓 아이디(ID)와 같은지를 비교한다(802). 정상적인 경우라면 읽어낸 값(BT_Rdata)이 지금 추가할 소켓 아이디(ID)(sock_id)와 같을 수는 없다(803). 만일, 이 값이 널(NULL)이라면, 현재 트 리에 저장된 소켓이 없으므로 브랜치 테이블(Branch Table)(601)의 해당 주소에 지금 추가할 소켓 아이디(ID)를 저장하고(804), 트리 테이블(Tree Table)(701)의 해당 소켓 아이디(ID) 위치에 초기값을 써 넣는다(805). 상기 초기값의 하이 포인터(High Pointer), 로우 포인터(Low Pointer)값은 널(NULL) 값이며, 기타 54비트(bit) "Sock_Info" 정보는 경우에 따라 호스트 포트(Host Port)의 번호만 입력하거나, 호스트 포트(Host Port), 리모트 포트(Remote Port), 리모트 아이피(Remote IP)를 모두 기록한다. 여기서, "T_W_data"(805)에 기록되는 "A/B/C" 포맷은 "Sock_Info/Low Pointer/High Pointer"를 의미한다.Next, a comparison is made between the read value BT_Rdata and the socket ID ID to be added now (802). In the normal case, the read value BT_Rdata may not be the same as the socket ID (sock_id) to be added (803). If this value is null, since there are no sockets currently stored in the tree, the socket ID (ID) to be added now is stored at the corresponding address of the branch table (601) (804), and the tree table (Tree) The initial value is written into the corresponding socket ID position of the table 701 (805). The high pointer and low pointer values of the initial value are null values, and other 54-bit " Sock_Info " information is only inputted with the host port number. Or, record all the Host Port, Remote Port, and Remote IP. Here, the format "A / B / C" recorded in "T_W_data" 805 means "Sock_Info / Low Pointer / High Pointer".

상기 비교 결과(802), "BT_Rdata" 값이 널(NULL)이 아니라면, 그 값을 이용하여 트리를 검색해 나간다. 즉, "T_R_add = BT_Rdata"(806)이다.As a result of the comparison 802, if the "BT_Rdata" value is not null, the tree is searched using the value. That is, "T_R_add = BT_Rdata" 806.

읽어온 트리 노드(Tree node)와 비교하여 "Sock_Info" 값이 더 크고, 하이 포인터(High Pointer)가 널(NULL)인 경우나(807), 값이 더 작고, 로우 포인터(Low Pointer)가 널(NULL)인 경우(808)는 추가할 수 있는 노드(Node)를 찾은 경우이다. 이렇게 되면 명령으로 받은 소켓 아이디(ID)를 포인터(Pointer)값에 저장하고, 해당 소켓 아이디(ID) 위치에 초기값을 써 넣으면 완료된다(809, 810). "Sock_Info" 값이 더 크고, 하이 포인터(High Pointer)가 널(NULL)이 아닌 경우나(811), 값이 더 작고, 로우 포인터(Low Pointer)가 널(NULL)인 경우(812)는 "T_R_add" 에 해당 포인터를 넣어 트리를 구성하는 메모리의 검색을 계속 실시한다.The value of "Sock_Info" is larger than the read tree node, the high pointer is null (807), or the value is smaller, and the low pointer is null. If it is NULL (808) is a case that finds a node that can be added (Node). In this case, the socket ID received by the command is stored in a pointer value, and an initial value is written in the corresponding socket ID location (809, 810). If the "Sock_Info" value is larger and the high pointer is not null (811) or if the value is smaller and the low pointer is null (812), the " T_R_add "is inserted to continue searching the memory constituting the tree.

여기서, "Sock_Info" 값의 비교시 연결된 TCP 소켓의 경우에는 54비트(bit) 값을 모두 비교하고, 그 외의 경우 (UDP 및 TCP 대기열)는 호스트 포트(Host Port) 값만 비교한다.Here, when comparing the "Sock_Info" value, all 54 bit values are compared in the case of the connected TCP socket, and in all other cases (UDP and TCP queue), only the host port value is compared.

순서도에서 엠프티(empty), 풀(full)의 결과는 차일드(Child) 노드의 포인터 값이 널(NULL) 인 경우와 그렇지 않은 경우를 의미한다.In the flowchart, the result of empty and full means when the pointer value of the child node is null or not.

도 9 는 상기 도 7의 트리 테이블 모듈에서의 트리 노드 검색 과정을 나타낸 일실시예 순서도이다.9 is a flowchart illustrating a tree node search process in the tree table module of FIG. 7.

검색시에는 트리구조의 변경은 이루어지지 않는다.The search does not change the tree structure.

먼저, 브랜치 테이블(Branch Table)을 읽는다(901). 마찬가지로 "B_add"로 입력되는 주소는 명령의 종류에 따라서 다르다. 즉, 연결된 TCP 소켓의 경우는 상대편 IP(Remote IP)의 하위 10비트(bit)가 되고, 연결을 기다리는 리슨(Listen) 상태에 있는 TCP 소켓의 경우는 대기 브랜치(Wait Branch)를 위한 주소, UDP의 경우는 UDP 브랜치(UDP Branch)를 위한 주소가 된다.First, a branch table is read (901). Similarly, the address entered as "B_add" depends on the type of command. That is, in case of connected TCP socket, it becomes the lower 10 bits of remote IP, and in case of TCP socket in listen state waiting for connection, the address for Wait Branch, UDP Is the address for the UDP branch.

다음으로, "BT_Rdata" 값이 널(Null) 값인지를 확인한다(902).Next, it is checked whether the "BT_Rdata" value is a null value (902).

"BT_Rdata" 값이 널(NULL) 이라면, 현재 트리에 저장된 소켓이 없으므로 탐색에 실패한 경우가 된다(903). 널(NULL)이 아니라면, 그 값을 이용하여 트리를 검색해 나간다(T_R_add = BT_Rdata)(904).If the value of "BT_Rdata" is null, the search fails because there is no socket currently stored in the tree (903). If not null, the value is searched for the tree (T_R_add = BT_Rdata) (904).

읽어온 트리 노드와 비교하여 "Sock_Info" 값이 일치하는 경우(905)에 현재 읽은 소켓 ID 값(709)을 결과로 리턴해주면 된다(906).When the "Sock_Info" value is matched with the read tree node (905), the current read socket ID value 709 may be returned as a result (906).

일치하는 경우를 찾을 수 없으면 탐색이 실패한 경우(907, 908)가 된다.If no match is found, then the search fails (907, 908).

도 10a 및 도 10b 는 상기 도 7의 트리 테이블 모듈에서의 트리 노드 삭제 과정을 나타낸 일실시예 순서도이다.10A and 10B are flowcharts illustrating an example of deleting a tree node in the tree table module of FIG. 7.

먼저, 브랜치 테이블(Branch Table)을 읽는다(1001). 그리고, "BT_Rdata" 값과 "sock_id" 값을 비교한다(1002).First, a branch table is read (1001). Then, the "BT_Rdata" value and the "sock_id" value are compared (1002).

비교 결과(1002), BT_Rdata 값이 널(NULL) 이라면, 현재 트리에 저장된 소켓이 없으므로 삭제할 노드가 없는, 실패한 경우가 된다(1003). 만일 이 값이 삭제하고자 하는 소켓 아이디(ID)(sock_id)와 일치한다면 루트(Root)를 제거해야 한다는 표시를 해둔다(Set [root_matched])(1004).As a result of the comparison (1002), if the BT_Rdata value is null, there is no node to delete because there is no socket stored in the current tree (1003). If this value matches the socket ID (sock_id) to be deleted, an indication is made that root should be removed (Set [root_matched]) (1004).

다음으로 해야 할 일은 삭제해야 할 노드의 모체(Mother) 노드를 찾는 것이다.The next thing to do is to find the mother node of the node that needs to be deleted.

BT_Rdata의 값을 이용하여 트리를 검색해 나간다(1005). 이때는 추가나 탐색시에 했던 비교와 더불어, 하이 포인터(high pointer) 및 로우 포인터(low pointer) 값을 삭제하고자 하는 소켓 아이디(ID)와 비교한다. 만약, 일치하는 경우는 하이 매치(high match) 및 로우 매치(Low match)의 결과를 나타낸다(1006, 1007).The tree is searched using the value of BT_Rdata (1005). In this case, the high pointer and low pointer values are compared with the socket ID to be deleted along with the comparison made at the time of addition or search. If a match is found, the result of the high match and the low match is shown (1006 and 1007).

읽어온 트리노드와 비교하여 Sock Info 값이 더 크고, 하이 포인터(high pointer)가 소켓 아이디(ID)와 일치하는 경우나, Sock Info 값이 더 작고, 로우 포인터(low pointer)가 소켓 아이디(ID)와 일치하는 경우는 삭제해야 할 노드의 모체(Mother) 노드를 찾은 경우이다. 이때의 소켓 아이디(ID) 값(709)과 그 데이터(706)를 mother_id(710)와 mother_data(707)에 저장해 두고, 모체(Mother) 노드의 로우 차일드(low child)를 삭제하는지 하이 차일드(high child)를 삭제하는지도 체크해 둔다(delete_position <= high or low)(1008, 1009). 여기서, BT_Rdata가 이미 일치하였다면 여기까지의 동작이 완료된 것으로 판단할 수 있다.Compared to the tree node read, the Sock Info value is larger, the high pointer matches the socket ID, or the Sock Info value is smaller, and the low pointer is the socket ID. ) Matches the parent node of the node to be deleted. At this time, the socket ID value 709 and the data 706 are stored in the mother_id 710 and the mother_data 707, and the high child is deleted or the low child of the mother node is deleted. child) is also checked (delete_position <= high or low) (1008, 1009). Here, if BT_Rdata has already matched, it can be determined that the operation up to this point is completed.

다음으로 삭제할 노드의 값을 읽어 온다(1010, 1011, 1012).Next, read the value of the node to delete (1010, 1011, 1012).

삭제할 노드에 차일드(child) 노드가 없거나 하나만 있는 경우(1013)는 차일드(child) 노드의 아이디(ID)(포인터(pointer)값)를 child_id(711)에 저장해 둔다(1015, 1016). 이는 곧바로 모체(Mother) 노드에 연결함으로써 삭제를 완료할 수 있다.When there is no child node or only one child node in the node to be deleted (1013), the ID (pointer value) of the child node is stored in the child_id 711 (1015 and 1016). This can be done by connecting directly to the parent node.

그러나, 삭제할 노드에 차일드(child) 노드가 두 개인 경우, 하이(high) 노드의 서브트리 중 가장 작은 값이나, 로우(low) 노드의 서브트리 중 가장 큰 값을 삭제할 노드의 위치에 가져와야 한다. 즉, 모체(Mother) 노드에 연결해야 한다. 여기서는 하이(high) 노드의 서브트리 중 가장 작은값을 가져오기로 한다. 그렇게 되면 가져온 노드의 차일드 포인터(Child Pointer)에 삭제된 노드의 차일드 포인터(Chind Pointer)를 기록해야 하기 때문에 이 값을 branch_id(712) 라는 값에 저장해 둔다(1014).However, if there are two child nodes in the node to be deleted, the smallest value among the subtrees of the high node or the largest value among the subtrees of the low node should be brought to the position of the node to be deleted. In other words, you need to connect to the mother node. Here, the smallest value among the subtrees of the high node is obtained. In this case, since the child pointer of the deleted node must be recorded in the child pointer of the imported node, the value is stored in the value of branch_id 712 (1014).

하이(high) 노드를 읽어와서(1017) 로우(low) 노드가 존재하는지 검색한다(1018).The high node is read (1017) to detect if a low node exists (1018).

검색 결과(1018), 만일 존재하지 않는다면 이 노드를 모체(Mother) 노드에 연결해야 하므로, child_id(711)에 현재 아이디(ID) 값을 저장한다(1019). 또한, 기존에 branch_id(712)에 저장해 둔 로우 포인터(low pointer) 값을 로우 트리(low tree)로 연결한다.The search result 1018 stores the current ID value in the child_id 711 because the node should be connected to the mother node if it does not exist (1019). In addition, a low pointer value stored in the branch_id 712 is connected to a low tree.

검색 결과(1018), 로우(Low) 노드가 존재하는 경우라면 로우(low) 노드를 읽어와서(1020) 로우(low) 노드가 존재하지 않을 때까지 로우 포인터(low pointer)를 따라 트리(Tree)를 검색해 나간다(1021). 이때는 로우(low) 노드가 존재하지 않는 노드의 모체(mother) 노드(node) 까지 기억해야 하므로, 항상 previous_address(713) 및 data(708)를 저장해 둔다.As a result of the search (1018), if there is a low node, the low node is read (1020) and the tree follows the low pointer until there is no low node. Search for (1021). In this case, since the parent node of the node where the low node does not exist must be stored, the previous_address 713 and the data 708 are always stored.

로우(Low) 노드가 존재하지 않는 노드를 찾으면 이 노드의 아이디(ID)를 child_id(711)에 저장해 둔다(1022). 또한, 기존에 branch_id(712)에 저장해 둔 두 개의 포인터를 서브트리로 연결한다. 그리고, 이 노드에 하이(high) 노드가 존재한다면 이를 끊고, 현재 노드의 모체(mother) 노드에 연결해 주어야 한다. 현재 노드의 모체(Mother) 노드는 Previous_r_add(713)에 기록되어 있다(1023).If a low node is found, the node's ID is stored in child_id 711 (1022). In addition, the two pointers previously stored in branch_id 712 are connected to the subtree. And, if there is a high node in this node, disconnect it and connect it to the mother node of the current node. The mother node of the current node is recorded in Previous_r_add 713 (1023).

마지막으로 해야 할 절차는 삭제된 노드의 모체(Mother) 노드와 새로운 노드를 연결해주는 작업이다. 만일 삭제한 노드가 루트 노드(Root node)였다면(Root matched)(1024), 브랜치 테이블(Branch Table)에 새로운 노드의 아이디(ID)(711) 값을 기록한다(1025). 이때 사용되는 B_add 값은 브랜치 테이블 (Branch Table) 을 읽을 때 (1001) 와 같은 값을 사용한다.The last step is to connect the new node with the mother node of the deleted node. If the deleted node was a root node (Root matched) (1024), the ID (711) value of the new node is recorded in the branch table (1025). The B_add value used at this time uses the same value as (1001) when reading the branch table.

만약, 루트(Root) 노드가 아니라면 Mother_id(710)에 삭제된 차일드(Child) 노드가 하이(high) 이냐 로우(low)이냐([delete position])에(1026) 따라서 적당한 데이터를 기록해주면 완료된다(1027, 1028).If it is not the root node, the child node deleted at the mother_id 710 is high or low ([delete position]) (1026), and thus the appropriate data is completed. (1027, 1028).

이상에서 설명한 본 발명은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 있어 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니다.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.

상기와 같은 본 발명은, 두 개의 내장 프로세서가 송/수신 기능을 하도록 TCP 가속 하드웨어를 제작할 때, TCP 및 UDP 소켓을 총 1만개까지 하드웨어를 통해 빠르게 검색 및 관리할 수 있도록 해주고, 상기 하드웨어는 소켓의 생성시에 소켓 할당기능까지 포함함으로써 사용자가 전달하는 소켓 아이디(ID)를 그대로 사용하여 소켓자원블록에 접근할 수 있도록 해주며, 또한 이진 검색 이전에 해시(Hash)를 통한 구분을 한번 더 함으로써, 검색의 효율을 높이고 메모리를 절약할 수 있도록 해줌과 동시에 일반적인 TCP 오프로드 엔진(TOE)에서 사용하듯 연결이 완료된 TCP 소켓 정보만을 관리하는 것이 아니라, UDP 소켓과, 리슨(Listen) 상태에 있는 TCP소켓까지 모두 검색함으로써 TCP/UDP 풀-오프로딩(Full-Offloading)에 필요한 모든 기능을 지원할 수 있는 효과가 있다.The present invention as described above, when manufacturing the TCP acceleration hardware so that the two built-in processors to transmit and receive functions, it is possible to quickly search and manage up to 10,000 TCP and UDP sockets through the hardware, the hardware is a socket By including the socket allocation function at the time of creation, the user can access the socket resource block using the socket ID (ID) passed by the user as it is, and also by separating the hash by one more time before the binary search. In addition to improving the efficiency of the search and saving memory, it does not only manage the information of the TCP sockets that have been connected, but also the TCP sockets in listen state. Searching all sockets also has the effect of supporting all the functions required for TCP / UDP full-offloading.

Claims (9)

전송 제어 프로토콜(TCP)과 사용자 데이터그램 프로토콜(UDP)의 소켓 검색 장치에 있어서,In the socket retrieval device of Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), 프로세서로부터 받은 명령 정보를 해석하여 하기 브랜치 테이블 관리 수단과 트리 테이블 관리 수단으로 명령을 전달하고, 하기 브랜치 테이블 관리 수단과 트리 테이블 관리 수단으로부터 결과를 받아 상기 프로세서로 결과를 보고하기 위한 마스터 관리 수단;Master management means for interpreting the command information received from the processor and transferring the command to the branch table management means and the tree table management means, and receiving the result from the branch table management means and the tree table management means and reporting the result to the processor; 상기 마스터 관리 수단으로부터 명령을 받아 브랜치 테이블을 관리하기 위한 브랜치 테이블 관리 수단; 및Branch table management means for receiving a command from the master management means and managing a branch table; And 이진 트리를 관리하기 위한 트리 테이블 관리 수단Tree Table Management Means for Managing Binary Trees 을 포함하는 소켓 검색 장치.Socket search device comprising a. 제 1 항에 있어서,The method of claim 1, 상기 마스터 관리 수단은,The master management means, 두 개의 프로세서(송/수신) 버스와 연결되며 명령을 받고 결과를 알려주되, 상기 프로세서와 인터페이스하여 명령 정보를 저장하기 위한 명령 및 결과 레지스터 수단;Instruction and result register means coupled to two processor (send / receive) buses for receiving instructions and informing a result, said interface being for interfacing with said processor to store instruction information; 상기 명령 및 결과 레지스터 수단으로부터 받은 명령 정보를 분석하여 해당 명령을 요청하기 위한 스케쥴 상태 처리 수단;Schedule status processing means for analyzing the command information received from the command and result register means and requesting the corresponding command; 상기 명령 정보를 분석하여 수신 프로세서의 명령 레지스터 정보와 송신 프로세서의 명령 레지스터 정보 중 하나를 선택하고, 상기 브랜치 테이블 관리 수단에서 사용할 주소를 선택하기 위한 인포 홀딩 수단; 및An information holding means for selecting one of command register information of a receiving processor and command register information of a transmitting processor by analyzing the command information, and selecting an address to be used by the branch table managing means; And 상기 스케쥴 상태 처리 수단으로부터 자리 할당 요청을 받아 주소값을 할당하기 위한 할당 테이블 관리 수단Allocation table management means for receiving a seat allocation request from the schedule state processing means and assigning an address value 을 포함하는 소켓 검색 장치.Socket search device comprising a. 제 1 항에 있어서,The method of claim 1, 상기 브랜치 테이블 관리 수단은,The branch table management means, 메모리 블록으로 총 1,026개의 엔트리를 가지고, 상기 각 엔트리의 값은 선택된 트리의 루트(Root)에 위치한 소켓 아이디(ID)값을 저장하기 위한 브랜치 테이블(Branch Table); 및A branch table for storing a socket ID value located at a root of a selected tree having a total of 1,026 entries in a memory block; And 상기 명령 및 결과 레지스터 수단으로 들어온 소켓 아이디(ID)의 값과 상기 브랜치 테이블(Branch Table)의 출력값을 비교하여 둘이 일치하는지 아닌지 또는 상기 브랜치 테이블(Branch Table)의 출력값이 널(NULL) 값인지를 찾아내기 위한 소켓 식별자 비교 수단Compare the value of the socket ID to the command and result register means and the output value of the branch table to see whether they match or whether the output value of the branch table is a null value. Means for comparing socket identifiers to find 을 포함하는 소켓 검색 장치.Socket search device comprising a. 제 1 항에 있어서,The method of claim 1, 상기 트리 테이블 관리 수단은,The tree table management means, 소켓 정보와 이진 트리(Binary Tree)의 포인터 정보를 저장하기 위한 트리 테이블(Tree Table);A tree table for storing socket information and pointer information of a binary tree; 상기 트리 테이블(Tree Table) 내의 트리정보를 읽고 갱신하며 트리를 관리하기 위한 읽기상태머신과 쓰기상태머신;A read state machine and a write state machine for reading and updating tree information in the tree table and managing the tree; 상기 트리 테이블(Tree Table)에서 읽은 정보를 잠시 저장해두기 위한 현재 데이터 저장 수단;Current data storage means for temporarily storing the information read from the Tree Table; 상기 현재 데이터 저장 수단의 값이 변경될 때 현재 데이터를 다시 저장해 두기 위한 과거 데이터 저장 수단;Past data storage means for storing the current data again when the value of the current data storage means is changed; 상기 읽기상태 머신의 지시에 따라서 상기 현재 데이터 저장 수단의 값을 저장해두기 위한 모체 데이터 저장 수단;Parent data storage means for storing a value of the current data storage means according to the instruction of the read state machine; 상기 명령 및 결과 레지스터 수단의 명령 레지스터로 들어온 정보와 상기 트리 테이블에서 읽어온 정보를 이용하여 결과 값을 상기 읽기상태머신으로 알려주고, 상기 명령 레지스터의 정보가 소켓 정보(Sock_info)와 일치하는지 또는 더 크거나 작은지를 판단하며, 로우 포인터 및 하이 포인터가 널(NULL) 값인지, 또는 명령 레지스터의 소켓 아이디(ID)와 일치하는지를 판단하기 위한 계산 수단; 및The result value is informed to the read state machine by using the information entered into the command register of the command and result register means and the information read from the tree table, and the information of the command register matches the socket information (Sock_info) or larger. Calculating means for determining whether the row pointer and the high pointer are null or match the socket IDs of the instruction registers; And 상기 트리 테이블(Tree Table)의 갱신이 필요할 때, 기록할 값을 만들어내기 위한 트리 기록 데이터 생성 수단Tree record data generating means for generating a value to be recorded when updating of the tree table is required 을 포함하는 소켓 검색 장치.Socket search device comprising a. 제 4 항에 있어서,The method of claim 4, wherein 상기 읽기상태머신과 쓰기상태머신은,The read state machine and the write state machine, 상기 읽기상태머신이 명령을 받아 데이터를 찾은 후 갱신의 필요성이 있으면 상기 쓰기상태머신으로 명령을 내리면 상기 쓰기상태머신이 트리정보를 갱신하며, 상기 쓰기상태머신은 상기 브랜치 테이블 모듈(Branch Table Module)의 브랜치 테이블(Branch Table)에 기록 요청신호를 보내기도 하는 것을 특징으로 하는 소켓 검색 장치.If the read state machine receives a command to find data and then needs to update, the write state machine updates tree information when the command is issued to the write state machine, and the write state machine is the branch table module. And a write request signal is also sent to a branch table of the socket search apparatus. 제 4 항에 있어서,The method of claim 4, wherein 상기 모체 데이터 저장 수단은,The parent data storage means, 상기 소켓 정보(Sock_info), 로우 포인터(Low_pt), 하이 포인터(high_pt)를포함하며, 상기 소켓 정보(Sock_info)는 호스트 포트(Host Port), 리모트 포트(Remote Port), 리모트 아이피(Remote IP)(22비트(bit))를 붙여서 만든 54비트(bit) 데이터로 이를 한 개의 값으로 보고, 이진트리에서 값의 대/소를 비교하고, 상기 로우 포인터(Low_pt)와 하이 포인터(high_pt)는 트리의 두 차일드 노드(Child Node)의 포인터값을 가리키며, 이 포인터값이 바로 소켓의 아이디(ID)인 것을 특징으로 하는 소켓 검색 장치.The socket information (Sock_info), a low pointer (Low_pt), a high pointer (high_pt), the socket information (Sock_info) is a host port (Host Port), a remote port (Remote Port), Remote IP (Remote IP) ( 54 bit data created by attaching 22 bits to a single value, compares the values in the binary tree, and compares the values of the values in the binary tree. The low pointer (Low_pt) and the high pointer (high_pt) Pointer value of two child nodes (Child Node), the pointer value is a socket search device, characterized in that the ID (ID) of the socket. 제 1 항 내지 제 6 항 중 어느 한 항에 있어서,The method according to any one of claims 1 to 6, 상기 트리 테이블 관리 수단은,The tree table management means, 명령에 따라 노드 추가, 노드 삭제, 노드 검색의 동작을 수행하며, 노드의 추가나 삭제는 송신 프로세서가 내리는 명령에 따른 동작이며, 검색은 수신 프로세서가 내리는 명령에 따른 동작이고, 상기 세 가지 동작의 절차는 이진 트리(Binary Tree)의 관리를 하드웨어로 구현하기 위해 레지스터값에 데이터를 저장하고, 메모리 블록의 읽기/쓰기 주소 및 쓰기 데이터를 결정하는 절차로 이루어지는 것을 특징으로 하는 소켓 검색 장치.According to the command, the node is added, the node is deleted, and the node is searched. The node is added or deleted according to the command issued by the sending processor. The search is performed according to the command issued by the receiving processor. The socket retrieval apparatus of claim 1, wherein the binary tree is stored in a register value to implement hardware management in a binary tree, and the read / write address and write data of the memory block are determined. 제 7 항에 있어서,The method of claim 7, wherein 상기 마스터 관리 수단은,The master management means, 연결된 TCP 소켓 뿐만 아니라 UDP 및 리슨(Listen) 상태에 있는 TCP 소켓까지 모두 관리하며, 상기 명령 및 결과 레지스터로 생성(Create) 명령이 들어오면 이를 상기 스케쥴 상태 처리 수단이 분석하여 상기 할당 테이블 관리 수단으로 자리를 할당할 것을 요청하고, 상기 할당 요청을 받으면 상기 할당 테이블 관리 수단에서 값을 출력하고, 출력된 값이 상기 명령 및 결과 레지스터에 기록되어 송신 프 로세서가 상기 출력된 값을 소켓 아이디(Socket ID)로 사용하는 것을 특징으로 하는 소켓 검색 장치.It manages not only TCP sockets connected but also TCP sockets in UDP and Listen states. When a command is created in the command and the result register, the schedule state processing means analyzes the schedule socket to the allocation table management means. Request to allocate a seat, and when the allocation request is received, outputs a value from the allocation table management means, and the output value is recorded in the command and result register so that the transmission processor stores the output value as a Socket ID. Socket search apparatus, characterized in that the use. 제 7 항에 있어서,The method of claim 7, wherein 상기 브랜치 테이블(Branch Table)은,The branch table, 트리를 한 개만 쓰는 것이 아니라 해시(Hash)를 통해 여러 개의 트리를 관리함으로써 검색 속도 및 효율을 높이고 메모리 자원을 절약하는 것을 특징으로 하는 소켓 검색 장치.A socket search device that improves search speed and efficiency and saves memory resources by managing multiple trees through hash rather than using only one tree.
KR1020060069952A 2005-12-01 2006-07-25 Apparatus for TCP and UDP Socket Search KR100725921B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US11/605,801 US7751346B2 (en) 2005-12-01 2006-11-29 Apparatus for searching TCP and UDP sockets

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020050116121 2005-12-01
KR20050116121 2005-12-01

Publications (2)

Publication Number Publication Date
KR20070057640A KR20070057640A (en) 2007-06-07
KR100725921B1 true KR100725921B1 (en) 2007-06-11

Family

ID=38354950

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060069952A KR100725921B1 (en) 2005-12-01 2006-07-25 Apparatus for TCP and UDP Socket Search

Country Status (1)

Country Link
KR (1) KR100725921B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314273B (en) * 2018-12-12 2022-06-07 阿里巴巴集团控股有限公司 Data transmission method and connection device based on UDP (user Datagram protocol)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19990046273A (en) * 1999-01-28 1999-07-05 유근순 A Compound of Water Treatment Agent Emitting Far-Infrared Rays

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19990046273A (en) * 1999-01-28 1999-07-05 유근순 A Compound of Water Treatment Agent Emitting Far-Infrared Rays

Also Published As

Publication number Publication date
KR20070057640A (en) 2007-06-07

Similar Documents

Publication Publication Date Title
US6754799B2 (en) System and method for indexing and retrieving cached objects
US8996611B2 (en) Parallel serialization of request processing
US9563423B1 (en) System and method for simultaneous shared access to data buffers by two threads, in a connection-oriented data proxy service
US8660130B2 (en) Transmitting a packet
US20030028515A1 (en) Proxy processing method
US7756961B2 (en) Hardware device and method for creation and management of toe-based socket information
EP4318251A1 (en) Data access system and method, and device and network card
US7751346B2 (en) Apparatus for searching TCP and UDP sockets
WO2020199760A1 (en) Data storage method, memory and server
JP2019531563A (en) Data processing method, storage system, and switching device
US8250176B2 (en) File sharing method and file sharing system
CN114625762A (en) Metadata acquisition method, network equipment and system
US11269687B2 (en) Map reduce using coordination namespace hardware acceleration
US7003589B2 (en) Method and arrangement for generating unique identifiers for logical units of SCSI devices
US20220342888A1 (en) Object tagging
KR100725921B1 (en) Apparatus for TCP and UDP Socket Search
CN111143427B (en) Distributed information retrieval method, system and device based on online computing
CN116155828B (en) Message order keeping method and device for multiple virtual queues, storage medium and electronic equipment
US20040267967A1 (en) Method, system, and program for managing requests to a network adaptor
US11237770B2 (en) Storage system and queue control method of storage system
CN115129779A (en) Database synchronization method, device and readable medium
CN107615259A (en) A kind of data processing method and system
US9531765B1 (en) System and method for maximizing system data cache efficiency in a connection-oriented data proxy service
US9514151B1 (en) System and method for simultaneous shared access to data buffers by two threads, in a connection-oriented data proxy service
US20080140687A1 (en) Socket structure simultaneously supporting both toe and ethernet network interface card and method of forming the socket structure

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