Transport Layer Protocols.

Functions of Transport Layer.

A transport layer protocol provides for logical connection between application processes running on different hosts.

A network layer protocol provides for logical connection between hosts.

Example about two houses (families exchanging letters).

Multiplexing and demultiplexing (port numbers). Well known port numbers (old version) and new one.

User Datagram Protocol.

Advantages

 Application   A.L. Protocol   T.L. Protocol 
E-mail SMTP TCP
Remote terminal Telnet TCP
Web HTTP TCP
File transfer FTP TCP
Remote file server NFS typically UDP
Streaming multimedia proprietary typically UDP
Internet telephony proprietary typically UDP
Network management SNMP typically UDP
Routing protocol RIP typically UDP
Name service DNS typically UDP

UDP segment (datagram).

 
Source port number
(UDP service ID for sender of this packet)
Destination port number
(UDP service ID for receiver of this packet)
UDP packet length
(byte length includes UDP header and data)
UDP checksum
(UDP header and data and portions of IP header included)
...  Data
...  Data

For official description of UDP see RFC-768.