what is the function of transport layer in tcp ip
Transport layer In computer networking, the transport layer is a conceptual division of methods in the layered architecture of protocols in the network stack in the Internet Protocol Suite and the Open Systems Interconnection (OSI) reference model. The protocols of this layer provide host-to-host communication services for applications.[1] It provides services such as connection-oriented communication, reliability, flow control, and multiplexing.
Encapsulation (networking) In computer networking, encapsulation is a method of designing modular communication protocols in which logically separate functions in the network are abstracted from their underlying structures by inclusion or information hiding within higher level objects.