Aller au contenu principal

Implémentation du TCP (partie 1)

4.1 INTRODUCTION​

Sur le plan conceptuel, le TCP se compose de plusieurs processus. Certains traitent les commandes UTILISATEUR/TCP, d'autres les paquets arrivant du réseau. Le TCP dispose également d'une fonction de mesure interne qui peut être activée à distance.

Un TCP donné peut être envisagé de plusieurs façons. Il pourrait être implémenté comme un processus indépendant desservant de nombreux processus utilisateurs. Il pourrait être vu comme un ensemble de routines de bibliothèque réentrantes partageant une interface commune avec le PSN local et un stockage tampon commun. Il pourrait même être vu comme un ensemble de processus, certains s'occupant de l'utilisateur, d'autres de l'entrée des paquets en provenance du réseau, et d'autres encore de la sortie des paquets vers le réseau.

4.2 STRUCTURES DE DONNÉES DU TCP​

4.2.1 FORMAT DU PAQUET INTER-RÉSEAUX​

8 bits: Internet information

   2 bits: Reserved for local PSN use

   2 bits: Header format (11 in binary)

   4 bits: Protocol version number

8 bits: Header length in octets (32 is the current value)

16 bits: Length of text in octets

32 bits: Packet sequence number

32 bits: Acknowledgment number (i.e. sequence number of next octet
expected).

16 bits: Window size (in octets)

16 bits: Control Information

   Listed from high to low order:

   SYN: Request to synchronize sending sequence numbers

   ACK: There is a valid acknowledgment in the 32 bit ACK field

   FIN: Sender will stop SENDing and RECEIVEing on this connection

   DSN: The sender has stopped using sequence numbers and wants to
   initiate a new sequence number for sending.

   EOS: This packet is the end of a segment and therefore has a
   checksum in the 16 bit checksum field. If this bit is not set, the
   16 bit checksum field is to be ignored. The bit is usually set,
   but if fragmentation at a GATEWAY occurs, the packets preceding
   the last one will not have checksums, and the last packet will
   have the checksum for the entire original fragment (segment) as it
   was calculated by the sending TCP.

   EOL: This packet contains the last fragment of a letter. The EOS
   bit will always be set in this case.

   INT: The sender wants to INTERRUPT on this connection.

   XXX: six (6) unused control bits

   OD: three (3) bits of control dispatch:

      000: Null (the control octet contents should be ignored}

      001: Event Code is present in the control octet. These were
      defined in section 2.4.3.

      010: Special Functions

      011: Reject (codes as yet undefined)

      1XX: Unused

8 bits: Control Data Octet

   If CD is 000 then this octet is to be ignored.

   If CD is 001, this octet contains event codes defined in section
   2.4.3

   If CD is 010, this octet contains a special function code as
   defined below:

      0: RESET all connections between Source and Destination TCPs

      l: RESET the specific connection referenced in this packet

      2: ECHO return packet to sender with the special function code
      ECHOR (Echo Reply).

      3: QUERY Query status of connection referenced in this packet

      4: STATUS Reply to QUERY with requested status.

      5: ECHOR Echo Reply

      6: TRASH Discard packet without acknowledgment

      >6: Unused

      Note: Special function packets not pertaining to a particular
      connection [RESET all, ECHO, ECHOR, and TRASH] are normally
      sent using socket zero as described in section 3.2.

   If CD is 01l, this octet contains an as yet undefined REJECT code.

   If CD is 1XX, this octet is undefined.

4 bits: Length of destination network address in 4 bit units (current
value is 1)

4 bits: Destination network address

   1010-1111 are addresses of ARPANET, UCL, CYCLADES, NPL, CADC, and
   EPSS respectively.

16 bits: Destination TCP address

8 bits: Padding

4 bits: length of source network address in 4 bit units (current
value is 1)

4 bits: source network address (as for destination address)

16 bits: Source TCP address

24 bits: Destination port address

24 bits: Source port address

16 bits: Checksum (if EOS bit is set)