The transport layer is responsible for end-to-end communication and ensures reliable data transfer between devices. It performs several key functions, such as:
- **End-to-end delivery**: Ensuring that data is delivered from the sender to the receiver correctly and in sequence.
- **Recovery from packet losses** and **detection of duplicate packets**: The transport layer also ensures the reliability of data transmission by using mechanisms like acknowledgment, retransmission, and sequencing to handle lost or duplicated packets.
However, the primary function highlighted in the question, as described, is **end-to-end delivery**.
Step 2: Conclusion.
Thus, the correct answer is **(4) End to end delivery**.