ection by a three-way handshake, when first host sends a flag of end of transmission and the second host replies with a segment containing the same flag and a suitable acknowledgment. At this point the first host replies with an acknowledgment. This is perhaps the most common method to tear down a connection. It is possible for both hosts to send end of transmission flags simultaneously then both just have to acknowledge. 3.2.3.2 Transport Layer: User Datagram Protocol UDP is the second used transport protocol in the Internet; UDP applications use datagram sockets to establish host-to-host communications. Sockets bind the application to service ports that function as the endpoints of data transmission. A port is a software structure that is identified by the port number, a 16 bit integer value, allowing for port numbers between 0 and 65,535. Telecommunication Networks 16-31 Source port Destination port Length Checksum FIGURE 3.24 UDP header content. UDP provides no guarantees to the upper layer for message delivery and retains no state of messages once sent. UDP provides application multiplexing (via port numbers) and integrity verification (via checksum) of the header and payload. If transmission reliability is desired, it must be implemented in the user's application. The scheme of the UDP header is shown in Figure 3.24. The UDP header consists of four fields. 1. Source port: This field identifies the sending port when meaningful and should be assumed to be the port to reply to if needed. If not used, then it should be zero. 2. Destination port: This field identifies the destination port. 3. Length: A 16 bit field that specifies the length in bytes of the entire datagram: header and data. The minimum length is 8 bytes since that is the length of the header. The field size sets a theoretical limit of 65,535 bytes (8 byte header + 65,527 bytes of data) for a UDP datagram. 4. Checksum: The 16 bit checksum field is used for error-checking of the header and data. Due to its extreme original simplicity, UDP has been 