Computer Networks: Architecture, Protocols, Operation, and Security
A computer network is a system of devices, links, and software protocols that enables hosts to exchange data across local, metropolitan, wide-area, and global environments. The Internet is the largest practical example: it uses packet-based communication, standardized addressing, routing, and layered protocols to move data between heterogeneous systems .
At the core of modern networking is packet switching, where application data is segmented into packets, each packet is forwarded through intermediate devices, and the receiver reassembles the original message. This design allows links to be shared efficiently among many conversations, unlike circuit-switched systems that reserve a fixed path for an entire session .
Networks are usually studied through layering. Layered models separate concerns: physical signaling, local delivery, internetwork routing, transport reliability, and application semantics. The OSI model is a conceptual seven-layer reference model, while the TCP/IP model is the practical foundation of the Internet protocol suite .
Key learning outcomes for this section:
| Competency | What you should be able to explain |
|---|---|
| Network architecture | How hosts, switches, routers, and links cooperate |
| Layered models | Why OSI and TCP/IP separate networking responsibilities |
| Addressing | How MAC addresses, IP addresses, ports, and names differ |
| Forwarding | How switches forward frames and routers forward packets |
| Reliability | How TCP provides ordered, reliable delivery over IP |
| Security | How segmentation, encryption, firewalls, and monitoring reduce risk |
Footnotes
-
RFC 1122: Requirements for Internet Hosts — Communication Layers - Foundational specification describing Internet host communication layers and TCP/IP requirements. ↩
-
Internet Society: A Brief History of the Internet - Historical overview of packet switching, ARPANET, and Internet development. ↩
-
ISO/IEC 7498-1: Open Systems Interconnection Basic Reference Model - International standard defining the OSI reference model. ↩
Computer Networking Full Course - OSI Model Deep Dive with Real Life Examples
Network Components and Topologies
A network is built from endpoint devices, intermediary devices, links, and protocols. A host may be a laptop, server, phone, printer, virtual machine, or container. A switch connects devices inside a local area network, while a router connects separate IP networks and chooses next hops for packets .
A LAN usually operates over Ethernet or Wi-Fi. A WAN connects remote sites through carrier links, leased lines, VPNs, or public Internet paths. A topology describes how nodes are arranged and how traffic flows.
Common topology patterns:
| Topology | Description | Strength | Limitation |
|---|---|---|---|
| Star | Devices connect to a central switch or access point | Easy to manage and troubleshoot | Central device can become a failure point |
| Mesh | Devices or routers have multiple interconnections | High resilience and path diversity | More expensive and complex |
| Bus | Devices share one communication medium | Simple historical design | Poor scalability and fault isolation |
| Tree | Hierarchical arrangement of switches and routers | Scales well for enterprises | Upper-layer failures affect many users |
| Hybrid | Combination of several designs | Flexible and realistic | Requires careful planning |
Footnotes
-
Cisco: What Is a Network Switch? - Vendor-neutral educational explanation of switching and network device roles. ↩
| Layer | Name | Main function |
|---|---|---|
| 7 | Application | User-facing network services such as web and email |
| 6 | Presentation | Data representation, serialization, encryption concepts |
| 5 | Session | Dialog control and session coordination |
| 4 | Transport | End-to-end delivery using TCP or UDP |
| 3 | Network | Logical addressing and routing with IP |
| 2 | Data Link | Local frame delivery with Ethernet or Wi-Fi |
| 1 | Physical | Electrical, optical, or radio transmission |
The OSI model is primarily a teaching and design reference that clarifies responsibilities across seven layers .
Footnotes
-
ISO/IEC 7498-1: Open Systems Interconnection Basic Reference Model - International standard defining the OSI reference model. ↩
Addressing: MAC, IP, Ports, and Names
Networking uses several kinds of identifiers because different layers solve different problems. A MAC address identifies an interface on a local link. An IP address identifies a host or interface within an IP network. A port number identifies an application conversation on a host.
IPv4 uses 32-bit addresses, commonly written in dotted-decimal form such as 192.0.2.10; IPv6 uses 128-bit addresses, commonly written in hexadecimal colon-separated notation such as 2001:db8::10 . IPv6 was designed with a vastly larger address space and improved support for modern Internet growth .
A subnet groups addresses under a common prefix. For example, 192.0.2.0/24 indicates that the first 24 bits are the network prefix, leaving 8 bits for host addresses. Classless Inter-Domain Routing, or CIDR, allows flexible address allocation and route aggregation .
The DNS translates names such as example.com into addresses that machines can route to. DNS is hierarchical and distributed, using zones, authoritative servers, recursive resolvers, and cached records to scale globally .
Footnotes
-
RFC 791: Internet Protocol - Original IPv4 specification defining IP datagrams, addressing, and fragmentation. ↩
-
RFC 8200: Internet Protocol, Version 6 Specification - Current IPv6 specification describing IPv6 packet format and addressing architecture. ↩
-
RFC 4632: Classless Inter-domain Routing - Specification and discussion of CIDR addressing and route aggregation. ↩
-
RFC 1034: Domain Names — Concepts and Facilities - Core DNS architecture specification explaining the distributed domain name system. ↩
Think in Layers During Troubleshooting
When a connection fails, isolate the layer. Check physical link first, then local addressing, IP routing, transport ports, DNS, and finally the application. This prevents guessing and mirrors how layered network models separate responsibilities .
Footnotes
-
ISO/IEC 7498-1: Open Systems Interconnection Basic Reference Model - International standard defining the OSI reference model. ↩
How a Web Request Travels Across a Network
- 1Step 1
The client asks DNS for the IP address associated with a domain name. DNS may return IPv4 A records, IPv6 AAAA records, or both, depending on the domain and resolver configuration .
Footnotes
-
RFC 1034: Domain Names — Concepts and Facilities - Core DNS architecture specification explaining the distributed domain name system. ↩
-
- 2Step 2
The client compares the destination IP address with its local subnet. If the destination is remote, the client sends the packet to its default gateway, usually a router .
Footnotes
-
Cisco: What Is a Network Switch? - Vendor-neutral educational explanation of switching and network device roles. ↩
-
- 3Step 3
Application data is wrapped in a transport header, then an IP header, then a link-layer frame. This encapsulation allows each layer to add the information needed for its own scope.
- 4Step 4
A switch forwards the Ethernet frame within the LAN using link-layer information. Switches learn which MAC addresses are reachable through which ports .
Footnotes
-
Cisco: What Is a Network Switch? - Vendor-neutral educational explanation of switching and network device roles. ↩
-
- 5Step 5
Routers inspect the destination IP address, consult routing tables, decrement the packet lifetime field, and forward the packet toward the next hop .
Footnotes
-
RFC 791: Internet Protocol - Original IPv4 specification defining IP datagrams, addressing, and fragmentation. ↩
-
- 6Step 6
At the destination, the receiver decapsulates the frame and packet, passes the segment to TCP or UDP, and uses the destination port to deliver data to the correct application process .
Footnotes
-
RFC 9293: Transmission Control Protocol - Modern TCP specification describing reliable ordered transport behavior. ↩
-
- 7Step 7
The server sends response data back through the same layered process. The return path may differ from the forward path because IP routing is packet-based and can be asymmetric.
Switching, Routing, and Forwarding
A switch operates primarily at the data-link layer. It forwards frames within the same LAN. Ethernet switches maintain forwarding tables that associate MAC addresses with switch ports, reducing unnecessary traffic compared with older shared-medium designs .
A router operates at the network layer. It forwards packets between networks based on destination IP prefixes. Routers use routing tables populated by static configuration, directly connected networks, or dynamic routing protocols.
A routing table usually contains:
| Field | Purpose |
|---|---|
| Destination prefix | Network range such as 203.0.113.0/24 |
| Next hop | Neighbor router or interface used to reach the destination |
| Metric | Preference value used to compare routes |
| Interface | Local outgoing link |
| Route source | Static, connected, or learned dynamically |
A key distinction is that switching is local and link-specific, while routing is logical and network-wide. Switches ask, “Which port reaches this MAC address?” Routers ask, “Which next hop reaches this IP prefix?”
Footnotes
-
Cisco: What Is a Network Switch? - Vendor-neutral educational explanation of switching and network device roles. ↩
Relative Scope of Common Network Identifiers
Illustrative comparison of how far each identifier is normally meaningful in a network path.
Transport Protocols: TCP, UDP, and QUIC
The transport layer provides process-to-process communication. TCP provides reliable byte-stream delivery, retransmission, flow control, congestion control, and ordered data delivery . UDP provides datagram delivery with lower overhead but without TCP-style reliability or ordering guarantees .
TCP is appropriate when correctness and ordered delivery matter, such as web transfers, file downloads, email delivery, and remote administration. UDP is appropriate when applications can tolerate loss or implement their own recovery, such as voice, video, gaming, telemetry, and DNS queries.
QUIC is a modern transport protocol that runs over UDP and integrates security, multiplexing, and connection migration. HTTP/3 uses QUIC rather than TCP, helping reduce connection setup costs and avoiding some head-of-line blocking issues associated with TCP-based multiplexing .
Transport-layer comparison:
| Feature | TCP | UDP | QUIC |
|---|---|---|---|
| Connection model | Connection-oriented | Connectionless | Connection-oriented over UDP |
| Reliability | Built in | Not built in | Built in |
| Ordering | Ordered byte stream | Message datagrams only | Stream-based delivery |
| Congestion control | Built in | Application-dependent | Built in |
| Encryption | Usually via TLS above TCP | Optional at application layer | Integrated with TLS 1.3 concepts |
| Typical uses | HTTPS, SSH, email | DNS, VoIP, streaming | HTTP/3, modern web transport |
The simplified throughput relationship often used in performance analysis is:
Latency-sensitive applications care not only about throughput, but also about jitter, packet loss, and round-trip time.
Footnotes
-
RFC 9293: Transmission Control Protocol - Modern TCP specification describing reliable ordered transport behavior. ↩
-
RFC 768: User Datagram Protocol - UDP specification defining connectionless datagram transport. ↩
-
RFC 9000: QUIC — A UDP-Based Multiplexed and Secure Transport - QUIC transport protocol standard. ↩
UDP Is Not Automatically Faster in Practice
UDP has less protocol overhead than TCP, but application performance depends on loss recovery, congestion behavior, path quality, and implementation. A poorly designed UDP application can perform worse than TCP and can harm shared networks .
Footnotes
-
RFC 768: User Datagram Protocol - UDP specification defining connectionless datagram transport. ↩
Application Protocols and Services
Application protocols define the meaning of exchanged messages. HTTP defines semantics for web requests and responses, including methods, status codes, headers, and representation metadata . DNS defines distributed name resolution. SMTP, IMAP, and related protocols support email. SSH supports secure remote administration. DHCP helps hosts obtain IP configuration automatically.
A client-server model is common: browsers request pages from web servers, mail clients retrieve messages from mail servers, and applications query databases through network APIs. A peer-to-peer model distributes service roles among participating nodes.
Typical protocol stack for loading a secure website:
| Layer | Example |
|---|---|
| Application | HTTP semantics |
| Security | TLS encryption and authentication |
| Transport | TCP, or QUIC for HTTP/3 |
| Internet | IPv4 or IPv6 |
| Link | Ethernet, Wi-Fi, cellular, or other access technology |
TLS protects data in transit and authenticates servers using certificates. TLS 1.3 simplified older handshake designs and removed many obsolete cryptographic options .
Footnotes
-
RFC 9110: HTTP Semantics - Current HTTP semantics specification for methods, status codes, and message meaning. ↩
-
RFC 8446: The Transport Layer Security Protocol Version 1.3 - TLS 1.3 specification for secure network communication. ↩
A Layered Network Troubleshooting Method
- 1Step 1
Confirm that cables, wireless association, link lights, VLAN membership, and interface status are correct. Many apparent application failures begin as link-layer failures.
- 2Step 2
Inspect IP address, subnet prefix, default gateway, and DNS server configuration. A host with an incorrect prefix or gateway may reach local devices but fail to reach remote networks.
- 3Step 3
Ping the default gateway or another local device. Success suggests that local link-layer communication is functioning.
- 4Step 4
Ping or trace toward a known external IP address. If remote IP connectivity works but names fail, the issue may be DNS rather than routing.
- 5Step 5
Query DNS directly. Compare resolver behavior with authoritative answers where appropriate because DNS caching and stale records can produce misleading symptoms .
Footnotes
-
RFC 1034: Domain Names — Concepts and Facilities - Core DNS architecture specification explaining the distributed domain name system. ↩
-
- 6Step 6
Check whether the required TCP or UDP port is reachable. Firewalls, access control lists, service binding, and NAT rules can block specific ports even when IP reachability works.
- 7Step 7
Review logs, protocol errors, certificates, authentication failures, HTTP status codes, and server-side resource limits. Application-layer failures often appear only after lower layers are healthy.
Network Security Fundamentals
Network security combines prevention, detection, response, and recovery. A firewall enforces traffic policy between zones or hosts. Network segmentation limits the blast radius of failures and attacks. A VPN protects traffic across untrusted networks.
Security objectives are often summarized as confidentiality, integrity, and availability:
| Objective | Network interpretation | Example control |
|---|---|---|
| Confidentiality | Prevent unauthorized disclosure of traffic | TLS, VPNs, encryption |
| Integrity | Prevent unauthorized modification | Message authentication, TLS |
| Availability | Keep services reachable and resilient | Redundancy, DDoS protection, monitoring |
Firewalls are effective when deployed as part of a broader architecture that includes least privilege, patching, authentication, logging, and incident response . Encryption protects data in transit, but it does not replace endpoint security or sound access control.
Footnotes
-
NIST SP 800-41 Rev. 1: Guidelines on Firewalls and Firewall Policy - NIST guidance on firewall technologies, policy, and network security architecture. ↩
Flat Networks Increase Attack Impact
If every host can freely reach every other host, one compromised endpoint can more easily spread laterally. Segmentation, firewall policy, and identity-aware access controls reduce this risk .
Footnotes
-
NIST SP 800-41 Rev. 1: Guidelines on Firewalls and Firewall Policy - NIST guidance on firewall technologies, policy, and network security architecture. ↩
Selected Milestones in Computer Networking
Packet Switching Concepts
1960sPacket switching emerged as a foundational idea for sharing communication links efficiently among many conversations ."
Footnotes
-
Internet Society: A Brief History of the Internet - Historical overview of packet switching, ARPANET, and Internet development. ↩
ARPANET Begins Operation
1969ARPANET connected early research sites and influenced later packet-switched internetworking designs ."
Footnotes
-
Internet Society: A Brief History of the Internet - Historical overview of packet switching, ARPANET, and Internet development. ↩
IPv4 Specification
1981RFC 791 defined IPv4, including datagram format, addressing, fragmentation, and best-effort packet delivery ."
Footnotes
-
RFC 791: Internet Protocol - Original IPv4 specification defining IP datagrams, addressing, and fragmentation. ↩
TCP/IP Becomes Core Internet Protocol Suite
1983TCP/IP became the operational foundation for Internet communication, separating reliable transport from IP packet delivery ."
Footnotes
-
RFC 1122: Requirements for Internet Hosts — Communication Layers - Foundational specification describing Internet host communication layers and TCP/IP requirements. ↩
IPv6 Specification Published
1998IPv6 introduced 128-bit addressing and a revised IP header architecture to support Internet growth ."
Footnotes
-
RFC 8200: Internet Protocol, Version 6 Specification - Current IPv6 specification describing IPv6 packet format and addressing architecture. ↩
QUIC Standardized
2021QUIC was standardized as a UDP-based transport protocol supporting secure, multiplexed connections ."
Footnotes
-
RFC 9000: QUIC — A UDP-Based Multiplexed and Secure Transport - QUIC transport protocol standard. ↩
Common Misconceptions and Edge Cases
Computer Networking Key Terms
Design Principles for Reliable Networks
Good network design balances scalability, performance, security, and operability. A scalable design uses hierarchical addressing, route summarization, modular topology, and predictable failure domains. A secure design applies least privilege, segmentation, encryption, centralized logging, and tested incident response. An operable design includes documentation, monitoring, configuration management, and change control.
Important design metrics include:
| Metric | Meaning | Why it matters |
|---|---|---|
| Bandwidth | Maximum transmission capacity of a link | Determines potential data rate |
| Latency | Time for data to travel from source to destination | Affects responsiveness |
| Jitter | Variation in latency | Important for voice, video, and gaming |
| Packet loss | Percentage of packets that fail to arrive | Reduces quality and throughput |
| Availability | Proportion of time a service is usable | Measures reliability |
| Mean time to repair | Average recovery time after failure | Measures operational resilience |
A useful availability approximation is:
For example, a service that is down for 8.76 hours per year has approximately annual availability. Higher availability usually requires redundancy, monitoring, tested failover, and disciplined operations rather than only faster hardware.
Design for Failure, Not Just Normal Operation
Reliable networks assume that links, devices, software, and configurations can fail. Redundant paths, clear routing policy, monitoring, backups, and tested recovery procedures are central to resilient design.
Knowledge Check
Which statement best describes packet switching?
Explore Related Topics
Algorithms: Foundations, Analysis, and Design Paradigms
Algorithms are formal, step‑by‑step procedures that transform inputs into correct outputs, and their study intertwines correctness, efficiency, and appropriate data representations.
- Correctness is proved via invariants, induction, or contradiction, while efficiency is measured with asymptotic notation (, , ) and space usage.
- Common design paradigms include divide‑and‑conquer (e.g., merge sort, binary search), dynamic programming, greedy methods, backtracking, and branch‑and‑bound.
- Choice of data structures (arrays, heaps, graphs, etc.) directly impacts algorithm performance.
- Typical algorithm families—sorting, searching, BFS/DFS—illustrate the trade‑offs in time ( vs ) and scalability.
- A standard development lifecycle proceeds from problem specification, representation, paradigm selection, analysis, to implementation and testing.
Data Communication Components: Various Connection Topology, Protocols and Standards
Data communication fundamentals are presented, detailing the five essential components, common physical and logical topologies, protocol layering (OSI and TCP/IP), and the standards bodies that ensure interoperability.
- Core components: message, sender, receiver, transmission medium, protocol; transmission modes include simplex, half‑duplex, and full‑duplex.
- Topologies: bus, star, ring, mesh, tree, hybrid—each balancing cost, fault tolerance, scalability, and complexity.
- Protocols define syntax, semantics, and timing; OSI (7 layers) and TCP/IP (4 layers) use key protocols such as IP, TCP, UDP, HTTP.
- Standards from ISO, ITU‑T, IEEE (e.g., 802.3 Ethernet, 802.11 Wi‑Fi) and IETF guarantee vendor‑independent communication.
- Design guidance: align requirements with appropriate topology, media, protocol stack, and verify compliance with relevant standards.
Systems Programming: Processes, Memory, Concurrency, and Operating-System Interfaces