---
title: Transport Control Protocol (TCP)
author: Carl Kittelberger

papersize: a4
classoption: oneside
mainfont: Arial
sansfont: Arial

header-includes:
  - \usepackage{longtable}
---

TCP ist ein *Layer-4-Protokoll*. Es addressiert Anwendungen über **Ports**.

- *reliable* -- zuverlässig
- *connection oriented* -- verbindungsorientiert

Die folgenden Phasen werden in dieser Reihenfolge ausgeführt:

# Verbindungsaufbau

```commute
% this needs to be integrated with https://github.com/sdiehl/cats

\node[] (server) {server};
\node[left = of server] (client) {client};

\node[below of=server, node distance=5cm] (server_ground) {};
\node[below of=client, node distance=5cm] (client_ground) {};

\draw (client) -- (client_ground);
\draw (server) -- (server_ground);
\draw[->] ([yshift=-1cm]client.south) -- ([yshift=-1cm]server.south) node[above] {syn};
\draw[->] ([yshift=-2cm]server.south) -- ([yshift=-2cm]client.south) node[above] {ack+syn};
\draw[->] ([yshift=-3cm]client.south) -- ([yshift=-3cm]server.south) node[above] {ack};
```

# Datenaustausch

```commute
% this needs to be integrated with https://github.com/sdiehl/cats

\node[] (server) {server};
\node[left = of server] (client) {client};

\node[below of=server, node distance=5cm] (server_ground) {};
\node[below of=client, node distance=5cm] (client_ground) {};

\draw (client) -- (client_ground);
\draw (server) -- (server_ground);
\draw[->] ([yshift=-1cm]client.south) -- ([yshift=-1cm]server.south) node[above] {ack: Sequence Number, Datenlänge};
\draw[->] ([yshift=-2cm]server.south) -- ([yshift=-2cm]client.south) node[above] {ack: Acknowledgement Number};
\draw[->] ([yshift=-3cm]client.south) -- ([yshift=-3cm]server.south) node[above] {ack: Sequence Number...};
```
