ethernet 환경에서 fragmentation없이 UDP로 보낼 수 있는 최대

stoneshim의 이미지

UDP 프로토콜위에 간단한 프로토콜을 만들 일이 생겼습니다.

application 패킷의 사이즈가 커서 fragmentation이 발생하게 되면 프로토콜 설계가 복잡하게 될듯 하여, 패킷 사이즈를 제한하려고 합니다.

ethernet에서의 MTU가 1500byte 이므로, ip header의 크기와 udp header의 크기를 빼고, ethernet header의 크기까지 빼야 fragmentation 없이 한번에 전송할 수 있는 최대 size가 나올듯 했습니다.
이렇게 계산하면 1500 - 20(ip header크기) - 8(udp header크기) -14(ethernet header 크기) 가 되어 1458이 될 것으로 생각했는데... ping test를 해보니 아닌듯 하더군요.

ping으로 fragmentation없이 보낼 수 있는 최대 buffer size가 1472로 나오더군요. 아마도 MTU에서 ipheader크기와 icmp header 크기를 제외한 크기인듯 싶습니다.

MTU의 개념이 NIC 에서 한번에 나갈수 있는 데이터의 크기로 알고 있었는데 아닌가요?
테스트 결과로만 놓고 볼때에는... MTU가 NIC 윗단의 최대 크기인듯 한데요.

도움을 요청합니다.

최종호의 이미지

말씀을 듣고 win 2000의 3com 랜카드에 sniffer를 걸어보니 DLC header의 frame size 가 1500이 아니라 1514네요.


What is the format of an Ethernet II frame?

    +-----------+----------+----------+-----------+----------+
    |Destination|Source MAC|Frame type|Data       | CRC      |
    |MAC Address|Address   |(IP, ARP) |(46 to     | Checksum |
    |(6 bytes)  |(6 bytes) |(2 bytes) |1500 bytes)| (4 bytes)|
    +-----------+----------+----------+-----------+----------+


What is the minimum and maximum size of an Ethernet frame?

The minimum size of an Ethernet frame is 64 bytes. The breakup of this size between the fields is: Destination Address (6 bytes) + Source Address (6 bytes) + Frame Type (2 bytes) + Data (46 bytes) + CRC Checksum (4 bytes). The minimum number of bytes passed as data in a frame must be 46 bytes. If the size of the data to be passed is less than this, then padding bytes are added. The maximum size of an Ethernet frame is 1518 bytes. The breakup of this size between the fields is: Destination Address (6 bytes) + Source Address (6 bytes) + Frame Type (2 bytes) + Data (1500 bytes) + CRC Checksum (4 bytes). The maximum number of bytes of data that can be passed in a single frame is 1500 bytes. 



인 것으로 봐서 MTU가 Ethernet frame의 크기가 아니라 payload의 크기인 것 같습니다.

http://www.geocities.com/SiliconValley/Vista/8672/network/ethernet.html
나 넷웍책을 참조하세요. ㅡ,.ㅡ;;

추가.
혹시 혼란이 있을까봐.. sniffer로 잡은 1514는 CRC는 제외한 frame의 길이입니다. CRC까지 계산하면 1518이 되겠네요.

stoneshim의 이미지

답변 감사합니다.

테스트 이후에 그렇겠구나... 라고 생각 하면서도 불안한 마음이 가지실 않았는데, 원군을 얻은 기분이군요. ^^

알려주신 Q&A 사이트는 잘 보겠습니다.

우리 모두 리얼리스트가 되자. 그러나 가슴에 이룰 수 없는 꿈을 가지자

불량청년의 이미지

엇그제 책에서 잠깐 본 내용이 생각 나서 몇자 적어 봅니다.

로컬 네트웍과 원격 네트워크의 MTU값은 알 수 있지만,

중계 네트워크의 MTU값은 파악 할 수 없는 걸로 알고 있습니다.

그래서 TCP에선 Path MTU Discovery를 사용하여 IP패킷의

Don't Fragment비트를 설정하고 패킷을 보내고 중계장비에서

ICMP Destination Unreachable : Fragmentation Required

에러 메시지가 오면 이전에 보낸 패킷보다 좀 더 작게 ICMP메시지의

에러가 오지 않을 때까지 보내는 걸로 알고 있는데요.

혹시 중계 네트워크 장비 때문에 그런건 아닐까 하는 생각이 드네요.

만약 같은 네트웍 대역에서 사용한다면 해당사항이 없겠지만요.

글쓰면서도 좀 헷갈리네요. ㅡ,.ㅡ;

H/W가 컴퓨터의 심장이라면 S/W는 컴퓨터의 영혼이다!

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.