SkillPilotAI

From browser to server: the full journey

When you type https://example.com and press Enter, ARP, DNS, NAT, routing, TCP, TLS and HTTP all work together in a fraction of a second. Knowing this journey step by step, and the tool that checks each step, is the backbone of both troubleshooting and the most famous networking interview question.

272.1 Why is it used?

  • It ties every earlier topic (ARP, DNS, NAT, routing, TCP, TLS, HTTP) into one real flow.
  • When a site does not open, you can tell exactly which step broke instead of guessing.
  • Every step has its own tool, so you know what to run first.
  • "What happens when you type a URL and press Enter?" is the most asked networking interview question.

272.2 How it works: the five steps

Setup: asha's laptop 192.168.1.10 -> home router 192.168.1.1 (NAT, public IP 198.51.100.7) -> ISP routers -> DNS resolver 1.1.1.1 and example.com 203.0.113.10.

From Enter to rendered page
  1. 1.ARP: 1.1.1.1 is off-LAN, so the laptop broadcasts for the gateway 192.168.1.1's MAC

  2. 2.DNS: query on UDP 53 to 1.1.1.1, answer A example.com = 203.0.113.10 (cached for TTL)

  3. 3.TCP: SYN to port 443; router NAT rewrites 192.168.1.10 -> 198.51.100.7

  4. 4.Routing: ISP routers forward hop by hop; SYN-ACK back via the NAT table, then ACK

  5. 5.TLS: ClientHello (SNI), ServerHello + certificate, verify, session keys

  6. 6.HTTP: encrypted GET / with Host header -> 200 OK + HTML -> browser renders

Behind one Enter key, every layer does its part

272.3 Step by step details

  • ARP: to put a frame on the LAN the laptop needs the router's MAC; the ARP reply is saved in the ARP table.
  • DNS: the query goes through the router and ISP to the resolver; laptop and browser cache the answer until its TTL expires, so the next request skips DNS.
  • TCP + NAT: the router writes the private-to-public mapping in its NAT table and uses it to send the SYN-ACK back to the laptop.
  • TLS: ClientHello carries supported ciphers, a key share and SNI; the browser checks a trusted CA signed the cert and the name matches.
  • HTTP: CSS and images reuse the same connection.

272.4 A tool for every step

StepWindowsLinux
ARParp -aip neigh
Routingroute printip route
Pathtracerttraceroute
DNSnslookupdig, nslookup
NATrouter admin pageconntrack -L
TCPnetstat -anss -tn
TLSopenssl s_client -servernameopenssl s_client -servername
HTTPcurl -v, browser DevToolscurl -v
PacketsWiresharktcpdump, tshark

272.5 Lab: before the first contact

  • Closed Docker lab 192.168.72.0/24: client .10, dnsmasq DNS .53 (shop.lab A record), nginx HTTPS web .80.
  • No router and no NAT here: the web server is on the same LAN, reached directly on eth0.
  • Before the first contact, the ARP table is empty.
Terminal
# lab 192.168.72.0/24 (internal, no NAT)# client  192.168.72.10# dns     192.168.72.53  shop.lab A record# web     192.168.72.80  nginx HTTPSip route get 192.168.72.80ip neigh
Output
$ ip route get 192.168.72.80192.168.72.80 dev eth0 src 192.168.72.10 uid 0    cache$ ip neigh

272.6 curl -v: the full journey in one command

Terminal
curl -v --cacert /tmp/shop.crt \  https://shop.lab/
Output
$ curl -v --cacert /tmp/shop.crt https://shop.lab/* IPv6: (none)* IPv4: 192.168.72.80*   Trying 192.168.72.80:443...* Connected to shop.lab (192.168.72.80) port 443* TLSv1.3 (OUT), TLS handshake, Client hello (1):* TLSv1.3 (IN), TLS handshake, Server hello (2):* TLSv1.3 (IN), TLS handshake, Certificate (11):* TLSv1.3 (OUT), TLS handshake, Finished (20):* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / x25519 / id-ecPublicKey*  subject: CN=shop.lab*  subjectAltName: host "shop.lab" matched cert's "shop.lab"*  SSL certificate verify ok.> GET / HTTP/1.1> Host: shop.lab< HTTP/1.1 200 OK< Server: nginx< Content-Type: text/html<h1>Welcome to shop.lab</h1>
  • IPv4 line = DNS done; Connected = TCP done; Client/Server hello + verify ok = TLS done; > and < lines = HTTP.
  • --cacert makes curl trust the lab's self-signed certificate.

272.7 ARP table and dig

Terminal
ip neighdig @192.168.72.53 shop.lab
Output
$ ip neigh192.168.72.53 dev eth0 lladdr 12:71:77:94:46:1b REACHABLE192.168.72.80 dev eth0 lladdr d2:30:cf:e7:fb:ef REACHABLE$ dig @192.168.72.53 shop.lab;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26274;; ANSWER SECTION:shop.lab.    0    IN    A    192.168.72.80;; SERVER: 192.168.72.53#53(192.168.72.53) (UDP)
  • Now ARP has two REACHABLE entries: the DNS server and the web server.
  • No gateway in the lab, so the client ARPed them directly; at home this entry would be the router.
  • dig asks the DNS server directly; the ANSWER section shows the A record.

272.8 openssl s_client: check TLS alone

Terminal
openssl s_client -connect shop.lab:443 \  -servername shop.lab \  -CAfile /tmp/shop.crt -brief
Output
Connecting to 192.168.72.80CONNECTION ESTABLISHEDProtocol version: TLSv1.3Ciphersuite: TLS_AES_256_GCM_SHA384Peer certificate: CN=shop.labHash used: SHA256Signature type: ECDSAVerification: OKServer Temp Key: X25519, 253 bits
  • -servername sends shop.lab as SNI.
  • Verification: OK = certificate trusted and name matches; very useful for production cert checks too.

272.9 The full journey in tcpdump

Terminal
tcpdump -p -n -i eth0 -c 30 -w /tmp/j.pcap \  'arp or udp port 53 or tcp port 443'tshark -r /tmp/j.pcap
Output
    1   0.000000 fe:02:db:69:d9:0e → Broadcast    ARP 42 Who has 192.168.72.53? Tell 192.168.72.10    3   0.000043 12:71:77:94:46:1b → fe:02:db:69:d9:0e ARP 42 192.168.72.53 is at 12:71:77:94:46:1b    5   0.000048 192.168.72.10 → 192.168.72.53 DNS 79 Standard query 0xd0b0 A shop.lab OPT    7   0.000528 192.168.72.53 → 192.168.72.10 DNS 95 Standard query response 0xd0b0 A shop.lab A 192.168.72.80 OPT    8   0.001058 fe:02:db:69:d9:0e → Broadcast    ARP 42 Who has 192.168.72.80? Tell 192.168.72.10   10   0.001097 d2:30:cf:e7:fb:ef → fe:02:db:69:d9:0e ARP 42 192.168.72.80 is at d2:30:cf:e7:fb:ef   11   0.001100 192.168.72.10 → 192.168.72.80 TCP 74 33634 → 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=2054134724 TSecr=0 WS=1024   12   0.001149 192.168.72.80 → 192.168.72.10 TCP 74 443 → 33634 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=14006534 TSecr=2054134724 WS=1024   13   0.001167 192.168.72.10 → 192.168.72.80 TCP 66 33634 → 443 [ACK] Seq=1 Ack=1 Win=64512 Len=0 TSval=2054134724 TSecr=14006534   14   0.007946 192.168.72.10 → 192.168.72.80 TLSv1 583 Client Hello (SNI=shop.lab)
Order of packets in the capture
  1. 1.Frames 1-3: ARP for the DNS server

  2. 2.Frames 5-7: DNS query and A record answer

  3. 3.Frames 8-10: ARP for the web server

  4. 4.Frames 11-13: SYN, SYN-ACK, ACK on port 443

  5. 5.Frame 14: Client Hello with SNI=shop.lab in plain text

The capture ran from a netshoot sidecar in the client's network namespace

272.10 Common mistakes

  • Myth: HTTPS hides everything. Encrypted: page content, URL path, cookies. Visible: IP + port, the normal DNS query, and the SNI.
  • dig gives the right IP but curl hangs at Trying...: DNS is fine, the problem is the TCP connect (routing, firewall or port 443). A SYN with no reply in tcpdump confirms it.
  • Forgetting ARP and NAT in the answer: the first frame needs the gateway's MAC, and the server sees the router's public IP.
  • Thinking the laptop ARPs for the remote server: off-LAN it ARPs only for the gateway.

272.11 Interview tips

  • Answer template: DNS -> IP, ARP -> gateway MAC; TCP 443 + NAT + routing; TLS cert verify + keys; HTTP GET -> 200 OK -> render.
  • Mention caching: DNS answers are cached until TTL, ARP entries in the ARP table.
  • Name a tool for each step (dig, ip neigh, ss, openssl s_client, curl -v, tcpdump).
  • Say what HTTPS does not hide: IP, port, DNS query and SNI.