Skip to Main Content
Internet Core Protocols: The Definitive Guide
book

Internet Core Protocols: The Definitive Guide

by Eric Hall
February 2000
Intermediate to advanced content levelIntermediate to advanced
464 pages
15h 57m
English
O'Reilly Media, Inc.
Content preview from Internet Core Protocols: The Definitive Guide

TCP checksums

TCP checksums are identical to UDP checksums, with the exception that checksums are mandatory with TCP (instead of being optional, as they are with UDP). Furthermore, their usage is mandatory for both the sending and receiving systems. RFC 1122 clearly states that the receiver must validate every segment received, using the checksum to verify that the contents of the segment are correct before delivering it to the destination application.

Checksums provide a valuable service in that they verify that data has not been corrupted in transit. All of the other reliability services provided by TCP—the sequence numbers, acknowledgments, and timers—serve only to ensure that segments arrive at their destination; checksums make sure the data inside the segments arrives intact.

Checksums are calculated by performing ones-complement math against the header and data of the TCP segment. Also included in this calculation is a " pseudo-header” that contains the source and destination IP addresses, the Protocol Identifier (6 for TCP), and the size of the TCP segment (including the TCP headers and data). By including the pseudo-header in the calculations, the destination system is able to validate that the sender and receiver information is also correct, in case the IP datagram that delivered the TCP segment got mixed up on the way to its final destination.

TCP must validate the checksum before issuing an acknowledgment for the segment. If a segment is received with an invalid checksum, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Packet Guide to Core Network Protocols

Packet Guide to Core Network Protocols

Bruce Hartpence
Ethernet: The Definitive Guide, 2nd Edition

Ethernet: The Definitive Guide, 2nd Edition

Charles E. Spurgeon, Joann Zimmerman

Publisher Resources

ISBN: 1565925726Supplemental ContentErrata Page