I had recently made a python program that parses broadcast messages sent from a device.
I knew the structure the information was coming in and the sequence (little endian)
Originally when I received the data I parsed it starting from octet one. The information didn't make any sense and I soon realized the first chunk of data must be the UDP header. From the link https://en.wikipedia.org/wiki/User_Datagram_Protocol I found that the data doesn't start til 8 octect. I shifted where I started parsing but still the data shown was not as expected.
Luckily while looking through the data I realized a chunk that I recognized and counted backwards/forwards to get the start and end points of the data. The data didn't start til octet 12
My question now is... why does the header take up 12 octets? What is the structure of this header?
Note: I used wireshark to check the message sizes to make sure Python was getting the whole message to make sure the message wasn't being cut down some how...