[go: up one dir, main page]

JP2013090200A - Memory management method of communication device, communication device, and program - Google Patents

Memory management method of communication device, communication device, and program Download PDF

Info

Publication number
JP2013090200A
JP2013090200A JP2011229893A JP2011229893A JP2013090200A JP 2013090200 A JP2013090200 A JP 2013090200A JP 2011229893 A JP2011229893 A JP 2011229893A JP 2011229893 A JP2011229893 A JP 2011229893A JP 2013090200 A JP2013090200 A JP 2013090200A
Authority
JP
Japan
Prior art keywords
memory
communication
data
unit
size
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.)
Pending
Application number
JP2011229893A
Other languages
Japanese (ja)
Inventor
Motoharu Suzuki
基治 鈴木
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 JP2011229893A priority Critical patent/JP2013090200A/en
Publication of JP2013090200A publication Critical patent/JP2013090200A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)
  • Communication Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a memory management method in which a basic size of a logical memory is determined, a logic memory size is managed at a fixed length, and memory utilization efficiency is high, in memory management.SOLUTION: A basic size of a logical memory is determined on the basis of a communication method, the logical memory of the basic size is set at a memory, and data received or data to be sent is stored in the logical memory.

Description

本発明は、通信装置におけるメモリ管理方法に関する。   The present invention relates to a memory management method in a communication device.

通信処理において、他機器が必要とするデータを他機器に送信する場合、通信処理に求められる処理は大きく分けると以下の3つがある。第一に、送信すべきデータを自機器のアプリケーションから受け取る。第二に、通信するにあたり必要となるヘッダ付与等のプロトコル処理をデータに施す。第三にヘッダを伴ったデータ、すなわちパケットを他機器との通信インターフェイスに送信する。   In communication processing, when data required by another device is transmitted to another device, the processing required for the communication processing is roughly divided into the following three. First, data to be transmitted is received from the application of the own device. Second, protocol processing such as header addition necessary for communication is performed on the data. Third, data with a header, that is, a packet is transmitted to a communication interface with another device.

通信処理において、自機器が必要とするデータを他機器から受信する場合にも、同様に以下の3つの処理がある。第一に、パケットを他機器との通信インターフェイスから受信する。第二に、通信するために必要であったプロトコル処理を解除し、前記パケットに含まれるデータを必要としている自機器のアプリケーションを特定する。第三に、自機器の特定されたアプリケーションに対して前記パケットから取り出したデータを送信する。   In the communication process, when data required by the own device is received from another device, the following three processes are similarly performed. First, a packet is received from a communication interface with another device. Second, the protocol processing necessary for communication is canceled, and the application of the own device that needs the data included in the packet is specified. Third, the data extracted from the packet is transmitted to the specified application of the own device.

このように、通信処理においては、送受信したいデータがアプリケーション処理部、通信処理部、インターフェイス処理部と複数の場所を移動する。さらにプロトコルの複雑性によっては、データ移動や連結といったメモリコピー処理が必要になるケースがある。よって、データの効率的なメモリへの格納方法が通信処理効率の向上に繋がる。例えばLinux(登録商標)では、sk_buffと呼ばれるメモリ管理方法を実装している。さらに、メモリ管理方法において、次のような先行技術がある。   Thus, in communication processing, data to be transmitted / received moves between an application processing unit, a communication processing unit, and an interface processing unit. Furthermore, depending on the complexity of the protocol, there may be cases where memory copy processing such as data movement and connection is required. Therefore, an efficient method for storing data in the memory leads to an improvement in communication processing efficiency. For example, Linux (registered trademark) implements a memory management method called sk_buff. Furthermore, there are the following prior arts in the memory management method.

例えば、複数のバッファを持ち、各データ・パケットの長さによって必要とされるような1つまたは複数のバッファに、データ・パケットが記憶されるパケット・メモリ部がある(特許文献1)。また、第一に、受信バッファでパケットの解析をし、第二に、予めアプリケーションと通信処理部で共有したユーザーバッファのアドレス情報にアドレス変換を行ってデータを転送する方法がある(特許文献2)。さらに、2つの転送モードを持つ通信処理において、それぞれ独立したDMAコントローラとヘッダ用メモリとペイロード用のメモリを配置することにより、データ転送を行う方法がある(特許文献3)。   For example, there is a packet memory unit that has a plurality of buffers and stores data packets in one or a plurality of buffers as required by the length of each data packet (Patent Document 1). First, there is a method in which a packet is analyzed by a reception buffer, and second, data is transferred by performing address conversion on address information of a user buffer shared in advance by an application and a communication processing unit (Patent Document 2). ). Further, in communication processing having two transfer modes, there is a method of performing data transfer by arranging an independent DMA controller, header memory, and payload memory, respectively (Patent Document 3).

特開平4−336729号公報JP-A-4-336729 特開平7−78112号公報JP-A-7-78112 特開2005−137022号公報Japanese Patent Laid-Open No. 2005-137022

通信を行う際に使用するメモリを複数の論理メモリとして扱うメモリ管理をすることにより、処理効率の向上が図れる。その際にメモリ管理は論理メモリサイズを固定長にすると管理しやすい。しかし、固定長に小さな値を用いたことで格納するデータが分割されると、分割されたデータを連結する処理が発生し、スループットが低下する要因となる。また、固定長に大きな値を用いた場合、メモリ利用効率が劣化することがある。   Processing efficiency can be improved by performing memory management that treats a memory used for communication as a plurality of logical memories. In this case, the memory management is easy if the logical memory size is fixed. However, if the data to be stored is divided by using a small value for the fixed length, a process of connecting the divided data occurs, which causes a decrease in throughput. In addition, when a large value is used for the fixed length, the memory utilization efficiency may deteriorate.

本発明は、上記の課題に鑑みてなされたものであり、通信を行う際に使用するメモリに、通信に適した所定長の論理メモリサイズを設定してスループットの低下、メモリ利用効率の劣化を防ぐ通信処理におけるメモリ管理方法を提供することを目的とする。   The present invention has been made in view of the above-mentioned problems, and a predetermined length of a logical memory size suitable for communication is set in a memory used for communication to reduce throughput and memory utilization efficiency. An object of the present invention is to provide a memory management method for preventing communication processing.

上記課題を解決するために、本発明の受信したデータ又は送信要求されたデータを格納するメモリを備える通信装置におけるメモリ管理方法は、通信開始時に通知された通信方式に基づいて論理メモリの基本サイズを決定する工程と、前記メモリに前記基本サイズの論理メモリを設定する工程と、前記論理メモリに受信したデータ又は送信要求されたデータを格納する工程とを含むことを特徴とする。   In order to solve the above problems, a memory management method in a communication device including a memory for storing received data or data requested to be transmitted according to the present invention is based on a basic size of a logical memory based on a communication method notified at the start of communication. , Determining the basic size logical memory in the memory, and storing received data or data requested to be transmitted in the logical memory.

通信に使用する際に使用するメモリに、通信に適した所定長の論理メモリサイズを設定してスループットの低下、メモリ利用効率の劣化を防ぐ通信処理におけるメモリ管理方法を提供する。   Provided is a memory management method in communication processing in which a predetermined length of a logical memory suitable for communication is set in a memory used for communication to prevent a decrease in throughput and a deterioration in memory utilization efficiency.

本発明を適用できるシステム構成例。The system structural example which can apply this invention. 実施形態1に係る通信制御装置のブロック図。1 is a block diagram of a communication control apparatus according to Embodiment 1. FIG. 実施形態1に係る通信制御部の機能ブロック図。FIG. 3 is a functional block diagram of a communication control unit according to the first embodiment. 実施形態に係る主記憶部のメモリ構成。The memory structure of the main memory part which concerns on embodiment. 実施形態1に係る通信制御部のメモリ管理処理のフローチャート。5 is a flowchart of memory management processing of the communication control unit according to the first embodiment. 受信した連続パケットの例。Example of received continuous packets. 実施形態に係るメモリのデータ格納状態。The data storage state of the memory which concerns on embodiment. 実施形態1に係る通信制御部の処理を表したフローチャート。5 is a flowchart showing processing of a communication control unit according to the first embodiment. 実施形態に係るデータ送信時のデータ格納状態。The data storage state at the time of the data transmission which concerns on embodiment. 実施形態2に係る通信制御部の機能ブロック図。FIG. 9 is a functional block diagram of a communication control unit according to the second embodiment. 通信制御部のメモリ管理処理を表したフローチャート。The flowchart showing the memory management process of a communication control part. 実施形態3における通信制御装置のブロック図。FIG. 9 is a block diagram of a communication control device according to a third embodiment. 実施形態3における通信制御部の機能ブロック図。FIG. 10 is a functional block diagram of a communication control unit in the third embodiment. 実施形態3における各モジュール間の受信時のデータフロー図。FIG. 10 is a data flow diagram at the time of reception between modules in the third embodiment. 実施形態3における各モジュール間の送信時のデータフロー図。FIG. 10 is a data flow diagram at the time of transmission between modules in the third embodiment.

図1により本実施形態にかかるシステムを説明する。電子機器101は、通信制御装置103と主制御装置102を収容する電子機器である。主制御装置102は、電子機器101のアプリケーションを制御するための装置である。主制御装置は、電子機器101が例えばテレビであれば表示であり、プリンタであれば印刷であり、カメラであれば撮像であったりといったアプリケーションを実行する。   A system according to the present embodiment will be described with reference to FIG. The electronic device 101 is an electronic device that houses the communication control device 103 and the main control device 102. The main control device 102 is a device for controlling the application of the electronic device 101. The main control device executes an application such as display if the electronic device 101 is a television, for example, printing if it is a printer, and imaging if it is a camera.

通信制御装置103は、電子機器101の通信に係る処理を実行する。通信制御装置103は無線通信が使用できるものを例として説明する。無線通信の外部インターフェイスとしてアンテナ104を具備する。電子機器101は空間105を介して無線通信機器106と通信を行う。
図2により本実施形態1に係る電子機器101の内部構成を説明する。
The communication control device 103 executes processing related to communication of the electronic device 101. The communication control apparatus 103 will be described as an example where wireless communication can be used. An antenna 104 is provided as an external interface for wireless communication. The electronic device 101 communicates with the wireless communication device 106 via the space 105.
The internal configuration of the electronic apparatus 101 according to the first embodiment will be described with reference to FIG.

電子機器101は、主制御装置102と通信制御装置103とからそれぞれが、アクセス可能な主記憶部201を有する。主記憶部201は、主制御装置102が主に使用するユーザーバッファ領域と、通信制御部203が主に使用する通信用の通信バッファ領域とに論理的に分かれているものとする。そのうち、通信バッファ領域のメモリ管理方法に本実施形態が適用される。主制御装置102は、通信相手に送信したいデータを主記憶部201のユーザーバッファ領域に配置する。通信制御装置103は、ユーザーバッファ領域に配置されたデータを送信データとして1度通信バッファ領域にコピーして、その後、所定のプロトコル処理を行いパケットデータ化して、通信相手に送信する。また、通信制御装置103は、無線通信機器106より受信したデータを1度通信バッファ領域に受信データとして格納し、前記受信データに対し通信制御装置103が所定のプロトコル処理をした後、必要なデータのみユーザーバッファ領域にコピーする。その後、通信制御装置103は主制御装置102に対し、データ受信の通知をする。   The electronic device 101 includes a main storage unit 201 that can be accessed from the main control device 102 and the communication control device 103, respectively. The main storage unit 201 is logically divided into a user buffer area mainly used by the main controller 102 and a communication buffer area for communication mainly used by the communication control unit 203. Among these, this embodiment is applied to the memory management method for the communication buffer area. The main controller 102 arranges data to be transmitted to the communication partner in the user buffer area of the main storage unit 201. The communication control apparatus 103 copies the data arranged in the user buffer area once as transmission data to the communication buffer area, and then performs predetermined protocol processing to convert it into packet data, which is transmitted to the communication partner. Further, the communication control device 103 stores the data received from the wireless communication device 106 once as received data in the communication buffer area, and after the communication control device 103 performs predetermined protocol processing on the received data, the necessary data is stored. Only copy to user buffer area. Thereafter, the communication control device 103 notifies the main control device 102 of data reception.

主制御装置102と通信制御装置103と主記憶部201はメインバス202で接続されている。通信制御部203は通信制御装置103全体の状態監視や制御を行う。詳細な通信制御部203の動作については後述する。通信制御装置103に存在する各種モジュールがローカルバス204により接続される。補助記憶部205は通信制御装置が各種処理を実行するために必要となるワークメモリとして使用される。   The main control device 102, the communication control device 103, and the main storage unit 201 are connected by a main bus 202. The communication control unit 203 monitors and controls the state of the communication control apparatus 103 as a whole. Detailed operation of the communication control unit 203 will be described later. Various modules existing in the communication control device 103 are connected by a local bus 204. The auxiliary storage unit 205 is used as a work memory necessary for the communication control device to execute various processes.

無線通信部206は通信相手と無線通信を実行するために必要となる媒体アクセス制御や物理層に係る処理を実行する。無線通信部206は通信制御部203からの制御情報を元に動作を行う。無線通信部206の状態変化時には、通信制御部203に割り込み信号209を送信することにより通知を行う。   The wireless communication unit 206 executes medium access control and processing related to the physical layer, which are necessary for executing wireless communication with a communication partner. The wireless communication unit 206 operates based on the control information from the communication control unit 203. When the state of the wireless communication unit 206 changes, notification is performed by transmitting an interrupt signal 209 to the communication control unit 203.

通信制御部203から主制御装置102へ割り込み信号線207が接続されている。通信制御部203はセットした命令が終了したときや、通信制御部203では処理しきれないエラーが発生した場合に主制御装置102へ割り込み信号線207によりその旨を通知する。   An interrupt signal line 207 is connected from the communication control unit 203 to the main control device 102. The communication control unit 203 notifies the main control device 102 through the interrupt signal line 207 when the set command is completed or when an error that cannot be processed by the communication control unit 203 occurs.

主制御装置102から、通信制御部203へ割り込み信号線208が接続されている。主制御装置102は通信制御部203に対して命令をセットしたい時に、割り込み信号線208に割り込み信号をアサートする。   An interrupt signal line 208 is connected from the main control device 102 to the communication control unit 203. The main control device 102 asserts an interrupt signal on the interrupt signal line 208 when it is desired to set an instruction to the communication control unit 203.

無線通信部206から、通信制御部203へ割り込み信号線209が接続されている。割り込み信号線209は、無線通信部206が外部よりデータを受信した場合や、異常を検知した場合に、通信制御部203へ割り込み信号をアサートする場合に使用する。   An interrupt signal line 209 is connected from the wireless communication unit 206 to the communication control unit 203. The interrupt signal line 209 is used when the wireless communication unit 206 receives data from the outside, or when an interrupt signal is asserted to the communication control unit 203 when an abnormality is detected.

主記憶部201と補助記憶部205は、同じ記憶装置に設定されていてもよいが、違う記憶装置でもよい。例えば、主記憶部201はLSIの外部に具備されるDRAMとし、補助記憶部205はLSI内部に具備されたオンチップRAMとしてもよい。   The main storage unit 201 and the auxiliary storage unit 205 may be set to the same storage device, but may be different storage devices. For example, the main storage unit 201 may be a DRAM provided outside the LSI, and the auxiliary storage unit 205 may be an on-chip RAM provided inside the LSI.

次に通信制御部203の詳細な構成、動作について図3により説明する。命令処理部301は主制御装置102から受信した各種命令を解析し、解析結果を元にどのような処理を行うべきかを決定する。
通信上位層処理部302は、OSI参照モデルにおけるトランスポート層(第四層)よりも上位レイヤであるプロトコルについて処理を行う。
通信プロトコル処理部303はOSI参照モデルにおけるトランスポート層(第四層)及びネットワーク層(第三層)に該当するプロトコルの処理を実行する。
無線制御部304は無線通信部206の初期設定や各種コマンド発行を行う。
メモリ管理部305については後述する。
Next, the detailed configuration and operation of the communication control unit 203 will be described with reference to FIG. The command processing unit 301 analyzes various commands received from the main controller 102 and determines what processing should be performed based on the analysis result.
The communication upper layer processing unit 302 processes a protocol that is an upper layer than the transport layer (fourth layer) in the OSI reference model.
The communication protocol processing unit 303 executes processing of protocols corresponding to the transport layer (fourth layer) and the network layer (third layer) in the OSI reference model.
The wireless control unit 304 performs initial setting of the wireless communication unit 206 and issues various commands.
The memory management unit 305 will be described later.

本実施形態では、状態検知部306は無線通信部206と主制御装置102からの割り込み信号を受信することにより状態を検知している。なお、割り込み信号を使用しないで状態検知するよう構成することもできる。そのような構成としては、例えば、無線通信部206と主制御装置102の状態を示すレジスタをそれぞれ用意しておく。そして定期的もしくは不定期にこのレジスタを監視する処理を状態検知部306が実行することが挙げられる。状態検知は上記いずれの方法で実施してもよい。   In the present embodiment, the state detection unit 306 detects the state by receiving interrupt signals from the wireless communication unit 206 and the main control device 102. In addition, it can also comprise so that a state may be detected without using an interruption signal. As such a configuration, for example, registers indicating the states of the wireless communication unit 206 and the main controller 102 are prepared. The state detection unit 306 may execute processing for monitoring this register regularly or irregularly. The state detection may be performed by any of the above methods.

通知部307は、主制御装置102に対して通信制御装置103が各種情報を送信したい場合に、通知情報があることを通知する。このときに通信制御部203から主制御装置102への割り込み信号線207を使用して通知を行う。ただし、主制御装置102の構成よっては必ずしも割り込み信号線は必要ない。上記状態検知部306で説明したように主制御装置102が定期的もしくは不定期に通信制御部203の状態を確認する動作を実行する場合には、割り込みは不要である。通知情報の通知は上記いずれの方法で実施してもよい。   The notification unit 307 notifies the main control device 102 that there is notification information when the communication control device 103 wants to transmit various types of information. At this time, notification is performed using the interrupt signal line 207 from the communication control unit 203 to the main control device 102. However, depending on the configuration of the main controller 102, an interrupt signal line is not necessarily required. As described in the state detection unit 306, when the main control device 102 performs an operation of checking the state of the communication control unit 203 regularly or irregularly, no interruption is necessary. The notification information may be notified by any of the above methods.

ローカルバス接続部308はローカルバスのプロトコルに則った動作を行い、通信制御装置103内の各種機能部にアクセスするのに使用される。なお、通信制御装置103内の各種機能部から、通信制御部203へアクセス可能なように構成されていてもよい。   The local bus connection unit 308 performs an operation according to the protocol of the local bus and is used to access various functional units in the communication control device 103. Note that the communication control unit 203 may be configured to be accessible from various functional units in the communication control apparatus 103.

メインバス接続部309はメインバスのプロトコルに則った動作を行い、通信制御装置103の外部にある各種機能部にアクセスするのに使用される。なお、通信制御装置103の外部にある各種機能部から、通信制御部203へアクセス可能なように構成されていてもよい。   The main bus connection unit 309 performs an operation in accordance with the main bus protocol and is used to access various function units outside the communication control device 103. Note that the communication control unit 203 may be configured to be accessible from various function units outside the communication control apparatus 103.

例えば無線を使用し、Web閲覧をするようなときは、無線接続から、ネットワーク層、トランスポート層、上位層といった各レイヤそれぞれでレイヤ間の接続がされなければならない。接続状態監視部310は上記の例のように各レイヤにおいての接続プロトコルや接続状態を監視する機能を備える。   For example, when using the radio and browsing the Web, the layers must be connected to each other such as the network layer, the transport layer, and the upper layer from the wireless connection. The connection state monitoring unit 310 has a function of monitoring the connection protocol and connection state in each layer as in the above example.

メモリ管理部305について、図4を用いて説明する。主記憶部201がユーザーバッファ領域401と通信バッファ領域402を有することは先に説明した。本実施形態にかかるメモリ管理方法は、通信バッファ領域を基本メモリサイズ403単位で論理的に区切られた複数の論理メモリとして扱う。メモリ管理部305はこの論理メモリの最大数や、各論理メモリのサイズ、さらに各論理メモリにIDが振られている場合、そのIDと物理アドレスの対応関係を管理する。メモリ管理部305はメモリ管理のための管理情報テーブルを備え、論理メモリが使用中の状態404(使用済み)と、使用されていない状態405(空き)の管理を行う。通信制御部203が、各種の処理実行おいて、メモリが必要になった場合、空き論理メモリから必要な数の論理メモリを取得し、それらを使用済みとして管理情報テーブルを変更した後、使用を開始する。そして、論理メモリの使用が終わった場合、該当使用済み論理メモリ内データを必要に応じて消去し、空き論理メモリとして管理情報テーブルに再登録する。なお、論理メモリの管理情報テーブルは、補助記憶部205にあっても、主記憶部201にあってもよい。メモリ管理部305は、管理情報テーブルの更新処理を行えることが望ましい。   The memory management unit 305 will be described with reference to FIG. As described above, the main storage unit 201 includes the user buffer area 401 and the communication buffer area 402. In the memory management method according to the present embodiment, the communication buffer area is handled as a plurality of logical memories logically divided in units of the basic memory size 403. The memory management unit 305 manages the maximum number of logical memories, the size of each logical memory, and the correspondence between the ID and the physical address when an ID is assigned to each logical memory. The memory management unit 305 includes a management information table for memory management, and manages a state 404 (used) and a state 405 (free) in which the logical memory is used. When the communication control unit 203 executes various processes and needs memory, it acquires the required number of logical memories from the free logical memory, changes them to the management information table as used, and then uses them. Start. When the use of the logical memory is finished, the data in the used logical memory is erased as necessary, and is re-registered in the management information table as an empty logical memory. The management information table of the logical memory may be in the auxiliary storage unit 205 or the main storage unit 201. It is desirable that the memory management unit 305 can update the management information table.

さらに、メモリ管理部305は、論理メモリの使用率についても監視を行うことが望ましい。論理メモリの使用率は、通信バッファ領域402のサイズと実際に通信バッファ領域402に格納されている有効データサイズを元に計算してもよいし、論理メモリの総数と使用済み論理メモリの数を元に計算してもよい。   Further, it is desirable that the memory management unit 305 also monitors the usage rate of the logical memory. The usage rate of the logical memory may be calculated based on the size of the communication buffer area 402 and the effective data size actually stored in the communication buffer area 402, or the total number of logical memories and the number of used logical memories It may be calculated based on the original.

次に図5により、通信制御部203が通信パケットを連続的に受信するときの処理手順について詳細に説明する。連続的に到着する通信パケットの例を図6に示す。   Next, a processing procedure when the communication control unit 203 continuously receives communication packets will be described in detail with reference to FIG. An example of communication packets that arrive continuously is shown in FIG.

通信パケットは、各パケットに付けられるヘッダ部601とデータ部602を含む。ヘッダ部601には、宛先アドレス(DA)603, 送信元アドレス(SA)604,データ部のデータサイズを示すパケット長( Length)605が含まれる。   The communication packet includes a header part 601 and a data part 602 attached to each packet. The header portion 601 includes a destination address (DA) 603, a transmission source address (SA) 604, and a packet length (Length) 605 indicating the data size of the data portion.

本実施形態では、上記の連続した通信パケットを受信する際の動作について説明する。まず、無線通信が確立する前に、使用する通信方式が主制御装置102より通信制御装置103の通信制御部203へ通知されるのを待つ(ステップ502、503)。通信方式が通知されると、通信制御部203は、通知された通信方式から、前記通信方式の1パケットにおける最大のパケット長を割り出し、その結果よりメモリ管理部305で、使用する基本メモリサイズを決定する(ステップ504)。例えばEthernet II(登録商標)を使用した無線LANの場合は、Ethernet II(登録商標)のMTUは、1500バイトと決められている。よって、基本メモリサイズを1500バイトより大きく設定しておく。そして例えば、基本メモリサイズの最小単位が128バイトである場合は、128バイトを整数倍して1500バイトを超えるサイズ、例えば1536バイトを基本メモリサイズと決定しておく。なお、基本メモリサイズの変更の必要が発生した場合には、基本メモリサイズを変更できるようにしておく(ステップ505、506)。基本メモリサイズの変更の例については後述する第2実施形態で説明する。   In the present embodiment, an operation when receiving the above-described continuous communication packets will be described. First, before wireless communication is established, it waits for the communication method to be used to be notified from the main control device 102 to the communication control unit 203 of the communication control device 103 (steps 502 and 503). When the communication method is notified, the communication control unit 203 determines the maximum packet length in one packet of the communication method from the notified communication method, and based on the result, the memory management unit 305 determines the basic memory size to be used. Determine (step 504). For example, in the case of a wireless LAN using Ethernet II (registered trademark), the MTU of Ethernet II (registered trademark) is determined to be 1500 bytes. Therefore, the basic memory size is set larger than 1500 bytes. For example, when the minimum unit of the basic memory size is 128 bytes, a size exceeding 128 bytes by multiplying 128 bytes by an integer, for example, 1536 bytes is determined as the basic memory size. If the basic memory size needs to be changed, the basic memory size can be changed (steps 505 and 506). An example of changing the basic memory size will be described in a second embodiment to be described later.

次に無線通信が確立していない場合は、無線通信を確立して(ステップ507、508)、アンテナ104よりデータを受信し、無線通信部206内部のメモリに受信データを取り込む。通信制御部203は、割り込み信号がアサートとされるのを待つ(ステップ509)。データを受信した無線通信部206は、割り込み信号線209を使用して、通信制御部203に割り込み信号をアサートする。割り込み信号を検知した通信制御部203は、割り込み要因を特定するために、無線通信部206に問合せを行う(ステップ509、510)。その問合せの結果により、受信通知であることが分かると、通信制御部203は、受信データの取り込みを開始する。次にパケットを基本サイズの論理メモリに分離して格納するか、分離しないで連続的に格納するか判定する(ステップ511)。この判定(ON/OFF)については後述する。   Next, when the wireless communication is not established, the wireless communication is established (steps 507 and 508), the data is received from the antenna 104, and the received data is taken into the memory inside the wireless communication unit 206. The communication control unit 203 waits for the interrupt signal to be asserted (step 509). The wireless communication unit 206 that has received the data asserts an interrupt signal to the communication control unit 203 using the interrupt signal line 209. The communication control unit 203 that has detected the interrupt signal makes an inquiry to the wireless communication unit 206 in order to identify the cause of the interrupt (steps 509 and 510). If it is determined from the inquiry result that the notification is a reception notification, the communication control unit 203 starts capturing the received data. Next, it is determined whether the packets are stored separately in the basic size logical memory or not stored separately (step 511). This determination (ON / OFF) will be described later.

以下では基本サイズの論理メモリにデータを分離して格納する場合(ステップ511でONの判定があったとき。)について説明する。まず補助記憶部205に受信した1パケット目のヘッダ部601のコピーを開始する(ステップ512、513)。ヘッダ部601のコピーが終了すると、ヘッダ部601のLength605を参照し(ステップ514)、その参照結果を元に1パケット目のデータ部602を取り込むための必要メモリサイズを算出する(ステップ515)。メモリ管理部305にて使用されている基本メモリサイズと前記必要メモリサイズを比較し、1パケット目を格納するに当たり、いくつの論理メモリが必要になるか算出を行う(ステップ516)。そして、必要個数を空き論理メモリから使用済みと変えることにより、必要な数の論理メモリを取得する(ステップ517)。通常は、ステップ504またはステップ506により、基本メモリサイズを決定しているため、1つのデータパケットは1つの論理メモリで収まるはずであるが、想定外であるデータ長の長いパケット等も受信する場合は、複数の論理メモリを使用して受信する。   Hereinafter, a case where data is separated and stored in the basic size logical memory (when ON is determined in step 511) will be described. First, copying of the header portion 601 of the first packet received in the auxiliary storage unit 205 is started (steps 512 and 513). When the copying of the header portion 601 is completed, the length 605 of the header portion 601 is referred to (step 514), and the necessary memory size for taking in the data portion 602 of the first packet is calculated based on the reference result (step 515). The basic memory size used in the memory management unit 305 is compared with the required memory size, and the number of logical memories required for storing the first packet is calculated (step 516). Then, the required number of logical memories are acquired by changing the required number from the free logical memory to used (step 517). Normally, since the basic memory size is determined in step 504 or 506, one data packet should fit in one logical memory, but when receiving an unexpectedly long packet or the like Receive using a plurality of logical memories.

そして、まず補助記憶部205にあるヘッダ部601のデータを獲得した主記憶部の論理メモリへコピーする(ステップ518、519)。続いて、無線通信部206からデータ部602を読み込んで、獲得した論理メモリへコピーする(ステップ520、521)。第一のパケットをすべて論理メモリへ取り込んだら、次に第二のパケットにおけるヘッダ部601の受信が開始される。再び補助記憶部205に2つ目のパケットのヘッダ部601を格納する。第二、第三のパケットを同様の処理で、すべてのパケットを受信するまで、コピー処理を繰り返す(ステップ522)。この例の場合、主記憶部201に最終的に図7(a)のようにパケットが受信、格納される。   First, the data of the header section 601 in the auxiliary storage section 205 is copied to the logical memory of the main storage section that has been acquired (steps 518 and 519). Subsequently, the data unit 602 is read from the wireless communication unit 206 and copied to the acquired logical memory (steps 520 and 521). When all the first packets are taken into the logical memory, reception of the header portion 601 in the second packet is started next. Again, the header portion 601 of the second packet is stored in the auxiliary storage unit 205. The copy process is repeated until the second and third packets are all processed in the same manner (step 522). In the case of this example, the packet is finally received and stored in the main storage unit 201 as shown in FIG.

ここで、主記憶部201への格納は、図7(b)に示されるようにデータ部602のみにしてもよい。実装された通信プロトコル処理部303がデータ処理をするのに都合のよい形で通信バッファ領域にデータを格納すればよい。   Here, the storage in the main storage unit 201 may be only the data unit 602 as shown in FIG. Data may be stored in the communication buffer area in a manner convenient for the mounted communication protocol processing unit 303 to process data.

次に、上記のステップ511で記した、パケット分離がoffの場合のパケットの格納について図5(b)により説明する。この場合もパケットを受信するのに必要なサイズのメモリを獲得し(ステップ524)、獲得したメモリにパケットを順番に格納する。その際に論理メモリの基本メモリサイズは使用しないでパケットとパケットの間を詰めて格納する(ステップ525,526)。図7(c)は、パケットを分離して格納する受信機能をOFF(分離しない)にして受信したときの様子である。すなわち、論理メモリごとにパケットが区切られず敷き詰めて入れることが出来るので、メモリ利用効率を考えた場合、基本サイズの論理メモリ毎にパケットを分離する方法に比べメモリの利用効率を高くできる。よって、メモリの枯渇によるパケットロスが頻発するような環境では、パケットを論理メモリに分離して格納する受信機能をoffした方が、パケットロスの発生を抑止できる可能性がある。そのため本実施形態にかかるパケットの分離受信機能をOn/Offできる機構を入れることがよい。   Next, packet storage when packet separation is off, as described in step 511 above, will be described with reference to FIG. Also in this case, a memory having a size necessary for receiving the packet is acquired (step 524), and the packets are sequentially stored in the acquired memory. At that time, the basic memory size of the logical memory is not used and the packets are packed and stored (steps 525 and 526). FIG. 7 (c) shows a state in which the reception function for separating and storing packets is turned off (not separated). That is, since packets can be placed without being divided for each logical memory, when considering the memory utilization efficiency, the memory utilization efficiency can be increased as compared with the method of separating packets for each logical memory of the basic size. Therefore, in an environment where packet loss frequently occurs due to memory depletion, it may be possible to suppress the occurrence of packet loss by turning off the reception function that separates and stores packets in logical memory. Therefore, it is preferable to include a mechanism capable of turning on / off the packet separation / reception function according to the present embodiment.

どのようにOn/Offを行うかについて、以下図5(c)を用いて説明する。通信開始された場合、まず初期設定を行う(ステップ527、528)。初期設定では、論理メモリの使用率に閾値を設定する。この閾値に基づいて、パケット分離受信機能をOn/Offさせる。この閾値は、事前にメモリ管理部305が、固定的に設定する方法でもよいし、主制御装置102からの命令により、セットされるものでもよい。次に、メモリ管理部305は、論理メモリの使用率を算出する(ステップ529)。算出結果と使用率の閾値とに基づいて、パケット分離受信機能のOn/Offが決定される(ステップ530,531,532)。例えば、算出されたメモリの使用率が閾値以上であれば、パケット分離受信機能をoffし、閾値未満であればパケット分離受信機能をonにする。上記決定に係るフロー(ステップ529〜532)は、通信が終了するまで(ステップ533)継続して実行される。   How to turn on / off will be described below with reference to FIG. When communication is started, initial setting is first performed (steps 527 and 528). In the initial setting, a threshold is set for the usage rate of the logical memory. Based on this threshold, the packet separation / reception function is turned on / off. This threshold value may be set in advance by the memory management unit 305 or may be set in accordance with a command from the main controller 102. Next, the memory management unit 305 calculates the usage rate of the logical memory (step 529). On / Off of the packet separation / reception function is determined based on the calculation result and the threshold of the usage rate (steps 530, 531 and 532). For example, if the calculated memory usage rate is equal to or greater than the threshold, the packet separation reception function is turned off, and if it is less than the threshold, the packet separation reception function is turned on. The flow related to the determination (steps 529 to 532) is continuously executed until the communication is completed (step 533).

次に、主制御装置102が、他機器にデータを送信するときに通信制御装置103で行われるメモリ管理方法について図8により説明する。まず図8(a)について説明する。最初に、主制御装置102より、通信制御装置103に対して、所定の通信方式を使用した通信開始要求が送信される。すると通信制御装置103が通信方式のフォーマットにしたがった接続処理を行い、通信を確立させる(ステップ802〜804)。また、通信制御装置103は通信方式に使用されるデータサイズより基本メモリサイズを決定する(ステップ805)。例えば、先のEthernetII(登録商標)を前提とした無線LANを使用する場合は、先の要領で1536バイトを基本メモリサイズとして使用する。なお、基本メモリサイズの変更要求があった場合には、その要求にしたがって基本メモリサイズを変更する(ステップ806,807)。これについては後述する。   Next, a memory management method performed by the communication control apparatus 103 when the main control apparatus 102 transmits data to another device will be described with reference to FIG. First, FIG. 8 (a) will be described. First, a communication start request using a predetermined communication method is transmitted from the main control device 102 to the communication control device 103. Then, the communication control apparatus 103 performs connection processing according to the communication format and establishes communication (steps 802 to 804). Further, the communication control apparatus 103 determines the basic memory size from the data size used for the communication method (step 805). For example, when using a wireless LAN based on the previous Ethernet II (registered trademark), 1536 bytes is used as the basic memory size in the previous procedure. If there is a request for changing the basic memory size, the basic memory size is changed according to the request (steps 806 and 807). This will be described later.

次に、通信制御装置103は主記憶装置から実際に転送して欲しいデータを受け取る。例えば、主制御装置102は、ユーザーバッファ領域に送信したいデータを用意し、その先頭アドレスとユーザーバッファ領域におかれたデータサイズを通信制御部203に通知する。通知を受けた通信制御部203は、通信制御部203が管理する通信バッファ領域にデータのコピーを行う際に、1回にコピーする基本コピーサイズを、通信に使用する通信方式を元に決定する(ステップ808,809)。例えば、TCP/IPを使用した無線通信を行っている場合は、TCPヘッダ/IPヘッダにそれぞれオプションがない場合は、TCPの最大ペイロードサイズ1460バイトを1回の基本コピーサイズに決定する。また、暗号・認証を用いた通信で、例えばIPsec のプロトコルを使う通信では、AH (Authentification Header)やESP (Encapsulation Security Payload)を使用している場合がある。この場合はAHヘッダやESPヘッダがTCPヘッダ、IPヘッダに付加される。それに伴い、主制御装置102から受け取ったデータを1パケットで送信できるサイズが減少する。そこで、データの基本コピーサイズを通信方式で使用する最大のデータサイズから付加するヘッダ分だけ減らした数値に決定する。   Next, the communication control device 103 receives data that is actually desired to be transferred from the main storage device. For example, the main controller 102 prepares data to be transmitted to the user buffer area, and notifies the communication control unit 203 of the start address and the data size stored in the user buffer area. Upon receiving the notification, the communication control unit 203 determines the basic copy size to be copied at one time based on the communication method used for communication when copying data to the communication buffer area managed by the communication control unit 203. (Steps 808, 809). For example, when wireless communication using TCP / IP is performed, if there are no options in the TCP header / IP header, the maximum payload size of 1460 bytes of TCP is determined as one basic copy size. In communication using encryption / authentication, for example, communication using the IPsec protocol may use AH (Authentification Header) or ESP (Encapsulation Security Payload). In this case, an AH header or ESP header is added to the TCP header or IP header. As a result, the size at which data received from the main controller 102 can be transmitted in one packet decreases. Therefore, the basic copy size of the data is determined to be a numerical value obtained by reducing the header size to be added from the maximum data size used in the communication method.

基本コピーサイズの決定後、ユーザーバッファ領域から基本コピーサイズのデータを、通信バッファ領域の1つの論理メモリにコピーする(ステップ810,811)。このときの主記憶部201の様子を図9に示す。この基本コピーサイズのデータコピー時では、図9(a)に示すように論理メモリの先頭からコピーしてもよい。この場合は、ヘッダ部は論理メモリに生成するようにしてもよいし、補助記憶部205に生成するようにしてもよい。論理メモリにヘッダも生成する場合は、図9(b)に示すように後からつけるヘッダサイズ分のオフセットサイズを論理メモリの先頭アドレスから移動させてデータをコピーするとよい。また、論理メモリにユーザーデータを格納し、送信時にヘッダを付加してもよい。このように通信パケットサイズに見合った形で、論理メモリにユーザーデータをコピーすることにより、通信パケットが他機器に受信されたことが確認できた際、すみやかに該当論理メモリを開放することができる。これにより、メモリ利用性の向上が実現する。以降、全てのユーザーバッファ領域に置かれたユーザーデータのコピーが完了するまで(ステップ812)、上記ステップ810,811が繰り返される。   After determining the basic copy size, the basic copy size data is copied from the user buffer area to one logical memory in the communication buffer area (steps 810 and 811). The state of the main storage unit 201 at this time is shown in FIG. When copying data of this basic copy size, copying may be performed from the beginning of the logical memory as shown in FIG. In this case, the header part may be generated in the logical memory, or may be generated in the auxiliary storage unit 205. When a header is also generated in the logical memory, the data may be copied by moving the offset size corresponding to the header size to be added later from the start address of the logical memory as shown in FIG. 9B. Further, user data may be stored in a logical memory, and a header may be added at the time of transmission. Thus, by copying user data to the logical memory in a form commensurate with the communication packet size, when it is confirmed that the communication packet has been received by another device, the corresponding logical memory can be released immediately. . Thereby, improvement of memory utilization is realized. Thereafter, steps 810 and 811 are repeated until copying of user data placed in all user buffer areas is completed (step 812).

送信要求されたユーザーデータのサイズが、通信方式で使用できるパケット長よりも非常に大きい場合がある。その場合、即座に順次、ユーザーデータから通信パケットサイズにコピーを開始させず、ユーザーデータを論理的なブロックに区切ってからコピーを行ってもよい。その処理を図8(b)に示す。図8(a)の処理との差分はブロックに切るためのブロックサイズとブロック位置の決定処理(ステップ814)が含まれることと、ブロックコピーの終了の確認(ステップ815)が入ることである。図9(c)に示すようにユーザーデータは所定のブロックサイズに分割され(ステップ814)、ブロック毎のコピー(ステップ810)がブロックのデータが終了するまで(ステップ811)続けられる。   The size of user data requested to be transmitted may be much larger than the packet length that can be used in the communication method. In this case, copying may be performed after dividing user data into logical blocks without starting copying immediately from user data to the communication packet size. The process is shown in FIG. 8 (b). The difference from the process of FIG. 8A is that a block size and block position determination process (step 814) for cutting into blocks is included, and that block copy end confirmation (step 815) is entered. As shown in FIG. 9 (c), the user data is divided into a predetermined block size (step 814), and copying for each block (step 810) is continued until the data of the block ends (step 811).

さらに、先に述べた通信制御装置103の受信処理時における基本メモリサイズとは別に、通信制御装置103の送信処理時の基本メモリサイズを用意して使用してもよい。例えば、主制御装置102が、他機器とTCP/IPを使用した通信において、データ受信している場合、通信制御装置103は、TCPのACK送信が主たる送信処理となる。この場合通信制御装置103が送信に使用する基本メモリサイズは受信における基本メモリサイズより小さくすることができ、メモリの利用効率を高くできる。   Further, apart from the basic memory size at the time of the reception process of the communication control apparatus 103 described above, a basic memory size at the time of the transmission process of the communication control apparatus 103 may be prepared and used. For example, when the main control device 102 receives data in communication using TCP / IP with another device, the communication control device 103 performs TCP ACK transmission as a main transmission process. In this case, the basic memory size used for transmission by the communication control apparatus 103 can be made smaller than the basic memory size for reception, and the memory utilization efficiency can be increased.

また、通信が確立されていない場合、通信が確立(ステップ508)した後に、確立した通信方式に使用されるMTUに基づいて基本メモリサイズを変更するようにしてもよい。
実施形態2では、通信状態をトレーニングすることにより、メモリ管理部305で使用される基本メモリサイズを変更する方法について説明する。実施形態1からの変更は、通信制御部の構成である。実施形態2の通信制御部213について、図10を用いて説明する。
If communication is not established, the basic memory size may be changed based on the MTU used for the established communication method after communication is established (step 508).
In the second embodiment, a method for changing the basic memory size used in the memory management unit 305 by training the communication state will be described. The change from the first embodiment is the configuration of the communication control unit. The communication control unit 213 according to the second embodiment will be described with reference to FIG.

通信制御部213に通信状態監視部311とタイマー部312を追加する。通信状態監視部311は、外部機器より受信したパケットのサイズについて監視を行う。タイマー部312は時間管理を行う。   A communication state monitoring unit 311 and a timer unit 312 are added to the communication control unit 213. The communication state monitoring unit 311 monitors the size of the packet received from the external device. The timer unit 312 performs time management.

主制御装置102が他機器からデータを受信するときにおける、通信制御部213の処理手順について図11(a)を用いて説明する。図11(a)は、通信制御部213の処理の一部をフローチャートで表したものである。なお、図7の処理のように受信したデータを論理メモリに格納する処理を通信制御部213が行っていることについての変更はない。さらに通信制御部213は、図11(a)に示す処理も図7の処理と並行または時分割に行う。まず、通信制御部213は、予め決められた間隔で処理を実行できるよう、タイマー部312を用いて処理を行う間隔をセットする(ステップ1102)。次に、通信状態監視を通信状態監視部311 により開始する(ステップ1103)。ここで通信状態監視部311は受信パケットのサイズについて統計する。例えばヘッダ部に含まれるLengthの値を統計する(ステップ1104)。そしてタイマーが終了次第、統計を終了する(ステップ1105,1106)。そして前記統計の結果を元に、次の基本メモリサイズを決定する(ステップ1107)。この決定は例えば、一番大きいサイズの受信パケットに合わせて基本メモリサイズを決定してもよいし、一番受信パケットの割合で多かったパケットのサイズを基本メモリサイズとして決定してもよい。最後に、通信制御部213は決定した基本メモリサイズをメモリ管理部305にセットするように要求する(1108)。なお、基本メモリサイズを変更するタイミングは、すでに受信したパケットの通信制御部203での処理がいったん終了している状態がよい。図5で示した基本サイズを変更するステップ505、506のタイミングにおいて変更してもよい。   A processing procedure of the communication control unit 213 when the main control apparatus 102 receives data from another device will be described with reference to FIG. FIG. 11 (a) is a flowchart showing a part of the processing of the communication control unit 213. Note that there is no change in that the communication control unit 213 performs a process of storing received data in the logical memory as in the process of FIG. Further, the communication control unit 213 also performs the process shown in FIG. 11A in parallel with the process of FIG. First, the communication control unit 213 sets an interval for performing processing using the timer unit 312 so that processing can be executed at predetermined intervals (step 1102). Next, communication state monitoring is started by the communication state monitoring unit 311 (step 1103). Here, the communication state monitoring unit 311 performs statistics on the size of the received packet. For example, the value of Length included in the header portion is statistically analyzed (step 1104). As soon as the timer expires, the statistics are finished (steps 1105 and 1106). Based on the result of the statistics, the next basic memory size is determined (step 1107). In this determination, for example, the basic memory size may be determined in accordance with the largest received packet, or the size of the packet having the largest received packet ratio may be determined as the basic memory size. Finally, the communication control unit 213 requests the memory management unit 305 to set the determined basic memory size (1108). It should be noted that the timing for changing the basic memory size may be such that the processing in the communication control unit 203 of the already received packet is once completed. The basic size may be changed at the timings of steps 505 and 506 shown in FIG.

これにより、基本メモリサイズを受信サイズに見合ったサイズに変更できるため、メモリの利用効率を向上することができ、通信状態の揺らぎにより突発的に発生するメモリの枯渇によるパケットロスを軽減できるようになる。   As a result, the basic memory size can be changed to a size suitable for the reception size, so that the memory usage efficiency can be improved, and packet loss due to sudden memory depletion caused by fluctuations in communication status can be reduced. Become.

次に、主制御装置102が他機器へデータを送信するときにおける、通信制御部213の処理手順について説明する。なお、実施形態1において、通信開始時に通信方式に応じて基本メモリサイズを決定する方法については説明した。今回の方式は、必ずしも最初に決定した基本メモリサイズが効率的とはいえなくなったような場合の基本メモリサイズ変更方法である。その方法を図11(b)に示す。なお、図8に示す通常の処理を通信制御部213も行うことについての変更はない。通信制御部213は、図11(b)に示された基本メモリサイズを変更する処理を図8の処理と並行または時分割に行う。まず、通信制御部213は、予め決められた間隔に処理が実行できるよう、タイマー部312を用いて間隔をセットする(ステップ1202)。次に通信状態監視を通信状態監視部311 により開始する(ステップ1203)。ここで送信の度に主制御装置102からユーザーデータとして通信制御部213に通知されるデータサイズについて統計する(ステップ1204)。例えばソケットを使用した通信であれば、ソケットIDごとにデータサイズを統計してもよい。そしてタイマーが終了次第、統計を終了する(ステップ1205,1206)。そしてその統計結果を元に、次の基本メモリサイズを決定する(ステップ1207)。最後に、決定した基本メモリサイズをメモリ管理部305にセットするように要求する(1208)。なお、基本メモリサイズを変更するタイミングは、例えば論理メモリに格納した送信パケットの処理がいったん終了している状態が望ましい。なお、送信の場合、事前にMTUによる基本サイズの決定を行っている。MTUよりも大きいサイズがユーザーデータとして通信制御部213に通知される場合、サイズをMTUより大きくすることは基本的にはできないから、基本サイズの変更は発生しない。これにより、送信サイズに見合った基本メモリサイズを適宜選択できるため、メモリ利用効率を向上することができる。   Next, a processing procedure of the communication control unit 213 when the main control apparatus 102 transmits data to another device will be described. In the first embodiment, the method for determining the basic memory size according to the communication method at the start of communication has been described. This method is a method for changing the basic memory size when the basic memory size determined first is not necessarily efficient. The method is shown in FIG. 11 (b). Note that there is no change in that the communication control unit 213 also performs the normal processing shown in FIG. The communication control unit 213 performs the process of changing the basic memory size shown in FIG. 11B in parallel with the process of FIG. 8 or in time division. First, the communication control unit 213 sets an interval using the timer unit 312 so that the process can be executed at a predetermined interval (step 1202). Next, communication state monitoring is started by the communication state monitoring unit 311 (step 1203). Here, every time transmission is performed, the data size notified to the communication control unit 213 as user data from the main control device 102 is statistics (step 1204). For example, in the case of communication using sockets, the data size may be statistics for each socket ID. As soon as the timer expires, the statistics are finished (steps 1205 and 1206). Based on the statistical result, the next basic memory size is determined (step 1207). Finally, the memory management unit 305 is requested to set the determined basic memory size (1208). Note that the timing for changing the basic memory size is preferably a state in which, for example, processing of a transmission packet stored in the logical memory is once completed. In the case of transmission, the basic size is determined by the MTU in advance. When a size larger than the MTU is notified to the communication control unit 213 as user data, the basic size cannot be changed because the size cannot be basically made larger than the MTU. As a result, the basic memory size corresponding to the transmission size can be appropriately selected, so that the memory utilization efficiency can be improved.

実施形態3では、論理メモリへのデータ格納や論理メモリからの読み出しにDMA(Direct Memory Access)を用いた場合、それに適した形でメモリ管理を実現する方法について説明する。まず、通信制御装置250 について図12を用いて実施形態3に係る部分を説明する。本実施形態の通信制御部223と他の実施形態の通信制御部203、213との構成の差については後述する。   In the third embodiment, a method for realizing memory management in a form suitable for the case where DMA (Direct Memory Access) is used for storing data in the logical memory or reading data from the logical memory will be described. First, the part concerning Embodiment 3 is demonstrated about the communication control apparatus 250 using FIG. A difference in configuration between the communication control unit 223 of the present embodiment and the communication control units 203 and 213 of the other embodiments will be described later.

メモリ管理部251は通信制御部203、213に組み込まれていたメモリ管理部の処理の一部を担う。さらに、後述のDMA部252との間で直接制御情報をやり取りできる構成を持つ。DMA部252は補助記憶部205及び、主記憶部201の両種記憶部と各種モジュール間のデータ転送を担う。DMA部252には、後述のDMAバス254に流れるデータに対して、簡単な比較・解析処理を行う機能が具備される。また、DMA部252は一次記憶部255を具備する。   The memory management unit 251 takes part of the processing of the memory management unit incorporated in the communication control units 203 and 213. In addition, control information can be directly exchanged with a DMA unit 252 described later. The DMA unit 252 is responsible for data transfer between the auxiliary storage unit 205 and both types of storage units of the main storage unit 201 and various modules. The DMA unit 252 has a function of performing a simple comparison / analysis process on data flowing on the DMA bus 254 described later. The DMA unit 252 includes a primary storage unit 255.

割り込み信号線253は、DMA部252から通信制御部223への割り込み通知する信号線である。DMA部252の処理が終了したときや、エラーが発生したときに、通信制御部223へ通知するために使用される。DMAバス254は無線通信部206と補助記憶部205または、主記憶部201間で、DMA部252を使用したデータ転送に使用するバスである。   The interrupt signal line 253 is a signal line for notifying the interrupt from the DMA unit 252 to the communication control unit 223. This is used to notify the communication control unit 223 when the processing of the DMA unit 252 is completed or when an error occurs. The DMA bus 254 is a bus used for data transfer using the DMA unit 252 between the wireless communication unit 206 and the auxiliary storage unit 205 or the main storage unit 201.

次に、通信制御部223について、図13を用いて実施形態3に係る部分を説明する。DMA制御部313はDMA部252を制御する。メモリ管理機能制御部314はメモリ管理部251を制御する。図13の状態検知部306と図3の状態検知部306との構成上の差は、図13の状態検知部306がDMA部252の状態も検知する点である。   Next, the part which concerns on Embodiment 3 is demonstrated about the communication control part 223 using FIG. The DMA control unit 313 controls the DMA unit 252. The memory management function control unit 314 controls the memory management unit 251. The difference in configuration between the state detection unit 306 in FIG. 13 and the state detection unit 306 in FIG. 3 is that the state detection unit 306 in FIG. 13 also detects the state of the DMA unit 252.

次に、通信制御装置250が、他機器より連続したパケットを受信するときにおける、通信制御装置250内部のデータ及び制御フローについて図14を用いて説明する。なお、連続して受信するパケットの例は、図6に記載のものと同様である。まず、無線通信部206がアンテナ104を介して連続したパケットを受信する。すると、無線通信部206は、通信制御部223に割り込み信号をアサートする(1501)。割り込みを検知した通信制御部223は、割り込み要因を確認するために、無線通信部206に問合せを行う(1502)。データ受信通知であると分かった通信制御部223は、DMA部252にデータ受信命令をセットする(1503)。ここで、DMA部252にセットする命令には、無線通信部206のアドレス情報が含まれる。また、事前に無線通信部206が受信した全パケットの総和のデータサイズが分かっていれば、それをDMA部252に通知しておいてもよい。   Next, data and control flow inside the communication control device 250 when the communication control device 250 receives continuous packets from other devices will be described with reference to FIG. An example of packets that are continuously received is the same as that shown in FIG. First, the wireless communication unit 206 receives continuous packets via the antenna 104. Then, the wireless communication unit 206 asserts an interrupt signal to the communication control unit 223 (1501). The communication control unit 223 that has detected the interruption makes an inquiry to the wireless communication unit 206 in order to confirm the cause of the interruption (1502). The communication control unit 223 found to be the data reception notification sets a data reception command to the DMA unit 252 (1503). Here, the instruction set in the DMA unit 252 includes address information of the wireless communication unit 206. Further, if the data size of the sum of all the packets received by the wireless communication unit 206 is known in advance, it may be notified to the DMA unit 252.

データ受信命令を受け取ったDMA部252は、DMAにより無線通信部206から、受信データの読み込みを開始する(1504)。まずパケット1のヘッダ部をDMAにより転送し(1505)、DMA部252内部にある一次記憶領域に格納する(1506)。ヘッダ部を獲得したDMA部252は、Length(605)を解析し(1507)、必要となる論理メモリサイズを算出し、メモリ管理部251に必要サイズ分の論理メモリの獲得要求を送信する(1508)。要求を受けたメモリ管理部251は、自身が管理する主記憶部201の空き論理メモリのリストから、要求されたサイズに見合う論理メモリの物理アドレスとサイズからなるリストを返す(1509)。なお、事前に各モジュール間で論理メモリのIDナンバー等と物理アドレスとの対応関係について共有できていれば、IDを返す方法でもよい。ここで、メモリ管理部251は、DMA部252に提供した論理メモリは使用済みとして情報を更新しておく。使用できる論理メモリに関する情報を受け取ったDMA部252は、主記憶部201にある論理メモリを転送先としてセットして、DMA転送によりデータを転送する(1510,1511)。このとき、一次記憶部255にすでにあるヘッダ部からヘッダの情報を論理メモリへ転送してもよいし、新たに読み取ったデータ部から論理メモリへ転送をしてもよい。   The DMA unit 252 that has received the data reception command starts reading the received data from the wireless communication unit 206 by DMA (1504). First, the header part of the packet 1 is transferred by DMA (1505) and stored in a primary storage area inside the DMA part 252 (1506). The DMA unit 252 that has acquired the header part analyzes the Length (605) (1507), calculates the required logical memory size, and transmits a request to acquire the logical memory for the required size to the memory management unit 251 (1508). ). Upon receipt of the request, the memory management unit 251 returns a list including the physical address and size of the logical memory corresponding to the requested size from the list of free logical memory in the main storage unit 201 managed by the memory management unit 251 (1509). If the correspondence between the ID number of the logical memory and the physical address can be shared between the modules in advance, the method of returning the ID may be used. Here, the memory management unit 251 updates the information that the logical memory provided to the DMA unit 252 has been used. The DMA unit 252 that has received information on the usable logical memory sets the logical memory in the main storage unit 201 as a transfer destination, and transfers data by DMA transfer (1510, 1511). At this time, the header information from the header part already in the primary storage unit 255 may be transferred to the logical memory, or the newly read data part may be transferred to the logical memory.

パケット1のデータをすべて論理メモリへ転送を行ったDMA部252は、まだ受信データが残っているか無線通信部206からのバスの応答を確認する。受信データが残っている場合には、パケット2,3とすべての受信データを論理メモリへ格納するまで上記の処理1503から処理1511を繰り返す。なお、ステップ1503で全パケットの総和のデータサイズが通信制御部223より通知されている場合は、無線通信部206からのバスの応答確認を不要にできる。この場合は、無線通信部206から転送されたデータが、通知された総和のデータサイズに達するまで、処理1503から処理1511を繰り返してデータを転送すればよい。すべてのパケットを論理メモリに格納したら、DMA部252は通信制御部223に割り込み信号をアサートすることにより(1512)、データ転送の終了を通知する。データ転送の終了を通知された通信制御部223は、DMA部にデータ転送の終了を確認し、必要に応じ、どこの論理メモリに何番目のパケットが格納されたのかDMA部252もしくは、メモリ管理部251に問合せる(1514)。この問い合わせにより、後工程の処理に必要となる情報を獲得する(1515)。   The DMA unit 252 that has transferred all the data of the packet 1 to the logical memory confirms the bus response from the wireless communication unit 206 to determine whether the received data still remains. If the received data remains, the processing 1503 to 1511 is repeated until the packets 2 and 3 and all the received data are stored in the logical memory. Note that if the communication control unit 223 notifies the total data size of all packets in step 1503, the bus response confirmation from the wireless communication unit 206 can be made unnecessary. In this case, data may be transferred by repeating processing 1503 to processing 1511 until the data transferred from the wireless communication unit 206 reaches the notified total data size. When all the packets are stored in the logical memory, the DMA unit 252 notifies the end of the data transfer by asserting an interrupt signal to the communication control unit 223 (1512). The communication control unit 223 notified of the end of the data transfer confirms the end of the data transfer with the DMA unit, and if necessary, determines what number of the packet is stored in which logical memory, the DMA unit 252 or the memory management Contact Part 251 (1514). By this inquiry, information necessary for the subsequent process is acquired (1515).

次に、主制御装置102が、他機器にデータを送信する時における、DMA転送を用いた通信制御装置250内部のデータ及び制御フローについて図15を用いて説明する。なお、通信に必要な設定等は、事前に行われているものとする。最初に主制御装置102が、送信を実行するユーザーデータを、ユーザーバッファ領域にデータをおく。そして、通信制御部223に、送信要求のための割り込み信号をアサートする(1601)。この際、通信制御部223には、ユーザーデータの置かれたアドレスとユーザーデータのサイズを合わせて通知する。送信要求を受け取った通信制御部223は、図9(c)で示したようにユーザーデータをブロック単位で区切り、さらにブロック単位で区切られたブロックデータに対し、パケット単位で分割して論理メモリに格納していく。まず、ブロック単位で切り出す位置を決定する(1602)。次に、ブロックデータから所定のサイズを論理メモリに格納するためのDMA転送に係る命令をDMA部252にセットする(1603)。所定のサイズとは、例えば使用する通信方式において、1パケットで送信可能なペイロード長である。事前に計算することについては、実施形態1で説明した。なお、このDMA部252が複数の転送命令を1度に受け付けるようになっている場合は、1度に全てのユーザーデータ分の転送ができるように命令をセットしてもよい(1612)。   Next, data and control flow inside the communication control device 250 using DMA transfer when the main control device 102 transmits data to other devices will be described with reference to FIG. It is assumed that settings necessary for communication are performed in advance. First, main controller 102 places user data to be transmitted in the user buffer area. Then, an interrupt signal for a transmission request is asserted to the communication control unit 223 (1601). At this time, the communication control unit 223 is notified of the address where the user data is placed and the size of the user data. Upon receiving the transmission request, the communication control unit 223 divides the user data into blocks as shown in FIG. 9 (c), and further divides the block data divided into blocks into units of packets and stores them in the logical memory. Store it. First, the position to be cut out in block units is determined (1602). Next, an instruction relating to DMA transfer for storing a predetermined size from the block data in the logical memory is set in the DMA unit 252 (1603). The predetermined size is, for example, a payload length that can be transmitted in one packet in the communication method to be used. The calculation in advance has been described in the first embodiment. If the DMA unit 252 accepts a plurality of transfer instructions at once, the instructions may be set so that all user data can be transferred at one time (1612).

全てのDMA転送についてセットが完了したら、DMA部252に転送開始要求を送信する(1604)。命令を受け取ったDMA部252は、1パケットで送信可能なペイロード長を格納できるサイズの論理メモリを獲得するため、メモリ管理部251に論理メモリ獲得要求を送信する(1605)。メモリ管理部251が必要サイズを満たす論理メモリを空きリストから必要数取り出し、DMA部252に前記論理メモリの情報を通知する(1606)。通知を受けたDMA部252は、ユーザーデータ領域から通信バッファ領域の論理メモリへ、次々とDMAにより転送し、1パケット分のペイロードに相当するサイズをコピーする(1607,1608)。1パケット分のペイロードのDMA転送が終了したら、1パケット分のDMAによる論理メモリへの格納が終わったことを通信制御部223に通知する(1609)。1つのブロックデータが全て論理メモリに格納されるまで、処理1605から処理1609までを継続する(1613)。1つのブロックデータの論理メモリへの終了が完了したら、1つのユーザーデータ全てが論理メモリに格納されるまで、処理1602から処理1609を継続する(1614)。そして、通信制御部223で、すべてのパケットを他機器に送れたことを確認できたら(1610)、主制御装置102へ、送信完了通知を行う(1611)。   When the setting is completed for all DMA transfers, a transfer start request is transmitted to the DMA unit 252 (1604). The DMA unit 252 that has received the command transmits a logical memory acquisition request to the memory management unit 251 in order to acquire a logical memory of a size that can store the payload length that can be transmitted in one packet (1605). The memory management unit 251 extracts the required number of logical memories satisfying the required size from the free list, and notifies the DMA unit 252 of the information on the logical memory (1606). Receiving the notification, the DMA unit 252 transfers the data from the user data area to the logical memory in the communication buffer area by DMA one after another, and copies the size corresponding to the payload for one packet (1607, 1608). When the DMA transfer of the payload for one packet is completed, the communication control unit 223 is notified that the DMA storage for one packet has been completed (1609). Until all the block data is stored in the logical memory, the processing from 1605 to 1609 is continued (1613). When the end of one block data to the logical memory is completed, the process 1602 to the process 1609 are continued until all one user data is stored in the logical memory (1614). When the communication control unit 223 confirms that all packets have been sent to another device (1610), it notifies the main control device 102 of transmission completion (1611).

以上、実施形態3について説明してきた。本実施形態ではメモリ管理とデータ転送を通信制御部223とは独立したメモリ管理部251及びDMA部252で実現した。これにより、通信制御装置250内部で発生する各種メモリコピー処理に通信制御部223の処理がとられることが無いので、通信制御部223は例えば通信ヘッダの解析・生成処理等を前記データ転送と並列に実行できる。よって、通信処理効率の向上を図ることが出来る。   The embodiment 3 has been described above. In this embodiment, memory management and data transfer are realized by the memory management unit 251 and the DMA unit 252 independent of the communication control unit 223. As a result, the processing of the communication control unit 223 is not performed in the various memory copy processes that occur inside the communication control device 250, so the communication control unit 223 performs, for example, communication header analysis / generation processing in parallel with the data transfer. Can be executed. Therefore, the communication processing efficiency can be improved.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。   The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

以上のように、本実施形態によれば物理メモリを所定サイズの複数の論理メモリとして扱うメモリ管理を行うことにより、ハードウエア処理に向き、データの処理を容易、高速にでき、通信処理効率の向上が図れる。そして、ストリームデータを通信制御装置が直接、主記憶へ書き込むことが可能になるので処理負担が軽減できる。また、論理メモリのサイズを変更できるようにすることにより、メモリの利用率の向上を図れる。メモリの基本サイズは最小単位の定数倍にすることにより、サイズ変更時は候補サイズからの選択で済み、処理面でも最小単位の定数倍なので処理しやすくなる。   As described above, according to the present embodiment, by performing memory management in which physical memory is handled as a plurality of logical memories of a predetermined size, it is suitable for hardware processing, data processing can be performed easily and at high speed, and communication processing efficiency can be improved. Improvement can be achieved. Since the stream data can be directly written to the main memory by the communication control device, the processing load can be reduced. Further, by making it possible to change the size of the logical memory, it is possible to improve the memory utilization rate. By making the basic size of the memory a constant multiple of the minimum unit, it is only necessary to select from the candidate size when changing the size, and the processing is easy because it is a constant multiple of the minimum unit.

さらに、メモリの使用率が高くなったときは所定長の論理メモリによる管理を止めて、メモリにデータを詰めて格納することにより、通信中のメモリの不足によるパケット落ちが軽減できる。   Further, when the memory usage rate becomes high, the management by the predetermined length of the logical memory is stopped, and the data is stored in the memory so as to reduce the packet drop due to the shortage of the memory during the communication.

Claims (7)

受信したデータ又は送信要求されたデータを格納するメモリを備える通信装置におけるメモリ管理方法であって、
通知された通信方式に基づいて論理メモリの基本サイズを決定する工程と、
前記メモリに前記基本サイズの論理メモリを設定する工程と、
前記論理メモリに受信したデータ又は送信要求されたデータを格納する工程と、
を含むことを特徴とする通信装置におけるメモリ管理方法。
A memory management method in a communication device including a memory for storing received data or data requested to be transmitted,
Determining a basic size of the logical memory based on the notified communication method;
Setting the basic size logical memory in the memory;
Storing received data or transmission requested data in the logical memory;
A memory management method in a communication device, comprising:
前記メモリの使用率が所定の閾値をこえたときは、前記メモリに前記論理メモリを設定せずに、データを連続的に前記メモリに格納することを特徴とした請求項1に記載の方法。   2. The method according to claim 1, wherein when the usage rate of the memory exceeds a predetermined threshold value, data is continuously stored in the memory without setting the logical memory in the memory. 前記論理メモリの基本サイズを決定する工程は、受信データのサイズ又は送信データのサイズの統計に基づいて前記基本サイズを変更することを特徴とする請求項1又は2に記載の方法。   The method according to claim 1 or 2, wherein the step of determining a basic size of the logical memory changes the basic size based on statistics of a size of received data or a size of transmitted data. 前記基本サイズは受信と送信とで独立した値を設定できることを特徴とする請求項1乃至3のいずれか1項に記載の方法。   The method according to claim 1, wherein the basic size can be set independently for reception and transmission. 前記メモリへの格納はDMAによることを特徴とする請求項1乃至4のいずれか1項に記載の方法。   The method according to claim 1, wherein storing in the memory is performed by DMA. 通信に用いるメモリを備える通信装置であって、
通知された通信方式に基づいて論理メモリの基本サイズを決定する手段と、
前記メモリに前記基本サイズの論理メモリを設定する手段と、
前記論理メモリに受信したデータ又は送信要求されたデータを格納する手段と、
を備えることを特徴とする通信装置。
A communication device comprising a memory used for communication,
Means for determining the basic size of the logical memory based on the notified communication method;
Means for setting the basic size logical memory in the memory;
Means for storing received data or requested data in the logical memory;
A communication apparatus comprising:
請求項1乃至5のいずれか1項に記載された方法の各工程をコンピュータに実行させるためのプログラム。   The program for making a computer perform each process of the method described in any one of Claims 1 thru | or 5.
JP2011229893A 2011-10-19 2011-10-19 Memory management method of communication device, communication device, and program Pending JP2013090200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011229893A JP2013090200A (en) 2011-10-19 2011-10-19 Memory management method of communication device, communication device, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011229893A JP2013090200A (en) 2011-10-19 2011-10-19 Memory management method of communication device, communication device, and program

Publications (1)

Publication Number Publication Date
JP2013090200A true JP2013090200A (en) 2013-05-13

Family

ID=48533683

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011229893A Pending JP2013090200A (en) 2011-10-19 2011-10-19 Memory management method of communication device, communication device, and program

Country Status (1)

Country Link
JP (1) JP2013090200A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022545011A (en) * 2020-07-09 2022-10-24 エルジー エナジー ソリューション リミテッド Communication system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022545011A (en) * 2020-07-09 2022-10-24 エルジー エナジー ソリューション リミテッド Communication system and method

Similar Documents

Publication Publication Date Title
EP3457644B1 (en) Transfer device, transfer method, and computer-readable medium
JP5645609B2 (en) COMMUNICATION DEVICE, COMMUNICATION DEVICE CONTROL METHOD, AND PROGRAM
CN113938945B (en) Method and device for sending data packets
US8214552B2 (en) Transmission apparatus, transmission method, communication apparatus, and program
JP2011160140A (en) Communication unit and method of controlling the same
WO2014043224A1 (en) Apparatus and method for optimizing semi-active workloads
US8838782B2 (en) Network protocol processing system and network protocol processing method
CN102156662A (en) Method and equipment for processing data
US11784929B2 (en) Heterogeneous link data translation and distribution method, system and device, and storage medium
US20140297791A1 (en) Communication apparatus, method of controlling the same, and storage medium
CN105429910A (en) Message transmission and processing method and device
US8842547B2 (en) Communication control apparatus and control method
CN108132904A (en) A kind of baseband intermediate frequency exchange method and system
JP2013090200A (en) Memory management method of communication device, communication device, and program
WO2014010189A1 (en) Proxy device, communication system, program
CN101631353B (en) Method and device for managing status packet data unit
JP2015106796A (en) Communication device, communication control method, and program
JP2009037285A (en) Network device
JP2011116083A (en) Printer and control method therefor, program
CN115280678A (en) Communication device, communication system, and communication method
CN113254202A (en) 5G base station forward-transmission lossless packet capturing method based on gigabit Ethernet port
JP5756738B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND COMMUNICATION METHOD
JP2014168144A (en) Communication method and switching hub
JP2004260562A (en) Method and device for transmitting and receiving packet
WO2014030321A1 (en) Information processing device