# Handshaking Protocol¶

(c) Tobias Hossfeld (Aug 2021)

This script and the figures are part of the following book. The book is to be cited whenever the script is used (copyright CC BY-SA 4.0):
Tran-Gia, P. & Hossfeld, T. (2021). Performance Modeling and Analysis of Communication Networks - A Lecture Note. Würzburg University Press. https://doi.org/10.25972/WUP-978-3-95826-153-2

A sender sends messages to a receiver in the form of packets. According to a handshaking protocol, packets received without errors are acknowledged with a positive message (ACK: positive acknowledgment). If the transmission is incorrect, the recipient sends a negative acknowledgment (NAK: negative acknowledgment), whereupon the sender repeats the transmission of the corresponding packet. The process is repeated until the packet arrives at the receiver without any errors. Then, the next packet can be transmitted from sender to receiver. This simple handshaking protocol only allows a single packet to currently move over the communication channel. The packet transmission time is indicated by $T_N$ and the signal propagation delay from sender to receiver and back (round-trip time) is denoted by $\tau$. To model the handshaking protocol, the virtual transmission time $T_V$ of a packet is determined first. The virtual transmission time is defined as the time actually required for the successful transmission of a packet. Let us assume a packet error probability $p_B$ for any packet and that the error events are independent of one another. After a single transfer process, the transmission is successful with probability $1 - p_B$ and we obtain $T_V = T_N + \tau$. With probability $p_B$ the transmission is repeated, and $T_V$ is increased by the time for a single (re-)transmission $T_N + \ \tau$.

## Mean Sojourn Time¶

Now, we consider that the packets are buffered and transmitted in a FIFO manner. We assume that the packets arrive according to a Poisson process with rate $\lambda$. The system is denoted as M/GI/1 delay system. The communication channel is occupied for the virtual transmission time $T_V$ with $R$ indicating the number of retransmissions of a packet. $R$ is a random variable (r.v.). Hence, the virtual transmission time (r.v.) reflects the service time of the system:

$T_V = (R+1)\cdot (T_N+\tau)$

The mean virtual transmission time is

$E[T_V] = \frac{T_N+\tau}{1-p_B}$

and the coefficient of variation of the virtual transmission time is

$c_{T_V} = {\sqrt{p_B}}$

The utilization of the system is

$\rho = \lambda \cdot E[T_V]$

which must $\rho<1$ for a stable system (otherwise overload).

Then, mean waiting time of the M/GI/1 delay system, see Chapter 5 (Tran-Gia & Hossfeld, 2021):

$E[W] = E[T_V] \frac{\rho(1+c_{T_V}^2)}{2(1-\rho)} = (T_N+\tau) \cdot \frac{1+p_B}{1-p_B} \cdot \frac{\rho}{2(1-\rho)}$