Fundamentals 26 min read

What Is a Computer Network? From OSI Layers to TCP/UDP and DNS Explained

This article introduces computer networks by defining them, describing their hardware and software components, functions, classification by scope and topology, then explains the OSI seven‑layer model, the differences between TCP and UDP protocols, DNS operation, and the step‑by‑step process a user follows to access a website.

Raymond Ops
Raymond Ops
Raymond Ops
What Is a Computer Network? From OSI Layers to TCP/UDP and DNS Explained

Computer Network Introduction

A computer network connects geographically separated computers and external devices through communication lines, allowing resource sharing and information exchange under the management of network operating systems, management software, and communication protocols.

Computer Network Definition

A computer network is a system that links multiple independent computers and external devices via communication media, enabling shared resources and data transmission under coordinated control.

Computer Network Basic Components

Hardware Part

Computers: servers (core devices providing shared resources) and clients (user machines accessing resources).

Network Interface Card (NIC): converts data to signals suitable for the transmission medium and vice versa.

Communication Media: twisted pair, coaxial cable, fiber optic, and wireless media (radio, microwave, satellite).

Network Interconnection Devices: repeaters, bridges, routers, and gateways for connecting network segments.

Software Part

Network Operating System: manages resources such as files, printers, and communication lines (e.g., Windows Server, Linux, Unix).

Network Communication Protocols: define data format, transmission order, speed, error handling (e.g., TCP/IP).

Network Management Software: monitors status, configures devices, manages users, and ensures security.

Functions

Resource Sharing: hardware, software, and data resources are shared among multiple computers.

Data Communication: enables transmission of text, images, audio, video, etc.

Distributed Processing: splits complex tasks into subtasks processed by multiple machines.

Reliability: redundancy and backup mechanisms ensure continuous operation.

Classification

By Geographic Scope

Local Area Network (LAN): small area, high speed, low latency.

Metropolitan Area Network (MAN): city‑wide coverage.

Wide Area Network (WAN): national or global coverage.

By Topology

Bus Topology: all nodes share a single communication bus.

Star Topology: each node connects to a central hub or switch.

Ring Topology: nodes form a closed loop.

Tree Topology: hierarchical structure with multiple branches.

Mesh Topology: multiple interconnections for high reliability.

OSI Model

Physical Layer

Handles raw bit streams on the physical medium, converting data to binary signals for transmission.

Data Link Layer

Encapsulates upper‑layer data into frames and adds MAC addresses.

Network Layer

Routes packets from source to destination using IP addresses.

Transport Layer

Provides end‑to‑end data transfer, controlling reliability and using port numbers.

Session Layer

Manages establishment, maintenance, and termination of sessions.

Presentation Layer

Handles data format conversion, encryption, and decryption.

Application Layer

Offers network services to users such as file transfer, email, and web browsing (e.g., HTTP, HTTPS, SSH, FTP, DNS).

TCP and UDP Protocols

TCP Protocol

Transmission Control Protocol (TCP) is a connection‑oriented, reliable, byte‑stream transport protocol defined in RFC 793.

TCP Packet Structure

image
image

Sequence Number (Seq): 32‑bit identifier for the data segment.

Acknowledgment Number (Ack): 32‑bit identifier confirming receipt (Ack = Seq + 1).

Flags: URG, ACK, PSH, RST, SYN, FIN, each occupying one bit.

TCP Characteristics

Connection‑oriented.

Before data transmission, TCP establishes a reliable connection using a three‑way handshake and closes it with a four‑way handshake.

Client sends SYN with an initial sequence number.

Server replies with SYN‑ACK, providing its own sequence number and acknowledging the client’s.

Client sends ACK, completing the connection.

Data transfer proceeds; termination follows the four‑step FIN/ACK exchange.

Memory mnemonic: “One question, one answer, one confirmation.”

Connection Termination (Four‑Way Handshake)

image
image

Client sends FIN, indicating it wants to close the connection.

Server acknowledges with ACK.

Server sends its own FIN after transmitting remaining data.

Client acknowledges with ACK, and the connection is closed.

Memory mnemonic: “Two questions, two answers.”

UDP Protocol

User Datagram Protocol (UDP) is a connectionless, simple, unreliable transport protocol widely used for real‑time applications.

UDP Packet Structure

image
image

UDP Characteristics

Connectionless.

Unreliable transmission (no ordering, no retransmission).

Datagram‑oriented.

Supports unicast, multicast, and broadcast.

Because UDP does not establish a connection, it has lower latency and overhead, making it suitable for streaming media, online gaming, and DNS queries.

Differences Between TCP and UDP

Connection type: TCP is connection‑oriented; UDP is connectionless.

Reliability: TCP provides reliable delivery; UDP does not.

Transmission speed: UDP is faster; TCP is slower due to reliability mechanisms.

Data unit: TCP uses a byte stream; UDP uses datagrams.

Supported communication: TCP supports unicast only; UDP supports unicast, multicast, and broadcast.

Typical use cases: TCP for file transfer, web browsing, email; UDP for real‑time video, DNS, simple queries.

DNS Protocol

DNS Role

Domain name resolution: translating human‑readable domain names to IP addresses.

DNS Functions

Load balancing: mapping a domain to multiple IPs and distributing traffic.

Fault tolerance: redirecting traffic to backup servers when a primary server fails.

DNS Resolution Process

The resolver checks the local cache, the hosts file, then queries the configured DNS server, which may contact root servers, top‑level domain (TLD) servers, and authoritative name servers to obtain the final IP address.

image
image

Domain Name Structure Diagram

image
image

DNS Query Commands

Windows:

ipconfig /displaydns
ipconfig /flushdns

Linux:

dig example.com
dig +trace example.com

User Access Website Simple Process

The typical flow for a user accessing a website includes:

Client sends an HTTP request.

DNS resolves the domain name to an IP address (checking cache, hosts file, local DNS server, root/TLD/authoritative servers).

TCP three‑way handshake establishes a connection (SYN, SYN‑ACK, ACK).

Server processes the request and returns an HTTP response.

TCP four‑way handshake terminates the connection.

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.

TCPDNSUDPnetwork fundamentalsOSI modelComputer Networks
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

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.