TCP からユーザへのメッセージ
2.4.1 タイプ・コード
すべてのメッセージには、そのメッセージが対象とするユーザ・コールの種類を識別するタイプ・コードが含まれる。タイプは次のとおり。
0 - General message, does not apply to a particular user call
1 - Applies to OPEN
2 - Applies to CLOSE
3 - Applies to INTERRUPT
10 - Applies to SEND
20 - Applies to RECEIVE
30 - Applies to STATUS
2.4.2 メッセージ形式 [概念的なもの]
すべてのメッセージには、次の 3 つのフィールドが含まれる。
Type code
Local connection name
Event code
メッセージ・タイプ 0 から 3 [General、Open、Close、Interrupt] では、これら 3 つのフィールドだけが必要である。
メッセージ・タイプ 10 [Send] では、さらに 1 つのフィールドが必要である。
Buffer address
メッセージ・タイプ 20 [Receive] では、さらに 3 つのフィールドが必要である。
Buffer address
Byte count
End-of-letter flag
メッセージ・タイプ 30 [status] では、追加データとして次のものが含まれうる。
Local socket, foreign socket
Send window [measures buffer space at foreign TCP]
Receive window [measures buffer space at local TCP]
Connection state [see section 4.3.6]
Number of letters awaiting acknowledgment
Number of letters awaiting receipt
Retransmission timeout
2.4.3 イベント・コード
イベント・コードは、TCP がユーザに伝えようとする個々のイベントを指定する。
イベント・コードに加えて、イベントを大きなカテゴリに分類し、ユーザによるイベント処理を容易にするために、3 つのフラグが役に立つ。
E flag: set if event is an error
L/F flag: indicates whether event was generated by Local TCP, or
Foreign TCP or network
P/T flag: indicates whether the event is Permanent or Temporary
[retry may succeed]
イベントは 8 ビットに符号化され、上位ビットがそれぞれ E、L/F、P/T の各フラグの状態を示す。
これまでに規定されたイベントを、コードとフラグの設定とともに以下に示す。* は、そのイベントについてフラグが該当しないか、両方の値を取りうることを意味する。実験の過程で、さらにイベントが定義されることがある。
0 0** general success
1 ELP connection illegal for this process
2 OF* unspecified foreign socket has become bound
3 ELP connection not open
4 ELT no room for TCB
5 ELT foreign socket unspecified
6 ELP connection already open
EFP unacceptable SYN [or SYN/ACK] arrived at foreign
TCP. Note: This is not a misprint, the local meaning is different
from foreign.
7 EFP connection does not exist at foreign TCP
8 EFT foreign TCP inaccessible [may have subcases]
9 ELT retransmission timeout
10 E*P buffer flushed due to interrupt
11 OF* interrupt to user
12 **P connection closing
13 E** general error
14 E*P connection reset
各メッセージ・タイプで発生しうるイベントは次のとおり。
Type 0[general]: 2,11,12,14
Type 1[open]: 0,1,4,6,13
Type 2[close]: 0,1,3,13
Type 3[interrupt]: 0,1,3,5,7,8,9,12,13
Type 10[send]: 0,1,3,5,7,8,9,10,11,12,13
Type 20[receive]: 0,1,3,10,12,13
Type 30[status]: 0,1,13
イベント 6 (外部)、7、8 は外部 TCP またはネットワーク内で生成され、これらと同じコードがインターネット・パケットの誤りフィールドにも使用される点に注意されたい [4.2.1 節を参照]。