The 8-byte header
The game has a 24-byte position update to send. UDP puts a header of just 8 bytes in front: four fields of 2 bytes each. Header plus data is a datagram: one message that travels on its own.
The ports name the app at each end: 50000 on your laptop, 4000 on the game server. Length counts header plus data, 32 bytes. The checksum lets the receiver spot damaged bits.
Fire and forget
There is no connection to set up: no SYN, no reply to wait for. Datagram #1 leaves at once inside an IP packet and travels through the router to the server.
The game sends #2, #3, #4 and #5 right behind it, without waiting for any answer. UDP has no acknowledgments, so the sender never learns what arrived.
Lost and out of order
#2 reaches a busy router whose queue is full, so the router throws it away. Nobody tells the sender and UDP never resends it. If the game needs #2, the game itself must notice.
#3 is held up inside the network and #4 overtakes it. The UDP header has no sequence number, so the server gets #1, #4, #3, #5: whatever order they arrive in.
The app decides
At the server, UDP checks each datagram's checksum and quietly drops a damaged one. It reads the destination port, 4000, and hands every good datagram to the game as it is, in arrival order.
The game reads its own numbers inside the data. It uses #4, throws away #3 because a newer position already came, and never waits for #2: #5 is already here.
TCP would resend #2 and hold #3, #4 and #5 back until it arrives, so the game sees nothing new for at least another round trip. For live updates, a fresh one beats a late one.
DNS asks and answers in single datagrams on port 53. Voice calls, video calls and games pick UDP for low delay. QUIC, under HTTP/3, runs on UDP port 443 and adds its own reliability and encryption.
The datagrams, field by field
;; step 1/10 · wrap · local ;; at your laptop the game's data: 24 bytes "game update #1 x=12 y=45" UDP adds a header of 8 bytes: source port 2 bytes destination port 2 bytes length 2 bytes checksum 2 bytes header + data = one datagram, 32 bytes
The #1 to #5 numbers are written by the game inside its own data. The UDP header has no sequence number. Over IPv4 a checksum of 0 means "not computed" and is allowed; over IPv6 the UDP checksum is mandatory (RFC 8200).