How does a message find the right app?
02Use a host address and a numbered destination endpoint to deliver PING.
An IP address identifies the destination host. A UDP destination port helps that host choose a receiving endpoint.
Where should PING go?
- Destination host
198.51.100.20- Destination port
- 5001
What happens if you change this?
Make one change, then watch again. Restart restores the original example.
Deliver it to the corresponding receive port, not every application.
Key idea: Use the address to find the host and the destination port to select an endpoint. A reply still belongs to the app.
Terms
- UDP
- User Datagram Protocol: sends separate messages to numbered endpoints with a small header.
- Datagram
- One separately carried message, rather than an ordered byte stream.
- Port
- A numbered endpoint used to choose where a message goes within a host.
- Payload
- The carried message data, excluding the wrapper being discussed.
- Checksum
- A computed error-check value; it is not proof of identity.
Rules & examples
An address selects a host; a destination port selects an endpoint.
These reference examples may differ from the selected experiment.
- UDP source and destination port fields are each 16 bits.
- The original source-port field may be zero when unused; a meaningful source port can guide replies.
The drawing is a simplified worked example. Follow the linked RFC and its updates for implementation requirements.
RFC 768 Fields: source/destination ports are 16-bit fields. A source port may be zero when unused; a meaningful source port may guide replies absent other information. Destination port is interpreted with the destination address. Binding, local socket policy and filters can add constraints beyond this two-listener example. RFC 1122 §§4.1.3.1/4.1.3.3 discuss ports and ICMP errors. These experiments use ordinary IPv4 UDP without RFC 9868 options or fragmentation. No packets are sent.
Sources
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.