
To perform error recovery, TCP uses a TCP header in front of
the user data. Notice that Figure 3-6
shows some rectangles, beginning with the words "TCP Header," followed by "User
Data." A header is a bunch of overhead
bits added to the user data so that a protocol can do its job. For instance, to
perform error recovery, TCP needs to number the packets. To number the packets,
TCP needs a place to put the number, so TCP puts the number, called a sequence number, in the TCP
header. The TCP header is part of the packet that is sent across the network.
TCP also defines a part of the header to hold the
acknowledgment number. TCP uses the acknowledgment
number field in the header to tell the sender which packets had
errors. Notice that Fred sets the acknowledgment number in the packets he sends
back to Wilma. The acknowledgment number lists the next packet Fred expects to
receive; for example, when Fred shows an acknowledgment value of 2, it means
that he got number 1 and expects to get number 2 next. That's how Wilma knows to
send packet number 2 again. This process of referring to the next expected
packet, rather than listing the last received packet, is called forward acknowledgment.
This example scratches the surface of what TCP defines. In
addition to checking out Chapter 9 of
this book, you can retrieve the TCP RFC free from http://www.ietf.org. Just click the
RFC Pages link and search for RFC 793.