Addressing, ARP
32-bit IP addresses are network-layer addresses for interfaces. They are used for layer 3 (network layer) forwarding.
- Can change (e.g. can be assigned a different address via DHCP from subnet machine is in)
MAC (or LAN or physical or Ethernet) addresses are the physical address of a link.
- Completely flat (does not change)
- Function is for “locally” getting a frame from one interface to another physically-connected interface (i.e. same network in the IP-addressing sense)
- 48 bit MAC addresses (for most LANs)
- Addresses are burned into NIC ROM
- Sometimes software settable
- e.g. 1A-2F-BB-76-09-AD
- Each adapter on LAN has a unique LAN address

- MAC address allocation is administered by IEEE
- Manufacturers buy a portion of the MAC address space to ensure uniqueness
- Compared to IP hiearchical addresses, MAC flat address is portable
- Can move LAN card from one LAN to another
- IP address depends on IP subnet to which a node is attached
Given the IP address of an interface, we must determine its MAC address.
- Done via ARP (address resolution) table
- Each IP node (host, router) on LAN has table in memory
- Entries have entries
<IP address; MAC address; TTL>
- TTL (time to live) is time after which address will be forgotten (typically 20 minutes)
- The given IP address is checked against network mask ⇒ if not under same subnet, need to route to first hop router
- e.g. suppose A wants to send a datagram to B (same LAN), and B’s MAC address is not in A’s ARP table
- A broadcasts an ARP query packet (broadcast frame) containing B’s IP address
- Destination MAC address = FF-FF-FF-FF-FF-FF
- All nodes on LAN receive ARP query
- B receives ARP packet and replies to A with its MAC address (i.e. MAC address for B)
- Frame is directly sent to A’s MAC address (unicast)
- i.e. link with IP address matching broadcasted packet responds
- A will cache the IP-MAC address pair in its ARP table until information becomes stale (timeout)
- Soft state ⇒ information times out unless refreshed
- e.g. suppose A wants to send a datagram to B (different LAN), B’s MAC address is not in A’s ARP table
-
A is configured with information of first-hop router from DHCP
-
A creates:
-
IP datagram with IP source A, destination B
-
Link-layer frame with R’s MAC address as destination (contains A-B IP datagram from above)

-
Frame is sent from A to R
-
Datagram is removed when frame is receieved, passed up to IP
-
R processes datagram for B’s network
- R forwards datagram with IP source A, destination B:
- R creates link-layer frame with B’s MAC address as destination (contains A-B IP datagram)

