Appendix E. Event Processing (イベント処理)
Appendix E: Event Processing (イベント処理)
Event Processing (イベント処理)
OPEN Call (OPEN呼び出し)
...
An initial send sequence number (ISS) is selected. Send a SYN
segment of the form:
<SEQ=ISS><CTL=SYN><TSval=my.TSclock><WSopt=Rcv.Wind.Scale>
...
初期送信シーケンス番号 (ISS) が選択されます。次の形式のSYNセグメントを送信します。
<SEQ=ISS><CTL=SYN><TSval=my.TSclock><WSopt=Rcv.Wind.Scale>
...
SEND Call (SEND呼び出し)
CLOSED STATE (i.e., TCB does not exist)
...
LISTEN STATE
If the foreign socket is specified, then change the connection
from passive to active, select an ISS. Send a SYN segment
containing the options: <TSval=my.TSclock> and
<WSopt=Rcv.Wind.Scale>. Set SND.UNA to ISS, SND.NXT to ISS+1.
Enter SYN-SENT state. ...
外部ソケットが指定されている場合、接続をパッシブからアクティブに変更し、ISSを選択します。次のオプションを含むSYNセグメントを送信します: <TSval=my.TSclock>および<WSopt=Rcv.Wind.Scale>。SND.UNAをISS、SND.NXTをISS+1に設定します。SYN-SENT状態に入ります...
SYN-SENT STATE
SYN-RECEIVED STATE
...
ESTABLISHED STATE
CLOSE-WAIT STATE
Segmentize the buffer and send it with a piggybacked
acknowledgment (acknowledgment value = RCV.NXT). ...
If the urgent flag is set ...
If the Snd.TS.OK flag is set, then include the TCP Timestamps
option <TSval=my.TSclock,TSecr=TS.Recent> in each data segment.
Scale the receive window for transmission in the segment header:
SEG.WND = (SND.WND >> Rcv.Wind.Scale).
バッファをセグメント化し、ピギーバック確認応答 (確認応答値 = RCV.NXT) を付けて送信します...
緊急フラグが設定されている場合...
Snd.TS.OKフラグが設定されている場合、各データセグメントにTCP Timestampsオプション<TSval=my.TSclock,TSecr=TS.Recent>を含めます。
セグメントヘッダーで送信するために受信ウィンドウをスケーリングします。
SEG.WND = (SND.WND >> Rcv.Wind.Scale).
SEGMENT ARRIVES (セグメント到着)
...
If the state is LISTEN then
first check for an RST
...
second check for an ACK
...
third check for a SYN
if the SYN bit is set, check the security. If the ...
...
If the SEG.PRC is less than the TCB.PRC then continue.
Check for a Window Scale option (WSopt); if one is found, save
SEG.WSopt in Snd.Wind.Scale and set Snd.WS.OK flag on.
Otherwise, set both Snd.Wind.Scale and Rcv.Wind.Scale to zero
and clear Snd.WS.OK flag.
Check for a TSopt option; if one is found, save SEG.TSval in the
variable TS.Recent and turn on the Snd.TS.OK bit.
Set RCV.NXT to SEG.SEQ+1, IRS is set to SEG.SEQ and any other
control or text should be queued for processing later. ISS
should be selected and a SYN segment sent of the form:
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
If the Snd.WS.OK bit is on, include a WSopt option
<WSopt=Rcv.Wind.Scale> in this segment. If the Snd.TS.OK bit is
on, include a TSopt <TSval=my.TSclock,TSecr=TS.Recent> in this
segment. Last.ACK.sent is set to RCV.NXT.
SND.NXT is set to ISS+1 and SND.UNA to ISS. The connection
state should be changed to SYN-RECEIVED. Note that any other
incoming control or data (combined with SYN) will be processed
in the SYN-RECEIVED state, but processing of SYN and ACK should
not be repeated. If the listen was not fully specified (i.e.,
the foreign socket was not fully specified), then the
unspecified fields should be filled in now.
...
状態がLISTENの場合
まずRSTをチェック
...
次にACKをチェック
...
第三にSYNをチェック
SYNビットが設定されている場合、セキュリティをチェックします。もし...
...
SEG.PRCがTCB.PRCより小さい場合、続行します。
Window Scaleオプション (WSopt) をチェックします。見つかった場合、SEG.WSoptをSnd.Wind.Scaleに保存し、Snd.WS.OKフラグをオンにします。それ以外の場合、Snd.Wind.ScaleとRcv.Wind.Scaleの両方をゼロに設定し、Snd.WS.OKフラグをクリアします。
TSoptオプションをチェックします。見つかった場合、SEG.TSvalを変数TS.Recentに保存し、Snd.TS.OKビットをオンにします。
RCV.NXTをSEG.SEQ+1に設定し、IRSをSEG.SEQに設定し、他の制御またはテキストは後で処理するためにキューに入れる必要があります。ISSを選択し、次の形式のSYNセグメントを送信する必要があります。
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
Snd.WS.OKビットがオンの場合、このセグメントにWSoptオプション<WSopt=Rcv.Wind.Scale>を含めます。Snd.TS.OKビットがオンの場合、このセグメントにTSopt <TSval=my.TSclock,TSecr=TS.Recent>を含めます。Last.ACK.sentはRCV.NXTに設定されます。
SND.NXTはISS+1に設定され、SND.UNAはISSに設定されます。接続状態はSYN-RECEIVEDに変更される必要があります。他の着信制御またはデータ (SYNと組み合わされた) はSYN-RECEIVED状態で処理されますが、SYNとACKの処理は繰り返されません。リスンが完全に指定されていなかった場合 (つまり、外部ソケットが完全に指定されていなかった場合)、未指定のフィールドは今すぐ埋められるべきです。
fourth other text or control (第四、その他のテキストまたは制御)
...
If the state is SYN-SENT then
first check the ACK bit
...
fourth check the SYN bit
...
If the SYN bit is on and the security/compartment and precedence
are acceptable then, RCV.NXT is set to SEG.SEQ+1, IRS is set to
SEG.SEQ, and any acknowledgements on the retransmission queue
which are thereby acknowledged should be removed.
Check for a Window Scale option (WSopt); if is found, save
SEG.WSopt in Snd.Wind.Scale; otherwise, set both Snd.Wind.Scale
and Rcv.Wind.Scale to zero.
Check for a TSopt option; if one is found, save SEG.TSval in
variable TS.Recent and turn on the Snd.TS.OK bit in the
connection control block. If the ACK bit is set, use my.TSclock
- SEG.TSecr as the initial RTT estimate.
If SND.UNA > ISS (our SYN has been ACKed), change the connection
state to ESTABLISHED, form an ACK segment:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
and send it. If the Snd.Echo.OK bit is on, include a TSopt
option <TSval=my.TSclock,TSecr=TS.Recent> in this ACK segment.
Last.ACK.sent is set to RCV.NXT.
Data or controls which were queued for transmission may be
included. If there are other controls or text in the segment
then continue processing at the sixth step below where the URG
bit is checked, otherwise return.
Otherwise enter SYN-RECEIVED, form a SYN,ACK segment:
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
and send it. If the Snd.Echo.OK bit is on, include a TSopt
option <TSval=my.TSclock,TSecr=TS.Recent> in this segment.
...
状態がSYN-SENTの場合
まずACKビットをチェック
...
第四にSYNビットをチェック
...
SYNビットがオンで、セキュリティ/コンパートメントと優先順位が受け入れ可能な場合、RCV.NXTはSEG.SEQ+1に設定され、IRSはSEG.SEQに設定され、それによって確認される再送信キュー上の確認応答は削除される必要があります。
Window Scaleオプション (WSopt) をチェックします。見つかった場合、SEG.WSoptをSnd.Wind.Scaleに保存します。それ以外の場合、Snd.Wind.ScaleとRcv.Wind.Scaleの両方をゼロに設定します。
TSoptオプションをチェックします。見つかった場合、SEG.TSvalを変数TS.Recentに保存し、接続制御ブロックのSnd.TS.OKビットをオンにします。ACKビットが設定されている場合、my.TSclock - SEG.TSecrを初期RTT推定値として使用します。
SND.UNA > ISS (私たちのSYNがACKされた) の場合、接続状態をESTABLISHEDに変更し、ACKセグメントを形成します。
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
そしてそれを送信します。Snd.Echo.OKビットがオンの場合、このACKセグメントにTSoptオプション<TSval=my.TSclock,TSecr=TS.Recent>を含めます。Last.ACK.sentはRCV.NXTに設定されます。
送信のためにキューに入れられたデータまたは制御が含まれる場合があります。セグメントに他の制御またはテキストがある場合、URGビットがチェックされる以下の6番目のステップで処理を続行し、それ以外の場合は戻ります。
それ以外の場合、SYN-RECEIVEDに入り、SYN,ACKセグメントを形成します。
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
そしてそれを送信します。Snd.Echo.OKビットがオンの場合、このセグメントにTSoptオプション<TSval=my.TSclock,TSecr=TS.Recent>を含めます。
If the Snd.WS.OK bit is on, include a WSopt option
<WSopt=Rcv.Wind.Scale> in this segment. Last.ACK.sent is set to
RCV.NXT.
If there are other controls or text in the segment, queue them
for processing after the ESTABLISHED state has been reached,
return.
fifth, if neither of the SYN or RST bits is set then drop the
segment and return.
Snd.WS.OKビットがオンの場合、このセグメントにWSoptオプション<WSopt=Rcv.Wind.Scale>を含めます。Last.ACK.sentはRCV.NXTに設定されます。
セグメントに他の制御またはテキストがある場合、ESTABLISHED状態に達した後の処理のためにキューに入れ、戻ります。
第五に、SYNまたはRSTビットのいずれも設定されていない場合、セグメントを破棄して戻ります。
Otherwise, (それ以外の場合)
First, check sequence number (まず、シーケンス番号をチェック)
SYN-RECEIVED STATE
ESTABLISHED STATE
FIN-WAIT-1 STATE
FIN-WAIT-2 STATE
CLOSE-WAIT STATE
CLOSING STATE
LAST-ACK STATE
TIME-WAIT STATE
Segments are processed in sequence. Initial tests on arrival
are used to discard old duplicates, but further processing is
done in SEG.SEQ order. If a segment's contents straddle the
boundary between old and new, only the new parts should be
processed.
Rescale the received window field:
TrueWindow = SEG.WND << Snd.Wind.Scale,
and use "TrueWindow" in place of SEG.WND in the following steps.
Check whether the segment contains a Timestamps option and bit
Snd.TS.OK is on. If so:
If SEG.TSval < TS.Recent, then test whether connection has
been idle less than 24 days; if both are true, then the
segment is not acceptable; follow steps below for an
unacceptable segment.
If SEG.SEQ is equal to Last.ACK.sent, then save SEG.ECopt in
variable TS.Recent.
SYN-RECEIVED STATE
ESTABLISHED STATE
FIN-WAIT-1 STATE
FIN-WAIT-2 STATE
CLOSE-WAIT STATE
CLOSING STATE
LAST-ACK STATE
TIME-WAIT STATE
セグメントは順番に処理されます。到着時の初期テストは古い重複を破棄するために使用されますが、さらなる処理はSEG.SEQ順で行われます。セグメントの内容が古いものと新しいものの境界にまたがる場合、新しい部分のみを処理する必要があります。
受信したウィンドウフィールドを再スケーリングします。
TrueWindow = SEG.WND << Snd.Wind.Scale,
そして次のステップでSEG.WNDの代わりに「TrueWindow」を使用します。
セグメントにTimestampsオプションが含まれ、Snd.TS.OKビットがオンかどうかをチェックします。そうであれば:
SEG.TSval < TS.Recentの場合、接続が24日未満アイドル状態であったかどうかをテストします。両方が真である場合、セグメントは受け入れられません。受け入れられないセグメントの以下のステップに従います。
SEG.SEQがLast.ACK.sentと等しい場合、SEG.ECoptを変数TS.Recentに保存します。
There are four cases for the acceptability test for an incoming
segment:
...
If an incoming segment is not acceptable, an acknowledgment
should be sent in reply (unless the RST bit is set, if so drop
the segment and return):
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
Last.ACK.sent is set to SEG.ACK of the acknowledgment. If the
Snd.Echo.OK bit is on, include the Timestamps option
<TSval=my.TSclock,TSecr=TS.Recent> in this ACK segment. Set
Last.ACK.sent to SEG.ACK and send the ACK segment. After
sending the acknowledgment, drop the unacceptable segment and
return.
...
fifth check the ACK field.
if the ACK bit is off drop the segment and return.
if the ACK bit is on
...
ESTABLISHED STATE
If SND.UNA < SEG.ACK =< SND.NXT then, set SND.UNA <- SEG.ACK.
Also compute a new estimate of round-trip time. If Snd.TS.OK
bit is on, use my.TSclock - SEG.TSecr; otherwise use the
elapsed time since the first segment in the retransmission
queue was sent. Any segments on the retransmission queue
which are thereby entirely acknowledged...
...
Seventh, process the segment text.
ESTABLISHED STATE
FIN-WAIT-1 STATE
FIN-WAIT-2 STATE
...
Send an acknowledgment of the form:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
If the Snd.TS.OK bit is on, include Timestamps option
<TSval=my.TSclock,TSecr=TS.Recent> in this ACK segment. Set
Last.ACK.sent to SEG.ACK of the acknowledgment, and send it.
This acknowledgment should be piggy-backed on a segment being
transmitted if possible without incurring undue delay.
...
着信セグメントの受け入れ可能性テストには4つのケースがあります。
...
着信セグメントが受け入れられない場合、応答として確認応答を送信する必要があります (RSTビットが設定されている場合を除き、その場合はセグメントを破棄して戻ります):
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
Last.ACK.sentは確認応答のSEG.ACKに設定されます。Snd.Echo.OKビットがオンの場合、このACKセグメントにTimestampsオプション<TSval=my.TSclock,TSecr=TS.Recent>を含めます。Last.ACK.sentをSEG.ACKに設定し、ACKセグメントを送信します。確認応答を送信した後、受け入れられないセグメントを破棄して戻ります。
...
第五に、ACKフィールドをチェックします。
ACKビットがオフの場合、セグメントを破棄して戻ります。
ACKビットがオンの場合
...
ESTABLISHED STATE
SND.UNA < SEG.ACK =< SND.NXTの場合、SND.UNA <- SEG.ACKを設定します。また、ラウンドトリップタイムの新しい推定値を計算します。Snd.TS.OKビットがオンの場合、my.TSclock - SEG.TSecrを使用します。それ以外の場合、再送信キューの最初のセグメントが送信されてからの経過時間を使用します。それによって完全に確認される再送信キュー上のセグメント...
...
第七に、セグメントテキストを処理します。
ESTABLISHED STATE
FIN-WAIT-1 STATE
FIN-WAIT-2 STATE
...
次の形式の確認応答を送信します。
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
Snd.TS.OKビットがオンの場合、このACKセグメントにTimestampsオプション<TSval=my.TSclock,TSecr=TS.Recent>を含めます。Last.ACK.sentを確認応答のSEG.ACKに設定し、それを送信します。この確認応答は、過度の遅延を発生させずに可能であれば、送信されるセグメントにピギーバックされるべきです。
...