COMPUTER NETWORKS (CN) — QUICK
NOTES
Exam-oriented notes covering networking basics, OSI/TCP-IP models, protocols, addressing, routing, transport,
security, and common formulas.
1. Introduction to Computer Networks
• Computer network: A collection of interconnected devices that communicate and share data/resources.
• Network goals: resource sharing, communication, reliability, scalability, and cost-effective connectivity.
• Components: hosts/end devices, switches, routers, transmission media, network interfaces, and protocols.
• Protocol: A set of rules defining how data is formatted, transmitted, received, and interpreted.
2. Types of Networks
• PAN: Personal Area Network, typically around an individual device/user.
• LAN: Local Area Network covering a limited area such as a home, office, or campus.
• MAN: Metropolitan Area Network covering a city or large campus region.
• WAN: Wide Area Network spanning large geographic areas; the Internet is the largest example.
3. Network Topologies
• Bus: Devices share a common backbone. Simple but a backbone failure can affect the network.
• Star: Devices connect to a central switch/hub. Easy to manage; central-device failure can affect connectivity.
• Ring: Devices form a logical/physical ring.
• Mesh: Devices have multiple interconnections, providing high redundancy but higher cost.
• Hybrid: Combination of two or more topology types.
4. OSI Reference Model
• 7. Application: Network services used by applications; examples include HTTP, FTP, SMTP, DNS.
• 6. Presentation: Data representation, translation, compression, and encryption.
• 5. Session: Establishes, manages, and terminates communication sessions.
• 4. Transport: End-to-end delivery, reliability, flow control, and segmentation; TCP and UDP operate here.
• 3. Network: Logical addressing and routing; IP and routing protocols operate here.
• 2. Data Link: Framing, MAC addressing, error detection, and local delivery.
• 1. Physical: Transmission of raw bits over the physical medium.
5. TCP/IP Model
• Application layer: Combines OSI application, presentation, and session functions.
• Transport layer: TCP and UDP provide process-to-process communication.
• Internet layer: IP handles logical addressing and routing.
• Network Access/Link layer: Handles local network delivery and physical transmission.
• Encapsulation: Each layer adds its own control information as data moves down the protocol stack.
6. Transmission Media
• Guided media: Twisted-pair cable, coaxial cable, and optical fiber.
• Unguided media: Radio, microwave, and infrared.
• Fiber optic: High bandwidth, long distance, and strong resistance to electromagnetic interference.
• Bandwidth: The capacity/range of frequencies of a communication channel; in networking it is often expressed as bit/s
capacity.
7. Data Link Layer
• Framing: Divides the bit stream into manageable frames.
• MAC address: Link-layer hardware address used for local network delivery.
• Error detection: Parity, checksum, and CRC are common techniques.
• Flow control: Prevents a fast sender from overwhelming a slower receiver.
• Ethernet: Widely used LAN technology. Modern switched Ethernet generally uses full-duplex links.
8. Switching
• Circuit switching: Establishes a dedicated communication path for the session.
• Packet switching: Data is divided into packets that share network resources.
• Store-and-forward: A switch/router receives enough data to process/forward it toward the next hop.
• Switch: Primarily forwards frames within a LAN using MAC addresses.
• Router: Connects different IP networks and forwards packets using routing information.
9. IP Addressing
• IPv4: 32-bit address, commonly written in dotted-decimal form such as [Link].
• IPv6: 128-bit address designed to provide a vastly larger address space and additional capabilities.
• Network prefix: Identifies the network portion of an IP address; host bits identify an interface within that network.
• Private IPv4 ranges: [Link]/8, [Link]/12, and [Link]/16.
• NAT: Network Address Translation maps private/internal addresses to public addresses and can conserve IPv4
addresses.
10. Subnetting and CIDR
• Subnet mask/prefix length: Specifies which bits belong to the network prefix.
• CIDR: Classless Inter-Domain Routing represents a network as address/prefix-length, e.g. [Link]/24.
• IPv4 host addresses in a typical subnet: For prefix /n, total addresses = 2^(32−n). Traditional usable-host calculation
is total − 2 for ordinary subnets, with exceptions for /31 and /32.
• Subnetting: Divides a larger network into smaller logical networks to improve organization and address utilization.
11. ARP, ICMP and DHCP
• ARP: Resolves an IPv4 address to a MAC address on a local network.
• ICMP: Carries network-control and error-reporting messages; ping uses ICMP Echo messages.
• DHCP: Automatically provides network configuration such as IP address, subnet information, gateway, and DNS server.
• DHCP process: Commonly summarized as DORA — Discover, Offer, Request, Acknowledge.
12. Routing
• Routing: Selecting paths for packets from source network to destination network.
• Static routing: Routes are manually configured.
• Dynamic routing: Routers exchange information and adapt routes as network conditions/topology change.
• Distance-vector: Routers learn routes using distance/cost information from neighbors; RIP is a classic example.
• Link-state: Routers build a topology view and compute shortest paths; OSPF is a common example.
• BGP: A major inter-domain routing protocol used to exchange reachability information between autonomous systems.
13. Transport Layer: TCP vs UDP
• TCP: Connection-oriented, reliable, ordered byte-stream delivery with acknowledgments, retransmission, flow control,
and congestion control.
• UDP: Connectionless datagram transport with low overhead; it does not provide TCP-style reliability or ordering.
• TCP use cases: Web traffic, file transfer, email, and applications where reliable ordered delivery is important.
• UDP use cases: DNS queries, real-time media, gaming, and other applications where low overhead or
application-controlled reliability is useful.
14. TCP Concepts
• Three-way handshake: SYN → SYN-ACK → ACK, used to establish a TCP connection.
• Sequence numbers: Help TCP order bytes and detect missing data.
• Acknowledgments: Confirm successfully received data.
• Flow control: Receiver advertises a window to limit outstanding data.
• Congestion control: TCP adjusts sending behavior based on perceived network congestion; concepts include slow
start and congestion avoidance.
15. Application Layer Protocols
• HTTP/HTTPS: Web communication; HTTPS adds TLS protection.
• DNS: Translates domain names to IP addresses and other DNS records.
• FTP: File transfer protocol.
• SMTP: Common protocol for sending email.
• POP3/IMAP: Common protocols for retrieving/managing email.
• SSH: Secure remote login and command execution.
16. Network Security Basics
• Confidentiality: Prevent unauthorized disclosure of information.
• Integrity: Prevent unauthorized modification of data.
• Availability: Keep services and resources accessible when needed.
• Firewall: Filters traffic according to configured security rules.
• Encryption: Converts readable data into protected ciphertext using cryptographic methods.
• TLS: Provides cryptographic protection for many application protocols, including HTTPS.
17. Common Network Devices
• Repeater: Regenerates/reshapes signals to extend a physical link.
• Hub: Basic multiport repeater that sends incoming signals to multiple ports.
• Bridge: Connects LAN segments and forwards frames based on link-layer information.
• Switch: Multiport device that forwards frames based on MAC addresses.
• Router: Forwards IP packets between networks.
• Gateway: A device or system that provides connectivity or protocol translation between different networks/systems.
18. Quick Revision Table
Topic Key point
OSI 7-layer reference model: Application, Presentation, Session, Transport, Network, Data Link, Physical.
TCP Reliable, connection-oriented, ordered transport.
UDP Connectionless, lightweight datagram transport.
Switch Primarily forwards LAN frames using MAC addresses.
Router Forwards packets between IP networks.
IPv4 32-bit addressing.
IPv6 128-bit addressing.
DNS Maps domain names to IP addresses/records.
DHCP Automatically provides network configuration.
ARP Maps IPv4 address to MAC address on a local network.
HTTP/HTTPS Web protocols; HTTPS uses TLS protection.
Exam tip: Memorize the OSI layers in order, compare TCP and UDP, practice IPv4 subnetting, and know the roles of
switches, routers, ARP, DNS, DHCP, and common routing protocols.