Computer Networking
— Complete DIT Notes
All 5 modules — OSI/TCP-IP, IP addressing, switching, and application-layer services — with real comparisons and every practical lab included, from cable crimping to Wireshark. Free to read — no account needed.
Data Communication & Network Types
The building blocks of any network — components, categories by size, topologies, and how devices relate to each other.
Data Communication Components
Every communication needs five parts: a sender, a receiver, a message (the data), a transmission medium (cable or wireless), and a protocol — the agreed rules both sides follow so the message is understood the same way on both ends.
Network Types by Size
LAN (Local Area Network) covers a single building or campus. MAN (Metropolitan Area Network) spans a city. WAN (Wide Area Network) spans countries or continents — the internet is the largest WAN. WLAN is a wireless LAN, same coverage as a LAN but over Wi-Fi instead of cable.
| Aspect | Client-Server | Peer-to-Peer (P2P) |
|---|---|---|
| Structure | Central server, many clients request from it | Every node is both client and server |
| Management | Centralized — easier to secure and administer | Decentralized — no single point of control |
| Example | A file server, a web app backend | BitTorrent, a small office workgroup sharing files directly |
| Failure point | Server down = everyone affected | No single point of failure |
Network Topologies
Topology is the physical or logical layout of connections: Star (all devices connect to one central hub/switch — most common today), Bus (all devices share one backbone cable — legacy), Ring (each device connects to exactly two neighbours in a loop), Mesh (every device connects to every other — high redundancy, expensive), and Hybrid (a mix, e.g. star networks linked into a larger bus or mesh backbone).
# T568A and T568B wiring standards (pin order on RJ-45) T568A: White-Green, Green, White-Orange, Blue, White-Blue, Orange, White-Brown, Brown T568B: White-Orange, Orange, White-Green, Blue, White-Blue, Green, White-Brown, Brown # Cable types built from these standards: Straight-through cable # same standard both ends (T568B–T568B) — PC to switch Crossover cable # T568A one end, T568B other end — PC to PC direct, switch to switch # Tools: RJ-45 connectors, crimping tool, cable tester # After crimping: always verify with a cable tester before trusting the link
- Protocol
- The agreed set of rules that let two devices understand each other's messages.
- LAN / WAN
- LAN = one site; WAN = many sites connected across distance, like the internet.
- Topology
- The layout pattern of how devices connect — star, bus, ring, mesh, or hybrid.
- RJ-45
- The standard 8-pin connector used to terminate Ethernet twisted-pair cable.
Almost every modern LAN is Star topology — a central switch, one cable run per device. Bus and Ring are mostly historical at this point, but still asked about in exams because they explain why Star won (a single cable break doesn't take down the whole network).
OSI & TCP/IP Models
The reference frameworks every networking concept in this course maps back to.
The OSI Reference Model
OSI splits networking into 7 layers, each handling one job and passing data to the next. From bottom to top: Physical (raw bits over a medium) → Data Link (MAC addressing, frames on the local segment) → Network (IP addressing, routing between networks) → Transport (TCP/UDP, port numbers, reliability) → Session (managing connections/sessions) → Presentation (formatting, encryption, compression) → Application (what the user-facing program actually does — HTTP, FTP, DNS). Data gets wrapped in a new header at each layer going down — this is encapsulation — and unwrapped layer by layer going up on the receiving end.
The TCP/IP Suite
TCP/IP is the model the real internet actually runs on — 4 layers instead of OSI's 7, because it merges several OSI layers together. It's more practical than OSI (which is mostly a teaching/reference tool) and is what every device on the internet actually implements.
| OSI Layer | TCP/IP Layer | Examples |
|---|---|---|
| Application, Presentation, Session | Application | HTTP, HTTPS, FTP, DNS, DHCP |
| Transport | Transport | TCP, UDP |
| Network | Internet | IP, ICMP |
| Data Link, Physical | Link (Network Access) | Ethernet, Wi-Fi, ARP |
- Encapsulation
- Wrapping data in a new header at each layer as it moves down the stack for transmission.
- PDU
- Protocol Data Unit — the name for data at each layer: Segment (Transport), Packet (Network), Frame (Data Link), Bits (Physical).
- De-encapsulation
- Stripping headers off layer by layer as data moves up the stack on the receiving device.
Exam tip: "Please Do Not Throw Sausage Pizza Away" is the classic mnemonic for OSI top-to-bottom: Application, Presentation, Session, Transport, Network, Data Link, Physical.
Physical & Data Link Layer
The cables, wireless signals, and devices that get bits from one machine to the next one physically connected to it.
Transmission Media
Guided (wired) media physically carries the signal: Twisted Pair (Cat5e/6/7 — the standard Ethernet cable, ranked by speed and shielding), Coaxial (older, used in cable internet), and Fiber-Optic (light pulses through glass — fastest, longest range, immune to electrical interference). Unguided (wireless) media uses radio waves — Wi-Fi, Bluetooth, microwave links.
Data Link Layer
This layer handles communication between two devices on the same local network segment. Every network interface has a unique MAC address burned into it. Data at this layer is organized into frames, and the layer performs basic error detection (catching corrupted frames, though not always correcting them).
| Device | OSI Layer | What it does |
|---|---|---|
| Hub / Repeater | Physical (L1) | Blindly repeats signal to every port — no intelligence |
| Switch | Data Link (L2) | Reads MAC addresses, sends frames only to the correct port |
| Router / L3 Switch | Network (L3) | Reads IP addresses, forwards packets between different networks |
# In Cisco Packet Tracer (or real switch CLI) Switch> enable Switch# configure terminal Switch(config)# hostname SW1 Switch(config)# enable secret Cisco123 # set console/privileged password Switch(config)# banner motd # Authorized Access Only # # Create and assign a VLAN Switch(config)# vlan 10 Switch(config-vlan)# name Sales Switch(config-vlan)# exit Switch(config)# interface fastEthernet 0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10
- MAC Address
- A unique 48-bit hardware address burned into every network interface card.
- Frame
- The unit of data at the Data Link layer — includes MAC addresses and error-checking.
- VLAN
- Virtual LAN — logically separates traffic on the same physical switch into isolated broadcast domains.
Simple way to remember switch vs router: a switch connects devices within one network; a router connects different networks together (like your home LAN to the internet).
Network & Transport Layer
IP addressing, subnetting, and how TCP/UDP get data reliably (or quickly) from one application to another.
IPv4 Addressing
An IPv4 address is 32 bits, written as four decimal numbers (e.g. 192.168.1.10). Addresses are grouped into classes: Class A (huge networks, few of them), Class B (medium), Class C (small — most common for LANs), Class D (multicast), Class E (reserved/experimental). Private IP ranges (like 192.168.x.x, 10.x.x.x) are used inside LANs and never routed on the public internet — that's what NAT is for.
| Class | Private Range | Typical Use |
|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 | Large enterprise networks |
| B | 172.16.0.0 – 172.31.255.255 | Medium-sized organizations |
| C | 192.168.0.0 – 192.168.255.255 | Home routers, small offices |
Subnetting & IPv6
A subnet mask (e.g. 255.255.255.0) splits an IP address into a network portion and a host portion, letting one large network be divided into smaller, manageable segments. IPv6 uses 128-bit addresses written in hex (e.g. 2001:0db8::1) — introduced because IPv4's ~4.3 billion addresses ran out with the growth of the internet.
Transport Layer — TCP vs UDP
TCP is connection-oriented — it performs a handshake, guarantees delivery, and re-sends lost packets (used for web pages, email, file transfer). UDP is connectionless — no handshake, no guarantee, but much faster (used for video streaming, DNS lookups, online gaming). Both use port numbers to direct traffic to the correct application on a device (e.g. port 80 for HTTP, port 443 for HTTPS).
# Linux — set static IP with nmcli nmcli con mod eth0 ipv4.addresses 192.168.1.50/24 nmcli con mod eth0 ipv4.gateway 192.168.1.1 nmcli con mod eth0 ipv4.dns "8.8.8.8" nmcli con mod eth0 ipv4.method manual nmcli con up eth0 # Windows — set static IP via netsh netsh interface ip set address "Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1 # Diagnostics — same intent, different command names ping 8.8.8.8 # both OSes ip a / ipconfig # Linux / Windows — show interface config traceroute 8.8.8.8 / tracert 8.8.8.8 # Linux / Windows — trace the route hop by hop nslookup devriston.com.pk # both — resolve a domain to an IP
# Typical steps via the router's web portal (usually 192.168.1.1 or 192.168.0.1) 1. Log in with admin credentials 2. WAN setup # PPPoE / DHCP / Static, per your ISP 3. DHCP pool # e.g. 192.168.1.100 - 192.168.1.200 for LAN clients 4. Wireless # set SSID, choose WPA2/WPA3, set a strong pre-shared key 5. Save & reboot the router to apply
- Subnet Mask
- Defines which part of an IP address is the network and which is the host.
- Port Number
- A number (0–65535) that routes traffic to the correct application on a device.
- NAT
- Network Address Translation — lets many private IPs share one public IP to reach the internet.
- Three-way handshake
- TCP's connection setup: SYN → SYN-ACK → ACK, before any real data is sent.
Common exam trap: a /24 subnet mask (255.255.255.0) gives 254 usable host addresses, not 256 — the first address is the network address and the last is the broadcast address, neither assignable to a device.
Application Layer Services & Security
The services that make a network actually useful — naming, address assignment, file transfer, the web — plus the basics of keeping it secure.
Core Network Services
DNS translates human-readable domain names (devriston.com.pk) into IP addresses computers use to connect. DHCP automatically assigns IP addresses, subnet masks, gateways, and DNS servers to devices joining a network — without it, every device would need manual configuration. FTP transfers files between a client and server.
Web Services
HTTP is the protocol web browsers and servers use to exchange pages — plain text, unencrypted. HTTPS is HTTP wrapped in SSL/TLS encryption, so data in transit (passwords, card numbers) can't be read if intercepted. Every padlock icon in a browser address bar means HTTPS is active.
Basic Network Security
A firewall filters traffic based on rules (allow/deny by port, IP, or protocol) — the first line of defense at a network's edge. NAT incidentally adds a layer of protection too, since internal private IPs are never directly reachable from the internet. An ACL (Access Control List) is a more granular rule set, often applied on routers/switches to permit or deny specific traffic.
| Port | Service | Protocol |
|---|---|---|
| 20/21 | FTP | TCP |
| 53 | DNS | TCP/UDP |
| 67/68 | DHCP | UDP |
| 80 | HTTP | TCP |
| 443 | HTTPS | TCP |
# Windows — join a workgroup (Settings → System → About → Rename this PC) # then set the same Workgroup name on every PC that should see each other # Share a folder with permissions Right-click folder → Properties → Sharing tab → Advanced Sharing → Share this folder → Permissions → set Read / Change / Full Control # Access a shared folder from another PC \\192.168.1.10\SharedFolder
# Wireshark — capture and inspect live traffic 1. Select your active network interface, click Start Capture 2. Filter traffic by protocol: tcp # show only TCP packets udp # show only UDP packets dns # show only DNS lookups http # show only unencrypted HTTP traffic # Find the TCP three-way handshake: # Look for consecutive packets flagged [SYN] → [SYN, ACK] → [ACK]
- DNS
- Translates domain names into IP addresses — the internet's phone book.
- DHCP
- Automatically assigns IP configuration to devices joining a network.
- Firewall
- Filters network traffic based on rules — allowed ports, IPs, or protocols.
- SSL/TLS
- The encryption layer that turns HTTP into HTTPS, protecting data in transit.
Try it: open Wireshark, visit any non-HTTPS site, and filter by http — you'll see form data readable in plain text. Then visit an HTTPS site and try the same filter — nothing readable shows up. That's the whole point of TLS.
Ready to go beyond reading?
The live course includes hands-on labs, Q&A sessions, and a final enterprise project for your GitHub portfolio. Same instructor who wrote these notes.
💬 Enroll via WhatsApp →Batch info & fee on request