Fundamentals 60 min read

A Complete Guide to Computer Network Fundamentals and Core Protocols

This article provides a comprehensive overview of networking basics, covering link concepts, protocol layers, TCP/IP architecture, routing algorithms, transport mechanisms, application services, security principles, and wireless LAN technologies.

Liangxu Linux
Liangxu Linux
Liangxu Linux
A Complete Guide to Computer Network Fundamentals and Core Protocols

Basic concepts

Network links connect nodes (computers, switches, routers). A protocol defines the syntax, semantics and timing of messages exchanged between peer entities. Services are offered by a lower layer to the layer above; entities are hardware or software processes that can send or receive information. Peer entities use the same PDU format. Links may be copper, fiber or wireless.

Communication models

Client/Server (C/S) : client requests services, server provides them.

Browser/Server (B/S) : a web server hosts databases accessed via a browser.

Peer‑to‑Peer (P2P) : each host acts as both client and server.

Network classifications

LAN – up to ~1 km.

MAN – 5–50 km.

WAN – tens to thousands of km.

PAN – ~10 m.

Performance parameters

Rate (bit/s)

Bandwidth (maximum bit/s)

Throughput (actual bit/s)

Delay (one‑way transmission time)

Round‑trip time (RTT)

Channel utilization

TCP/IP architecture

The TCP/IP stack consists of four layers: Link, Internet, Transport, and Application. Data are encapsulated with a header at each layer and decapsulated at the receiver.

TCP/IP architecture diagram
TCP/IP architecture diagram

Data encapsulation

Each layer adds its own header (and sometimes a trailer). The link layer also appends a trailer (e.g., CRC).

TCP header fields

Source port (2 bytes)

Destination port (2 bytes)

Sequence number (4 bytes)

Acknowledgment number (4 bytes)

Window size (2 bytes)

Header length (4 bits)

Checksum (2 bytes)

Flags: URG, ACK, PSH, RST, SYN, FIN

UDP header

Contains source port, destination port, length, and checksum (optional but recommended).

Physical layer

Signal encoding methods include:

NRZ – 1 = high, 0 = low.

Manchester – a transition in the middle of each bit period.

Typical transmission media: twisted‑pair, coaxial cable, single‑mode/multi‑mode fiber, and wireless.

Data link layer

Key functions:

Framing (adding header and trailer).

Error detection (CRC).

Flow control (e.g., PPP, Ethernet).

PPP frame format uses byte‑stuffing or bit‑stuffing to ensure transparent transmission. CRC is computed by dividing the data polynomial by a generator polynomial; a zero remainder indicates no error.

Network layer

Responsibilities include routing and forwarding. Important concepts:

IP addressing (class A/B/C/D/E).

Subnetting and CIDR.

ARP for mapping IP to MAC addresses.

IP header fields: version, header length, total length, TTL, protocol, checksum.

Routing protocols

RIP – distance‑vector, hop count ≤ 15.

OSPF – link‑state, Dijkstra algorithm.

BGP – path‑vector for inter‑AS routing.

MPLS – label‑switched paths for fast forwarding.

Transport layer

Provides end‑to‑end communication.

UDP : connectionless, supports unicast/multicast/broadcast, no reliability.

TCP : connection‑oriented, reliable, flow control, congestion control (slow start, congestion avoidance, ssthresh, duplicate ACKs).

TCP mechanisms:

Three‑way handshake (SYN, SYN‑ACK, ACK) to establish a connection.

Four‑way termination (FIN, ACK, FIN, ACK).

Sliding window, cumulative acknowledgments.

Retransmission timeout (RTO) calculation: RTO = RTT + 4·RTT_dev, where RTT_dev is the estimated deviation.

Application layer

Key services:

DNS – hierarchical name resolution (root, TLD, authoritative, local); supports iterative and recursive queries.

FTP – control connection on port 21, data connection on port 20; supports anonymous access.

HTTP – request/response model, persistent connections, pipelining, status codes, cookies.

Email – SMTP (port 25) for sending, POP3/IMAP for retrieval; MIME for multipart messages.

DHCP – dynamic IP configuration (DISCOVER, OFFER, REQUEST, ACK) with lease renewal.

Network security

Common attacks: eavesdropping, data tampering, denial‑of‑service, malware (worms, trojans, logic bombs, backdoors). Cryptographic foundations:

Symmetric encryption – same key for encryption and decryption.

Asymmetric encryption – public key (PK) and private key (SK).

Digital signatures – provide authentication, integrity, and non‑repudiation.

Key distribution mechanisms include Kerberos (KDC) and PKI (certificate authority).

Wireless LANs

Two WLAN types:

Infrastructure – hosts communicate via an Access Point (AP).

Ad‑hoc – hosts communicate directly without an AP.

CSMA/CA avoids collisions using DIFS, SIFS and a random backoff. 802.11 frames can contain up to four address fields.

802.11 frame format
802.11 frame format

Additional technical notes

Address lengths : MAC = 6 bytes, IPv4 = 4 bytes, IPv6 = 16 bytes, Port = 2 bytes.

Header sizes : Ethernet frame header+trailer = 18 bytes; IPv4 header = 20 bytes + options (0–40 bytes); IPv6 basic header = 40 bytes.

Checksum calculations :

Frame CRC – sender appends n‑bit remainder after dividing (data·2ⁿ) by a generator polynomial; receiver checks for zero remainder.

IPv4 header checksum – sum of 16‑bit words with carry‑wrap, then one's complement.

UDP/TCP checksum – includes a pseudo‑header (source IP, destination IP, zero, protocol, length) plus the segment; result must be zero for a correct packet.

Routing technologies :

RIP – distance‑vector, max hop count = 15.

OSPF – link‑state, Dijkstra shortest‑path tree.

BGP – path‑vector, inter‑AS routing.

MPLS – label‑switched paths, fast hardware forwarding.

Data‑exchange methods :

Circuit switching – dedicated physical path for the duration of the call.

Message switching – whole messages stored and forwarded.

Packet switching – messages divided into packets, each routed independently.

TCP vs UDP :

TCP – reliable, ordered, connection‑oriented, flow and congestion control.

UDP – unreliable, unordered, connectionless, low overhead.

IPv4 vs IPv6 :

IPv6 provides a 128‑bit address space, simplified header (no checksum), flow label, and built‑in support for extensions.

IPv4 uses 32‑bit addresses, includes header checksum, and has separate fields for fragmentation.

P2P vs C/S :

P2P – each host can act as both client and server, enabling direct resource sharing.

C/S – distinct client (requester) and server (provider) roles.

Search engine types :

Full‑text search engines (e.g., Google, Bing, Baidu).

Directory‑based engines (e.g., Yahoo, Sina, Sohu, NetEase).

CSMA/CD vs CSMA/CA :

CSMA/CD – carrier sense, collision detection; used in wired Ethernet.

CSMA/CA – carrier sense, collision avoidance; used in wireless (Wi‑Fi).

Common attack tools :

Worms, trojans, logic bombs, backdoors, rogue software.

Sniffing – intercepting traffic.

Denial‑of‑service – overwhelming a target with traffic.

Useful commands : ipconfig /all, /displaydns, /flushdns, /release,

/renew
ping -n count

, ping -l size,

ping -t
tracert
arp -a

, -d,

-s
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.

TCP/IPComputer NetworksTransport ProtocolsWireless LAN
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

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.