Detail Look at TCP/IP
Transmission Control Protocol/Internet Protocol (TCP/IP) is the best known and most popular protocol suite used today. Its ease of use and commonality are two of the biggest reasons for the Internet explosion.
TCP/IP offers reliable connection-based packet transfer as well as unreliable, connectionless transfers.
TCP is a connection-oriented, reliable protocol responsible for breaking messages into segments and reassembling them at the destination station. (It also resends packets not received at the destination.) TCP also provides virtual circuits between applications.
A connection-oriented protocol establishes and maintains a connection during a transmission. The protocol must establish the connection prior to sending data. After the data transfer is complete, the session is torn down.
User Datagram Protocol (UDP) is an unreliable, connectionless protocol. Although “unreliable” might have a negative connotation, in cases where real-time data is exchanged (such as a voice conversation), taking the time to set up a connection and resend dropped packets can cause more harm than good.
End points in TCP/IP are identified by IP addresses. IP addressing is covered later in this chapter.
TCP/IP Datagrams
TCP/IP sends information via datagrams. A single message might break up into a series of datagrams to be reassembled at their destination. The TCP/IP protocol stack has three layers:
- Application layer'This layer specifies protocols for e-mail, file transfer, remote login, and other applications. It also supports network management.
- Transport layer'This layer lets multiple upper- layer applications use the same data stream. TCP and UDP provide flow control and reliability.
- Network layer'Protocols operating at this layer include IP, Internet Control Message Protocol (ICMP), Address Resolution Protocol (ARP), and Reverse Address Resolution Protocol (RARP).
IP provides connectionless, best-effort routing of datagrams.
TCP/IP hosts use ICMP to carry error and control messages with IP datagrams.
ARP allows communication on a multi-access medium such as Ethernet by mapping known IP addresses to Media Access Control (MAC) sublayer addresses.
RARP maps a known MAC address to an IP address.
Dynamic Host Configuration Protocol (DHCP) is a modern implementation of RARP.
How TCP Connections Are Established
End stations exchange control bits called SYN (for synchronize) and Initial Sequence Numbers (ISN) to synchronize while establishing a connection. TCP/IP uses a three-way handshake to establish connections.
To synchronize the connection, each side sends its own ISN and expects to receive a confirmation of it in an acknowledgment (ACK) from the other side. The figure shows an example.
TCP Windowing
Windowing is a mechanism that sends the maximum amount of packets without overwhelming an end station with data that it cannot process (thus dropping packets).
The window size from one end station informs the other side of the connection how much it can accept at one time. When a window size is one, each segment must be acknowledged before another segment is sent. This size makes the least efficient use of bandwidth. This figure shows a windowing example.
UDP
UDP is a connectionless, unreliable Layer 4 protocol. Unreliable in this sense means that the protocol does not ensure that every packet reaches its destination. UDP is used for applications that provide their own error-recovery process or when retransmission does not make sense. UDP is simple and efficient, trading reliability for speed.
Why not resend? It might not be obvious why you would not resend dropped packets if you had the option to do so. However, receiving old packets out of order disrupts real-time applications such as voice and video. Such applications are usually capable of masking the dropped packets as long as they account for a small percentage of the total.
Port Numbers
Two hosts can have multiple conversations between each other using different upper-layer applications. Port numbers differentiate each conversation (or session) between the hosts. Port numbers (also called socket numbers) keep track of different conversations crossing the network at any given time. The Internet Assigned Numbers Authority (lANA) controls some of the more well-known port numbers. For example, port 23 is always Telnet. Applications that do not use well-known port numbers have them randomly assigned from a specific range.