Aller au contenu principal

Appendix E. Event Processing (Traitement des événements)

Appendix E: Event Processing (Traitement des événements)

Event Processing (Traitement des événements)

OPEN Call (Appel 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>

...

Un numéro de séquence d'envoi initial (ISS) est sélectionné. Envoyer un segment SYN de la forme:

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

...

SEND Call (Appel 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. ...

Si le socket étranger est spécifié, alors changer la connexion de passive à active, sélectionner un ISS. Envoyer un segment SYN contenant les options: <TSval=my.TSclock> et <WSopt=Rcv.Wind.Scale>. Définir SND.UNA à ISS, SND.NXT à ISS+1. Entrer dans l'état 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 &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).

Segmenter le tampon et l'envoyer avec un accusé de réception piggyback (valeur d'accusé de réception = RCV.NXT)...

Si le flag urgent est défini...

Si le flag Snd.TS.OK est défini, alors inclure l'option TCP Timestamps <TSval=my.TSclock,TSecr=TS.Recent> dans chaque segment de données.

Mettre à l'échelle la fenêtre de réception pour la transmission dans l'en-tête du segment:

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

SEGMENT ARRIVES (Arrivée de segment)

...

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.

...

Si l'état est LISTEN alors

d'abord vérifier un RST

...

deuxièmement vérifier un ACK

...

troisièmement vérifier un SYN

si le bit SYN est défini, vérifier la sécurité. Si le...

...

Si le SEG.PRC est inférieur au TCB.PRC alors continuer.

Vérifier une option Window Scale (WSopt); si une est trouvée, sauvegarder SEG.WSopt dans Snd.Wind.Scale et activer le flag Snd.WS.OK. Sinon, définir à la fois Snd.Wind.Scale et Rcv.Wind.Scale à zéro et effacer le flag Snd.WS.OK.

Vérifier une option TSopt; si une est trouvée, sauvegarder SEG.TSval dans la variable TS.Recent et activer le bit Snd.TS.OK.

Définir RCV.NXT à SEG.SEQ+1, IRS est défini à SEG.SEQ et tout autre contrôle ou texte devrait être mis en file d'attente pour traitement ultérieur. ISS devrait être sélectionné et un segment SYN envoyé de la forme:

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

Si le bit Snd.WS.OK est activé, inclure une option WSopt <WSopt=Rcv.Wind.Scale> dans ce segment. Si le bit Snd.TS.OK est activé, inclure une TSopt <TSval=my.TSclock,TSecr=TS.Recent> dans ce segment. Last.ACK.sent est défini à RCV.NXT.

SND.NXT est défini à ISS+1 et SND.UNA à ISS. L'état de connexion devrait être changé à SYN-RECEIVED. Notez que tout autre contrôle ou données entrant (combiné avec SYN) sera traité dans l'état SYN-RECEIVED, mais le traitement de SYN et ACK ne devrait pas être répété. Si le listen n'a pas été entièrement spécifié (c'est-à-dire, le socket étranger n'a pas été entièrement spécifié), alors les champs non spécifiés devraient être remplis maintenant.

fourth other text or control (quatrièmement autre texte ou contrôle)

...

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.

...

Si l'état est SYN-SENT alors

d'abord vérifier le bit ACK

...

quatrièmement vérifier le bit SYN

...

Si le bit SYN est activé et que la sécurité/compartiment et la précédence sont acceptables alors, RCV.NXT est défini à SEG.SEQ+1, IRS est défini à SEG.SEQ, et tous les accusés de réception sur la file d'attente de retransmission qui sont ainsi accusés devraient être supprimés.

Vérifier une option Window Scale (WSopt); si elle est trouvée, sauvegarder SEG.WSopt dans Snd.Wind.Scale; sinon, définir à la fois Snd.Wind.Scale et Rcv.Wind.Scale à zéro.

Vérifier une option TSopt; si une est trouvée, sauvegarder SEG.TSval dans la variable TS.Recent et activer le bit Snd.TS.OK dans le bloc de contrôle de connexion. Si le bit ACK est défini, utiliser my.TSclock - SEG.TSecr comme estimation RTT initiale.

Si SND.UNA > ISS (notre SYN a été acquitté), changer l'état de connexion à ESTABLISHED, former un segment ACK:

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

et l'envoyer. Si le bit Snd.Echo.OK est activé, inclure une option TSopt <TSval=my.TSclock,TSecr=TS.Recent> dans ce segment ACK. Last.ACK.sent est défini à RCV.NXT.

Les données ou contrôles qui ont été mis en file d'attente pour transmission peuvent être inclus. S'il y a d'autres contrôles ou texte dans le segment alors continuer le traitement à la sixième étape ci-dessous où le bit URG est vérifié, sinon retourner.

Sinon entrer dans SYN-RECEIVED, former un segment SYN,ACK:

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

et l'envoyer. Si le bit Snd.Echo.OK est activé, inclure une option TSopt <TSval=my.TSclock,TSecr=TS.Recent> dans ce segment.

    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.

Si le bit Snd.WS.OK est activé, inclure une option WSopt <WSopt=Rcv.Wind.Scale> dans ce segment. Last.ACK.sent est défini à RCV.NXT.

S'il y a d'autres contrôles ou texte dans le segment, les mettre en file d'attente pour traitement après que l'état ESTABLISHED ait été atteint, retourner.

cinquièmement, si ni le bit SYN ni le bit RST n'est défini alors rejeter le segment et retourner.

Otherwise, (Sinon)

First, check sequence number (D'abord, vérifier le numéro de séquence)

  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

Les segments sont traités en séquence. Les tests initiaux à l'arrivée sont utilisés pour rejeter les anciens duplicata, mais le traitement ultérieur est effectué dans l'ordre SEG.SEQ. Si le contenu d'un segment chevauche la limite entre ancien et nouveau, seules les nouvelles parties devraient être traitées.

Remettre à l'échelle le champ de fenêtre reçu:

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

et utiliser "TrueWindow" à la place de SEG.WND dans les étapes suivantes.

Vérifier si le segment contient une option Timestamps et si le bit Snd.TS.OK est activé. Si oui:

Si SEG.TSval < TS.Recent, alors tester si la connexion a été inactive moins de 24 jours; si les deux sont vrais, alors le segment n'est pas acceptable; suivre les étapes ci-dessous pour un segment non acceptable.

Si SEG.SEQ est égal à Last.ACK.sent, alors sauvegarder SEG.ECopt dans la variable 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.


...

Il y a quatre cas pour le test d'acceptabilité pour un segment entrant:

...

Si un segment entrant n'est pas acceptable, un accusé de réception devrait être envoyé en réponse (à moins que le bit RST ne soit défini, si oui rejeter le segment et retourner):

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

Last.ACK.sent est défini au SEG.ACK de l'accusé de réception. Si le bit Snd.Echo.OK est activé, inclure l'option Timestamps <TSval=my.TSclock,TSecr=TS.Recent> dans ce segment ACK. Définir Last.ACK.sent à SEG.ACK et envoyer le segment ACK. Après l'envoi de l'accusé de réception, rejeter le segment non acceptable et retourner.

...

cinquièmement vérifier le champ ACK.

si le bit ACK est désactivé rejeter le segment et retourner.

si le bit ACK est activé

...

ESTABLISHED STATE

Si SND.UNA < SEG.ACK =< SND.NXT alors, définir SND.UNA <- SEG.ACK. Aussi calculer une nouvelle estimation du temps aller-retour. Si le bit Snd.TS.OK est activé, utiliser my.TSclock - SEG.TSecr; sinon utiliser le temps écoulé depuis que le premier segment dans la file d'attente de retransmission a été envoyé. Tous les segments sur la file d'attente de retransmission qui sont ainsi entièrement accusés...

...

Septièmement, traiter le texte du segment.

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

...

Envoyer un accusé de réception de la forme:

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

Si le bit Snd.TS.OK est activé, inclure l'option Timestamps <TSval=my.TSclock,TSecr=TS.Recent> dans ce segment ACK. Définir Last.ACK.sent au SEG.ACK de l'accusé de réception, et l'envoyer. Cet accusé de réception devrait être piggybacké sur un segment en cours de transmission si possible sans encourir de retard indu.

...