Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

length field in header

Why is it important for protocols configured on top of the Ethernet to have a length field in their header indicating how long the message is?

Is it for error checking at the other end? Or is there a special purpose on an Ethernet?
0
kuntilanak
Asked:
kuntilanak
  • 7
  • 6
  • 4
2 Solutions
 
Cyclops3590Commented:
perhaps you can be more specific.  which protocol are you wanting to know about specifically?

the length is typically in a protocol because the data payload is variable.  IPv4 has packet length and header length because the header is actually capable of being variable as well.  In order to properly process the packet, these fields must be set.
0
 
kuntilanakAuthor Commented:
I am asking this as in general only. IPv4 works as well.

Can you please explain what you mean by the header is capable or being a variable as well?
0
 
bbrunningCommented:
In layman's terms, it's instructions to tell about the packets being sent (or how large the packet is). If this wasn't there....the packets wouldn't know how much data was there, where to put it back together, etc. And yes, it helps with checking at the end to make sure everything is complete and nothing was missed.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
kuntilanakAuthor Commented:
Hmm.. is there any other purpose besides that?
0
 
bbrunningCommented:
LOL! You're taking a test for class:
>>
4. Why is it important for protocols configured on top of the
   Ethernet to have a length field in their header, indicating
   how long the message is?

Ans:

   Ethernet has a minimum frame size (64 bytes for 10Mbps; considerably
   larger for faster Ethernets); smaller packets are padded out to the
   minimum size. Protocols above Ethernet must be able to distinguish
   such padding from actual data.

   or

   It is important to indicate the message size because of the following
   reasons:

   - There can be padded data inside the message,
   - In case of collision only part of data is recieved, so it can
     checked by the message length field, otherwise, it won't be known.
   - The Ethernet frame size isn't fixed. It can hold up to 1500 bytes
     but it can vary from network to network.
   - The fragementation may have been done with the length field. The
     length field can actually make reassemble fragmented data easily.
<<

Good luck on the exam/mid term
0
 
kuntilanakAuthor Commented:
Errm.. I am not taking any exam/mid term... where did you get those answers anyway?
0
 
bbrunningCommented:
http://an.kaist.ac.kr/courses/2004/cs441/mid-term.doc

Consider that a freebie, the internet shouldn't be used for just answers, but knowledge and learning. If you know the answer to a question, it doesn't mean you understand it.
0
 
bbrunningCommented:
0
 
kuntilanakAuthor Commented:
yes... that's why I prefer not to google the question and rather ask it here as you guys usually explain it better so I understand the concept.. anyway I understand all the reasons except for this one:

The Ethernet frame size isn't fixed. It can hold up to 1500 bytes but it can vary from network to network.

can you explain what this means?
0
 
bbrunningCommented:
It's not fixed because depending on the network's speed, it will usually be increased in size. In other words, say you have an old network card that's only a 10mb interface. It not only sends data slow, it also has a limitation on the memory available within the nic itself (like a RAM stick, but it's just a mem chip). So with that limitation it cannot send full sized packets. With new gigabit NICs, they have the capability to actually send larger than 1500byte packets, these are called jumbo packets (I think something along those lines). They have the memory and processing speed to handle and send bigger packets. Same goes with switches, their speeds vary. You could have a gigabit switch on your network, but it's true capacity is based on the memory/processing power within the hardware to handle the data, and the connected computers themselves draw restrictions and create a variable size. example: It could be 24 port gigabit switch, but it may not be able to handle all 24 ports at the same time because of the hardware restrictions.

I know that's a little more than you asked but thought it would help.
0
 
kuntilanakAuthor Commented:
so what will happen if I send a packet which is bigger than the network card interface?
0
 
Cyclops3590Commented:
the length of the data portion has nothing to do with the speed of the network.  that is all apart of the protocol.  it fits as much as possible into the packet as it can.  

For example, when you sent a 2K file, it breaks it up to fit into the data portion of the packet.  The protocol designates the max that can go into it (MTU/MSS is apart of the protocols as well).  The last packet of data will typically be smaller because there isn't enough to fill it up to max size.

>>so what will happen if I send a packet which is bigger than the network card interface?
it should reject it.  however, if it doesn't handle it properly, you can crash the machine.  http://insecure.org/sploits/ping-o-death.html
0
 
kuntilanakAuthor Commented:
ok.. and so the purpose of the length is if I want to break this file that doesn't fir into the data portion?
0
 
Cyclops3590Commented:
kindof.   its so the receiving device know how long the packet is.  Some protocols are fixed-length (e.g. ATM) so length isn't needed.  However, the purpose of adding the length is so there is not wasted transmission.  For example, if you are transferring a bunch of 100 byte files and ethernet was fixed-length, you'd be transferring  ~1500bytes instead of the ~100bytes.  A substantial difference in performance.  This becomes more apparent in jumboframes and jumbo grams like kuntilanak was talking about.  IPv6 is capable of 4GB packets.  If you didn't have variable length packets, then a 2KB excel would take up 4GB on the wire instead of the 2KB it should.  

At least that is my understanding of the reasoning for variable length.  And if you made it fixed length, like ATM, it can't be large because of potential for corruption, so it'd have to be small, ATM is 53-byte cell.  However, then you have the problem of more overhead than desired.
0
 
kuntilanakAuthor Commented:
ok..thanks, I got it now
0
 
Cyclops3590Commented:
oops
>>more apparent in jumboframes and jumbo grams like kuntilanak was talking about
should be
>> more apparent in jumboframes and jumbo grams like bbrunning was talking about

sorry bbrunning, tried to hurry thru answer and accidentally read wrong post's author line.
0
 
bbrunningCommented:
no prob. =)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now