What actually happens when you open a website?

A connection is not one event. It is a series of decisions made by the application, operating system, network, and server. Follow a typical HTTPS request from a name to a response. See what each layer can and cannot tell you.

From application to application

This page describes a common web request. Real networks vary: caches, proxies, VPNs, firewalls, address translation, and protocol versions can change the path. Ok bye

  1. Application

    A program asks to connect

    An application starts with a protocol and a destination. For example, HTTPS to www.example.com on port 443. Typically, the client asks its operating system's resolver to resolve the name, then selects a destination address. The operating system chooses a source address and looks up how to reach it. The application asks for a connection; it does not choose the physical route itself.

    RFC 9110 · HTTP Semantics
  2. Name resolution

    DNS finds records, not reachability

    A host may answer from its local cache first. Otherwise, in a common setup, a stub resolver asks a configured recursive resolver. If its cache misses, that resolver follows referrals through the DNS hierarchy. It queries root servers, then top-level domain servers, then the domain's authoritative servers, which return records such as A (IPv4) or AAAA (IPv6). Cached answers have a time to live. DNS commonly uses UDP or TCP; encrypted transports such as DNS-over-TLS and DNS-over-HTTPS are also used. A successful lookup says nothing by itself about whether a service accepts connections.

    RFC 1034 · RFC 1035
  3. Local link

    The first frame goes to a neighbor

    The host compares the destination with its routing table. If the destination is on a directly attached network, it needs that destination's link-layer address; otherwise, it needs the address of the selected next-hop router. IPv4 commonly uses ARP for this lookup; IPv6 uses Neighbor Discovery. The IP destination remains the remote host while each local link delivers a frame to its next neighbor.

    RFC 826 · RFC 4861
  4. Internet

    Routers forward IP packets

    The host wraps transport data in an IP packet and a link-layer frame. Routers choose the most-specific matching route, decrease IPv4 TTL or IPv6 Hop Limit, and forward the packet in a new frame on the next link. The link-layer addresses change hop by hop; in ordinary forwarding, IP source and destination stay the same, though NAT can translate addresses or ports and tunnels can add an outer packet. IP is best-effort: it does not guarantee delivery or ordering. Links also have size limits (MTUs). IPv4 routers can fragment packets when permitted; IPv6 routers do not fragment packets in transit, so the sender must account for the path MTU. Routes can be asymmetric, so the return path need not match.

    RFC 791 · RFC 8200 · RFC 1812 · RFC 1191 · RFC 8201
  5. Transport

    Ports deliver data to the right process

    TCP identifies a connection by its endpoint addresses and ports. For example, a client selects a source port and connects to server port 443. For a new connection, the SYN, SYN-ACK, ACK handshake establishes shared connection state; applications may reuse an existing connection instead. Sequence numbers, acknowledgements, retransmission, and congestion control support a reliable, ordered byte stream. TCP does not preserve application message boundaries. UDP instead carries independent datagrams without TCP's built-in delivery, ordering, or congestion control guarantees; applications may add their own. QUIC uses UDP datagrams while providing connection, security, and transport mechanisms of its own.

    RFC 9293 · RFC 5681 · RFC 768
  6. Security

    TLS authenticates and protects the session

    For HTTPS over TCP, TLS negotiates cryptographic keys and normally authenticates the server with a certificate. The client validates the certificate chain and requested hostname against its trust policy. TLS then protects application records against disclosure and modification in transit. HTTP/3 is different: it uses QUIC over UDP, with the TLS 1.3 handshake integrated into QUIC rather than layered over TCP.

    RFC 8446 · RFC 9525 · RFC 9001
  7. Application

    HTTP carries the request and response

    HTTP defines semantics such as methods, status codes, fields, and message content. HTTP/1.1 and HTTP/2 use TCP; HTTP/3 uses QUIC. The server returns a response through the network to the client. A proxy or gateway may handle the request along the way. A successful TCP connection is only one step: TLS and the application request can still fail.

    RFC 9110 · RFC 9113 · RFC 9114

How data is wrapped for the wire

Each layer adds information needed by the next layer. A router forwards the IP packet; on every link, it is carried inside a new link-layer frame.

  1. Application dataHTTP request, response, or other application protocol
  2. Security and transportTLS over TCP, or QUIC over UDP (which integrates TLS for HTTP/3)
  3. Internet packetIPv4 or IPv6 source and destination addresses
  4. Link frameFor example, Ethernet or Wi-Fi for one local hop

This is a useful model, not a guarantee of one fixed stack: tunnels, VPNs, proxies, and other protocols can add layers or change where connections terminate.

What changes at a router, and what stays the same

In this simplified Ethernet example, the IP packet names the communicating endpoints while each link frame is addressed only to the next neighbor. Wi-Fi and tunnels add their own details.

Client to gateway

IP packet

client IP → server IP

Link frame

client MAC → gateway MAC

Router to next hop

IP packet, ordinary forwarding

client IP → server IP

New link frame

router MAC → next-hop MAC

Last hop to server

IP packet

client IP → server IP

Final link frame

last-hop MAC → server MAC

This example assumes the client reaches a remote network through a gateway. NAT can change IP addresses or ports; tunnels add an outer IP packet. A directly connected destination uses a different next-hop decision.

Three messages establish transport state

The TCP handshake synchronizes sequence numbers and confirms that both endpoints can exchange TCP segments. It does not encrypt the connection; HTTPS negotiates TLS separately afterward.

  1. Client → ServerSYNRequests a connection and proposes an initial sequence number.
  2. Server → ClientSYN-ACKAcknowledges the request and provides its own sequence number.
  3. Client → ServerACKAcknowledges the server; the TCP connection is established.

What the error can tell you

The error is a clue, not a diagnosis. What it means depends on which test you ran and where you ran it.

Name does not resolve
Check the queried name, resolver configuration, record type, and DNS response. This is different from a server refusing a connection.
Connection times out
A probe got no timely response. Packet loss, filtering, a missing route, an unavailable host, or a service that silently drops traffic can look similar.
Connection is refused
A refusal often means a TCP reset or an explicit reject reached the client. There may be no listener on that port, or network policy may be actively rejecting the connection.
Certificate validation fails
The transport may already be connected. Check the requested hostname, certificate dates, trust chain, and system clock before treating this as a routing problem.
HTTP returns an error status
An HTTP-speaking server or intermediary returned a response. Use its status and headers to investigate the application, proxy, or gateway layer.

Each test sees a different part

DNS lookup

Tells you what that resolver returned for the name. It does not tell you whether the service will answer.

Ping or port check

Tests for a particular kind of reply. A blocked ping does not mean TCP is blocked, and an open port does not mean the application is healthy.

Packet capture

Shows packets visible where you captured them. It will not show every hop, and encrypted application data stays encrypted.

HTTP request

Tests more of the path at once. If it fails, check the DNS, connection, and TLS results to narrow down where.

Oh yeah and you can ping stuff if your internet is shit and you wanna see if you have internet or if it went out, I do that a lot.

What tools I'm working on

Ripnet helps inspect networks: look up names, check routes, examine packets, and test services. RipSSH is the start of a separate SSH toolkit, but its SSH features are not implemented yet. We want both projects to be clear about what they test and what they can’t tell you.

Resources.

Standards and specifications

These explanations summarize protocol standards, not every implementation detail. The links point to specifications published by the RFC Editor.

Browse all 23 cited RFCs