JP7005303B2 - Communication equipment, packet generators and their control methods - Google Patents

Communication equipment, packet generators and their control methods Download PDF

Info

Publication number
JP7005303B2
JP7005303B2 JP2017219329A JP2017219329A JP7005303B2 JP 7005303 B2 JP7005303 B2 JP 7005303B2 JP 2017219329 A JP2017219329 A JP 2017219329A JP 2017219329 A JP2017219329 A JP 2017219329A JP 7005303 B2 JP7005303 B2 JP 7005303B2
Authority
JP
Japan
Prior art keywords
transmission
data
packet
transmission data
mode
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
JP2017219329A
Other languages
Japanese (ja)
Other versions
JP2019092035A (en
Inventor
聖 坪井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2017219329A priority Critical patent/JP7005303B2/en
Publication of JP2019092035A publication Critical patent/JP2019092035A/en
Application granted granted Critical
Publication of JP7005303B2 publication Critical patent/JP7005303B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Description

本発明は通信プロトコル処理を実行する通信装置、パケット生成装置およびそれらの制御方法に関する。 The present invention relates to a communication device that executes communication protocol processing, a packet generation device, and a control method thereof.

近年、急速に増加するスマートデバイスと呼ばれる多機能端末を用いて高解像度動画(8K/4K)をネットワーク経由で閲覧するというニーズが増加しており、これに伴ってネットワークにおけるデータトラフィックが増大している。またEthernet(登録商標)による10Gbps通信、移動体通信の5G通信などのネットワーク高速化に伴って、TCP/UDP/IPなどの通信プロトコル処理のCPUにかかる負荷が大きくなっている。これらの高速データ通信を実現するためにCPUの通信プロトコル処理負荷を低減させる施策が提案されている。 In recent years, there has been an increasing need to view high-resolution video (8K / 4K) via a network using a multifunctional terminal called a smart device, which is rapidly increasing, and along with this, data traffic on the network has increased. There is. Further, with the increase in network speed such as 10 Gbps communication by Ethernet (registered trademark) and 5 G communication of mobile communication, the load on the CPU of communication protocol processing such as TCP / UDP / IP is increasing. In order to realize these high-speed data communications, measures have been proposed to reduce the communication protocol processing load of the CPU.

通信プロトコル処理においてデータを送信するためには、通信ヘッダや通信フッタを付加した通信パケットを生成する必要がある。そして、この通信パケットを生成する処理の効率化は高速データ通信には欠かせないものである。特許文献1は、メインシステムから渡されるロングパケットを送信バッファに蓄積し、所定のサイズ以下に分割し、ヘッダ情報を解析してロングパケットからショートパケットを生成するパケット生成方法について記載している。 In order to transmit data in the communication protocol processing, it is necessary to generate a communication packet to which a communication header and a communication footer are added. Improving the efficiency of the process of generating this communication packet is indispensable for high-speed data communication. Patent Document 1 describes a packet generation method in which a long packet passed from a main system is stored in a transmission buffer, divided into a predetermined size or less, header information is analyzed, and a short packet is generated from the long packet.

特開2007-266759号公報JP-A-2007-266759

特許文献1の送信パケット生成方法では、メインシステムから渡されるロングパケットを一度送信バッファに蓄積する処理が行われる。一般に、バッファにデータを格納する際に、送信対象のデータが1つのバッファに格納できるとは限らない。言い換えれば、そのデータがすべて連続領域に格納できるとは限らない。また、システムの実装やシステムの稼働状況により、バッファのサイズは一意とは限らず、状況に応じて確保するバッファの大きさを切り替えるものが存在する。特許文献1の通信パケット生成方法では、サイズが異なる複数のバッファに格納された送信データを外部に送信するには、送信処理をそのバッファの数だけ実施しなければならず、送信処理のオーバーヘッドが大きくなるという課題がある。 In the transmission packet generation method of Patent Document 1, a process of temporarily storing a long packet passed from the main system in a transmission buffer is performed. Generally, when storing data in a buffer, it is not always possible to store the data to be transmitted in one buffer. In other words, not all the data can be stored in a continuous area. Further, the size of the buffer is not always unique depending on the implementation of the system and the operating status of the system, and there are some that switch the size of the buffer to be secured according to the situation. In the communication packet generation method of Patent Document 1, in order to transmit transmission data stored in a plurality of buffers having different sizes to the outside, transmission processing must be performed for the number of buffers, and the overhead of transmission processing is increased. There is a problem of getting bigger.

本発明は上記の課題に鑑みてなされたものであり、バッファへの送信データの格納状況に応じて通信パケットの生成の方法を切り替えるパケット生成装置、通信装置およびそれらの制御方法を提供することを目的とする。 The present invention has been made in view of the above problems, and provides a packet generation device, a communication device, and a control method thereof for switching a communication packet generation method according to a storage status of transmission data in a buffer. The purpose.

本発明の一態様によるパケット生成装置は、
パケット生成システムを備えたパケット生成装置であって、
前記パケット生成システムに配備されたローカルメモリの内の1つの送信バッファに送信対象データの全体が格納できているかの判断処理に基づいて、前記送信対象データを1つの送信データとする、もしくは前記送信対象データからそれぞれが所定長を越えない複数の送信データを生成することを決定する決定手段と、
パケット生成のモードとして、前記1つの送信データからペイロード長が前記所定長を超えない1つ以上のパケットを生成する第1のモードと、前記複数の送信データからそれら送信データの個数を超えない数のパケットを生成する第2のモードと、を有する生成手段と、を備え、
前記生成手段は、前記第1のモードで動作する場合、前記所定長を基に前記送信データからパケットを生成し、前記第2のモードで動作する場合、送信データの結合関係を基に前記送信データからパケットを生成する。
The packet generator according to one aspect of the present invention is
A packet generator equipped with a packet generation system.
Based on the determination process of determining whether the entire transmission target data can be stored in one transmission buffer in the local memory deployed in the packet generation system, the transmission target data is regarded as one transmission data , or the transmission target data is described. A determination means for determining to generate a plurality of transmission data, each of which does not exceed a predetermined length, from the transmission target data .
As the packet generation modes, a first mode for generating one or more packets whose payload length does not exceed the predetermined length from the one transmission data, and a number not exceeding the number of the transmission data from the plurality of transmission data. A second mode for generating a packet of, and a generation means having .
When operating in the first mode, the generation means generates a packet from the transmission data based on the predetermined length, and when operating in the second mode, the transmission means based on the coupling relationship of the transmission data. Generate a packet from the data .

本発明によれば、バッファへの送信データの格納状況に応じて通信パケットの生成方法が切り替わる。 According to the present invention, the method of generating a communication packet is switched according to the storage status of the transmission data in the buffer.

実施形態による通信装置の機能ブロック図。The functional block diagram of the communication apparatus according to an embodiment. 実施形態における通信装置の送信動作を示すフローチャート。The flowchart which shows the transmission operation of the communication apparatus in embodiment. 実施形態におけるヘッダ処理部のモード選択処理を示すフローチャート。The flowchart which shows the mode selection process of the header processing part in embodiment. 実施形態におけるヘッダ処理部の第1のモードの処理を示すフローチャート。The flowchart which shows the processing of the 1st mode of the header processing part in an embodiment. 実施形態におけるヘッダ処理部の第2のモードの処理を示すフローチャート。The flowchart which shows the processing of the 2nd mode of the header processing part in embodiment. 設定情報の生成からレジスタ部への設定の処理を示すフローチャート。A flowchart showing the process of setting from the generation of setting information to the register section. 送信対象データからの送信データの派生、パケットの生成を説明する図。The figure explaining the derivation of the transmission data from the transmission target data, and the generation of a packet.

以下、添付の図面を参照して本発明の実施形態の一例について説明する。 Hereinafter, an example of an embodiment of the present invention will be described with reference to the accompanying drawings.

図1は、実施形態による通信装置100の内部構成を機能ブロック単位で示したブロック図である。通信装置100は、メインCPU102と、メインメモリ103と、通信プロトコル処理を実行するサブシステム104とを備える。通信装置100内の各機能ブロック(102~104)はシステムバス101を介して相互に接続されている。 FIG. 1 is a block diagram showing an internal configuration of a communication device 100 according to an embodiment in units of functional blocks. The communication device 100 includes a main CPU 102, a main memory 103, and a subsystem 104 that executes communication protocol processing. The functional blocks (102 to 104) in the communication device 100 are connected to each other via the system bus 101.

メインCPU102は、通信装置100全体の制御を司るとともに、アプリケーションソフトウエアを実行する。アプリケーションソフトウエアを実行する上で必要となるデータやプログラムなどはメインメモリ103に記憶される。メインCPU102は、メインメモリ103に対し、必要に応じてシステムバス101を介してデータやプログラムの読み出しおよび書き込みを行う。メインメモリ103は、通信装置内の各機能ブロックが共有して利用可能なメモリであり、例えばDRAM(Dynamic Random Access Memory)に代表されるような半導体メモリで構成されている。メインメモリ103のメモリ領域は、プログラムを格納する領域、アプリケーションソフトウエアが使用するアプリケーションバッファ領域、などに分けられる。 The main CPU 102 controls the entire communication device 100 and executes application software. Data, programs, etc. required for executing the application software are stored in the main memory 103. The main CPU 102 reads and writes data and programs to the main memory 103 via the system bus 101 as necessary. The main memory 103 is a memory that can be shared and used by each functional block in the communication device, and is composed of a semiconductor memory such as, for example, a DRAM (Dynamic Random Access Memory). The memory area of the main memory 103 is divided into an area for storing a program, an application buffer area used by application software, and the like.

パケット生成装置としてのサブシステム104は、サブCPU106と、ローカルメモリ107と、DMAコントローラ108と、通信インターフェース109と、ヘッダ処理部110とを備える。これらの機能ブロック(106、107、108,109、110)は、ローカルバス105によって相互に接続されている。ローカルバス105は、システムバス101と通信可能に接続されている。サブシステム104は、通信装置100におけるパケット生成、通信プロトコル処理を実行するサブシステムである。サブシステム104は、TCP/IPプロトコルといった通信プロトコル処理に特化して、外部機器とネットワークを介したデータ転送処理の一部を担っている。サブシステム104は、通信プロトコル処理専用のハードウエアを装備して高速な通信プロトコル処理をメインCPU102に代わって実行する。なお、TCP/IPプロトコルは説明を行うために示した一例であり、他の通信プロトコルが適用されても良い。 The subsystem 104 as a packet generation device includes a sub CPU 106, a local memory 107, a DMA controller 108, a communication interface 109, and a header processing unit 110. These functional blocks (106, 107, 108, 109, 110) are interconnected by a local bus 105. The local bus 105 is communicably connected to the system bus 101. The subsystem 104 is a subsystem that executes packet generation and communication protocol processing in the communication device 100. The subsystem 104 specializes in communication protocol processing such as TCP / IP protocol, and is responsible for a part of data transfer processing via an external device and a network. The subsystem 104 is equipped with hardware dedicated to communication protocol processing and executes high-speed communication protocol processing on behalf of the main CPU 102. The TCP / IP protocol is an example shown for explanation, and other communication protocols may be applied.

サブCPU106は、通信プロトコル処理を実行する。具体的には、サブCPU106は、IPv4(IPバージョン4)、IPv6(IPバージョン6)、UDP、TCPの各通信プロトコル処理(送信シーケンス制御や輻輳制御、通信エラー制御等)を行う。またサブCPU106は、1つのプロセッサによる構成としてもよいし、複数のプロセッサによるマルチプロセッサ構成としてもよいし、プロセッサと一部の機能をアクセラレートするハードウエアを含む構成としてもよい。 The sub CPU 106 executes the communication protocol process. Specifically, the sub CPU 106 performs each communication protocol process (transmission sequence control, congestion control, communication error control, etc.) of IPv4 (IP version 4), IPv6 (IP version 6), UDP, and TCP. Further, the sub CPU 106 may be configured by one processor, may be a multiprocessor configuration by a plurality of processors, or may be configured to include a processor and hardware for accelerating some functions.

ローカルメモリ107は、サブCPU106による利用が可能なメモリであり、例えば、SRAM(Static Random Access Memory)に代表されるような半導体メモリで構成される。また、ローカルメモリ107は、システムバス101とローカルバス105を経由してメインCPU102からもアクセスが可能になっている。ローカルメモリ107は、通信プロトコル処理を実行する上で必要となる送受信データや各種の設定情報などを記憶する。ローカルメモリ107に対するデータの読み出しおよび書き込みは、ローカルバス105を介して行われる。 The local memory 107 is a memory that can be used by the sub CPU 106, and is composed of, for example, a semiconductor memory represented by a SRAM (Static Random Access Memory). Further, the local memory 107 can also be accessed from the main CPU 102 via the system bus 101 and the local bus 105. The local memory 107 stores transmission / reception data and various setting information required for executing communication protocol processing. Reading and writing of data to the local memory 107 is performed via the local bus 105.

DMAコントローラ108は、デスクリプタに記載された内容に従ってソース側からディスティネーション側へデータ転送を実行する。デスクリプタには、データ転送元となるソース側のアドレス情報、データ転送先となるディスティネーション側のアドレス情報、データ転送の転送サイズの情報、などが記載されている。また、デスクリプタには次に実行するデスクリプタの有無とそのデスクリプタのアドレス情報を記載する領域があり、DMAコントローラ108への一度の転送開始指示により、複数のデスクリプタを使用した転送が可能である。 The DMA controller 108 executes data transfer from the source side to the destination side according to the contents described in the descriptor. The descriptor includes address information on the source side as a data transfer source, address information on the destination side as a data transfer destination, information on the transfer size of the data transfer, and the like. Further, the descriptor has an area for describing the presence / absence of the descriptor to be executed next and the address information of the descriptor, and the transfer using a plurality of descriptors can be performed by the one-time transfer start instruction to the DMA controller 108.

ローカルバス105に対してマスターとなる機能ブロック(例えば、サブCPU106)が、ローカルメモリ107にデスクリプタを書き込み、その後、DMAコントローラ108に対してDMA転送開始指示を通知する。DMA転送開始指示の通知の方法としては、最初のデスクリプタを保存しているローカルメモリ107のアドレス情報をDMAコントローラ108に設定することが挙げられる。 A functional block (for example, a sub CPU 106) that becomes a master for the local bus 105 writes a descriptor to the local memory 107, and then notifies the DMA controller 108 of a DMA transfer start instruction. As a method of notifying the DMA transfer start instruction, the address information of the local memory 107 storing the first descriptor may be set in the DMA controller 108.

DMAコントローラ108についてより詳細に説明する。DMAコントローラ108は、DMA転送部181とチェックサム演算器182を備える。DMA転送開始指示の通知を受けたDMAコントローラ108のDMA転送部181は、上述のデスクリプタにしたがって、メインメモリ103とローカルメモリ107の間、または、内部メモリ113とローカルメモリ107の間のDMA転送を実行する。また、DMA転送部181は、内部メモリ113と通信インターフェースの間、ローカルメモリ107と通信インターフェースの間のDMA転送処理も実行する。チェックサム演算器182は、DMA転送されるデータについて16ビット単位で1の補数和を計算する演算機能を有する。DMA転送部181は、転送されるデータの末尾にチェックサム演算器182の演算結果を付加してDMA転送する機能、あるいはチェックサム演算器182の演算結果だけを出力する機能を具備する。さらにこの演算機能は、複数の演算領域を指定して1つの補数和を算出することができる。チェックサム演算器182におけるこれら演算機能の実行は、デスクリプタにより指示されてもよいし、DMAコントローラ内のレジスタで指示されてもよい。 The DMA controller 108 will be described in more detail. The DMA controller 108 includes a DMA transfer unit 181 and a checksum calculator 182. Upon receiving the notification of the DMA transfer start instruction, the DMA transfer unit 181 of the DMA controller 108 performs a DMA transfer between the main memory 103 and the local memory 107 or between the internal memory 113 and the local memory 107 according to the above-mentioned descriptor. Execute. The DMA transfer unit 181 also executes a DMA transfer process between the internal memory 113 and the communication interface and between the local memory 107 and the communication interface. The checksum calculator 182 has a calculation function for calculating the one's complement sum in 16-bit units for the data transferred by DMA. The DMA transfer unit 181 has a function of adding the calculation result of the checksum calculator 182 to the end of the transferred data and performing DMA transfer, or a function of outputting only the calculation result of the checksum calculator 182. Further, this calculation function can calculate one complement sum by designating a plurality of calculation areas. Execution of these arithmetic functions in the checksum arithmetic unit 182 may be instructed by a descriptor or may be instructed by a register in the DMA controller.

通信インターフェース109は、LAN(Local Area Network)に代表されるようなネットワーク111とのインターフェースとなっており、通信における物理層(PHY層)とデータリンク層(MAC層)の通信制御を担っている。通信インターフェース109は、送受信情報を一時的に蓄積するバッファメモリ(不図示)を有する。このバッファメモリに対する送受信情報の入出力は、DMAコントローラ108のDMA転送によって行われる。なお、通信インターフェース109がDMAコントローラを内蔵して、そのDMAコントローラを使用する構成であっても良い。その場合には、DMAコントローラ108と同様に一度の転送開始指示で複数のデスクリプタを使用した転送ができるものが望ましい。なぜならば、送信するデータ(ペイロード)とそのヘッダは常に連続領域に格納されているとは限らないため、複数の領域から効率よくデータとヘッダを読み取ることができるほど、高速な通信速度を得られやすいからである。 The communication interface 109 is an interface with a network 111 as represented by a LAN (Local Area Network), and is responsible for communication control between a physical layer (PHY layer) and a data link layer (MAC layer) in communication. .. The communication interface 109 has a buffer memory (not shown) for temporarily storing transmission / reception information. Input / output of transmission / reception information to / from this buffer memory is performed by DMA transfer of the DMA controller 108. The communication interface 109 may have a built-in DMA controller and may use the DMA controller. In that case, it is desirable that the transfer can be performed by using a plurality of descriptors with one transfer start instruction as in the case of the DMA controller 108. This is because the data (payload) to be transmitted and its header are not always stored in the continuous area, so that the communication speed is so high that the data and the header can be efficiently read from multiple areas. Because it is easy.

ヘッダ処理部110は、コア部112と内部メモリ113を備え、通信プロトコル処理における通信ヘッダの生成処理を実行する。ヘッダ処理部110は、サブCPU106が実行する通信プロトコル処理における通信ヘッダ生成処理を肩代わりして実行する機能ブロックである。コア部112内のレジスタ部191は、ヘッダ処理部110を制御するための設定情報を入力する入力機能と、ヘッダ処理部110内の状態を確認するためのステータス情報を表示する出力機能を有する。また、レジスタ部191は、ステータス情報を表示するだけでなく外部へ割込み信号を使用してステータス情報を通知する機能も有している。 The header processing unit 110 includes a core unit 112 and an internal memory 113, and executes a communication header generation process in the communication protocol process. The header processing unit 110 is a functional block that executes the communication header generation process in the communication protocol process executed by the sub CPU 106 on behalf of the user. The register unit 191 in the core unit 112 has an input function for inputting setting information for controlling the header processing unit 110 and an output function for displaying status information for confirming the state in the header processing unit 110. Further, the register unit 191 not only displays the status information but also has a function of notifying the status information to the outside by using an interrupt signal.

コア部112内の通信ヘッダ生成部192は、レジスタ部191に入力された設定情報に従って通信ヘッダを生成し、内部メモリ113に記憶する。レジスタ部191に入力される設定情報は、ひな形となるヘッダ情報(以下、ひな形ヘッダ)と通信ヘッダ生成のための編集情報を含む。内部メモリ113は、コア部112およびサブCPU106からアクセス可能であり、例えば、SRAM(Static Random Access Memory)に代表されるような半導体メモリで構成される。内部メモリ113は、コア部112により生成された通信ヘッダを記憶する。 The communication header generation unit 192 in the core unit 112 generates a communication header according to the setting information input to the register unit 191 and stores it in the internal memory 113. The setting information input to the register unit 191 includes header information that serves as a template (hereinafter, template header) and editing information for generating a communication header. The internal memory 113 is accessible from the core unit 112 and the sub CPU 106, and is composed of, for example, a semiconductor memory represented by a SRAM (Static Random Access Memory). The internal memory 113 stores the communication header generated by the core unit 112.

さらに、ヘッダ処理部110は、ローカルバス105に対してマスターとなる機能を有し、DMAコントローラ108を制御することが可能である。ヘッダ処理部110によるDMA転送の設定は次のように行われる。すなわち、ヘッダ処理部110がDMA転送の内容を記載したデスクリプタを生成して内部メモリ113に保存する。そして、ヘッダ処理部110がこのデスクリプタを保存した内部メモリ113のアドレス情報や各種転送にかかわる情報をDMAコントローラ108に設定する。これにより、DMAコントローラ108は、内部メモリ113に保存されているデスクリプタに従ってDMA転送を実行する。さらに、ヘッダ処理部110は、レジスタ部191へ設定される設定情報により、第1のモードと第2のモードを切り替えて動作する機能を有している。設定情報、第1のモードおよび第2のモードの詳細については後述する。 Further, the header processing unit 110 has a function of becoming a master for the local bus 105, and can control the DMA controller 108. The DMA transfer setting by the header processing unit 110 is performed as follows. That is, the header processing unit 110 generates a descriptor describing the contents of the DMA transfer and stores it in the internal memory 113. Then, the header processing unit 110 sets the address information of the internal memory 113 in which the descriptor is stored and the information related to various transfers in the DMA controller 108. As a result, the DMA controller 108 executes the DMA transfer according to the descriptor stored in the internal memory 113. Further, the header processing unit 110 has a function of switching between the first mode and the second mode according to the setting information set in the register unit 191. The details of the setting information, the first mode and the second mode will be described later.

次に図1に示す通信装置100の通信動作について説明する。図2は、ネットワーク111を介して外部機器と接続し、その外部機器へ通信パケットを送信する際の通信装置100の動作を示すフローチャートである。なお、以下では通信装置100が外部機器との間でデータ転送する際に使用する通信プロトコルとしてTCP/IPプロトコルを用いた例を説明するが、TCP/IPプロトコル以外の通信プロトコルであってもよいことは言うまでもない。 Next, the communication operation of the communication device 100 shown in FIG. 1 will be described. FIG. 2 is a flowchart showing the operation of the communication device 100 when connecting to an external device via the network 111 and transmitting a communication packet to the external device. In the following, an example in which the TCP / IP protocol is used as the communication protocol used when the communication device 100 transfers data to and from an external device will be described, but a communication protocol other than the TCP / IP protocol may be used. Needless to say.

ステップS201は、このフローチャートのスタートを示す。通信装置100がネットワーク111を介して外部機器と通信状態になったとき、すなわち外部機器との通信が確立したときに、図示のフローチャートによって示される処理が開始する。ステップS202において、サブCPU106は、自身が実行する通信プロトコル処理でもって外部機器へ送信する通信パケットの生成準備が整ったかどうかを判断する。例えば、メインCPU102で実行されているアプリケーションソフトウエアから外部機器へ通信パケットを送信する指示(送信指示)をサブCPU106が受け取った場合、通信パケットの生成準備が整ったと判断される。外部機器へ送信する通信パケットの生成準備が整ったと判断された場合、処理はステップS203へ移行し、そうでない場合、処理は現在の状態を維持する。 Step S201 indicates the start of this flowchart. When the communication device 100 enters a communication state with an external device via the network 111, that is, when communication with the external device is established, the process shown by the flowchart shown in the figure starts. In step S202, the sub CPU 106 determines whether or not the communication packet to be transmitted to the external device is ready to be generated by the communication protocol process executed by the sub CPU 106. For example, when the sub CPU 106 receives an instruction (transmission instruction) for transmitting a communication packet from the application software executed by the main CPU 102 to an external device, it is determined that the communication packet is ready to be generated. If it is determined that the communication packet to be transmitted to the external device is ready to be generated, the process proceeds to step S203, and if not, the process maintains the current state.

ステップS203において、サブCPU106は、外部機器への通信プロトコルに従った送信を実行するために、送信対象データをメインメモリ103からサブシステム104のローカルメモリ107へ転送する。ここではステップS202で受け取った送信指示に基づいて、メインメモリ103からローカルメモリ107へ送信対象データがDMA転送される。サブCPU106は、DMAコントローラ108を用いてこのDMA転送を行う。DMA転送の設定はサブCPU106がDMA転送の内容を記載したデスクリプタを生成してローカルメモリ107に保存する。そして、サブCPU106が、このデスクリプタが保存されたローカルメモリ107のアドレス情報をDMAコントローラ108に設定することでDMA転送が実行される。このDMA転送の完了をもってステップS203の処理は終了する。 In step S203, the sub CPU 106 transfers the transmission target data from the main memory 103 to the local memory 107 of the subsystem 104 in order to execute transmission to the external device according to the communication protocol. Here, the transmission target data is DMA-transferred from the main memory 103 to the local memory 107 based on the transmission instruction received in step S202. The sub CPU 106 uses the DMA controller 108 to perform this DMA transfer. For the DMA transfer setting, the sub CPU 106 generates a descriptor describing the contents of the DMA transfer and saves it in the local memory 107. Then, the sub CPU 106 sets the address information of the local memory 107 in which the descriptor is stored in the DMA controller 108, so that the DMA transfer is executed. The process of step S203 ends when the DMA transfer is completed.

DMA転送の際に、メインメモリ103の送信対象データの全体を一つの送信バッファ(ローカルメモリ107の、アドレスが連続した1つのメモリ空間)に格納できるとは限らない。確保できる送信バッファの量はサブシステムの稼働状況、つまりローカルメモリ107の空き具合に依存するからである。また、送信データが大きいほど一つの送信バッファに格納できる確率は小さくなる傾向にある。なぜなら、一つの送信バッファを大きく取るということは、メモリの連続領域を確保する必要があるためである。受信処理で受信パケットを格納している場合、その他の通信相手に対する送信のために送信バッファを確保している場合などでは、メモリを連続領域で確保できなくなる可能性が高まる。送信バッファを可能な限り大きく取っても一つの送信バッファに送信対象データが収まらない場合は、サブCPU106は、送信対象データを複数の送信バッファに分割してデータを格納するようにデスクリプタを生成し、データ転送を実行する。ここで、送信対象データが1つの送信バッファに格納できたかどうかを基準に第1のモードもしくは第2のモードのどちらを使用して通信パケットを生成するかをサブCPU106が判断する。 At the time of DMA transfer, it is not always possible to store the entire transmission target data of the main memory 103 in one transmission buffer (one memory space having consecutive addresses in the local memory 107). This is because the amount of the transmit buffer that can be secured depends on the operating status of the subsystem, that is, the freeness of the local memory 107. Further, the larger the transmission data, the smaller the probability that it can be stored in one transmission buffer. This is because it is necessary to secure a continuous area of memory to take a large transmission buffer. When the received packet is stored in the reception process, or when the transmission buffer is secured for transmission to other communication partners, there is a high possibility that the memory cannot be secured in the continuous area. If the transmission target data does not fit in one transmission buffer even if the transmission buffer is taken as large as possible, the sub CPU 106 generates a descriptor so that the transmission target data is divided into a plurality of transmission buffers and the data is stored. , Perform data transfer. Here, the sub CPU 106 determines whether to generate a communication packet using the first mode or the second mode based on whether the transmission target data can be stored in one transmission buffer.

ステップS203における送信データの転送処理が終わると、ステップS204において、サブCPU106は、ヘッダ処理部110に対してヘッダ生成処理を開始するよう命令する。そして、ステップS205において、サブCPU106は、ヘッダ処理部110によるヘッダ生成処理の完了を待つ。ステップS204におけるヘッダ生成処理の開始の命令は、サブCPU106が設定情報をレジスタ部191に設定することでなされる。以下、サブCPU106による設定情報の設定処理について図6のフローチャートを参照して説明する。 When the transfer processing of the transmission data in step S203 is completed, in step S204, the sub CPU 106 instructs the header processing unit 110 to start the header generation processing. Then, in step S205, the sub CPU 106 waits for the completion of the header generation processing by the header processing unit 110. The instruction to start the header generation process in step S204 is given by the sub CPU 106 setting the setting information in the register unit 191. Hereinafter, the setting process of the setting information by the sub CPU 106 will be described with reference to the flowchart of FIG.

図6は、サブCPU106による、設定情報の生成処理を示すフローチャートである。まず、ステップS601において、サブCPU106はステップS202で転送した送信対象データの長さ(以下、送信データ長)と生成するパケットのパケットサイズに基づいて生成するパケット数を算出する。ステップS602~ステップS610では、サブCPU106は、ローカルメモリ107への送信対象データの格納状態に基づいて、送信対象データから派生される、パケット生成に用いられる送信データを決定する。ステップS602において、サブCPU106は、ローカルメモリ107の1つの送信バッファ(連続したアドレスのメモリ領域)に送信対象データの全体が格納されたか否かを判定する。1つの送信バッファに送信対象データの全体が格納されている場合は、ステップS603において、サブCPU106は、送信対象データの全体を1つの送信データに決定する。 FIG. 6 is a flowchart showing a process of generating setting information by the sub CPU 106. First, in step S601, the sub CPU 106 calculates the number of packets to be generated based on the length of the transmission target data transferred in step S202 (hereinafter, transmission data length) and the packet size of the packets to be generated. In steps S602 to S610, the sub CPU 106 determines the transmission data used for packet generation derived from the transmission target data based on the storage state of the transmission target data in the local memory 107. In step S602, the sub CPU 106 determines whether or not the entire transmission target data is stored in one transmission buffer (memory area of continuous addresses) of the local memory 107. When the entire transmission target data is stored in one transmission buffer, in step S603, the sub CPU 106 determines the entire transmission target data as one transmission data.

一方、ステップS602において複数の送信バッファに送信対象データが分割されて格納されていると判定された場合、ステップS604~S610において、サブCPU106は、送信対象データから複数の送信データを決定する。この場合、送信対象データは複数の送信バッファの個数以上の送信データとしてパケット生成に提供される。まず、ステップS604において、サブCPU106は、先頭の送信バッファを選択する。ステップS605において、サブCPU106は、選択した送信バッファに格納されているデータ(送信対象データの部分データ)が送信するパケットのセグメントサイズ以下かどうかを判定する。データがセグメントサイズ以下であると判定された場合、ステップS606において、サブCPU106は、選択した送信バッファに格納されているデータを1つの送信データに決定する。データがセグメントサイズ以下ではないと判定された場合、ステップS607において、サブCPU106は、選択した送信バッファに格納されているデータをセグメントサイズ以下のデータに分割し、それぞれを送信データに決定する。 On the other hand, when it is determined in step S602 that the transmission target data is divided and stored in the plurality of transmission buffers, in steps S604 to S610, the sub CPU 106 determines a plurality of transmission data from the transmission target data. In this case, the transmission target data is provided for packet generation as transmission data equal to or greater than the number of transmission buffers. First, in step S604, the sub CPU 106 selects the first transmission buffer. In step S605, the sub CPU 106 determines whether or not the data (partial data of the transmission target data) stored in the selected transmission buffer is equal to or smaller than the segment size of the packet to be transmitted. If it is determined that the data is equal to or smaller than the segment size, in step S606, the sub CPU 106 determines the data stored in the selected transmission buffer as one transmission data. If it is determined that the data is not the segment size or less, in step S607, the sub CPU 106 divides the data stored in the selected transmission buffer into the data having the segment size or less, and determines each of them as the transmission data.

ステップS608において、サブCPU106は、決定された送信データのサイズとパケットのセグメントサイズとに基づいて、隣接する送信データの結合を行うか否かを示すデータ結合情報を生成する。本実施形態によるデータ結合情報の詳細については後述する。次に、ステップS609において、サブCPU106は、全ての送信バッファについて上記処理を行ったか否かを判定する。未処理の送信バッファがあると判定された場合、ステップS610においてサブCPU106は、次の送信バッファを選択し、ステップS605からの処理を実行する。ステップS609で未処理の送信バッファがないと判定されると、処理はステップS611へ進む。ステップS611において、サブCPU106は、ステップS608により生成されたデータ結合情報に基づいてステップS601で設定されたパケット数を修正する。こうして、ローカルメモリ107への送信対象データの格納状態に基づいて、送信対象データを送信するための送信データの構成が決定される。 In step S608, the sub CPU 106 generates data binding information indicating whether or not to combine adjacent transmission data based on the determined transmission data size and the packet segment size. The details of the data combination information according to this embodiment will be described later. Next, in step S609, the sub CPU 106 determines whether or not the above processing has been performed for all the transmission buffers. If it is determined that there is an unprocessed transmission buffer, the sub CPU 106 selects the next transmission buffer in step S610 and executes the processing from step S605. If it is determined in step S609 that there is no unprocessed transmission buffer, the process proceeds to step S611. In step S611, the sub CPU 106 modifies the number of packets set in step S601 based on the data binding information generated in step S608. In this way, the configuration of the transmission data for transmitting the transmission target data is determined based on the storage state of the transmission target data in the local memory 107.

ステップS612において、サブCPU106は、設定情報をヘッダ処理部110のレジスタ部191に入力(設定)する。設定情報は、パケット数、ひな形ヘッダの情報、ローカルメモリ107における送信データの開始アドレス、送信データの長さ、送信データの個数、初期シーケンス番号などの情報を含む。なお、送信対象データを複数の送信データとして処理するように決定された場合には、設定情報はそれぞれの送信データの開始アドレスと長さを含む。また、ヘッダ処理部110は、生成する通信ヘッダの開始アドレスが固定された仕様でもよいし、サブCPU106によって管理される仕様でもよい。前者と後者ともに内部メモリ113の領域に通信ヘッダを生成するように実装、もしくは指示する必要がある。後者のメリットとしては、ヘッダ処理部110が生成した通信ヘッダを外部へ送信する前に次の通信ヘッダの生成を実施するような場合に、生成済みでかつ未送信の通信ヘッダを上書きしないように指示することが可能となることが挙げられる。 In step S612, the sub CPU 106 inputs (sets) the setting information to the register unit 191 of the header processing unit 110. The setting information includes information such as the number of packets, template header information, the start address of transmission data in the local memory 107, the length of transmission data, the number of transmission data, and the initial sequence number. When it is determined to process the transmission target data as a plurality of transmission data, the setting information includes the start address and the length of each transmission data. Further, the header processing unit 110 may have a specification in which the start address of the generated communication header is fixed, or may be a specification managed by the sub CPU 106. Both the former and the latter need to be implemented or instructed to generate a communication header in the area of the internal memory 113. The latter merit is that when the next communication header is generated before the communication header generated by the header processing unit 110 is transmitted to the outside, the generated and untransmitted communication header is not overwritten. It is possible to give instructions.

なお、ローカルメモリ107のサイズは実装時に決定されてしまうため、前者の仕様と後者の仕様ともにひな形ヘッダの全長の上限値を事前に考慮する必要がある。その際に、TCPやIPv6の場合にはオプション設定を考慮して設定する必要がある。とくにIPv6はオプションの上限値がないため、どこまで対応するか注意が必要である。 Since the size of the local memory 107 is determined at the time of mounting, it is necessary to consider the upper limit of the total length of the template header in advance for both the former specification and the latter specification. At that time, in the case of TCP or IPv6, it is necessary to consider the option setting. In particular, IPv6 does not have an upper limit for options, so it is necessary to pay attention to how far it corresponds.

上述のように、ローカルメモリ107において送信対象データが一つの送信バッファに格納できているのであれば送信データの個数は1である。また、送信対象データが複数の送信バッファに分割して格納されているのであれば送信データの個数はその分割数以上である。なお、送信データの個数が1である場合、サブCPU106は、ヘッダ処理部110が送信データの分割を行う分割長を指定する(設定情報に含める)必要がある。この分割長はTCPにおける最大セグメントサイズ(Max Segment Size、以下MSS)と同じでもよいし、より短くても構わない。但し、少なくとも、生成するパケット数と送信データ長と分割長の間で整合性が取れている必要がある。すなわち、生成するパケット数と分割長の掛け算の計算値が、送信データ長と等しいかもしくは小さい必要がある。また、送信データ長よりも分割長のほうが大きい場合には、生成するパケット数は1とする必要がある。 As described above, if the transmission target data can be stored in one transmission buffer in the local memory 107, the number of transmission data is 1. Further, if the transmission target data is divided and stored in a plurality of transmission buffers, the number of transmission data is equal to or greater than the number of divisions. When the number of transmission data is 1, the sub CPU 106 needs to specify (include in the setting information) the division length for dividing the transmission data by the header processing unit 110. This division length may be the same as or shorter than the maximum segment size (Max Segment Size, hereinafter MSS) in TCP. However, at least, it is necessary that the number of packets to be generated, the transmission data length, and the division length are consistent. That is, the calculated value of the product of the number of packets to be generated and the division length must be equal to or smaller than the transmission data length. Further, when the division length is larger than the transmission data length, the number of packets to be generated needs to be 1.

また、ヘッダ処理部110は、複数の送信データが入力された場合に、複数の送信データを結合して得られるパケットのための通信ヘッダを生成する機能を持つ。仮に送信データの個数を4と入力した場合、サブCPU106は、1~4のいずれかの数のパケットに対応してパケットを生成するように送信データの結合を指示することができる。但し、入力した送信データの個数よりも多くのパケットを生成することはできない。結合する送信データの個数の上限値は、ヘッダ処理部110に一度に入力できる送信データの数以下であればよく、実装依存である。なお、TCPプロトコルの送信ウィンドウサイズの値とMSSの値から、送信データの個数の上限を算出してもよい。たとえば、送信ウィンドウサイズが64キロバイト(65536バイト)、MSSが1460バイトであれば、最大で45個のパケットを一度の命令で生成できるように実装しているのが望ましい。複数の送信データを入力する場合、最終的なパケットの全長を管理するのはサブCPU106である。したがって、サブCPU106は、使用するプロトコルに準拠するようにヘッダ処理部110に結合を設定する必要がある。あくまでもヘッダ処理部110は入力されたデータを結合するかしないかを管理する。送信データの結合に関する機能の詳細は後述する。 Further, the header processing unit 110 has a function of generating a communication header for a packet obtained by combining a plurality of transmission data when a plurality of transmission data are input. If the number of transmission data is input to 4, the sub CPU 106 can instruct the combination of transmission data so as to generate a packet corresponding to any number of packets from 1 to 4. However, it is not possible to generate more packets than the number of input transmission data. The upper limit of the number of transmission data to be combined may be equal to or less than the number of transmission data that can be input to the header processing unit 110 at one time, and is implementation-dependent. The upper limit of the number of transmission data may be calculated from the transmission window size value of the TCP protocol and the MSS value. For example, if the transmission window size is 64 kilobytes (65536 bytes) and the MSS is 1460 bytes, it is desirable to implement so that a maximum of 45 packets can be generated by one instruction. When inputting a plurality of transmission data, it is the sub CPU 106 that manages the total length of the final packet. Therefore, the sub CPU 106 needs to set the combination in the header processing unit 110 so as to comply with the protocol to be used. To the last, the header processing unit 110 manages whether or not to combine the input data. Details of the functions related to the combination of transmitted data will be described later.

また、上述のステップS607では、1つの送信バッファから複数の送信データが決定される。すなわち、送信バッファの数よりも多い数のパケットを生成することが必要となる場合がある。このように、複数の送信バッファに格納されている送信対象データから、その送信バッファ数を超える数のパケットを生成する場合は、ヘッダ処理部110のレジスタ部191に入力される設定情報を工夫する必要がある。より具体的には、設定情報に含まれる送信データの個数、送信データのアドレスと長さを工夫する必要がある。たとえば2つの送信バッファにある送信データから3つのパケットを生成する場合を例に説明する。 Further, in step S607 described above, a plurality of transmission data are determined from one transmission buffer. That is, it may be necessary to generate more packets than there are transmit buffers. In this way, when generating a number of packets exceeding the number of transmission buffers from the transmission target data stored in the plurality of transmission buffers, devise the setting information input to the register unit 191 of the header processing unit 110. There is a need. More specifically, it is necessary to devise the number of transmission data included in the setting information and the address and length of the transmission data. For example, a case where three packets are generated from transmission data in two transmission buffers will be described.

図7は送信対象データから送信データおよびパケットを生成する様子を示す図である。図7(a)に示されるように、2つの送信バッファをそれぞれAバッファとBバッファとする。Aバッファに格納されている送信データの開始アドレスが0x1000、送信データ長が2000バイト、Bバッファに格納されている送信データの開始アドレスが0x2000、送信データ長が1000バイトとする。パケットを送信する際のMSSが仮に1000バイトである場合、バッファAの送信データを利用して2つのパケット、バッファBの送信データを利用して1つのパケットを生成することが可能である。そこで、サブCPU106は、以下の内容を示す設定情報をレジスタ部191に入力する。
・送信データの開始アドレスが0x1000、0x13E8(0x1000から1000バイトオフセット)、0x2000。
・送信データ長がそれぞれ1000バイト。
・送信データ数が3で、生成するパケット数が3。
FIG. 7 is a diagram showing how transmission data and packets are generated from transmission target data. As shown in FIG. 7A, the two transmission buffers are the A buffer and the B buffer, respectively. The start address of the transmission data stored in the A buffer is 0x1000, the transmission data length is 2000 bytes, the start address of the transmission data stored in the B buffer is 0x2000, and the transmission data length is 1000 bytes. If the MSS at the time of transmitting a packet is 1000 bytes, it is possible to generate two packets by using the transmission data of the buffer A and one packet by using the transmission data of the buffer B. Therefore, the sub CPU 106 inputs the setting information indicating the following contents to the register unit 191.
-The start address of the transmission data is 0x1000, 0x13E8 (offset from 0x1000 to 1000 bytes), 0x2000.
-Transmission data length is 1000 bytes each.
-The number of transmitted data is 3, and the number of packets to be generated is 3.

この設定により、図7(a)に示されるように、一度の処理命令で、2つの送信データから3つのパケットを生成することが可能となる。ヘッダ処理部110が1つの送信データしか受け付けることができない場合、上記例では必ず二度の処理命令が必要になる。これに対し、本実施形態は、複数に分割されている送信データを一度にパケット化できるメリットがある。その結果、複数回の処理に係るオーバーヘッドを削減することが可能となる。また、図7(a)には、隣接する送信データとの結合の要否を示すデータ結合情報の例が示されている。本実施形態のデータ結合情報は、次の送信データとの結合の要否を示す。図7(a)のデータ結合情報は、全ての送信データに対して"1"となっており、次の送信データとの結合を行わないことを示している。 With this setting, as shown in FIG. 7A, it is possible to generate three packets from two transmission data with one processing instruction. When the header processing unit 110 can accept only one transmission data, the above example always requires two processing instructions. On the other hand, the present embodiment has an advantage that the transmission data divided into a plurality of parts can be packetized at once. As a result, it is possible to reduce the overhead related to a plurality of processes. Further, FIG. 7A shows an example of data combination information indicating whether or not to combine with adjacent transmission data. The data combination information of the present embodiment indicates the necessity of combination with the next transmission data. The data combination information in FIG. 7A is "1" for all transmission data, indicating that the combination with the next transmission data is not performed.

また、上述したように、データ結合情報により結合を指示することにより送信バッファの個数よりも少ない個数のパケットを生成することができる。例えば上記の例で仮にMSSが1500である場合、図7(b)に示されるように、サブCPU106が以下の情報をレジスタ部191に設定することで、3つの送信データから2つのパケットを生成することができる。
・開始アドレスが0x1000、0x15DC(0x1000から1500バイトオフセット)、0x2000。
・送信データ長がそれぞれ1500バイト、500バイト、1000バイト・
・データ結合情報(二番目と三番目の送信データを結合することの指示)。
・送信データ数が3、生成するパケット数が2。
Further, as described above, it is possible to generate a number of packets smaller than the number of transmission buffers by instructing the combination by the data combination information. For example, in the above example, if the MSS is 1500, as shown in FIG. 7B, the sub CPU 106 sets the following information in the register unit 191 to generate two packets from the three transmission data. can do.
-Starting addresses are 0x1000, 0x15DC (offset from 0x1000 to 1500 bytes), 0x2000.
・ Transmission data lengths are 1500 bytes, 500 bytes, and 1000 bytes, respectively.
-Data combination information (instruction to combine the second and third transmission data).
-The number of transmitted data is 3, and the number of packets to be generated is 2.

データ結合情報として、次の送信データと結合する送信データに"0"が付される。図7(b)では、500バイトの送信データが次の送信データ(1000バイト)と結合されることを示している。なお、上記では、MSSを基準として設定値を決定したが、MSSを基準とする必要はない。また、データを結合せず(送信データのアドレスとデータ長はそのまま)、送信データ数が3、生成するパケット数が3としてもよい。 As the data combination information, "0" is added to the transmission data to be combined with the next transmission data. FIG. 7B shows that 500 bytes of transmission data are combined with the next transmission data (1000 bytes). In the above, the set value is determined based on the MSS, but it is not necessary to use the MSS as a reference. Further, the number of transmitted data may be 3 and the number of generated packets may be 3 without combining the data (the address and the data length of the transmitted data remain the same).

なお、上記では、送信データの結合を行うか否かを判断するための基準として送信データのサイズを用いたがこれに限られるものではない。たとえば通信インターフェースが全二重であるか半二重であるかを、送信データの結合を行うか否かの判断基準として用いてもよい。半二重である場合、一回の送信で送信できる送信データ長が大きくなる程ネットワーク利用効率が高くなるため、送信データを結合させるほうがよい。また、通信相手の性能を加味して送信データの結合を行うか否かを判断してもよい、通信相手の性能が良いほどパケット処理スピードが速くなるので、小さいパケットが増えてもパケットロスが発生する確率は少なく、通信速度の低下が発生するリスクは少ない。一方、ヘッダ処理部110は結合処理が入ると、その分の処理負荷が増えるため処理スピードが遅くなる。したがって、通信相手の性能に問題なければ、送信データを結合させる必要がない。なお、通信相手の性能は、確立している通信接続を用いて通信相手に問い合わせることで取得すればよい。 In the above, the size of the transmission data is used as a criterion for determining whether or not to combine the transmission data, but the present invention is not limited to this. For example, whether the communication interface is full-duplex or half-duplex may be used as a criterion for determining whether to combine transmission data. In the case of half-duplex, the network utilization efficiency increases as the transmission data length that can be transmitted in one transmission increases, so it is better to combine the transmission data. In addition, it may be determined whether or not to combine transmission data in consideration of the performance of the communication partner. The better the performance of the communication partner, the faster the packet processing speed, so even if the number of small packets increases, packet loss will occur. The probability of occurrence is low, and the risk of a decrease in communication speed is low. On the other hand, when the header processing unit 110 includes the join processing, the processing load increases by that amount, and the processing speed slows down. Therefore, if there is no problem with the performance of the communication partner, it is not necessary to combine the transmission data. The performance of the communication partner may be obtained by inquiring to the communication partner using an established communication connection.

ステップS205において、サブCPU106は、ヘッダ処理部110に開始させた処理が完了したかどうかを判断する。処理の完了を判断する方法としては、例えば、ヘッダ処理部110からの割り込み信号の受信、ヘッダ処理部110のステータスレジスタのポーリング、などがある。割り込み信号の受信待ちのほうが、割り込みを待っている間に他の処理を行うことができるので処理の並列性が向上するメリットがある。サブCPU106は、ヘッダ処理部110の処理終了を検知すると、処理をステップS206へ進める。ヘッダ処理部110は、レジスタ部191に設定された設定情報に従って処理を行う。その結果、終了通知が行われる際には、指定されたパケット数と同数の通信ヘッダが内部メモリ113上に生成されている。 In step S205, the sub CPU 106 determines whether or not the processing started by the header processing unit 110 is completed. As a method for determining the completion of processing, for example, there is reception of an interrupt signal from the header processing unit 110, polling of the status register of the header processing unit 110, and the like. Waiting for an interrupt signal to be received has the advantage of improving the parallelism of processing because other processing can be performed while waiting for an interrupt. When the sub CPU 106 detects the end of the processing of the header processing unit 110, the sub CPU 106 advances the processing to step S206. The header processing unit 110 performs processing according to the setting information set in the register unit 191. As a result, when the end notification is performed, the same number of communication headers as the specified number of packets are generated on the internal memory 113.

ステップS206において、サブCPU106は、ローカルメモリ107に格納されている送信データと内部メモリ113に格納されている通信ヘッダを通信インターフェース109に転送し、通信パケットの送信を行う。サブCPU106はヘッダ処理部110にヘッダ生成の命令(送信データの結合を含む)を発行しているため、生成されたヘッダとそのヘッダに対応するペイロード部分を識別することが可能である。したがって、ヘッダとペイロード部分が連続メモリ領域に格納されていなくても、サブCPU106は、通信パケットを識別することができる。通信インターフェース109にヘッダおよび送信データを転送する際には、DMAコントローラ108が使用されてもよいし、通信インターフェース109内に具備するDMAコントローラが使用されてもよい。サブCPU106は1つのパケットに対してヘッダ部分のデスクリプタとペイロード部分のデスクリプタの2つを1組とし、送信するパケット数だけデスクリプタを準備してから通信インターフェース109へ送信する。 In step S206, the sub CPU 106 transfers the transmission data stored in the local memory 107 and the communication header stored in the internal memory 113 to the communication interface 109, and transmits the communication packet. Since the sub CPU 106 issues a header generation instruction (including a combination of transmission data) to the header processing unit 110, it is possible to identify the generated header and the payload portion corresponding to the header. Therefore, the sub CPU 106 can identify the communication packet even if the header and the payload portion are not stored in the continuous memory area. When transferring the header and the transmission data to the communication interface 109, the DMA controller 108 may be used, or the DMA controller provided in the communication interface 109 may be used. The sub CPU 106 makes a set of a descriptor of the header portion and a descriptor of the payload portion for one packet, prepares descriptors for the number of packets to be transmitted, and then transmits the descriptors to the communication interface 109.

ステップS206における通信インターフェース109への通信パケットの送信が終了すると、ステップS207において、サブCPU106は、通信装置100と外部機器の通信状態を終了させる要因が発生したかどうかを判断する。外部機器との通信状態を終了させる要因が発生していなければ、サブCPU106は、処理をステップS202へ戻し、上述の処理を繰り返す。外部機器との通信状態を終了させる要因が発生していると判断されると、サブCPU106は、処理をステップS208へ進める。外部機器との通信状態を終了させる要因としては、例えば以下のケースがある。
・メインCPU102で実行しているアプリケーションソフトウエアが、ユーザからの操作などで通信装置と外部機器の接続を終了させる指示を検知した場合。
・ユーザがネットワークケーブルを通信装置から抜くなどして通信回線が断絶したことを通信インターフェース109が検知した場合。
・通信相手である外部機器から通信回線を切断する旨の通知を含んだ通信パケットを受信した場合。
When the transmission of the communication packet to the communication interface 109 in step S206 is completed, in step S207, the sub CPU 106 determines whether or not a factor for terminating the communication state between the communication device 100 and the external device has occurred. If there is no factor for terminating the communication state with the external device, the sub CPU 106 returns the process to step S202 and repeats the above process. When it is determined that a factor for terminating the communication state with the external device has occurred, the sub CPU 106 advances the process to step S208. For example, there are the following cases as factors for terminating the communication state with the external device.
-When the application software running on the main CPU 102 detects an instruction to terminate the connection between the communication device and the external device by an operation from the user or the like.
-When the communication interface 109 detects that the communication line is disconnected due to the user disconnecting the network cable from the communication device.
-When a communication packet including a notification to disconnect the communication line is received from an external device that is the communication partner.

ステップS208において、サブCPU106は、通信装置100と外部機器の通信状態を終了させる処理を行う。より詳細には、サブCPU106が担っている通信プロトコル処理に従って外部機器との通信回線を切断する。そして、サブCPU106は、ローカルメモリ107やヘッダ処理部110の内部メモリ113に一時的に保存している関連情報を削除する。その後、サブCPU106からメインCPU102へ通信回線の切断完了の通知が伝達されるとアプリケーションソフトウエアで通信回線が切断した事をユーザなどに示す表示が行われる。その後、本処理は終了する(ステップS209)。 In step S208, the sub CPU 106 performs a process of terminating the communication state between the communication device 100 and the external device. More specifically, the communication line with the external device is disconnected according to the communication protocol processing carried by the sub CPU 106. Then, the sub CPU 106 deletes the related information temporarily stored in the local memory 107 or the internal memory 113 of the header processing unit 110. After that, when the notification of the completion of disconnection of the communication line is transmitted from the sub CPU 106 to the main CPU 102, the application software displays to the user or the like that the communication line has been disconnected. After that, this process ends (step S209).

以上により、ヘッダ処理部110を適切に動作せることで、効率的にパケットの生成を行うことが可能となる。 As described above, by appropriately operating the header processing unit 110, it is possible to efficiently generate packets.

図3は実施形態におけるヘッダ処理部110の動作モードを判定する処理を示すフローチャートである。本実施形態において、図3に示される動作モードの判定処理は、ヘッダ処理部110が、サブCPU106から処理を開始する命令(ステップS204)を受け付けたことにより開始する(ステップS301)。ヘッダ処理部110は、サブCPU106により決定された(図6の処理により決定された)送信データの個数に応じて第1のモードと第2のモードを切り替える。 FIG. 3 is a flowchart showing a process of determining the operation mode of the header processing unit 110 in the embodiment. In the present embodiment, the operation mode determination process shown in FIG. 3 is started when the header processing unit 110 receives an instruction (step S204) to start the process from the sub CPU 106 (step S301). The header processing unit 110 switches between the first mode and the second mode according to the number of transmission data determined by the sub CPU 106 (determined by the process of FIG. 6).

ステップS302において、ヘッダ処理部110は、レジスタ部191に設定された送信データの個数が1であるか否かを判定する。送信データの個数が1であると判定された場合、ステップS303において、ヘッダ処理部110は、1つの送信データから、所定長を超えない1つ以上のパケットを生成する第1のモードで動作する。本実施形態では、所定長とは分割長であり、MSSを用いることができる。第1のモードでは、分割長を用いて通信ヘッダのシーケンス番号とペイロード長が計算される。第1のモードの詳細は図4で説明する。そして処理はS305へ進み、終了する。他方、ステップS302において、送信データの個数が1以外(複数)であると判定された場合、処理はステップS304へ進む。ステップS304において、ヘッダ処理部110は、複数の送信データからそれら送信データの個数を超えない数のパケットを生成する第2のモードで動作する。第2のモードでは、データ結合情報を用いて通信ヘッダのシーケンス番号とペイロード長が計算される。第2のモードの詳細は図5で説明する。そして処理はS305へ進み、終了する。 In step S302, the header processing unit 110 determines whether or not the number of transmission data set in the register unit 191 is 1. If it is determined that the number of transmitted data is 1, in step S303, the header processing unit 110 operates in the first mode of generating one or more packets that do not exceed a predetermined length from one transmitted data. .. In the present embodiment, the predetermined length is a divided length, and MSS can be used. In the first mode, the sequence number and payload length of the communication header are calculated using the split length. The details of the first mode will be described with reference to FIG. Then, the process proceeds to S305 and ends. On the other hand, if it is determined in step S302 that the number of transmitted data is other than 1 (plural), the process proceeds to step S304. In step S304, the header processing unit 110 operates in the second mode of generating a number of packets not exceeding the number of transmitted data from a plurality of transmitted data. In the second mode, the sequence number and payload length of the communication header are calculated using the data binding information. The details of the second mode will be described with reference to FIG. Then, the process proceeds to S305 and ends.

図3のフローチャートに示される処理と並行して、ヘッダ処理部110は、サブCPU106により入力されたひな形ヘッダのコピーを内部メモリ113に生成する。もちろん、ひな形ヘッダのコピー完了前や完了後に図3に示される処理が行われても問題はない。ひな形ヘッダのコピーの個数は、レジスタ部191に設定されたパケット数と等しい。通信ヘッダの各部位の修正はこのコピーと同時に行われてもよいし、コピー後に上書きする形で行われてもよい。 In parallel with the processing shown in the flowchart of FIG. 3, the header processing unit 110 generates a copy of the template header input by the sub CPU 106 in the internal memory 113. Of course, there is no problem even if the process shown in FIG. 3 is performed before or after the copy of the template header is completed. The number of copies of the template header is equal to the number of packets set in the register unit 191. Modification of each part of the communication header may be performed at the same time as this copy, or may be performed by overwriting after copying.

図4は、ステップS303において実行される、第1のモードにおける各パケットのペイロード長の計算とシーケンス番号の計算の処理を示すフローチャートである。ひな形ヘッダのコピーが終了していなくてもよいが、計算とヘッダ修正の両方を同時に行う場合、該当部分のヘッダコピーは少なくとも終わっている必要がある。同時に行わない場合は、一時格納領域に計算結果を保存しておく必要がある。図中に記載されているシーケンス番号[i]はi番目のパケットのシーケンス番号の値を表しており、最初のパケットのシーケンス番号はシーケンス番号[0]で表わされるものとする。また、図中に記載されているペイロード長[i]は、i番目のパケットのペイロード長を表しており、最初のパケットのペイロード長はペイロード長[0]で表わされるものとする。 FIG. 4 is a flowchart showing a process of calculating the payload length and the sequence number of each packet in the first mode, which is executed in step S303. The copy of the template header does not have to be completed, but if both the calculation and the header modification are performed at the same time, the header copy of the corresponding part must be completed at least. If not done at the same time, it is necessary to save the calculation result in the temporary storage area. It is assumed that the sequence number [i] shown in the figure represents the value of the sequence number of the i-th packet, and the sequence number of the first packet is represented by the sequence number [0]. Further, the payload length [i] shown in the figure represents the payload length of the i-th packet, and the payload length of the first packet is represented by the payload length [0].

ステップS402において、通信ヘッダ生成部192は、変数iを初期化する(i=0)。次に、ステップS403において、通信ヘッダ生成部192は、最初のパケットに対する処理であるかどうかを判断する。最初のパケットに対する処理であると判断された場合、処理はステップS405へすすみ、そうでない場合は、処理はステップS404へ進む。この判断基準に変数iを使用しても構わない。すなわち、i=0の場合は最初のパケットに対する処理であると判断し、i≠0の場合は最初のパケットに対する処理ではないと判断する。 In step S402, the communication header generation unit 192 initializes the variable i (i = 0). Next, in step S403, the communication header generation unit 192 determines whether or not the processing is for the first packet. If it is determined that the processing is for the first packet, the processing proceeds to step S405, and if not, the processing proceeds to step S404. The variable i may be used as this criterion. That is, when i = 0, it is determined that the processing is for the first packet, and when i ≠ 0, it is determined that the processing is not for the first packet.

ステップS404において、通信ヘッダ生成部192は、i(≠0)番目のパケットのヘッダに記載するシーケンス番号を計算する。シーケンス番号[i]は、レジスタ部191(設定情報)に設定された初期シーケンス番号からそれまでのパケット(i-1番目のパケット)のペイロード長の総和を加算したものである。たとえば、3番目のパケットに対する計算の場合、1番目のパケットのペイロード長と2番目のパケットのペイロード長の総和が、「それまでのパケットのペイロード長の総和」となる。計算が終了すると、処理はステップS406へ進む。 In step S404, the communication header generation unit 192 calculates the sequence number described in the header of the i (≠ 0) th packet. The sequence number [i] is the sum of the total payload lengths of the packets (i-1st packet) up to that point from the initial sequence number set in the register unit 191 (setting information). For example, in the case of calculation for the third packet, the sum of the payload length of the first packet and the payload length of the second packet is the "sum of the payload lengths of the packets so far". When the calculation is completed, the process proceeds to step S406.

ステップS405では、通信ヘッダ生成部192は、ステップS404と同様にi番目のパケットのヘッダに記載するシーケンス番号を計算する。ステップS405に処理が到達する場合はi=0であるため、シーケンス番号[i]には、レジスタ部191に設定された初期シーケンス番号が使用される。計算が終了すると、処理はステップS406へ進む。 In step S405, the communication header generation unit 192 calculates the sequence number described in the header of the i-th packet as in step S404. Since i = 0 when the process reaches step S405, the initial sequence number set in the register unit 191 is used for the sequence number [i]. When the calculation is completed, the process proceeds to step S406.

ステップS406において、通信ヘッダ生成部192は、最後のパケットに対する処理であるかどうかを判断する。この判断は、例えば変数iの値とレジスタ部191に設定されたパケット数を比較することにより行える。最後のパケットに対する処理ではない判定された場合、ステップS407において、通信ヘッダ生成部192は、i番目のパケットのペイロード長を計算する。ペイロード長は、レジスタ部191に設定される分割長と同じとする。計算が終了すると、ステップS408において、通信ヘッダ生成部192は、変数iに1を加算する。その後、通信ヘッダ生成部192は、処理をステップS403に戻し、次のパケットのシーケンス番号とペイロード長を計算する。 In step S406, the communication header generation unit 192 determines whether or not the processing is for the last packet. This determination can be made, for example, by comparing the value of the variable i with the number of packets set in the register unit 191. If it is determined that the processing is not for the last packet, in step S407, the communication header generation unit 192 calculates the payload length of the i-th packet. The payload length is the same as the division length set in the register unit 191. When the calculation is completed, in step S408, the communication header generation unit 192 adds 1 to the variable i. After that, the communication header generation unit 192 returns the process to step S403 and calculates the sequence number and payload length of the next packet.

ステップS406において、最後のパケットに対する処理であると判断された場合、ステップS409において、通信ヘッダ生成部192は、i番目のパケットのペイロード長を計算する。ステップS409では、ペイロード長[i]は、レジスタ部191に設定されている送信データ長から、分割長とパケット数から1を差し引いた値との積を差し引いた値である。すなわち、送信データ長からそれまでのパケットのペイロード分を差し引くことで残りの送信データ長を算出し、その値が最後のパケットのペイロード長となる。計算が終了すると、本処理は終了する(ステップS410)。なお、図4のフローチャートは第1のモードの処理であり、ヘッダ処理部110に入力される送信データの個数は1つである。そのため、フローチャートに記載されている送信データ長に対して明示的に番号を付加していない。 If it is determined in step S406 that the process is for the last packet, in step S409, the communication header generation unit 192 calculates the payload length of the i-th packet. In step S409, the payload length [i] is a value obtained by subtracting the product of the divided length and the value obtained by subtracting 1 from the number of packets from the transmission data length set in the register unit 191. That is, the remaining transmission data length is calculated by subtracting the payload portion of the packet up to that point from the transmission data length, and that value becomes the payload length of the last packet. When the calculation is completed, this process ends (step S410). The flowchart of FIG. 4 is the processing of the first mode, and the number of transmission data input to the header processing unit 110 is one. Therefore, a number is not explicitly added to the transmission data length described in the flowchart.

以上により、第1のモードにおいて、1つの送信データから各パケットのシーケンス番号とペイロード長を計算することが可能となる。 As described above, in the first mode, it is possible to calculate the sequence number and the payload length of each packet from one transmission data.

図5は、ステップS304において実行される、第2のモードにおける各パケットのペイロード長の計算とシーケンス番号の計算の処理を示すフローチャートである。なお、第1のモードの処理(図4)と同様に、ひな形ヘッダのコピーが終了していなくてもよいが、計算とヘッダ修正の両方を同時に行う場合は、該当部分のヘッダコピーは少なくとも終わっている必要がある。同時に行わない場合は、一時格納領域に計算結果を保存しておく必要がある。図5に記載されているシーケンス番号[i]とペイロード長[i]は図4で説明したものと同様である。また、送信データ長[k]は、ヘッダ処理部110に入力されたk番目の送信データの長さを表しており、最初の送信データの長さは送信データ長[0]で表される。 FIG. 5 is a flowchart showing a process of calculating the payload length and the sequence number of each packet in the second mode, which is executed in step S304. As in the process of the first mode (FIG. 4), the copy of the template header does not have to be completed, but when both the calculation and the header correction are performed at the same time, the header copy of the corresponding part is at least. Must be finished. If not done at the same time, it is necessary to save the calculation result in the temporary storage area. The sequence number [i] and the payload length [i] shown in FIG. 5 are the same as those described in FIG. Further, the transmission data length [k] represents the length of the kth transmission data input to the header processing unit 110, and the length of the first transmission data is represented by the transmission data length [0].

ステップS502において、ヘッダ処理部110の通信ヘッダ生成部192は、変数iと変数kと変数tmpを初期化する。初期化を終えると、ステップS503において、通信ヘッダ生成部192は、tmpに送信データ長[k]の値を加算する。次に、ステップS504において、通信ヘッダ生成部192は、変数kに1を加算する。次に、ステップS505において、通信ヘッダ生成部192は、k-1番目の送信データを次の送信データ(k番目の送信データ)と結合するかどうかを判定する。結合すると判定された場合、処理はステップS503に戻り、結合しないと判定された場合、処理はステップS506へ進む。 In step S502, the communication header generation unit 192 of the header processing unit 110 initializes the variable i, the variable k, and the variable tmp. When the initialization is completed, in step S503, the communication header generation unit 192 adds the value of the transmission data length [k] to the tpm. Next, in step S504, the communication header generation unit 192 adds 1 to the variable k. Next, in step S505, the communication header generation unit 192 determines whether or not to combine the k-1st transmission data with the next transmission data (kth transmission data). If it is determined to be combined, the process returns to step S503, and if it is determined not to be combined, the process proceeds to step S506.

次の送信データ(隣接する送信データ)を結合するか否かの判定には、データ結合の要否を示すデータ結合情報が用いられる。図7(b)により上述したように、本実施形態のデータ結合情報は1つの送信データに対して1ビットの情報である。データ結合情報が0値である場合は次の送信データと結合することを示し、データ結合情報が1値である場合は次の送信データと結合しないことを示す。たとえば、送信データの数が3つであり、データ結合情報が最初の送信データから0、1、1である場合は、最初と二番目の送信データを結合してパケットを生成し、三番目の送信データだけでパケットを生成することを意味する。ヘッダ処理部110のレジスタに入力する生成パケット数とデータ結合情報の総和(今回の例では、0+1+1=2)は等しくなるように入力しなければならない。データ結合情報の入力は専用のレジスタを用意しても構わないが、1つの送信データに1ビットの情報だけなので、他のレジスタ領域の特定フィールドを使用してもよい。たとえば、ヘッダ処理部110が扱える送信データの最長が64キロバイト(一般的なTCPの最大ウィンドウサイズ)である場合、最大で16ビットしか使用しない。1つのレジスタが32ビットで構成する場合であれば、使われないビット領域が存在するので、そのようなビット領域を活用することが可能である。 Data combination information indicating the necessity of data combination is used for determining whether or not to combine the next transmission data (adjacent transmission data). As described above with reference to FIG. 7B, the data combination information of the present embodiment is 1-bit information for one transmission data. When the data binding information is 0 value, it indicates that it is combined with the next transmission data, and when the data binding information is 1 value, it indicates that it is not combined with the next transmission data. For example, if the number of transmitted data is three and the data binding information is 0, 1, 1 from the first transmitted data, the first and second transmitted data are combined to generate a packet, and the third is It means that a packet is generated only from the transmitted data. The number of generated packets to be input to the register of the header processing unit 110 and the sum of the data combination information (0 + 1 + 1 = 2 in this example) must be input so as to be equal. A dedicated register may be prepared for inputting data binding information, but since only one bit of information is used for one transmission data, a specific field in another register area may be used. For example, if the maximum transmission data that can be handled by the header processing unit 110 is 64 kilobytes (the maximum window size of general TCP), only 16 bits are used at the maximum. If one register is composed of 32 bits, there is an unused bit area, and it is possible to utilize such a bit area.

ステップS506において、通信ヘッダ生成部192は、i番目のパケットのペイロード長(ペイロード長[i])にステップS503で計算したtmpの値をセットする。次に、ステップS507において、通信ヘッダ生成部192は、変数tmpを0に初期化する。続いて、ステップS508において、通信ヘッダ生成部192は、直前までの処理が最初のパケットに対する処理であるかどうかを判定する。この判定は、例えば、iが0か否かにより行うことができる。 In step S506, the communication header generation unit 192 sets the payload length (payload length [i]) of the i-th packet to the value of tp calculated in step S503. Next, in step S507, the communication header generation unit 192 initializes the variable tmp to 0. Subsequently, in step S508, the communication header generation unit 192 determines whether or not the processing up to the immediately preceding is the processing for the first packet. This determination can be made, for example, by whether or not i is 0.

ステップS508において最初のパケットに対する処理ではない(i≠0の場合)と判定された場合、ステップS509において、通信ヘッダ生成部192は、i番目のパケットのヘッダに記載するシーケンス番号(シーケンス番号[i])を計算する。シーケンス番号[i]は、レジスタに設定された初期シーケンス番号からそれまでのパケットのペイロード長の総和を加算したものである。その後、処理はステップS511へ進む。他方、最初のパケットに対する処理であると判定された場合(i=0の場合)、ステップS510において、通信ヘッダ生成部192は、シーケンス番号[i]として、レジスタ部191(設定情報)に設定された初期シーケンス番号を設定する。その後、処理はステップS511へ進む。 When it is determined in step S508 that the processing is not for the first packet (when i ≠ 0), in step S509, the communication header generation unit 192 uses the sequence number (sequence number [i]) described in the header of the i-th packet. ]) Is calculated. The sequence number [i] is the sum of the initial sequence number set in the register and the total payload lengths of the packets up to that point. After that, the process proceeds to step S511. On the other hand, when it is determined that the processing is for the first packet (when i = 0), the communication header generation unit 192 is set in the register unit 191 (setting information) as the sequence number [i] in step S510. Set the initial sequence number. After that, the process proceeds to step S511.

ステップS511において、通信ヘッダ生成部192は、変数iに1を加算する。そして、ステップS512において、通信ヘッダ生成部192は、直前の処理が最後のパケットに対する処理であるかどうかで処理を分岐する。最後のパケットに対する処理であると判定された場合、本処理は終了する(ステップS513)。他方、直前の処理が最後のパケットに対する処理ではないと判定された場合、通信ヘッダ生成部192は、処理をステップS503へ戻し、上述の処理を繰り返す。なお、この判断は、例えば変数iの値とレジスタ部191に設定されたパケット数を比較することにより行える。 In step S511, the communication header generation unit 192 adds 1 to the variable i. Then, in step S512, the communication header generation unit 192 branches the processing depending on whether or not the immediately preceding processing is the processing for the last packet. If it is determined that the process is for the last packet, this process ends (step S513). On the other hand, when it is determined that the immediately preceding process is not the process for the last packet, the communication header generation unit 192 returns the process to step S503 and repeats the above process. This determination can be made, for example, by comparing the value of the variable i with the number of packets set in the register unit 191.

以上により、第2のモードにおいて、複数の送信データから各パケットのシーケンス番号とペイロード長を計算することが可能となる。 As described above, in the second mode, it is possible to calculate the sequence number and the payload length of each packet from a plurality of transmission data.

なお、図4、図5のフローチャートにより各パケットのシーケンス番号とペイロード長の計算方法を示したが、ひな形ヘッダのコピー後に各パケットのヘッダを完成させるにはその他の領域も修正する必要がある。 Although the calculation method of the sequence number and the payload length of each packet is shown by the flowcharts of FIGS. 4 and 5, it is necessary to modify other areas in order to complete the header of each packet after copying the template header. ..

IPヘッダのLengthフィールドは図4や図5のシーケンスで計算したペイロード長とヘッダ処理部110に入力されるひな形ヘッダの長さから計算できる。IPヘッダのIdentificationフィールドは各IPパケットで独立した値である必要があるため、ヘッダ処理部110で自動的に用意してもよいし、サブCPU106からレジスタに入力してもらっても構わない。IPヘッダのチェックサムはひな形ヘッダの情報と計算したペイロード長やひな形ヘッダの長さ、Identificationから計算できる。IPヘッダの領域のサム演算を行いながらひな形ヘッダのコピーを行えば、より効果的にIPヘッダのチェックサムを計算することが可能となる。 The Length field of the IP header can be calculated from the payload length calculated in the sequence of FIGS. 4 and 5 and the length of the template header input to the header processing unit 110. Since the Identity field of the IP header needs to be an independent value for each IP packet, it may be automatically prepared by the header processing unit 110 or may be input to the register from the sub CPU 106. The checksum of the IP header can be calculated from the information of the template header, the calculated payload length, the length of the template header, and the Identity. If the template header is copied while performing the sum calculation of the IP header area, the checksum of the IP header can be calculated more effectively.

TCPヘッダのチェックサムに関しては、DMAコントローラ108に通信パケットの通信ヘッダ部分と通信パケットのペイロード部分を連続して読み込ませて16ビット毎に1の補数和を計算させてチェックサム値を算出させる。DMAコントローラ108は複数の領域から補数和を計算できるため、疑似ヘッダを考慮した計算が可能である。ヘッダ処理部110はTCPヘッダのチェックサム計算を行うために、これらを考慮してDMAコントローラ108を制御する。さらに、算出したチェックサム値は元の通信パケットの通信ヘッダの所定の場所に書き込まれるように制御を行う。 Regarding the checksum of the TCP header, the DMA controller 108 is made to continuously read the communication header part of the communication packet and the payload part of the communication packet, calculate the one's complement sum for every 16 bits, and calculate the checksum value. Since the DMA controller 108 can calculate the complement sum from a plurality of regions, the calculation in consideration of the pseudo header is possible. The header processing unit 110 controls the DMA controller 108 in consideration of these in order to perform the checksum calculation of the TCP header. Further, the calculated checksum value is controlled so as to be written in a predetermined place in the communication header of the original communication packet.

(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

100:通信装置、101:システムバス、102:メインCPU、103:メインメモリ、104:サブシステム、105:ローカルバス、106:サブCPU、107:ローカルメモリ、108:DMAコントローラ、110:ヘッダ処理部 100: Communication device, 101: System bus, 102: Main CPU, 103: Main memory, 104: Subsystem, 105: Local bus, 106: Sub CPU, 107: Local memory, 108: DMA controller, 110: Header processing unit

Claims (15)

パケット生成システムを備えたパケット生成装置であって、
前記パケット生成システムに配備されたローカルメモリの内の1つの送信バッファに送信対象データの全体が格納できているかの判断処理に基づいて、前記送信対象データを1つの送信データとする、もしくは前記送信対象データからそれぞれが所定長を越えない複数の送信データを生成することを決定する決定手段と、
パケット生成のモードとして、前記1つの送信データからペイロード長が前記所定長を超えない1つ以上のパケットを生成する第1のモードと、前記複数の送信データからそれら送信データの個数を超えない数のパケットを生成する第2のモードと、を有する生成手段と、を備え、
前記生成手段は、前記第1のモードで動作する場合、前記所定長を基に前記送信データからパケットを生成し、前記第2のモードで動作する場合、送信データの結合関係を基に前記送信データからパケットを生成することを特徴とするパケット生成装置。
A packet generator equipped with a packet generation system.
Based on the determination process of determining whether the entire transmission target data can be stored in one transmission buffer in the local memory deployed in the packet generation system, the transmission target data is regarded as one transmission data , or the transmission target data is described. A determination means for determining to generate a plurality of transmission data, each of which does not exceed a predetermined length, from the transmission target data .
As the packet generation modes, a first mode for generating one or more packets whose payload length does not exceed the predetermined length from the one transmission data, and a number not exceeding the number of the transmission data from the plurality of transmission data. A second mode for generating a packet of, and a generation means having .
When operating in the first mode, the generation means generates a packet from the transmission data based on the predetermined length, and when operating in the second mode, the transmission means based on the coupling relationship of the transmission data. A packet generator characterized by generating packets from data .
前記生成手段は、前記第1のモードで動作する場合に、前記送信データを前記所定長で分割し、分割された送信データごとにパケットを生成することを特徴とする請求項1に記載のパケット生成装置。 The packet according to claim 1, wherein the generation means divides the transmission data into the predetermined lengths and generates a packet for each of the divided transmission data when operating in the first mode. Generator. 前記生成手段は、前記第1のモードで動作する場合に、生成されるパケットのペイロード長とシーケンス番号を、前記所定長を用いて計算することを特徴とする請求項1に記載のパケット生成装置。 The packet generation device according to claim 1, wherein the generation means calculates the payload length and the sequence number of the generated packet by using the predetermined length when operating in the first mode. .. 前記ローカルメモリの1つの送信バッファに前記送信対象データの全体が格納されている場合、前記第1のモードが実行されることを特徴とする請求項1乃至3のいずれか1項に記載のパケット生成装置。 The packet according to any one of claims 1 to 3, wherein the first mode is executed when the entire transmission target data is stored in one transmission buffer of the local memory. Generator. 前記所定長は、通信プロトコルで決定される最大セグメントサイズであることを特徴とする請求項1乃至4のいずれか1項に記載のパケット生成装置。 The packet generator according to any one of claims 1 to 4, wherein the predetermined length is a maximum segment size determined by a communication protocol. 前記決定手段は、前記ローカルメモリに設けられた複数の送信バッファに分離して格納された前記複数の送信データについて、前記送信対象データを構成する並びにおいて隣接する送信データの結合の要否を指示するデータ結合情報を生成し、
前記生成手段は、前記第2のモードで動作する場合に、前記データ結合情報に従って送信データを結合してパケット生成ることを特徴とする請求項1乃至5のいずれか1項に記載のパケット生成装置。
The determination means determines whether or not it is necessary to combine adjacent transmission data in a sequence constituting the transmission target data for the plurality of transmission data separately stored in a plurality of transmission buffers provided in the local memory. Generates the data binding information to be instructed and
The generation means according to any one of claims 1 to 5, wherein when operating in the second mode, the transmission data is combined according to the data combination information to generate a packet. Packet generator.
前記データ結合情報は、1つの送信データに対して1ビットの情報であることを特徴とする請求項に記載のパケット生成装置。 The packet generation device according to claim 6 , wherein the data combination information is 1-bit information for one transmission data. 前記決定手段は、送信データが次の送信データと結合されても結合された送信データのサイズが前記所定長を超えない場合に、これら送信データを結合させるようにデータ結合情報を生成することを特徴とする請求項またはに記載のパケット生成装置。 The determination means generates data binding information so as to combine the transmission data when the transmission data is combined with the next transmission data and the size of the combined transmission data does not exceed the predetermined length . The packet generator according to claim 6 or 7 . 前記決定手段は、前記データ結合情報の生成において、通信相手の性能に基づいて送信データを隣接する送信データと結合するか否かを決定することを特徴とする請求項乃至のいずれか1項に記載のパケット生成装置。 One of claims 6 to 8 , wherein the determination means determines whether or not to combine the transmission data with the adjacent transmission data based on the performance of the communication partner in the generation of the data combination information. The packet generator described in the section. 前記生成手段は、前記第2のモードで動作する場合に、パケットの生成に用いられる送信データのサイズを使用して、パケットのペイロード長とシーケンス番号を算出することを特徴とする請求項乃至のいずれか1項に記載のパケット生成装置。 5. The generation means is characterized in that, when operating in the second mode, the size of the transmission data used for generating the packet is used to calculate the payload length and the sequence number of the packet. 9. The packet generator according to any one of 9. 前記ローカルメモリにおいて、1つの送信バッファは連続したアドレスのメモリ空間で構成され、前記送信対象データが複数の送信バッファに分かれて格納された場合、前記生成手段は、前記複数の送信バッファの個数以上の送信データからなる前記複数の送信データを生成することを特徴とする請求項1乃至10のいずれか1項に記載のパケット生成装置。 In the local memory, one transmission buffer is composed of a memory space having consecutive addresses, and when the transmission target data is divided and stored in a plurality of transmission buffers , the generation means is equal to or more than the number of the plurality of transmission buffers. The packet generation device according to any one of claims 1 to 10 , wherein the plurality of transmission data composed of the transmission data of the above are generated. 前記生成手段は、前記送信対象データが複数の送信バッファに分かれて格納された場合において、1つの送信バッファに前記所定長を超えるサイズのデータが格納されている場合は、当該データから前記所定長を超えない2つ以上の送信データを生成することを特徴とする請求項11に記載のパケット生成装置。 When the transmission target data is separately stored in a plurality of transmission buffers and the data having a size exceeding the predetermined length is stored in one transmission buffer, the generation means obtains the predetermined length from the data. The packet generation device according to claim 11 , wherein two or more transmission data not exceeding the above are generated . 請求項1乃至12のいずれか1項に記載されたパケット生成装置と、
所定のアプリケーションの実行により前記送信対象データを生成する処理手段と、
前記送信対象データを前記ローカルメモリにより提供される送信バッファへ転送する転送手段と、
前記パケット生成装置により生成されたパケットを送信することにより、前記送信対象データを送信する送信手段と、を備えることを特徴とする通信装置。
The packet generator according to any one of claims 1 to 12 .
A processing means for generating the transmission target data by executing a predetermined application, and
A transfer means for transferring the transmission target data to the transmission buffer provided by the local memory, and
A communication device comprising: a transmission means for transmitting the transmission target data by transmitting a packet generated by the packet generation device.
パケット生成システムを備えたパケット生成装置の制御方法であって、
前記パケット生成システムに配備されたローカルメモリのうちの1つの送信バッファ送信対象データの全体が格納できているかの判断処理に基づいて、前記送信対象データを1つの送信データとする、もしくは前記送信対象データからそれぞれが所定長を越えない複数の送信データを生成することを決定する決定工程と、
パケット生成のモードとして、前記1つの送信データからペイロード長が前記所定長を超えない1つ以上のパケットを生成する第1のモードと、前記複数の送信データからそれら送信データの個数を超えない数のパケットを生成する第2のモードと、を有する生成工程と、を有し、
前記生成工程では、前記第1のモードで動作する場合、前記所定長を基に前記送信データからパケットを生成し、前記第2のモードで動作する場合、送信データの結合関係を基に前記送信データからパケットを生成することを特徴とするパケット生成装置の制御方法。
It is a control method of a packet generator equipped with a packet generator.
Based on the determination process of determining whether the entire transmission target data can be stored in the transmission buffer of one of the local memories deployed in the packet generation system, the transmission target data is regarded as one transmission data , or the transmission is performed. A decision process that determines to generate multiple transmission data, each of which does not exceed a predetermined length, from the target data .
As the packet generation modes, a first mode for generating one or more packets whose payload length does not exceed the predetermined length from the one transmission data, and a number not exceeding the number of the transmission data from the plurality of transmission data. It has a second mode of generating a packet of, and a generation process having.
In the generation step, when operating in the first mode, a packet is generated from the transmission data based on the predetermined length, and when operating in the second mode, the transmission is based on the coupling relationship of the transmission data. A method for controlling a packet generator, which comprises generating a packet from data .
所定のアプリケーションの実行により送信対象データを生成する第1の生成工程と、
前記送信対象データをローカルメモリにより提供される送信バッファへ転送する転送工程と、
前記ローカルメモリのうちの1つの送信バッファ前記送信対象データの全体が格納できているかの判断処理に基づいて、前記送信対象データを1つの送信データとする、もしくは前記送信対象データからそれぞれが所定長を越えない複数の送信データを生成することを決定する決定工程と、
前記1つの送信データからペイロード長が前記所定長を超えない1つ以上のパケットを生成する第1のモードと、前記複数の送信データからそれら送信データの個数を超えない数のパケットを生成する第2のモードとを、実行する第2の生成工程と、
前記第2の生成工程で生成されたパケットを送信する送信工程と、を備え
前記第2の生成工程では、前記第1のモードで動作する場合、前記所定長を基に前記送信データからパケットを生成し、前記第2のモードで動作する場合、送信データの結合関係を基に前記送信データからパケットを生成することを特徴とする通信装置の制御方法。
The first generation step of generating the data to be transmitted by executing a predetermined application, and
The transfer step of transferring the transmission target data to the transmission buffer provided by the local memory, and
Based on the determination process of determining whether the entire transmission target data can be stored in one transmission buffer of the local memory, the transmission target data is regarded as one transmission data , or each is predetermined from the transmission target data. The decision-making process that determines to generate multiple transmission data that does not exceed the length, and
A first mode for generating one or more packets whose payload length does not exceed the predetermined length from the one transmission data, and a first mode for generating a number of packets not exceeding the number of the transmission data from the plurality of transmission data. The second generation step to execute the second mode and
A transmission step of transmitting the packet generated in the second generation step is provided .
In the second generation step, when operating in the first mode, a packet is generated from the transmission data based on the predetermined length, and when operating in the second mode, the coupling relationship of the transmission data is used. A method for controlling a communication device, which comprises generating a packet from the transmission data .
JP2017219329A 2017-11-14 2017-11-14 Communication equipment, packet generators and their control methods Active JP7005303B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017219329A JP7005303B2 (en) 2017-11-14 2017-11-14 Communication equipment, packet generators and their control methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017219329A JP7005303B2 (en) 2017-11-14 2017-11-14 Communication equipment, packet generators and their control methods

Publications (2)

Publication Number Publication Date
JP2019092035A JP2019092035A (en) 2019-06-13
JP7005303B2 true JP7005303B2 (en) 2022-02-10

Family

ID=66836678

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017219329A Active JP7005303B2 (en) 2017-11-14 2017-11-14 Communication equipment, packet generators and their control methods

Country Status (1)

Country Link
JP (1) JP7005303B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006081033A (en) 2004-09-10 2006-03-23 Canon Inc Communication control apparatus and method
JP2010041458A (en) 2008-08-06 2010-02-18 Toshiba Corp Transmitter, receiver and communication system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0955718A (en) * 1995-08-17 1997-02-25 Nec Corp Data communication device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006081033A (en) 2004-09-10 2006-03-23 Canon Inc Communication control apparatus and method
JP2010041458A (en) 2008-08-06 2010-02-18 Toshiba Corp Transmitter, receiver and communication system

Also Published As

Publication number Publication date
JP2019092035A (en) 2019-06-13

Similar Documents

Publication Publication Date Title
EP0996069B1 (en) Method of transferring image data using a IEEE 1394 bus
CN109992405B (en) Method and network card for processing data message
CN104395895A (en) Systems and methods for input/output virtualization
JP2009031954A (en) Data processing apparatus and data transfer method
JP2005102037A (en) Packet communication device
EP3563534B1 (en) Transferring packets between virtual machines via a direct memory access device
US8965996B2 (en) Communication apparatus, information processing apparatus, and method for controlling communication apparatus
US20100183009A1 (en) Discriminatory mtu fragmentation in a logical partition
JP5094482B2 (en) Processing apparatus and processing method thereof
JP2005167965A (en) Packet processing method and apparatus
WO2022151475A1 (en) Message buffering method, memory allocator, and message forwarding system
US20210006264A1 (en) Dma transfer apparatus, method of controlling the same, communication apparatus, method of controlling the same, and non-transitory computer-readable storage medium
JP7005303B2 (en) Communication equipment, packet generators and their control methods
CN114385534A (en) Data processing method and device
CN116644010A (en) Data processing method, device, equipment and medium
JP2004207891A (en) Data communication apparatus, data communication method, data communication program, and recording medium having data communication program recorded thereon
US9509559B2 (en) Bandwidth control apparatus, bandwidth control method, and bandwidth control program
CN111800340B (en) Data packet forwarding method and device
JP7027145B2 (en) Communication equipment, control methods and programs for communication equipment
JP2004094931A (en) Network system and communication method in network
JP7321913B2 (en) Communication device, control method and program
JP6938399B2 (en) Communication equipment, communication methods and programs
JP6873953B2 (en) Communication equipment, control methods and programs for communication equipment
JP7049140B2 (en) Communication equipment and its control method
JP6976786B2 (en) Communication device and control method of communication device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200902

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20210103

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210113

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210526

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210604

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210730

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20211206

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220105

R151 Written notification of patent or utility model registration

Ref document number: 7005303

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151