# Transmission Control Protocol Simulator
(Client-Server)

## Protocol Description

TCP (Transmission Control Protocol) is a connection-oriented protocol for transferring data reliably in either direction between a pair of users. TCP is described and in Sections 6.4.1 to 6.4.5 of [Tanenbaum 1996]. TCP is a rather complex protocol, so it is easy to lose track of the simulation. Try not to do anything too complicated! There is a peer-peer version as an alternative to this client-server simulation.

The protocol simulation shows a time-sequence diagram with a client and a server, protocol entities A and B that support them, and a communications medium that carries messages. The server initially passively opens (waits) for a connection. The client may actively open a connection to the waiting server. After a connection has been made, the client and the server may send data messages to each other.

Users simply send messages of a fixed size; the content of messages is not identified. Depending on the medium maximum packet size, messages may be sent as a number of fragments. Data transfer is also subject to the current window size of the receiver, and may be held up if the receiver's window becomes full.

To open a connection, a message is sent with the SYN flag. To close a connection, a message is sent with the FIN flag. Urgent messages may also be sent by selecting the PUSH flag as a protocol parameter.

Messages may contain a send sequence number (the offset of where the message starts in the user's byte stream), an acknowledgement sequence number (the offset of the next byte expected), and the current window (how many bytes can be received).

TCP is rather complex, so the simulation does not attempt to faithfully reflect all its details. Although the main paths should work as expected, it is possible to get the simulation into unusual states in which it does not behave correctly.

## Protocol Simulation Parameters

User A Message Size |  | User A Push Flag |  | Protocol A Receive Window |
User B Message Size |  | User B Push Flag |  | Protocol B Receive Window |
Medium Maximum Packet Size |  |  |