UDP packets have a maximum size that you can't control at the end points, each segment of the path between the end points has a maximum size for a udp packet that you don't have any way of knowing other than sending packings of different sizes and seeing what goes through.
If anyone ever tells you that technology is elegant or that technological solutions are clean, laugh at them.
for those of you who don't know, udp is one of the methods used to transmit data on the internet, just about everything you do online that moves data, like viewing a website or video chat, is built on top of udp.
If you move far enough away jagged lines start to look smooth, that is the same illusion that any sort of technology uses to look elegant or cleanly made.