KR100462478B1 - Apparatus of transmitting and receiving variable length packet, and method thereof - Google Patents

Apparatus of transmitting and receiving variable length packet, and method thereof Download PDF

Info

Publication number
KR100462478B1
KR100462478B1 KR10-2002-0078148A KR20020078148A KR100462478B1 KR 100462478 B1 KR100462478 B1 KR 100462478B1 KR 20020078148 A KR20020078148 A KR 20020078148A KR 100462478 B1 KR100462478 B1 KR 100462478B1
Authority
KR
South Korea
Prior art keywords
packet
transmission
data
storage unit
received
Prior art date
Application number
KR10-2002-0078148A
Other languages
Korean (ko)
Other versions
KR20040050338A (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 KR10-2002-0078148A priority Critical patent/KR100462478B1/en
Publication of KR20040050338A publication Critical patent/KR20040050338A/en
Application granted granted Critical
Publication of KR100462478B1 publication Critical patent/KR100462478B1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

본 발명은 이더넷(Ethernet) 제어기와 같은 하드웨어 장치를 통하여 CPU가 기존의 DMA(Direct Memory Access)를 사용하지 않고 가변길이의 패킷을 간단하게 네트워크로 송수신하는 인터페이스 장치 및 방법에 관한 것이다. 가변길이의 패킷 송수신 장치는, 송신할 가변길이의 패킷을 저장하는 송신 데이터 저장부; 상기 송신할 패킷의 길이정보를 저장하는 송신 데이터 길이 저장부; 네트워크를 통해 송신할 패킷의 수를 카운트하는 송신 패킷 카운터를 저장하는 송신 패킷 카운터 저장부; 상기 송신 데이터 길이 저장부의 길이정보에 따라서 상기 송신 패킷을 읽어 네트워크로 송신하는 데이터 송신부; 네트워크를 통해 전송되는 가변길이의 패킷을 수신하는 데이터 수신부; 상기 수신된 패킷을 저장하는 수신 데이터 저장부; 상기 수신된 패킷의 길이정보를 저장하는 수신 데이터 길이 저장부; 및 상기 네트워크로부터 수신된 데이터 패킷의 수를 카운트하는 수신 패킷 카운터를 저장하는 수신 패킷 카운터 저장부를 구비한다.The present invention relates to an interface device and method for a CPU to easily transmit and receive a variable length packet to a network without using a conventional direct memory access (DMA) through a hardware device such as an Ethernet controller. A variable length packet transmission / reception apparatus includes: a transmission data storage unit for storing a variable length packet to be transmitted; A transmission data length storage unit for storing length information of the packet to be transmitted; A transmission packet counter storage unit for storing a transmission packet counter for counting the number of packets to be transmitted through the network; A data transmitter which reads the transmission packet and transmits the transmission packet to a network according to length information of the transmission data length storage unit; A data receiver for receiving a variable length packet transmitted through a network; A reception data storage unit for storing the received packet; A reception data length storage unit for storing length information of the received packet; And a reception packet counter storage unit for storing a reception packet counter for counting the number of data packets received from the network.

Description

가변길이의 패킷 송수신 장치 및 방법 {Apparatus of transmitting and receiving variable length packet, and method thereof }Apparatus of transmitting and receiving variable length packet, and method

본 발명은 이더넷(Ethernet) 제어기와 같은 하드웨어 장치를 통하여 CPU가 기존의 DMA(Direct Memory Access)를 사용하지 않고 가변길이의 패킷을 간단하게 네트워크로 송수신하는 인터페이스 장치 및 방법에 관한 것이다.The present invention relates to an interface device and method for a CPU to easily transmit and receive a variable length packet to a network without using a conventional direct memory access (DMA) through a hardware device such as an Ethernet controller.

종래에는 CPU가 ATM(Asynchronous Transfer Mode) 셀을 송신하거나 수신할 때는, 송신 FIFO(First-In, First-Out)와 수신 FIFO를 제어하는 FIFO 제어부가 송신 FIFO 및 수신 FIFO에 ATM 셀이 입력될 때마다 그 FIFO에 저장되어 있는 데이터양을 의미하는 높이 카운터를 순차적으로 하나씩 증가시키고, ATM 셀이 출력될 때는 높이 카운터를 순차적으로 감소시키고, 이 높이 카운터 정보를 FIFO 건너편에 있는 송신회로와 CPU에 전달함으로써, 송신할 때 FIFO에서 데이터를 읽어 전송하는 송신회로가, 또는 수신할 때 CPU가 FIFO에서 읽어낼 데이터의 갯수를 알 수 있도록 하였다.Conventionally, when a CPU transmits or receives an ATM (Asynchronous Transfer Mode) cell, when an ATM cell is input to a transmit FIFO and a receive FIFO, a FIFO control unit that controls a transmit FIFO (First-In, First-Out) and a receive FIFO is input. Each time, the height counter, which represents the amount of data stored in the FIFO, is sequentially increased by one, and when the ATM cell is output, the height counter is sequentially decreased, and the height counter information is transmitted to the transmitting circuit and the CPU across the FIFO. This allows the transmitting circuit that reads data from the FIFO to transmit when transmitting, or the CPU knows the number of data to read from the FIFO when receiving.

한편, CPU가 가변길이의 패킷을 송신할 때, DMA를 사용하는 경우에는 CPU 메모리에 저장되어 송신하고자 하는 데이터가 저장된 버퍼의 정보를 송신회로에 있는 별도의 큐를 통해 전달하고, 회로가 이 큐에서 버퍼 정보를 읽어 DMA 읽기를 통하여 CPU의 메모리에서 데이터를 읽어서 전송하였다.On the other hand, when the CPU transmits a variable-length packet, when using DMA, the CPU transmits the buffer information stored in the CPU memory to store the data to be transmitted through a separate queue in the transmitting circuit. Read the buffer information from the CPU and read the data from the CPU memory via DMA read.

또한 가변길이의 패킷을 수신할 때는, 수신회로가 DMA를 사용하여 수신된 가변길이의 패킷을 CPU의 메모리에 쓰고 난 후에 버퍼 정보를 별도의 큐를 거쳐 CPU로 전달하고, 인터럽트를 사용하여 CPU가 패킷이 수신된 것을 인지하도록 하였다.In addition, when receiving a variable length packet, the receiving circuit writes the variable length packet received using the DMA to the memory of the CPU, passes the buffer information to the CPU through a separate queue, and uses the interrupt to The packet was acknowledged to be received.

DMA를 사용하는 경우에는 DMA 기능이 추가되어 회로가 복잡해지고, 전송하는 회로가 전송하기 전에 패킷의 길이를 미리 알고 있어서 긴밀하게 타이밍을 제어하고 싶을 때는 사용할 수 없는 단점이 있다. DMA를 사용하여 통해서 패킷을 즉시 전달하기 위해서는, 버스(bus)의 사용을 요구하여야 하고 그랜트(grant)를 받고 난후에 특정번지부터 버스트(burst)하게 패킷을 읽어오기 시작한다. 따라서 즉시 전송할 수 없다. 그리고 버스(bus)를 요구해서 그랜트(grant)를 받을 때까지 걸리는 시간도 일정하지 않다.In the case of using DMA, the circuit is complicated by the addition of the DMA function, and there is a disadvantage that it cannot be used when the timing of the packet is tightly controlled because the length of the packet is known before the transmitting circuit is transmitted. In order to deliver packets immediately using DMA, you must request the use of a bus and start reading packets bursting from a specific address after receiving a grant. Therefore, it cannot be sent immediately. And the time it takes to get a grant by requesting a bus is not constant.

이더넷 PON(Ethernet Passvie Optical Network)에서 CPU에 의해 송수신되는프레임들은 길이가 일정한 MPCP(Multi-Point Control Protocol) 관련 메시지들 외에도 CPU에 의해 처리되는 길이가 일정하지 않은 OAM 프레임들이 있는데, 이 일정하지 않는 프레임들을 종래의 DMA 방식을 사용하여 전송하는데 문제점이 있다.Frames transmitted and received by the CPU in an Ethernet PON (Ethernet Passvie Optical Network) include OAM frames of non-uniform length that are processed by the CPU, in addition to messages of constant length Multi-Point Control Protocol (MPCP). There is a problem in transmitting frames using a conventional DMA scheme.

본 발명이 이루고자 하는 기술적 과제는, 가변길이의 패킷을 전송시에 그 패킷을 전송하기 전에 미리 패킷의 길이를 알아서, CPU에서 전송한 패킷과 다른 패킷을 다중화할 때 이 패킷 길이 정보를 활용하고, 가변길이의 패킷을 수신하여 CPU로 전달하는 경우에도 이 패킷의 길이 정보를 별도로 수신회로가 제공하도록 한 가변길이 패킷을 송수신하기 위한 CPU 인터페이스 장치를 제공하는데 있다.The technical problem to be achieved by the present invention is to determine the length of a packet before transmitting the packet at the time of transmission of a variable length packet, and to utilize this packet length information when multiplexing a packet different from a packet transmitted from a CPU, The present invention provides a CPU interface device for transmitting and receiving a variable length packet in which a receiving circuit separately provides length information of the packet even when a variable length packet is received and transmitted to the CPU.

또한, CPU에서 이렇게 가변길이의 패킷을 읽어 처리하는데 있어 쉽게 프로그래밍을 할 수 있다. 만약 읽어내는 패킷의 길이를 모른다면, 읽어내면서 패킷의 끝인지 아닌지를 계속 해석하여야 하지만, 읽어낼 패킷의 길이를 미리 알고 있다면 루프를 돌면서 읽어 내기가 쉽기 때문이다.In addition, this variable length packet can be easily programmed in the CPU. If you don't know the length of the packet you're reading, you should continue to interpret whether it's the end of the packet as you read it, but if you know the length of the packet you're reading ahead of time, it's easy to loop around.

패킷이 끊어짐이 없이 연속적으로 송신 및 수신될 수 있도록 하기 위해서 CPU에서 전달되는 패킷, 또는 CPU로 전달되는 패킷을 충분히 버퍼링하면서 패킷길이 정보를 제공한다.In order to allow packets to be transmitted and received continuously without interruption, the packet length information is provided while sufficiently buffering the packet transmitted from the CPU or the packet transmitted to the CPU.

도 1은 본 발명의 가변길이 패킷을 송수신하는 CPU 인터페이스 장치를 도시한 도면이다.1 is a diagram illustrating a CPU interface device for transmitting and receiving variable length packets of the present invention.

도 2는 본 발명의 패킷 송신 과정 플로우차트이다.2 is a flowchart of a packet transmission process of the present invention.

도 3은 본 발명의 패킷 수신 과정 플로우차트이다.3 is a flowchart of a packet receiving process of the present invention.

도 4는 본 발명의 가변길이 패킷을 송수신하는 CPU 인터페이스 장치의 다른 일실시예의 구성도이다.4 is a block diagram of another embodiment of a CPU interface device for transmitting and receiving variable length packets of the present invention.

상기의 과제를 이루기 위하여 본 발명에 의한 가변길이의 패킷 송수신 장치는, 송신할 가변길이의 패킷을 저장하는 송신 데이터 저장부; 상기 송신할 패킷의 길이정보를 저장하는 송신 데이터 길이 저장부; 네트워크를 통해 송신할 패킷의 수를 카운트하는 송신 패킷 카운터를 저장하는 송신 패킷 카운터 저장부; 상기 송신 데이터 길이 저장부의 길이정보에 따라서 상기 송신 패킷을 읽어 네트워크로 송신하는 데이터 송신부; 네트워크를 통해 전송되는 가변길이의 패킷을 수신하는 데이터 수신부; 상기 수신된 패킷을 저장하는 수신 데이터 저장부; 상기 수신된 패킷의 길이정보를 저장하는 수신 데이터 길이 저장부; 및 상기 네트워크로부터 수신된 데이터 패킷의 수를 카운트하는 수신 패킷 카운터를 저장하는 수신 패킷 카운터 저장부를 구비한다.In order to achieve the above object, a variable length packet transmission / reception apparatus according to the present invention includes a transmission data storage unit for storing a variable length packet to be transmitted; A transmission data length storage unit for storing length information of the packet to be transmitted; A transmission packet counter storage unit for storing a transmission packet counter for counting the number of packets to be transmitted through the network; A data transmitter which reads the transmission packet and transmits the transmission packet to a network according to length information of the transmission data length storage unit; A data receiver for receiving a variable length packet transmitted through a network; A reception data storage unit for storing the received packet; A reception data length storage unit for storing length information of the received packet; And a reception packet counter storage unit for storing a reception packet counter for counting the number of data packets received from the network.

상기의 과제를 이루기 위하여 본 발명에 의한 가변길이의 패킷 송수신 장치는, 송신할 패킷의 길이정보 및 송신할 패킷을 저장한 후에 저장하였다는 신호를 출력함과 동시에 송신 패킷 카운터를 증가시키는 송신 데이터 저장부; 상기 저장하였다는 신호를 수신하여 상기 송신 데이터 저장부에서 송신할 패킷을 읽어 네트워크로 전송한 후에 전송하였다는 정보를 상기 송신 데이터 저장부에 전달하는 데이터 송신부; 네트워크로부터 가변길이의 패킷과 길이 정보를 수신하는 데이터 수신부; 및 상기 가변길이의 패킷과 길이정보를 저장하고 내부의 카운터를 증가시키고, 외부에서 이 패킷을 읽어가면 카운터를 감소시키는 수신 데이터 저장부를 구비한다.In order to achieve the above object, the variable length packet transmission / reception apparatus according to the present invention outputs a packet length information of a packet to be transmitted and a signal indicating that the packet to be transmitted is stored after being stored, and at the same time, increases the transmission packet counter and stores the transmission data counter. part; A data transmitter which receives the stored signal, reads a packet to be transmitted from the transmission data storage unit and transmits the packet to the transmission data storage unit after transmitting the packet to the transmission data storage unit; A data receiver for receiving a variable length packet and length information from a network; And a received data storage for storing the variable length packet and length information, incrementing an internal counter, and decrementing the counter when the external packet is read.

상기의 과제를 이루기 위하여 본 발명에 의한 가변길이의 패킷 송신 방법은, 송신할 패킷을 송신 데이터 FIFO에 저장하는 단계; 상기 저장된 패킷의 길이정보를 송신 size FIFO에 저장하는 단계; 상기 송신 Size FIFO에 패킷의 길이정보가 저장되면, 송신 패킷 카운터를 하나 증가시켜 CPU가 보낸 송신할 패킷이 있음을 데이터송신부에 알리는 단계; 상기 송신할 패킷이 있음을 통보받은 상기 데이터 송신부가 상기 송신 size FIFO를 읽어 패킷의 길이를 알아낸 다음 상기 송신 데이터 FIFO에서 저장된 패킷을 읽는 단계; 및 상기 데이터 송신부에서 전달되는 읽기 신호를 감시하여 하나의 패킷이 다 읽혀진 것을 알게 되면 패킷 카운터를 감소시키는 단계를 구비한다.According to the present invention, there is provided a variable length packet transmission method comprising: storing a packet to be transmitted in a transmission data FIFO; Storing length information of the stored packet in a transmission size FIFO; If the length information of the packet is stored in the transmission size FIFO, increasing the transmission packet counter by one to inform the data transmitter of the presence of a packet to be sent by the CPU; Reading, by the data transmitter, notifying that there is a packet to be transmitted, reading the transmission size FIFO to determine the length of the packet, and then reading the packet stored in the transmission data FIFO; And monitoring the read signal transmitted from the data transmitter to decrease the packet counter when it is known that one packet has been read.

상기의 과제를 이루기 위하여 본 발명에 의한 가변길이의 패킷 수신 방법은, 수신한 패킷을 수신 데이터 FIFO에 저장하는 단계; 상기 저장된 패킷의 길이정보를 수신 size FIFO에 저장하는 단계; 상기 수신 Size FIFO에 패킷의 길이정보가 저장되면, 수신 패킷 카운터를 하나 증가시켜 CPU에 수신된 패킷이 있음을 CPU 인터페이스부에 알리는 단계; CPU가 상기 수신 size FIFO를 읽어 패킷의 길이를 알아낸 다음 수신 데이터 FIFO에 저장된 패킷을 읽는 단계; 및 상기 CPU에서 전달되는 읽기 신호를 감시하여 하나의 패킷이 다 읽혀진 것을 알게 되면 상기 수신 패킷 카운터를 감소시키는 단계를 구비한다.In order to achieve the above object, the variable length packet receiving method according to the present invention comprises the steps of: storing the received packet in the received data FIFO; Storing length information of the stored packet in a received size FIFO; If the length information of the packet is stored in the received Size FIFO, increasing the received packet counter by one to inform the CPU interface that there is a received packet to the CPU; A CPU reading the received size FIFO to determine the length of the packet and then reading the packet stored in the received data FIFO; And monitoring the read signal transmitted from the CPU and decrementing the received packet counter when it is known that one packet has been read.

이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 가변길이 패킷을 송수신하는 CPU 인터페이스 장치를 도시한 도면이다.1 is a diagram illustrating a CPU interface device for transmitting and receiving variable length packets of the present invention.

가변길이 패킷을 송수신하는 CPU 인터페이스 장치는 CPU 인터페이스부(110), 송신 데이터 FIFO(120), 송신 size FIFO(130), 송신 패킷 카운터(140), 수신 데이터 FIFO(150), 수신 size FIFO(160), 수신 패킷 카운터(170), 송신회로(180) 및 수신회로(190)로 구성된다.The CPU interface device for transmitting and receiving variable length packets includes a CPU interface unit 110, a transmission data FIFO 120, a transmission size FIFO 130, a transmission packet counter 140, a reception data FIFO 150, and a reception size FIFO 160. ), A reception packet counter 170, a transmission circuit 180, and a reception circuit 190.

CPU 인터페이스부(110)는 외부의 CPU가 송신 데이터 FIFO(120), 송신 size FIFO(130), 수신 데이터 FIFO(150) 및 수신 size FIFO(160)를 액세스할 수 있도록 하는 인터페이스기능을 제공한다. 그리고, 송신 데이터 FIFO(120)와 송신 size FIFO(130)가 특정 번지에 위치하는 쓰기 레지스터처럼 보이게 해 주고, 수신 데이터 FIFO(150)와 수신 size FIFO(160)는 특정번지에 위치하는 읽기 레지스터처럼 보이게 해 준다.The CPU interface unit 110 provides an interface function to allow an external CPU to access the transmission data FIFO 120, the transmission size FIFO 130, the reception data FIFO 150, and the reception size FIFO 160. Then, the transmission data FIFO 120 and the transmission size FIFO 130 look like a write register located at a specific address, and the reception data FIFO 150 and the reception size FIFO 160 look like a read register located at a specific address. Make it visible

CPU는 송신 데이터 FIFO(120)와 송신 SIZE FIFO(130)에 이더넷 PON에서의 프레임이나 POS, SONET 패킷과 같은 데이터를 저장한 후, 이들 데이터는 송신회로(180)에 전달된다. 송신 SIZE FIFO(130)는 내부에 각 패킷에 대한 size 정보들을 저장하고 있고, 한 개 이상의 SIZE 정보가 저장되어 있으면, 한 개 이상의 패킷의 저장이 완료되어 있다는 의미이므로 송신회로에 이 사실을 알린다.The CPU stores data such as frames, POS, and SONET packets in the Ethernet PON in the transmission data FIFO 120 and the transmission size FIFO 130, and then these data are transferred to the transmission circuit 180. The transmission SIZE FIFO 130 stores the size information for each packet therein, and if more than one size information is stored, it means that one or more packets have been stored.

수신회로(190)는 수신 데이터 FIFO(150)와 수신 SIZE FIFO(160)에 패킷 데이터를 저장하고, 이 패킷 데이터들은 CPU에 전달된다. 수신 SIZE FIFO(160)는 내부에 상술한 이유와 같이 한 개 이상의 SIZE 정보가 있으면 CPU 인터페이스부(110)로 이 사실을 알린다. 이 정보는 인터럽트를 사용하여 전달될 수 있다.The receiving circuit 190 stores the packet data in the received data FIFO 150 and the received SIZE FIFO 160, and the packet data is transferred to the CPU. The reception SIZE FIFO 160 notifies the CPU interface unit 110 if there is more than one size information in the above-described reason. This information can be conveyed using interrupts.

송신 패킷 카운터 저장부(140)는 선로로 송신할 패킷의 수를 카운트하는 송신 패킷 카운터를 저장하고, 수신 패킷 카운터 저장부(170)는 선로로부터 수신된 패킷의 수를 카운트하는 수신 패킷 카운터를 저장한다.The transmission packet counter storage unit 140 stores a transmission packet counter that counts the number of packets to be transmitted on the line, and the reception packet counter storage unit 170 stores a reception packet counter that counts the number of packets received from the line. do.

도 2는 본 발명의 패킷 송신 과정 플로우차트이다.2 is a flowchart of a packet transmission process of the present invention.

외부의 CPU가 가변길이 패킷을 보내고자 하면, 송신 데이터 FIFO(120)에 이 가변길이 패킷을 전달하여, 송신 데이터 FIFO(120)는 수신한 가변길이의 패킷을 저장한다(S210). 그리고 이렇게 저장된 패킷의 길이정보를 송신 size FIFO(130)에 저장한다(S220). Size 정보를 송신 size FIFO(130)에 쓰는 순간 송신 패킷 카운터 저장부(140)는 송신 패킷 카운터를 하나 증가시키고, 패킷이 하나 쓰여졌음을 송신회로에 전달한다(S230). 패킷이 하나 쓰여졌다는 신호를 수신한 송신회로(180)는 송신 size FIFO(130)에서 먼저 패킷의 길이 정보를 읽고, 송신 데이터 FIFO(120)에서 실제 패킷을 읽는다(S240). 송신 패킷 카운터 저장부(140)는 읽기 신호를 감시하고 있다가, 하나의 패킷을 다 읽고 나면 송신 패킷 카운터를 하나 감소시킨다(S250).If the external CPU wants to send a variable length packet, the variable length packet is transferred to the transmission data FIFO 120, and the transmission data FIFO 120 stores the received variable length packet (S210). The length information of the stored packet is stored in the transmission size FIFO 130 (S220). As soon as the size information is written to the transmission size FIFO 130, the transmission packet counter storage unit 140 increments the transmission packet counter by one and transmits that one packet has been written to the transmission circuit (S230). Receiving a signal that one packet is written, the transmission circuit 180 first reads the length information of the packet from the transmission size FIFO 130, and reads the actual packet from the transmission data FIFO 120 (S240). The transmission packet counter storage 140 monitors the read signal and decrements the transmission packet counter by one after reading one packet (S250).

이와 같은 방법을 사용하면, CPU가 써넣은 패킷이 전송되기 전에 패킷을 추가로 쓰는 파이프라이닝(pipelining)도 가능하여 패킷의 송신 성능을 향상시킬 수 있다. 즉, 패킷이 쓰여졌을 때 카운터를 증가시키고 하나의 패킷이 다 읽혀졌을 때 카운터를 감소시키는 것은 독립적으로 일어난다. 물론 어느 클럭시점에서 하나의 패킷의 쓰기가 완료되는 시점에서 패킷의 읽기도 동시에 완료되었다면 당연히 카운터는 변동이 없다. 따라서 패킷이 읽혀지고 있는 동안에도 반대쪽에서는 패킷이 쓰여진다. 따라서 패킷을 읽는 회로는 읽자 마자 다음 패킷을 또 읽어 낼 수 있다. 이것이 파이프라이닝이다. 수신부의 예를 들면 대부분 선로에서 수신되는 패킷은 CPU가 읽어내는 동작과 상관없이 연속으로 몰려 올 수 있으므로 파이프라이닝이 필요하다.Using this method, it is possible to pipelining additional packets before the CPU-sent packets are transmitted, thereby improving packet transmission performance. That is, incrementing the counter when a packet is written and decrementing the counter when a packet is read all occurs independently. Of course, if the reading of the packet is completed at the same time when the writing of one packet is completed at a certain clock time, the counter does not change. Thus, while the packet is being read, the packet is written on the other side. Thus, a circuit that reads a packet can read the next packet again as soon as it reads. This is pipelining. For example, in the receiver, most of the packets received on the line need to be piped because they can be continuously collected regardless of the operation read by the CPU.

도 3은 본 발명의 패킷 수신 과정 플로우차트이다.3 is a flowchart of a packet receiving process of the present invention.

수신회로(190)는 수신한 패킷을 수신 데이터 FIFO(150)에 저장하고(S310), 다 저장하고 난 후 수신된 패킷의 길이정보를 수신 size FIFO(160)에 저장한다(S320). 수신 Size FIFO(160)에 패킷의 길이정보가 저장되면, 수신 패킷 카운터 저장부(170)의 수신 패킷 카운터가 하나 증가시켜 CPU에 수신된 패킷이 있음을 CPU 인터페이스부(110)에 알린다(S330). CPU는 먼저 수신 size FIFO(160)를 읽어 패킷의 길이를 알아낸 다음 수신 데이터 FIFO(150)에서 저장된 패킷을 읽는다(S340). 수신 패킷 카운터 저장부(170)는 CPU에서 전달되는 읽기 신호를 감시하여 하나의 패킷이 다 읽혀진 것을 알게 되면 패킷 카운터를 감소시킨다(S350). 패킷이 연속으로 수신되는 경우에도 송신의 경우에서 설명한 바와 마찬가지로 파이프라이닝방법도 가능하다.The receiving circuit 190 stores the received packet in the received data FIFO 150 (S310), and stores the length information of the received packet in the received size FIFO 160 after storing all the received packets (S320). When the packet length information is stored in the reception size FIFO 160, the reception packet counter of the reception packet counter storage unit 170 is increased by one to inform the CPU interface unit 110 that there is a received packet to the CPU (S330). . The CPU first reads the reception size FIFO 160 to determine the length of the packet, and then reads the packet stored in the reception data FIFO 150 (S340). The reception packet counter storage unit 170 monitors the read signal transmitted from the CPU and decreases the packet counter when it is known that one packet is read (S350). Even in the case where packets are received continuously, the pipelining method is also possible as described in the case of transmission.

도 4는 본 발명의 가변길이 패킷을 송수신하는 CPU 인터페이스 장치의 다른 일실시예의 구성도이다.4 is a block diagram of another embodiment of a CPU interface device for transmitting and receiving variable length packets of the present invention.

즉, 패킷과 패킷의 size 정보를 하나의 FIFO 에 저장한 것이다. 따라서, CPU 인터페이스부(410), 송신 데이터 FIFO(420), 송신회로(430), 수신 데이터 FIFO(440) 및 수신회로(450)로 구성된다.That is, the packet and the packet size information are stored in one FIFO. Therefore, it is comprised of the CPU interface part 410, the transmission data FIFO 420, the transmission circuit 430, the reception data FIFO 440, and the reception circuit 450. As shown in FIG.

패킷의 송신시, CPU가 송신 데이터 FIFO(420)에 패킷의 길이정보를 먼저 쓰고 패킷 데이터를 쓴 후에 송신회로가 인식할 수 있도록 EOP(End Of Packet) 신호를 송신회로에게 보내주면(예를 들어 특정 번지에 쓰면 이 신호가 발생되도록 할 수도 있다), 송신 데이터 FIFO(420) 내부의 패킷 카운트가 증가하여 송신회로(430)가 패킷이 존재함을 인식하고, 송신 데이터 FIFO(420)에 저장된 패킷의 길이정보를읽고, 이 길이에 따라서 패킷의 길이만큼 읽어 전송한다.When the packet is transmitted, the CPU writes the packet length information to the transmission data FIFO 420 first, and then writes the packet data, and then sends an EOP (End Of Packet) signal to the transmitting circuit so that the transmitting circuit can recognize the packet. If a signal is written to a specific address, this signal may be generated.), The packet count inside the transmission data FIFO 420 increases, and the transmission circuit 430 recognizes that the packet exists, and the packet stored in the transmission data FIFO 420. The length information of is read, and the length of the packet is read and transmitted according to this length.

패킷의 수신시, 수신회로(450)가 패킷을 수신 데이터 FIFO(440)에 다 써넣은 후에 마지막에 EOP 정보와 함께 패킷의 size 정보를 수신 데이터 FIFO(440)에 써 넣으면, 그 패킷의 size 정보가 해당 패킷이 저장되기 시작한 번지의 바로 앞 부분에 저장되도록 하고, 패킷 카운트를 증가시켜 인터럽트 등을 통해 CPU에 그 정보가 전달된다. 그러면 CPU가 패킷을 읽어 내기 전에 FIFO에서 size 정보를 먼저 읽어서 패킷의 size 만큼 패킷을 읽는다. 이렇게 하여 하나의 FIFO를 가지고 도 1과 기능을 수행할 수 있다.When the packet is received, when the receiving circuit 450 writes the packet to the received data FIFO 440 and finally writes the size information of the packet to the received data FIFO 440 together with the EOP information, the size information of the packet is received. The packet is stored immediately before the address where the packet starts to be stored, the packet count is increased, and the information is transmitted to the CPU through an interrupt. Then, the CPU reads the size information from the FIFO and reads the packet by the size of the packet before reading the packet. In this way, a single FIFO can perform the functions of FIG. 1.

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.So far I looked at the center of the preferred embodiment for the present invention. Those skilled in the art will appreciate that the present invention can be implemented in a modified form without departing from the essential features of the present invention. Therefore, the disclosed embodiments should be considered in descriptive sense only and not for purposes of limitation. The scope of the present invention is shown in the claims rather than the foregoing description, and all differences within the scope will be construed as being included in the present invention.

상술한 바와 같이 본 발명은, 송신회로가 패킷 데이터를 보내기 전에 다음에 보낼 패킷의 길이를 알 수 있으며 CPU가 수신된 패킷 데이터를 읽기 전에 그 패킷의 길이를 미리 알 수 있어 가변길이의 패킷 송수신을 구현하는 소프트웨어를 프로그램밍(programming) 하기에 편리하다.As described above, the present invention can determine the length of the next packet to be transmitted before the transmitting circuit sends the packet data and the length of the packet before the CPU reads the received packet data. It is convenient to program the software you implement.

그리고, 본 발명은 이더넷 PON과 같은 장치에서 대부분의 패킷은 CPU가 아닌 별도의 패킷 처리장치(네트워크 프로세서 등)를 통해 처리되고 일부 패킷만 CPU에 의해 처리될 때 사용될 수 있다. 이더넷 PON에서는 CPU가 송신하고 수신하는 패킷의 길이가 다양하기 때문에 DMA 기능 없이도 간단하게 목적을 이룰 수 있으며 특별히 ONU(Optical Network Unit)는 주어진 전송시간 그랜트(grant)안에 여러 개의 FIFO에서 패킷을 전송하기 위해 각 전송 FIFO에 대기하고 있는 패킷의 길이를 미리 알고 있으면 스케쥴링(scheduling)할 때 효율을 높일 수 있는 효과가 있다.In addition, the present invention can be used when most packets are processed through a separate packet processing device (such as a network processor), not a CPU, and only some packets are processed by the CPU in a device such as an Ethernet PON. In Ethernet PON, the length of the packet sent and received by the CPU varies so that it can be achieved simply without the DMA function.In particular, the Optical Network Unit (ONU) can transmit packets from multiple FIFOs within a given grant time. For example, if the length of a packet waiting in each transmission FIFO is known in advance, the efficiency can be increased when scheduling.

Claims (6)

송신할 가변길이의 패킷을 저장하는 송신 데이터 저장부;A transmission data storage unit for storing a variable length packet to be transmitted; 상기 송신할 패킷의 길이정보를 저장하는 송신 데이터 길이 저장부;A transmission data length storage unit for storing length information of the packet to be transmitted; 네트워크를 통해 송신할 패킷의 수를 카운트하는 송신 패킷 카운터를 저장하는 송신 패킷 카운터 저장부;A transmission packet counter storage unit for storing a transmission packet counter for counting the number of packets to be transmitted through the network; 상기 송신 데이터 길이 저장부의 길이정보에 따라서 상기 송신 패킷을 읽어 네트워크로 송신하는 데이터 송신부;A data transmitter which reads the transmission packet and transmits the transmission packet to a network according to length information of the transmission data length storage unit; 네트워크를 통해 전송되는 가변길이의 패킷을 수신하는 데이터 수신부;A data receiver for receiving a variable length packet transmitted through a network; 상기 수신된 패킷을 저장하는 수신 데이터 저장부;A reception data storage unit for storing the received packet; 상기 수신된 패킷의 길이정보를 저장하는 수신 데이터 길이 저장부; 및A reception data length storage unit for storing length information of the received packet; And 상기 네트워크로부터 수신된 데이터 패킷의 수를 카운트하는 수신 패킷 카운터를 저장하는 수신 패킷 카운터 저장부를 포함하는 것을 특징으로 하는 가변길이의 패킷 송수신 장치.And a receiving packet counter storage unit for storing a receiving packet counter for counting the number of data packets received from the network. 제1항에 있어서, 상기 송신 패킷 카운터는The method of claim 1, wherein the transmission packet counter 상기 송신 데이터 저장부에 송신할 패킷이 하나 저장될 때마다 증가하고 상기 데이터 송신부가 네트워크로 상기 패킷을 송신할 때마다 감소하는 것을 특징으로 하는 가변길이의 패킷 송수신 장치.And increasing each time one packet to be transmitted is stored in the transmission data storage unit and decreasing each time the data transmission unit transmits the packet to a network. 제1항에 있어서, 상기 수신 패킷 카운터는The method of claim 1, wherein the received packet counter 상기 수신 데이터 저장부에 수신한 패킷이 하나 저장될 때마다 증가하고 외부에서 상기 저장된 패킷을 읽어갈 때마다 감소하는 것을 특징으로 하는 가변길이의 패킷 송수신 장치.The variable length packet transmission / reception apparatus of claim 1, wherein the received packet is increased every time one received packet is stored and decreases every time the external packet is read. 송신할 패킷의 길이정보 및 송신할 패킷을 저장한 후에 저장하였다는 신호를 출력함과 동시에 송신 패킷 카운터를 증가시키는 송신 데이터 저장부;A transmission data storage unit for outputting a length information of a packet to be transmitted and a signal indicating that the packet to be transmitted is stored and then storing the transmission packet counter; 상기 저장하였다는 신호를 수신하여 상기 송신 데이터 저장부에서 송신할 패킷을 읽어 네트워크로 전송한 후에 전송하였다는 정보를 상기 송신 데이터 저장부에 전달하는 데이터 송신부;A data transmitter which receives the stored signal, reads a packet to be transmitted from the transmission data storage unit and transmits the packet to the transmission data storage unit after transmitting the packet to the transmission data storage unit; 네트워크로부터 가변길이의 패킷과 길이 정보를 수신하는 데이터 수신부; 및A data receiver for receiving a variable length packet and length information from a network; And 상기 가변길이의 패킷과 길이정보를 저장하고 내부의 카운터를 증가시키고, 외부에서 이 패킷을 읽어가면 카운터를 감소시키는 수신 데이터 저장부를 포함하는것을 특징으로 하는 가변길이의 패킷 송수신 장치.And a received data storage unit for storing the variable length packet and length information, incrementing an internal counter, and decreasing the counter when the external packet is read. (a) 송신할 패킷을 송신 데이터 FIFO에 저장하는 단계;(a) storing a packet to be transmitted in a transmission data FIFO; (b) 상기 저장된 패킷의 길이정보를 송신 size FIFO에 저장하는 단계;(b) storing the length information of the stored packet in a transmission size FIFO; (c) 상기 송신 Size FIFO에 패킷의 길이정보가 저장되면, 송신 패킷 카운터를 하나 증가시켜 CPU가 보낸 송신할 패킷이 있음을 데이터 송신부에 알리는 단계;(c) if the length information of the packet is stored in the transmission size FIFO, increasing the transmission packet counter by one to inform the data transmission unit that there is a packet to be sent by the CPU; (d) 상기 송신할 패킷이 있음을 통보받은 상기 데이터 송신부가 상기 송신 size FIFO를 읽어 패킷의 길이를 알아낸 다음 상기 송신 데이터 FIFO에서 저장된 패킷을 읽는 단계; 및(d) the data transmission unit notified that there is a packet to be transmitted, reads the transmission size FIFO to determine the length of the packet, and then reads the packet stored in the transmission data FIFO; And (e) 상기 데이터 송신부에서 전달되는 읽기 신호를 감시하여 하나의 패킷이 다 읽혀진 것을 알게 되면 상기 패킷 카운터를 감소시키는 단계를 포함하는 것을 특징으로 하는 가변길이의 패킷 송신방법.(e) monitoring the read signal transmitted from the data transmission unit and decreasing the packet counter when it knows that one packet has been read. (a) 수신한 패킷을 수신 데이터 FIFO에 저장하는 단계;(a) storing the received packet in a received data FIFO; (b) 상기 저장된 패킷의 길이정보를 수신 size FIFO에 저장하는 단계;(b) storing length information of the stored packet in a received size FIFO; (c) 상기 수신 Size FIFO에 패킷의 길이정보가 저장되면, 수신 패킷 카운터를 하나 증가시켜 CPU에 수신된 패킷이 있음을 CPU 인터페이스부에 알리는 단계;(c) if the length information of the packet is stored in the reception size FIFO, increasing the reception packet counter by one to inform the CPU interface that there is a received packet to the CPU; (d) CPU가 상기 수신 size FIFO를 읽어 패킷의 길이를 알아낸 다음 수신 데이터 FIFO에 저장된 패킷을 읽는 단계; 및(d) a CPU reading the received size FIFO to determine the length of the packet and then reading the packet stored in the received data FIFO; And (e) 상기 CPU에서 전달되는 읽기 신호를 감시하여 하나의 패킷이 다 읽혀진것을 알게 되면 상기 수신 패킷 카운터를 감소시키는 단계를 포함하는 것을 특징으로 하는 가변길이의 패킷 수신방법.(e) monitoring the read signal transmitted from the CPU and decrementing the received packet counter when it is known that one packet has been read.
KR10-2002-0078148A 2002-12-10 2002-12-10 Apparatus of transmitting and receiving variable length packet, and method thereof KR100462478B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2002-0078148A KR100462478B1 (en) 2002-12-10 2002-12-10 Apparatus of transmitting and receiving variable length packet, and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2002-0078148A KR100462478B1 (en) 2002-12-10 2002-12-10 Apparatus of transmitting and receiving variable length packet, and method thereof

Publications (2)

Publication Number Publication Date
KR20040050338A KR20040050338A (en) 2004-06-16
KR100462478B1 true KR100462478B1 (en) 2004-12-17

Family

ID=37344551

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2002-0078148A KR100462478B1 (en) 2002-12-10 2002-12-10 Apparatus of transmitting and receiving variable length packet, and method thereof

Country Status (1)

Country Link
KR (1) KR100462478B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100953549B1 (en) * 2008-04-11 2010-04-21 도시바삼성스토리지테크놀러지코리아 주식회사 Method and apparatus for processing data transfer and data transfer system

Also Published As

Publication number Publication date
KR20040050338A (en) 2004-06-16

Similar Documents

Publication Publication Date Title
TWI416334B (en) Method, bus interface device and processor for transmitting data transfer requests from a plurality of clients as packets on a bus
US6442162B1 (en) Credit-based scheme for high performance communication between devices in a packet-based communication system
EP0239937B1 (en) Serial communications controller
US7818470B2 (en) Adaptive interrupt on serial rapid input/output (SRIO) endpoint
EP1466449A1 (en) Deferred queuing in a buffered switch
KR950703766A (en) A DEVICE WITH HOST INDICATION COMBINATION
US6952739B2 (en) Method and device for parameter independent buffer underrun prevention
US7546400B2 (en) Data packet buffering system with automatic threshold optimization
US7177963B2 (en) System and method for low-overhead monitoring of transmit queue empty status
EP0562222A1 (en) Access control arrangement
US7610415B2 (en) System and method for processing data streams
JP2005018768A (en) Dual-port functionality for single-port cell memory device
US7330479B2 (en) Shared transmit buffer for network processor and methods for using same
CN107153412B (en) A kind of CAN controller circuit with transmission FIFO
US20050021307A1 (en) Asynchronous serial data interface
JP3506130B2 (en) Buffering device and buffering method
KR100462478B1 (en) Apparatus of transmitting and receiving variable length packet, and method thereof
US10002092B2 (en) Arithmetic processing unit, and method of controlling arithmetic processing unit
JP5359692B2 (en) Frame output method and frame output device
JP4406011B2 (en) Electronic circuit with processing units connected via a communication network
US5933615A (en) Optimization of the transfer of data word sequences
JP2001308958A (en) Interface circuit
KR100484134B1 (en) Asynchronous data interface apparatus using a FIFO
KR0136499B1 (en) Asynchronous transfer mode cell buffer
US6763405B2 (en) Process for interfacing a microprocessor with a packet based device and respective system

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20091113

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee