我正在测试 tcpdump 以查看 HAProxy 服务器和 mariadb 服务器之间的流量。结果如下:
23:07:22.328958 00:0c:29:a9:28:a8 > 00:50:56:b0:e0:ea, ethertype IPv4 (0x0800), length 66: (tos 0x0, ttl 64, id 62140, offset 0, flags [DF], proto TCP (6), length 52)
172.24.2.51.46370 > 172.24.2.41.9200: Flags [.], cksum 0xcf6a (incorrect), seq 2091233458, ack 1346328093, win 229, options [nop,nop,TS val 2961588746 ecr 287872844], length 0
0x0000: 4500 0034 f2bc 4000 4006 e966 ac18 033d E..4..@[email protected]...=
0x0010: ac18 0333 b522 23f0 7ca5 b0b2 503f 561d ...3."#.|...P?V.
0x0020: 8010 00e5 cf6a 0000 0101 080a b086 420a .....j........B.
0x0030: 1128 974c .(.L
23:07:22.328997 00:0c:29:a9:28:a8 > 00:50:56:b0:e0:ea, ethertype IPv4 (0x0800), length 88: (tos 0x0, ttl 64, id 62141, offset 0, flags [DF], proto TCP (6), length 74)
172.24.2.51.46370 > 172.24.2.41.9200: Flags [P.], cksum 0x460a (correct), seq 0:22, ack 1, win 229, options [nop,nop,TS val 2961588746 ecr 287872844], length 22
0x0000: 4500 004a f2bd 4000 4006 e94f ac18 033d E..J..@[email protected]...=
0x0010: ac18 0333 b522 23f0 7ca5 b0b2 503f 561d ...3."#.|...P?V.
0x0020: 8018 00e5 460a 0000 0101 080a b086 420a ....F.........B.
0x0030: 1128 974c 4f50 5449 4f4e 5320 2f20 4854 .(.LOPTIONS./.HT
0x0040: 5450 2f31 2e30 0d0a 0d0a TP/1.0....
23:07:22.357592 00:0c:29:a9:28:a8 > 00:50:56:b0:e0:ea, ethertype IPv4 (0x0800), length 66: (tos 0x0, ttl 64, id 62142, offset 0, flags [DF], proto TCP (6), length 52)
172.24.2.51.46370 > 172.24.2.41.9200: Flags [.], cksum 0xcf0a (correct), seq 22, ack 18, win 229, options [nop,nop,TS val 2961588774 ecr 287872873], length 0
0x0000: 4500 0034 f2be 4000 4006 e964 ac18 033d E..4..@[email protected]...=
0x0010: ac18 0333 b522 23f0 7ca5 b0c8 503f 562e ...3."#.|...P?V.
0x0020: 8010 00e5 cf0a 0000 0101 080a b086 4226 ..............B&
0x0030: 1128 9769 .(.i
23:07:22.357641 00:0c:29:a9:28:a8 > 00:50:56:b0:e0:ea, ethertype IPv4 (0x0800), length 66: (tos 0x0, ttl 64, id 62143, offset 0, flags [DF], proto TCP (6), length 52)
172.24.2.51.46370 > 172.24.2.41.9200: Flags [R.], cksum 0xc1b3 (incorrect), seq 22, ack 18, win 229, options [nop,nop,TS val 0 ecr 287872873], length 0
0x0000: 4500 0034 f2bf 4000 4006 e963 ac18 033d E..4..@[email protected]...=
0x0010: ac18 0333 b522 23f0 7ca5 b0c8 503f 562e ...3."#.|...P?V.
0x0020: 8014 00e5 c1b3 0000 0101 080a 0000 0000 ................
0x0030: 1128 9769
如您所见的示例,有两个显示(不正确)的数据包或帧。
(不正确)是什么意思?网络数据包是否包含错误?
十六进制校验和值如何帮助确保完整性?例如第一个数据包,校验和显示 0xcf6a。此值如何帮助确保数据完整性?
问候
答案1
IP协议使用报头校验和:
来自维基百科
校验和字段是报头中所有 16 位字的二进制补码和的 16 位二进制补码。为了计算校验和,校验和字段的值为零。
此字段用作一种机制,用于查看传输过程中 IP 标头是否发生了变化(错误或中间人)