关于TCP的Total Length
随便找了个发送的TCP:
70 89 cc ee 84 2c 3c 2c 30 a6 a2 d0 08 00 45 00
00 4c c7 a8 40 00 80 06 00 00 c0 a8 01 06 31 eb
6b da b6 ef 0e 96 37 84 39 60 e1 c5 ad 22 50 18
ff ff 5f b2 00 00 ->54 4c 42 42 30 31 d5 01 18 00 00
2c 0b 84 80 58 0e 03 00 00 00 71 71 71 00 ff ff ff
ff 01 00 00 00 00 00 00
分解下每个部分
// Ethernet header
70 89 cc ee 84 2c 3c 2c 30 a6 a2 d0 08 00
// IP header
45 00 00 4c c7 a8 40 00 80 06 00 00 c0 a8 01 06 31 eb 6b da
// TCP header
b6 ef 0e 96 37 84 39 60 e1 c5 ad 22 50 18 ff ff 5f b2 00 00
// DATA
54 4c 42 42 30 31 d5 01 18 00 00 2c 0b 84 80 58 0e 03 00 00 00 71 71 71 00 ff ff ff ff 01 00 00 00 00 00 00
Total Length怎么来的的?
- IP header + TCP header + DATA = 76