Big picture

A user action can require supporting messages before the intended packet can leave. DNS finds an IP address from a name; routing chooses an outgoing interface and next hop; ARP resolves that next hop’s IPv4 address to an Ethernet MAC address.

Name -> DNS if needed -> destination IP -> routing lookup
     -> next-hop IP -> ARP cache or ARP exchange -> Ethernet frame

DNS queries are themselves packets: contacting DNS may first require routing and ARP. A cached DNS result can avoid the lookup; a valid ARP entry can avoid address resolution. Neither cache replaces the intended ping or HTTP request.

Final destination versus next recipient

An IP packet is carried inside an Ethernet frame. In ordinary routing without NAT, the packet keeps its original source and final destination IP addresses. Each router decreases TTL and replaces the link-layer wrapping for the outgoing link.

LocationEthernet source -> destinationIP source -> destination
First linkH1 -> router’s incoming interfaceH1 -> H2
Second linkRouter’s outgoing interface -> H2H1 -> H2

H1 needs only its local gateway’s MAC for a remote destination. The router independently resolves H2’s MAC if H2 is directly connected to its outgoing network. ARP broadcasts do not cross routers in these exercises. Different router interfaces can have different MAC addresses; multiple IP addresses on one interface do not imply multiple interfaces.

ARP messages and learning

An ARP Request is normally broadcast; its Reply is normally unicast. One ARP exchange therefore contributes two frames. The request contains the requester’s IP and MAC, enabling the target to learn the return mapping.

The workbook discusses two cache-learning models: uninvolved hosts may learn a sender from an overheard ARP Request, or only the request’s target learns it. Its later exercises use the second model. Hearing a broadcast is distinct from replying to it or creating a cache entry. Do not treat these models as verified behavior of every current operating system. The workbook also models ordinary IP traffic as refreshing existing entries rather than creating new ARP entries.

Ping and ICMP

Ping tests IP reachability by sending an ICMP Echo Request and waiting for an Echo Reply. One successful ping exchange is two IP packets. Four successful pings generate eight ICMP packets, before any ARP/DNS overhead. Round-trip time covers the request’s outward journey and the reply’s return. No reply can reflect filtering or path failure as well as an unavailable destination.

Other workbook ICMP messages:

  • Destination Unreachable: delivery failed; the code identifies a reason such as an unreachable network.
  • Time Exceeded: a router cannot forward because the packet’s TTL would expire.
  • Redirect: advises the original sender of a directly reachable, better next-hop router for a destination. The current packet is still forwarded in the workbook examples; later traffic can use the shortcut if the redirect is accepted. The default gateway for other destinations need not change.

An ICMP error is a new IP packet: its source is the device generating the error, not the original packet’s source. Redirect acceptance and exact cache handling are assumptions of these examples.

Source

Fulvio Risso, Exercises on Packet Sniffing and Traffic Analysis, 17 September 2017, 56 pages. Source: local 01e - Packet Sniffing and Traffic Analysis.pdf in Downloads. PDF page order is used. Workbook-derived explanations retain CC BY-NC-SA 3.0 attribution and licensing: https://creativecommons.org/licenses/by-nc-sa/3.0/. Original PDF and figures remain local. Plain-language analogies and qualifications are added study explanations.