Answer the question
In order to leave comments, you need to log in
How is checksum calculated in TCP?
According to the documentation, it seems like every 2 bytes are added starting from the addresses, but something does not converge
https://tools.ietf.org/html/rfc793
Answer the question
In order to leave comments, you need to log in
You didn't read this part:
The checksum also covers a 96 bit pseudo header conceptually
prefixed to the TCP header. This pseudo header contains the Source
Address, the Destination Address, the Protocol, and TCP length.
This gives the TCP protection against misrouted segments. This
information is carried in the Internet Protocol and is transferred
across the TCP/Network interface in the arguments or results of
calls by the TCP on the IP.
+--------+--------+--------+--------+
| source address |
+--------+--------+--------+--------+
| Destination Address |
+--------+--------+--------+--------+
| zero | PTCL | TCP length |
+--------+--------+--------+--------+
The TCP Length is the TCP header length plus the data length in
octets (this is not an explicitly transmitted quantity, but is
computed), and it does not count the 12 octets of the pseudo
header.
You need to add pseudo-header data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question