JP2016174292A - Communication device, communication control program, and communication control method - Google Patents
Communication device, communication control program, and communication control method Download PDFInfo
- Publication number
- JP2016174292A JP2016174292A JP2015053684A JP2015053684A JP2016174292A JP 2016174292 A JP2016174292 A JP 2016174292A JP 2015053684 A JP2015053684 A JP 2015053684A JP 2015053684 A JP2015053684 A JP 2015053684A JP 2016174292 A JP2016174292 A JP 2016174292A
- Authority
- JP
- Japan
- Prior art keywords
- data
- tail pointer
- unit
- pointer
- communication device
- 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.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本発明は、通信装置に関する。 The present invention relates to a communication device.
インターネットなどで利用されている通信プロトコルとして、TCP(Transmission Control Protocol)とIP(Internet Protocol)とを組み合わせたものが知られている。TCP/IPはバイトストリーム型であり、正規化された受信データはリングバッファに格納される場合がある。 As a communication protocol used in the Internet or the like, a combination of TCP (Transmission Control Protocol) and IP (Internet Protocol) is known. TCP / IP is a byte stream type, and normalized received data may be stored in a ring buffer.
リングバッファ形式の送信バッファを用いて送信制御を行う技術が知られている(例えば、特許文献1参照)。 A technique for performing transmission control using a ring buffer type transmission buffer is known (for example, see Patent Document 1).
受信側の通信装置は、受信データをリングバッファに格納する際に、次の受信データの書き込み位置を示すヘッドポインタと、アプリケーション層などの上位層の機能による次のデータ引き取り位置を示すテイルポインタとを用いて受信可能なデータサイズを求める。受信側の通信装置は、送信側の通信装置に受信可能なデータサイズを公告(アドバタイズ)することによって通知する。 When the receiving side communication device stores the received data in the ring buffer, the head pointer indicating the writing position of the next received data, and the tail pointer indicating the next data collection position by the function of the upper layer such as the application layer, Is used to determine the receivable data size. The receiving communication device notifies the transmitting communication device by advertising (advertisement) the receivable data size.
しかし、受信側の通信装置が通常動作モードから省電力動作モードに移行するなどによって受信処理のリソースが縮退した状態となった場合には、受信バッファとして使用できるリングバッファの容量や、受信データを処理する能力が通常動作モードと比較して低下している。このため、受信側の通信装置から送信側の通信装置に受信可能なデータサイズを公告し、送信側の通信装置によって送信されるデータを受信しても、受信側の通信装置は、そのデータの処理ができないおそれがある。 However, if the reception processing resources are degenerated due to the communication device on the receiving side shifting from the normal operation mode to the power saving operation mode, the capacity of the ring buffer that can be used as the reception buffer and the received data The ability to process is reduced compared to the normal operating mode. For this reason, even if the data size that can be received is announced from the communication device on the reception side to the communication device on the transmission side, and the data transmitted by the communication device on the transmission side is received, the communication device on the reception side Processing may not be possible.
そこで、本発明は、送信側の通信装置に公告する受信可能なデータサイズを変更することを目的とする。 Therefore, an object of the present invention is to change the receivable data size notified to the communication device on the transmission side.
開示の一実施の形態の通信装置は、
バイトストリームでデータ通信を行うプロトコルにしたがって動作する通信装置であって、
他の通信装置によって送信されたデータを受信する受信部と、
該受信部によって受信したデータを格納するリングバッファ領域を有する記憶部と、
前記受信部によって受信したデータに基づいて、該データを前記リングバッファ領域に格納した場合に次に受信するデータの書き込み位置を示すヘッドポインタを検出するプロトコル処理部と、
受信可能なデータ量を算出する際に使用する第1のテイルポインタと、上位層によって処理されていないデータ量を算出する際に使用する第2のテイルポインタとを設定するシステム制御部と、
該システム制御部によって設定する前記第1のテイルポインタ、および前記第2のテイルポインタのいずれかを選択する選択部と、
前記プロトコル処理部によって算出したヘッドポインタと、前記選択部によって選択した前記第1のテイルポインタおよび前記第2のテイルポインタのいずれかとに基づいて、前記他の通信装置に公告する前記リングバッファ領域の空き容量を算出する空き容量算出部と、
前記空き容量算出部によって算出した前記リングバッファ領域の空き容量を前記他の通信装置に公告する送信部と
を有する。
A communication device according to an embodiment of the disclosure includes:
A communication device that operates according to a protocol for performing data communication in a byte stream,
A receiving unit for receiving data transmitted by another communication device;
A storage unit having a ring buffer area for storing data received by the receiving unit;
A protocol processing unit for detecting a head pointer indicating a write position of data to be received next when the data is stored in the ring buffer area based on the data received by the receiving unit;
A system control unit that sets a first tail pointer that is used when calculating the amount of receivable data and a second tail pointer that is used when calculating the amount of data not processed by an upper layer;
A selection unit for selecting one of the first tail pointer and the second tail pointer set by the system control unit;
Based on the head pointer calculated by the protocol processing unit and either the first tail pointer or the second tail pointer selected by the selection unit, the ring buffer area to be notified to the other communication device A free space calculation unit for calculating free space;
A transmission unit that advertises the free capacity of the ring buffer area calculated by the free capacity calculation unit to the other communication device.
開示の実施の形態によれば、送信側の通信装置に公告する受信可能なデータサイズを変更することができる。 According to the embodiment of the disclosure, it is possible to change the receivable data size notified to the communication device on the transmission side.
次に、本発明を実施するための形態を、以下の実施例に基づき図面を参照しつつ説明する。以下で説明する実施例は一例に過ぎず、本発明が適用される実施の形態は、以下の実施例に限られない。
なお、実施例を説明するための全図において、同一機能を有するものは同一符号を用い、繰り返しの説明は省略する。
Next, the form for implementing this invention is demonstrated, referring drawings based on the following Examples. Examples described below are merely examples, and embodiments to which the present invention is applied are not limited to the following examples.
In all the drawings for explaining the embodiments, the same reference numerals are used for those having the same function, and repeated explanation is omitted.
<第1の実施の形態>
<通信システム>
図1は、本実施の形態に係る通信システムを示す図である。通信システムは送信装置100と受信装置200とを有する。送信装置100と受信装置200との間は、インターネットなどのネットワーク50を介して有線または無線によって接続される。送信装置100と受信装置200は、バイトストリームでデータ通信を行うTCPなどの所定のプロトコルにしたがって通信を行う。
<First Embodiment>
<Communication system>
FIG. 1 is a diagram showing a communication system according to the present embodiment. The communication system includes a
送信装置100は、受信装置200によって公告される受信可能なデータ量(データ長)に応じて、データを付帯したパケットを受信装置200に送信する。受信装置200は、送信装置100によって送信されたパケットを受信すると、該パケットに付帯されるデータ量に基づいて、受信可能なデータ量を公告(アドバタイズ)する。
The
<フレーム構成>
図2は、送信装置100と受信装置200との間で送受信されるフレームフォーマットの一例として、TCPヘッダのフォーマットを示す。
<Frame configuration>
FIG. 2 shows a TCP header format as an example of a frame format transmitted and received between the
フレームは、発信元ポート番号フィールドと、宛先ポート番号フィールドと、シーケンス番号フィールドと、確認応答(ACK)番号フィールドと、データオフセットフィールドと、予約フィールドと、コードビットフィールドとを有する。さらに、フレームは、ウインドウサイズフィールドと、チェックサムフィールドと、緊急ポインタフィールドと、オプションフィールドと、パディングフィールドとを有する。 The frame includes a source port number field, a destination port number field, a sequence number field, an acknowledgment (ACK) number field, a data offset field, a reservation field, and a code bit field. In addition, the frame has a window size field, a checksum field, an urgent pointer field, an options field, and a padding field.
発信元ポート番号フィールドは16ビットで構成され、発信元のポート番号が格納される。発信元のポート番号は、TCPパケットの送信元のアプリケーションを識別するための番号である。宛先ポート番号フィールドは16ビットで構成され、宛先のポート番号が格納される。宛先のポート番号は、あて先となるアプリケーションが待ち受けしているポートの番号である。 The source port number field is composed of 16 bits and stores the source port number. The port number of the transmission source is a number for identifying the application that is the transmission source of the TCP packet. The destination port number field is composed of 16 bits and stores the destination port number. The destination port number is the port number on which the destination application is waiting.
シーケンス番号フィールドは32ビットで構成され、分割されたTCPセグメントのシーケンス番号が格納される。シーケンス番号は、データを送信する送信装置100によって管理される。送信装置100は、データを送信するたびに、送信したデータのバイト数分だけシーケンス番号を加算し、TCPパケットに付帯して送信する。確認応答番号フィールドは32ビットで構成され、送信側が次に送信すべきデータのシーケンス番号が格納される。確認応答番号は、受信したデータに対して、どこのバイト位置までを受信したかを表す。
The sequence number field is composed of 32 bits and stores the sequence numbers of the divided TCP segments. The sequence number is managed by the
データオフセットフィールドは4ビットで構成され、TCPヘッダ長が4オクテット単位で格納される。データオフセットは、TCPデータが始まる位置を表す。予約フィールドは6ビットで構成され、0が格納される。コードビットフィールドは6ビットで構成され、各ビットはフラグとして使用される。 The data offset field is composed of 4 bits, and the TCP header length is stored in units of 4 octets. The data offset represents the position where the TCP data starts. The reserved field is composed of 6 bits and 0 is stored. The code bit field is composed of 6 bits, and each bit is used as a flag.
ウインドウサイズフィールドは16ビットで構成され、受信側が現在受信可能なデータサイズを送信側に通知するために使用される。送信側は、ウインドウサイズで指定されたデータサイズ以上のデータを送信しない。チェックサムフィールドは16ビットで構成され、データの信頼性を保証するために使用される。オプションフィールドおよびパディングフィールドは32ビットで構成され、パディングフィールドには0が格納される。 The window size field is composed of 16 bits and is used for notifying the transmitting side of the data size that the receiving side can currently receive. The transmission side does not transmit data larger than the data size specified by the window size. The checksum field is composed of 16 bits and is used to ensure data reliability. The option field and the padding field are composed of 32 bits, and 0 is stored in the padding field.
<受信装置200>
図3は、本実施の形態に係る受信装置200のハードウェア構成図である。図3に示されているように、本実施の形態の受信装置200は、受信装置200全体の動作を制御するCPU(Central Processing Unit)202、およびIPL(Initial Program Loader)等のCPU202の駆動に用いられるプログラムを記憶したROM(Read Only Memory)204を備えている。さらに、受信装置200は、CPU202のワークエリアとして使用されるRAM(Random Access Memory)206、受信装置用のプログラム等の各種データを記憶するフラッシュメモリ210、およびCPU202の制御にしたがってフラッシュメモリ210に対する各種データの読み出しまたは書き込みを制御するSSD(Solid State Drive)208を備えている。さらに、受信装置200は、ネットワーク50を利用してデータ伝送をするためのネットワークI/F(Interface)212、および上記各構成要素を図3に示されているように電気的に接続するためのアドレスバスやデータバス等のシステムバス250を備えている。
<Receiving
FIG. 3 is a hardware configuration diagram of receiving
<受信装置200の機能構成>
図4は、本実施の形態に係る受信装置200を示す。受信装置200は、パケット送信部252と、パケット受信部254と、プロトコル処理部256と、バッファ空き容量算出部258と、DMA(Direct Memory Access)制御部260と、受信データ量算出部262と、選択部264と、第1のテイルポインタ設定部266と、第2のテイルポインタ設定部268と、記憶部270と、システム制御部272とを有する。これら各部は、図3に示されている各構成要素のいずれかが、フラッシュメモリ210からRAM206上に展開されたプログラムに従ったCPU202からの命令によって動作することで実現される機能が含まれる。また、受信装置200は、図3に示されているROM204、RAM206、フラッシュメモリ210によって構築される記憶部270を有している。記憶部270は、リングバッファ領域を有する。リングバッファ領域とは、記憶部270に確保される一定の領域であり、その領域は「環(リング)」であるように扱われ、末尾(最終アドレス)と先頭(先頭アドレス)とがつながった環状構造と見なされる。
<Functional configuration of receiving
FIG. 4 shows a receiving
(受信装置200の各機能構成)
次に、図3および図4を用いて、受信装置200の各機能構成について詳細に説明する。なお、以下では、受信装置200の各機能構成を説明するにあたって、図3に示されている各構成要素のうち、受信装置200の各機能構成を実現させるための主な構成要素との関係も説明する。
(Each functional configuration of receiving apparatus 200)
Next, each functional configuration of the receiving
図4に示される受信装置200のパケット送信部252は、ネットワークI/F212によって実現され、プロトコル処理部256によって生成されたIPパケットをネットワーク50を経由して送信装置100に送信する。
The
図4に示される受信装置200のパケット受信部254は、ネットワークI/F212によって実現され、送信装置100によって送信されたIPパケットを受信し、該IPパケットをプロトコル処理部256に入力する。
The
図4に示される受信装置200のプロトコル処理部256は、CPU202からの命令によって実現される。プロトコル処理部256は、パケット送信部252、およびパケット受信部254と接続される。プロトコル処理部256は、TCP/IPプロトコルにしたがってデータの送受信を行う。例えば、プロトコル処理部256は、パケット受信部254によって入力されるIPパケットに付帯されるデータをDMA制御部260に入力する。さらに、プロトコル処理部256は、パケット受信部254によって入力されるパケットに付帯されるデータに基づいてヘッドポインタの位置を検出し、該ヘッドポインタの位置を表すヘッドポインタ信号をバッファ空き容量算出部258、および受信データ量算出部262に入力する。ここで、ヘッドポインタとは、記憶部270のリングバッファ領域に格納されるデータの先頭(先頭アドレス)を示す変数であり、次に受信されるデータの書き込みを開始する位置を示す。また、プロトコル処理部256は、バッファ空き容量算出部258によって入力されるバッファの空き容量を表すバッファ空き容量信号に基づいて、ウインドウサイズを設定し、該ウインドウサイズを付帯したACKなどのIPパケットを作成し、パケット送信部252に入力する。
The
図4に示される受信装置200のDMA制御部260は、ネットワークI/F212、およびCPU202からの命令によって実現される。DMA制御部260は、プロトコル処理部256と接続される。DMA制御部260は、プロトコル処理部256によって入力されるデータをシステムバス250を介して、記憶部270のリングバッファ領域にダイレクトメモリアクセスによって格納する。また、DMA制御部260は、システムバス250を介して、記憶部270のリングバッファ領域に格納されたデータを取得し、プロトコル処理部256に入力する。
The
図4に示される受信装置200の受信データ量算出部262は、演算回路などのハードウェアや、CPU202からの命令によって実現される。受信データ量算出部262は、プロトコル処理部256と接続される。受信データ量算出部262は、プロトコル処理部256によって入力されるヘッドポインタ信号により表されるヘッドポインタと、第2のテイルポインタ設定部268によって入力される上位層による引き取りが行われていないデータ量を算出する際に使用する第2のテイルポインタとに基づいて、受信データがあることを表す受信データイベント信号を作成する。ここで、第2のテイルポインタとは、記憶部270のリングバッファ領域に格納されたデータの末尾(末尾のアドレス)を指す変数である。例えば、受信データ量算出部262は、ヘッドポインタと、第2のテイルポインタが一致しない場合に受信データイベント信号を作成し、受信データ量を算出する。受信データ量算出部262は、システム制御部272に受信データイベント信号を入力するとともに、受信データ量を表す受信データ量信号を入力する。具体的には、受信データ量算出部262は、ヘッドポインタと第2のテイルポインタとの間の差分を算出することによって、受信データ量を算出する。
The reception data amount
図4に示される受信装置200のシステム制御部272は、比較回路などのハードウェアや、CPU202からの命令によって実現される。システム制御部272は、受信データ量算出部262、およびシステムバス250と接続される。システム制御部272は、受信データ量算出部262によって入力される受信データイベント信号、および受信データ量信号と、記憶部270のリングバッファ領域に格納されるデータ量に基づいて、ヘッドポインタの位置を把握する。
The
システム制御部272は、記憶部270のリングバッファ領域に格納されたデータに基づいて、アプリケーション層などの上位層によって引き取りされていない未処理データがある場合に、引き取りされていない未処理データがあることを上位層に通知する。上位層は、システム制御部272によって引き取りされていない未処理データがあることが通知されると、記憶部270のリングバッファ領域に格納されたデータを引き取る。上位層は、引き取ったデータ量に応じて第2のテイルポインタをずらすことによって変更し、変更した第2のテイルポインタをシステム制御部272に通知する。システム制御部272は、上位層によって通知される第2のテイルポインタを第2のテイルポインタ設定部268に設定する。
Based on the data stored in the ring buffer area of the
さらに、システム制御部272は、受信装置200が通常動作モードである場合には選択部264に第2のテイルポインタ設定部268に設定される第2のテイルポインタを選択するように設定するテイルポインタ選択信号を選択部264に入力する。また、システム制御部272は、受信装置200が通常動作モードから省電力動作モードに移行した場合に、第1のテイルポインタ設定部266に第1のテイルポインタを設定する。例えば、システム制御部272は、第1のテイルポインタとして、現在のヘッドポインタから5バイトから20バイト程度、より好ましくは10バイト程度先頭アドレスから最終アドレスに向かう方向に設定する。さらに、システム制御部272は、受信装置200が省電力動作モードである場合には選択部264に第1のテイルポインタ設定部266に設定される第1のテイルポインタを選択するように設定するテイルポインタ選択信号を選択部264に入力する。
Further, the
図4に示される受信装置200の第1のテイルポインタ設定部266は、CPU202からの命令によって実現される。第1のテイルポインタ設定部266は、システムバス250と接続され、システム制御部272によって通知される第1のテイルポインタを設定する。図4に示される受信装置200の第2のテイルポインタ設定部268は、CPU202からの命令によって実現される。第2のテイルポインタ設定部268は、システムバス250と接続され、システム制御部272によって通知される第2のテイルポインタを設定する。
The first tail
図4に示される受信装置200の選択部264は、CPU202からの命令によって実現される。選択部264は、第1のテイルポインタ設定部266、第2のテイルポインタ設定部268、システム制御部272、およびバッファ空き容量算出部258と接続される。選択部264は、システム制御部272によって入力されるテイルポインタ選択信号にしたがって、第1のテイルポインタ設定部266によって設定される第1のテイルポインタまたは第2のテイルポインタ設定部268によって設定される第2のテイルポインタをバッファ空き容量算出部258に入力する。
The
図4に示される受信装置200のバッファ空き容量算出部258は、CPU202からの命令によって実現される。バッファ空き容量算出部258は、プロトコル処理部256と接続される。バッファ空き容量算出部258は、プロトコル処理部256によって入力されるヘッドポインタ信号によって表されるヘッドポインタと、選択部264によって入力される第1のテイルポインタまたは第2のテイルポインタに基づいて、バッファ空き容量を求める。バッファ空き容量算出部258は、プロトコル処理部256にバッファ空き容量を表すバッファ空き容量信号を入力する。
The buffer free
<受信装置200の動作>
以下、受信装置200の動作を通常動作モードと省電力動作モードのそれぞれについて説明する。
<Operation of
Hereinafter, the operation of the receiving
<通常動作モード>
受信装置200のシステム制御部272は、通常動作モードでは、選択部264に第2のテイルポインタ設定部268によって設定される第2のテイルポインタを選択するテイルポインタ選択信号を入力する。このため、バッファ空き容量算出部258は、プロトコル処理部256によって入力されるヘッドポインタ信号によって表されるヘッドポインタと、選択部264によって入力される第2のテイルポインタとに基づいてバッファの空き容量を算出する。また、受信データ量算出部262は、プロトコル処理部256によって入力されるヘッドポインタ信号によって表されるヘッドポインタと、第2のテイルポインタ設定部268によって入力される第2のテイルポインタとが一致するか否かを判断する。受信データ量算出部262は、ヘッドポインタと第2のテイルポインタとが一致しない場合には受信データがあると判断し、受信データイベント信号を作成し、該受信データイベント信号をシステム制御部272に入力する。システム制御部272は、受信データイベント信号が入力されるか否かによって、上位層によって引き取りされていないデータがあるか否かを判断する。
<Normal operation mode>
In the normal operation mode, the
図5は、リングバッファの概念図(その1)を示し、上位層によって引き取られていない、つまり上位層によって処理されていない未処理の受信データが存在する場合を示す。図5において、縦方向はアドレスを示し、先頭アドレスから最終アドレスに向かってデータが格納される。以下、先頭アドレスから最終アドレスに向かう方向を「データ格納順方向」と呼び、その逆方向を「データ格納逆方向」と呼ぶ。また、図5において、点によって表されている領域は空き領域を示し、斜線によって表されている領域は受信データが格納されている領域を示す。 FIG. 5 is a conceptual diagram (part 1) of the ring buffer, showing a case where there is unprocessed received data that has not been taken over by the upper layer, that is, not processed by the upper layer. In FIG. 5, the vertical direction indicates an address, and data is stored from the head address toward the last address. Hereinafter, the direction from the first address to the last address is referred to as “data storage forward direction”, and the opposite direction is referred to as “data storage reverse direction”. In FIG. 5, an area represented by a dot indicates an empty area, and an area represented by a diagonal line indicates an area in which received data is stored.
送信装置100と受信装置200が通信を開始する際には、ヘッドポインタおよび第2のテイルポインタは先頭アドレスに設定されると仮定する。プロトコル処理部256は、パケット受信部254によって受信パケットが入力された場合に該受信パケットに付帯されるデータ量に基づいて、ヘッドポインタの位置をデータ格納順方向にずらすことによって変更する。プロトコル処理部256は、該変更したヘッドポインタを表すヘッドポインタ信号をバッファ空き容量算出部258、および受信データ量算出部262に入力する。また、システム制御部272は、上位層によって通知される第2のテイルポインタを第2のテイルポインタ設定部268に設定する。
When the
図5によれば、ヘッドポインタはデータ格納順方向に第2のテイルポインタより進んでおり、ヘッドポインタから第2のテイルポインタまでのデータ格納逆方向における距離に相当する受信データが存在している。この場合、バッファ空き容量算出部258は、ヘッドポインタによって示されるアドレスと最終アドレスとの間の領域に格納できるデータ量と、先頭アドレスと第2のテイルポインタによって示されるアドレスとの間の領域に格納できるデータ量の和を求めることによって、バッファ空き容量を算出する。
According to FIG. 5, the head pointer is advanced from the second tail pointer in the data storage forward direction, and there is received data corresponding to the distance in the data storage reverse direction from the head pointer to the second tail pointer. . In this case, the buffer free
また、受信データ量算出部262は、ヘッドポインタと第2のテイルポインタが不一致であることによって、受信データイベント信号を作成し、該受信データイベント信号をシステム制御部272に入力する。これによって、システム制御部272は、上位層に対して引き取られていない未処理の受信データが存在することを示す未処理データ通知を発行する。未処理データ通知を受信した上位層は、ヘッドポインタから第2のテイルポインタまでのデータ格納逆方向における距離を計算することで、未処理の受信データのデータ量(データ長)を検出する。
The reception data amount
図6は、リングバッファの概念図(その2)を示し、上位層によって引き取られていない未処理の受信データが存在しない場合を示す。図6において、縦方向はアドレスを示し、先頭アドレスから最終アドレスに向かってデータが格納される。また、図6において、点によって表されている領域は空き領域を示す。 FIG. 6 is a conceptual diagram (part 2) of the ring buffer, showing a case where there is no unprocessed received data that has not been taken over by the upper layer. In FIG. 6, the vertical direction indicates an address, and data is stored from the head address toward the last address. In FIG. 6, an area represented by a dot indicates an empty area.
図6によれば、ヘッドポインタと第2のテイルポインタは一致しており受信データは存在していない。この場合、バッファ空き容量算出部258は、ヘッドポインタから第2のテイルポインタまでのデータ格納逆方向における距離に相当する領域に格納できるデータ量、つまりリングバッファに格納できるデータ量の全てを、バッファ空き容量として算出する。
According to FIG. 6, the head pointer matches the second tail pointer, and no received data exists. In this case, the buffer free
また、受信データ量算出部262は、ヘッドポインタと第2のテイルポインタが一致しているため、受信データイベント信号は作成しない。このため、システム制御部272は、上位層に対して未処理の受信データが存在することを示す未処理データ通知を発行しない。
In addition, the reception data amount
図7は、本実施の形態に係る受信装置200の動作(その1)を示し、受信装置200が送信装置100によって送信されたパケットを受信する際の動作を示す。
FIG. 7 shows the operation (part 1) of receiving
ステップS702では、システム制御部272は、通常動作モードに設定する。通常動作モードでは、RAM206の全てを使用できる。
In step S702, the
ステップS704では、システム制御部272は、選択部264に、第2のテイルポインタ設定部268によって設定される第2のテイルポインタを選択するように設定するテイルポインタ選択信号を入力する。
In step S <b> 704, the
ステップS706では、パケット受信部254は送信装置100によって送信されたパケットを受信する。
In step S706, the
ステップS708では、受信データ量算出部262は、受信データがあるか否かを判断する。受信データ量算出部262は、ヘッドポインタと第2のテイルポインタとが一致するか否かに基づいて、受信データがあるか否かを判断する。
In step S708, the received data
ステップS710では、ステップS708で受信データがあると判断した場合、システム制御部272は、上位層に対して、引き取られていない未処理の受信データがあることを示す未処理データ通知を送信する。
In step S710, when it is determined that there is received data in step S708, the
ステップS712では、システム制御部272は、上位層によって通知される第2のテイルポインタを第2のテイルポインタ設定部268に設定する。
In step S712, the
ステップS714では、ステップS712の処理が終了した後、またはステップS708において受信データがないと判断された場合、バッファ空き容量算出部258は、プロトコル処理部256によって入力されるヘッドポインタと選択部264によって入力される第2のテイルポインタとに基づいてバッファ空き容量を算出する。
In step S714, after the process of step S712 is completed or when it is determined in step S708 that there is no received data, the buffer free
ステップS716では、プロトコル処理部256は、バッファ空き容量算出部258によって算出されたバッファ空き容量を表す情報を付帯したACKなどのIPパケットを作成し、パケット送信部252から送信する。
In step S 716, the
<省電力動作モード>
受信装置200のシステム制御部272は、省電力動作モードでは、選択部264に第1のテイルポインタ設定部266によって設定される第1のテイルポインタを選択するテイルポインタ選択信号を入力する。このため、バッファ空き容量算出部258は、プロトコル処理部256によって入力されるヘッドポインタ信号によって表されるヘッドポインタと、選択部264によって入力される第1のテイルポインタとに基づいてバッファの空き容量を算出する。また、受信データ量算出部262は、プロトコル処理部256によって入力されるヘッドポインタ信号によって表されるヘッドポインタと、第2のテイルポインタ設定部268によって入力される第2のテイルポインタとが一致するか否かを判断する。受信データ量算出部262は、ヘッドポインタと第2のテイルポインタとが一致しない場合には受信データがあると判断し、受信データイベント信号を作成し、該受信データイベント信号をシステム制御部272に入力する。システム制御部272は、受信データイベント信号が入力されるか否かによって、上位層によって引き取りされていないデータがあるか否かを判断する。
<Power saving operation mode>
In the power saving operation mode, the
図8は、リングバッファの概念図(その3)を示し、上位層によって引き取られていない未処理の受信データが存在しない場合を示す。図8において、縦方向はアドレスを示し、先頭アドレスから最終アドレスに向かってデータが格納される。また、図8において、点によって表されている領域は空き領域を示す。 FIG. 8 is a conceptual diagram (part 3) of the ring buffer, and shows a case where there is no unprocessed received data that has not been taken over by the upper layer. In FIG. 8, the vertical direction indicates an address, and data is stored from the head address toward the last address. In FIG. 8, the area represented by a point indicates a free area.
図8によれば、第1のテイルポインタは、ヘッドポインタに対してデータ格納順方向に所定のデータ量に相当するアドレスだけ離れた位置(アドレス)に設定される。また、ヘッドポインタと第2のテイルポインタは一致しており受信データは存在していない。この場合、ヘッドポインタから第1のテイルポインタまでのデータ格納逆方向における距離に相当する領域に格納できるデータ量が、バッファ空き容量として送信装置100に通知される。
According to FIG. 8, the first tail pointer is set at a position (address) that is separated from the head pointer by an address corresponding to a predetermined amount of data in the data storage forward direction. Further, the head pointer and the second tail pointer coincide with each other, and no received data exists. In this case, the amount of data that can be stored in an area corresponding to the distance in the data storage reverse direction from the head pointer to the first tail pointer is notified to the
また、受信データ量算出部262は、ヘッドポインタと第2のテイルポインタが一致しているため、受信データイベント信号は作成しない。このため、システム制御部272は、上位層に対して未処理の受信データが存在することを示す未処理データ通知を発行しない。
In addition, the reception data amount
図9は、リングバッファの概念図(その4)を示し、上位層によって引き取られていない、つまり上位層によって処理されていない未処理の受信データが存在する場合を示す。図9において、縦方向はアドレスを示し、先頭アドレスから最終アドレスに向かってデータが格納される。また、図9において、点によって表されている領域は空き領域を示し、斜線によって表されている領域は受信データが格納されている領域を示す。 FIG. 9 is a conceptual diagram (part 4) of the ring buffer, and shows a case where there is unprocessed received data that has not been taken over by the upper layer, that is, not processed by the upper layer. In FIG. 9, the vertical direction indicates an address, and data is stored from the head address toward the last address. In FIG. 9, an area represented by a dot indicates an empty area, and an area represented by a diagonal line indicates an area in which received data is stored.
送信装置100と受信装置200が通信を開始する際には、ヘッドポインタおよび第2のテイルポインタは先頭アドレスに設定されると仮定する。プロトコル処理部256は、パケット受信部254によって受信パケットが入力された場合に該受信パケットに付帯されるデータ量に基づいて、ヘッドポインタの位置をデータ格納順方向にずらすことによって変更する。プロトコル処理部256は、該変更したヘッドポインタを表すヘッドポインタ信号をバッファ空き容量算出部258、および受信データ量算出部262に入力する。また、システム制御部272は、上位層によって通知される第2のテイルポインタを第2のテイルポインタ設定部268に設定する。
When the
図9によれば、ヘッドポインタはデータ格納順方向に第2のテイルポインタより進んでおり、ヘッドポインタから第2のテイルポインタまでのデータ格納逆方向における距離だけの受信データが存在している。この場合、バッファ空き容量算出部258は、ヘッドポインタによって示されるアドレスと、第1のテイルポインタによって示されるアドレスとの間の領域に格納できるデータ量を求めることによって、バッファ空き容量を算出する。
According to FIG. 9, the head pointer advances from the second tail pointer in the data storage forward direction, and there is received data corresponding to the distance in the data storage reverse direction from the head pointer to the second tail pointer. In this case, the buffer free
また、受信データ量算出部262は、ヘッドポインタと第2のテイルポインタが不一致であることによって、受信データイベント信号を作成し、該受信データイベント信号をシステム制御部272に入力する。システム制御部272は、受信データイベント信号が入力されたか否かによって、上位層に対して引き取られていない未処理の受信データが存在することを示す未処理データ通知を発行する。未処理データ通知を受信した上位層は、ヘッドポインタから第2のテイルポインタまでのデータ格納逆方向における距離を計算することで、未処理の受信データのデータ量(データ長)を検出する。
The reception data amount
図10は、本実施の形態に係る受信装置200の動作(その2)を示し、受信装置200が送信装置100によって送信されたパケットを受信する際の動作を示す。
FIG. 10 shows the operation (part 2) of receiving
ステップS1002では、システム制御部272は、省電力動作モードに設定する。省電力動作モードでは、大規模なRAMには電源が供給されず、小規模なRAMの使用ができると仮定する。また、省電力動作モードにおいては、受信装置200を搭載する装置の電源は切られており、受信データを処理する機能は働いていないと仮定する。ここで、装置の一例は、プリンターなどの消費電力が非常に大きく、稼動しているとき以外は装置の電源を切断し、受信装置200の電源のみを投入しておくような装置を想定する。
In step S1002, the
ステップS1004では、システム制御部272は、第1のテイルポインタを設定し、該第1のテイルポインタを第1のテイルポインタ設定部266に入力する。
In step S1004, the
ステップS1006では、システム制御部272は、選択部264に、第1のテイルポインタ設定部266によって設定される第1のテイルポインタを選択するように設定するテイルポインタ選択信号を選択部264に入力する。
In step S <b> 1006, the
ステップS1008では、パケット受信部254は送信装置100によって送信されたパケットを受信する。
In step S <b> 1008, the
ステップS1010では、受信データ量算出部262は、受信データがあるか否かを判断する。受信データ量算出部262は、ヘッドポインタと第2のテイルポインタとが一致するか否かに基づいて、受信データがあるか否かを判断する。
In step S1010, the reception data amount
ステップS1012では、ステップS1010で受信データがあると判断した場合、システム制御部272は、上位層に対して、引き取られていない未処理の受信データがあることを示す未処理データ通知を送信する。
In step S1012, when it is determined that there is received data in step S1010, the
ステップS1014では、システム制御部272は、上位層によって通知される第2のテイルポインタを第2のテイルポインタ設定部268に設定する。
In step S1014, the
ステップS1016では、ステップS1014の処理が終了した後、またはステップS1010において受信データがないと判断した場合、バッファ空き容量算出部258は、ヘッドポインタと第1のテイルポインタとに基づいてバッファ空き容量を算出する。
In step S1016, after the process of step S1014 is completed or when it is determined in step S1010 that there is no received data, the buffer free
ステップS1018では、プロトコル処理部256は、バッファ空き容量算出部258によって算出されたバッファ空き容量を表す情報を付帯したACKなどのIPパケットを作成し、パケット送信部252から送信する。
In step S <b> 1018, the
図10に示されるフローチャートのステップS1010において、受信データ量算出部262によって、受信データがあると判断された場合に、以下の処理を行うようにしてもよい。受信データ量算出部262は、受信データの先頭部分などの一部分に示されるメッセージに含まれる受信データ量に基づいて、省電力動作モードを継続するか、通常動作モードに移行するかを判断する。受信データ量に基づいて、受信データ量算出部262は、少量のデータ交換で完了し、且つ受信装置200を搭載する装置によるデータ処理が必要ないか、受信装置200を搭載する装置によるデータ処理を必要とするかを判断する。受信データ量算出部262は、受信装置200を搭載する装置によるデータ処理が必要ない通信データである場合には省電力動作モードを継続すると判断し、受信装置200を搭載する装置によるデータ処理を必要とする通信データである場合には通常動作モードに移行すると判断する。受信データ量算出部262は、該判断結果をシステム制御部272に通知する。
In step S1010 of the flowchart shown in FIG. 10, when the received data
システム制御部272は、受信データ量算出部262によって通知される判断結果に基づいて、省電力動作モードを継続する場合には、ステップS1012以降の処理を行う。一方、システム制御部272は、通常動作モードに移行する場合には、受信装置200を搭載する装置に電源を投入するとともに、再起動要求を実施し(1)、大規模RAMに電源を投入する(2)。さらに、システム制御部272は、該装置が再起動したか否かを確認するとともに、大規模RAMの稼動を確認する(3)。さらに、システム制御部272は、大規模RAMの稼動を確認できた場合に、小規模RAMに格納した受信データを該大規模RAMに転送するとともに(4)、ヘッドポインタ、および第2のテイルポインタによって指し示されるアドレスに対応する物理アドレスにDMA制御部260における写像設定を行うことによって、小規模RAMから大規模RAMへの切り替えを行う(5)。その後、受信装置200は、図7に示した処理を実行する。
When continuing the power saving operation mode based on the determination result notified by the received data
上記において、(1)−(3)の処理には相当の時間を要するが、この期間では、送信装置100には第1のテイルポインタに基づいて算出されるバッファ空き容量が公告され、送信装置100は、該バッファ空き容量にしたがってパケットを送信する。このため、該パケットに付帯されるデータ量は少なく、受信装置200では大規模な受信データが発生しない。一方、通常動作モードに復帰した後は、送信装置100には第2のテイルポインタに基づいて算出されるバッファの空き容量が公告され、送信装置100は、該バッファ空き容量にしたがってパケットを送信する。このため、該パケットに付帯されるデータ量は多く、大規模な受信データが発生する。このように、受信データ量に基づいて、省電力動作モードから通常動作モードへ復帰することが可能である。
In the above, the processing of (1)-(3) takes a considerable time. During this period, the transmitting
本実施の形態に係る受信装置によれば、ヘッドポインタに対して所定のデータ量に相当するアドレスだけ離したアドレスに第1のテイルポインタを設定し、該第1のテイルポインタを使用してリングバッファの空き容量を算出することによって、実際の空き容量よりも小さく算出できる。このため、受信装置は、送信装置に実際の空き容量よりも小さい空き容量を受信可能なデータ量として通知でき、送信装置からのデータの受信速度をTCPフロー制御機能を用いて制限できる。 According to the receiving apparatus according to the present embodiment, the first tail pointer is set at an address separated from the head pointer by an address corresponding to a predetermined amount of data, and the ring is created using the first tail pointer. By calculating the free capacity of the buffer, it can be calculated smaller than the actual free capacity. For this reason, the receiving apparatus can notify the transmitting apparatus of a free capacity smaller than the actual free capacity as a receivable data amount, and can limit the reception speed of data from the transmitting apparatus using the TCP flow control function.
<第2の実施の形態>
本実施の形態に係る通信システムは図1を適用でき、フレーム構成は図2を適用できる。ただし、図1に示される通信システムにおいて、受信装置200の代わりに受信装置300を有する。
<Second Embodiment>
1 can be applied to the communication system according to this embodiment, and FIG. 2 can be applied to the frame configuration. However, the communication system shown in FIG. 1 includes a receiving
本実施の形態に係る受信装置300のハードウエア構成は、図3を適用できる。
FIG. 3 can be applied to the hardware configuration of receiving
<受信装置300の機能構成>
図11は、本実施の形態に係る受信装置300を示す。受信装置300は、パケット送信部352と、パケット受信部354と、プロトコル処理部356と、バッファ空き容量算出部358と、DMA制御部360と、受信データ量算出部362と、選択部364と、第1のテイルポインタ設定部366と、第2のテイルポインタ設定部368と、記憶部370と、システム制御部372とを有する。これら各部は、図3に示されている各構成要素のいずれかが、フラッシュメモリ210からRAM206上に展開されたプログラムに従ったCPU202からの命令によって動作することで実現される機能が含まれる。また、受信装置300は、図3に示されているROM204、RAM206、フラッシュメモリ210によって構築される記憶部370を有している。
<Functional configuration of receiving
FIG. 11
<受信装置300の各機能構成>
パケット送信部352、パケット受信部354、プロトコル処理部356、バッファ空き容量算出部358、DMA制御部360、受信データ量算出部362、選択部364、第1のテイルポインタ設定部366、第2のテイルポインタ設定部368、および記憶部370は、図4を参照して説明した受信装置200を適用できる。
<Each functional configuration of receiving
本実施の形態に係る受信装置200のシステム制御部372は、演算回路、比較回路などのハードウェアや、CPU202からの命令によって実現される。システム制御部372は、受信データ量算出部362、およびシステムバス350と接続される。システム制御部372は、受信データ量算出部362によって入力される受信データイベント信号、および受信データ量信号と、記憶部370のリングバッファ領域に格納されるデータ量に基づいて、ヘッドポインタの位置を把握する。
The
システム制御部372は、記憶部370のリングバッファ領域に格納されたデータに基づいて、アプリケーション層などの上位層によって引き取りされていない未処理データがある場合に、上位層に対して、引き取りされていない未処理の受信データがあることを示す未処理データ通知を通知する。上位層は、システム制御部372によって未処理データ通知が通知されると、記憶部270のリングバッファ領域に格納された未処理データを引き取る。上位層は、引き取った未処理データ量に応じて第2のテイルポインタをずらすことによって変更し、変更した第2のテイルポインタをシステム制御部372に通知する。システム制御部372は、上位層によって通知される第2のテイルポインタを第2のテイルポインタ設定部368に設定する。
Based on the data stored in the ring buffer area of the
さらに、システム制御部372は、受信装置300が通常動作モードである場合には選択部364に第2のテイルポインタ設定部368に設定される第2のテイルポインタを選択するように設定するテイルポインタ選択信号を選択部364に入力する。また、システム制御部372は、受信装置300が通常動作モードから省電力動作モードに移行した場合に、第1のテイルポインタ設定部366に第1のテイルポインタを設定する。例えば、システム制御部372は、第1のテイルポインタとして、現在のヘッドポインタから5バイトから20バイト程度、より好ましくは10バイト程度先頭アドレスから最終アドレスに向かう方向に設定する。さらに、システム制御部372は、受信装置300が省電力動作モードである場合には選択部364に第1のテイルポインタ設定部366に設定される第1のテイルポインタを選択するように設定するテイルポインタ選択信号を選択部364に入力する。
Further, the
さらに、システム制御部372は、通常動作モードから省電力動作モードに移行し、第1のテイルポインタ設定部366に第1のテイルポインタを設定した後に、送信装置100によってヘッドポインタと第1のテイルポインタに基づいて算出されるデータ量以上のデータが送信される場合、現在のヘッドポインタから5バイトから20バイト程度、より好ましくは10バイト程度先頭アドレスから最終アドレスに向かう方向に第1のテイルポインタをさらに変更する。これによって、受信装置200は、送信装置100によって送信されるパケットをさらに受信できる。
Further, the
通常動作モードから省電力動作モードに移行し、第1のテイルポインタ設定部366にヘッドポインタから所定のアドレスずらした位置に第1のテイルポインタが設定されると、送信装置100から受信できるデータは、そのずらした位置に相当するデータ量に制限される。この場合、送信装置100によって該データ量以下のデータが送信される場合に対応できる。しかし、送信装置100によって該データ量以上のデータが送信される場合には対応できないため、第1のテイルポインタの位置をさらに変更する。
When shifting from the normal operation mode to the power saving operation mode and the first tail pointer is set at a position shifted from the head pointer by a predetermined address in the first tail
通常動作モードから省電力動作モードに移行し、第1のテイルポインタ設定部366に設定される第1のテイルポインタの位置をヘッドポインタから大きくずらした場合、省電力動作モードから通常動作モードへ復帰する際に、小規模RAMから大規模RAMへのデータ転送量が多くなるため、非効率となる。このため、通常動作モードから省電力動作モードに移行し、第1のテイルポインタ設定部366に設定される第1のテイルポインタの位置をヘッドポインタから小さくずらして、送信装置100によってそのずらした位置に対応するデータ量以上のデータが送信される場合には、さらにずらすのが好ましい。
When the normal operation mode is shifted to the power saving operation mode and the position of the first tail pointer set in the first tail
本実施の形態によれば、省電力動作モードであっても、受信装置200は、送信装置100によって送信されるデータ量に応じて、受信できるデータ量を変更できる。
According to the present embodiment, even in the power saving operation mode, receiving
図12は、省電力動作モードに設定する場合に、第1のテイルポインタを設定しないで、第2のテイルポインタをずらすことによって対応した例を示す。第2のテイルポインタは、ヘッドポインタのデータ格納順方向において直前に設定される。このようにした場合、上位層によって引き取られていない未処理の受信データの量が多く、リングバッファの未使用領域が少ないように見えてしまう問題がある。また、第2のテイルポインタとヘッドポインタとが不一致であるため、受信データがリングバッファ上に存在しないにも拘らず、上位層に対して未処理の受信データが存在することを示す通知が発行される問題がある。また、未処理の受信データのデータ量が、ヘッドポインタと第2のテイルポインタとから求めることができないため、未処理の受信データの判定処理が非常に複雑となる。 FIG. 12 shows an example in which the second tail pointer is shifted without setting the first tail pointer when the power saving operation mode is set. The second tail pointer is set immediately before in the data storage forward direction of the head pointer. In such a case, there is a problem that the amount of unprocessed received data that has not been taken over by the upper layer is large and the unused area of the ring buffer appears to be small. Also, because the second tail pointer does not match the head pointer, a notification indicating that unprocessed received data exists is issued to the upper layer even though the received data does not exist on the ring buffer. There is a problem. In addition, since the amount of unprocessed received data cannot be obtained from the head pointer and the second tail pointer, the determination process of unprocessed received data becomes very complicated.
本実施の形態によれば、第2のテイルポインタに加えて、第1のテイルポインタを設定できるため、上位層によって引き取られていない未処理の受信データの量があるか否かの判定ができるとともに、送信装置に公告するバッファの空き容量も小さく算出できる。 According to the present embodiment, since the first tail pointer can be set in addition to the second tail pointer, it is possible to determine whether or not there is an amount of unprocessed received data that has not been collected by the upper layer. At the same time, the free space of the buffer that is notified to the transmitting device can be calculated small.
受信装置用の各プログラムは、インストール可能な形式または実行可能な形式のファイルによって、コンピュータで読み取り可能な記録媒体に記録されて流通されるようにしてもよい。また、上記記録媒体の他の例として、CD−R(Compact Disc Recordable)、DVD(Digital Versatile Disk)、ブルーレイディスク等が挙げられる。また、上記実施の形態の各プログラムが記憶されたCD−ROM等の記録媒体、並びに、これらプログラムが記憶されたフラッシュメモリは、プログラム製品(Program Product)として、国内または国外へ提供されることができる。 Each program for the receiving device may be recorded and distributed on a computer-readable recording medium by a file in an installable or executable format. Other examples of the recording medium include CD-R (Compact Disc Recordable), DVD (Digital Versatile Disk), and Blu-ray Disc. In addition, a recording medium such as a CD-ROM in which the programs of the above-described embodiments are stored, and a flash memory in which these programs are stored may be provided domestically or abroad as a program product (Program Product). it can.
また、通信システムを構成する送信装置100、および受信装置200は、相互に通信可能なものに適用できる。例えば、送信装置100、および受信装置200は、IP(Internet Protocol)電話機や、インターネット電話機、PC(Personal Computer)等に搭載することなどによって適用してもよい。さらに、送信装置100、および受信装置200は、スマートフォン、携帯電話機、カーナビゲーション端末、ウェアラブルコンピュータ、プロジェクタ、監視カメラ、電子黒板、電子看板(デジタルサイネージ)、ゲーム機、または、通信機能を備えた産業用機器に搭載することによって適用してもよい。ウェアラブルコンピュータには、腕時計型のものやヘッドマウントディスプレイ等が含まれる。また、産業用機器には、MFP(Multifunction Peripheral/Printer/Product)等のオフィス機器、内視鏡等の医療用機器、耕運機等の農業用機器などが含まれる。
Further, the
更に、例えば、端末に受信装置200が搭載され、そのアプリが自らセンターのサーバにアクセスして、各種データを送信したり取得する場合にも適用される。この場合、相手側が、端末ではなく、サーバの場合もあり得る。
Furthermore, for example, the present invention is also applied to a case where the receiving
上述した実施の形態において、受信装置は通信装置の一例であり、パケット受信部は受信部の一例であり、受信装置用プログラムは通信制御プログラムの一例である。 In the above-described embodiments, the receiving device is an example of a communication device, the packet receiving unit is an example of a receiving unit, and the receiving device program is an example of a communication control program.
本発明は特定の実施例、変形例を参照しながら説明されてきたが、各実施例、変形例は単なる例示に過ぎず、当業者は様々な変形例、修正例、代替例、置換例などを理解するであろう。説明の便宜上、本発明の実施例に従った装置は機能的なブロック図を用いて説明されたが、そのような装置はハードウェアで、ソフトウエアでまたはそれらの組み合わせで実現されてもよい。本発明は上記実施例に限定されず、本発明の精神から逸脱することなく、様々な変形例、修正例、代替例、置換例などが包含される。 Although the present invention has been described with reference to specific embodiments and modifications, each embodiment and modification is merely an example, and those skilled in the art will recognize various modifications, modifications, alternatives, substitutions, and the like. Will understand. For convenience of explanation, an apparatus according to an embodiment of the present invention has been described using a functional block diagram, but such an apparatus may be implemented in hardware, software, or a combination thereof. The present invention is not limited to the above embodiments, and various modifications, modifications, alternatives, substitutions, and the like are included without departing from the spirit of the present invention.
50 ネットワーク
100 送信装置
200、300 受信装置
202 CPU
204 ROM
206 RAM
208 SSD
210 フラッシュメモリ
212 ネットワークI/F
252、352 パケット送信部
254、354 パケット受信部
256、356 プロトコル処理部
258、358 バッファ空き容量算出部
260、360 DMA制御部
262、362 受信データ量算出部
264、364 選択部
266、366 第1のテイルポインタ設定部
268、368 第2のテイルポインタ設定部
270、370 記憶部
272、372 システム制御部
50
204 ROM
206 RAM
208 SSD
210
252 and 352
Claims (7)
他の通信装置によって送信されたデータを受信する受信部と、
該受信部によって受信したデータを格納するリングバッファ領域を有する記憶部と、
前記受信部によって受信したデータに基づいて、該データを前記リングバッファ領域に格納した場合に次に受信するデータの書き込み位置を示すヘッドポインタを検出するプロトコル処理部と、
受信可能なデータ量を算出する際に使用する第1のテイルポインタと、上位層によって処理されていないデータ量を算出する際に使用する第2のテイルポインタとを設定するシステム制御部と、
該システム制御部によって設定する前記第1のテイルポインタ、および前記第2のテイルポインタのいずれかを選択する選択部と、
前記プロトコル処理部によって算出したヘッドポインタと、前記選択部によって選択した前記第1のテイルポインタおよび前記第2のテイルポインタのいずれかとに基づいて、前記他の通信装置に公告する前記リングバッファ領域の空き容量を算出する空き容量算出部と、
前記空き容量算出部によって算出した前記リングバッファ領域の空き容量を前記他の通信装置に公告する送信部と
を有する、通信装置。 A communication device that operates according to a protocol for performing data communication in a byte stream,
A receiving unit for receiving data transmitted by another communication device;
A storage unit having a ring buffer area for storing data received by the receiving unit;
A protocol processing unit for detecting a head pointer indicating a write position of data to be received next when the data is stored in the ring buffer area based on the data received by the receiving unit;
A system control unit that sets a first tail pointer that is used when calculating the amount of receivable data and a second tail pointer that is used when calculating the amount of data not processed by an upper layer;
A selection unit for selecting one of the first tail pointer and the second tail pointer set by the system control unit;
Based on the head pointer calculated by the protocol processing unit and either the first tail pointer or the second tail pointer selected by the selection unit, the ring buffer area to be notified to the other communication device A free space calculation unit for calculating free space;
A communication device, comprising: a transmission unit that advertises the free space in the ring buffer area calculated by the free space calculation unit to the other communication device.
を有し、
前記システム制御部は、前記受信データ量算出部によって算出された受信データ量に基づいて、前記上位層に引き取られていない受信データがあることを通知する、請求項1ないし3のいずれか1項に記載の通信装置。 A received data amount calculating unit that calculates a received data amount based on the head pointer detected by the protocol processing unit and the second tail pointer set by the system control unit;
4. The system control unit according to claim 1, wherein the system control unit notifies that there is received data that has not been collected in the higher layer, based on the received data amount calculated by the received data amount calculating unit. 5. The communication apparatus as described in.
他の通信装置によって送信されたデータを受信させ、
該受信したデータに基づいて、受信したデータを格納するリングバッファ領域を有する記憶部に格納した場合に次に受信するデータの書き込み位置を示すヘッドポインタを検出させ、
受信可能なデータ量を算出する際に使用する第1のテイルポインタと、上位層によって処理されていないデータ量を算出する際に使用する第2のテイルポインタとを設定させ、
該設定させる前記第1のテイルポインタ、および前記第2のテイルポインタのいずれかを選択させ、
前記ヘッドポインタと、前記第1のテイルポインタおよび前記第2のテイルポインタのいずれかとに基づいて、前記他の通信装置に公告する前記リングバッファ領域の空き容量を算出させ、
該前記リングバッファ領域の空き容量を前記他の通信装置に公告させる、通信制御プログラム。 To a communication device that operates according to a protocol that performs data communication with a byte stream,
Receive data sent by other communication devices,
Based on the received data, when stored in a storage unit having a ring buffer area for storing received data, a head pointer indicating a write position of data to be received next is detected,
Setting a first tail pointer used when calculating the amount of receivable data and a second tail pointer used when calculating the amount of data not processed by the upper layer;
Selecting one of the first tail pointer and the second tail pointer to be set;
Based on the head pointer and one of the first tail pointer and the second tail pointer, the free capacity of the ring buffer area to be advertised to the other communication device is calculated,
A communication control program for causing the other communication device to advertise the free capacity of the ring buffer area.
他の通信装置によって送信されたデータを受信し、
該受信したデータに基づいて、該データをリングバッファ領域を有する記憶部に格納した場合に次に受信するデータの書き込み位置を示すヘッドポインタを検出し、
受信可能なデータ量を算出する際に使用する第1のテイルポインタと、上位層によって処理されていないデータ量を算出する際に使用する第2のテイルポインタとを設定し、
前記第1のテイルポインタ、および前記第2のテイルポインタのいずれかを選択し、
前記ヘッドポインタと、前記第1のテイルポインタおよび前記第2のテイルポインタのいずれかとに基づいて、前記他の通信装置に公告する前記リングバッファ領域の空き容量を算出し、
前記リングバッファ領域の空き容量を前記他の通信装置に公告する、通信制御方法。 A communication control method executed by a communication device operating according to a protocol for performing data communication in a byte stream,
Receive data sent by other communication devices,
Based on the received data, when the data is stored in a storage unit having a ring buffer area, a head pointer indicating a write position of data to be received next is detected,
Setting a first tail pointer used when calculating the amount of receivable data and a second tail pointer used when calculating the amount of data not processed by the upper layer;
Selecting one of the first tail pointer and the second tail pointer;
Based on the head pointer and either the first tail pointer or the second tail pointer, the free capacity of the ring buffer area to be advertised to the other communication device is calculated,
A communication control method for notifying the free space of the ring buffer area to the other communication device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015053684A JP6458574B2 (en) | 2015-03-17 | 2015-03-17 | COMMUNICATION DEVICE, COMMUNICATION CONTROL PROGRAM, AND COMMUNICATION CONTROL METHOD |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015053684A JP6458574B2 (en) | 2015-03-17 | 2015-03-17 | COMMUNICATION DEVICE, COMMUNICATION CONTROL PROGRAM, AND COMMUNICATION CONTROL METHOD |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016174292A true JP2016174292A (en) | 2016-09-29 |
JP6458574B2 JP6458574B2 (en) | 2019-01-30 |
Family
ID=57009300
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015053684A Expired - Fee Related JP6458574B2 (en) | 2015-03-17 | 2015-03-17 | COMMUNICATION DEVICE, COMMUNICATION CONTROL PROGRAM, AND COMMUNICATION CONTROL METHOD |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6458574B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114257645A (en) * | 2021-11-23 | 2022-03-29 | 北京谊安医疗系统股份有限公司 | Embedded modular communication system and communication method thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001094613A (en) * | 1999-09-21 | 2001-04-06 | Canon Inc | Communication controller, method and recording medium |
JP2005092764A (en) * | 2003-09-19 | 2005-04-07 | Ricoh Co Ltd | Image forming apparatus, interface board, interface chip, and information processor |
JP2007259374A (en) * | 2006-03-27 | 2007-10-04 | Matsushita Electric Ind Co Ltd | Network transmitter/receiver |
JP2014042110A (en) * | 2012-08-21 | 2014-03-06 | Fujitsu Semiconductor Ltd | Data transfer device, data transfer method, and semiconductor device |
-
2015
- 2015-03-17 JP JP2015053684A patent/JP6458574B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001094613A (en) * | 1999-09-21 | 2001-04-06 | Canon Inc | Communication controller, method and recording medium |
JP2005092764A (en) * | 2003-09-19 | 2005-04-07 | Ricoh Co Ltd | Image forming apparatus, interface board, interface chip, and information processor |
JP2007259374A (en) * | 2006-03-27 | 2007-10-04 | Matsushita Electric Ind Co Ltd | Network transmitter/receiver |
JP2014042110A (en) * | 2012-08-21 | 2014-03-06 | Fujitsu Semiconductor Ltd | Data transfer device, data transfer method, and semiconductor device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114257645A (en) * | 2021-11-23 | 2022-03-29 | 北京谊安医疗系统股份有限公司 | Embedded modular communication system and communication method thereof |
Also Published As
Publication number | Publication date |
---|---|
JP6458574B2 (en) | 2019-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3720019B1 (en) | Internet of things data transmission method, device and system | |
JP6387370B2 (en) | Electronic device and method of operating electronic device | |
CN109271327B (en) | Memory management method and device | |
JP6475256B2 (en) | Computer, control device and data processing method | |
US20150256988A1 (en) | Method, terminal, server, and system for audio signal transmission | |
JP6431260B2 (en) | Method and system for sending an email with a large file attached on a mobile device | |
US9665317B2 (en) | Image forming system for exchanging location and processing information of a job using short-range communication | |
US20100050006A1 (en) | Communication apparatus, power supply control method, display apparatus, communication method, and computer program product | |
JP4452690B2 (en) | Electronic device, control method thereof, host device and control method thereof | |
JP5255035B2 (en) | Failover system, storage processing apparatus, and failover control method | |
JP2010015475A (en) | Information processing terminal and client server system | |
EP3805938B1 (en) | Server node selection method and terminal device | |
JP6458574B2 (en) | COMMUNICATION DEVICE, COMMUNICATION CONTROL PROGRAM, AND COMMUNICATION CONTROL METHOD | |
JP6172296B2 (en) | COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM | |
JP2012156645A (en) | Information processor, communication apparatus, and control method therefor | |
JP2006109466A (en) | Message transmitting apparatus and method in mobile communication terminal | |
JP5632733B2 (en) | Display device, screen image transfer method, and program | |
US11882015B2 (en) | Estimation system, addition apparatus, estimation method, addition method, estimation program and addition program | |
CN103117955A (en) | Method, device and system of message transmission | |
US20150341678A1 (en) | Video supply apparatus, video obtaining apparatus, control methods thereof, and video supply system | |
CN112291285A (en) | File transmission method and device for cloud desktop and terminal peripheral equipment | |
JP4630798B2 (en) | COMMUNICATION CONTROL DEVICE, ITS CONTROL METHOD, AND COMMUNICATION CONTROL METHOD | |
JP2008109471A (en) | Lan system, transmitter, receiver, lan system control method, program and multiple frames | |
JP2020013324A (en) | Settlement system, settlement terminal, service provider terminal, user terminal, information processing method, and program | |
JP6575082B2 (en) | COMMUNICATION DEVICE, COMMUNICATION CONTROL PROGRAM, AND COMMUNICATION CONTROL METHOD |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180208 |
|
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: 20181127 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20181130 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20181210 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6458574 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |