Fundamentals 9 min read

Master Computer Network Fundamentals: TCP/UDP, HTTP, Socket & More

This comprehensive guide walks readers through the fundamentals of computer networking, covering architecture models, TCP and UDP protocols, HTTP basics, socket programming, IP addressing, ICMP, Ping, and related concepts such as routers, cookies, and token authentication, all illustrated with clear diagrams.

Efficient Ops
Efficient Ops
Efficient Ops
Master Computer Network Fundamentals: TCP/UDP, HTTP, Socket & More

Preface

Computer network fundamentals are essential for R&D and operations engineers but are often overlooked. This guide provides a clear, detailed overview of TCP/UDP, HTTP, Socket, and related concepts.

1. Computer Network Architecture

1.1 Overview

Definition: the set of layers and protocols in a computer network.

Purpose: defines the capabilities of the network.

1.2 Structure

The three main models are OSI, TCP/IP, and the five‑layer model.

OSI: conceptually clear but complex and rarely used in practice.

TCP/IP: core Internet protocol suite, widely applied in LAN and WAN.

Five‑layer: combines OSI and TCP/IP for teaching purposes.

Lower three layers form the communication sub‑network (data transport); upper three layers form the resource sub‑network (data processing); the transport layer connects them.

2. TCP Protocol

Transmission Control Protocol (TCP) is a transport‑layer communication protocol.

It belongs to the transport layer.

Application‑layer protocols based on TCP include HTTP, SMTP, FTP, Telnet, and POP3.

Additional TCP topics include three‑way handshake, four‑way termination, and error‑control mechanisms.

3. UDP Protocol

3.1 Definition

User Datagram Protocol (UDP) is a transport‑layer protocol.

3.2 Characteristics

Connection‑less, unreliable, message‑oriented, without congestion control.

3.3 Advantages & Disadvantages

Advantage: high speed.

Disadvantage: prone to packet loss, especially on poor networks.

3.4 Typical Applications

Scenarios requiring high communication speed, e.g., DNS, FTP, SNMP, NFS.

3.5 UDP Header Format

UDP datagram consists of a data field and an 8‑byte header with four fields.

image
image
image
image

4. HTTP Protocol

Brief introduction to HTTP.

image
image

5. Socket

5.1 Overview

A socket is an abstraction layer between the application layer and the TCP/IP protocol suite, providing a programming interface (API).

Socket is not a protocol; it is an API in the transport layer that enables communication over TCP/IP, including on Android platforms.

Socket pair example: Socket = {(IP1:PORT1), (IP2:PORT2)} A socket instance uniquely represents a communication link for an application on a host.

image
image

6. Additional Topics

6.1 URL to Homepage Process

Opening a web page involves multiple protocols, as illustrated.

image
image

6.2 IPv4 Address

Definition: a globally unique identifier for each host or router on the Internet.

Structure: 32‑bit address composed of network number and host number.

Network number identifies the network; host number identifies the host within that network.
image
image

6.3 ICMP Protocol

Internet Control Message Protocol (ICMP) operates at the IP layer, providing error reporting and diagnostics such as Ping and Traceroute.

6.4 Ping Process

Ping sends ICMP echo requests to a destination and measures round‑trip time based on the replies.

image
image

6.5 Router vs Switch

Key differences are illustrated.

image
image

6.6 Cookie vs Session

Overview of differences and comparisons.

image
image

6.7 Cookie vs Token

Authentication flows based on cookies and tokens.

image
image
image
image
image
image
image
image
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

tcpHTTPipSocketUDPICMPComputer Networks
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.