is assigned to the client and is used to keep track of user sessions. The combination of port number and IP address is called a socket. The destination port is used to route packets on a server to the appropriate net- work application. On servers, port numbers identify running applications that are waiting for incoming connections from clients. Port numbers distinguish one lis- tening application from another. Numbers between 1 and 1,023 are reserved for well-known server applications (e.g., Web servers run on port 80, FTP runs on port 21). Also, many recent protocols have been assigned well-known port num- bers above 1,023. Ports with higher numbers, called ephemeral ports, are dynami- cally assigned to client applications as needed. A client obtains a random ephemeral port when it opens a connection to a well-known server port. Firewalls can use port numbers and IP addresses to control the flow of information. (Fire- walls are discussed in Chapter 9, "IP Services.") Internet Basics TCP is the protocol for sequenced and reliable data transfer. It breaks the data into pieces and numbers each piece SO that the receipt can be verified and the data can be put back in the proper order. TCP provides Layer 4 functionality, and it is responsible for virtual circuit setup, acknowledgments, flow control, and retrans- mission of lost or damaged data. TCP provides end-to-end, connection-oriented, reliable, virtual circuit service. Like TCP, UDP is a Layer 4 (transport layer) protocol that operates over IP. UDP provides end-to-end, connectionless, unreliable datagram service. It is well suited for query/response applications, for multicasting, and for use with Voice over IP (VoIP). (VoIP is discussed in Chapter 9.) Because UDP does not request retrans- missions, it minimizes what would otherwise be unmanageable delay; the result is that sometimes the quality is not very good. For instance, if you encounter losses or errors associated with a voice packet, the delays that would be associated with retransmitting that packet wou