I'm learning some tcp/ip basics, and am having trouble understanding the Message Length field in UDP. In my book, it says that the Message Length represents the UDP header and data in octets, and since the UDP header is 8 octets, the minimum Message Length value is 8. I have a scenario where the UDP header is 8 octets, and the data is a 13 character string(13 octets). However, the example I'm looking at says the message length is 20 + 13, and then explains that it's 20 octets for the header and 13 octets for the data. I thought that UDP headers were 8 octets, not 20, so why is this 20?
I suspect that it might have to do with the pseudo header, which is 12 octets, so 12 from the pseudo and 8 from the actual header = 20 total header octets. Is this the case? It's really not making any sense to me. Also doesn't the 13 octet data need to be rounded to a multiple of 4? The way it is presented in my book makes it look like the data needs to be padded to 32 bits(4 octets).
Sorry for this confusion, just trying to understand the layout here. If you guys need any additional information just ask.