KR100654190B1 - communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel - Google Patents

communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel Download PDF

Info

Publication number
KR100654190B1
KR100654190B1 KR1020040105572A KR20040105572A KR100654190B1 KR 100654190 B1 KR100654190 B1 KR 100654190B1 KR 1020040105572 A KR1020040105572 A KR 1020040105572A KR 20040105572 A KR20040105572 A KR 20040105572A KR 100654190 B1 KR100654190 B1 KR 100654190B1
Authority
KR
South Korea
Prior art keywords
toe
socket
layer
memory
interface
Prior art date
Application number
KR1020040105572A
Other languages
Korean (ko)
Other versions
KR20060067311A (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 KR1020040105572A priority Critical patent/KR100654190B1/en
Publication of KR20060067311A publication Critical patent/KR20060067311A/en
Application granted granted Critical
Publication of KR100654190B1 publication Critical patent/KR100654190B1/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
    • 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/163In-band adaptation of TCP data exchange; In-band control procedures

Abstract

본 발명은 응용 프로그램에서 사용하는 소켓 인터페이스와 TOE(TCP offload Engine) 사이의 연결을 제어하는 통신 인터페이스 방법에 관한 것이다. The present invention relates to a communication interface method for controlling a connection between a socket interface used in an application and a TCP offload engine (TOE).

본 발명에서는 기존의 소켓 인터페이스와 완전히 호환이 가능한 TOE 소켓 인터페이스를 구현할 수 있다.The present invention can implement a TOE socket interface that is fully compatible with the existing socket interface.

따라서, 특정 TOE에 의존하지 않는 일반적인 소켓 스위치 계층과 오프로드 프로토콜 처리 계층을 제작할 수 있어서 다양한 TOE 상에서 호환성 있는 소켓 인터페이스를 지원할 수 있다. 또한, 오프로드 프로토콜 처리 계층에서 구현한 데이터 무복사 기능을 통해 TOE를 사용하는 서버의 네트워크 성능을 향상시킬 수 있다.Therefore, the general socket switch layer and the offload protocol processing layer that do not depend on a specific TOE can be manufactured to support a compatible socket interface on various TOEs. In addition, the data copying function implemented in the offload protocol processing layer can improve the network performance of the server using the TOE.

TOE(TCP Offlond engine), 커널 소켓, 소켓 스위치 계층, 오프로드 프로토콜 계층, TOE 디바이스 드라이버TCP Offlond Engine (TOE), Kernel Sockets, Socket Switch Layer, Offload Protocol Layer, TOE Device Driver

Description

응용 프로그램내의 소켓 인터페이스와 TOE 사이의 연결을 제어하는 통신 인터페이스 방법{communication interface method for controlling actions between Socket interface and TOE(TCP offload Engine) on Kernel}Communication interface method for controlling actions between Socket interface and TCP offload engine (TOE) on Kernel}

도 1은 종래의 네트워크 시스템의 구성을 나타낸 도면이다.1 is a view showing the configuration of a conventional network system.

도 2는 종래의 네트워크 시스템에서 통신을 위해 거치게 되는 소프트웨어 계층 구조를 나타낸 도면이다.2 is a diagram illustrating a software hierarchy structure for communication in a conventional network system.

도 3은 종래의 TOE 소켓 인터페이스를 지원하기 위한 소프트웨어 계층 구조를 나타낸 도면이다.3 is a diagram illustrating a software hierarchy for supporting a conventional TOE socket interface.

도 4 및 도 5에서는 프로토콜 처리시 데이터 복사를 하지 않도록 하여 CPU 부담을 줄이는 방법을 설명하기 위한 도면이다.4 and 5 are diagrams for explaining a method of reducing CPU burden by not copying data during protocol processing.

도 6은 본 발명의 실시예에 따른 커널 수준의 소켓 계층이 포함된 소프트웨어 계층 구조를 나타낸 도면이다.6 is a diagram illustrating a software layer structure including a kernel level socket layer according to an embodiment of the present invention.

도 7은 도 6의 각 계층에서 정의된 인터페이스를 나타내는 도면이다.FIG. 7 is a diagram illustrating an interface defined in each layer of FIG. 6.

도 8은 본 발명의 실시예에 따른 커널 수준의 소켓 계층에서의 소켓 데이터 송신을 설명하기 위한 도면이다.8 is a diagram illustrating socket data transmission at a kernel level socket layer according to an embodiment of the present invention.

도 9 및 도 10은 본 발명의 실시예에 따른 도 6의 구조 상에서 데이터 무복 사 구조를 설명하기 위한 도면이다.9 and 10 are diagrams for explaining a data copyless structure on the structure of FIG. 6 according to an embodiment of the present invention.

본 발명은 컴퓨터 네트워크 포로토콜 처리 방법에 관한 것으로, 특히 네트워크 컴퓨터 서버에서 네트워크 프로토콜을 효율적으로 처리하여 서버의 성능 향상과 처리용량 증대와 네트워크 인터페이스 상에서 표준 소켓 인터페이스를 제공하는 통신 인터페이스 방법에 관한 것이다.The present invention relates to a method for processing computer network protocols, and more particularly, to a communication interface method for efficiently processing a network protocol in a network computer server to increase server performance, increase throughput, and provide a standard socket interface on a network interface.

도 1은 컴퓨터 네트워크 시스템의 일반적인 구성을 나타낸 도면이다.1 is a diagram showing a general configuration of a computer network system.

도 1에 나타낸 바와 같이, 종래의 컴퓨터 네트워크 시스템은 하나 이상의 노드(10)들을 포함하며, 각 노드(10)들은 서로 독립적인 별도의 운영체제를 가지고, 각각 별도의 응용 프로그램을 수행한다. 이와 같이 별도로 운용되는 각 노드(10)들은 네트워크 인터페이스 카드(Network Interface Card: NIC)(11)를 통하여 네트워크(20)에 연결되며, 각각의 노드에서 실행되는 응용 프로그램들이 서로 통신을 하기 위해서는 응용 프로그램을 작성하는데 이용될 수 있는 통신 인터페이스를 이용한다.As shown in FIG. 1, a conventional computer network system includes one or more nodes 10, each node 10 having separate operating systems that are independent of each other, and each performing a separate application program. Each of the nodes 10 separately operated as described above is connected to the network 20 through a network interface card (NIC) 11, and in order for the applications executed in each node to communicate with each other, the application programs. Use a communication interface that can be used to write

이러한 통신 인터페이스로는 버클리 소재 캘리포니아 대학에서 개발된 소켓(Sockets) 인터페이스가 광범위하게 사용되고 있으며, 이러한 소켓 인터페이스를 사용하여 각 노드들간 통신을 수행할 때, 종래의 리눅스 운영체제의 네트워크 시스템에서 거치게 되는 소프트웨어 계층구조가 도 2에 나타나 있다.These communication interfaces are widely used sockets interface developed by the University of California, Berkeley, the software layer that passes through the network system of the conventional Linux operating system when communicating between nodes using these socket interfaces The structure is shown in FIG.

도 2를 참조하면, 상기 소프트웨어 계층구조의 가장 상위에 소켓 인터페이스(30)가 위치하고, 그 아래로 시스템 호출 계층(40), 커널 소켓 계층(41), TCP/UDP(42), IP(43)가 순차적으로 위치하며, 가장 하위에 NIC(45)를 구동하기 위한 네트워크 드라이버(44)가 위치한다. 이때, 소켓 인터페이스(30)는 사용자 수준에서 라이브러리 형태로 구성되어 응용 프로그램별로 제공되며, 시스템 호출 계층(40) 및 그 아래의 계층들은 소켓 인터페이스(30)가 해당 응용 프로그램에 의해 호출될 때, 이를 처리하기 위해 사용되는 소프트웨어 모듈이다.2, a socket interface 30 is located at the top of the software hierarchy, below which the system call layer 40, kernel socket layer 41, TCP / UDP 42, and IP 43 are located. Are sequentially located, and at the bottom is a network driver 44 for driving the NIC 45. At this time, the socket interface 30 is configured in the form of a library at the user level and is provided for each application program. The system call layer 40 and the layers below the socket interface 30 are called when the socket interface 30 is called by the corresponding application program. Software module used to process.

즉, 노드 1(10)의 응용 프로그램이 해당 소켓 인터페이스(30)를 호출하면, 그 소켓 인터페이스(30)는 해당 노드 1(10)의 운영체제 커널 영역에 속한 시스템 호출 계층(40)을 거쳐 커널 소켓 계층(41)으로 호출 명령을 전달한다. 이후, 상기 호출 명령은 TCP/UDP(42) 및 IP(43) 계층을 거쳐 네트워크 드라이버(44)로 전달되며, 네트워크 드라이버(44)에 의해 NIC(45)가 구동된다.That is, when an application program of the node 1 (10) calls the socket interface 30, the socket interface 30 passes through the system call layer 40 belonging to the operating system kernel area of the node 1 (10). Pass the call command to layer 41. The call command is then passed to the network driver 44 via the TCP / UDP 42 and IP 43 layers, whereby the NIC 45 is driven by the network driver 44.

이 과정에서, 커널은 사용자 수준에 있는 데이터를 커널 버퍼로 복사하고, 커널 버퍼의 데이터를 NIC(45)가 DMA(Direct memory access)를 통하여 가져간다. 이러한 일련의 소프트웨어 계층을 거친 후에야 응용프로그램은 네트워크에 데이터를 전송할 수 있게 된다. 하지만, 상기와 같은 소프트웨어 계층에서 TCP 프로토콜 처리와 프로토콜을 처리할 때 수행되는 메모리 복사가 CPU를 가장 많이 점유하여 네트워크 성능 저하를 초래하는 것으로 알려져 있다.In this process, the kernel copies data at the user level into the kernel buffer, and the data of the kernel buffer is taken by the NIC 45 through direct memory access (DMA). Only after this series of software layers will the application be able to send data over the network. However, it is known that memory copying performed when TCP protocol processing and protocol processing in the software layer as described above occupy the most CPU and cause network performance degradation.

아래에서는 이러한 네트워크 성능 저하를 초래하는 CPU의 부담을 줄이기 위한 방법에 대해 설명한다.The following describes how to reduce the burden on the CPU that causes such network performance degradation.

도 3은 종래의 TOE 소켓 인터페이스를 지원하기 위한 소프트웨어 구조를 나타낸 도면이다.3 is a diagram illustrating a software structure for supporting a conventional TOE socket interface.

종래의 CPU의 부담을 줄이기 위해 사용된 방법은 TCP 프로토콜 처리를 별도의 하드웨어(TOE: TCP Offload Engine)가 담당하도록 하는 것이다.The method used to reduce the burden on the conventional CPU is to make TCP protocol processing a separate hardware (TOE: TCP Offload Engine).

도 3에 나타낸 바와 같이, TOE(52)와 같은 네트워크 인터페이스 장치는 리눅스가 지원하지 않기 때문에 TOE 제공자는 별도의 TOE 장치 드라이버(51)를 제작하고, 상기 TOE 장치 드라이버(51) 상에서 상기 TOE(52)에만 적용되는 소켓 인터페이스를 제공해야만 한다. 한편, 이와 같이 TOE(52)를 개발하고, 상기 TOE(52)에만 적용되는 소켓 인터페이스를 제공하기 위해서는 TOE 장치 드라이버(51) 및 소켓 모듈 즉, 도 3에서 TOE 지원 모듈(50)을 모두 개발해야 하는 부담이 발생한다. 또한, 상기 TOE 지원 모듈(50)은 표준 소켓 인터페이스와 호환되지 않는 문제점이 있다.As shown in FIG. 3, since a network interface device such as the TOE 52 is not supported by Linux, the TOE provider creates a separate TOE device driver 51, and the TOE 52 on the TOE device driver 51. Must provide a socket interface that applies only to Meanwhile, in order to develop the TOE 52 and provide a socket interface applicable only to the TOE 52, both the TOE device driver 51 and the socket module, that is, the TOE support module 50 in FIG. 3 must be developed. The burden arises. In addition, the TOE support module 50 has a problem that is incompatible with the standard socket interface.

도 4 및 도 5에서는 프로토콜 처리시 데이터 복사를 하지 않도록 하여 CPU 부담을 줄이는 방법을 설명하기 위한 도면이다.4 and 5 are diagrams for explaining a method of reducing CPU burden by not copying data during protocol processing.

도 4는 NIC의 메모리를 사용자가 직접 접근할 수 있도록 하여 메모리 복사를 피하는 방법이다.4 is a method of avoiding memory copy by allowing a user to directly access the memory of the NIC.

하지만, 이때 응용 프로그램은 NIC의 메모리를 소켓 버퍼로 할당해야 하고 소켓 송수신시 그 버퍼의 주소를 사용해야 한다. 또한, 응용 프로그램은 NIC의 메모리를 사용하기 위해서는 NIC가 제공하는 특별한 API를 사용해야만 한다.However, the application program must allocate the memory of the NIC as a socket buffer and use the address of the buffer when sending and receiving sockets. In addition, an application must use the special APIs provided by the NIC to use the NIC's memory.

도 5는 커널과 사용자가 공유하는 메모리를 사용하여 사용자와 커널간의 메 모리 복사를 피하는 방법이다.5 illustrates a method of avoiding memory copying between a user and the kernel by using a memory shared by the kernel and the user.

하지만, 도 4의 경우와 유사하게 응용 프로그램은 공유 메모리를 소켓 송수신 버퍼로 할당해야 하고, 이를 위해선 별도의 API를 사용해야만 한다.However, similar to the case of FIG. 4, the application program should allocate shared memory as a socket transmit / receive buffer and use a separate API for this purpose.

상기와 같이, CPU의 부담을 줄이기 위한 방법에 따르면 TOE 장치 드라이버(51)를 사용하기 위해서나 특정 메모리를 사용하기 위해서는 별도의 API를 사용해야 하므로 응용 프로그램간의 호환성 문제가 발생한다. 또한, 기존의 소켓 응용 프로그램에 상기 방법을 적용하는 경우에는 특별한 API가 사용되도록 수정되어야 하고, 또한, 도 5의 방법을 사용하는 경우에는 추가적으로 소켓 버퍼가 페이지 단위로 정렬되어 있어야만 한다. As described above, according to the method for reducing the burden on the CPU, a separate API must be used to use the TOE device driver 51 or to use a specific memory, thereby causing compatibility problems between applications. In addition, when the above method is applied to an existing socket application program, a special API must be modified to be used. In addition, when the method of FIG. 5 is used, the socket buffer must be additionally arranged in units of pages.

본 발명이 이루고자 하는 기술적 과제는, 기존의 소켓 인터페이스와 호환이 되는 TOE 소켓 인터페이스를 구현할 수 있도록 응용 프로그램에서 사용하는 소켓 인터페이스와 TOE 사이의 연결을 제어하는 통신 인터페이스 방법을 제공하는데 있다.An object of the present invention is to provide a communication interface method for controlling a connection between a socket interface used in an application program and a TOE so as to implement a TOE socket interface compatible with an existing socket interface.

이러한 목적을 달성하기 위한 본 발명의 하나의 특징에 따른 응용 프로그램내의 소켓 인터페이스와 TOE(TCP Offload Engine) 사이의 연결을 제어하는 통신 인터페이스 방법에서, 상기 소켓은 소켓 스위칭 계층, 오프로드 프로토콜 처리 계층, 그리고 TOE 장치 드라이버 계층을 포함하는 형태로 구현되며, 상기 방법은 a) 사용자가 소켓 인터페이스를 호출하면, 상기 소켓 스위치 계층에서 현재 사용하고 있는 소켓이 TOE에 연결되었는지를 판단하여, 그 판단 결과에 따라 프로토콜 스택을 선택하는 단계; b) 상기 소켓 스위치 계층에서 TOE 프로토콜 스택이 선택된 경우, 상기 오프로드 프로토콜 처리 계층에서, 상기 소켓 스위치 계층으로부터 전달된 사용자의 요청을 디스크립터 형태로 변환하는 단계; c) 상기 TOE 장치 드라이버 계층에서 상기 오프로드 프로토콜 처리 계층으로부터 상기 디스크립터를 수신하여 이를 상기 TOE의 지정된 메모리에 저장하고 상기 오프로드 프로토콜 처리 계층으로 제어권을 반환하는 단계를 포함한다. In the communication interface method for controlling a connection between a socket interface in the application and a TCP Offload Engine (TOE) according to an aspect of the present invention for achieving this object, the socket is a socket switching layer, an offload protocol processing layer, And a TOE device driver layer. The method includes: a) when a user calls a socket interface, determines whether the socket currently used by the socket switch layer is connected to the TOE, and according to the determination result. Selecting a protocol stack; b) when a TOE protocol stack is selected in the socket switch layer, converting a request of a user transferred from the socket switch layer into a descriptor form in the offload protocol processing layer; c) receiving the descriptor from the offload protocol processing layer at the TOE device driver layer, storing the descriptor in a specified memory of the TOE, and returning control to the offload protocol processing layer.

삭제delete

삭제delete

삭제delete

본 발명의 다른 특징에 따른 응용 프로그램내의 소켓 인터페이스와 TOE 사이의 연결을 제어하는 커널 수준의 소켓을 이용한 통신 인터페이스 방법은, 상기 커널 수준의 소켓 중 오프로드 프로토콜 처리 계층에서, 임의의 사용자 수준의 가상 메모리를 할당받는 응용 프로그램으로부터 소켓 송수신 인터페이스를 통해 그 메모리의 주소를 수신하는 단계; 상기 수신한 메모리의 주소를 TOE의 DMA 엔진이 인식할 수 있는 실제 메모리 주소로 변환하는 단계; 및 상기 변환된 실제 메모리 주소를 상기 TOE로 전달하는 단계를 포함한다. According to another aspect of the present invention, a communication interface method using a kernel-level socket for controlling a connection between a socket interface in an application program and a TOE is provided. Receiving an address of the memory through a socket transmission / reception interface from an application to which the memory is allocated; Converting the address of the received memory into an actual memory address that can be recognized by a DMA engine of a TOE; And transmitting the converted real memory address to the TOE.

삭제delete

삭제delete

삭제delete

삭제delete

삭제delete

아래에서는 첨부한 도면을 참고로 하여 본 발명의 실시예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였다. 명세서 전체를 통하여 유사한 부분에 대해서는 동일한 도면 부호를 붙였다.DETAILED DESCRIPTION Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art may easily implement the present invention. As those skilled in the art would realize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. In the drawings, parts irrelevant to the description are omitted in order to clearly describe the present invention. Like parts are designated by like reference numerals throughout the specification.

이하, 본 발명의 실시예에 따른 커널 수준의 소켓 계층과 그를 이용한 통신 인터페이스 방법에 대해 도면을 참조하여 상세하게 설명한다.Hereinafter, a kernel level socket layer and a communication interface method using the same will be described in detail with reference to the accompanying drawings.

도 6은 본 발명의 실시예에 따른 커널 수준의 소켓 계층이 포함된 소프트웨어 계층 구조를 나타낸 도면이다.6 is a diagram illustrating a software layer structure including a kernel level socket layer according to an embodiment of the present invention.

도 6을 참조하면, 상기 소프트웨어 계층구조의 가장 상위에 소켓 인터페이스(100)가 위치하고, 그 아래로 시스템 호출 계층(200), BSD 소켓 계층(210)이 순차적으로 위치한다. 그 다음, 가장 하위에 TOE(300)를 구동하기 위한 TOE 장치 드라이버(280), 오프로드 프로토콜 계층(OP 계층)(270)이 순차적으로 위치하고, 또한 NIC(400)를 구동하기 위한 NIC 디바이스 드라이버(250), TCP/IP(240) 및 INET 소켓 계층(230)이 순차적으로 위치한다. 그리고, 상기 소켓 인터페이스를 구현하기 위해 커널의 시스템 호출 계층부터 상기 TOE 디바이스 드라이버(280) 또는 상기 NIC 디바이스 드라이버(250)까지 계층을 거치는 각각의 프로토콜 처리 스택을 선택하는 기능을 갖는 소켓 스위치 계층(260)이 위치한다.Referring to FIG. 6, the socket interface 100 is positioned at the top of the software hierarchy, and the system call layer 200 and the BSD socket layer 210 are sequentially positioned below the software interface. Next, the TOE device driver 280 and the offload protocol layer (OP layer) 270 for driving the TOE 300 are sequentially located at the lowermost level, and the NIC device driver for driving the NIC 400 ( 250), TCP / IP 240 and INET socket layer 230 are sequentially located. In addition, a socket switch layer 260 having a function of selecting each protocol processing stack passing through a layer from a system call layer of a kernel to the TOE device driver 280 or the NIC device driver 250 to implement the socket interface. ) Is located.

상기와 같이 본 발명의 실시예에 따른 커널 수준의 소켓 계층이 포함된 소프트웨어 계층 구조 하에서, 응용 프로그램은 기존의 소켓 인터페이스를 그대로 사용하고, 커널 수준의 시스템 호출 계층(200) 및 BSD 소켓 계층(210)을 거쳐 호출 명령을 전달하면, 소켓 스위치 계층(260)은 현재 사용하는 소켓의 TOE(300) 연결 여부에 따라 INET 소켓 계층(230)에서 NIC 디바이스 드라이버(250)를 거치는 기존의 프로토콜 스택 또는 오프로드 프로토콜 계층(270) 및 TOE 디바이스 드라이버(280)를 거치는 TOE 프로토콜 스택을 선택한다. 이와 같이, 스위치 계층은 프로토콜 스택을 선택하는 기능만을 갖도록 제한된다.As described above, under a software hierarchy including a kernel level socket layer according to an embodiment of the present invention, an application program may use an existing socket interface as it is, and a kernel level system call layer 200 and a BSD socket layer 210. When the call command is transmitted through the ()), the socket switch layer 260 may turn off or turn off the existing protocol stack passing through the NIC device driver 250 at the INET socket layer 230 depending on whether the socket 300 is currently connected to the TOE 300. The TOE protocol stack passing through the load protocol layer 270 and the TOE device driver 280 is selected. As such, the switch layer is limited to having only the ability to select a protocol stack.

한편, 오프로드 프로토콜 처리계층(270)은 특정 TOE에 독립적인 기능을 구현하는 계층으로 데이터 무복사 기능, 사용자 소켓과 TOE의 TCP 세션의 매핑과 같은 기능을 포함하고 있다. 상기 오프로드 프로토콜 처리 계층(270)은 TOE(300)를 위한 부가 기능을 구현함과 동시에 소켓 인터페이스와 TOE 드라이버 인터페이스와의 의미 차이를 극복하는 수단이 된다. TOE 드라이버 인터페이스는 아주 낮은 수준의 인터페이스만을 제공하고, 소켓 인터페이스와 매우 다르기 때문에 스위치 계층(260)이 직접 호출하기에는 적합하지 않다.Meanwhile, the offload protocol processing layer 270 is a layer that implements a function independent of a specific TOE. The offload protocol processing layer 270 includes functions such as a data non-copy function, a mapping between a user socket and a TCP session of the TOE. The offload protocol processing layer 270 implements an additional function for the TOE 300 and is a means for overcoming semantic differences between the socket interface and the TOE driver interface. The TOE driver interface provides only a very low level interface and is very different from the socket interface so that the switch layer 260 is not suitable for direct calls.

TOE 디바이스 드라이버 계층(280)은 TOE(300)가 제공하는 인터페이스를 소프트웨어로 구현한 것이다. 대부분의 TOE(300)가 제공하는 인터페이스는 소켓 생성, 데이터 송수신 등을 TOE(300)와 공유하는 메모리에 포스팅하고 처리 결과를 하드웨어 인터럽트를 통하여 통지하는 형태이다. TOE 디바이스 드라이버(280)는 이러한 하드웨어 인터페이스를 상기 오프로드 프로토콜 처리 계층(260)이 사용할 수 있도록 소프트웨어 인터페이스로 구현한 것이다. 따라서, 공유 메모리에 디스크립터를 저장하거나 꺼내오는 작업의 주도권은 오프로드 프로토콜 처리 계층(260)에 있다.The TOE device driver layer 280 implements the interface provided by the TOE 300 in software. The interface provided by most of the TOE 300 is a form of posting a socket, data transmission, and the like to a memory shared with the TOE 300 and notifying the processing result through a hardware interrupt. The TOE device driver 280 implements this hardware interface as a software interface for the offload protocol processing layer 260 to use. Thus, the initiative to store or retrieve descriptors in shared memory resides in the offload protocol processing layer 260.

또한, 상기 공유 메모리에 포스팅한 데이터 송신이 완료되면 하드웨어 인터럽트가 발생하고 TOE 디바이스 드라이버(280)가 인터럽트 핸들러에서 최소 기능만 수행한 후 완료 정보를 상기 공유 메모리에서 꺼내고 나머지 소켓 관련 처리는 상 기 오프로드 프로토콜 처리 계층(280)이 담당한다.In addition, when the transmission of the data posted to the shared memory is completed, a hardware interrupt occurs and the TOE device driver 280 performs the minimum function in the interrupt handler, and then completes the information from the shared memory and the remaining socket related processing is turned off. The load protocol processing layer 280 is in charge.

도 7은 도 6의 각 계층에서 정의된 인터페이스를 나타내는 도면이다.FIG. 7 is a diagram illustrating an interface defined in each layer of FIG. 6.

사용자가 소켓 인터페이스를 호출하면 그 호출은 소켓 스위치 계층(260), 오프로드 프로토콜 계층(270)까지 접두어(prefix)만 다르고 이름과 인자가 동일한 인터페이스에 연결된다. 오프로드 프로토콜 계층(270)은 호출된 함수의 의미와 전달된 인자를 바탕으로 TOE 요청 디스크립터를 작성하고, 그 디스크립터를 TOE 디바이스 드라이버(280)에 전달한다. TOE 디바이스 드라이버(280)는 상기 디스크립터를 참조하여, 상기 소켓 호출을 예를 들어, socket, bind, listen, connect, accept 등과 같은 명령 메시지와 sendmsg, recvmsg와 같은 데이터 송수신 메시지로 구분한다. 예를 들어, toe_post_cmd 는 명령 디스크립터를, toe_post_send, toe_post_recv 는 각각 데이터 송신과 수신 디스크립터를 TOE(300)에게 전달한다.When a user invokes a socket interface, the call is connected to an interface with the same prefix and different name and argument, up to socket switch layer 260 and offload protocol layer 270. The offload protocol layer 270 creates a TOE request descriptor based on the meaning of the called function and the passed arguments, and delivers the descriptor to the TOE device driver 280. The TOE device driver 280 refers to the descriptor and classifies the socket call into a command message such as socket, bind, listen, connect, accept, and the like, and a data transmission / reception message such as sendmsg and recvmsg. For example, toe_post_cmd delivers command descriptors, and toe_post_send and toe_post_recv deliver data transmission and reception descriptors to the TOE 300, respectively.

도 8은 본 발명의 실시예에 따른 커널 수준의 소켓 계층에서의 소켓 데이터 송신을 설명하기 위한 도면이다.8 is a diagram illustrating socket data transmission at a kernel level socket layer according to an embodiment of the present invention.

응용 프로그램이 소켓 인터페이스를 호출 즉, 소켓 송신 함수인 send(socket_id, socket_buffer, buffer_size)를 호출하면 소켓 스위치 계층(260)에서는 현재 사용하고 있는 소켓(socket_id)이 TOE(300)에 연결된 것인지 아닌지를 판단한다. 판단결과, TOE(300)에 연결된 소켓이면 사용자의 함수 호출을 그대로 오프로드 프로토콜 처리 계층(270)으로 전달한다. 그러면, 상기 오프로드 프로토콜 처리 계층(270)은 상기 사용자의 송신 요청을 디스크립터 형태(op_sendmsg)로 변환하여 TOE 디바이스 드라이버(280)로 전달한다. 다음, TOE 디바이스 드라이버 (280)는 이 디스크립터(toe_post_send)를 TOE(300)와의 공유 메모리에 저장하고 오프로드 프로토콜 처리 계층(270)으로 제어권을 반환한다. 오프로드 프로토콜 처리 계층(270)은 요청한 디스크립터 처리가 완료되어 미리 지정된 완료 처리 함수가 호출될 때까지 요청 프로세스를 기다리게 한다. TOE(300)가 하드웨어 인터럽트를 받으면 완료 처리 함수를 호출하여 완료큐에 저장된 디스크립터를 가져가고 완료를 기다리고 있던 프로세스를 깨운다.When an application calls the socket interface, that is, the socket send function send (socket_id, socket_buffer, buffer_size), the socket switch layer 260 determines whether the socket (socket_id) currently being used is connected to the TOE 300. do. As a result, if the socket is connected to the TOE 300, the function call of the user is transferred to the offload protocol processing layer 270 as it is. Then, the offload protocol processing layer 270 converts the user's transmission request into a descriptor form (op_sendmsg) and transmits the request to the TOE device driver 280. Next, the TOE device driver 280 stores this descriptor (toe_post_send) in shared memory with the TOE 300 and returns control to the offload protocol processing layer 270. The offload protocol processing layer 270 waits for the request process until the requested descriptor processing is completed and a predetermined completion processing function is called. When the TOE 300 receives the hardware interrupt, it calls the completion processing function, takes the descriptor stored in the completion queue, and wakes up the process waiting for completion.

도 9 및 도 10은 본 발명의 실시예에 따른 도 7의 구조 상에서 데이터 무복사 구조를 설명하기 위한 도면이다. 특히, 도 9는 데이터의 시작 주소가 정렬된 경우의 무복사 구조를 설명하는 도면이고, 도 10은 데이터의 시작 주소가 정렬되지 않은 경우의 무복사 구조를 설명하기 위한 도면이다.9 and 10 are diagrams for describing a data non-copy structure on the structure of FIG. 7 according to an embodiment of the present invention. In particular, FIG. 9 is a diagram illustrating a copyless structure when the start addresses of data are aligned, and FIG. 10 is a diagram illustrating a copyless structure when the start addresses of data are not aligned.

먼저, 도 9를 참조하면 응용 프로그램은 임의의 사용자 수준의 가상메모리(virtual memory)를 할당받고 소켓 송수신 인터페이스를 통하여 그 메모리를 오프로드 프로토콜 계층(270)에 전달한다. 그러면, 상기 메모리를 오프로드 프로토콜 계층(270)은 TOE(300)의 DMA 엔진이 인식할 수 있는 실제 메모리 주소로 변환하여 TOE(300)에 전달한다.First, referring to FIG. 9, an application program allocates an arbitrary user level virtual memory and transfers the memory to the offload protocol layer 270 through a socket transmission / reception interface. Then, the offload protocol layer 270 converts the memory into an actual memory address that can be recognized by the DMA engine of the TOE 300 and transfers the memory to the TOE 300.

TOE(300)는 사용자가 지정한 메모리가 페이지보다 크거나 페이지 경계를 넘어갈 경우에는 상기 실제 메모리에 대해서 페이지 경계를 기준으로 잘라서 실제 메모리 주소와 메모리 크기로 이루어진 리스트(sg list, scatter/gather list)를 작성하여 TOE(300)에 전달한다. 이 메모리는 송수신이 완료될 때까지 실제 메모리에 머물러 있어야 하기 때문에 리스트에 포함된 모든 페이지에 대해서 page map table 을 검색하여 해당 페이지의 페이지 테이블의 Reserved 비트를 설정해야 한다.When the user-specified memory is larger than the page or crosses the page boundary, the TOE 300 cuts the real memory based on the page boundary and generates a list (sg list, scatter / gather list) of actual memory addresses and memory sizes. Create and deliver to TOE 300. Since this memory must stay in real memory until the transmission and reception is completed, the page map table must be searched for all pages included in the list, and the reserved bit of the page table of the corresponding page must be set.

한편, 사용자가 지정한 주소의 실제 주소가 TOE(300)가 요청하는 바이트 정렬을 만족하지 못한 경우에는 도 10을 참조하여 아래에서 설명하기로 한다.On the other hand, if the actual address of the address specified by the user does not satisfy the byte alignment requested by the TOE 300 will be described below with reference to FIG.

도 10을 참조하면, 사용자가 지정한 주소의 실제 주소가 TOE(300)가 요청하는 바이트 정렬을 만족하지 못한 경우에는 메모리 앞부분의 정렬이 어긋난 부분만 정렬된 커널 메모리에 저장하여 처리한다.Referring to FIG. 10, when the actual address of the address specified by the user does not satisfy the byte alignment requested by the TOE 300, only the misaligned portion of the front part of the memory is stored and processed in the aligned kernel memory.

상기 방법은 데이터 송수신에 대해 적용할 수 있으며, TOE(300)는 TCP 프로토콜 처리시 필요한 버퍼를 관리하고 있으므로 이 버퍼를 활용하면 정렬된 사용자 메모리에 대해서 송신뿐만 아니라 수신시에도 메모리 복사를 피할 수 있다.The above method can be applied to data transmission and reception, and since the TOE 300 manages a buffer necessary for processing the TCP protocol, utilizing this buffer can avoid memory copying at the time of reception as well as transmission for the sorted user memory. .

이상에서 본 발명의 실시예에 대하여 상세하게 설명하였지만 본 발명은 이에 한정되는 것은 아니며, 그 외의 다양한 변경이나 변형이 가능하다.Although the embodiments of the present invention have been described in detail above, the present invention is not limited thereto, and various other changes and modifications are possible.

본 발명에 따르면, 특정 TOE에 의존하지 않는 일반적인 소켓 스위치 계층과 오프로드 프로토콜 처리 계층을 제작할 수 있어서 다양한 TOE 상에서 호환성 있는 소켓 인터페이스를 지원할 수 있다. 또한, 오프로드 프로토콜 처리 계층에서 구현한 데이터 무복사 기능을 통해 TOE를 사용하는 서버의 네트워크 성능을 향상시킬 수 있다.According to the present invention, a general socket switch layer and an offload protocol processing layer that do not depend on a specific TOE can be manufactured to support compatible socket interfaces on various TOEs. In addition, the data copying function implemented in the offload protocol processing layer can improve the network performance of the server using the TOE.

Claims (14)

소켓이 응용 프로그램내의 소켓 인터페이스와 TOE(TCP Offload Engine) 사이의 연결을 제어하는 통신 인터페이스 방법에서,In a communication interface method in which a socket controls a connection between a socket interface in an application program and a TCP offload engine (TOE), 상기 소켓은 소켓 스위칭 계층, 오프로드 프로토콜 처리 계층, 그리고 TOE 장치 드라이버 계층을 포함하는 형태로 구현되며,The socket is implemented in a form including a socket switching layer, an offload protocol processing layer, and a TOE device driver layer, a) 사용자가 소켓 인터페이스를 호출하면, 상기 소켓 스위치 계층에서 현재 사용하고 있는 소켓이 TOE에 연결되었는지를 판단하여, 그 판단 결과에 따라 프로토콜 스택을 선택하는 단계;a) when the user calls the socket interface, determining whether the socket currently being used by the socket switch layer is connected to the TOE, and selecting a protocol stack according to the determination result; b) 상기 소켓 스위치 계층에서 TOE 프로토콜 스택이 선택된 경우, 상기 오프로드 프로토콜 처리 계층에서, 상기 소켓 스위치 계층으로부터 전달된 사용자의 요청을 디스크립터 형태로 변환하는 단계;b) when a TOE protocol stack is selected in the socket switch layer, converting a request of a user transferred from the socket switch layer into a descriptor form in the offload protocol processing layer; c) 상기 TOE 장치 드라이버 계층에서 상기 오프로드 프로토콜 처리 계층으로부터 상기 디스크립터를 수신하여 이를 상기 TOE의 지정된 메모리에 저장하고 상기 오프로드 프로토콜 처리 계층으로 제어권을 반환하는 단계c) receiving the descriptor from the offload protocol processing layer at the TOE device driver layer, storing the descriptor in a specified memory of the TOE, and returning control to the offload protocol processing layer. 를 포함하는 통신 인터페이스 방법.Communication interface method comprising a. 제1항에 있어서,The method of claim 1, 상기 b) 단계에서 오프로드 프로토콜 처리 계층은 상기 TOE 디바이스 드라이버로 디스크립터를 제공하고, 상기 제공한 디스크립터의 처리 결과를 상기 TOE 디바이스 드라이버로부터 꺼내오는 작업을 수행하는 것을 특징으로 하는 통신 인터페이스 방법.In step b), the offload protocol processing layer provides a descriptor to the TOE device driver, and performs a task of retrieving the processing result of the provided descriptor from the TOE device driver. 제2항에 있어서,The method of claim 2, 상기 오프로드 프로토콜 처리 계층은 상기 TOE의 지정된 메모리에 저장된 사용자의 송신 요청에 대응하는 디스크립터에 해당하는 작업이 완료되어 미리 지정된 완료처리함수가 호출될 때까지 사용자의 요청 프로세스를 대기시키는 것을 특징으로 하는 통신 인터페이스 방법.The offload protocol processing layer waits for a user's request process until a task corresponding to a descriptor corresponding to a user's transmission request stored in a specified memory of the TOE is completed and a predetermined completion processing function is called. Communication interface method. 제3항에 있어서,The method of claim 3, 상기 오프로드 프로토콜 처리 계층은 상기 TOE가 하드웨어 인터럽트를 받으면 완료처리함수를 호출하여 완료큐에 저장된 디스크립터를 가져가고 완료를 기다리고 있던 프로세스를 깨우는 것을 특징으로 하는 통신 인터페이스 방법.The offload protocol processing layer calls a completion processing function when the TOE receives a hardware interrupt, takes a descriptor stored in a completion queue, and wakes up a process waiting for completion. 제1항에 있어서,The method of claim 1, 상기 TOE 디바이스 드라이버 계층에서는 상기 TOE의 지정된 메모리에 저장한 디스크립터에 해당하는 작업이 완료되어 하드웨어 인터럽트가 발생하면, 완료 정보를 상기 지정된 메모리에서 꺼내는 작업을 수행하는 것을 특징으로 하는 통신 인터페이스 방법.And in the TOE device driver layer, when a task corresponding to a descriptor stored in a specified memory of the TOE is completed and a hardware interrupt occurs, retrieving completion information from the designated memory. 제5항에 있어서,The method of claim 5, 상기 TOE 디바이스 드라이버 계층은 상기 TOE에서 제공하는 인터페이스를 소프트웨어로 구현한 것임을 특징으로 하는 통신 인터페이스 방법.The TOE device driver layer is a communication interface method, characterized in that the software implemented by the interface provided by the TOE. 제5항에 있어서,The method of claim 5, 상기 디스크립터는 호출된 함수의 의미와 전달된 인자에 대응하여 생성되는 것을 특징으로 하는 통신 인터페이스 방법.The descriptor is generated according to the meaning of the called function and the passed argument. 제1항에 있어서,The method of claim 1, 상기 a) 단계에서 사용자가 소켓 인터페이스를 호출하는 경우 그 호출은 상기 소켓 스위치 계층 및 오프로드 프로토콜 처리 계층에 걸쳐 접두어만 다르고 이름과 인자가 동일한 인터페이스에 연결되는 것을 특징으로 하는 통신 인터페이스 방법.If the user calls a socket interface in step a), the call is connected to an interface that differs only in prefix and has the same name and argument across the socket switch layer and offload protocol processing layer. 제1항에 있어서,The method of claim 1, 상기 오프로드 프로토콜 처리 계층은 데이터 무복사 기능, 사용자 소켓과 상기 ROE의 TCP 세션의 매핑 기능을 포함하는 것을 특징으로 하는 통신 인터페이스 방법.And said offload protocol processing layer includes a data copy-free function and a mapping function of a user socket and a TCP session of said ROE. 응용 프로그램내의 소켓 인터페이스와 TOE 사이의 연결을 제어하는 커널 수준의 소켓을 이용한 통신 인터페이스 방법에 있어서,In the communication interface method using a kernel-level socket that controls the connection between the socket interface in the application and the TOE, 상기 커널 수준의 소켓 중 오프로드 프로토콜 처리 계층에서,In the offload protocol processing layer of the kernel-level socket, 임의의 사용자 수준의 가상 메모리를 할당받는 응용 프로그램으로부터 소켓 송수신 인터페이스를 통해 그 메모리의 주소를 수신하는 단계;Receiving an address of the memory through a socket transmit / receive interface from an application program allocated to any user level virtual memory; 상기 수신한 메모리의 주소를 TOE의 DMA(direct memory access) 엔진이 인식할 수 있는 실제 메모리 주소로 변환하는 단계; 및Converting the address of the received memory into a real memory address that can be recognized by a direct memory access (DMA) engine of a TOE; And 상기 변환된 실제 메모리 주소를 상기 TOE로 전달하는 단계Delivering the translated real memory address to the TOE 를 포함하는 것을 특징으로 하는 통신 인터페이스 방법.Communication interface method comprising a. 제10항에 있어서,The method of claim 10, 사용자가 지정한 메모리가 페이지보다 크거나 페이지 경계를 넘어갈 경우에는 상기 실제 메모리에 대해서 페이지 경계를 기준으로 잘라서 상기 실제 메모리 주소와 메모리 크기로 이루어진 리스트를 작성하여 상기 TOE로 전달하는 것을 특징으로 하는 통신 인터페이스 방법.If the memory specified by the user is larger than the page or crosses the page boundary, the communication interface is characterized by cutting the page based on the page boundary and creating a list of the actual memory address and the memory size and transmitting the same to the TOE. Way. 제11항에 있어서,The method of claim 11, 상기 리스트는 sg list 및 scatter/gather list 인 것을 특징으로 하는 통신 인터페이스 방법.Wherein the list is an sg list and a scatter / gather list. 제11항에 있어서,The method of claim 11, 상기 사용자가 지정한 메모리의 송수신이 완료될 때까지 상기 실제 메모리에 머물러 있을 수 있도록 상기 리스트에 포함된 모든 페이지에 대해서 페이지 맵 테이블을 검색하여 해당 페이지의 페이지 테이블의 Reserved 비트를 설정하도록 하는 것을 특징으로 하는 통신 인터페이스 방법.Search for a page map table for all pages included in the list to set the reserved bit of the page table of the corresponding page so that the user stays in the real memory until the transmission and reception of the memory designated by the user is completed. Communication interface method. 제11항에 있어서,The method of claim 11, 사용자가 지정한 메모리 주소의 실제 주소가 상기 TOE가 요청하는 바이트 정렬을 만족하지 못한 경우에는 상기 메모리의 정렬이 어긋난 부분만 정렬된 커널 메모리에 저장하여 처리하는 것을 특징으로 하는 통신 인터페이스 방법.If the actual address of the memory address specified by the user does not satisfy the byte alignment requested by the TOE, only the misaligned portion of the memory is stored in the aligned kernel memory and processed.
KR1020040105572A 2004-12-14 2004-12-14 communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel KR100654190B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020040105572A KR100654190B1 (en) 2004-12-14 2004-12-14 communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020040105572A KR100654190B1 (en) 2004-12-14 2004-12-14 communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel

Publications (2)

Publication Number Publication Date
KR20060067311A KR20060067311A (en) 2006-06-20
KR100654190B1 true KR100654190B1 (en) 2006-12-05

Family

ID=37161888

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020040105572A KR100654190B1 (en) 2004-12-14 2004-12-14 communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel

Country Status (1)

Country Link
KR (1) KR100654190B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100929852B1 (en) * 2007-09-20 2009-12-04 한국전자통신연구원 Apparatus and method for communication between applications on virtual machine using shared memory

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020156927A1 (en) 2000-12-26 2002-10-24 Alacritech, Inc. TCP/IP offload network interface device
US6765901B1 (en) 1998-06-11 2004-07-20 Nvidia Corporation TCP/IP/PPP modem
KR20050060801A (en) * 2003-12-17 2005-06-22 한국전자통신연구원 Socket compatibility layer for toe

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6765901B1 (en) 1998-06-11 2004-07-20 Nvidia Corporation TCP/IP/PPP modem
US20020156927A1 (en) 2000-12-26 2002-10-24 Alacritech, Inc. TCP/IP offload network interface device
KR20050060801A (en) * 2003-12-17 2005-06-22 한국전자통신연구원 Socket compatibility layer for toe

Also Published As

Publication number Publication date
KR20060067311A (en) 2006-06-20

Similar Documents

Publication Publication Date Title
US6658469B1 (en) Method and system for switching between network transport providers
US8713180B2 (en) Zero-copy network and file offload for web and application servers
US5848234A (en) Object procedure messaging facility
EP0889623B1 (en) System and method for efficient remote disk I/O
US5404527A (en) System and method for remote program load
JP5214473B2 (en) Virtual machine migration system with resources such as hardware devices
JP5364773B2 (en) System and method for managing a connection between a client and a server
US7222152B1 (en) Generic communications framework
Dubnicki et al. Design and implementation of virtual memory-mapped communication on myrinet
US5768618A (en) Method for performing sequence of actions in device connected to computer in response to specified values being written into snooped sub portions of address space
US20150201007A1 (en) Reception according to a data transfer protocol of data directed to any of a plurality of destination entities
US7028091B1 (en) Web server in-kernel interface to data transport system and cache manager
US20040240435A1 (en) Obtaining a destination address so that a network interface device can write network data without headers directly into host memory
JP2001523864A (en) Server operating system that supports multiple client-server sessions and dynamic reconnection of users to previous sessions
CZ20012154A3 (en) Interrupt architecture for a non-uniform memory access (NUMA) data processing system
WO2017000593A1 (en) Packet processing method and device
JPH10301873A (en) System and method for controlling transmission of relatively large data object in communication system
US20060059244A1 (en) Communication mechanism and method for easily transferring information between processes
CN113067849A (en) Network communication optimization method and device based on Glusterfs
US5915124A (en) Method and apparatus for a first device accessing computer memory and a second device detecting the access and responding by performing sequence of actions
KR100654190B1 (en) communication interface method for controlling actions between Socket interface and TOETCP offload Engine on Kernel
US7827194B2 (en) Access to shared disk device on storage area network
JPH11149387A (en) Common device control method and its implementing device
Fischer GMSOCKS-a direct sockets implementation on myrinet
JP3644158B2 (en) Data transmission / reception method in parallel computer

Legal Events

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