Skip to main content
Systems Architecture•Last Updated : 09 Oct 2026
~40 min read

Computer Networking & Web Protocols

The networking stack from sockets to the application layer: DNS recursive resolvers, TLS 1.3 handshakes, TCP flow control and congestion windows, and HTTP/2 multiplexing.

The Anatomy of a URL Request & HTTP Protocol Evolution

When typing https://programmersos.com into a browser address bar, a complex cascade of low-level network transactions is executed across the OSI stack before the first HTML byte renders.

  • 1. DNS Hierarchy Resolution:Browser Cache -> OS Resolver Cache -> Local DNS Resolver -> Root Server (.) -> TLD Server (.com) -> Authoritative Nameserver (IP resolved).
  • 2. HTTP/1.1 Head-of-Line (HoL) Blocking:A slow HTTP request on a single TCP connection blocks all subsequent queued requests in the pipeline, forcing browsers to open up to 6 parallel TCP connections per host.
  • 3. HTTP/2 Binary Multiplexing:Splits messages into independent binary frames multiplexed over a single persistent TCP connection. Solved application-layer HoL blocking, but TCP-layer packet loss still stalls all streams.
  • 4. HTTP/3 with QUIC (UDP Transport):Replaces TCP with QUIC over UDP, providing true independent stream recovery (loss on stream A does not stall stream B) and zero-RTT connection resumption.
  1. Recursive DNS Resolution: The resolver queries the Root servers, gets referral to .com TLD server, queries TLD for NS records, and fetches the final A/AAAA record from the domain's authoritative DNS server.
  2. TCP + TLS 1.3 Combined Handshake: In 1 Round-Trip Time (1-RTT), the client sends SYN + TLS KeyShare; server responds with SYN-ACK + TLS ServerHello + EncryptedExtensions + Finished.
  3. HTTP/2 Binary Stream Transfer: Headers are compressed via HPACK (RFC 7541) into HEADERS frames; request payload is divided into DATA frames with stream IDs.
Definition: HTTP/2 Multiplexing

The ability to interleave multiple bidirectional request and response message frames concurrently over a single underlying TCP connection without blocking or connection re-establishment.

Handshake Latency Comparison

HTTP/1.1 + TLS 1.2: 3 RTTs ===> HTTP/3 + QUIC: 0 to 1 RTT
Variable Definitions & Term Breakdown:
HTTP/1.1 + TLS 1.21 RTT TCP 3-way handshake + 2 RTTs TLS 1.2 handshake = 3 full round trips before first HTTP byte
HTTP/3 + QUICTransport (UDP) and Crypto (TLS 1.3) unified into a single 1-RTT exchange (or 0-RTT for resumed sessions)

HTTP Protocol Evolution Matrix

ProtocolTransportMultiplexingHeader CompressionHead-of-Line Blocking
HTTP/1.1TCP
No (Sequential Pipeline)
None (Plaintext)
Application & TCP Level
HTTP/2TCP
Yes (Binary Frames)
HPACK
TCP Level Only
HTTP/3QUIC (UDP)
Yes (Independent Streams)
QPACK
Zero HoL BlockingOptimal
Comparison of transport, multiplexing, and head-of-line blocking
Tip

For real-time bidirectional messaging (chat applications, live trade updates), WebSockets provide continuous full-duplex TCP streams with minimal 2-byte framing overhead after an initial HTTP 101 Switching Protocols upgrade.

PythonSimulated HTTP/2 Multiplexed Frame Interleaver
1# Demonstration of HTTP/2 Multiplexed Binary Framing
2class HTTP2Stream:
3 def __init__(self, stream_id, path):
4 self.stream_id = stream_id
5 self.path = path
6 self.chunks = [f'DATA chunk 1 for {path}', f'DATA chunk 2 for {path}']
7
8# Two concurrent streams over ONE connection
9s1 = HTTP2Stream(stream_id=1, path='/index.html')
10s2 = HTTP2Stream(stream_id=3, path='/style.css')
11
12# Interleaved transmission over single TCP socket
13transmission_pipe = [
14 (s1.stream_id, s1.chunks[0]),
15 (s2.stream_id, s2.chunks[0]),
16 (s1.stream_id, s1.chunks[1]),
17 (s2.stream_id, s2.chunks[1]),
18]
19
20print('HTTP/2 Wire Frame Transmission:')
21for sid, frame in transmission_pipe:
22 print(f' [Stream #{sid}] Received: {frame}')
Output
HTTP/2 Wire Frame Transmission:
  [Stream #1] Received: DATA chunk 1 for /index.html
  [Stream #3] Received: DATA chunk 1 for /style.css
  [Stream #1] Received: DATA chunk 2 for /index.html
  [Stream #3] Received: DATA chunk 2 for /style.css
BashcURL HTTP/3 vs HTTP/2 Protocol Inspection
1# Test HTTP/3 QUIC connection
2curl --http3 -I https://cloudflare.com
3
4# Inspect HTTP/2 frames and HPACK header compression
5curl --http2 -v https://programmersos.com
Output
HTTP/3 200 OK
alt-svc: h3=":443"; ma=86400

Quick Syntax & Reference Sheet

Concept / RuleSyntax / Usage
WebSocket UpgradeGET /ws HTTP/1.1 Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZQ==
DNS Record TypesA (IPv4), AAAA (IPv6), CNAME (Alias), MX (Mail), TXT (SPF/DKIM), NS (Nameserver)

Common Pitfalls & Developer Mistakes

✕ Mistake 1:

Setting DNS TTL (Time To Live) too high during domain or IP migrations

Why it happens: Resolvers cache DNS responses for the full TTL duration. If an IP changes, clients with cached high TTLs continue sending traffic to the old decommissioned server.

Correction: Reduce DNS TTL to 300 seconds (5 minutes) 24 hours prior to a planned infrastructure migration.
# In Zone File:
@  IN  A  300  192.0.2.1

Frequently Asked Questions

What is the difference between WebSockets and Server-Sent Events (SSE)?

WebSockets provide bidirectional, full-duplex communication over a raw TCP connection. Server-Sent Events (SSE) provide unidirectional server-to-client streaming over standard HTTP/2, with built-in automatic reconnect and simpler firewall traversal.

Hands-On Practice Problems

Practice Coding Challenges (1)Solve in Cloud IDE
Article Tags:#Networking#HTTP#DNS#TCP/IP#TLS#Web Protocols
Was this lesson clear and helpful?

Discussion (0)

Sign in to ask questions and reply.
Loading discussion…
Discuss in community