---
# System prepended metadata

title: LAN and NAT

---

# LAN and NAT

## Simplified model for arping



## Simplified model for ping

Ping can be used to determine L3 reachability.

- L3: IPv4 (packet)
    - header fields: src IP address, dest IP address, protocol = 1
    - payload: ICMP echo request/reply
- L2: Ethernet (frame)
    - header fields: src MAC address, dest MAC address
    - payload: IP packet
- client: the machine with src IP address
- server: the machine with dest IP address
- ping: client sends an ICMP echo request to server, and server returns an ICMP echo reply.

## Simplified model for plain-text HTTP

- L7: HTTP
    - header: path, host, origin
    - payload: HTML content, JSON, etc.
- L4: TCP
    - header: src port, dest port
    - payload: L7 content
- L3: IP
    - header: src IP address, dest IP address, protocol = 6
    - payload: L4 content
- L2: Ethernet
    - header: src MAC address, dest MAC address
    - payload: L3 content