Curriculum

Topic 09 · Networking

Computer Networks

Computer networks are the infrastructure underlying all distributed AI systems. TCP/IP, OSI layers, DNS, HTTP/3, and WebSockets are the protocols your AI applications run on.

The idea

Computers communicate by agreeing on protocols at multiple abstraction layers. The OSI model defines 7 layers: Physical, Data Link, Network (IP), Transport (TCP/UDP), Session, Presentation, Application (HTTP). The simplified TCP/IP stack has 4: Link, Internet, Transport, Application.

TCP provides reliable, ordered, connection-oriented delivery via a three-way handshake and acknowledgement. UDP is connectionless and unreliable—no handshake, no ordering—but has lower latency. Video streaming, DNS, and QUIC use UDP.

HTTP/3 (QUIC) runs over UDP, eliminating TCP's head-of-line blocking. A single lost packet no longer stalls all streams. This dramatically improves performance on lossy mobile networks—critical for AI API latency.

RTT = 2 × (propagation delay + transmission delay + queuing delay)

Round Trip Time: the total time for a request to reach the server and the response to return.

What to hold onto

  • DNSDomain Name System: resolves human-readable hostnames (learn.nexorazentrix.com) to IP addresses. Recursive resolvers, authoritative nameservers, TTL, and caching make this the internet's phone book.
  • TLSTransport Layer Security encrypts connections between clients and servers. TLS 1.3 reduces handshake latency from 2 RTTs to 1 RTT. Essential for securing AI API calls.
  • WebSocketsFull-duplex TCP connection upgraded from HTTP. Enables real-time streaming of LLM tokens from server to browser. Used by ChatGPT, Claude.ai, and all streaming AI interfaces.

Live: Packet Switching & Dynamic SPF Routing

Transmit TCP frames across mesh routers. Click links to simulate fiber cut and watch Dijkstra SPF recalculate paths.

Path: Node 1 → 2 → 4

Quick answers

What is the OSI model?

The OSI (Open Systems Interconnection) model defines seven layers of network communication: Physical, Data Link, Network, Transport, Session, Presentation, and Application. Each layer provides services to the layer above and communicates with its peer layer on the remote system via defined protocols.

Why does HTTP/3 use UDP instead of TCP?

HTTP/3 uses the QUIC protocol over UDP to eliminate TCP's head-of-line blocking: in TCP, a single lost packet stalls all streams sharing the connection. QUIC multiplexes independent streams so packet loss in one stream does not affect others, significantly improving performance on lossy mobile networks.