MTU与协议报文头

1. 以太帧

//包括二层以太头和FCS:
Ethernet MinSize = 512bit = 64 Byte
Ethernet MaxSize = 1518 Byte

2. IP MTU

Ethernet MTU = 1518 - 18 ( 6 SRCMAC+ 6 DSTMAC+ 2 TYPE+ 4 CRC) = 1500 B
IP MTU <= Ethernet MTU

3. MSS

TCP MSS = 1500 - 40 ( 20 IP_HEADER + 20 TCP_HEADER) = 1460 B

4. UDP

UDP MTU = 1500 - 28 ( 20 IP_HEADER + 8 UDP_HEADER ) = 1472 B

5. PPPoE

PPPoE MTU/MRU = 1500 - 8 ( 6 PPPoE_SESSION + 2 PPP_HEADER ) = 1492 B

6. TCP over PPPoE

TCP over PPPoE MSS = 1492 ( PPPoE MTU/MRU ) - 40 ( 20 IP_HEADER + 20 TCP_HEADER) = 1452

7. PPTP MTU

PPTP MTU = 1500 - 56 ( 20 IP_HEADER + 20 TCP_HEADER + 12 GRE_HEADER + 4 PPP_HEADER ) = 1444 B

8. TCP over PPTP

TCP over PPTP MSS = 1444 ( PPTP MTU/MRU ) - 40 ( 20 IP_HEADER + 20 TCP_HEADER) = 1404

9. L2TP MTU

L2TP MTU = 1500 - 40 ( 20 IP_HEADER +8 UDP_HEADER + 8 L2TP_HEADER + 4 PPP_HEADER ) = 1460 B

10. TCP over L2TP

TCP over L2TP MSS = 1460 ( L2TP MTU ) - 40 ( 20 IP_HEADER + 20 TCP_HEADER) = 1420 B

11. PPTP over PPPoE

PPTP over PPPoE MTU/MRU = 1492 ( PPPoE MTU/MRU ) - 56 ( 20 IP_HEADER + 20 TCP_HEADER + 12 GRE_HEADER + 4 PPP_HEADER ) = 1436 B

12. PPTP over PPTP

PPTP over PPTP MTU/MRU = 1444 ( PPTP MTU/MRU ) - 56 ( 20 IP_HEADER + 20 TCP_HEADER + 12 GRE_HEADER + 4 PPP_HEADER ) = 1388 B

13. PPTP over L2TP

PPTP over L2TP MTU/MRU = 1460 ( L2TP MTU/MRU ) - 56 ( 20 IP_HEADER + 20 TCP_HEADER + 12 GRE_HEADER + 4 PPP_HEADER ) = 1404 B

14. L2TP over PPPoE

L2TP over PPPoE MTU/MRU = 1492 ( PPPoE MTU/MRU ) - 40 ( 20 IP_HEADER +8 UDP_HEADER + 8 L2TP_HEADER + 4 PPP_HEADER ) = 1452 B

15. L2TP over PPTP

L2TP over PPTP MTU/MRU = 1444 ( PPTP MTU/MRU ) - 40 ( 20 IP_HEADER +8 UDP_HEADER + 8 L2TP_HEADER + 4 PPP_HEADER ) = 1404 B

16. L2TP over L2TP

L2TP over L2TP MTU/MRU = 1460 ( L2TP MTU/MRU ) - 40 ( 20 IP_HEADER +8 UDP_HEADER + 8 L2TP_HEADER + 4 PPP_HEADER ) = 1420 B

通过上面计算,PPTP over PPPoE的准确MTU值为1436,L2TP over PPPoE的准确MTU值为1452。
MSS = MTU - 40

你可能感兴趣的:(MTU与协议报文头)