Layer 4 of the OSI model known as OSI Transport Layer prepares application data for transport over network and processes network data for use by application. The transport layer makes multiple applications on single application at the same time to communicate over the network. If required this layer ensure reliable transfer of the data. Beside that this layer employs error handling mechanisms for data, tracking individual conversations, segmentation, desegmentation and identifying applications.
Typical examples of the OSI transport layer are the TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). TCP described in RFC 793 is a connection oriented protocol. TCP has additional function such flow control, reliable delivery and same order delivery. TCP segment add 20 bytes in the header encapsulating to gain its function. Applications that use TCP protocol such web browser, email, file transfers. UDP described in RFC 768 is connectionless protocol. The datagrams are the pieces of communication in UDP and sent as “best effort”. Applications that use UDP protocol such DNS (Domain Name System), video streaming, and VoIP (Voice over IP).
To identify the proper application OSI Transport layer both UDP and TCP have header field that use unique identifiers call port numbers. The IANA assign port numbers. Different types of port numbers known as well known ports (0 -1023): reserved for service and application. Registered Port (1024-49151): assigned to user processes or application. Dynamic Port (49152-65535):assigned dynamically to client application when initiating a connection.