2

My question is the inverse of this one asked on Stack Overflow: InverseQuestion

...but I don't think I get an unequivocal answer to what I'm seeking from that either. My question was posed on a mid-term I just took and was worth A LOT of points. I argued that it was not a legitimate question because the UDP header DOES have a length field (that speaks to the header and data), as shown in the screenshot I'm embedding. I could list dozens of references that have a similar diagram and explanation. The instructor simply marked it wrong with no explanation. We have been going back and forth since then and I can't get an answer as to why every UDP header diagram on the internet shows a length field if there is no length! Can someone help me understand--if it's true there is no header length--in plain English? Am I misinterpreting all these similar diagrams? Thanks. UDP Diagram

https://www.computernetworkingnotes.com/ccna-study-guide/segmentation-explained-with-tcp-and-udp-header.html https://www.lifewire.com/tcp-headers-and-udp-headers-explained-817970

ldp
  • 43
  • 8
  • 1
    You are conflating 'header length' with 'length'. The UDP header length is fixed at 8 bytes so it doesn't need to be part of the packet. TCP/IP header length is variable so it does. – user207421 Apr 11 '20 at 03:34

1 Answers1

2

Why does the TCP header have a header length field while the UDP header does not? might be a valid question.

  • UDP header contains the header+data length
  • TCP header contains the header length in 32b DWORD
  • IP header contains the total length of the IP packet

Important:

  • UDP header is fixed 8 Bytes => no meaning to make the header bigger for a constant
  • TCP header can vary with options

If you're looking for the reason why UDP includes the data and TCP doesn't, you can check in the draft of each RFC specification. Nevertheless, there might not be any reason for that, don't forget those protocols have been defined tens years ago.

Alexis
  • 2,136
  • 2
  • 19
  • 47
  • @RossJacobs He has answered the question thus: 'might be a valid question', and he has given reasons, and FYI they are correct. Please stop it. – user207421 Apr 11 '20 at 03:55
  • @user207421 because I edited my question while he was commenting ;) – Alexis Apr 11 '20 at 03:58
  • @user207421 You may want to look at the edit history timestamps when deleting comments. The answer was asking for clarification when I looked at it. – Ross Jacobs Apr 11 '20 at 04:39
  • I understand that there's a difference with respect to fixed vs variable but that isn't the question. If the question asked why is the length in the UDP header fixed while TCP is variable, then I would have spoken to the options. I think maybe the answer is what @user207421 said ("You are conflating 'header length' with 'length'.") but I don't really understand the distinction. UDP header has a length field that represents the header length (and its data). How is that mutually exclusive? It seems like it's splitting hairs. – ldp Apr 11 '20 at 16:11
  • You don't underwtand the distinction between 'header length' and 'header length+data length' ? I can't do much. I answered the question you asked. – Alexis Apr 11 '20 at 23:33
  • No, Alexis_FR_JP, that's not what I said. I was addressing both your comments and @user207421 who said I was conflating "header length (TCP)" with "length (UDP)" and my point being that "length (UDP)" includes both header and data so I don't see how they are mutually exclusive concepts. From what I can understand, the only reason the essay question could be considered valid is because TCP *literally* calls the field "header length" and UDP *literally* calls the field simply "length". That seems like splitting hairs when you look at what is included in the UDP "length"--a header length! – ldp Apr 12 '20 at 01:20
  • Your question is "Is [] a valid question" period. – Alexis Apr 12 '20 at 01:29