So far we have seen how arbitrary hosts communicate with each other. The unit of transfer in this layer is the UDP datagram , and the destination is an input within a host. A UDP datagram is embedded in the data field of the Internet datagram, and contains its own header and data areas. The UDP header identifies the destination port and a reply port.
Appropriate software distributes the datagrams reaching a host onto the queues of appropriate ports.
Often processes require a communication protocol that provides reliable delivery. To support reliable delivery, each packet is acknowledged. The answer is that the ack is not acked. Instead, if the sender does not send the ack within some transmission period, T, it retransmits the packet, and repeats the process till it gets the ack. After a certain number of tries, the sender gives up and closes the connection.