Zum Hauptinhalt springen

Appendix E. Event Processing (Ereignisverarbeitung)

Appendix E: Event Processing (Ereignisverarbeitung)

Event Processing (Ereignisverarbeitung)

OPEN Call (OPEN-Aufruf)

...
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>

...

Eine anfängliche Sendesequenznummer (ISS) wird ausgewählt. Senden Sie ein SYN-Segment der Form:

<SEQ=ISS><CTL=SYN><TSval=my.TSclock><WSopt=Rcv.Wind.Scale>

...

SEND Call (SEND-Aufruf)

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. ...

Wenn der fremde Socket angegeben ist, ändern Sie die Verbindung von passiv zu aktiv, wählen Sie eine ISS. Senden Sie ein SYN-Segment mit den Optionen: <TSval=my.TSclock> und <WSopt=Rcv.Wind.Scale>. Setzen Sie SND.UNA auf ISS, SND.NXT auf ISS+1. Wechseln Sie in den SYN-SENT-Zustand...

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 &lt;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).

Segmentieren Sie den Puffer und senden Sie ihn mit einer huckepack getragenen Bestätigung (Bestätigungswert = RCV.NXT)...

Wenn das dringende Flag gesetzt ist...

Wenn das Snd.TS.OK-Flag gesetzt ist, fügen Sie die TCP Timestamps-Option <TSval=my.TSclock,TSecr=TS.Recent> in jedes Datensegment ein.

Skalieren Sie das Empfangsfenster für die Übertragung im Segmentheader:

SEG.WND = (SND.WND >> Rcv.Wind.Scale).

SEGMENT ARRIVES (Segment kommt an)

...

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:

&lt;SEQ=ISS>&lt;ACK=RCV.NXT>&lt;CTL=SYN,ACK>

If the Snd.WS.OK bit is on, include a WSopt option
&lt;WSopt=Rcv.Wind.Scale> in this segment. If the Snd.TS.OK bit is
on, include a TSopt &lt;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.

...

Wenn der Zustand LISTEN ist, dann

zuerst auf RST prüfen

...

zweitens auf ACK prüfen

...

drittens auf SYN prüfen

wenn das SYN-Bit gesetzt ist, Sicherheit prüfen. Wenn das...

...

Wenn SEG.PRC kleiner als TCB.PRC ist, dann fortfahren.

Auf eine Window Scale-Option (WSopt) prüfen; wenn eine gefunden wird, speichern Sie SEG.WSopt in Snd.Wind.Scale und setzen Sie das Snd.WS.OK-Flag. Andernfalls setzen Sie sowohl Snd.Wind.Scale als auch Rcv.Wind.Scale auf Null und löschen Sie das Snd.WS.OK-Flag.

Auf eine TSopt-Option prüfen; wenn eine gefunden wird, speichern Sie SEG.TSval in der Variablen TS.Recent und schalten Sie das Snd.TS.OK-Bit ein.

Setzen Sie RCV.NXT auf SEG.SEQ+1, IRS wird auf SEG.SEQ gesetzt und alle anderen Steuerungen oder Texte sollten für die spätere Verarbeitung in die Warteschlange gestellt werden. ISS sollte ausgewählt und ein SYN-Segment der Form gesendet werden:

&lt;SEQ=ISS>&lt;ACK=RCV.NXT>&lt;CTL=SYN,ACK>

Wenn das Snd.WS.OK-Bit an ist, fügen Sie eine WSopt-Option <WSopt=Rcv.Wind.Scale> in dieses Segment ein. Wenn das Snd.TS.OK-Bit an ist, fügen Sie eine TSopt <TSval=my.TSclock,TSecr=TS.Recent> in dieses Segment ein. Last.ACK.sent wird auf RCV.NXT gesetzt.

SND.NXT wird auf ISS+1 und SND.UNA auf ISS gesetzt. Der Verbindungszustand sollte auf SYN-RECEIVED geändert werden. Beachten Sie, dass jede andere eingehende Steuerung oder Daten (kombiniert mit SYN) im SYN-RECEIVED-Zustand verarbeitet werden, aber die Verarbeitung von SYN und ACK sollte nicht wiederholt werden. Wenn das Listen nicht vollständig spezifiziert war (d.h. der fremde Socket war nicht vollständig spezifiziert), sollten die nicht spezifizierten Felder jetzt ausgefüllt werden.

fourth other text or control (viertens anderer Text oder Steuerung)

...

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:

&lt;SEQ=SND.NXT>&lt;ACK=RCV.NXT>&lt;CTL=ACK>

and send it. If the Snd.Echo.OK bit is on, include a TSopt
option &lt;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:

&lt;SEQ=ISS>&lt;ACK=RCV.NXT>&lt;CTL=SYN,ACK>

and send it. If the Snd.Echo.OK bit is on, include a TSopt
option &lt;TSval=my.TSclock,TSecr=TS.Recent> in this segment.

...

Wenn der Zustand SYN-SENT ist, dann

zuerst das ACK-Bit prüfen

...

viertens das SYN-Bit prüfen

...

Wenn das SYN-Bit an ist und Sicherheit/Compartment und Priorität akzeptabel sind, dann wird RCV.NXT auf SEG.SEQ+1 gesetzt, IRS wird auf SEG.SEQ gesetzt, und alle Bestätigungen in der Neuübertragungswarteschlange, die dadurch bestätigt werden, sollten entfernt werden.

Auf eine Window Scale-Option (WSopt) prüfen; wenn sie gefunden wird, speichern Sie SEG.WSopt in Snd.Wind.Scale; andernfalls setzen Sie sowohl Snd.Wind.Scale als auch Rcv.Wind.Scale auf Null.

Auf eine TSopt-Option prüfen; wenn eine gefunden wird, speichern Sie SEG.TSval in der Variablen TS.Recent und schalten Sie das Snd.TS.OK-Bit im Verbindungssteuerblock ein. Wenn das ACK-Bit gesetzt ist, verwenden Sie my.TSclock - SEG.TSecr als anfängliche RTT-Schätzung.

Wenn SND.UNA > ISS (unser SYN wurde bestätigt), ändern Sie den Verbindungszustand auf ESTABLISHED, bilden Sie ein ACK-Segment:

&lt;SEQ=SND.NXT>&lt;ACK=RCV.NXT>&lt;CTL=ACK>

und senden Sie es. Wenn das Snd.Echo.OK-Bit an ist, fügen Sie eine TSopt-Option <TSval=my.TSclock,TSecr=TS.Recent> in dieses ACK-Segment ein. Last.ACK.sent wird auf RCV.NXT gesetzt.

Daten oder Steuerungen, die für die Übertragung in die Warteschlange gestellt wurden, können enthalten sein. Wenn es andere Steuerungen oder Text im Segment gibt, fahren Sie mit der Verarbeitung beim sechsten Schritt unten fort, wo das URG-Bit geprüft wird, andernfalls kehren Sie zurück.

Andernfalls wechseln Sie zu SYN-RECEIVED, bilden Sie ein SYN,ACK-Segment:

&lt;SEQ=ISS>&lt;ACK=RCV.NXT>&lt;CTL=SYN,ACK>

und senden Sie es. Wenn das Snd.Echo.OK-Bit an ist, fügen Sie eine TSopt-Option <TSval=my.TSclock,TSecr=TS.Recent> in dieses Segment ein.

    If the Snd.WS.OK bit is on, include a WSopt option
&lt;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.

Wenn das Snd.WS.OK-Bit an ist, fügen Sie eine WSopt-Option <WSopt=Rcv.Wind.Scale> in dieses Segment ein. Last.ACK.sent wird auf RCV.NXT gesetzt.

Wenn es andere Steuerungen oder Text im Segment gibt, stellen Sie sie für die Verarbeitung nach Erreichen des ESTABLISHED-Zustands in die Warteschlange, kehren Sie zurück.

Fünftens, wenn weder das SYN- noch das RST-Bit gesetzt ist, dann verwerfen Sie das Segment und kehren Sie zurück.

Otherwise, (Andernfalls)

First, check sequence number (Zuerst Sequenznummer prüfen)

  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 &lt;&lt; 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 &lt; 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

Segmente werden in der Reihenfolge verarbeitet. Anfängliche Tests bei Ankunft werden verwendet, um alte Duplikate zu verwerfen, aber die weitere Verarbeitung erfolgt in SEG.SEQ-Reihenfolge. Wenn der Inhalt eines Segments die Grenze zwischen alt und neu überschreitet, sollten nur die neuen Teile verarbeitet werden.

Skalieren Sie das empfangene Fensterfeld neu:

TrueWindow = SEG.WND &lt;&lt; Snd.Wind.Scale,

und verwenden Sie "TrueWindow" anstelle von SEG.WND in den folgenden Schritten.

Prüfen Sie, ob das Segment eine Timestamps-Option enthält und das Bit Snd.TS.OK an ist. Wenn ja:

Wenn SEG.TSval < TS.Recent, dann testen Sie, ob die Verbindung weniger als 24 Tage inaktiv war; wenn beides wahr ist, dann ist das Segment nicht akzeptabel; folgen Sie den Schritten unten für ein nicht akzeptables Segment.

Wenn SEG.SEQ gleich Last.ACK.sent ist, dann speichern Sie SEG.ECopt in der Variablen 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):

&lt;SEQ=SND.NXT>&lt;ACK=RCV.NXT>&lt;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
&lt;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 &lt; SEG.ACK =&lt; SND.NXT then, set SND.UNA &lt;- 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:

&lt;SEQ=SND.NXT>&lt;ACK=RCV.NXT>&lt;CTL=ACK>

If the Snd.TS.OK bit is on, include Timestamps option
&lt;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.


...

Es gibt vier Fälle für den Akzeptanztest für ein eingehendes Segment:

...

Wenn ein eingehendes Segment nicht akzeptabel ist, sollte eine Bestätigung als Antwort gesendet werden (es sei denn, das RST-Bit ist gesetzt, wenn ja, verwerfen Sie das Segment und kehren Sie zurück):

&lt;SEQ=SND.NXT>&lt;ACK=RCV.NXT>&lt;CTL=ACK>

Last.ACK.sent wird auf SEG.ACK der Bestätigung gesetzt. Wenn das Snd.Echo.OK-Bit an ist, fügen Sie die Timestamps-Option <TSval=my.TSclock,TSecr=TS.Recent> in dieses ACK-Segment ein. Setzen Sie Last.ACK.sent auf SEG.ACK und senden Sie das ACK-Segment. Nach dem Senden der Bestätigung verwerfen Sie das nicht akzeptable Segment und kehren Sie zurück.

...

Fünftens das ACK-Feld prüfen.

wenn das ACK-Bit aus ist, verwerfen Sie das Segment und kehren Sie zurück.

wenn das ACK-Bit an ist

...

ESTABLISHED STATE

Wenn SND.UNA < SEG.ACK =< SND.NXT, dann setzen Sie SND.UNA <- SEG.ACK. Berechnen Sie auch eine neue Schätzung der Rundlaufzeit. Wenn das Snd.TS.OK-Bit an ist, verwenden Sie my.TSclock - SEG.TSecr; andernfalls verwenden Sie die verstrichene Zeit seit dem Senden des ersten Segments in der Neuübertragungswarteschlange. Alle Segmente in der Neuübertragungswarteschlange, die dadurch vollständig bestätigt werden...

...

Siebtens den Segmenttext verarbeiten.

ESTABLISHED STATE
FIN-WAIT-1 STATE
FIN-WAIT-2 STATE

...

Senden Sie eine Bestätigung der Form:

&lt;SEQ=SND.NXT>&lt;ACK=RCV.NXT>&lt;CTL=ACK>

Wenn das Snd.TS.OK-Bit an ist, fügen Sie die Timestamps-Option <TSval=my.TSclock,TSecr=TS.Recent> in dieses ACK-Segment ein. Setzen Sie Last.ACK.sent auf SEG.ACK der Bestätigung und senden Sie es. Diese Bestätigung sollte huckepack auf einem zu übertragenden Segment mitgeführt werden, wenn möglich ohne übermäßige Verzögerung.

...