Introduction
Imagine you are ending a phone call and want to make sure both sides hang up properly. In computer networks, closing a connection between two devices needs a careful process to avoid losing data or leaving the connection half-open.
Imagine two friends finishing a phone call. One says, 'I'm done talking,' and the other replies, 'Okay, I heard you.' Then the second friend says, 'I'm done too,' and the first friend replies, 'Got it, bye!' This way, both know the call ended properly.
Initiator Receiver | | |---- FIN ---------> | | | |<--- ACK ---------- | | | |<--- FIN ---------- | | | |---- ACK ---------> | | |