TCP-Implementierung (Teil 1)
4.1 EINLEITUNG
Konzeptionell besteht das TCP aus mehreren Prozessen. Einige davon befassen sich mit BENUTZER/TCP-Befehlen, andere mit aus dem Netzwerk eintreffenden Paketen. Das TCP verfügt außerdem über eine interne Messeinrichtung, die aus der Ferne aktiviert werden kann.
Ein bestimmtes TCP lässt sich auf verschiedene Weise auffassen. Es könnte als eigenständiger Prozess implementiert sein, der viele Benutzerprozesse bedient. Es könnte als eine Menge wiedereintrittsfähiger Bibliotheksroutinen betrachtet werden, die eine gemeinsame Schnittstelle zum lokalen PSN und einen gemeinsamen Pufferspeicher teilen. Es könnte sogar als eine Menge von Prozessen aufgefasst werden, von denen einige den Benutzer bedienen, einige die Eingabe von Paketen aus dem Netz und einige die Ausgabe von Paketen an das Netz.
4.2 TCP-DATENSTRUKTUREN
4.2.1 FORMAT DES INTERNETWORK-PAKETS
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)