About Ethernet frame and IP packet (Data field and Total Length mismatch)

FreddyIWFreddyIW Member Posts: 27 ■□□□□□□□□□
As we know that the Data field of an ethernet frame has a size between 46-1500 bytes. But why does the Total Length field of an IP header can have a value up to 65535 bytes?

Comments

  • d4nz1gd4nz1g Member Posts: 464
    Maybe for future compatibility with other protocols.
    IP and Ethernet are completely independent, you can run IP over several different layer 2 protocols.
  • HeeroHeero Member Posts: 486
    The layer 2 protocol that carries the IP packet doesn't have to be ethernet. Also, look up jumbo frames for ethernet, they allow up to ~9000 bytes per frame. So the answer is that they wrote 65535 as the max packet size for flexibility. I believe the max packet size for IPv6 is somewhere in the couple GBs range.
  • theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    Packets can be larger than 1500 bytes. IPv4 allows a packet size of up to 65,535 bytes. Most network devices use an MTU of 1500 bytes for IPv4 over Ethernet, meaning that any IP packet larger than 1500 bytes will be fragmented into multiple packets.
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
  • FreddyIWFreddyIW Member Posts: 27 ■□□□□□□□□□
    Hi d4nz1g and Heero, thanks for reminding me about that.
    theodoxa wrote: »
    Packets can be larger than 1500 bytes. IPv4 allows a packet size of up to 65,535 bytes. Most network devices use an MTU of 1500 bytes for IPv4 over Ethernet, meaning that any IP packet larger than 1500 bytes will be fragmented into multiple packets.

    Let's say the MTU is set to 1500 bytes and there is a packet as large as 15000 bytes, then it is fragmented into 10 separate fragments transmitted as 10 separate frames. Does the Total Length field of each fragment's IP header still contain the value of 15000 bytes or does it become 1500 bytes?
  • theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    Looking at a Wireshark capture, it appears Total Length is for the individual fragment rather than the original packet. There is a fragment offset field that would be used to put everything back in the correct order and a more fragments flag to let the device know to expect more fragments.

    [EDIT] The total length field is in the IP Header. An IP Packet could theoretically be encapsulated in a different Layer 2 protocol, which supports larger frames.
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
  • FreddyIWFreddyIW Member Posts: 27 ■□□□□□□□□□
    Thanks for that Theodoxa.

    Oh ya, I have additional questions related to this:
    1) Does MTU reflect the whole frame (header + data + trailer) or just the frame's data field (which is packet)?

    2) Does the size of the data field of any ethernet frame always have to be inside the 46-1500 bytes range? If I set the MTU of the device to 2500 bytes, would the data field size exceed 1500 and become 2500 bytes large each?
Sign In or Register to comment.