DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. Understanding TCP/IP for Web Developers
XLinkedInReddit
MediumFrontend Engineering

Understanding TCP/IP for Web Developers

D
DevPrep Team
February 10, 2026·1 min read·0
Table of Contents
  • The TCP/IP Model
  • TCP: Reliable Delivery
  • The Three-Way Handshake
  • Flow Control
  • Congestion Control
  • TCP vs UDP
  • IP Addressing
  • What This Means for Web Performance

Every HTTP request travels through the TCP/IP stack. Understanding these layers helps you debug network issues and optimize performance.

The TCP/IP Model

Application Layer  → HTTP, WebSocket, DNS
Transport Layer    → TCP, UDP
Internet Layer     → IP, ICMP
Link Layer         → Ethernet, WiFi

TCP: Reliable Delivery

The Three-Way Handshake

Client          Server
  |--- SYN ------→|    1. "I want to connect"
  |←-- SYN-ACK ---|    2. "OK, I'm ready too"
  |--- ACK ------→|    3. "Great, let's go"
  |--- Data -----→|    4. Now data flows

This adds 1.5 RTT (Round Trip Times) before any data transfer. With TLS, add another 1-2 RTTs.

Flow Control

TCP uses a sliding window to prevent the sender from overwhelming the receiver. The receiver advertises how much data it can accept.

Congestion Control

TCP starts with a small window (slow start) and increases it exponentially until packet loss occurs, then backs off. This is why new connections are slower than persistent ones.

TCP vs UDP

FeatureTCPUDP
ReliabilityGuaranteed deliveryBest effort
OrderingOrderedUnordered
ConnectionConnection-orientedConnectionless
SpeedSlower (overhead)Faster (minimal overhead)
Use casesHTTP, email, file transferGaming, video, DNS

IP Addressing

IPv4: 192.168.1.1       (32-bit, ~4.3 billion addresses)
IPv6: 2001:0db8::1       (128-bit, practically unlimited)

// Special addresses
127.0.0.1    → localhost
0.0.0.0      → all interfaces
192.168.x.x  → private network
10.x.x.x     → private network

What This Means for Web Performance

  • Keep-Alive: Reuse TCP connections to avoid handshake overhead
  • HTTP/2: Multiplexes requests over a single TCP connection
  • HTTP/3 (QUIC): Uses UDP to avoid TCP head-of-line blocking
  • CDNs: Reduce RTT by serving from geographically close servers
  • Preconnect: <link rel="preconnect"> starts TCP+TLS handshake early

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • The TCP/IP Model
  • TCP: Reliable Delivery
  • The Three-Way Handshake
  • Flow Control
  • Congestion Control
  • TCP vs UDP
  • IP Addressing
  • What This Means for Web Performance

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.