Skip to content

Instantly share code, notes, and snippets.

@devlights
Created September 14, 2023 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devlights/602a3b17f04b5d6e3cff2908ef9df69a to your computer and use it in GitHub Desktop.
Save devlights/602a3b17f04b5d6e3cff2908ef9df69a to your computer and use it in GitHub Desktop.
UDPでデータを送る際、ipフラグメントを起こさずに送信できる最大サイズ (MTU=1500byteとする)

MTU(Maximum Transmission Unit)が1500バイトの場合、UDPでデータを送る際にIPフラグメントを起こさずに送信できる最大サイズは以下のように計算できます。

  • Ethernetヘッダ: 14バイト
  • IPヘッダ: 最小で20バイト
  • UDPヘッダ: 8バイト
  • それらのヘッダを引いた値: (1500 - 14 - 20 - 8 = 1458)バイト

したがって、フラグメントを起こさずに送信できる最大サイズは1458バイトになります。


By GPT-4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment