KR20060095676A - Layer structure and method for internal routing in communication system - Google Patents

Layer structure and method for internal routing in communication system Download PDF

Info

Publication number
KR20060095676A
KR20060095676A KR1020050016464A KR20050016464A KR20060095676A KR 20060095676 A KR20060095676 A KR 20060095676A KR 1020050016464 A KR1020050016464 A KR 1020050016464A KR 20050016464 A KR20050016464 A KR 20050016464A KR 20060095676 A KR20060095676 A KR 20060095676A
Authority
KR
South Korea
Prior art keywords
header
packet
ethernet
card
encapsulation header
Prior art date
Application number
KR1020050016464A
Other languages
Korean (ko)
Inventor
진성기
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to KR1020050016464A priority Critical patent/KR20060095676A/en
Publication of KR20060095676A publication Critical patent/KR20060095676A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • 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/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

본 발명은 특정 네트워크 시스템 내부에 네트워크 프로세서가 있는 경우, 네트워크 프로세서가 필요로 하는 정보를 리눅스(Linux)커널(kernel)에서 생성하는 방안과 라우팅이 종료된 패킷이 리눅스 커널에 도착했을 때, 이 정보를 제거하는 방안에 대한 것이다. 네트워크 프로세서가 특정 시스템 내부에서의 내부 라우팅(Internal Routing)을 수행하기 위해서 필요로 하는 정보는 인캡슐레이션 헤더(Encapsulation Header)라고 명명되는 삼성에서 제안한 패킷 헤더에 포함되며 리눅스 커널에서 생성되고 삭제된다. 패킷 포워딩 및 라우팅을 담당하는 네트워크 프로세서는 인터넷 프로토콜(Internet Protocol : 이하 IP라 함)이나 TCP/UDP(Transmission Control Protocol)/(User Datagram Protocol) 헤더를 보지 않고 인캡슐레이션 헤더만을 이용하여 시스템 내부에서의 패킷 라우팅을 수행한다.According to the present invention, when there is a network processor in a specific network system, a method for generating information required by the network kernel in the Linux kernel and when the packet whose routing is terminated arrives in the Linux kernel are provided. It is about the way to eliminate it. The information needed by the network processor to perform internal routing within a specific system is included in the packet header proposed by Samsung, called the encapsulation header, and created and deleted by the Linux kernel. The network processor responsible for packet forwarding and routing does not look at the Internet Protocol (hereinafter referred to as IP) or TCP / UDP (Transmission Control Protocol) / (User Datagram Protocol) headers. Performs packet routing.

리눅스 커널, 내부 라우팅 Linux kernel, internal routing

Description

통신 장치 내부 라우팅 계층 구조 및 방법{LAYER STRUCTURE AND METHOD FOR INTERNAL ROUTING IN COMMUNICATION SYSTEM}LAYER STRUCTURE AND METHOD FOR INTERNAL ROUTING IN COMMUNICATION SYSTEM}

도 1은 종래 기술에 따른 통신 시스템 내부 라우팅 시의 통신 프로토콜 헤더 포맷,1 is a communication protocol header format in a communication system internal routing according to the prior art;

도 2는 상기 도 1의 헤더를 생성하는 통신 프로토콜 계층을 도시한 도면,2 illustrates a communication protocol layer generating the header of FIG. 1;

도 3a는 본 발명의 실시 예에 따라 인캡슐레이션 헤더를 삽입한 형태의 통신 프로토콜 헤더 포맷,3A illustrates a communication protocol header format in which an encapsulation header is inserted according to an embodiment of the present invention;

도 3b는 본 발명의 실시 예에 따른 상기 인캡슐레이션 헤더 포맷,3B illustrates the encapsulation header format according to an embodiment of the present invention;

도 4는 본 발명의 실시 예에 따라 통신 장치 내부에서 인캡슐레이션 헤더를 사용하여 라우팅되는 패킷의 흐름도,4 is a flowchart of a packet routed using an encapsulation header inside a communication device according to an embodiment of the present invention;

도 5는 본 발명의 실시 예에 따라 상기 도 4의 제 1경로 상의 통신 프로토콜 스택을 도시화한 도면,5 is a diagram illustrating a communication protocol stack on the first path of FIG. 4 according to an embodiment of the present invention;

도 6은 본 발명의 실시 예에 따라 각각의 처리카드들에 구비된 리눅스 커널의 통신 프로토콜 스택 구조,6 is a communication protocol stack structure of a Linux kernel provided in each processing card according to an embodiment of the present invention;

도 7은 본 발명의 실시 예에 따른 처리카드에 구비된 리눅스 커널에서 패킷을 송신하기 위한 흐름도,7 is a flowchart for transmitting a packet in a Linux kernel provided in a processing card according to an embodiment of the present invention;

도 8은 본 발명의 실시 예에 따른 처리카드에 구비된 리눅스 커널에서 패킷을 수신하기 위한 흐름도.8 is a flowchart for receiving a packet in a Linux kernel provided in a processing card according to an embodiment of the present invention.

본 발명은 통신 장치에서 패킷을 라우팅(Routing)하기 위한 계층 구조 및 방법 그리고 그 시스템에 관한 것으로서, 특히, 통신 장치의 내부 라우팅을 위한 계층구조 및 방법 그리고 그 시스템에 관한 것이다. 일반적인 통신 시스템에서의 라우팅은 크게 인터넷 프로토콜 망을 통해 외부의 호스트와 통신하는 외부 라우팅(External routing)과 인터넷 프로토콜 망을 경유하지 않고 통신 장치 내부로 패킷을 라우팅하는 내부 라우팅(Internal routing)으로 나뉠 수 있다.The present invention relates to a hierarchy and method and system for routing packets in a communication device, and more particularly, to a hierarchy and method and a system for internal routing of a communication device. Routing in a general communication system can be largely divided into an external routing that communicates with an external host through an Internet protocol network and an internal routing that routes a packet into a communication device without passing through an Internet protocol network. have.

일반적인 통신 장치에서는 패킷을 송수신하기 위해 사용자 프로그램에서 생성한 데이터에 통신 프로토콜 헤더를 첨부하여 송신한다. 일반적인 통신 프로토콜 헤더는 인터넷 프로토콜(Internet Protocol : 이하 IP라 함)과 TCP/UDP(Transmission Control Protocol)/(User Datagram Protocol) 및 이더넷(Ethernet)헤더를 예를 들 수 있다.In a general communication apparatus, a communication protocol header is attached to data generated by a user program to transmit and receive a packet. Common communication protocol headers include Internet Protocol (hereinafter referred to as IP), TCP / UDP (Transmission Control Protocol) / (User Datagram Protocol), and Ethernet (Ethernet) headers.

개방형 상호 접속 시스템(Open Systems Interconnection : OSI) 7 계층(Layer)에서 상위 계층인 응용 프로그램(Application)은 송신할 데이터를 생성하여 하위 계층으로 전달하며, 이러한 과정은 운영 체제(Operation System : OS)에 따라 다르게 동작된다.Open Systems Interconnection (OSI) In the seventh layer, the application, the upper layer, generates data for transmission and passes it to the lower layer. This process is transmitted to the operating system (OS). It works differently.

운영 체제는 운영 컴퓨터 또는 장치를 사용 가능하게 만드는 하나 이상의 컴퓨터 프로그램이다. DOS, Windows, Mac, Unix 및 Palm 은 이러한 운영 체제의 한 종류이다.An operating system is one or more computer programs that make an operating computer or device available. DOS, Windows, Mac, Unix, and Palm are one of these operating systems.

본 발명에서는 그러한 운영 체제 중 리눅스(Linux)를 예를 들어서 설명하기로 하겠다. 리눅스는 유닉스(Unix) 운영 체제 계열의 한 종류이며, 퍼스널 컴퓨터를 포함한 각종 컴퓨터 플랫폼(platform)상에서 수행될 수 있다. 리눅스는 유닉스를 무료로, 개방형으로 구현한 것이다. 특히 리눅스 커널(Kernel)의 소스 코드는 일반에게 공개되어 있으며, 그에 따라 리눅스 커널이 점점 향상되고 수정되어지고 있다. In the present invention will be described by taking the Linux (Linux) of such an operating system as an example. Linux is a family of Unix operating systems and can run on a variety of computer platforms, including personal computers. Linux is a free, open implementation of Unix. In particular, the source code of the Linux kernel (Kernel) is open to the public, and the Linux kernel is being improved and modified accordingly.

일반적으로 리눅스를 운영체제로 사용하는 통신 장치에서 패킷을 송신하기 위해서는 최상위 계층인 사용자 프로그램에서 송신하기 위한 실제 데이터를 생성하여 하위의 통신 프로토콜 스택으로 전달하게 되며, 이에 하위의 계층에서는 해당되는 통신 프로토콜 헤더를 붙이게 된다.In general, in order to transmit a packet in a communication device using Linux as an operating system, actual data for transmission from a user program, which is a top layer, is generated and transferred to a lower communication protocol stack. Will be attached.

도 1은 일반적인 리눅스 커널에서 생성하는 프로토콜 헤더를 도시하였으며, 도 2는 상기 도 1의 헤더를 생성하는 통신 프로토콜 계층을 도시한 것이다. 페이로드(payload)(100)는 사용자 프로그램(200)이 생성한 실제 데이터이며, TCP/UDP 헤더(102)는 TCP/UDP 계층(202)에서 TCP/UDP 통신을 하기 위해 상기 데이터 앞에 붙는 헤더이다. IP헤더(104)는 IP 계층(204)에서 IP 통신을 하기 위해 상기 TCP/UDP 헤더 앞에 붙는 헤더이며, 이더넷 헤더(106)는 이더넷(MAC) 계층에서 생성한 헤더 이다.FIG. 1 illustrates a protocol header generated by a general Linux kernel, and FIG. 2 illustrates a communication protocol layer generating the header of FIG. The payload 100 is the actual data generated by the user program 200, and the TCP / UDP header 102 is the header that precedes the data for TCP / UDP communication in the TCP / UDP layer 202. . The IP header 104 is a header attached to the TCP / UDP header for IP communication in the IP layer 204, and the Ethernet header 106 is a header generated in the Ethernet (MAC) layer.

그러나 이러한 헤더는 일반적으로 IP 네트워크를 통해 외부의 호스트로 전달하기 위해 사용되며, 네트워크 프로세서는 송신할 패킷의 헤더 정보에 근거하여 통신 장치의 내부로 라우팅 할 것인지 아니면 외부로 라우팅 할 것인지에 대한 결정을 해야한다. 하지만, 이때 상기 네트워크 프로세서가 모든 헤더를 일일이 참조하여 그에 대한 내부 또는 외부 라우팅을 실시하는 것은 네트워크 프로세서의 부하를 증가시키는 문제점이 있다.However, these headers are typically used to forward to an external host over an IP network, and the network processor must decide whether to route internally or externally based on the header information of the outgoing packet. do. However, at this time, if the network processor refers to all headers and performs internal or external routing thereof, there is a problem of increasing the load on the network processor.

그러한, 통신 장치 내부의 IPC(Inter Processor Communications) 경로 상에 네트워크 프로세서(Network Processor)가 있는 경우, 패킷의 흐름에 대해서 네트워크 프로세서가 능동적으로 관여할 수 있다. 능동적으로 관여한다는 의미는 해당 패킷의 헤더 내용에 따라서 패킷의 라우팅에 관련된 흐름을 제어할 수 있다는 의미이다. 하지만, 이때 상기 네트워크 프로세서가 모든 헤더를 일일이 참조하여 그에 대한 내부 또는 외부 라우팅을 실시하는 것은 네트워크 프로세서의 부하를 증가시키는 문제점이 있다.Such a network processor may actively participate in the flow of packets when there is a network processor on an Inter Processor Communications (IPC) path inside the communication device. Actively engaged means that the flow related to the routing of the packet can be controlled according to the header content of the packet. However, at this time, if the network processor refers to all headers and performs internal or external routing thereof, there is a problem of increasing the load on the network processor.

따라서, 본 발명의 목적은, 통신 장치내의 내부 라우팅 시 네트워크 프로세서의 부하를 경감시키는 계층 및 방법을 제공함에 있다. It is therefore an object of the present invention to provide a layer and a method for reducing the load on a network processor during internal routing in a communication device.

본 발명의 다른 목적은, 통신 장치내의 내부 라우팅 시 패킷 라우팅 처리 속도를 증가시키는 계층 및 방법을 제공함에 있다. Another object of the present invention is to provide a layer and a method for increasing the packet routing processing speed during internal routing in a communication device.

상술한 본 발명의 목적들을 달성하기 위한 본 발명의 계층은, 통신 장치 내부에서 패킷을 전송하기 위한 네트워크 계층구조에 있어서, 상기 통신 장치의 내부 라우팅을 수행하기 위한 정보인 인캡슐레이션 헤더(Encapsulation header)를 인터넷 프로토콜 헤더와 이더넷 헤더사이에 구성한다.In order to achieve the above object of the present invention, a layer of the present invention is an encapsulation header which is information for performing internal routing of the communication device in a network hierarchy for transmitting a packet inside a communication device. ) Between the Internet Protocol header and the Ethernet header.

상술한 본 발명의 목적들을 달성하기 위한 본 발명의 방법은, 외부 네트워크로부터 패킷을 수신하는 통신 장치에서 상기 패킷을 처리카드의 사용자 프로그램으로 전송하는 방법에 있어서, 상기 외부 네트워크로부터 수신된 패킷의 인터넷 프로토콜 헤더와 이더넷 헤더 사이에 내부 라우팅을 하기 위해 라인카드에서 인켑슐레이션 헤더를 삽입하여 먹스 카드로 전송하는 제 1과정과, 상기 먹스 카드에서는 상기 인캡슐레이션 헤더 정보를 근거로 해당되는 처리카드로 상기 패킷을 전송하는 제 2과정과, 상기 처리카드에서는 수신된 상기 패킷의 인캡슐레이션 헤더를 삭제하고 정상적인 수신 패킷 처리를 수행하는 제 3과정을 포함한다.A method of the present invention for achieving the above object of the present invention is a method for transmitting the packet to a user program of a processing card in a communication device receiving a packet from an external network, the Internet of packets received from the external network. A first process of inserting an encapsulation header from a line card and transmitting it to a mux card for internal routing between a protocol header and an ethernet header, and from the mux card to a corresponding processing card based on the encapsulation header information; A second process of transmitting the packet, and a third process of deleting the encapsulation header of the received packet from the processing card and performing normal received packet processing.

이하 본 발명의 실시 예를 첨부한 도면을 참조하여 상세히 설명하기로 하겠다. 하기에서 본 발명을 설명함에 있어, 관련된 공지 기능 또는 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략할 것이다.  Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description of the present invention, if it is determined that a detailed description of a related known function or configuration may unnecessarily obscure the subject matter of the present invention, the detailed description thereof will be omitted.

일반적인 리눅스 커널에서 패킷의 송신 과정을 거치면 상기 도 1과 같이 어플리케이션(Application)에서 생성한 데이터를 페이로드(Payload)로 하여 TCP/UDP, IP 및 이더넷(Ethernet) 헤더가 생성되어 MAC(Medium Access Control) 디바이스를 통해서 패킷이 전송된다.When the packet is transmitted in a general Linux kernel, TCP / UDP, IP, and Ethernet headers are generated by using data generated by an application as a payload as shown in FIG. The packet is sent through the device.

따라서 본 발명에서는 시스템 내부의 IPC 경로상에 존재하는 네트워크 프로세서가 라우팅을 위해 필요로 하는 정보를 표준 헤더인 TCP/UDP, IP 혹은 이더넷 헤더가 아닌 특정하게 제안한 인캡슐레이션 헤더를 제안하도록 하겠다.Therefore, the present invention proposes a specially proposed encapsulation header instead of a standard header, TCP / UDP, IP or Ethernet header, which is required for routing by a network processor existing on an IPC path in a system.

시스템의 네트워크 프로세서가 TCP/UDP, IP, 혹은 이더넷 헤더 사이에 네트워크 프로세서가 필요로 하는 정보인 인캡슐레이션 헤더를 부가할 때의 문제점을 계층별로 살펴보면 하기와 같다.The problem when the network processor of the system adds an encapsulation header, which is information required by the network processor, between the TCP / UDP, IP, or Ethernet headers is as follows.

먼저, TCP/UDP 헤더의 상위에 두는 경우를 살펴보면, 인캡슐레이션 헤더가 TCP/UDP 입장에서는 페이로드가 되는데, 리눅스 커널 입장에서는 이 헤더를 채울 방법이 없고, 반드시 사용자 프로그램(application)에서 채워야 한다. 따라서, 이 경우의 문제점은 사용자 프로그램이 시스템 내부의 라우팅에 필요한 정보를 모두 제공해야 한다는 것인데, TCP/UDP/IP 네트워크 상에서 수행되는 일반적인 사용자 프로그램의 경우 통신 상대(상대방 IP 주소와 포트 번호)만을 알면 통신이 가능하다는 면과 비교해 볼 때, 매우 제한적인 조건이 되므로 불합리하다.First, look at the case above the TCP / UDP header. The encapsulation header is the payload for TCP / UDP. There is no way for the Linux kernel to fill this header, but it must be filled in the user application. . Therefore, the problem with this case is that the user program must provide all the information necessary for routing inside the system. For a typical user program running on a TCP / UDP / IP network, the only known communication partner (the other party's IP address and port number) Compared with the possibility of communication, it is unreasonable because it is a very limited condition.

두 번째로 TCP/UDP 헤더와 IP 헤더사이에 인캡슐레이션 헤더를 두는 경우를 살펴보면, IP 헤더가 패킷의 크기가 가변 길이이므로 TCP/UDP 헤더의 위치가 패킷마다 다르다. 따라서 네트워크 프로세서는 IP 헤더의 길이를 알아낸 이후에 그 길이에 따라서 패킷마다 다른 위치의 TCP/UDP 헤더를 살펴보아야 하는데, 이러한 동작은 패킷 포워딩(Packet Forwarding)을 고속으로 수행하는 네트워크 프로세서의 입장에서는 큰 오버헤드가 되고, 패킷 포워딩 성능을 저하시키게 된다.Secondly, the encapsulation header is placed between the TCP / UDP header and the IP header. Since the IP header has a variable size, the location of the TCP / UDP header differs from packet to packet. Therefore, after determining the length of the IP header, the network processor should look at the TCP / UDP header at different positions according to the length of the packet. This operation is performed by a network processor that performs packet forwarding at a high speed. This is a large overhead, and degrades packet forwarding performance.

따라서, 본 발명에서는 도 3a와 같이 IP 헤더(104)와 이더넷 헤더(106)사이에 인켑슐레이션 헤더(300)를 부가하는 것을 제안한다. 도 3a는 본 발명의 실시 예에 따라 특정 시스템 내부에서의 내부 라우팅(Internal Routing)을 수행하기 위해서 필요로 하는 정보인 인캡슐레이션 헤더(300)가 삽입된 프로토콜 구조를 도시한 것이다. 본 발명에서는 이더넷 프레임 포맷이라는 명칭으로 사용되기도 한다. 이더넷(Eth) 헤더(106)와 IP 헤더(104)사이의 위치에 인켑슐레이션 헤더(300)를 두게 되면, 기존의 TCP/UDP/IP 헤더를 아무 변경 없이 사용할 수 있게 되므로, 사용자 프로그램은 패킷을 수신할 상대를 확인하는 목적지 IP 주소와 포트 번호만을 이용해서 통신할 수 있다. 그리고, 네트워크 프로세서는 가변 헤더인 IP 헤더(104) 하위에 위치하는 고정 위치/고정 크기의 헤더만을 이용하여 라우팅을 수행할 수 있으므로 패킷 포워딩 속도를 향상시킬 수 있다. 여기서 상기 인캡슐레이션 헤더(300)는 네트워크 프로세서가 내부 라우팅을 수행하기 위한 특정 정보이며, 각 통신 장치내부에서만 필요한 정보이므로, IP 네트워크를 통해 외부로 라우팅 되는 패킷은 상기 인캡슐레이션 헤더(300)가 필요 없게 된다.Accordingly, the present invention proposes to add the insulation header 300 between the IP header 104 and the Ethernet header 106 as shown in FIG. 3A. 3A illustrates a protocol structure in which an encapsulation header 300 is inserted, which is information required to perform internal routing within a specific system according to an embodiment of the present invention. In the present invention, it may be used as an Ethernet frame format. By placing the insulation header 300 at a location between the Ethernet (Eth) header 106 and the IP header 104, an existing TCP / UDP / IP header can be used without any changes, so that the user program can You can communicate using only the destination IP address and port number to identify the recipient. In addition, since the network processor may perform routing using only a fixed position / fixed size header positioned under the IP header 104 that is a variable header, the network processor may improve packet forwarding speed. In this case, the encapsulation header 300 is specific information for the network processor to perform internal routing, and is required only in each communication device. Therefore, a packet routed to the outside through an IP network is encapsulated header 300. There is no need.

도 3b는 본 발명의 실시 예에 따른 상기 인캡슐레이션 헤더 포맷을 도시한 것이며, 상기 도 3b에 도시된 상기 인캡슐레이션 헤더의 각 필드 이름과 그 설명은 하기의 <표 1>에 설명되어 있다.FIG. 3B illustrates the encapsulation header format according to an embodiment of the present invention. Each field name and description of the encapsulation header shown in FIG. 3B are described in Table 1 below. .

필드 이름  Field name 설명 Explanation Ver.Ver. 인캡슐레이션 헤더 버전 Encapsulation Header Version Type Type 인캡슐레이션 해더 상위 프로토콜 타입(예, IPv4, IPv6, ARP, etc) Encapsulation header higher protocol type (eg IPv4, IPv6, ARP, etc) Flag Flag loopback/이중화/내부-외부 지시 라우팅 지시 loopback / redundancy / internal-external indication routing indication Switching ID Switching ID 스위칭 카드를 지날 때의 스위칭 카드의 출력 포트 정보 Output port information of the switching card when passing through the switching card Dest.(Src.) Shelf Dest. (Src.) Shelf 목적지(송신지) 네트워크 프로세서가 위치한 shelf번호 Destination (Send To) shelf number where the network processor is located Dest.(Src.) Slot Dest. (Src.) Slot 목적지(송신지) 네트워크 프로세서가 위치한 슬롯번호 Destination Slot number where the network processor is located Dest.(Src.) Proc. Dest. (Src.) Proc. 목적지(송신지) 네트워크 프로세서의 ID ID of the destination (sender) network processor Dest.(Src.) MAC Dest. (Src.) MAC 목적지(송신지) MAC ID Destination (Sender) MAC ID Next Hop Index Next Hop Index 라인카드에서 패킷이 외부로 나갈 때 MAC(Ethernet) Address를 부가하기 위한 인덱스 Index to add MAC (Ethernet) address when outgoing packet in line card Link Group ID Link Group ID 라인카드의 링크가 이중화 되어있는 경우, 이중화된 링크들을 한꺼번에 가리키는 인덱스 If the links on the line card are redundant, indexes pointing to the duplicated links at once

도 4는 본 발명의 실시 예에 따라 통신 장치 내부에서 인캡슐레이션 헤더(300)를 사용하여 라우팅되는 패킷의 흐름을 살펴보기로 하겠다.4 is a flow chart of a packet routed using an encapsulation header 300 in a communication device according to an embodiment of the present invention.

본 발명에서 통신 장치라 함은, 라우터 또는 스위칭 장치를 의미하며, IP 네트워크(402a, 402b)에 연결된 호스트(404a, 404b)는 이동 통신망에서의 기지국과 같은 장비를 의미한다. 또한, 본 발명에서 언급하는 통신 장치는 상기 IP 네트워크(402a, 402b)와 물리적으로 연결되어 외부 네트워크와 패킷을 송수신하는 라인카드(Line Card)(406a, 406b)들에는 각각 네트워크 프로세서들(408a, 408b)이 구비되어 있다. 본 발명의 실시 예에서는 두 개의 라인카드만을 도시하였지만, 실제 통신 장치에는 다수 개의 라인카드가 구비되어 있다. 스위칭 카드(410)는 상기 라인카드들에서 수신된 패킷을 스위칭하는 역할을 수행하며, 반대로 먹스(Mux) 카드(412)에서 수신된 패킷을 해당되는 라인 카드로 스위칭 하는 역할을 수행하기도 한다.In the present invention, the communication device means a router or a switching device, and the hosts 404a and 404b connected to the IP networks 402a and 402b refer to equipment such as a base station in a mobile communication network. In addition, the communication apparatus referred to in the present invention is connected to the IP network 402a, 402b and is connected to the line cards 406a, 406b that transmit and receive packets to and from the external network, respectively. 408b). Although only two line cards are shown in the embodiment of the present invention, a plurality of line cards are provided in the actual communication device. The switching card 410 serves to switch the packets received from the line cards, and conversely, to switch the packets received from the mux card 412 to the corresponding line card.

본 발명의 실시 예에서는 도시하지 않았지만, 실제 구현된 통신 장치에서는 상기 스위칭 카드(410)와 네트워크 프로세서(NP)들이 실장된 라인카드들(406a, 406b)과 처리카드들(414, 416, 418)은 각각 하나의 보드로 구성되어 슬롯(Slot)형태로 쉘프(Shelf)에 실장되게 된다.Although not shown in the embodiment of the present invention, in the actual communication device, the line cards 406a and 406b and the processing cards 414, 416, and 418 in which the switching card 410 and the network processors NP are mounted are mounted. Each is composed of one board and is mounted on shelf in slot form.

먹스 카드(412)는 상기 스위칭 카드(410)에 의해 수신된 패킷을 해당되는 각각의 처리 카드(Processing card)(414, 416, 418)들에게 분산하는 역할을 수행하며, 반대로 처리 카드(414, 416, 418)들에서 수신된 패킷을 어느 라인카드의 어느 링크로 출력할지를 결정하는 출력 경로를 결정하여 스위칭 카드(410)에게 알려주는 역할을 수행한다. 상기 먹스 카드(312)는 내부에 이더넷 스위치(412a)와 네트워크 프로세서 3(412b)를 구비하고 있으며, 상기에서 언급한 바와 같이 패킷의 출력 경로를 결정하는 것은 네트워크 프로세서3(412b)에서 수행하며, 각각의 처리 카드 및 상기 통신 장치의 내부 라우팅은 이더넷 스위치(412a)에서 하게 된다. 도 4에서 상기 처리카드들도 세 개만 도시되어 있지만, 실제로는 다수개의 처리카드들이 존재하게 된다.The mux card 412 distributes packets received by the switching card 410 to respective processing cards 414, 416, and 418, and vice versa. It determines the output path for determining which link of which line card to receive the packet received at 416, 418 to inform the switching card 410. The MUX card 312 has an Ethernet switch 412a and a network processor 3 (412b) therein, and as mentioned above, determining the output path of the packet is performed by the network processor 3 (412b). Internal routing of each processing card and communication device is done at Ethernet switch 412a. Although only three processing cards are shown in FIG. 4, a plurality of processing cards are actually present.

상기 도 4에 도시된 통신 장치(400)에 구비된 상기 처리카드(414, 416, 418)들은 상기 호스트(404a, 404b)들이 요청한 호 설정에 관련된 역할을 수행하기도 한다. 또한, 각 처리카드(414, 416, 418)들에는 운영체제가 구비되어 있으며, 본 발명의 실시 예에서는 리눅스를 그 예로 들어 설명하기로 하겠다. 상기 처리카드들(414, 416, 418)들에는 각각 중앙처리장치(414a, 416a, 418a)들이 구비되어 있으며, 각 중앙처리장치들(414a, 416a, 418a)은 통신 장치가 시동될 시에 해당 운영체제를 로딩하게 되는데, 본 발명의 실시 예에서는 하드웨어 관점이 아닌 통신 프로토콜 계층관점에서 설명하기로 하겠다. 또한, 각각의 처리카드들(414, 416, 418)에는 데이터 베이스(414b, 416a, 418b)들이 구비되어 있는데, 이는 본 발명의 실시 예에 따라 라우팅 테이블이 저장되어 있다.The processing cards 414, 416, and 418 provided in the communication device 400 shown in FIG. 4 also play a role related to call setup requested by the hosts 404a and 404b. In addition, each processing card (414, 416, 418) is provided with an operating system, in the embodiment of the present invention will be described using Linux as an example. The processing cards 414, 416, and 418 are provided with central processing units 414a, 416a, and 418a, respectively, and each of the central processing units 414a, 416a, and 418a corresponds to when the communication device is started. The operating system is loaded, but embodiments of the present invention will be described in terms of communication protocol layers, not hardware perspectives. In addition, each of the processing cards 414, 416, 418 is provided with a database (414b, 416a, 418b), which is stored in the routing table according to an embodiment of the present invention.

본 발명에서는 상기 각 처리 카드(414, 416, 418)들의 리눅스 커널에서 내부 라우팅 헤더인 인켑슐레이션 헤더(Encapsulation Header : EH)(300)를 생성하고 삭제한다. 리눅스 커널에서부터 물리계층을 통해 외부로 전송되는 패킷에 대해서는 IP 헤더(104)와 이더넷 헤더(106)사이의 고정된 위치에 16바이트 고정 크기의 인캡슐레이션 헤더(300)를 생성하는 모듈을 구비하였다. 그리고 물리계층을 통해 외부로부터 수신된 패킷에 대해서는 송신 측에서 부가한 인캡슐레이션 헤더(300)를 삭제하는 루틴을 리눅스 커널내부에 구현하였다. 이렇게 함으로써 사용자 프로그램은 인캡슐레이션 헤더(300)의 존재 여부에 무관하게 동작할 수 있으며, 네트워크 프로세서에게는 빠른 포워딩 성능을 보장할 수 있다.In the present invention, an encapsulation header (EH) 300, which is an internal routing header, is generated and deleted in the Linux kernel of the processing cards 414, 416, and 418. For the packet transmitted from the Linux kernel to the outside through the physical layer, a module for generating a 16-byte fixed size encapsulation header 300 at a fixed position between the IP header 104 and the Ethernet header 106 is provided. . In addition, a routine for deleting the encapsulation header 300 added by the sender for packets received from the outside through the physical layer is implemented in the Linux kernel. By doing so, the user program can operate regardless of the presence of the encapsulation header 300, and can guarantee fast forwarding performance to the network processor.

도 5는 본 발명의 실시 예에 따라 상기 도 4의 제 1경로(420) 상의 통신 프로토콜 스택을 도시화한 것이다. FIG. 5 illustrates a communication protocol stack on the first path 420 of FIG. 4 according to an embodiment of the present invention.

외부 네트워크(402b)를 통해 수신된 데이터 패킷의 구조는 종래 통신 프로토콜과 같이 상기 도 1에 도시된 바와 같은 형식을 취하고 있다. 데이터(500)는 송신 측에서 생성한 실제 송신 정보이며, TCP/UDP(502), IP(504)는 상기 도 1에서 설명하한 바와 동일함으로 설명을 생략하기로 하겠다. 이더넷 헤더(Eth)(506)는 해당 라인 카드2(406b)의 실제 물리적 주소를 담고 있으며, 이더넷 헤더(506)는 최종 목적지에 도착하기까지 경유하게 될 장치의 주소를 담고 있으며, 고정적이지 않다. 라인카드2(406b)에서는 상기 네트워크(402b)에서 수신된 데이터 패킷의 TCP/UDP(502) 계층의 16비트 크기의 UDP정보를 근거로 해당되는 처리카드2(416)의 포트 번호를 확인하여 EH(508)를 만들어 IP 헤더(504)와 이더넷 헤더(510) 사이에 첨부한다. 이때 상기 라인카드 2(406b)에서는 먹스카드(412)의 물리적 주소를 이더넷 헤더(510)로 설정하게 된다. 먹스카드(412)에서는 상기 라인카드2(406b)가 생성한 EH(508)을 근거로 해당되는 처리카드의 이더넷 헤더를 생성하게 되는데, 본 발명의 실시 예에서는 처리카드2(416)가 목적지이므로, 처리카드2(416)의 물리적 주소를 이더넷 헤더(512)를 생성하여 처리카드2(416)로 전송하게 된다. 그러면, 처리카드 2(416)에서는 수신된 패킷의 이더넷 헤더(512)를 보고 자신에게 제대로 수신된 패킷임을 인지하면, 리눅스 커널에서 정상적인 패킷 수신이 이루어지도록 netif_rx() 커널 함수를 호출한다. 상기 netif-rx() 커널 함수는 상기 EH(508)를 근거로 이더넷 헤더(512)의 타입 필드(도시되지 않음)를 복원한 후 EH(514)를 제거한다. 그 이유는 인캡슐레이션 헤더(300) 내부에 이더넷 헤더의 타입(Type) 필드 값이 저장되어 있어, 상기 타입 필드 값을 원래의 이더넷 타입 값으로 치환해야만 본 발명의 실시 예에 따라 인캡슐레이션 헤더(300)가 제거되고 난 이후의 프레임 포맷이 인캡슐레이션 헤더가 삽입되기 이전의 프레임 포맷과 동일해 질 수 있기 때문이다. The structure of the data packet received via the external network 402b takes the form as shown in FIG. 1 above, like the conventional communication protocol. The data 500 is actual transmission information generated by the transmitting side, and the description thereof will be omitted since the TCP / UDP 502 and the IP 504 are the same as those described with reference to FIG. 1. The Ethernet header (Eth) 506 contains the actual physical address of the line card 2 406b, and the Ethernet header 506 contains the address of the device that will be routed to its final destination and is not fixed. Line card 2 406b checks the port number of processing card 2 416 based on the 16-bit UDP information of the TCP / UDP 502 layer of the data packet received from network 402b. 508 is created and attached between the IP header 504 and the Ethernet header 510. In this case, the line card 2 406b sets the physical address of the mux card 412 to the Ethernet header 510. The mux card 412 generates the Ethernet header of the processing card based on the EH 508 generated by the line card 2 406b. In the embodiment of the present invention, the processing card 2 416 is a destination. The physical address of the processing card 2 416 is generated by the Ethernet header 512 and transmitted to the processing card 2 416. Then, when processing card 2 416 sees the Ethernet header 512 of the received packet and recognizes that the packet is properly received, the Linux kernel calls the netif_rx () kernel function so that normal packet reception is performed. The netif-rx () kernel function removes the EH 514 after restoring the type field (not shown) of the Ethernet header 512 based on the EH 508. The reason is that the type field value of the Ethernet header is stored in the encapsulation header 300. Therefore, the encapsulation header according to an embodiment of the present invention should be replaced with the original Ethernet type value. This is because the frame format after the 300 is removed may be the same as the frame format before the encapsulation header is inserted.

지금까지는 외부 네트워크 망을 통해 수신되는 패킷의 내부 라우팅을 설명하였는데, 그 반대의 경우인 처리카드에서 생성한 데이터를 라우팅 하기 위한 방법을 설명하기로 하겠다. 이의 경우도 도 4를 참조하여 설명하기로 하겠다. 상기 도 4의 제 2경로(420)가 통신 장치(400)의 처리카드 1(414)에서 생성된 데이터의 외부 라우팅 경로이다. 상기 처리카드1 (414)의 리눅스 커널에서는 사용자 프로그램이 생성한 패킷을 송신하기 위해 본 발명의 실시 예에 따라 IP 헤더와 이더넷 헤더사이에 EH를 삽입하게 되는데, 먼저, 본 발명의 실시 예에서는 통신 장치(400) 내부 프로세서간 IPC를 위한 경우와, 통신 장치(400) 내부 프로세서와 네트워크 망을 통해 외부 프로세서간의 IPC를 위한 인터페이스 이렇게 두 개를 구비한다.Up to now, the internal routing of packets received through an external network has been described. On the contrary, a method for routing data generated from a processing card will be described. This case will also be described with reference to FIG. 4. The second path 420 of FIG. 4 is an external routing path of data generated by the processing card 1 414 of the communication device 400. In the Linux kernel of the processing card 1 414, an EH is inserted between an IP header and an Ethernet header according to an embodiment of the present invention to transmit a packet generated by a user program. The apparatus 400 includes two interfaces for IPC between the internal processors and an interface for the IPC between the internal processor and the external processor through the network.

만일 내부 프로세서간 IPC를 위한 경우라면, 이더넷 스위치(412a)에서 상기 처리카드 1(414)의 리눅스 커널이 생성한 이더넷 헤더(106)의 정보를 근거로 목적지 처리카드로 바로 송신을 하게 된다. 반면 내부 프로세서와 외부 프로세서간의 IPC인 경우가 상기 제 2경로(422)인데, 이 경우에는 상기 처리카드 1(414)의 리눅스 커널에서 생성된 EH의 정보를 근거로 스위칭카드(410)에서 라인카드1(402a)로 출력하여 외부 네트워크로 전송되게 된다. 이때 상기 처리카드 1(414)의 리눅스 커널에서는 라우팅 테이블이 저장된 데이터 베이스(414b)를 근거로 EH를 만들게 된다.If the internal processor is for IPC, the Ethernet switch 412a directly transmits the information to the destination processing card based on the information of the Ethernet header 106 generated by the Linux kernel of the processing card 1 (414). On the other hand, the IPC between the internal processor and the external processor is the second path 422. In this case, the line card in the switching card 410 is based on the information of the EH generated in the Linux kernel of the processing card 1 (414). Output to 1 (402a) is to be transmitted to the external network. At this time, the Linux kernel of the processing card 1 414 creates an EH based on the database 414b in which the routing table is stored.

도 6은 본 발명의 실시 예에 따라 각각의 처리카드들(414, 416, 418)에 구비된 리눅스 커널의 통신 프로토콜 스택 구조이다. 사용자 프로그램(600)은 실제 전송할 데이터를 생성하는 부분이며, 소켓(Socket)(602)은 일반적인 리눅스 프로그래밍에서 데이터를 송신하기 위해 생성하는 부분이다. 상기 소켓(602)를 통해 상기 사용자 프로그램(600)에서 생성된 데이터는 TCP/UDP 계층(604)과 IP 계층(606)을 통과하면서, 상기 프로토콜 스택에 해당되는 헤더가 첨부되며, 본 발명의 실시 예에서 첨부된 EH 계층(610)을 거치게 된다. 이때 상기 EH 계층(610)에서는 상기 사용자 프로그램(600)이 송신할 데이터를 생성하면서, 특정 정보(전달한 내부 프로세서간 IPC 인지 내부와 외부 프로세서간의 IPC인지 또는 어느 라인카드의 어느 링크로 전달할 것인지에 대한 정보들)를 넘겨받아 EH 헤더를 작성하게 된다. 그 후 이더넷 계층(610)에서는 상위 계층에서 생성된 패킷을 전송할 장치의 물리적인 주소(MAC 주소)를 생성하고, 최하위 계층인 물리 계층(612)로 전송하여 외부로 전달하게 된다. 지금까지는 패킷을 송신하는 경우에 대해서만 살펴보았지만, 하기에서 패킷을 수신할 시의 과정에 대해서도 살펴보기로 하겠다.6 is a communication protocol stack structure of the Linux kernel provided in each of the processing cards 414, 416, and 418 according to an embodiment of the present invention. The user program 600 is a part for generating data to actually transmit, and the socket 602 is a part for generating data in general Linux programming. The data generated by the user program 600 through the socket 602 passes through the TCP / UDP layer 604 and the IP layer 606, and is attached with a header corresponding to the protocol stack. In the example, it goes through the attached EH layer 610. In this case, the EH layer 610 generates data to be transmitted by the user program 600, while specifying specific information (IPC between internal processors to be transmitted, IPC between internal and external processors, or to which link of which line card to transfer). This file takes the form of an EH header. Thereafter, the Ethernet layer 610 generates a physical address (MAC address) of the device to transmit the packet generated in the upper layer, and transmits to the physical layer 612, which is the lowest layer, to be transmitted to the outside. So far, only the case of transmitting a packet has been described, but the process of receiving the packet will be described below.

만일, 최하위 계층인 물리계층(612)으로 패킷이 수신된다면, 이더넷 계층(6120)에서 이더넷 헤더를 제거하고, 이 패킷이 EH를 가지는 패킷임을 알게되며, EH 계층(608)으로 전달된다. 그리고, EH 계층(608)에서는 수신된 패킷의 EH를 보고 원래의 이더넷 헤더의 타입 필드를 복원한다. 그 이유는 인캡슐레이션 헤더(EH)가 제거되고 난 이후에 원래의 이더넷 프레임 포맷을 완전히 복원해야 하기 때문이다. 송신할 때에 인캡슐레이션 헤더를 부가하는 과정에서 원래의 이더넷 타입은 인캡슐레이션 헤더에 저장하고 이더넷 타입은 EH_TYPE으로 바뀌게 된다. 정확히는 ETH_P_EH라는 값으로 바뀌게 된다. 따라서, 상기 이더넷 프레임 포맷을 수신할 때에는 EH 계층(608)에서 ETH_P_EH라는 이더넷 타입 필드 값을, 인캡슐레이션 헤더에 저장된 원래의 이더넷 타입으로 복원하는 과정을 거쳐야 한다. 여기서, 상기 ETH_P_EH는 상수 값이고 구체적으로는 16진수 070A라는 값이다.If a packet is received at the physical layer 612, which is the lowest layer, the Ethernet header 6120 is removed from the Ethernet layer, and it is recognized that the packet has an EH, and is forwarded to the EH layer 608. The EH layer 608 then looks at the EH of the received packet and restores the type field of the original Ethernet header. This is because the original Ethernet frame format must be completely restored after the encapsulation header (EH) is removed. In the process of adding the encapsulation header when transmitting, the original Ethernet type is stored in the encapsulation header and the Ethernet type is changed to EH_TYPE. The exact value is changed to ETH_P_EH. Therefore, when receiving the Ethernet frame format, the EH layer 608 must go through the process of restoring the Ethernet type field value of ETH_P_EH to the original Ethernet type stored in the encapsulation header. Here, ETH_P_EH is a constant value, specifically, a value of hexadecimal 070A.

상기 복원된 이더넷 헤더의 상위 패킷 타입(예를 들어, ETH_P_IP 혹은 ETH_P_IPV6)정보를 근거로 ARP(Address Resolution Protocol) 또는 IP 계층이나 EH 계층에서 처리해야하는지 여부를 검사한다. 여기서, 상기 ETH_P_IP 혹은 ETH_P_IPV6 값들은 리눅스에서 사용하는 단순한 상수 값이며 이더넷 헤더의 타입 필드에 포함될 수 있다. 용도는 이더넷 상위의 계층이 어떤 프로토콜인지를 표시하기 위해서 리눅스에서 사용한다. 예를 들어, 이더넷 헤더의 타입 필드가 ETH_P_IP(16진수 0800)는 이더넷 다음에 IP가 처리되어야 한다는 의미-IP 처리 루틴이 호출됨-이고, ETH_P_ARP(16진수 0806)는 이더넷 다음에 ARP가 처리되어야 한다는 의미이다. 즉, ARP 처리 루틴이 호출된다. 본 발명에서는 인캡슐레이션 헤더를 부가할 때 이 값들을 ETH_P_EH로 변화시키는데, 이는 이더넷 다음에 인캡슐레이션 헤더가 처리되어야 한다는 것을 의미한다. 즉, 인캡슐레이션 헤더 처리 루틴이 호출되도록 리눅스를 수정한 것이다. 그 후, 인캡슐레이션 헤더 처리 루틴은 인캡슐레이션 헤더를 제거하고 난 이후, 다시 IP나 ARP가 처리되도록 해 주기 위해서 인캡슐레이션 헤더에 저장되어 있는 본래의 이더넷 타입 필드 값을 복원시키게 된다.It is checked whether the ARP (Address Resolution Protocol) or the IP layer or the EH layer should be processed based on the higher packet type (eg, ETH_P_IP or ETH_P_IPV6) information of the restored Ethernet header. Here, the ETH_P_IP or ETH_P_IPV6 values are simple constant values used in Linux and may be included in the type field of the Ethernet header. Usage is used by Linux to indicate which protocol is the upper layer of Ethernet. For example, the type field in the Ethernet header is ETH_P_IP (0800 hexadecimal), which means that the IP should be processed after Ethernet—the IP processing routine is called; I mean. That is, the ARP processing routine is called. In the present invention, when adding an encapsulation header, these values are changed to ETH_P_EH, which means that the encapsulation header must be processed after Ethernet. In other words, Linux has been modified to call the encapsulation header handling routine. The encapsulation header processing routine then removes the encapsulation header and then restores the original Ethernet type field value stored in the encapsulation header to allow the IP or ARP to be processed again.

만일 ARP 나 IP 계층에서 처리해야 한다면, 종래와 같은 방식으로 수신된 패킷을 처리하지만, EH 계층에서 처리해야 한다면, 정상적인 패킷 수신처리가 이루어지도록 netif_rx() 커널 함수를 호출한다. 그 후, EH 계층(608)에서는 상기 이더넷 헤더의 복원된 상위 패킷 타입을 근거로 정상적인 커널의 패킷 수신 경로를 찾는다. 이후, IP 계층(606)과 TCP/UDP 계층(604)과 소켓 계층(602)을 거쳐 처음 송신단의 사용자 프로그램에서 생성된 패킷이 recvmsg(), recv() 혹은 recvfrom() 소켓 시스템 호출(call)을 통해서 그대로 수신단의 사용자 프로그램(600)으로 전송된다.If the ARP or IP layer has to process the packet in the same way as the conventional method, but if the EH layer has to process, the netif_rx () kernel function is called for normal packet reception. The EH layer 608 then finds the packet reception path of the normal kernel based on the recovered higher packet type of the Ethernet header. Then, the packet generated by the user program of the first sender via the IP layer 606, the TCP / UDP layer 604, and the socket layer 602 is recvmsg (), recv () or recvfrom () socket system call. Through it is transmitted to the user program 600 of the receiving end as it is.

도 7은 본 발명의 실시 예에 따른 처리카드에 구비된 리눅스 커널에서 패킷을 송신하기 위한 흐름도이다.7 is a flow chart for transmitting a packet in the Linux kernel provided in the processing card according to an embodiment of the present invention.

700단계에서 사용자 프로그램(600)에서 송신할 데이터를 생성한다. 702단계에서 사용자 프로그램(600)은 sendmsg(), send(), sendto()와 같은 일반적인 리눅스 소켓 시스템(602)을 호출하여, 패킷을 하위 계층으로 전송한다. 이때 사용자 프로그램(600)은 시스템 외부의 프로세서로 상기 데이터를 송신할 경우, 소켓 시스템 호출(602)을 통하여 어떤 라인카드의 어떤 링크를 통해서 외부 네크워크로 패킷을 전송할지 여부를 커널로 넘겨주며, 이러한 정보는 인켑슐레이션 헤더(EH) 계층(608)으로도 전달된다. 704단계에서 소켓(602) 호출을 통해 TCP/UDP 계층(604)에서 TCP/UDP 헤더가 첨부되는데, 이때 RAW 소켓을 사용할 수도 있다. 그리고, 706단계에서는 IP 계층(606)에서 상기 TCP/UDP 헤더 앞에 IP 헤더가 첨부된다. 708단계에서 EH 계층(608)으로 수신된 패킷에는 상기 IP 계층(606)에서 생성된 IP 헤더의 앞부분에 16바이트 크기의 EH 공간을 마련한다. 710단계에서 EH 계층(608)에서는 전 단계에서 마련된 16바이트 크기의 인캡슐레이션 헤더(EH)공간에 대해서 인캡슐레이션의 각 필드에 라우팅에 필요한 값을 설정하는데, 그 방식은 패킷의 IP목적지 주소에 따라서, 상기 각 처리카드의 데이터 베이스(414b, 416b, 418b)에 저장된 내부 라우팅 테이블을 검색하여 인캡슐레이션 헤더의 모든 필드를 채운다. 그 후 물리 계층(610)의 디바이스 드라이버(Device Driver) 함수를 호출한다. 여기서 상기 내부 라우팅 테이블을 검색하는 키(key)값은 패킷의 목적지 IP 주소가 될 수도 있고, 상기 702단계에서 사용자 프로그램(600)이 커널로 내려준 통신 장치의 외부 인터페이스 링크에 대한 특정 정보가 될 수도 있다. 712단계에서 이더넷(MAC) 계층에서는 리눅스 커널의 ARP에 의해서 인식한 패킷의 목적지의 IP 주소에 대응되는 이더넷 주소를 이용하여 이더넷 헤더를 부가한다. 714단계에서 물리 계층(612)에서는 상기 이더넷 계층(614)에서 생성된 주소를 근거로 패킷을 송신한다.In step 700, the user program 600 generates data to be transmitted. In operation 702, the user program 600 calls general Linux socket systems 602 such as sendmsg (), send (), and sendto () to transmit a packet to a lower layer. In this case, when the user program 600 transmits the data to a processor external to the system, the kernel system 602 transmits the packet to the kernel through a socket system call 602 on which link of which line card to transmit the packet to the external network. The information is also passed to the insulation header (EH) layer 608. In step 704, a TCP / UDP header is attached to the TCP / UDP layer 604 through a socket 602 call, which may use a RAW socket. In step 706, an IP header is attached to the IP layer 606 before the TCP / UDP header. A packet received by the EH layer 608 in step 708 is provided with an EH space having a size of 16 bytes in front of the IP header generated by the IP layer 606. In step 710, the EH layer 608 sets a value required for routing in each field of the encapsulation for the 16-byte encapsulation header (EH) space prepared in the previous step. As a result, the internal routing table stored in the databases 414b, 416b, and 418b of each processing card is searched to fill all fields of the encapsulation header. Thereafter, the device driver function of the physical layer 610 is called. The key value for searching the internal routing table may be a destination IP address of a packet, and may be specific information on an external interface link of a communication device that the user program 600 drops to the kernel in step 702. It may be. In step 712, the Ethernet (MAC) layer adds an Ethernet header using the Ethernet address corresponding to the IP address of the destination of the packet recognized by the Linux ARP. In step 714, the physical layer 612 transmits a packet based on the address generated by the Ethernet layer 614.

도 8은 본 발명의 실시 예에 따른 처리카드에 구비된 리눅스 커널에서 패킷을 수신하기 위한 흐름도이다. 800단계에서 물리 계층(612)에 패킷이 수신되면, 802단계로 진행하여, 이더넷 계층(610)에서 이더넷(Eth) 헤더를 제거한다. 이때 리눅스 커널에서는 이더넷 헤더의 상위 패킷 타입(ETH_P_EH)을 보고 이 패킷이 EH를 갖는 패킷임을 알 수 있다. 그러면, 804단계에서는 EH 계층(608)에서 수신된 패킷의 EH를 근거로 상기 이더넷 헤더의 타입 필드(Type field)를 복원한다. 그 후 806단계에서 상기 EH 계층(608)에서는 상기 EH를 제거하고, 808단계에서 정상적인 패킷 수신 처리가 이루어질 수 있도록 netif_rx() 커널 함수를 호출한다. 810단계에서 EH 계층(608)에서는 복원된 이더넷 헤더의 상위 패킷 타입(예를 들어, ETH_P_IP, ETH_P_IPV6)을 이용해서 정상적인 커널의 패킷 수신 경로를 찾는다. 812단계에서 IP 계층(606)에서는 하위 계층 즉, EH 계층(608)에서 수신된 패킷의 IP 헤더를 제거하며, 또한 ARP 요구 일 경우 해당 ARP 절차를 수행하기도 한다. 814단계에서는 TCP/UDP 계층(604)에서 상기 IP 계층(606)에서 수신된 패킷의 TCP/UDP 헤더를 삭제하고, 소켓 계층(602)으로 전송한다. 이때 생성하는 소켓은 TCP 일 경우에는 IPPROTO_TCP 이며, IP 일 경우에는 IPPROTO_UDP, RAW일 경우에는 IPPROTO_RAW이다. 816단계에서 소켓 계층(602)에서는 recvmsg(), recv() 또는 recvfrom() 소켓 시스템 호출을 통해 그대로 사용자 프로그램(600)으로 전송된다.8 is a flowchart for receiving a packet in the Linux kernel provided in the processing card according to an embodiment of the present invention. When the packet is received at the physical layer 612 in step 800, the flow proceeds to step 802 to remove the Ethernet (Eth) header from the Ethernet layer 610. At this time, the Linux kernel looks at the higher packet type (ETH_P_EH) of the Ethernet header to see that this packet has an EH. Then, in step 804, the type field of the Ethernet header is restored based on the EH of the packet received by the EH layer 608. Thereafter, in step 806, the EH layer 608 removes the EH, and in step 808, the netif_rx () kernel function is called to allow normal packet reception processing. In step 810, the EH layer 608 finds a packet reception path of a normal kernel using higher packet types (eg, ETH_P_IP and ETH_P_IPV6) of the restored Ethernet header. In step 812, the IP layer 606 removes the IP header of the packet received from the lower layer, that is, the EH layer 608, and performs the corresponding ARP procedure in case of an ARP request. In step 814, the TCP / UDP layer 604 deletes the TCP / UDP header of the packet received at the IP layer 606, and transmits it to the socket layer 602. The socket created here is IPPROTO_TCP for TCP, IPPROTO_UDP for IP, and IPPROTO_RAW for RAW. In step 816, the socket layer 602 is transmitted to the user program 600 as it is through a recvmsg (), recv (), or recvfrom () socket system call.

한편 본 발명의 상세한 설명에서는 구체적인 실시 예에 관해 설명하였으나, 본 발명의 범위에서 벗어나지 않는 한도 내에서 여러 가지 변형이 가능함은 물론이다. 그러므로 본 발명의 범위는 설명된 실시 예에 국한되어 정해져서는 안되며 후술하는 특허청구의 범위뿐 아니라 이 특허청구의 범위와 균등한 것들에 의해서 정해져야 한다.Meanwhile, in the detailed description of the present invention, specific embodiments have been described, but various modifications are possible without departing from the scope of the present invention. Therefore, the scope of the present invention should not be limited to the described embodiments, but should be determined not only by the scope of the following claims, but also by the equivalents of the claims.

따라서, 상술한 바와 같이 본 발명은 통신 장치내의 라우팅에 필요한 정보를 운영체제의 커널에서 생성하므로 통신 장치 내부의 네트워크 프로세서의 부담을 경감시켜 네트워크 프로세서의 패킷 포워딩(forwarding) 성능을 높일 수 있다.Therefore, as described above, the present invention generates information necessary for routing in the communication device in the kernel of the operating system, thereby reducing the burden on the network processor inside the communication device and improving the packet forwarding performance of the network processor.

Claims (13)

통신 장치 내부에서 패킷을 전송하기 위한 네트워크 계층구조에 있어서,In a network hierarchy for transmitting a packet inside a communication device, 상기 통신 장치의 내부 라우팅을 수행하기 위한 정보인 인캡슐레이션 헤더(Encapsulation header)를 인터넷 프로토콜 헤더와 이더넷 헤더사이에 구성함을 특징으로 하는 통신 장치 내부 라우팅 계층 구조.And an encapsulation header, which is information for performing internal routing of the communication device, between an internet protocol header and an ethernet header. 제 1항에 있어서, 상기 인캡슐레이션 헤더는,The method of claim 1, wherein the encapsulation header, 상기 인터넷 프로토콜의 하위(앞부분)에 16바이트 크기로 구성됨을 특징으로 하는 통신 장치 내부 라우팅 계층 구조.And a 16-byte size in the lower part of the Internet protocol. 외부 네트워크로부터 패킷을 수신하는 통신 장치에서 상기 패킷을 처리카드의 사용자 프로그램으로 전송하는 방법에 있어서,A communication device for receiving a packet from an external network, the method for transmitting the packet to a user program of a processing card, 상기 외부 네트워크로부터 수신된 패킷의 인터넷 프로토콜 헤더와 이더넷 헤더 사이에 내부 라우팅을 하기 위해 라인카드에서 인켑슐레이션 헤더를 삽입하여 먹스 카드로 전송하는 제 1과정과,A first step of inserting an insulation header in a line card and transmitting it to a mux card for internal routing between an internet protocol header and an ethernet header of a packet received from the external network; 상기 먹스 카드에서는 상기 인캡슐레이션 헤더 정보를 근거로 해당되는 처리카드로 상기 패킷을 전송하는 제 2과정과,In the MUX card, a second process of transmitting the packet to a processing card corresponding to the encapsulation header information; 상기 처리카드에서는 수신된 상기 패킷의 인캡슐레이션 헤더를 삭제하고 정상적인 수신 패킷 처리를 수행하는 제 3과정을 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And a third step of deleting, by the processing card, the encapsulation header of the received packet and performing normal received packet processing. 제 3항에 있어서, 제 1과정은,The method of claim 3, wherein the first process comprises: 상기 외부 네트워크에서 수신된 패킷의 16비트크기의 사용자 데이터그램 프로토콜 헤더에 근거하여 상기 패킷을 수신할 처리카드의 포트 번호를 인캡슐레이션 헤더에 삽입하는 과정을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And inserting a port number of a processing card to receive the packet into an encapsulation header based on a 16-bit user datagram protocol header of the packet received from the external network. Routing method. 제 3항에 있어서, 제 3과정은,The method of claim 3, wherein the third process comprises: 상기 처리카드에서 상기 인캡슐레이션 헤더를 근거로 이더넷 헤더의 타입 필드를 복원하는 과정과,Restoring a type field of an Ethernet header based on the encapsulation header in the processing card; 상기 복원된 타입 필드를 근거로 정상적인 커널의 패킷 수신 경로를 찾는 과정을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And searching for a packet reception path of a normal kernel based on the restored type field. 외부 네트워크에 연결된 네트워크 프로세서와 통신 장치 내부의 네트워크 프로세서로 패킷을 전송하기 위한 통신 장치 내부의 라우팅 방법에 있어서,A routing method inside a communication device for transmitting a packet to a network processor connected to an external network and a network processor inside the communication device, 처리카드의 사용자 프로그램에서 송신할 데이터를 생성하고 리눅스 소켓 시스템을 호출하는 제 1과정과,A first step of generating data to be transmitted from the user card of the processing card and calling the Linux socket system; 상기 데이터를 송신할 통신 프로토콜에 맞게 전송 제어 프로토콜(TCP)/사용자 데이터 그램 프로토콜(UDP) 및 인터넷 프로토콜(IP) 헤더를 첨부하는 제 2과정과,A second step of attaching a transmission control protocol (TCP) / user datagram protocol (UDP) and an internet protocol (IP) header according to a communication protocol to transmit the data; 상기 제 2과정에서 첨부된 인터넷 프로토콜(IP) 헤더 앞에(하위에) 내부 라우팅을 위한 인캡슐레이션 헤더를 첨부하는 제 3과정과,A third step of attaching an encapsulation header for internal routing in front of (below) the internet protocol (IP) header attached in the second step; 목적지의 인터넷 프로토콜 주소에 대응되는 이더넷 주소를 상기 인캡슐레이션 헤더 앞에 첨부하는 제 4과정을 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And a fourth step of attaching an Ethernet address corresponding to an internet protocol address of a destination in front of the encapsulation header. 제 6항에 있어서, 상기 제 1과정은,The method of claim 6, wherein the first process, 상기 사용자 프로그램이 상기 송신할 데이터를 생성할 시 상기 소켓 시스템 호출을 통해 상기 데이터가 전송될 링크 정보를 커널로 전달함을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And when the user program generates the data to be transmitted, transmits link information to the kernel through the socket system call to the kernel. 제 6항에 있어서, 상기 제 3과정은,The method of claim 6, wherein the third process, 상기 인터넷 프로토콜(IP) 헤더 앞(하위) 부분에 상기 16바이트 크기로 상기 인캡슐레이션 헤더를 첨부함을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And attaching the encapsulation header with the 16-byte size in front of (lower) the Internet Protocol (IP) header. 제 8항에 있어서, 상기 인캡슐레이션 헤더는,The method of claim 8, wherein the encapsulation header, 상기 처리카드의 데이터 베이스에 구비된 패킷의 목적지 주소와 일대일 대응되는 정보를 담고 있는 라우팅 테이블을 검색하여 구성됨을 특징으로 하는 통신 장치 내부 라우팅 방법.And retrieving a routing table containing information corresponding to a destination address of a packet provided in a database of the processing card. 외부 네트워크로부터 수신된 패킷을 네트워크 프로세서가 상기 패킷이 전송되어야하는 처리카드의 사용자프로그램에게 상기 패킷(이더넷 프레임)을 송신하기 위해 라우팅을 실시하고, 리눅스 운영체제를 기반으로 하는 상기 처리카드의 리눅스 커널에서 상기 패킷을 처리하기 위한 방법에 있어서,In the Linux kernel of the processing card based on the Linux operating system, the network processor routes the packet received from the external network to send the packet (Ethernet frame) to the user program of the processing card to which the packet should be transmitted. In the method for processing the packet, 상기 수신된 패킷(이더넷 프레임)의 이더넷 헤더를 제거하는 제 1과정과,A first step of removing an Ethernet header of the received packet (Ethernet frame), 인캡슐레이션 헤더 계층에서 상기 인캡슐레이션 헤더를 제거하는 제 2과정과,A second process of removing the encapsulation header from an encapsulation header layer; 상기 인캡슐레이션 헤더계층에서 상기 패킷의 인캡슐레이션 헤더를 근거로 상기 이더넷 헤더의 타입 필드를 복원하는 제 3과정과,Restoring, by the encapsulation header layer, a type field of the Ethernet header based on an encapsulation header of the packet; 상기 복원된 타입 필드를 근거로 정상적인 커널의 패킷 수신 경로를 찾는 제 4과정과,A fourth process of finding a packet reception path of a normal kernel based on the restored type field; 인터넷 프로토콜계층에서는 인터넷 프로토콜 헤더를 제거하는 제 5과정과,The fifth step of removing the internet protocol header from the internet protocol layer; 상기 인터넷 프로토콜 헤더가 제거된 상기 패킷을 상기 사용자 프로그램에게 전달하기 위해 소켓을 생성하는 제 6과정을 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And a sixth step of creating a socket for delivering the packet from which the Internet protocol header has been removed to the user program. 제 10항에 있어서, 상기 제 1 과정은,The method of claim 10, wherein the first process comprises: 상기 리눅스 커널에서 상기 이더넷 헤더의 상위 패킷 타입(ETH_P_EH)을 보고 상기 패킷이 인캡슐레이션 헤더를 갖는 패킷임을 인식하는 과정을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And recognizing, by the Linux kernel, an upper packet type (ETH_P_EH) of the Ethernet header and recognizing that the packet is a packet having an encapsulation header. 제 10항에 있어서, 상기 제 2 과정은,The method of claim 10, wherein the second process, 정상적인 패킷 수신 처리가 이루어질 수 있도록 netif_rx() 커널 함수를 호출하는 과정을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And invoking the netif_rx () kernel function so that normal packet reception processing can be performed. 제 10항에 있어서, 상기 제 6 과정은,The method of claim 10, wherein the sixth process, 소켓 계층에서 소켓 시스템 호출을 통해 사용자 프로그램에게 상기 패킷을 전달하는 과정을 더 포함함을 특징으로 하는 통신 장치 내부 라우팅 방법.And forwarding the packet to a user program via a socket system call at a socket layer.
KR1020050016464A 2005-02-28 2005-02-28 Layer structure and method for internal routing in communication system KR20060095676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020050016464A KR20060095676A (en) 2005-02-28 2005-02-28 Layer structure and method for internal routing in communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020050016464A KR20060095676A (en) 2005-02-28 2005-02-28 Layer structure and method for internal routing in communication system

Publications (1)

Publication Number Publication Date
KR20060095676A true KR20060095676A (en) 2006-09-01

Family

ID=37625246

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020050016464A KR20060095676A (en) 2005-02-28 2005-02-28 Layer structure and method for internal routing in communication system

Country Status (1)

Country Link
KR (1) KR20060095676A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023090482A1 (en) * 2021-11-18 2023-05-25 주식회사 우리넷 Method for transmitting/receiving protocol packet by using linux-based packet processor in distributed packet transport network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023090482A1 (en) * 2021-11-18 2023-05-25 주식회사 우리넷 Method for transmitting/receiving protocol packet by using linux-based packet processor in distributed packet transport network

Similar Documents

Publication Publication Date Title
US6714985B1 (en) Method and apparatus for efficiently reassembling fragments received at an intermediate station in a computer network
US7630368B2 (en) Virtual network interface card loopback fastpath
CN101217493B (en) TCP data package transmission method
US7068656B2 (en) Packet routing apparatus and a method of routing a packet
JP4230663B2 (en) Packet header reduction in wireless communication networks
US7289509B2 (en) Apparatus and method of splitting a data stream over multiple transport control protocol/internet protocol (TCP/IP) connections
EP1565826B1 (en) Network interface and protocol supporting mappings of virtual memory locations at different processing devices
US7984163B2 (en) Method and system for optimizing DNS queries
US20060274787A1 (en) Adaptive cache design for MPT/MTT tables and TCP context
US20090238209A1 (en) Method for transmitting fragmented packets, communication system, and tunnel equipment
US9445384B2 (en) Mobile device to generate multiple maximum transfer units and data transfer method
WO2000054467A1 (en) System and method for distributing packet processing in an internetworking device
US7269661B2 (en) Method using receive and transmit protocol aware logic modules for confirming checksum values stored in network packet
CN107787570A (en) Light weight transportation protocol
CN108076066B (en) Method and device for protecting GRE (generic routing encapsulation) message
CN107888710A (en) A kind of message forwarding method and device
CN116055586B (en) Fragment message matching method, router and storage medium
US20100238930A1 (en) Router and method of forwarding ipv6 packets
US20060187922A1 (en) Packet communication device
KR20060095676A (en) Layer structure and method for internal routing in communication system
US20070147376A1 (en) Router-assisted DDoS protection by tunneling replicas
CN117376233A (en) Data processing method, device and system
CN113709016B (en) Communication system, communication method, communication apparatus, communication device, and storage medium
CN111314447B (en) Proxy server and method for processing access request thereof
JPWO2005050935A1 (en) Intrusion detection device and method

Legal Events

Date Code Title Description
WITN Withdrawal due to no request for examination