Run tcpdump on Prague: tcpdump dst host 192.168.2.2 and udp
Run udpserver on Prague: udpserver 1024
Run udpclient on Madrid: udpclient 1024 192.168.2.2 1 [packet size]




Question 1: From layer 2 view, the max UDP payload is 1480 or 1472  ????

When sending big UDP packet, udp layer seem to fragment it into small packet of
1480 bytes size

When sending UDP packets of size around 1480, UDP layer seems to fragment it into
1472 Bytes size

Why????  Is there any optional header???

tcpdump result:

size = 1472
12:40:41.335183 eth1 < 192.168.1.2.1028 > 192.168.2.2.1024: udp 1472   

size = 1480
12:41:47.130948 eth1 < 192.168.1.2.1028 > 192.168.2.2.1024: udp 1480 (frag 32155:1480@0+)
12:41:47.130949 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32155:8@1480)

size = 16384

12:43:06.093782 eth1 < 192.168.1.2.1028 > 192.168.2.2.1024: udp 16384 (frag 32173:1480@0+)
12:43:06.093904 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@1480+)
12:43:06.094027 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@2960+)
12:43:06.094150 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@4440+)
12:43:06.094274 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@5920+)
12:43:06.094396 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@7400+)
12:43:06.094519 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@8880+)
12:43:06.094642 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@10360+)
12:43:06.094766 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@11840+)
12:43:06.094889 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@13320+)
12:43:06.095013 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:1480@14800+)
12:43:06.095034 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32173:112@16280)







Question 2: From UDP layer view, The max UDP payload is 65380 or 65507

when request size is >= 65508, error message is:  Message too long
when request size is between 65381 and 65507 (inclusive),
      tcpdump can get the udp packet fragament, but the server can't receive or assemble it well, meaning: udp packet dropped



When request size is 65507

tcpdump result:

12:45:11.693651 eth1 < 192.168.1.2.1028 > 192.168.2.2.1024: udp 65507 (frag 32199:1480@0+)
12:45:11.693774 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@1480+)
12:45:11.693897 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@2960+)
12:45:11.694019 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@4440+)
12:45:11.694143 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@5920+)
12:45:11.694265 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@7400+)
12:45:11.694389 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@8880+)
12:45:11.694512 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@10360+)
12:45:11.694635 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@11840+)
12:45:11.694758 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@13320+)
12:45:11.694881 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@14800+)
12:45:11.695004 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@16280+)
12:45:11.695127 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@17760+)
12:45:11.695250 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@19240+)
12:45:11.695374 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@20720+)
12:45:11.695496 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@22200+)
12:45:11.695619 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@23680+)
12:45:11.695743 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@25160+)
12:45:11.695866 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@26640+)
12:45:11.695988 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@28120+)
12:45:11.696112 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@29600+)
12:45:11.696235 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@31080+)
12:45:11.696358 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@32560+)
12:45:11.696482 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@34040+)
12:45:11.696604 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@35520+)
12:45:11.696727 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@37000+)
12:45:11.696861 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@38480+)
12:45:11.696974 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@39960+)
12:45:11.697096 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@41440+)
12:45:11.697219 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@42920+)
12:45:11.697342 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@44400+)
12:45:11.697466 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@45880+)
12:45:11.697589 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@47360+)
12:45:11.697712 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@48840+)
12:45:11.697835 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@50320+)
12:45:11.697958 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@51800+)
12:45:11.698081 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@53280+)
12:45:11.698204 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@54760+)
12:45:11.698327 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@56240+)
12:45:11.698452 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@57720+)
12:45:11.698573 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@59200+)
12:45:11.698696 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@60680+)
12:45:11.698819 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@62160+)
12:45:11.698942 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:1480@63640+)
12:45:11.698979 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32199:395@65120)


On server side (prague)

 1 packets lost here
 Expected to receive 1 UDP packet. Lost 1 packets



when packet size is 65381

tcpdump result

12:47:34.160953 eth1 < 192.168.1.2.1028 > 192.168.2.2.1024: udp 65381 (frag 32214:1480@0+)
12:47:34.161076 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@1480+)
12:47:34.161199 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@2960+)
12:47:34.161322 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@4440+)
12:47:34.161445 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@5920+)
12:47:34.161568 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@7400+)
12:47:34.161691 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@8880+)
12:47:34.161814 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@10360+)
12:47:34.161937 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@11840+)
12:47:34.162060 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@13320+)
12:47:34.162184 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@14800+)
12:47:34.162306 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@16280+)
12:47:34.162429 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@17760+)
12:47:34.162554 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@19240+)
12:47:34.162676 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@20720+)
12:47:34.162799 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@22200+)
12:47:34.162922 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@23680+)
12:47:34.163045 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@25160+)
12:47:34.163168 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@26640+)
12:47:34.163291 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@28120+)
12:47:34.163414 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@29600+)
12:47:34.163537 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@31080+)
12:47:34.163660 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@32560+)
12:47:34.163783 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@34040+)
12:47:34.163906 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@35520+)
12:47:34.164030 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@37000+)
12:47:34.164152 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@38480+)
12:47:34.164276 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@39960+)
12:47:34.164399 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@41440+)
12:47:34.164522 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@42920+)
12:47:34.164645 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@44400+)
12:47:34.164768 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@45880+)
12:47:34.164891 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@47360+)
12:47:34.165014 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@48840+)
12:47:34.165137 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@50320+)
12:47:34.165260 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@51800+)
12:47:34.165383 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@53280+)
12:47:34.165506 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@54760+)
12:47:34.165629 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@56240+)
12:47:34.165754 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@57720+)
12:47:34.165876 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@59200+)
12:47:34.165999 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@60680+)
12:47:34.166121 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@62160+)
12:47:34.166245 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:1480@63640+)
12:47:34.166271 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32214:269@65120)


on server side ( prague ): Nothing is received





When request size is 65380

tcpdump result is:

12:49:52.278713 eth1 < 192.168.1.2.1028 > 192.168.2.2.1024: udp 65380 (frag 32223:1480@0+)
12:49:52.278836 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@1480+)
12:49:52.278959 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@2960+)
12:49:52.279082 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@4440+)
12:49:52.279206 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@5920+)
12:49:52.279328 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@7400+)
12:49:52.279451 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@8880+)
12:49:52.279575 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@10360+)
12:49:52.279698 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@11840+)
12:49:52.279821 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@13320+)
12:49:52.279944 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@14800+)
12:49:52.280067 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@16280+)
12:49:52.280190 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@17760+)
12:49:52.280325 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@19240+)
12:49:52.280436 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@20720+)
12:49:52.280559 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@22200+)
12:49:52.280682 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@23680+)
12:49:52.280806 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@25160+)
12:49:52.280929 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@26640+)
12:49:52.281052 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@28120+)
12:49:52.281175 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@29600+)
12:49:52.281298 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@31080+)
12:49:52.281421 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@32560+)
12:49:52.281544 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@34040+)
12:49:52.281667 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@35520+)
12:49:52.281791 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@37000+)
12:49:52.281913 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@38480+)
12:49:52.282036 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@39960+)
12:49:52.282159 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@41440+)
12:49:52.282283 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@42920+)
12:49:52.282405 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@44400+)
12:49:52.282528 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@45880+)
12:49:52.282651 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@47360+)
12:49:52.282775 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@48840+)
12:49:52.282897 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@50320+)
12:49:52.283021 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@51800+)
12:49:52.283144 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@53280+)
12:49:52.283267 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@54760+)
12:49:52.283390 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@56240+)
12:49:52.283515 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@57720+)
12:49:52.283636 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@59200+)
12:49:52.283760 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@60680+)
12:49:52.283882 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@62160+)
12:49:52.284006 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:1480@63640+)
12:49:52.284032 eth1 < 192.168.1.2 > 192.168.2.2: (frag 32223:268@65120)


On server side( prague )

Expected to receive 1 UDP packet. Lost 0 packets