JP5680978B2 - COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM - Google Patents

COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM Download PDF

Info

Publication number
JP5680978B2
JP5680978B2 JP2011005882A JP2011005882A JP5680978B2 JP 5680978 B2 JP5680978 B2 JP 5680978B2 JP 2011005882 A JP2011005882 A JP 2011005882A JP 2011005882 A JP2011005882 A JP 2011005882A JP 5680978 B2 JP5680978 B2 JP 5680978B2
Authority
JP
Japan
Prior art keywords
packet
time
unit
retransmission
transmission
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.)
Expired - Fee Related
Application number
JP2011005882A
Other languages
Japanese (ja)
Other versions
JP2012147377A (en
Inventor
幸男 片倉
幸男 片倉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Advanced Engineering Ltd
Original Assignee
Fujitsu Advanced Engineering Ltd
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 Fujitsu Advanced Engineering Ltd filed Critical Fujitsu Advanced Engineering Ltd
Priority to JP2011005882A priority Critical patent/JP5680978B2/en
Publication of JP2012147377A publication Critical patent/JP2012147377A/en
Application granted granted Critical
Publication of JP5680978B2 publication Critical patent/JP5680978B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、通信装置と、その通信装置により行われる通信方法にかかわる。   The present invention relates to a communication device and a communication method performed by the communication device.

通信技術の普及と発達により、インターネットを含むWide Area Network(WAN)経由でデータの送受信が行われることが増えてきている。例えば、ユーザ端末が対向装置にWAN経由でデータを送信し、対向装置が受信データに基づいて処理を行うシステムが増加してきている。このようなシステムでは、ユーザ装置から送信されたデータが対向装置で受信されないと処理が行われないため、データの送信に失敗すると、ユーザ装置は、対向装置に向けて送信データを再度送信しなおす。例えば、ユーザ端末は、送信したパケットについての確認応答メッセージを再送タイムアウト(Retransmission Time Out、RTO)が経過するまでに受信できない場合、送信したパケットを対向装置に向けて再度送信する。   With the spread and development of communication technology, data transmission / reception is increasing through a wide area network (WAN) including the Internet. For example, a system is increasing in which user terminals transmit data to opposing devices via WAN, and the opposing devices perform processing based on received data. In such a system, since processing is not performed unless the data transmitted from the user device is received by the opposite device, if the data transmission fails, the user device retransmits the transmission data to the opposite device again. . For example, when the user terminal cannot receive an acknowledgment message for a transmitted packet before the retransmission timeout (Retransmission Time Out, RTO) elapses, the user terminal transmits the transmitted packet to the opposite device again.

関連する技術として、サーバ装置へ送信する通信データを再送するまでの再送タイムアウトを算出する際に、サーバ装置と通信装置の間をデータが往復する往復時間の測定結果を用いる通信装置が提案されている。この通信装置は、再送タイムアウトの算出結果よりも大きな値となった往復時間の測定結果を、次回の再送タイムアウトの算出の際に用いない。   As a related technique, there has been proposed a communication device that uses a measurement result of a round-trip time in which data reciprocates between the server device and the communication device when calculating a retransmission timeout until the communication data to be transmitted to the server device is retransmitted. Yes. This communication apparatus does not use the round trip time measurement result, which is larger than the retransmission timeout calculation result, for the next retransmission timeout calculation.

特開2008−172480号公報JP 2008-172480 A

ユーザ端末によっては、再送タイムアウトが固定値に設定されている場合がある。しかし、ユーザ装置から対向装置までの間のパケットの往復時間は、ネットワークの輻輳状態によって変化する。例えば、ネットワークを介して送受信されるパケットの数が少ない場合、往復時間は短くなる。従って、再送タイムアウトが固定値に設定されている場合、パケットが送信されてからそのパケットが再送されるまでの時間が長くなりすぎる場合がある。なお、背景技術では、ユーザ装置から送信されたデータが対向装置で処理される場合について述べたが、任意の複数の通信装置がWANを介してパケットを送受信する場合にも、同様の問題が生じる可能性がある。   Depending on the user terminal, the retransmission timeout may be set to a fixed value. However, the round-trip time of the packet between the user device and the opposite device varies depending on the congestion state of the network. For example, when the number of packets transmitted and received through the network is small, the round trip time is shortened. Therefore, when the retransmission timeout is set to a fixed value, the time from when a packet is transmitted until the packet is retransmitted may be too long. In the background art, the case where the data transmitted from the user apparatus is processed by the opposite apparatus has been described, but the same problem occurs when any of a plurality of communication apparatuses transmit and receive packets via the WAN. there is a possibility.

本発明は、再送タイムアウトが固定値に設定されている装置から送信されたパケットについて、再送が行われるまでの時間をパケットの往復時間に応じて変更することを目的とする。   An object of the present invention is to change the time until retransmission is performed according to the round trip time of a packet for a packet transmitted from a device whose retransmission timeout is set to a fixed value.

実施形態に係る通信装置は、受信部、記憶部、送信部、測定部、および、再送部を備える。受信部は、対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信する。記憶部は、前記第1および第2のパケットを記憶する。送信部は、前記第1および第2のパケットを前記対向装置に送信する。測定部は、前記送信部が前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを前記受信部が受信した時刻までの時間である応答時間を測定する。前記送信部が前記第2のパケットを前記対向装置に送信した時刻から前記応答時間より長い時間が経過しても、前記受信部が前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から再送パケットも受信しない場合、再送部が動作する。ここで、再送パケットは、前記送信元装置から前記第2のパケットを再送したパケットである。再送部は、前記記憶部から前記第2のパケットを取得すると共に、前記送信部に、前記第2のパケットを前記対向装置に再度送信させる。   The communication apparatus according to the embodiment includes a reception unit, a storage unit, a transmission unit, a measurement unit, and a retransmission unit. The receiving unit transmits the first and second packets addressed to the opposite device, and sends the first and second packets from the transmission source device that retransmits the packet that cannot be confirmed by the opposite device to the opposite device. Receive. The storage unit stores the first and second packets. The transmission unit transmits the first and second packets to the opposite device. The measurement unit receives the first response message for notifying the reception of the first packet at the opposite device from the time when the transmission unit transmits the first packet to the opposite device. Measure response time, which is the time to time. Even if a time longer than the response time elapses from the time when the transmission unit transmits the second packet to the opposite device, the reception unit notifies the reception of the second packet by the opposite device. If no response message 2 is received and no retransmission packet is received from the transmission source device, the retransmission unit operates. Here, the retransmission packet is a packet obtained by retransmitting the second packet from the transmission source device. The retransmission unit acquires the second packet from the storage unit and causes the transmission unit to transmit the second packet to the opposite device again.

再送タイムアウトが固定値に設定されている装置から送信されたパケットについても、再送が行われるまでの時間がパケットの往復時間に応じて変更される。   Also for a packet transmitted from a device whose retransmission timeout is set to a fixed value, the time until retransmission is changed according to the round trip time of the packet.

ある実施形態にかかる通信装置の動作の例を説明する図である。It is a figure explaining the example of operation | movement of the communication apparatus concerning a certain embodiment. 通信装置の構成の例を示す図である。It is a figure which shows the example of a structure of a communication apparatus. 直結機器テーブルの例を示す図である。It is a figure which shows the example of a directly connected apparatus table. 直結機器の検出方法の例を説明する図である。It is a figure explaining the example of the detection method of a directly connected apparatus. IPヘッダとTCPヘッダの構成例を示す図である。It is a figure which shows the structural example of an IP header and a TCP header. 検出されたコネクションの記録方法の例を示す図である。It is a figure which shows the example of the recording method of the detected connection. 通信パケットテーブルの例を示す図である。It is a figure which shows the example of a communication packet table. コネクションテーブルと通信パケットテーブルの例を示す図である。It is a figure which shows the example of a connection table and a communication packet table. 通信パケットテーブルの例を示す図である。It is a figure which shows the example of a communication packet table. コネクションテーブルと通信パケットテーブルの例を示す図である。It is a figure which shows the example of a connection table and a communication packet table. 通信装置がパケットを受信したときに行う動作の例を説明するフローチャートである。It is a flowchart explaining the example of the operation | movement performed when a communication apparatus receives a packet. 通信装置がパケットを受信したときに行う動作の例を説明するフローチャートである。It is a flowchart explaining the example of the operation | movement performed when a communication apparatus receives a packet. 通信装置に格納されているパケットが対向装置に再送される場合の動作の例を説明するフローチャートである。It is a flowchart explaining the example of operation | movement when the packet stored in the communication apparatus is resent to an opposing apparatus. 対向装置に送信されたパケットが送信されてから再送されるまでの時間の例を示すテーブルである。It is a table which shows the example of the time after the packet transmitted to the opposite apparatus is transmitted until it is resent. 通信装置がパケットを受信したときに行う動作の例を説明するフローチャートである。It is a flowchart explaining the example of the operation | movement performed when a communication apparatus receives a packet. 通信装置がパケットを受信したときに行う動作の例を説明するフローチャートである。It is a flowchart explaining the example of the operation | movement performed when a communication apparatus receives a packet.

図1は、ある実施形態にかかる通信装置10の動作の例を説明する図である。通信装置10は、送信元装置2が対向装置6にむけて送信したパケットを中継する。送信元装置2が対向装置6にむけて送信したパケットについて、そのパケットが対向装置6で受信されたことが一定の時間に通知されず、さらに、送信元装置2からパケットが再送されないとき、通信装置10は、パケットを対向装置6に再送する。図1を参照しながら、送信元装置2から対向装置6にWAN4を介してパケットが送信される場合の通信装置10の動作について説明する。   FIG. 1 is a diagram illustrating an example of the operation of the communication device 10 according to an embodiment. The communication device 10 relays the packet transmitted from the transmission source device 2 toward the opposite device 6. When a packet transmitted from the transmission source device 2 to the opposite device 6 is not notified at a certain time that the packet has been received by the opposite device 6, and when the packet is not retransmitted from the transmission source device 2, communication is performed. The device 10 retransmits the packet to the opposite device 6. The operation of the communication apparatus 10 when a packet is transmitted from the transmission source apparatus 2 to the opposite apparatus 6 via the WAN 4 will be described with reference to FIG.

なお、以下の説明では、あるパケットが通信装置10から対向装置6に送信された時刻から、そのパケットの受信を通知する応答メッセージが通信装置10で受信される時刻までの時間を「応答時間」(Round Trip Time、RTT)と記載するものとする。さらに、送信元装置2から送信されたパケットが対向装置6に送信された後、通信装置10が同じパケットを対向装置6に再送するまで待機する時間を「待機時間」と記載することもある。   In the following description, the time from the time when a certain packet is transmitted from the communication device 10 to the opposite device 6 until the time when the response message notifying the reception of the packet is received by the communication device 10 is referred to as “response time”. (Round Trip Time, RTT). Furthermore, after the packet transmitted from the transmission source device 2 is transmitted to the opposite device 6, the time that the communication device 10 waits until the same packet is retransmitted to the opposite device 6 may be described as “waiting time”.

(1)まず、送信元装置2は、対向装置6に向けて第1のパケットを送信する。通信装置10は、第1のパケットを受信すると、受信したパケットを複製し、複製した第1のパケットを、送信元装置2を識別する情報と通信装置10を識別する情報との組み合わせに関連付けて記憶する。   (1) First, the transmission source device 2 transmits a first packet toward the opposite device 6. When the communication device 10 receives the first packet, the communication device 10 duplicates the received packet and associates the duplicated first packet with a combination of information identifying the transmission source device 2 and information identifying the communication device 10. Remember.

(2)通信装置10は、第1のパケットをそのパケットの宛先である対向装置6に向けて送信する。さらに、通信装置10は、第1のパケットを送信した時刻を記憶する。
(3)対向装置6は、第1のパケットを受信すると、第1のパケットを受信したことを通知する第1の応答メッセージを送信元装置2に向けて送信する。第1の応答メッセージが通信装置10に到達すると、通信装置10は、第1の応答メッセージを参照して、第1のパケットが対向装置6で受信されたことを認識する。次に、通信装置10は、第1のパケットを通信装置10から送信した時刻と、第1の応答メッセージの受信時刻の間の時間(応答時間)を求める。図1のAは応答時間を示す。
(2) The communication device 10 transmits the first packet to the opposite device 6 that is the destination of the packet. Further, the communication device 10 stores the time when the first packet is transmitted.
(3) Upon receiving the first packet, the opposite apparatus 6 transmits a first response message notifying that the first packet has been received, to the transmission source apparatus 2. When the first response message reaches the communication device 10, the communication device 10 refers to the first response message and recognizes that the first packet has been received by the opposite device 6. Next, the communication device 10 obtains a time (response time) between the time when the first packet is transmitted from the communication device 10 and the reception time of the first response message. 1A shows the response time.

(4)通信装置10は、第1の応答メッセージを送信元装置2に送信する。
(5)次に、送信元装置2から送信された第2のパケットについて、通信装置10は、手順(1)と同様に第2のパケットを複製して記憶する。また、第2のパケットを対向装置6に送信した時刻も記憶する。
(4) The communication device 10 transmits the first response message to the transmission source device 2.
(5) Next, for the second packet transmitted from the transmission source device 2, the communication device 10 duplicates and stores the second packet in the same manner as in the procedure (1). Further, the time when the second packet is transmitted to the opposite apparatus 6 is also stored.

(6)さらに、通信装置10は、第2のパケットを対向装置6に転送する。ここで、第2のパケットについて、WAN4でパケットロストが発生したとする。この場合、対向装置6は、第2のパケットを受信しないため、対向装置6は、第2のパケットの受信を通知する第2の応答メッセージを送信しない。   (6) Furthermore, the communication device 10 transfers the second packet to the opposite device 6. Here, it is assumed that packet loss occurs in WAN 4 for the second packet. In this case, since the opposite apparatus 6 does not receive the second packet, the opposite apparatus 6 does not transmit the second response message notifying the reception of the second packet.

(7)通信装置10は、手順(3)で求めた応答時間を用いて待機時間を計算する。ここで、待機時間は、図1のBに示すように、応答時間よりも長い時間である。待機時間の計算方法については後述する。通信装置10は、第2のパケットを対向装置6に送信した時刻から待機時間が経過するまで待機する。待機時間が経過しても、通信装置10が第2の応答メッセージを受信せず、さらに、送信元装置2から対向装置6に向けて再送された第2のパケットも受信しない場合、通信装置10は、記憶している第2のパケットを、対向装置6に送信する。   (7) The communication device 10 calculates the standby time using the response time obtained in the procedure (3). Here, as shown in FIG. 1B, the standby time is longer than the response time. A method for calculating the standby time will be described later. The communication device 10 waits until the standby time elapses from the time when the second packet is transmitted to the opposite device 6. If the communication device 10 does not receive the second response message and the second packet retransmitted from the transmission source device 2 toward the opposite device 6 is not received even after the standby time has elapsed, the communication device 10 Transmits the stored second packet to the opposite apparatus 6.

(8)手順(7)で再送された第2のパケットを対向装置6が受信すると、対向装置6は、第2の応答メッセージを送信元装置2に送信する。通信装置10は、第2の応答メッセージを確認することにより、第2のパケットが対向装置6によって受信されたことを認識する。   (8) When the opposite device 6 receives the second packet retransmitted in the procedure (7), the opposite device 6 transmits a second response message to the transmission source device 2. The communication device 10 recognizes that the second packet has been received by the opposite device 6 by confirming the second response message.

(9)通信装置10は、第2の応答メッセージを送信元装置2に送信する。
このように、パケットの送信時刻から待機時間が経過するまでの間に対向装置6でのパケットの受信が確認できず、さらに、送信元装置2からパケットの再送も行われていない場合に、通信装置10は、対向装置6にパケットを再送する。ここで、待機時間は、応答時間を基にして計算されているので、応答時間の変動に応じて待機時間の長さも変動する。従って、通信装置10は、送信元装置2から送信されたパケットの再送のタイミングを応答時間に応じて変動させることができる。例えば、送信元装置2において、再送タイムアウトが固定値に設定されている場合でも、通信装置10は、応答時間に応じて計算されたタイミングでパケットの再送を行うことができる。すなわち、応答時間が短い場合は、通信装置10が動作することにより、パケットの送信時刻からそのパケットの再送時刻までの間隔が短くなる。このため、例えば、対向装置6で動作しているアプリケーションが送信元装置2から送信されたデータを処理している場合、パケットの送信に失敗しても、アプリケーションでの処理に間に合うようにパケットを再送できる確率が高くなる。
(9) The communication device 10 transmits the second response message to the transmission source device 2.
As described above, when the reception of the packet at the opposite device 6 cannot be confirmed before the standby time elapses from the transmission time of the packet, and the packet is not retransmitted from the transmission source device 2, the communication is performed. The device 10 retransmits the packet to the opposite device 6. Here, since the waiting time is calculated based on the response time, the length of the waiting time varies according to the variation of the response time. Therefore, the communication device 10 can change the retransmission timing of the packet transmitted from the transmission source device 2 according to the response time. For example, in the transmission source device 2, even when the retransmission timeout is set to a fixed value, the communication device 10 can retransmit the packet at a timing calculated according to the response time. That is, when the response time is short, the communication device 10 operates to shorten the interval from the packet transmission time to the packet retransmission time. For this reason, for example, when an application operating on the opposite device 6 processes data transmitted from the transmission source device 2, even if packet transmission fails, the packet is sent in time for processing in the application. Probability of resending increases.

<装置構成>
図2は、通信装置10の構成の例を示す図である。通信装置10は、受信部11、送信部12、ルーチング部13、タイマ14、記憶部20、および、再送代替部30を備える。記憶部20は、直結機器テーブル21、コネクションテーブル22、通信パケットテーブル23、および、ルーティングテーブル24を備える。再送代替部30は、直結機器検出部31、コネクション検出部32、通信パケット確認部33、測定部34、算出部35、判定部36、および、再送部37を備える。
<Device configuration>
FIG. 2 is a diagram illustrating an example of the configuration of the communication device 10. The communication device 10 includes a reception unit 11, a transmission unit 12, a routing unit 13, a timer 14, a storage unit 20, and a retransmission substitution unit 30. The storage unit 20 includes a directly connected device table 21, a connection table 22, a communication packet table 23, and a routing table 24. The retransmission substitution unit 30 includes a directly connected device detection unit 31, a connection detection unit 32, a communication packet confirmation unit 33, a measurement unit 34, a calculation unit 35, a determination unit 36, and a retransmission unit 37.

受信部11は、送信元装置2からパケットを受信する。さらに、受信部11は、受信したパケットを直結機器検出部31、送信部12などに出力することができる。また、受信部11は、対向装置6から、パケットの受信を通知する応答メッセージを受信する。受信部11は、受信した応答メッセージを、直結機器検出部31、送信部12などに出力する。送信部12は、送信元装置2から受信したパケットを対向装置6に向けて送信する。また、送信部12は、パケットを対向装置6に送信した時刻から待機時間が経過したときに、通信パケットテーブル23を参照して、パケットを対向装置6に再送する。なお、後述するように、通信パケットテーブル23には、送信元装置2から対向装置6に送信されたが対向装置6での受信が確認されていないパケットと、そのパケットについての情報が記録されている。さらに、送信部12は、対向装置6から受信した応答メッセージを送信元装置2に送信する。ルーチング部13は、通信装置10が受信したパケットの転送先をルーティングテーブル24に基づいて決定し、送信部12に通知する。タイマ14は、直結機器検出部31、コネクション検出部32、通信パケット確認部33、測定部34、再送部37などに時刻情報を提供する。   The receiving unit 11 receives a packet from the transmission source device 2. Further, the reception unit 11 can output the received packet to the directly connected device detection unit 31, the transmission unit 12, and the like. In addition, the receiving unit 11 receives a response message for notifying reception of a packet from the opposite device 6. The reception unit 11 outputs the received response message to the directly connected device detection unit 31, the transmission unit 12, and the like. The transmission unit 12 transmits the packet received from the transmission source device 2 toward the opposite device 6. The transmission unit 12 refers to the communication packet table 23 and retransmits the packet to the opposite device 6 when the standby time has elapsed from the time when the packet was transmitted to the opposite device 6. As will be described later, in the communication packet table 23, a packet transmitted from the transmission source device 2 to the opposite device 6 but not confirmed to be received by the opposite device 6 and information about the packet are recorded. Yes. Further, the transmission unit 12 transmits the response message received from the opposite device 6 to the transmission source device 2. The routing unit 13 determines the transfer destination of the packet received by the communication device 10 based on the routing table 24 and notifies the transmission unit 12 of the transfer destination. The timer 14 provides time information to the directly connected device detection unit 31, the connection detection unit 32, the communication packet confirmation unit 33, the measurement unit 34, the retransmission unit 37, and the like.

直結機器検出部31は、通信装置10と同じネットワークに所属する機器を検出し、検出した機器に関する情報を直結機器テーブル21に記録する。以下の説明では、通信装置10と同じネットワークに所属する通信装置を「直結機器」と記載することがある。直結機器は、送信元装置2となる可能性がある。例えば、通信装置Aが直結機器であり、さらに、通信装置Aが通信装置Bに向けてパケットを送信するとする。通信装置Aから通信装置Bに送信されたパケットが、通信装置10を経由して通信装置Bに送信される場合、通信装置Aは、図1に示す送信元装置2となる。直結機器テーブル21の例を図3に示す。図3の例では、直結機器テーブル21は、直結機器のMedia Access Control(MAC)アドレス、Internet Protocol(IP)アドレス、および、通信装置10との最新の通信時刻を格納する。なお、図3は、直結機器テーブル21の例であり、直結機器テーブル21に含まれる情報は、実装に応じて、適宜、変更される場合がある。   The directly connected device detection unit 31 detects devices belonging to the same network as the communication device 10 and records information on the detected devices in the directly connected device table 21. In the following description, a communication device belonging to the same network as the communication device 10 may be referred to as “directly connected device”. The directly connected device may be the transmission source device 2. For example, it is assumed that the communication device A is a directly connected device and that the communication device A transmits a packet toward the communication device B. When a packet transmitted from the communication apparatus A to the communication apparatus B is transmitted to the communication apparatus B via the communication apparatus 10, the communication apparatus A becomes the transmission source apparatus 2 illustrated in FIG. An example of the directly connected device table 21 is shown in FIG. In the example of FIG. 3, the directly connected device table 21 stores a Media Access Control (MAC) address, an Internet Protocol (IP) address, and the latest communication time with the communication device 10 of the directly connected device. Note that FIG. 3 is an example of the directly connected device table 21, and the information included in the directly connected device table 21 may be appropriately changed according to the implementation.

コネクション検出部32は、送信元装置2と対向装置6の間でTransmission Control Protocol(TCP)を用いた通信が行われる場合、送受信されるパケット中のTCPヘッダを参照する。コネクション検出部32は、TCPヘッダに含まれている情報に基づいて、コネクションの生成と消滅を監視し、通信が行われているコネクションに関する情報を、コネクションテーブル22に格納する。コネクションの監視の方法と、コネクションテーブル22の例については、後述する。   When communication using Transmission Control Protocol (TCP) is performed between the transmission source device 2 and the opposite device 6, the connection detection unit 32 refers to the TCP header in the transmitted / received packet. The connection detection unit 32 monitors the generation and disappearance of the connection based on the information included in the TCP header, and stores information related to the connection in which communication is performed in the connection table 22. A connection monitoring method and an example of the connection table 22 will be described later.

通信パケット確認部33は、送信元装置2から受信したパケットに基づいて、コネクションテーブル22や通信パケットテーブル23を更新する。通信パケットテーブル23には、パケットの送信時間などの情報が記録される。   The communication packet confirmation unit 33 updates the connection table 22 and the communication packet table 23 based on the packet received from the transmission source device 2. Information such as packet transmission time is recorded in the communication packet table 23.

測定部34は、通信パケットテーブル23に記録されているパケットについての応答メッセージが受信部11で受信された時刻と、パケットの送信時刻の差から、応答時間を求める。さらに、測定部34は、通信パケットテーブル23に記録されている情報のうち、対向装置6から応答メッセージを受信したパケットに関する情報を削除する。このため、通信パケットテーブル23は、通信装置10から対向装置6に送信されたパケットのうち、対向装置6からの応答メッセージが通信装置10で受信されていないパケットに関する情報が格納されている。   The measurement unit 34 obtains a response time from the difference between the time when the response message for the packet recorded in the communication packet table 23 is received by the reception unit 11 and the transmission time of the packet. Further, the measurement unit 34 deletes information related to the packet that has received the response message from the opposite device 6 among the information recorded in the communication packet table 23. For this reason, the communication packet table 23 stores information on packets for which the response message from the opposite device 6 is not received by the communication device 10 among the packets transmitted from the communication device 10 to the opposite device 6.

算出部35は、あるパケットが送信部12から対向装置6に向けて送信された時刻から、再送部37がパケットの再送を送信部12に指示する時刻までの待機時間を、応答時間に基づいて計算する。待機時間の計算方法については、後述する。   Based on the response time, the calculation unit 35 determines the waiting time from the time when a packet is transmitted from the transmission unit 12 to the opposite device 6 until the time when the retransmission unit 37 instructs the transmission unit 12 to retransmit the packet. calculate. A method for calculating the standby time will be described later.

判定部36は、通信装置10が送信元装置2の代わりに対向装置6に対する再送を行うかを判定する。例えば、判定部36は、送信元装置2がパケットを送信してから同じパケットを再送するまでの時間が、待機時間より長いかを判定する。パケットの送信に待機時間より長い時間がかかると判定された送信元装置2については、パケットの再送を通信装置10が行う。また、以下の記載では、通信装置10が送信元装置2の代わりに対向装置6に対する再送を行う場合、その送信元装置2を「対象装置」と記載することがある。   The determination unit 36 determines whether the communication device 10 performs retransmission for the opposite device 6 instead of the transmission source device 2. For example, the determination unit 36 determines whether the time from when the transmission source device 2 transmits a packet until the same packet is retransmitted is longer than the standby time. For the transmission source device 2 that is determined to take longer than the standby time for packet transmission, the communication device 10 retransmits the packet. Further, in the following description, when the communication device 10 performs retransmission to the opposite device 6 instead of the transmission source device 2, the transmission source device 2 may be described as a “target device”.

再送部37は、通信パケットテーブル23を参照して、対象装置から送信されたパケットのうち、パケットの送信時刻から待機時間が経過するまでに対向装置6からの応答メッセージが受信されていないパケットを特定する。また、再送部37は、通信パケットテーブル23に含まれているデータに基づいて、送信部12にパケットの再送を指示する。   The retransmission unit 37 refers to the communication packet table 23, and among the packets transmitted from the target device, packets for which no response message has been received from the opposite device 6 until the standby time elapses from the packet transmission time. Identify. The retransmission unit 37 instructs the transmission unit 12 to retransmit the packet based on the data included in the communication packet table 23.

次に、通信装置10のハードウェア構成の例について述べる。通信装置10は、例えば、Central Processing Unit(CPU)などのプロセッサ、メモリ、ネットワーク接続装置を備えることができる。この場合、ネットワーク接続装置は、通信装置10をネットワークに接続し、例えば、受信部11、送信部12として動作する。CPUは、再送代替部30、ルーチング部13、タイマ14などとして動作することができる。メモリは、記憶部20として動作する。例えば、通信装置10は、プロセッサ、メモリ、ネットワーク接続装置を備えたコンピュータであっても良い。なお、ここで述べた構成は一例であり、実装に応じて通信装置10の構成は変更される場合がある。   Next, an example of the hardware configuration of the communication device 10 will be described. The communication device 10 can include, for example, a processor such as a Central Processing Unit (CPU), a memory, and a network connection device. In this case, the network connection device connects the communication device 10 to the network and operates as, for example, the reception unit 11 and the transmission unit 12. The CPU can operate as the retransmission alternative unit 30, the routing unit 13, the timer 14, and the like. The memory operates as the storage unit 20. For example, the communication device 10 may be a computer including a processor, a memory, and a network connection device. The configuration described here is an example, and the configuration of the communication device 10 may be changed depending on the implementation.

<第1の実施形態>
通信装置10は、直結機器の検出、応答時間の測定、コネクションの検出、直結機器から受信したパケットの保持、待機時間の算出、パケットの再送などを行う。以下、これらの動作の詳細について説明する。
<First Embodiment>
The communication device 10 performs detection of a directly connected device, measurement of a response time, detection of a connection, retention of a packet received from the directly connected device, calculation of a waiting time, retransmission of a packet, and the like. Details of these operations will be described below.

〔直結機器の検出〕
通信装置10が起動されると、通信装置10は、まず、送信元装置2となる可能性のある装置(直結機器)を検出する。直結機器検出部31は、直結機器の検出に、Address Resolution Protocol(ARP)要求パケットを用いる。
[Detection of directly connected devices]
When the communication device 10 is activated, the communication device 10 first detects a device (directly connected device) that may be the transmission source device 2. The directly connected device detection unit 31 uses an Address Resolution Protocol (ARP) request packet for detecting directly connected devices.

図4は、直結機器の検出方法の例を説明する図である。通信を開始しようとする装置は、通信先のIPアドレスを取得すると、そのIPアドレスを用いている装置のMACアドレスを取得するためにARP要求パケットを送信する。図4に、装置Aから送信されたARP要求パケットの例を示す。以下の例では、装置AのIPアドレスは「IP1」、MACアドレスは「MAC1」であるものとする。ARP要求パケットは、イーサネットヘッダとARPメッセージを含む。イーサネットヘッダには、送信先MACアドレス、送信元MACアドレス、および、Typeが記録される。ここでは、送信元MACアドレスは装置AのMACアドレス、TypeはARP要求を表す「0806」が記録される。さらに、ARP要求パケットの送信先MACアドレスはブロードキャストアドレス(MAC_B)である「ff:ff:ff:ff:ff:ff」が用いられる。このため、ARP要求パケットは、装置Aが所属するネットワークと同じネットワークに所属する全ての通信装置に送信される。   FIG. 4 is a diagram illustrating an example of a method for detecting a directly connected device. When a device that is to start communication acquires an IP address of a communication destination, the device transmits an ARP request packet to acquire the MAC address of the device that uses the IP address. FIG. 4 shows an example of the ARP request packet transmitted from the device A. In the following example, it is assumed that the IP address of device A is “IP1” and the MAC address is “MAC1”. The ARP request packet includes an Ethernet header and an ARP message. In the Ethernet header, a transmission destination MAC address, a transmission source MAC address, and Type are recorded. Here, the source MAC address is recorded as the MAC address of the device A, and the Type is recorded as “0806” indicating an ARP request. Further, “ff: ff: ff: ff: ff: ff”, which is a broadcast address (MAC_B), is used as the transmission destination MAC address of the ARP request packet. For this reason, the ARP request packet is transmitted to all communication devices belonging to the same network as the network to which the device A belongs.

ARP要求パケットのARPメッセージには、Opcode、送信元MACアドレス、送信元IPアドレス、対象MACアドレス、対象IPアドレスが含まれる。ここで、対象IPアドレスはMACアドレスを取得しようとする装置で用いられているIPアドレスである。例えば、対象IPアドレスは、装置Aが通信する対象の装置のIPアドレスである。また、対象MACアドレスは、取得しようとするMACアドレスである。ARP要求パケットが生成されるときには、装置Aは対象MACアドレスを取得していないので、MACアドレスの代わりに「0」が記録される。Opcodeは、ARPメッセージがARP要求であるかを示す情報であり、ARP要求の場合は「1」である。送信元MACアドレスと送信元IPアドレスのフィールドには、装置AのMACアドレスとIPアドレスが格納されている。   The ARP message of the ARP request packet includes Opcode, source MAC address, source IP address, target MAC address, and target IP address. Here, the target IP address is an IP address used in a device that attempts to acquire a MAC address. For example, the target IP address is an IP address of a target device with which the device A communicates. The target MAC address is the MAC address to be acquired. When the ARP request packet is generated, since device A has not acquired the target MAC address, “0” is recorded instead of the MAC address. Opcode is information indicating whether the ARP message is an ARP request, and is “1” in the case of an ARP request. The MAC address and IP address of device A are stored in the source MAC address and source IP address fields.

装置Aが図4に示すARP要求パケットをブロードキャストすると、装置Aと同じネットワークに所属する通信装置10は、ARP要求パケットを受信する。直結機器検出部31は、受信部11を介して受信されたパケットの種類を確認し、ARP要求パケットを取得する。さらに、直結機器検出部31は、取得したパケットのARPメッセージから送信元MACアドレスと送信元IPアドレスを抽出して、直結機器テーブル21(図3)に格納する。また、直結機器検出部31は、タイマ14を参照して、ARP要求パケットが受信された時刻を取得し、直結機器テーブル21に格納する。直結機器検出部31は、通信装置10がARP要求パケットを受信するたびに、ARP要求に含まれている送信元IPアドレス、送信元MACアドレス、およびARP要求パケットの受信時刻を取得し、直結機器テーブル21に格納する。   When the device A broadcasts the ARP request packet shown in FIG. 4, the communication device 10 belonging to the same network as the device A receives the ARP request packet. The directly connected device detection unit 31 confirms the type of the packet received via the reception unit 11 and acquires an ARP request packet. Further, the directly connected device detection unit 31 extracts the source MAC address and the source IP address from the acquired ARP message of the packet, and stores them in the directly connected device table 21 (FIG. 3). In addition, the directly connected device detection unit 31 refers to the timer 14, acquires the time when the ARP request packet is received, and stores it in the directly connected device table 21. Each time the communication device 10 receives an ARP request packet, the directly connected device detection unit 31 acquires the transmission source IP address, the transmission source MAC address, and the reception time of the ARP request packet included in the ARP request. Store in table 21.

すでに直結機器テーブル21に登録されている装置から再度ARP要求パケットを受信した場合、直結機器検出部31は、ARP要求パケットを送信した装置に関する記録の最終通信時刻を変更する。例えば、図3の直結機器テーブル21の1番上の欄には、すでに、装置Aとの通信について記録されている。そこで、直結機器検出部31は、装置AからARP要求パケットを受信すると、装置Aとの最終通信時刻をARP要求パケットの受信時刻に変更する。また、直結機器検出部31は、コネクションの生成要求や、既に確立されたコネクションを介して送信されたパケットなどを受信するたびに、それらのパケットの送信元アドレスに対応付けられた最終通信時刻を更新する。   When the ARP request packet is received again from the device already registered in the directly connected device table 21, the directly connected device detecting unit 31 changes the last communication time of the record relating to the device that has transmitted the ARP request packet. For example, communication with the device A has already been recorded in the top column of the directly connected device table 21 in FIG. Therefore, when the directly connected device detection unit 31 receives the ARP request packet from the device A, it changes the last communication time with the device A to the reception time of the ARP request packet. In addition, each time the directly connected device detection unit 31 receives a connection generation request or a packet transmitted via an already established connection, the directly connected device detection unit 31 sets the final communication time associated with the source address of those packets. Update.

〔コネクションの検出〕
次に、直結機器テーブル21に記録されている装置が対向装置6との間でコネクションを生成するときに、通信装置10で行われる動作の例を説明する。以下の説明では、送信元装置2のIPアドレスはIP1であり、対向装置6のIPアドレスはIP10であるものとする。なお、以下の説明では、図1に示すように、送信元装置2と対向装置6はWAN4を介して通信するものとする。
[Detection of connection]
Next, an example of an operation performed in the communication device 10 when the device recorded in the directly connected device table 21 generates a connection with the opposite device 6 will be described. In the following description, it is assumed that the IP address of the transmission source device 2 is IP1 and the IP address of the opposite device 6 is IP10. In the following description, it is assumed that the transmission source device 2 and the opposite device 6 communicate via the WAN 4 as shown in FIG.

パケットを受信すると、受信部11は受信パケットを直結機器検出部31に出力する。直結機器検出部31は、ARP要求パケット以外のパケットについて、IPヘッダを確認することにより、直結装置から送信されたパケットであるかを判定する。   When receiving the packet, the receiving unit 11 outputs the received packet to the directly connected device detecting unit 31. The directly connected device detection unit 31 determines whether the packet is a packet transmitted from the directly connected device by checking the IP header for packets other than the ARP request packet.

図5(a)に、IPヘッダの構成例を示す。図5(a)は、IPv4で用いられるIPヘッダを示す。IPv4ヘッダには、パケットの送信元IPアドレスと宛先IPアドレスが含まれている。さらに、IPv4ヘッダには、ヘッダ長フィールドとデータ長フィールドが含まれる。ヘッダ長フィールドは、IPヘッダの長さを示す。データ長フィールドは、IPヘッダとセグメントデータを合わせた長さを示す。さらに、IPv4ヘッダには、バージョン情報、サービスタイプ、識別番号、フラグ、フラグメントオフセット、Time To Live(TTL)、プロトコル、ヘッダチェックサム、オプション、パディングなどのフィールドが含まれる。ここではIPv4ヘッダについて述べたが、IPv6ヘッダにも送信元IPアドレスと宛先IPアドレスが含まれている。また、IPv6ヘッダには、ペイロード長フィールドが含まれている。ペイロード長フィールドには、IPv6パケットの全体の長さからIPv6ヘッダの長さを差し引いたペイロードの長さが記録される。   FIG. 5A shows a configuration example of the IP header. FIG. 5A shows an IP header used in IPv4. The IPv4 header includes a packet source IP address and a destination IP address. Further, the IPv4 header includes a header length field and a data length field. The header length field indicates the length of the IP header. The data length field indicates the combined length of the IP header and segment data. Further, the IPv4 header includes fields such as version information, service type, identification number, flag, fragment offset, Time To Live (TTL), protocol, header checksum, option, and padding. Although the IPv4 header has been described here, the IPv6 header also includes a source IP address and a destination IP address. The IPv6 header includes a payload length field. In the payload length field, the length of the payload obtained by subtracting the length of the IPv6 header from the entire length of the IPv6 packet is recorded.

直結機器検出部31は、受信したパケットのIPヘッダに含まれている送信元IPアドレスを、直結機器テーブル21に含まれているIPアドレスと比較する。受信されたパケットの送信元IPアドレスが直結機器テーブル21に記録されている場合、直結機器検出部31は、そのパケットの送信元の装置は、直結装置であると判定し、コネクション検出部32にパケットを出力する。コネクション検出部32は、直結機器検出部31から入力されたパケットのTCPヘッダを参照することにより、コネクションに関する情報を取得する。コネクション検出部32は、取得した情報をコネクションテーブル22に格納する。   The directly connected device detection unit 31 compares the source IP address included in the IP header of the received packet with the IP address included in the directly connected device table 21. When the transmission source IP address of the received packet is recorded in the direct connection device table 21, the direct connection device detection unit 31 determines that the transmission source device of the packet is a direct connection device, and sends it to the connection detection unit 32. Output the packet. The connection detection unit 32 acquires information related to the connection by referring to the TCP header of the packet input from the directly connected device detection unit 31. The connection detection unit 32 stores the acquired information in the connection table 22.

図5(b)は、TCPヘッダの構成例を示す図である。TCPヘッダには、送信元ポート番号、宛先ポート番号、シーケンス番号、確認応答番号、制御ビットが含まれる。さらに、TCPヘッダには、オプション、データオフセット、予約ビット、ウィンドウサイズ、チェックサム、緊急ポインタ、パディングも含まれる。データオフセットフィールドには、TCPヘッダの長さが記録されている。制御ビットには、URG(urgent)、ACK(acknowledge)、PSH(push)、RST(reset)、SYN(synchronize)、FIN(finis)の6ビットが含まれる。通信装置10では、ACK、RST、SYN、FINの値を用いた制御が行われる。SYNビットは、コネクションの確立が要求されているかを示す。SYN=1のパケットは、宛先の装置に対してコネクションの確立を要求するために用いられる。以下の記載では、SYN=1のパケットを「送信許可要求パケット」と記載することがある。ACKビットは、パケットが応答メッセージであるかを示す。ACK=1のパケットは、あるパケットに対する応答メッセージとして用いられる。RSTとFINは、そのパケットの送信に用いられたコネクションの切断が要求されているかを示す。RSTかFINのいずれかが1であるパケットは、そのパケットの宛先の装置に対して、そのパケットの送信に用いられたコネクションの切断を要求する。   FIG. 5B is a diagram illustrating a configuration example of the TCP header. The TCP header includes a source port number, a destination port number, a sequence number, an acknowledgment number, and a control bit. Furthermore, the TCP header includes options, data offset, reserved bits, window size, checksum, urgent pointer, and padding. In the data offset field, the length of the TCP header is recorded. The control bits include 6 bits of URG (urgent), ACK (acknowledge), PSH (push), RST (reset), SYN (synchronize), and FIN (finis). In the communication device 10, control using values of ACK, RST, SYN, and FIN is performed. The SYN bit indicates whether connection establishment is requested. The packet with SYN = 1 is used for requesting the destination device to establish a connection. In the following description, a packet with SYN = 1 may be described as a “transmission permission request packet”. The ACK bit indicates whether the packet is a response message. A packet with ACK = 1 is used as a response message for a certain packet. RST and FIN indicate whether the connection used for transmitting the packet is requested to be disconnected. A packet in which either RST or FIN is 1 requests the destination device of the packet to disconnect the connection used to transmit the packet.

コネクション検出部32は、直結機器検出部31から入力された各々のパケットについて、TCPヘッダ中の制御ビットのうちのRST、SYN、FINのそれぞれの値を確認する。ここでは、SYN=1、RST=0、FIN=0のパケットを通信装置10が受信したものとする。SYNが1の場合、コネクション検出部32は、送信元装置2から対向装置6に向けたコネクションが確立されると判断して、確立されるコネクションに関する情報をコネクションテーブル22に記録する。   The connection detection unit 32 confirms the values of RST, SYN, and FIN among the control bits in the TCP header for each packet input from the directly connected device detection unit 31. Here, it is assumed that the communication apparatus 10 has received a packet with SYN = 1, RST = 0, and FIN = 0. When SYN is 1, the connection detection unit 32 determines that a connection from the transmission source device 2 to the opposite device 6 is established, and records information on the established connection in the connection table 22.

図6は、検出されたコネクションの記録方法の例を示す図である。コネクションテーブル22は、例えば、送信元装置2のIPアドレス、送信元ポート番号、対向装置6のIPアドレス、宛先ポート番号、次に送信されるセグメントのシーケンス番号(NextSeqNo)を記録する。さらに、応答時間から算出された再送タイムアウト(RTO計算値)、再送フラグ、最終通信時刻を格納する。以下の説明では、応答時間から算出された通信装置10での再送タイムアウトのことを、「RTO計算値」と記載することがある。ここで、再送フラグは、通信装置10がパケットの再送を行う送信元装置2を識別するために用いられる。再送フラグが「ON」の場合、そのコネクションを介して送信されたパケットについて、通信装置10は、判定部36による判定を行わずに再送を行う。なお、再送フラグが「ON」の場合と「OFF」の場合で、算出部35は、待機時間の算出方法を変更することができる。以下、図6を参照しながら、コネクション検出部32の動作について説明する。   FIG. 6 is a diagram illustrating an example of a method for recording the detected connection. The connection table 22 records, for example, the IP address of the transmission source device 2, the transmission source port number, the IP address of the opposite device 6, the destination port number, and the sequence number (NextSeqNo) of the segment to be transmitted next. Furthermore, the retransmission timeout (RTO calculation value) calculated from the response time, the retransmission flag, and the last communication time are stored. In the following description, the retransmission timeout in the communication apparatus 10 calculated from the response time may be described as “RTO calculation value”. Here, the retransmission flag is used for the communication apparatus 10 to identify the transmission source apparatus 2 that performs retransmission of the packet. When the retransmission flag is “ON”, the communication device 10 retransmits the packet transmitted through the connection without performing the determination by the determination unit 36. Note that the calculation unit 35 can change the calculation method of the standby time depending on whether the retransmission flag is “ON” or “OFF”. Hereinafter, the operation of the connection detection unit 32 will be described with reference to FIG.

コネクション検出部32は、送信許可要求パケットを受信すると、そのパケットのIPヘッダから送信元IPアドレスと宛先IPアドレスを取得して、コネクションテーブル22に記録する。コネクション検出部32は、TCPヘッダの送信元ポート番号を送信元装置2でのポート番号とし、TCPヘッダの宛先ポート番号を対向装置6でのポート番号として、コネクションテーブル22に記録する。コネクション検出部32は、パケットを受信した時刻もコネクションテーブル22に記録する。   When the connection detection unit 32 receives the transmission permission request packet, the connection detection unit 32 acquires the transmission source IP address and the destination IP address from the IP header of the packet and records them in the connection table 22. The connection detection unit 32 records the transmission header port number of the TCP header in the connection table 22 as the port number of the transmission source device 2 and the destination port number of the TCP header as the port number of the opposite device 6. The connection detection unit 32 also records the time when the packet is received in the connection table 22.

次に、コネクション検出部32は、次に送信されるセグメントのシーケンス番号を計算する。コネクション検出部32は、IPv4パケットのデータ長フィールドに記録されている値からヘッダ長フィールドに記録されている値を差し引いて、セグメントデータの長さを求める。次に、コネクション検出部32は、TCPヘッダのデータオフセットフィールドの値を取得し、セグメントデータの長さからTCPヘッダの長さを差し引くことにより、パケットに含まれているデータの長さを求める。すなわち、パケットに含まれているデータ長をD、IPv4パケットのデータ長フィールドの値をIPd、IPヘッダ長をIPh、TCPヘッダ長をTCPhとすると、コネクション検出部32は、以下の計算によりデータ長Dを求める。
D=IPd−IPh−TCPh
Next, the connection detection unit 32 calculates the sequence number of the segment to be transmitted next. The connection detection unit 32 obtains the length of the segment data by subtracting the value recorded in the header length field from the value recorded in the data length field of the IPv4 packet. Next, the connection detection unit 32 obtains the value of the data included in the packet by acquiring the value of the data offset field of the TCP header and subtracting the length of the TCP header from the length of the segment data. That is, assuming that the data length included in the packet is D, the value of the data length field of the IPv4 packet is IPd, the IP header length is IPh, and the TCP header length is TCPh, the connection detection unit 32 calculates the data length by the following calculation. D is obtained.
D = IPd-IPh-TCPh

さらに、コネクション検出部32は、通信装置10が受信したパケットに含まれているシーケンス番号(Seq)にデータ長を加えることにより、次に送信されるセグメントのシーケンス番号(NextSeq)を算出する。すなわち、次に送信されるセグメントのシーケンス番号は、次式により求められる。コネクション検出部32は、算出したNextSeqをコネクションテーブル22に記録する。
NextSeq=Seq+D
Further, the connection detection unit 32 calculates the sequence number (NextSeq) of the segment to be transmitted next by adding the data length to the sequence number (Seq) included in the packet received by the communication device 10. That is, the sequence number of the segment to be transmitted next is obtained by the following equation. The connection detection unit 32 records the calculated NextSeq in the connection table 22.
NextSeq = Seq + D

コネクション検出部32は、図6に示すように、NextSeqをコネクションテーブル22に記録する。なお、送信許可要求パケットのように、データが含まれていないパケットに基づいてNextSeqの値が計算された場合、次に同じコネクションを介して送信されるパケットに含まれているデータのシーケンス番号はNextSeqの値より大きいことがある。例えば、コネクションを確立するために送信元装置2から対向装置6に送信される送信許可要求パケットには、送信元装置2から対向装置6への送信データが含まれていないので、データ長は0バイトになる。コネクションの確立のために送信されたパケットのシーケンス番号が2000であると、コネクション検出部32は、NextSeqを2000とする。しかし、送信許可要求パケットの次に送信されるパケットに含まれるシーケンス番号は、2000よりも大きい場合がある。   As shown in FIG. 6, the connection detection unit 32 records NextSeq in the connection table 22. If the value of NextSeq is calculated based on a packet that does not contain data, such as a transmission permission request packet, the sequence number of the data contained in the next packet transmitted through the same connection is May be greater than NextSeq. For example, since a transmission permission request packet transmitted from the transmission source device 2 to the opposite device 6 to establish a connection does not include transmission data from the transmission source device 2 to the opposite device 6, the data length is 0. Become a byte. When the sequence number of the packet transmitted for establishing the connection is 2000, the connection detection unit 32 sets NextSeq to 2000. However, the sequence number included in the packet transmitted next to the transmission permission request packet may be larger than 2000.

さらに、コネクション検出部32は、時刻情報をタイマ14から取得してコネクションテーブル22に記録する。コネクションを確立する要求が送信元装置2から対向装置6に送信されたときには、まだ送信元装置2から対向装置6の間の応答時間が求められていないので、RTO計算値は記録されない。コネクション検出部32は、検出したコネクションについて、再送フラグを「OFF」に設定する。   Further, the connection detection unit 32 acquires time information from the timer 14 and records it in the connection table 22. When a request for establishing a connection is transmitted from the transmission source device 2 to the opposite device 6, since the response time between the transmission source device 2 and the opposite device 6 has not yet been obtained, the RTO calculation value is not recorded. The connection detection unit 32 sets the retransmission flag to “OFF” for the detected connection.

次に、送信許可要求パケットは、通信パケットテーブル23に格納される。図7に通信パケットテーブル23の例を示す。通信パケットテーブル23は、例えば、送信元装置2のIPアドレス、送信元ポート番号、対向装置6のIPアドレス、宛先ポート番号、そのパケットのシーケンス番号、データ長、再送回数、発信時刻を格納する。さらに、これらの情報に対応付けて、受信パケットが通信パケットテーブル23に格納される。   Next, the transmission permission request packet is stored in the communication packet table 23. FIG. 7 shows an example of the communication packet table 23. The communication packet table 23 stores, for example, the IP address of the transmission source device 2, the transmission source port number, the IP address of the opposite device 6, the destination port number, the sequence number of the packet, the data length, the number of retransmissions, and the transmission time. Further, the received packet is stored in the communication packet table 23 in association with these pieces of information.

コネクション検出部32は、送信許可要求パケットについて、送信元装置2のIPアドレス、送信元ポート番号、対向装置6のIPアドレス、宛先ポート番号、そのパケットのシーケンス番号、および、データ長を既に認識している。そこで、コネクション検出部32は、これらの情報を通信パケットテーブル23に格納し、通信パケット確認部33に送信許可要求パケットを出力する。通信パケット確認部33は、パケットを通信パケットテーブル23に登録するときは、再送回数を「0」に設定する。さらに、通信パケット確認部33は、タイマ14から時刻情報を取得し、そのパケットが送信部12から対向装置6に向けて出力される時刻も、通信パケットテーブル23に記録する。   The connection detection unit 32 has already recognized the IP address of the transmission source device 2, the transmission source port number, the IP address of the opposite device 6, the destination port number, the sequence number of the packet, and the data length of the transmission permission request packet. ing. Therefore, the connection detection unit 32 stores these pieces of information in the communication packet table 23 and outputs a transmission permission request packet to the communication packet confirmation unit 33. The communication packet confirmation unit 33 sets the number of retransmissions to “0” when registering the packet in the communication packet table 23. Further, the communication packet confirmation unit 33 acquires time information from the timer 14 and records the time when the packet is output from the transmission unit 12 toward the opposite device 6 in the communication packet table 23.

〔応答時間の測定とRTO計算値の算出〕
次に、対向装置6から送信元装置2に向けてコネクションの送信を許可する応答メッセージが送信され、通信装置10が応答メッセージを受信した場合について説明する。
[Measure response time and RTO calculation value]
Next, a case where a response message permitting transmission of a connection is transmitted from the opposite apparatus 6 to the transmission source apparatus 2 and the communication apparatus 10 receives the response message will be described.

受信部11は、対向装置6から受信したパケットを、直結機器検出部31に出力する。直結機器検出部31は、パケットのIPヘッダに含まれているIPアドレスを直結機器テーブル21に記録されているIPアドレスと比較する。宛先IPアドレスが直結機器テーブル21に記録されている場合、直結機器検出部31は、そのパケットを測定部34に出力する。従って、通信装置10を介して対向装置6に送信された送信許可要求パケットに対する応答パケットは、測定部34に出力される。   The reception unit 11 outputs the packet received from the opposite device 6 to the directly connected device detection unit 31. The directly connected device detection unit 31 compares the IP address included in the IP header of the packet with the IP address recorded in the directly connected device table 21. When the destination IP address is recorded in the direct connection device table 21, the direct connection device detection unit 31 outputs the packet to the measurement unit 34. Accordingly, a response packet to the transmission permission request packet transmitted to the opposite device 6 via the communication device 10 is output to the measurement unit 34.

測定部34は、直結機器検出部31から入力されたパケットのTCPヘッダ中のACKビットを参照して、応答メッセージを受信しているかを確認する。ACKビットの値が「1」である場合、測定部34は、応答メッセージを受信したと判断し、確認応答番号を参照する。確認応答番号には、対向装置6が送信元装置2から次に受信するデータを識別するシーケンス番号が記録されている。このため、測定部34は、確認応答番号よりもシーケンス番号が小さな値のデータを含むパケットが対向装置6で受信されたと認識する。ただし、コネクションが確立される段階では、そのコネクションに関連して通信パケットテーブル23に登録されているパケットは、送信元装置2から対向装置6に送信された送信許可要求パケットだけである。そこで、測定部34は、応答メッセージは送信許可要求パケットの受信を通知していると判断し、応答メッセージの受信時刻を取得する。次に、測定部34は、通信パケットテーブル23を参照することにより、応答メッセージの受信時刻から、送信許可要求パケットの発信時刻までの時間を差し引いた値を、応答時間とする。   The measurement unit 34 refers to the ACK bit in the TCP header of the packet input from the directly connected device detection unit 31 and confirms whether a response message is received. When the value of the ACK bit is “1”, the measurement unit 34 determines that the response message has been received, and refers to the confirmation response number. In the confirmation response number, a sequence number for identifying the next data received by the opposite device 6 from the transmission source device 2 is recorded. For this reason, the measurement unit 34 recognizes that the packet including data having a smaller sequence number than the acknowledgment number has been received by the opposite device 6. However, at the stage where the connection is established, the packet registered in the communication packet table 23 in relation to the connection is only the transmission permission request packet transmitted from the transmission source device 2 to the opposite device 6. Therefore, the measurement unit 34 determines that the response message notifies the reception of the transmission permission request packet, and acquires the reception time of the response message. Next, the measurement unit 34 refers to the communication packet table 23 and sets a value obtained by subtracting the time from the reception time of the response message to the transmission time of the transmission permission request packet as the response time.

例えば、図7に示すように、送信許可要求パケットが通信装置10から対向装置6に送信された時刻は、12時0分0秒であり、応答メッセージの受信時刻が12時0分0.04秒であるとする。すると、測定部34は、
(12時0分0.04秒)−(12時0分0秒)=0.04秒
を応答時間とする。測定部34は、求めた応答時間を算出部35に出力する。さらに、測定部34は、通信パケットテーブル23から送信許可要求パケットについての記録を削除する。
For example, as shown in FIG. 7, the time when the transmission permission request packet is transmitted from the communication apparatus 10 to the opposite apparatus 6 is 12:00:00, and the reception time of the response message is 12: 00.04. Let it be seconds. Then, the measurement unit 34
(12: 00: 0.04 seconds) − (12: 0: 0) = 0.04 seconds is the response time. The measurement unit 34 outputs the obtained response time to the calculation unit 35. Further, the measurement unit 34 deletes the record about the transmission permission request packet from the communication packet table 23.

算出部35は、応答時間を用いて、RTO計算値と待機時間を算出する。算出部35は、コネクションについて初めて求められた応答時間を用いて(1)式に基づく計算を行い、RTO計算値(RTOcal )を求める。
RTOcal =SRTT+max(G,K×RTTVAR) ・・・(1)
ここで、
K=4
SRTT=MRTT
RTTVAR=MRTT/2
であるものとする。MRTT(Measured RTT)は、測定部34が求めた応答時間である。RTTVARは、応答時間の2分の1である。また、Gは、通信装置10が応答時間の測定に使用するクロックの粒度(分解能)である。
The calculation unit 35 calculates the RTO calculation value and the standby time using the response time. The calculation unit 35 performs a calculation based on the equation (1) using the response time obtained for the first time for the connection, and obtains an RTO calculation value (RTO cal ).
RTO cal = SRTT + max (G, K × RTTVAR) (1)
here,
K = 4
SRTT = MRTT
RTTVAR = MRTT / 2
Suppose that MRTT (Measured RTT) is a response time obtained by the measurement unit 34. RTTVAR is one half of the response time. G is the granularity (resolution) of the clock used by the communication device 10 for measuring the response time.

例えば、応答時間が0.04秒、クロックの分解能が0.05秒であるとすると、RTO計算値は以下のように求められる。
RTTVAR=MRTT/2=0.04/2=0.02(秒)
SRTT=MRTT=0.04(秒)
RTOcal =0.04+max(0.05,4×0.02)=0.12(秒)
算出部35は、求めたRTO計算値をコネクションテーブル22に記録する。
For example, assuming that the response time is 0.04 seconds and the clock resolution is 0.05 seconds, the RTO calculation value is obtained as follows.
RTTVAR = MRTT / 2 = 0.04 / 2 = 0.02 (seconds)
SRTT = MRTT = 0.04 (seconds)
RTO cal = 0.04 + max (0.05, 4 × 0.02) = 0.12 (seconds)
The calculation unit 35 records the obtained RTO calculation value in the connection table 22.

〔記録済みのコネクションを介して受信したパケットの保持〕
次に、コネクションテーブル22に記録されているコネクションを介して送信元装置2から対向装置6に送信されるパケットを、通信装置10が受信した場合について、通信パケット確認部33などの動作の例を説明する。受信されたパケットがARP要求パケットではない場合、コネクション検出部32は、受信されたパケットのTCPヘッダを参照し、コネクションテーブル22に登録されているコネクションを介して送信されたパケットであるかを判定する。コネクションテーブル22に登録されているコネクションを介して送信元装置2から送信されたパケットを受信した場合、コネクション検出部32は、パケットを通信パケット確認部33に出力する。例えば、送信元装置2から対向装置6に送信されたパケットを受信すると、コネクション検出部32は、IPアドレスとポート番号を用いて、コネクションテーブル22に登録されているコネクションを介して送信されているかを確認する。登録されているコネクションを介して送信されたパケットであると、コネクション検出部32は、通信パケット確認部33にパケットを出力する。
[Retention of packets received through recorded connections]
Next, an example of the operation of the communication packet confirmation unit 33 and the like when the communication device 10 receives a packet transmitted from the transmission source device 2 to the opposite device 6 via the connection recorded in the connection table 22. explain. If the received packet is not an ARP request packet, the connection detection unit 32 refers to the TCP header of the received packet and determines whether the packet is transmitted via a connection registered in the connection table 22. To do. When receiving a packet transmitted from the transmission source device 2 via a connection registered in the connection table 22, the connection detection unit 32 outputs the packet to the communication packet confirmation unit 33. For example, when a packet transmitted from the transmission source device 2 to the opposite device 6 is received, is the connection detection unit 32 transmitted via the connection registered in the connection table 22 using the IP address and the port number? Confirm. If the packet is transmitted through the registered connection, the connection detection unit 32 outputs the packet to the communication packet confirmation unit 33.

通信パケット確認部33は、入力されたパケットのシーケンス番号にデータ長を加えた値を、コネクションテーブル22のNextSeqNoに記録されている数値と比較する。ここで、データ長の求め方は、送信許可要求パケットの場合と同様である。通信パケット確認部33は、シーケンス番号とデータ長の和がNextSeqNoに記録されている数値よりも大きい場合、入力されたパケットは、送信元装置2から対向装置6に初めて送られるデータを含むと判定する。一方、通信パケット確認部33は、シーケンス番号とデータ長の和がNextSeqNoに記録されている数値以下の場合、入力されたパケットは再送パケットであると判定する。   The communication packet confirmation unit 33 compares the value obtained by adding the data length to the sequence number of the input packet with the numerical value recorded in NextSeqNo of the connection table 22. Here, the method for obtaining the data length is the same as in the case of the transmission permission request packet. When the sum of the sequence number and the data length is larger than the numerical value recorded in NextSeqNo, the communication packet confirmation unit 33 determines that the input packet includes data transmitted from the transmission source device 2 to the opposite device 6 for the first time. To do. On the other hand, when the sum of the sequence number and the data length is equal to or smaller than the numerical value recorded in NextSeqNo, the communication packet confirmation unit 33 determines that the input packet is a retransmission packet.

図8(a)は、通信パケットテーブル23の例を示す図である。図8(a)は、パケットP1〜P3の3つのパケットが送信元装置2から対向装置6に送信された場合の通信パケットテーブル23を示す。以下の説明では、通信パケットテーブル23が図8(a)に示すように更新されたとき、パケットP1〜P3は、いずれも初めて送られるデータを含むと判定されたとする。   FIG. 8A shows an example of the communication packet table 23. FIG. 8A shows the communication packet table 23 when three packets P1 to P3 are transmitted from the transmission source device 2 to the opposite device 6. In the following description, it is assumed that when the communication packet table 23 is updated as shown in FIG. 8A, all of the packets P1 to P3 are determined to include data to be transmitted for the first time.

通信パケット確認部33は、コネクション検出部32から入力されたパケットのTCPヘッダに含まれているシーケンス番号とデータ長を通信パケットテーブル23に記録する。通信パケット確認部33は、送信元装置2および対向装置6のIPアドレス、送信元ポート番号、宛先ポート番号を、コネクション検出部32と同様にTCPヘッダなどを参照して取得し、通信パケットテーブル23に記録する。通信パケット確認部33は、パケットを通信パケットテーブル23に登録するときは、再送回数を「0」に設定する。さらに、通信パケット確認部33は、タイマ14から時刻情報を取得し、そのパケットが送信部12から対向装置6に向けて出力される時刻も、通信パケットテーブル23に記録する。   The communication packet confirmation unit 33 records the sequence number and data length included in the TCP header of the packet input from the connection detection unit 32 in the communication packet table 23. The communication packet confirmation unit 33 acquires the IP address, the transmission source port number, and the destination port number of the transmission source device 2 and the opposite device 6 with reference to the TCP header or the like as in the connection detection unit 32, and the communication packet table 23 To record. The communication packet confirmation unit 33 sets the number of retransmissions to “0” when registering the packet in the communication packet table 23. Further, the communication packet confirmation unit 33 acquires time information from the timer 14 and records the time when the packet is output from the transmission unit 12 toward the opposite device 6 in the communication packet table 23.

通信パケット確認部33は、コネクション検出部32から入力されたパケットの情報に基づいて、これまでに送信元装置2から対向装置6に送信されたデータの次のデータを示すシーケンス番号を求め、コネクションテーブル22に記録する。さらに、通信パケット確認部33は、コネクションテーブル22の最終通信時刻も更新する。   Based on the packet information input from the connection detection unit 32, the communication packet confirmation unit 33 obtains a sequence number indicating the next data after the data transmitted from the transmission source device 2 to the opposite device 6 so far. Record in table 22. Furthermore, the communication packet confirmation unit 33 also updates the last communication time in the connection table 22.

図8(b)は、パケットP1〜P3が送信されたときのコネクションテーブル22の例を示す。パケットP1〜P3はいずれも送信元装置2から対向装置6に同じコネクションを用いて送信されている。従って、そのコネクションでは、シーケンス番号2001から1000バイト分、シーケンス番号3001から1000バイト分、および、シーケンス番号3001から1000バイト分のデータが対向装置6に向けて送信されている。従って、パケットP1〜P3のいずれも対向装置6で受信された場合、シーケンス番号5000までのデータが対向装置6に送信されていることになる。従って、パケットP1〜P3が対向装置6で受信された場合、次に対向装置6に送信されるパケットは、シーケンス番号5001から始まるデータを含む。そこで、NextSeqNoには、5001が記録される。   FIG. 8B shows an example of the connection table 22 when the packets P1 to P3 are transmitted. The packets P1 to P3 are all transmitted from the transmission source device 2 to the opposite device 6 using the same connection. Therefore, in the connection, data corresponding to the sequence number 2001 to 1000 bytes, the sequence number 3001 to 1000 bytes, and the sequence number 3001 to 1000 bytes are transmitted to the opposite device 6. Therefore, when any of the packets P1 to P3 is received by the opposite device 6, data up to the sequence number 5000 is transmitted to the opposite device 6. Therefore, when the packets P1 to P3 are received by the opposite device 6, the next packet transmitted to the opposite device 6 includes data starting from the sequence number 5001. Therefore, 5001 is recorded in NextSeqNo.

通信パケット確認部33は、コネクション検出部32からパケットを受信するたびに、パケットのシーケンス番号にデータ長を加えた値を、コネクションテーブル22のNextSeqNoに記録されている数値と比較する。シーケンス番号とデータ長の合計値が、コネクションテーブル22のNextSeqNoに記録されている数値よりも大きい場合、通信パケット確認部33は、NextSeqNoを、得られた合計値に変更する。   Each time the communication packet confirmation unit 33 receives a packet from the connection detection unit 32, the communication packet confirmation unit 33 compares the value obtained by adding the data length to the sequence number of the packet with the numerical value recorded in NextSeqNo of the connection table 22. When the total value of the sequence number and the data length is larger than the numerical value recorded in NextSeqNo of the connection table 22, the communication packet confirmation unit 33 changes NextSeqNo to the obtained total value.

〔待機時間の算出〕
通信装置10は、通信パケットテーブル23に記録したパケットを、対向装置6に送信する。パケットP1〜P3のようにデータを含むパケットが送信されると、算出部35は、コネクションテーブル22に記録されているRTO計算値を用いて、待機時間を算出する。再送回数をMとし、パケットの送信時刻からM回目の再送までの待機時間をRとすると、算出部35は、待機時間を(2)式に従って計算する。
M =RTOcal ×2M-1 ×V ・・・(2)
(2)式において、Vは1以上の定数である。
[Calculation of waiting time]
The communication device 10 transmits the packet recorded in the communication packet table 23 to the opposite device 6. When a packet including data such as the packets P <b> 1 to P <b> 3 is transmitted, the calculation unit 35 calculates the standby time using the RTO calculation value recorded in the connection table 22. The number of retransmissions and M, when the waiting time from the transmission time of the packet to the M-th retransmission and R M, calculating unit 35 calculates according to the waiting time (2).
R M = RTO cal × 2 M-1 × V (2)
In the formula (2), V is a constant of 1 or more.

算出部35は、Vの値を決定する際に、通信パケットテーブル23の再送フラグの設定を参照することができる。再送フラグが「ON」に設定されている場合、算出部35は、再送フラグが「OFF」に設定されている場合よりもVの値を小さくする。例えば、コネクションが確立されるときは、送信元装置2が対象装置であるかの判定が行われる前であるため、再送フラグが「OFF」に設定されている。そこで、送信元装置2が自律的に応答時間に応じた時間で再送を行うかを判定するために、算出部35は、Vの値を1より大きい値に設定して待機時間を計算する。例えば、算出部35は、対象装置であると判定されていない送信元装置2から送信されたパケットを再送するときの待機時間を、V=3として計算することができる。一方、再送フラグが「ON」に設定されているコネクションについては、送信元装置2から対向装置6に送信されたパケットを通信装置10が再送することが決定されているので、算出部35は、Vの値を1として待機時間を計算できる。   The calculation unit 35 can refer to the setting of the retransmission flag in the communication packet table 23 when determining the value of V. When the retransmission flag is set to “ON”, the calculation unit 35 makes the value of V smaller than when the retransmission flag is set to “OFF”. For example, since the connection is established before it is determined whether the transmission source device 2 is the target device, the retransmission flag is set to “OFF”. Therefore, in order to determine whether the transmission source device 2 autonomously performs retransmission at a time corresponding to the response time, the calculation unit 35 sets the value of V to a value larger than 1 and calculates the standby time. For example, the calculation unit 35 can calculate the waiting time when resending a packet transmitted from the transmission source device 2 that is not determined to be the target device as V = 3. On the other hand, for the connection for which the retransmission flag is set to “ON”, since the communication device 10 has decided to retransmit the packet transmitted from the transmission source device 2 to the opposite device 6, the calculation unit 35 The waiting time can be calculated by setting the value of V to 1.

〔パケットの再送〕
通信装置10は、送信元装置2から送信されたパケットが対向装置6で受信されたかを、応答メッセージ中の確認応答番号を参照することによって確認する。確認応答番号は、応答メッセージに対応するパケットに含まれているデータの次に対向装置6が受信するデータの先頭を表すシーケンス番号である。例えば、パケットP1を受信すると、対向装置6はシーケンス番号=2001のデータから1000バイト分を受信しているので、パケットP1に対する応答メッセージA1では、確認応答番号は3001となる。
[Resend packet]
The communication device 10 confirms whether the packet transmitted from the transmission source device 2 is received by the opposite device 6 by referring to the confirmation response number in the response message. The confirmation response number is a sequence number indicating the head of data received by the opposite apparatus 6 next to the data included in the packet corresponding to the response message. For example, when receiving the packet P1, since the opposite device 6 has received 1000 bytes from the data of sequence number = 2001, the confirmation response number is 3001 in the response message A1 to the packet P1.

通信装置10に受信された応答メッセージA1は、受信部11と直結機器検出部31を介して測定部34に出力される。測定部34は、応答メッセージA1のTCPヘッダ中のACKビットの値が「1」であることを確認すると、確認応答番号を取得する。測定部34は、応答メッセージに含まれている確認応答番号よりも小さいシーケンス番号に対応付けられたパケットは、対向装置6に受信されたと判断し、確認応答番号よりも小さいシーケンス番号に対応するデータやパケットを削除する。さらに、測定部34は、受信した応答メッセージに対応するパケットと、応答メッセージに対応するパケットに関するデータを通信パケットテーブル23から削除する。図9に、応答メッセージA1に基づいてパケットP1に関する情報を削除した後の通信パケットテーブル23を示す。   The response message A1 received by the communication device 10 is output to the measurement unit 34 via the reception unit 11 and the directly connected device detection unit 31. When the measurement unit 34 confirms that the value of the ACK bit in the TCP header of the response message A1 is “1”, the measurement unit 34 acquires the confirmation response number. The measurement unit 34 determines that the packet associated with the sequence number smaller than the confirmation response number included in the response message has been received by the opposite device 6, and data corresponding to the sequence number smaller than the confirmation response number. Or delete the packet. Further, the measurement unit 34 deletes the packet corresponding to the received response message and the data related to the packet corresponding to the response message from the communication packet table 23. FIG. 9 shows the communication packet table 23 after information related to the packet P1 is deleted based on the response message A1.

一方、パケットが対向装置6で受信されたという通知が待機時間以内に届かない場合、パケットの再送が行われる。通信装置10から対向装置6へのパケットの再送は、通信装置10に格納されているパケットが対向装置6に再送される場合と、送信元装置2がパケットを再送する場合とがある。各々の場合について、通信装置10の動作を説明する。   On the other hand, if the notification that the packet is received by the opposite device 6 does not arrive within the waiting time, the packet is retransmitted. The retransmission of the packet from the communication device 10 to the opposite device 6 includes a case where a packet stored in the communication device 10 is retransmitted to the opposite device 6 and a case where the transmission source device 2 retransmits the packet. The operation of the communication device 10 will be described for each case.

(A)ケース1
まず、通信装置10に格納されているパケットが対向装置6に再送される場合について説明する。判定部36は、再送フラグがOFFに設定されているコネクションの各々について、通信装置10から送信を行うかを判定する。判定部36は、タイマ14から現在時刻を取得し、通信パケットテーブル23に含まれている発信時刻との差を求める。得られた差が算出部35で求められた待機時間を超えていると判定部36は、通信装置10からパケットの再送を行うことを決定する。判定部36は、再送を行うパケットを再送部37に通知する。さらに、判定部36は、再送を行うことが決定されたパケットの送信に用いられるコネクションについて、コネクションテーブル22の再送フラグをONに設定する。
(A) Case 1
First, a case where a packet stored in the communication device 10 is retransmitted to the opposite device 6 will be described. The determination unit 36 determines whether to perform transmission from the communication device 10 for each connection for which the retransmission flag is set to OFF. The determination unit 36 acquires the current time from the timer 14 and obtains a difference from the transmission time included in the communication packet table 23. When the obtained difference exceeds the standby time obtained by the calculation unit 35, the determination unit 36 determines to retransmit the packet from the communication device 10. The determination unit 36 notifies the retransmission unit 37 of a packet to be retransmitted. Further, the determination unit 36 sets the retransmission flag of the connection table 22 to ON for the connection used for transmission of the packet determined to be retransmitted.

例えば、送信元装置2(IP1)の1300番のポートから、対向装置6(IP10)の1400番のポートに向けたパケットの送信に用いられるコネクションにおいて、RTO計算値が0.12秒であるとする。また、算出部35で算出された1回目の待機時間は、0.12×(2^0)×3=0.36(秒)であるとする。判定部36が12時0分0.612秒に図9の通信パケットテーブル23を参照したとする。この場合、現在時刻と発信時刻の差は12時0分0.612秒−12時0分0.212秒=0.400秒である。そこで、判定部36は、パケットP2の再送を通信装置10で行うことを決定し、再送部37に通知する。さらに、判定部36は、コネクションテーブル22の再送フラグをONに設定する。すなわち、コネクションテーブル22は、図8(b)から図10(a)に示すように変更される。   For example, in the connection used for transmitting a packet from the port 1300 of the transmission source device 2 (IP1) to the port 1400 of the opposite device 6 (IP10), the RTO calculation value is 0.12 seconds. To do. Further, it is assumed that the first waiting time calculated by the calculation unit 35 is 0.12 × (2 ^ 0) × 3 = 0.36 (seconds). Assume that the determination unit 36 refers to the communication packet table 23 of FIG. 9 at 12: 00: 0.612 seconds. In this case, the difference between the current time and the transmission time is 12: 00: 0.612 seconds-12: 0: 0.212 seconds = 0.400 seconds. Therefore, the determination unit 36 determines to retransmit the packet P <b> 2 by the communication device 10 and notifies the retransmission unit 37. Further, the determination unit 36 sets the retransmission flag in the connection table 22 to ON. That is, the connection table 22 is changed from FIG. 8B to FIG. 10A.

再送部37は、判定部36から通知されたパケットについて、通信パケットテーブル23の再送回数を1に変更し、再送を送信部12に指示する。さらに、再送部37は、通信パケットテーブル23の発信時刻を、パケットが再送される時刻に更新する。変更後の通信パケットテーブル23の例を図10(b)に示す。送信部12にパケットの再送を指示した後も、再送部37は、定期的に、再送フラグがONに設定されているコネクションを介して対向装置6に送信されたパケットについて、発信時刻から経過している時間を求める。再送部37は、発信時刻から経過した時間が2回目の待機時間を越えたパケットについて、送信部12に2回目の再送を指示する。その後も、発信時刻と再送部37が通信パケットテーブル23を確認する時刻の差が、待機時間を越えるたびに再送部37は、送信部12にパケットの再送を指示する。   The retransmission unit 37 changes the number of retransmissions in the communication packet table 23 to 1 for the packet notified from the determination unit 36 and instructs the transmission unit 12 to perform retransmission. Further, the retransmission unit 37 updates the transmission time of the communication packet table 23 to the time when the packet is retransmitted. An example of the communication packet table 23 after the change is shown in FIG. Even after the transmission unit 12 is instructed to retransmit the packet, the retransmission unit 37 periodically elapses from the transmission time for the packet transmitted to the opposite device 6 through the connection in which the retransmission flag is set to ON. Ask for time. The retransmission unit 37 instructs the transmission unit 12 to perform a second retransmission for a packet whose time elapsed from the transmission time exceeds the second standby time. Thereafter, whenever the difference between the transmission time and the time at which the retransmission unit 37 confirms the communication packet table 23 exceeds the standby time, the retransmission unit 37 instructs the transmission unit 12 to retransmit the packet.

次に、再送フラグがONに設定されているコネクションを介して対向装置6に送信されたパケットの再送について説明する。再送フラグがONに設定されているコネクションを介して送信されたパケットの再送については、算出部35は、V=1として待機時間を算出することができる。算出部35は、得られた待機時間を、適宜、記憶部20に記憶する。この場合、再送部37は、発信時刻から(2)式でV=1として求められた待機時間を超えても通信パケットテーブル23に記録されているパケットについて、再送を送信部12に指示する。例えば、パケットP3については、再送部37は、そのコネクションについてV=1で計算された待機時間が経過した時刻に対向装置6に向けて再送を指示する。さらに、再送部37は、通信パケットテーブル23の発信時刻を、パケットが再送される時刻に更新する。   Next, retransmission of a packet transmitted to the opposite apparatus 6 via a connection in which the retransmission flag is set to ON will be described. For retransmission of a packet transmitted via a connection for which the retransmission flag is set to ON, the calculation unit 35 can calculate the standby time with V = 1. The calculation unit 35 stores the obtained standby time in the storage unit 20 as appropriate. In this case, the retransmission unit 37 instructs the transmission unit 12 to retransmit a packet recorded in the communication packet table 23 even if the standby time obtained as V = 1 in equation (2) from the transmission time is exceeded. For example, for the packet P3, the retransmission unit 37 instructs retransmission to the opposite device 6 at the time when the standby time calculated with V = 1 for the connection has elapsed. Further, the retransmission unit 37 updates the transmission time of the communication packet table 23 to the time when the packet is retransmitted.

なお、この例では、再送タイムアウトの3倍以上の時間が経過しても再送が行われないコネクションについて通信装置10が再送を行う場合の例を述べたが、通信装置10が再送を行うと決定するための基準は、実装に応じて任意に変更されることがある。算出部35は、通信装置10で再送が行われる基準に応じて待機時間を計算する。さらに、例えば3秒などの、予め決められた閾値よりも長い時間にわたって再送が行われないときに、判定部36は、通信装置10で再送を行うことを決定することもできる。この場合、算出部35で算出された待機時間ではなく、予め記憶している閾値の時間が経過しても再送が行われないコネクションについて、判定部36は、通信装置10で再送を行うことを決定する。   In this example, an example has been described in which the communication apparatus 10 performs retransmission for a connection in which retransmission is not performed even after a time three times longer than the retransmission timeout has elapsed, but the communication apparatus 10 is determined to perform retransmission. The criteria for doing so may be arbitrarily changed depending on the implementation. The calculation unit 35 calculates the standby time according to a criterion for retransmission at the communication device 10. Furthermore, when retransmission is not performed for a time longer than a predetermined threshold, such as 3 seconds, the determination unit 36 can also determine to perform retransmission by the communication device 10. In this case, the determination unit 36 determines that the communication device 10 performs retransmission for a connection that is not retransmitted even after the threshold time stored in advance has elapsed instead of the standby time calculated by the calculation unit 35. decide.

(B)ケース2
次に、送信元装置2がパケットを再送した場合の通信装置10の動作について説明する。まず、再送フラグの設定が行われていないときの動作から説明する。通信パケット確認部33は、入力されたパケットのシーケンス番号とデータ長の合計値をNextSeqNoと比較する。合計値がNextSeqNo以下であれば、通信パケット確認部33は、送信元装置2から再送されたパケットを取得したと判断する。すると、通信パケット確認部33は、取得したパケットとコネクションおよびシーケンス番号が同一であるエントリを通信パケットテーブル23から抽出し、抽出したエントリの再送回数の値を1つインクリメントする。
(B) Case 2
Next, the operation of the communication device 10 when the transmission source device 2 retransmits a packet will be described. First, the operation when the retransmission flag is not set will be described. The communication packet confirmation unit 33 compares the total value of the sequence number and data length of the input packet with NextSeqNo. If the total value is equal to or less than NextSeqNo, the communication packet confirmation unit 33 determines that the packet retransmitted from the transmission source device 2 has been acquired. Then, the communication packet confirmation unit 33 extracts an entry having the same connection and sequence number as the acquired packet from the communication packet table 23, and increments the value of the number of retransmissions of the extracted entry by one.

次に、通信パケット確認部33は、送信元装置2から対向装置6に再送されたパケットを送信することと、再送するパケットを特定する情報を判定部36に通知する。判定部36は、通信パケット確認部33から通知を受け取った時刻をタイマ14から取得する。また、判定部36は、再送するパケットの前回の発信時刻を通信パケットテーブル23から取得し、タイマ14から得られた時刻との差(実タイムアウト時間)を求める。判定部36は、実タイムアウト時間と待機時間を比較する。待機時間の計算方法はケース1と同様である。実タイムアウト時間が待機時間よりも長い場合、判定部36は、そのコネクションについて、通信装置10からパケットの再送を行うことを決定し、コネクションテーブル22の再送フラグをONに設定する。   Next, the communication packet confirmation unit 33 transmits the retransmitted packet from the transmission source device 2 to the opposite device 6 and notifies the determination unit 36 of information specifying the packet to be retransmitted. The determination unit 36 acquires the time when the notification is received from the communication packet confirmation unit 33 from the timer 14. Further, the determination unit 36 obtains the previous transmission time of the packet to be retransmitted from the communication packet table 23 and obtains the difference (actual timeout time) from the time obtained from the timer 14. The determination unit 36 compares the actual timeout time with the standby time. The calculation method of the waiting time is the same as in case 1. When the actual timeout time is longer than the waiting time, the determination unit 36 determines to retransmit the packet from the communication device 10 for the connection, and sets the retransmission flag of the connection table 22 to ON.

判定部36が実タイムアウト時間を求めた後、通信パケット確認部33は、再送するパケットの送信を送信部12に指示し、送信を指示したパケットについて、通信パケットテーブル23中の発信時刻を更新する。   After the determination unit 36 obtains the actual timeout time, the communication packet confirmation unit 33 instructs the transmission unit 12 to transmit a packet to be retransmitted, and updates the transmission time in the communication packet table 23 for the packet instructed to be transmitted. .

例えば、図9の通信パケットテーブル23が生成された後で、通信装置10がパケットP2を再送する前に、送信元装置2が対向装置6にパケットP2を送信したとする。また、ここでは再送フラグがOFFに設定されているコネクションについて、V=2として(2)式から待機時間が計算されたとする。送信元装置2から再送されたパケットP2を通信装置10が対向装置6に転送した時刻が12時0分0.5秒であるとする。すると、通信パケット確認部33は、図8(a)に示すパケットP2のエントリについて、再送回数を1回インクリメントする。判定部36は、パケットP2の送信時刻が12時0分0.212秒であるので、12時0分0.5秒−12時0分0.212秒=0.288秒より、実タイムアウト時間が0.288秒であることを認識する。次に、判定部36は、そのコネクションについて計算されている待機時間と実タイムアウト時間を比較する。ここで、RTO計算値が0.12秒であるとすると、待機時間は、V=2なので、0.12×(2^0)×2=0.24(秒)である。従って、実タイムアウト時間は、待機時間より長い。そこで、判定部36は、パケットP2の送信に用いられているコネクションについて、通信装置10からパケットの再送を行うことを決定し、そのコネクションの再送フラグをONに設定する。その後、通信パケット確認部33は、パケットP2を対向装置6に向けて再送するように送信部12に指示する。また、パケットP2について、発信時刻を12時0分0.5秒に変更する。   For example, after the communication packet table 23 in FIG. 9 is generated, the transmission source device 2 transmits the packet P2 to the opposite device 6 before the communication device 10 retransmits the packet P2. Here, it is assumed that the standby time is calculated from the equation (2) with V = 2 for the connection in which the retransmission flag is set to OFF. It is assumed that the time when the communication device 10 transfers the packet P2 retransmitted from the transmission source device 2 to the opposite device 6 is 12: 00: 0.5. Then, the communication packet confirmation unit 33 increments the number of retransmissions once for the entry of the packet P2 shown in FIG. Since the transmission time of the packet P2 is 12: 00: 0.212 seconds, the determination unit 36 determines the actual timeout period from 12: 0: 0.5-12-12: 0: 0.212 seconds = 0.288 seconds. Is 0.288 seconds. Next, the determination unit 36 compares the standby time calculated for the connection with the actual timeout time. Here, if the RTO calculation value is 0.12 seconds, the waiting time is V = 2, so 0.12 × (2 × 0) × 2 = 0.24 (seconds). Therefore, the actual timeout time is longer than the waiting time. Therefore, the determination unit 36 determines to retransmit the packet from the communication device 10 for the connection used for transmission of the packet P2, and sets the retransmission flag of the connection to ON. Thereafter, the communication packet confirmation unit 33 instructs the transmission unit 12 to retransmit the packet P2 toward the opposite device 6. For packet P2, the transmission time is changed to 12: 00: 0.5.

なお、この例では、実タイムアウトがRTO計算値の2倍以上の場合に通信装置10が再送を行う場合の例を述べたが、通信装置10が再送を行うと決定するための実タイムアウトとRTO計算値の割合は、実装に応じて任意に変更されることがある。さらに、例えば3秒などの、予め決められた時間よりも実タイムアウト時間が長いときに、判定部36は、通信装置10で再送を行うことを決定することもできる。   In this example, the example in which the communication apparatus 10 performs retransmission when the actual timeout is twice or more the RTO calculation value has been described. However, the actual timeout and RTO for determining that the communication apparatus 10 performs retransmission are described. The ratio of calculated values may be changed arbitrarily depending on the implementation. Further, when the actual timeout time is longer than a predetermined time, such as 3 seconds, the determination unit 36 can also determine that the communication device 10 performs retransmission.

次に、再送フラグがONに設定されているコネクションを介して対向装置6に送信されたパケットについては、ケース1と同様に処理される。従って、すでに再送フラグがONに設定されているコネクションについては、例えば、発信時刻から(2)式でV=1として求められた待機時間が経過したときに、通信装置10に格納されているパケットが対向装置6に再送される。   Next, the packet transmitted to the opposite device 6 via the connection in which the retransmission flag is set to ON is processed in the same manner as in case 1. Therefore, for a connection in which the retransmission flag is already set to ON, for example, a packet stored in the communication device 10 when the standby time determined as V = 1 in Expression (2) from the transmission time has elapsed. Is retransmitted to the opposite device 6.

〔RTO計算値の更新〕
次に、RTO計算値の更新について説明する。ここでは、パケットP1が対向装置6に受信され、対向装置6から送信元装置2に向けてパケットP1についての応答メッセージA1が送信された場合を例として述べる。
[Update of RTO calculation value]
Next, updating of the RTO calculation value will be described. Here, a case where the packet P1 is received by the opposite device 6 and a response message A1 regarding the packet P1 is transmitted from the opposite device 6 to the transmission source device 2 will be described as an example.

通信装置10に受信された応答メッセージA1は、前述のとおり、受信部11と直結機器検出部31を介して測定部34に出力される。測定部34は、確認応答番号よりもデータ長だけ小さな値のシーケンス番号を算出し、応答メッセージで受信が通知されたパケットを特定する。例えば、応答メッセージA1では確認応答番号が3001でデータ長が1000バイトであるので、測定部34は、3001−1000=2001のシーケンス番号のパケットに対する応答メッセージを受信したと認識する。すると、測定部34は、通信パケットテーブル23を参照することにより、応答メッセージを受け取ったパケットについて、送信部12から対向装置6に向けて送信した時刻(発信時刻)を求める。測定部34は、応答メッセージの受信時刻から、受信が通知されたパケットの発信時刻までの時間を差し引いた値を、応答時間とする。   The response message A1 received by the communication device 10 is output to the measurement unit 34 via the reception unit 11 and the directly connected device detection unit 31 as described above. The measuring unit 34 calculates a sequence number having a value smaller than the confirmation response number by the data length, and identifies the packet notified of reception by the response message. For example, in the response message A1, since the confirmation response number is 3001 and the data length is 1000 bytes, the measurement unit 34 recognizes that the response message for the packet having the sequence number of 3001-1000 = 2001 has been received. Then, the measurement unit 34 refers to the communication packet table 23 to obtain the time (transmission time) at which the packet that received the response message was transmitted from the transmission unit 12 to the opposite device 6. The measurement unit 34 sets a value obtained by subtracting the time from the reception time of the response message to the transmission time of the packet notified of reception as the response time.

例えば、図8(a)に示すように、パケットP1が通信装置10から対向装置6に送信された時刻は、12時0分0.21秒である。測定部34は、応答メッセージA1の受信時刻をタイマ14から取得する。例えば、応答メッセージA1の受信時刻が12時0分0.41秒であるとする。すると、測定部34は、
(12時0分0.41秒)−(12時0分0.21秒)=0.20秒
を応答時間とする。測定部34は、求めた応答時間を算出部35に出力する。算出部35は、RTO計算値を更新するときは、(3)式によって更新値を求める。なお、(3)式において、N番目に算出されるRTO計算値をRTOcal ,N とする。
RTOcal ,N =SRTTN +max(G,K×RTTVARN ) ・・・(3)
ここで、
K=4
RTTVARN =(1−β)×RTTVARN-1 +β×|SRTTN-1 −MRTTN
SRTTN =(1−α)×SRTTN-1 +α×MRTTN
であるものとする。ここで、α=1/8、β=1/4であるものとする。Nは2以上の任意の整数である。MRTTN は、測定部34がN回目に求めた応答時間である。また、Gは、通信装置10が応答時間の測定に使用するクロックの粒度(分解能)である。更新後のRTO計算値に基づいた待機時間の求め方は前述のとおりである。算出部35により待機時間が算出されると、待機時間に基づいて再送処理が行われる。
For example, as illustrated in FIG. 8A, the time when the packet P1 is transmitted from the communication device 10 to the opposite device 6 is 12 hours 0 minutes 0.21 seconds. The measurement unit 34 acquires the reception time of the response message A1 from the timer 14. For example, it is assumed that the reception time of the response message A1 is 12: 00: 0.41 seconds. Then, the measurement unit 34
(12: 00: 0.41 seconds) − (12: 0: 0.21 seconds) = 0.20 seconds is the response time. The measurement unit 34 outputs the obtained response time to the calculation unit 35. When the calculation unit 35 updates the RTO calculation value, the calculation unit 35 obtains the update value by the expression (3). In the equation (3), the N-th calculated RTO value is RTO cal , N.
RTO cal , N = SRTT N + max (G, K × RTTVAR N ) (3)
here,
K = 4
RTTVAR N = (1−β) × RTTVAR N−1 + β × | SRTT N−1 −MRTT N |
SRTT N = (1−α) × SRTT N−1 + α × MRTT N
Suppose that Here, it is assumed that α = 1/8 and β = 1/4. N is an arbitrary integer of 2 or more. MRTT N is a response time obtained by the measurement unit 34 for the Nth time. G is the granularity (resolution) of the clock used by the communication device 10 for measuring the response time. The method for obtaining the standby time based on the updated RTO calculation value is as described above. When the standby time is calculated by the calculation unit 35, retransmission processing is performed based on the standby time.

〔通信が終了したときの処理〕
コネクション検出部32は、TCPヘッダ中のRSTかFINが1になっている場合、そのパケットが送信されてきたコネクションに対応する情報をコネクションテーブル22から消去する。従って、コネクションテーブル22には、確立されているコネクションが記録されており、消滅したコネクションや送信元装置2からの切断が要求されているコネクションは記録されていない。また、消去されるコネクションを介して送信されたパケットや、そのパケットに関する情報も、通信パケットテーブル23から消去される。さらに、前述のとおり、直結機器検出部31は、パケットを受信するたびに、受信パケットの送信元アドレスに対応付けられた最終通信時刻を更新する。そこで、直結機器検出部31は、最終通信時刻と現在の時刻の差が一定の時間以上になったエントリを直結機器テーブル21から削除する。
[Process when communication ends]
When the RST or FIN in the TCP header is 1, the connection detection unit 32 deletes information corresponding to the connection from which the packet has been transmitted from the connection table 22. Accordingly, established connections are recorded in the connection table 22, and no lost connections or connections that are requested to be disconnected from the transmission source device 2 are recorded. In addition, the packet transmitted via the connection to be deleted and information related to the packet are also deleted from the communication packet table 23. Furthermore, as described above, each time the directly connected device detection unit 31 receives a packet, it updates the last communication time associated with the source address of the received packet. Therefore, the directly connected device detection unit 31 deletes the entry in which the difference between the last communication time and the current time is a certain time or more from the directly connected device table 21.

図11Aと図11Bは、通信装置10がパケットを受信したときに行う動作の例を説明するフローチャートである。以下、図11Aと図11Bを参照しながら、通信装置10の動作を説明する。なお、図11Aと図11Bに示す通信装置10の動作は一例であり、実装に応じて変更される場合がある。例えば、ステップS3とS4は順序を入れ替えることができる。また、ステップS5は、ステップS14とS15の組み合わせと順序が変更される場合がある。また、ステップS17とS18の動作の組み合わせ、ステップS19とS20の組み合わせ、および、ステップS1とS2の組み合わせは、どの組み合わせの処理が最初に行われても良い。   11A and 11B are flowcharts for explaining an example of an operation performed when the communication device 10 receives a packet. Hereinafter, the operation of the communication apparatus 10 will be described with reference to FIGS. 11A and 11B. Note that the operation of the communication device 10 illustrated in FIGS. 11A and 11B is an example, and may be changed depending on the implementation. For example, steps S3 and S4 can be switched in order. In step S5, the combination and order of steps S14 and S15 may be changed. Further, any combination of the operations of steps S17 and S18, the combinations of steps S19 and S20, and the combinations of steps S1 and S2 may be performed first.

直結機器検出部31は、一定時間以上、通信装置10を介した通信が行われていない直結機器があるかを確認し、通信が行われていない直結機器の登録を直結機器テーブル21から削除する(ステップS1、S2)。受信部11でパケットが受信されると、直結機器検出部31は、受信されたパケットはARPパケットであるかを確認する(ステップS3)。受信されたパケットがARPパケットではない場合、直結機器検出部31は、受信されたパケットがTCPパケットであるかを確認する(ステップS4)。受信されたパケットがTCPパケットである場合、直結機器検出部31は、送信元アドレスと直結機器テーブル21に記録されたアドレスを比較して、送信元の装置が直結装置であるかを確認する(ステップS5)。送信元の装置が直結装置である場合、コネクション検出部32は、送信元装置2から対向装置6に向けて設定されているコネクションがコネクションテーブル22に登録されているかを確認する(ステップS5でYes、ステップS6)。コネクションがコネクションテーブル22に登録されていない場合、コネクション検出部32は、コネクションテーブル22に送信元装置2から対向装置6にデータを送信するためのコネクションを登録する(ステップS6でNo、ステップS7)。   The directly connected device detection unit 31 confirms whether there is a directly connected device that has not been communicated via the communication device 10 for a certain time or longer, and deletes the registration of the directly connected device that has not been communicated from the directly connected device table 21. (Steps S1, S2). When the reception unit 11 receives the packet, the directly connected device detection unit 31 confirms whether the received packet is an ARP packet (step S3). If the received packet is not an ARP packet, the directly connected device detection unit 31 confirms whether the received packet is a TCP packet (step S4). When the received packet is a TCP packet, the direct connection device detection unit 31 compares the transmission source address with the address recorded in the direct connection device table 21 to confirm whether the transmission source device is a direct connection device ( Step S5). When the transmission source device is a direct connection device, the connection detection unit 32 confirms whether or not the connection set from the transmission source device 2 to the opposite device 6 is registered in the connection table 22 (Yes in step S5). Step S6). When the connection is not registered in the connection table 22, the connection detection unit 32 registers a connection for transmitting data from the transmission source device 2 to the opposite device 6 in the connection table 22 (No in step S6, step S7). .

次に、通信パケット確認部33は、受信パケットのシーケンス番号とデータ長の合計値とコネクションテーブル22のNextSeqNoを比較することにより、受信したパケットが再送されたパケットであるかを確認する(ステップS8)。通信パケット確認部33は、受信パケットのシーケンス番号とデータ長の合計値がNextSeqNo以下の場合、再送であると判断して、通信パケットテーブル23を更新する(ステップS8でYes、ステップS9)。一方、受信パケットのシーケンス番号とデータ長の合計値がNextSeqNoより大きい場合、通信パケット確認部33は、処理対象のパケットは再送されたパケットではないと判断する。通信パケットテーブル23は、コネクションテーブル22のNextSeqNoを、受信パケットのシーケンス番号とデータ長の合計値に更新し、さらに、通信パケットテーブル23を更新する(ステップS8でNo、ステップS10)。   Next, the communication packet confirmation unit 33 confirms whether the received packet is a retransmitted packet by comparing the total value of the sequence number of the received packet and the data length with NextSeqNo in the connection table 22 (step S8). ). If the total value of the sequence number and data length of the received packet is equal to or less than NextSeqNo, the communication packet confirmation unit 33 determines that the packet is a retransmission and updates the communication packet table 23 (Yes in step S8, step S9). On the other hand, when the total value of the sequence number and the data length of the received packet is larger than NextSeqNo, the communication packet confirmation unit 33 determines that the processing target packet is not a retransmitted packet. The communication packet table 23 updates NextSeqNo of the connection table 22 to the total value of the sequence number and data length of the received packet, and further updates the communication packet table 23 (No in step S8, step S10).

再送されたパケットを受信した場合、判定部36は、再送パケットを送信する時刻と最初に同じパケットを対向装置6に送信した時刻の間の時間(実タイムアウト時間)を求める。さらに、判定部36は、実タイムアウト時間が待機時間を超過しているかを判定する(ステップS11)。実タイムアウト時間が待機時間を超過している場合、判定部36は、算出部35で計算された待機時間に合わせて対向装置6へのパケットの再送を行うことを決定し、再送フラグをONに設定する(ステップS11でYes、ステップS12)。   When the retransmitted packet is received, the determination unit 36 obtains a time (actual timeout time) between the time when the retransmitted packet is transmitted and the time when the same packet is first transmitted to the opposite device 6. Furthermore, the determination unit 36 determines whether the actual timeout time exceeds the standby time (step S11). When the actual timeout time exceeds the standby time, the determination unit 36 determines to retransmit the packet to the opposite device 6 in accordance with the standby time calculated by the calculation unit 35, and sets the retransmission flag to ON. Set (Yes in step S11, step S12).

次に、通信装置10は、受信パケットが応答メッセージであるかを確認する。この処理は、受信パケットの送信元アドレスが直結機器テーブル21に登録されていない場合も行われる(ステップS5でNo、ステップS13)。直結機器検出部31は、受信パケットの宛先アドレスが直結機器テーブル21に記録されているかを確認する。さらに、測定部34は、受信パケットのTCPヘッダ中のACKビットの値が1であるかを確認する(ステップS13)。宛先アドレスが直結機器テーブル21に記録されていて、さらに、ACKが1になっている場合、測定部34は、受信パケットが応答メッセージであると判断する。さらに、測定部34は、応答メッセージにより対向装置6で受信されたことが通知されたパケットについての記録を、通信パケットテーブル23から削除する(ステップS14)。その後、コネクションテーブル22の最終通信時刻を更新する(ステップS15)。一方、受信パケットが応答メッセージではない場合も、コネクションテーブル22の最終通信時刻が更新される(ステップS13でNo、ステップS15)。   Next, the communication device 10 confirms whether the received packet is a response message. This process is also performed when the source address of the received packet is not registered in the directly connected device table 21 (No in step S5, step S13). The directly connected device detection unit 31 confirms whether the destination address of the received packet is recorded in the directly connected device table 21. Further, the measurement unit 34 confirms whether the value of the ACK bit in the TCP header of the received packet is 1 (step S13). If the destination address is recorded in the directly connected device table 21 and ACK is 1, the measurement unit 34 determines that the received packet is a response message. Further, the measurement unit 34 deletes the record about the packet notified by the counter device 6 by the response message from the communication packet table 23 (step S14). Thereafter, the last communication time in the connection table 22 is updated (step S15). On the other hand, when the received packet is not a response message, the last communication time in the connection table 22 is updated (No in step S13, step S15).

さらに、コネクション検出部32は、コネクションテーブル22に含まれているコネクションの中で一定時間以上通信が行われていないコネクションがあるかを判定する(ステップS16)。一定時間以上通信が行われていないコネクションがあれば、そのコネクションについて、コネクション検出部32はコネクションテーブル22のエントリを削除する。また、通信パケット確認部33は、通信が行われていないコネクションを介して送信されたパケットの記録を、通信パケットテーブル23から削除する(ステップS17)。また、コネクション検出部32は、コネクションテーブル22に登録されているパケットのうちで、切断されるコネクションがあるかを確認する(ステップS18)。この確認は、受信パケットのTCPヘッダに含まれているRSTビットかFINビットの値が1になっているかを確認することにより行われる。コネクション検出部32は、切断されるコネクションのエントリをコネクションテーブル22から削除する。また、また、通信パケット確認部33は、通信が行われていないコネクションを介して送信されたパケットの記録を、通信パケットテーブル23から削除する(ステップS19)。   Further, the connection detection unit 32 determines whether there is a connection that has not been communicated for a certain period of time among the connections included in the connection table 22 (step S16). If there is a connection that has not been communicated for a certain period of time, the connection detection unit 32 deletes the entry in the connection table 22 for that connection. Further, the communication packet confirmation unit 33 deletes the record of the packet transmitted through the connection that is not performing communication from the communication packet table 23 (step S17). Further, the connection detection unit 32 confirms whether there is a connection to be disconnected among the packets registered in the connection table 22 (step S18). This check is performed by checking whether the value of the RST bit or the FIN bit included in the TCP header of the received packet is 1. The connection detection unit 32 deletes the entry of the connection to be disconnected from the connection table 22. Further, the communication packet confirmation unit 33 deletes the record of the packet transmitted via the connection that is not performing communication from the communication packet table 23 (step S19).

一方、受信されたパケットがARPパケットである場合、直結機器検出部31は、ARPパケットの送信元の装置が直結機器テーブル21に登録されているかを確認する(ステップS20)。ARPパケットの送信元の装置が直結機器テーブル21に登録されていない場合、直結機器検出部31は、送信元の装置のIPアドレスやMACアドレスなどを直結機器テーブル21に登録する(ステップS21)。受信パケットがARPパケットである場合、ステップS21の処理の後は、ステップS15以降の処理が行われる。また、既に送信元アドレスが直結機器テーブル21に登録されている場合は、ステップS20の処理の後、ステップS15以降の処理が行われる。また、受信されたパケットの種類がTCPパケットでない場合も、ステップS15以降の処理が行われる(ステップS4でNo、ステップS15)。   On the other hand, when the received packet is an ARP packet, the directly connected device detection unit 31 confirms whether the device that has transmitted the ARP packet is registered in the directly connected device table 21 (step S20). When the transmission source device of the ARP packet is not registered in the direct connection device table 21, the direct connection device detection unit 31 registers the IP address or the MAC address of the transmission source device in the direct connection device table 21 (step S21). When the received packet is an ARP packet, the process after step S15 is performed after the process of step S21. If the transmission source address has already been registered in the directly connected device table 21, the processing after step S15 is performed after the processing at step S20. Further, even when the type of the received packet is not a TCP packet, the processing after step S15 is performed (No in step S4, step S15).

図12は、通信装置10に格納されているパケットが対向装置6に再送される場合の動作の例を説明するフローチャートである。なお、図12は、動作の例であり、例えば、ステップS34とS35をステップS31の前に行うように順序が変更されるなどの変更が加えられる場合がある。また、図12は、判定部36が定期的に起動される場合の動作を示しているが、例えば、判定部36は通信装置10が起動している間、継続的に起動しているように変形されても良い。さらに、判定部36が起動される間隔は、任意の値に設定される。   FIG. 12 is a flowchart for explaining an example of the operation when a packet stored in the communication device 10 is retransmitted to the opposite device 6. FIG. 12 shows an example of the operation. For example, there is a case where a change is made such that the order is changed so that steps S34 and S35 are performed before step S31. FIG. 12 shows the operation when the determination unit 36 is periodically started. For example, the determination unit 36 seems to be continuously activated while the communication device 10 is activated. It may be deformed. Furthermore, the interval at which the determination unit 36 is activated is set to an arbitrary value.

判定部36は、通信パケットテーブル23に含まれている発信時刻と現在時刻の差を求め、得られた差が待機時間を超えているパケットがあるかを確認する(ステップS31)。ここで、待機時間は、RTO計算値に基づいて、(2)式から計算される。待機時間を越えても再送が行われていないパケットがあると、再送部37は、そのパケットの再送を送信部12に指示する。さらに、再送部37は、再送を指示したパケットについて、通信パケットテーブル23の発信時刻を更新する(ステップS31でYes、ステップS32)。さらに、判定部36は、再送されたパケットの送信に用いられるコネクションについて、再送フラグをONに設定する(ステップS33)。   The determination unit 36 obtains the difference between the transmission time and the current time included in the communication packet table 23, and confirms whether there is a packet for which the obtained difference exceeds the standby time (step S31). Here, the standby time is calculated from the equation (2) based on the RTO calculation value. If there is a packet that has not been retransmitted even after the waiting time has been exceeded, the retransmission unit 37 instructs the transmission unit 12 to retransmit the packet. Further, the retransmission unit 37 updates the transmission time of the communication packet table 23 for the packet instructed to be retransmitted (Yes in step S31, step S32). Further, the determination unit 36 sets the retransmission flag to ON for the connection used for transmission of the retransmitted packet (step S33).

次に、再送部37は、再送フラグがONに設定されているコネクションを介して送信されたパケットについて、発信時刻からV=1として計算される待機時間を超過しても再送が行われていないパケットが通信パケットテーブル23に記録されているかを確認する(ステップS34)。該当するパケットが通信パケットテーブル23に記録されている場合、再送部37は、そのパケットの再送を送信部12に指示する。さらに、再送部37は、再送を指示したパケットについて、通信パケットテーブル23の発信時刻を更新する(ステップS34でYes、ステップS35)。   Next, the retransmission unit 37 does not retransmit a packet transmitted via a connection in which the retransmission flag is set to ON even if the standby time calculated as V = 1 from the transmission time is exceeded. It is confirmed whether the packet is recorded in the communication packet table 23 (step S34). When the corresponding packet is recorded in the communication packet table 23, the retransmission unit 37 instructs the transmission unit 12 to retransmit the packet. Further, the retransmission unit 37 updates the transmission time of the communication packet table 23 for the packet instructed to be retransmitted (Yes in step S34, step S35).

図13は、対向装置6に送信されたパケットが送信されてから再送されるまでの時間の例を示すテーブルである。この例では、送信元装置2では、再送タイムアウトが3秒に固定されているものとする。すなわち、送信元装置2は、パケットの送信後3秒以上経過しなければパケットを再送しない。   FIG. 13 is a table showing an example of the time from when a packet transmitted to the opposite apparatus 6 is transmitted until it is retransmitted. In this example, in the transmission source device 2, it is assumed that the retransmission timeout is fixed to 3 seconds. That is, the transmission source device 2 does not retransmit a packet unless 3 seconds or more have elapsed after the transmission of the packet.

通信装置10からの再送を行わないと、送信元装置2からの再送は、(A)に示すように、送信から3秒後に1回目の再送が行われる。1回目の再送を行った後でも応答メッセージが得られなければ、次の再送までの待ち時間を、1回目の再送のときの2倍の長さにして、送信元装置2は、最初のパケットの送信から9秒後に、2回目の再送を行う。   If retransmission from the communication apparatus 10 is not performed, retransmission from the transmission source apparatus 2 is performed for the first time after 3 seconds from transmission, as shown in FIG. If no response message is obtained even after the first retransmission, the transmission source device 2 sets the waiting time until the next retransmission to twice the length of the first retransmission, The second retransmission is performed 9 seconds after the transmission.

一方、再送フラグがOFFのパケットについて、判定部36の判定に基づいて再送が行われる場合の待機時間を(B)に示す。ここで、コネクションの応答時間から計算されたRTO計算値は0.12秒であるとする。また、判定部36は、RTO計算値の3倍以内の時間に対向装置6での受信が確認できず、さらに、パケットの再送も行われていない場合、通信装置10がパケットの再送を行うことを決定するものとする。この場合、最初の再送は、最初にパケットを送信した後0.36秒で行われる。また、パケットを最初に送信してから1.08秒後に2回目の再送、2.52秒後に3回目の再送、5.4秒後に4回目の再送が行われる。   On the other hand, the waiting time when retransmission is performed based on the determination of the determination unit 36 for the packet with the retransmission flag OFF is shown in (B). Here, it is assumed that the RTO calculation value calculated from the response time of the connection is 0.12 seconds. In addition, when the determination unit 36 cannot confirm reception by the opposite device 6 within a time within three times the RTO calculation value and the packet is not retransmitted, the communication device 10 retransmits the packet. Shall be determined. In this case, the first retransmission is performed 0.36 seconds after the first packet transmission. Also, a second retransmission is performed 1.08 seconds after the packet is first transmitted, a third retransmission is performed 2.52 seconds later, and a fourth retransmission is performed 5.4 seconds later.

従って、応答時間から算出されたRTO計算値に基づいて得られた待機時間に合わせて送信が行われると、(B)に示すように最初にパケットを送信してから10秒以内に4回再送が行われる。一方、通信装置10が再送を行わない場合は、(A)に示すように最初にパケットを送信してから10秒以内に2回までしか再送が行われない。   Therefore, when transmission is performed in accordance with the standby time obtained based on the RTO calculation value calculated from the response time, as shown in (B), the packet is retransmitted four times within 10 seconds from the first transmission. Is done. On the other hand, when the communication apparatus 10 does not perform retransmission, as shown in (A), retransmission is performed only twice within 10 seconds after the first packet transmission.

さらに、再送フラグがONに設定されたコネクションについては、通信装置10は、送信元装置2の再送処理は、パケットが最初に送信されてからRTO計算値の3倍以上経過しないと行われないことを認識している。従って、算出部35は、待機時間を計算する際に(2)式などのVの値を1に設定することができ、(C)に示すようなタイミングで再送が行われる。すると、最初にパケットを送信してから10秒以内に6回再送が行われる。   Further, for a connection for which the retransmission flag is set to ON, the communication apparatus 10 does not perform the retransmission process of the transmission source apparatus 2 unless three or more times the RTO calculation value has elapsed since the packet was first transmitted. Recognize. Accordingly, the calculation unit 35 can set the value of V in equation (2) or the like to 1 when calculating the standby time, and retransmission is performed at the timing shown in (C). Then, retransmission is performed six times within 10 seconds after the first packet transmission.

このように、通信装置10が応答時間に合わせて待機時間を計算し、パケットの送信から待機時間が経過したときにパケットの再送を行うシステムでは、パケットロストが発生しても、早いタイミングで対向装置6に再送が行われる。送信元装置2から送信されたパケットに含まれているデータを対向装置6で動作しているアプリケーションで処理している場合、アプリケーションでのタイムアウトが発生する前にパケットを再送できることが望ましい。通信装置10に格納されているパケットを通信装置10から対向装置6に再送することにより、パケットの再送のタイミングを応答時間に合わせて設定することができる。そのため、応答時間が短い場合は、送信元装置2での再送タイムアウトが固定値になっていたとしても、通信装置10が再送を行うことで、アプリケーションがタイムアウトするまでのリトライ回数を増やすことができる。このような通信装置10は、例えば、クラウドコンピューティングシステムのクライアント装置が所属するネットワークに配置されると、送信元装置2で行われる再送のタイミングが固定であっても、リトライ回数を増やすことができる。   In this way, in the system in which the communication device 10 calculates the standby time according to the response time and resends the packet when the standby time has elapsed since the packet was transmitted, even if a packet lost occurs, Retransmission is performed to the device 6. When data included in a packet transmitted from the transmission source device 2 is processed by an application operating in the opposite device 6, it is desirable that the packet can be retransmitted before a timeout occurs in the application. By retransmitting the packet stored in the communication device 10 from the communication device 10 to the opposite device 6, the packet retransmission timing can be set in accordance with the response time. Therefore, if the response time is short, even if the retransmission timeout at the transmission source device 2 is a fixed value, the number of retries until the application times out can be increased by the communication device 10 performing retransmission. . For example, when such a communication device 10 is arranged in a network to which a client device of a cloud computing system belongs, the number of retries can be increased even when the timing of retransmission performed by the transmission source device 2 is fixed. it can.

さらに、送信元装置2の再送タイムアウトが固定値ではない場合でも通信装置10を用いることにより、リトライ回数を増やすことができる場合がある。例えば、通信装置10で計算される待機時間よりも長い時間待機してから送信元装置2がパケットを再送する場合、通信装置10が送信元装置2に代わってパケットを再送することにより、リトライ回数が増加する。   Further, even when the retransmission timeout of the transmission source device 2 is not a fixed value, the number of retries may be increased by using the communication device 10. For example, when the transmission source device 2 retransmits a packet after waiting for a longer time than the standby time calculated by the communication device 10, the communication device 10 retransmits the packet on behalf of the transmission source device 2, so that the number of retries Will increase.

<第2の実施形態>
第1の実施形態では、パケットの再送を行うかをコネクションごとに通信装置10が決定する場合について説明したが、本実施形態では、通信装置10での再送を行うかがパケットごとに決定される。従って、通信装置10での再送を行うかは、送信元装置2が対向装置6に対して送信したパケットを再送するたびに判定される。
<Second Embodiment>
In the first embodiment, a case has been described in which the communication device 10 determines whether to retransmit a packet for each connection. However, in this embodiment, whether to perform retransmission in the communication device 10 is determined for each packet. . Therefore, whether to retransmit in the communication device 10 is determined every time the packet transmitted from the transmission source device 2 to the opposite device 6 is retransmitted.

図14Aと図14Bは、通信装置10がパケットを受信したときに行う動作の例を説明するフローチャートである。ステップS41〜S50の処理は、図11Aと図11Bを参照しながら説明したステップS1〜S10と同様に行われる。次に、判定部36は、送信元装置2から対向装置6に向けて送信されたパケットについて、実タイムアウト時間を求める。実タイムアウト時間は、再送される通信パケットテーブル23に記録されている送信時刻と再送するパケットの送信時刻の差である。判定部36は、実タイムアウト時間を、RTO計算値を用いて得られた待機時間と比較する。(ステップS51)。判定部36は、実タイムアウト時間が待機時間以下の場合、再送フラグを「OFF」に設定する(ステップS52)。一方、実タイムアウト時間が待機時間より長い場合、判定部36は、再送フラグを「ON」に設定する(ステップS53)。ステップS54〜S62の処理は、ステップS13〜S21と同様である。   14A and 14B are flowcharts illustrating an example of an operation performed when the communication apparatus 10 receives a packet. The processes of steps S41 to S50 are performed in the same manner as steps S1 to S10 described with reference to FIGS. 11A and 11B. Next, the determination unit 36 obtains an actual timeout time for the packet transmitted from the transmission source device 2 to the opposite device 6. The actual timeout time is the difference between the transmission time recorded in the retransmitted communication packet table 23 and the transmission time of the packet to be retransmitted. The determination unit 36 compares the actual timeout time with the standby time obtained using the RTO calculated value. (Step S51). When the actual timeout time is equal to or shorter than the standby time, the determination unit 36 sets the retransmission flag to “OFF” (step S52). On the other hand, when the actual timeout time is longer than the standby time, the determination unit 36 sets the retransmission flag to “ON” (step S53). The process of steps S54 to S62 is the same as that of steps S13 to S21.

本実施形態では、通信装置10での再送を行うかは、待機時間が経過するたびに判定されるので、例えば、誤って再送フラグが「ON」に設定されたとしても、判定部36は、次のパケットについて再送を行うかを判定するときに再送フラグの設定を修正できる
なお、本発明は上記の実施形態に限られるものではなく、様々に変形可能である。例えば、直結機器検出部31は、受信パケットのMACアドレスを用いて、送信元の装置が直結装置であるかを確認することもできる。この場合、直結機器検出部31は、受信パケットのイーサネットヘッダを確認する。
In the present embodiment, whether or not to perform retransmission in the communication device 10 is determined every time the standby time elapses. For example, even if the retransmission flag is erroneously set to “ON”, the determination unit 36 The setting of the retransmission flag can be corrected when determining whether to retransmit the next packet. The present invention is not limited to the above-described embodiment, and can be variously modified. For example, the directly connected device detection unit 31 can also check whether the transmission source device is a directly connected device using the MAC address of the received packet. In this case, the directly connected device detection unit 31 confirms the Ethernet header of the received packet.

上述の第1、第2の実施形態を含む各実施形態に対し、さらに以下の付記を開示する。
(付記1)
対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信する受信部と、
前記第1および第2のパケットを記憶する記憶部と、
前記第1および第2のパケットを前記対向装置に送信する送信部と、
前記送信部が前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを前記受信部が受信した時刻までの時間である応答時間を測定する測定部と、
前記送信部が前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記受信部が前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記記憶部から前記第2のパケットを取得すると共に、前記送信部に、前記第2のパケットを前記対向装置に再度送信させる再送部
を備えることを特徴とする通信装置。
(付記2)
前記送信部が前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記受信部が前記第2の応答メッセージと前記再送パケットのいずれも受信しない場合、前記第2のパケット以降に前記送信元装置から受信した前記対向装置宛のパケットは前記再送部が再送する対象であると判定するとともに、前記送信元装置を対象装置に指定する判定部と、
前記対象装置から前記第2のパケットの後に送信された第3のパケットが前記送信部から送信された時刻から前記第3のパケットの再送を前記送信部に指示する時刻までの、前記再送部が待機する時間である待機時間を算出する算出部をさらに備え、
前記第3のパケットに対する応答メッセージを、前記第3のパケットが前記送信部から送信された時刻から前記待機時間が経過しても受信しない場合、前記再送部は前記第3のパケットを前記対向装置に送信する
ことを特徴とする付記1に記載の通信装置。
(付記3)
前記第3のパケットが前記送信部から前記対向装置に向けて送信された時刻から、前記送信元装置から再送された前記第3のパケットを前記受信部が受信するまでの時間が、前記待機時間よりも短い場合、前記判定部は、前記送信元装置が前記対象装置ではなくなったと判定する
ことを特徴とする付記2に記載の通信装置。
(付記4)
前記送信元装置から前記対向装置へのデータの送信に用いられるコネクションの確立を検出すると共に、前記コネクションを介して送信されたパケットに含まれるデータの次に前記コネクションを介して送信されるデータを特定する第1の値を、前記コネクションと対応付けてコネクションテーブルに記録するコネクション検出部を備え、
前記再送部は前記コネクションを介して送信される前記対向装置宛のパケットとして、前記受信部で受信されたパケットに含まれているデータの次に前記コネクションを介して送信されるデータを特定する第2の値が前記コネクションテーブルに記録されている値以下の場合、前記第2の値で特定されるデータを含むパケットが前記送信元装置から再送されたと認識する
ことを特徴とする付記2もしくは3に記載の通信装置。
(付記5)
前記コネクション検出部は、前記コネクションテーブルに記録されている第1のコネクションを介して送受信されるパケットに含まれている制御ビットを確認することにより、前記第1のコネクションを介した通信の終了を検出すると、前記コネクションテーブルから前記第1のコネクションに関するエントリを削除する
ことを特徴とする付記4に記載の通信装置。
(付記6)
前記受信部が応答メッセージを受信すると、前記記憶部は、受信された応答メッセージに対応するパケットを削除する
ことを特徴とする付記1〜5のいずれか1項に記載の通信装置。
(付記7)
対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信し、
前記第1および第2のパケットを記憶し、
前記第1および第2のパケットを前記対向装置に送信し、
前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを受信した時刻までの間の時間である応答時間を測定し、
前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記第2のパケットを前記対向装置に再度送信する
処理を、前記送信元装置から送信された前記対向装置宛のパケットを中継する通信装置が実行することを特徴とする通信方法。
(付記8)
対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信し、
前記第1および第2のパケットを記憶し、
前記第1および第2のパケットを前記対向装置に送信し、
前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを受信した時刻までの間の時間である応答時間を測定し、
前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記第2のパケットを前記対向装置に再度送信する
処理をコンピュータに実行させることを特徴とする通信プログラム。
The following additional notes are further disclosed for each of the embodiments including the first and second embodiments described above.
(Appendix 1)
A receiving unit that receives the first and second packets from a transmission source device that transmits the first and second packets addressed to the opposite device and retransmits a packet that cannot be confirmed by the opposite device to the opposite device. When,
A storage unit for storing the first and second packets;
A transmitter for transmitting the first and second packets to the opposite device;
Time from the time when the transmission unit transmits the first packet to the opposite device to the time when the reception unit receives the first response message notifying the reception of the first packet at the opposite device A measurement unit for measuring the response time,
Even if a time longer than the response time elapses from the time when the transmission unit transmits the second packet to the opposite device, the reception unit notifies the reception of the second packet by the opposite device. When not receiving a second response message and not receiving a retransmission packet that is a packet obtained by retransmitting the second packet from the transmission source device, the second packet is acquired from the storage unit, and A communication apparatus comprising: a retransmission unit that causes the transmission unit to transmit the second packet to the opposite device again.
(Appendix 2)
Even if a time longer than the response time elapses from the time when the transmission unit transmits the second packet to the opposite apparatus, the reception unit receives neither the second response message nor the retransmission packet. A packet addressed to the opposite device received from the transmission source device after the second packet is determined to be a target to be retransmitted by the retransmission unit, and a determination unit that designates the transmission source device as a target device; ,
The retransmission unit from the time when the third packet transmitted after the second packet from the target device is transmitted from the transmission unit to the time when the transmission unit is instructed to retransmit the third packet. A calculation unit for calculating a waiting time that is a waiting time;
If the response message for the third packet is not received even after the waiting time has elapsed from the time when the third packet was transmitted from the transmission unit, the retransmission unit receives the third packet as the opposite device. The communication apparatus according to appendix 1, wherein:
(Appendix 3)
The time from when the third packet is transmitted from the transmission unit to the opposite device until the reception unit receives the third packet retransmitted from the transmission source device is the waiting time. The communication device according to appendix 2, wherein the determination unit determines that the transmission source device is no longer the target device.
(Appendix 4)
The establishment of a connection used for data transmission from the transmission source device to the opposite device is detected, and data transmitted via the connection is next to data included in a packet transmitted via the connection. A connection detection unit that records a first value to be identified in the connection table in association with the connection;
The retransmission unit specifies data transmitted via the connection next to data included in the packet received by the reception unit as a packet addressed to the opposite device transmitted via the connection. When the value of 2 is less than or equal to the value recorded in the connection table, it is recognized that the packet including the data specified by the second value is retransmitted from the transmission source device. The communication apparatus as described in.
(Appendix 5)
The connection detection unit confirms the end of communication via the first connection by checking a control bit included in a packet transmitted / received via the first connection recorded in the connection table. If detected, the entry related to the first connection is deleted from the connection table.
(Appendix 6)
The communication device according to any one of appendices 1 to 5, wherein when the reception unit receives a response message, the storage unit deletes a packet corresponding to the received response message.
(Appendix 7)
Receiving the first and second packets from a transmission source device that transmits first and second packets addressed to the opposite device, and retransmits a packet that cannot be confirmed by the opposite device to the opposite device;
Storing the first and second packets;
Sending the first and second packets to the opposite device;
Measure response time, which is the time between the time when the first packet is transmitted to the opposite device and the time when the first response message for notifying the reception of the first packet at the opposite device is received. And
Even if a time longer than the response time has elapsed since the time when the second packet was transmitted to the opposite device, a second response message for notifying the reception of the second packet by the opposite device should be received. In addition, when the retransmission packet which is a packet obtained by retransmitting the second packet is not received from the transmission source device, a process of transmitting the second packet to the opposite device again is transmitted from the transmission source device. And a communication apparatus that relays the packet addressed to the opposite apparatus.
(Appendix 8)
Receiving the first and second packets from a transmission source device that transmits first and second packets addressed to the opposite device, and retransmits a packet that cannot be confirmed by the opposite device to the opposite device;
Storing the first and second packets;
Sending the first and second packets to the opposite device;
Measure response time, which is the time between the time when the first packet is transmitted to the opposite device and the time when the first response message for notifying the reception of the first packet at the opposite device is received. And
Even if a time longer than the response time has elapsed since the time when the second packet was transmitted to the opposite device, a second response message for notifying the reception of the second packet by the opposite device should be received. And, when a retransmission packet that is a packet obtained by retransmitting the second packet is not received from the transmission source device, the computer is caused to execute a process of retransmitting the second packet to the opposite device. Communication program.

2 送信元装置
4 WAN
6 対向装置
10 通信装置
11 受信部
12 送信部
13 ルーチング部
14 タイマ
20 記憶部
21 直結機器テーブル
22 コネクションテーブル
23 通信パケットテーブル
24 ルーティングテーブル
30 再送代替部
31 直結機器検出部
32 コネクション検出部
33 通信パケット確認部
34 測定部
35 算出部
36 判定部
37 再送部
2 Source device 4 WAN
6 Opposing Device 10 Communication Device 11 Receiving Unit 12 Transmitting Unit 13 Routing Unit 14 Timer 20 Storage Unit 21 Directly Connected Device Table 22 Connection Table 23 Communication Packet Table 24 Routing Table 30 Retransmission Alternative Unit 31 Directly Connected Device Detection Unit 32 Connection Detection Unit 33 Communication Packet Confirmation unit 34 Measurement unit 35 Calculation unit 36 Determination unit 37 Retransmission unit

Claims (7)

対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信する受信部と、
前記第1および第2のパケットを記憶する記憶部と、
前記第1および第2のパケットを前記対向装置に送信する送信部と、
前記送信部が前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを前記受信部が受信した時刻までの時間である応答時間を測定する測定部と、
前記送信部が前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記受信部が前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記記憶部から前記第2のパケットを取得すると共に、前記送信部に、前記第2のパケットを前記対向装置に再度送信させる再送部と、
前記送信元装置から前記再送パケットを受信すると、前記再送パケットの受信時刻と前記第2のパケットを送信した時刻の差である実タイムアウト時間が、前記第2のパケットの送信から前記第2のパケットの再送を前記送信部に指示する時刻までの待機時間より長い場合、前記第2のパケット以降に前記送信元装置から受信した前記対向装置宛のパケットが再送処理の対象であると判定する判定部
を備えることを特徴とする通信装置。
A receiving unit that receives the first and second packets from a transmission source device that transmits the first and second packets addressed to the opposite device and retransmits a packet that cannot be confirmed by the opposite device to the opposite device. When,
A storage unit for storing the first and second packets;
A transmitter for transmitting the first and second packets to the opposite device;
Time from the time when the transmission unit transmits the first packet to the opposite device to the time when the reception unit receives the first response message notifying the reception of the first packet at the opposite device A measurement unit for measuring the response time,
Even if a time longer than the response time elapses from the time when the transmission unit transmits the second packet to the opposite device, the reception unit notifies the reception of the second packet by the opposite device. When not receiving a second response message and not receiving a retransmission packet that is a packet obtained by retransmitting the second packet from the transmission source device, the second packet is acquired from the storage unit, and A retransmission unit that causes the transmission unit to transmit the second packet to the opposite device again ;
When the retransmission packet is received from the transmission source device, an actual time-out time that is a difference between the reception time of the retransmission packet and the time of transmission of the second packet is determined from the transmission of the second packet to the second packet. A determination unit that determines that a packet addressed to the opposite device received from the transmission source device after the second packet is a target of a retransmission process when the retransmission time is longer than a standby time until a time instructing the transmission unit to transmit A communication apparatus comprising:
対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信する受信部と、
前記第1および第2のパケットを記憶する記憶部と、
前記第1および第2のパケットを前記対向装置に送信する送信部と、
前記送信部が前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを前記受信部が受信した時刻までの時間である応答時間を測定する測定部と、
前記送信部が前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記受信部が前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記記憶部から前記第2のパケットを取得すると共に、前記送信部に、前記第2のパケットを前記対向装置に再度送信させる再送部と、
前記送信部が前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記受信部が前記第2の応答メッセージと前記再送パケットのいずれも受信しない場合、前記第2のパケット以降に前記送信元装置から受信した前記対向装置宛のパケット再送処理の対象であると判定するとともに、前記送信元装置を対象装置に指定する判定部と、
前記対象装置から前記第2のパケットの後に送信された第3のパケットが前記送信部から送信された時刻から前記第3のパケットの再送を前記送信部に指示する時刻までの、前記再送部が待機する時間である待機時間を算出する算出部を備え、
前記第3のパケットに対する応答メッセージを、前記第3のパケットが前記送信部から送信された時刻から前記待機時間が経過しても受信しない場合、前記再送部は前記送信部に、前記第3のパケットを前記対向装置に送信させ
ことを特徴とする通信装置。
A receiving unit that receives the first and second packets from a transmission source device that transmits the first and second packets addressed to the opposite device and retransmits a packet that cannot be confirmed by the opposite device to the opposite device. When,
A storage unit for storing the first and second packets;
A transmitter for transmitting the first and second packets to the opposite device;
Time from the time when the transmission unit transmits the first packet to the opposite device to the time when the reception unit receives the first response message notifying the reception of the first packet at the opposite device A measurement unit for measuring the response time,
Even if a time longer than the response time elapses from the time when the transmission unit transmits the second packet to the opposite device, the reception unit notifies the reception of the second packet by the opposite device. When not receiving a second response message and not receiving a retransmission packet that is a packet obtained by retransmitting the second packet from the transmission source device, the second packet is acquired from the storage unit, and A retransmission unit that causes the transmission unit to transmit the second packet to the opposite device again;
Even if a time longer than the response time elapses from the time when the transmission unit transmits the second packet to the opposite apparatus, the reception unit receives neither the second response message nor the retransmission packet. A determination unit that determines that a packet addressed to the opposite device received from the transmission source device after the second packet is a target of retransmission processing, and designates the transmission source device as a target device;
The retransmission unit from the time when the third packet transmitted after the second packet from the target device is transmitted from the transmission unit to the time when the transmission unit is instructed to retransmit the third packet. for example Bei the calculation unit for calculating the waiting time is the time to wait,
A response message to said third packet, when the third packet is not received even after the standby time from the time transmitted from the transmitting unit, the retransmission unit in the transmitting unit, the third packet you characterized in that Ru is transmitted to the counter device communication device.
前記第3のパケットが前記送信部から前記対向装置に向けて送信された時刻から、前記送信元装置から再送された前記第3のパケットを前記受信部が受信するまでの時間が、前記待機時間よりも短い場合、前記判定部は、前記送信元装置が前記対象装置ではなくなったと判定する
ことを特徴とする請求項2に記載の通信装置。
The time from when the third packet is transmitted from the transmission unit to the opposite device until the reception unit receives the third packet retransmitted from the transmission source device is the waiting time. The communication device according to claim 2, wherein the determination unit determines that the transmission source device is no longer the target device.
前記送信元装置から前記対向装置へのデータの送信に用いられるコネクションの確立を検出すると共に、前記コネクションを介して送信されたパケットに含まれるデータの次に前記コネクションを介して送信されるデータを特定する第1の値を、前記コネクションと対応付けてコネクションテーブルに記録するコネクション検出部を備え、
前記再送部は前記コネクションを介して送信される前記対向装置宛のパケットとして、前記受信部で受信されたパケットに含まれているデータの次に前記コネクションを介して送信されるデータを特定する第2の値が前記コネクションテーブルに記録されている値以下の場合、前記第2の値で特定されるデータを含むパケットが前記送信元装置から再送されたと認識する
ことを特徴とする請求項2もしくは3に記載の通信装置。
The establishment of a connection used for data transmission from the transmission source device to the opposite device is detected, and data transmitted via the connection is next to data included in a packet transmitted via the connection. A connection detection unit that records a first value to be identified in the connection table in association with the connection;
The retransmission unit specifies data transmitted via the connection next to data included in the packet received by the reception unit as a packet addressed to the opposite device transmitted via the connection. 3. When the value of 2 is less than or equal to the value recorded in the connection table, it is recognized that a packet including data specified by the second value is retransmitted from the transmission source device. 3. The communication device according to 3.
前記コネクション検出部は、前記コネクションテーブルに記録されている第1のコネクションを介して送受信されるパケットに含まれている制御ビットを確認することにより、前記第1のコネクションを介した通信の終了を検出すると、前記コネクションテーブルから前記第1のコネクションに関するエントリを削除する
ことを特徴とする請求項4に記載の通信装置。
The connection detection unit confirms the end of communication via the first connection by checking a control bit included in a packet transmitted / received via the first connection recorded in the connection table. The communication apparatus according to claim 4, wherein when detected, an entry related to the first connection is deleted from the connection table.
対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信し、
前記第1および第2のパケットを記憶し、
前記第1および第2のパケットを前記対向装置に送信し、
前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを受信した時刻までの間の時間である応答時間を測定し、
前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記第2のパケットを前記対向装置に再度送信し、
前記送信元装置から前記再送パケットを受信すると、前記再送パケットの受信時刻と前記第2のパケットを送信した時刻の差である実タイムアウト時間が、前記第2のパケットの送信から前記第2のパケットを再送する時刻までの待機時間より長い場合、前記第2のパケット以降に前記送信元装置から受信した前記対向装置宛のパケットは再送処理の対象であると判定する
処理を、前記送信元装置から送信された前記対向装置宛のパケットを中継する通信装置が実行することを特徴とする通信方法。
Receiving the first and second packets from a transmission source device that transmits first and second packets addressed to the opposite device, and retransmits a packet that cannot be confirmed by the opposite device to the opposite device;
Storing the first and second packets;
Sending the first and second packets to the opposite device;
Measure response time, which is the time between the time when the first packet is transmitted to the opposite device and the time when the first response message for notifying the reception of the first packet at the opposite device is received. And
Even if a time longer than the response time has elapsed since the time when the second packet was transmitted to the opposite device, a second response message for notifying the reception of the second packet by the opposite device should be received. not, and, when said from the source device does not even receive the retransmission packet is the second packet retransmission packet, sends again the second packet to the opposite apparatus,
When the retransmission packet is received from the transmission source device, an actual time-out time that is a difference between the reception time of the retransmission packet and the time of transmission of the second packet is determined from the transmission of the second packet to the second packet. If the transmission time is longer than the waiting time until the time to retransmit the packet, a process for determining that a packet addressed to the opposite device received from the transmission source device after the second packet is a target of retransmission processing is performed from the transmission source device. A communication method executed by a communication device that relays a packet addressed to the opposite device.
対向装置宛ての第1および第2のパケットを送信し、前記対向装置での受信が確認できないパケットを前記対向装置に再送する送信元装置から、前記第1および第2のパケットを受信し、
前記第1および第2のパケットを記憶し、
前記第1および第2のパケットを前記対向装置に送信し、
前記第1のパケットを前記対向装置に送信した時刻から、前記対向装置での前記第1のパケットの受信を通知する第1の応答メッセージを受信した時刻までの間の時間である応答時間を測定し、
前記第2のパケットを前記対向装置に送信した時刻から、前記応答時間より長い時間が経過しても、前記対向装置での前記第2のパケットの受信を通知する第2の応答メッセージを受信せず、かつ、前記送信元装置から前記第2のパケットを再送したパケットである再送パケットも受信しない場合、前記第2のパケットを前記対向装置に再度送信し、
前記送信元装置から前記再送パケットを受信すると、前記再送パケットの受信時刻と前記第2のパケットを送信した時刻の差である実タイムアウト時間が、前記第2のパケットの送信から前記第2のパケットを再送する時刻までの待機時間より長い場合、前記第2のパケット以降に前記送信元装置から受信した前記対向装置宛のパケットは再送処理の対象であると判定する
処理をコンピュータに実行させることを特徴とする通信プログラム。
Receiving the first and second packets from a transmission source device that transmits first and second packets addressed to the opposite device, and retransmits a packet that cannot be confirmed by the opposite device to the opposite device;
Storing the first and second packets;
Sending the first and second packets to the opposite device;
Measure response time, which is the time between the time when the first packet is transmitted to the opposite device and the time when the first response message for notifying the reception of the first packet at the opposite device is received. And
Even if a time longer than the response time has elapsed since the time when the second packet was transmitted to the opposite device, a second response message for notifying the reception of the second packet by the opposite device should be received. not, and, when said from the source device does not even receive the retransmission packet is the second packet retransmission packet, sends again the second packet to the opposite apparatus,
When the retransmission packet is received from the transmission source device, an actual time-out time that is a difference between the reception time of the retransmission packet and the time of transmission of the second packet is determined from the transmission of the second packet to the second packet. If it is longer than the waiting time until the time to retransmit the packet , the computer is caused to execute processing for determining that a packet addressed to the opposite device received from the transmission source device after the second packet is a target of retransmission processing. A featured communication program.
JP2011005882A 2011-01-14 2011-01-14 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM Expired - Fee Related JP5680978B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011005882A JP5680978B2 (en) 2011-01-14 2011-01-14 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011005882A JP5680978B2 (en) 2011-01-14 2011-01-14 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Publications (2)

Publication Number Publication Date
JP2012147377A JP2012147377A (en) 2012-08-02
JP5680978B2 true JP5680978B2 (en) 2015-03-04

Family

ID=46790458

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011005882A Expired - Fee Related JP5680978B2 (en) 2011-01-14 2011-01-14 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Country Status (1)

Country Link
JP (1) JP5680978B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10291365B2 (en) * 2016-12-29 2019-05-14 X Development Llc Efficient automatic repeat request for free space optical communication
CN111010362B (en) * 2019-03-20 2021-09-21 新华三技术有限公司 Monitoring method and device for abnormal host

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1146217A (en) * 1997-07-28 1999-02-16 Nippon Telegr & Teleph Corp <Ntt> Radio packet re-transmission method
JP2002330168A (en) * 2001-05-07 2002-11-15 Nec Corp Method for setting retransfer timeout time in communication system
JP4214793B2 (en) * 2003-02-19 2009-01-28 日本電気株式会社 Wireless communication system, server, base station, mobile terminal, and retransmission timeout time determination method used for them

Also Published As

Publication number Publication date
JP2012147377A (en) 2012-08-02

Similar Documents

Publication Publication Date Title
US7502860B1 (en) Method and apparatus for client-side flow control in a transport protocol
US7738495B2 (en) Method of determining a maximum transmission unit value of a network path using transport layer feedback
US8260935B2 (en) Error control terminal discovery and updating
US8583831B2 (en) Thin client discovery
US8174964B2 (en) Detecting unavailable network connections
US7496038B2 (en) Method for faster detection and retransmission of lost TCP segments
JP5867188B2 (en) Information processing apparatus, congestion control method, and congestion control program
JP5935940B2 (en) COMMUNICATION METHOD, COMMUNICATION DEVICE, AND COMMUNICATION PROGRAM
JP2005287045A (en) Method for discovery of device connected to ip network and device to carry out the method
WO2014037760A1 (en) Method and system for increasing data flow transmission
US11677675B2 (en) Method and system for determining a path maximum transmission unit (MTU) between endpoints of a generic routing encapsulation (GRE) tunnel
CN108234087B (en) Data transmission method and sending end
JP2009525708A (en) Protocol link layer
EP2922241B1 (en) Methods and apparatus to determine network delay with location independence from retransmission delay and application response time
US7535916B2 (en) Method for sharing a transport connection across a multi-processor platform with limited inter-processor communications
JP5680978B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM
CN108234089B (en) Method and system for low latency communication
US9172654B2 (en) Transfer device and transfer method
JP5662779B2 (en) Communication system and node device
US20210359787A1 (en) Communication protocol packet retransmission
WO2004071027A1 (en) Methods and systems for non-disruptive physical address resolution
JP2016019198A (en) Communication apparatus, control method for communication apparatus, and program
WO2018202282A1 (en) Device and method for monitoring a tcp connection
US9172774B2 (en) Technique for managing communications at a router
US20170195085A1 (en) Transmission control protocol segment recovery

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140718

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140805

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140919

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: 20150106

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150108

R150 Certificate of patent or registration of utility model

Ref document number: 5680978

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees