Jumbo frame

最後更新: 2021-09-10

Jumbo Frame 介紹

 

Jumbo frames can increase the efficiency of Ethernet and network processing in hosts by reducing the protocol overhead

Ethernet frames default size: 1538 bytes     # mtu 1500, tcp payload 1460 bytes

Jumbo frame size: 9038 byte                      # mtu 9000, tcp payload 8960 bytes

--------------------------------- Physical (20 bytes)
Preamble: 8 byte
IPG(interpacket gap): 12 byte
--------------------------------- MAC (18 bytes)
frame header: 14 byte     
FCS(frame check sequence): 4 byte
--------------------------------- Jumbo Frame
IPv4 header: 20 byte     
TCP header: 20 byte
Data: ?

TCP Protocol Efficiency:

94.93%(1460/1538) -> 99.14%(8960/9038)

優點

主要: 減小 package 的 overhead

未必有: Jumbo frames have the potential to reduce overheads and CPU cycles

           (不用將 single large frame broken up into smaller frames)

缺點

Larger frames are more likely to suffer undetected errors with the simple CRC32 error detection used in Ethernet frames

iSCSI (RFC 7143) use the Castagnoli CRC polynomial 去克服此問題

為何要 9000 ?

當初考慮:

NFSv2 packet size is 8192 bytes. There 's certainly a performance incentive to not fragment NFS traffic.

Frame 限制

4 bytes 的 CRC 最大支持12000 bytes, 超過了就沒有辦法檢查了

FCS

 * The FCS provides error detection only.

the receiver can compute a running sum over the entire frame, together with the trailing FCS, expecting to see a fixed result

IEEE 802 protocols, this fixed result, also known as the magic number or CRC32 residue, is 0xC704DD7B

要求

  • Switch + Router + NIC + OS
  • Jumbo frame 必須  full-duplex 的 Ethernet

 


LSO 與 LRO

 

making CPU load independent of frame size

(eliminate the per-packet overhead that jumbo frames were designed to reduce)

Large send offload (LSO)

Large receive offload (LRO)

Checking

ethtool -k eth1 | grep -e large

large-receive-offload: off [fixed]

 


Linux 設定

 

CLI

ifconfig ethX mtu 9000

Permanence

# Centos

/etc/sysconfig/network-scripts/ifcfg-eth0

...
MTU=9000

Test

IP=r.r.r.r

ping $IP -M do -s 5000