Computer networks in one shot  - The Ultimate Cheat Sheet

    Computer networks in one shot - The Ultimate Cheat Sheet

    This Computer Networks cheat sheet is designed as a quick yet complete revision guide for the most important networking concepts. It walks through the fundamentals like how devices communicate, the OSI and TCP/IP models, IP addressing, DNS, HTTP/HTTPS, routing, switching, and commonly used network protocols. The goal is to explain these ideas in a simple and practical way so you can understand how networks actually work behind the scenes. It’s a helpful one-shot resource for students preparing for interviews, exams, or anyone who wants to refresh their networking basics in one place.

    default profile

    Shreyash Gurav

    March 04, 2026

    8 min read

    Computer Networks in One Shot - The Ultimate Cheatsheet Cheat Sheet

    A complete computer networks cheat sheet that simplifies core networking concepts including OSI layers, TCP/IP model, network topologies, IP addressing, subnetting, networking protocols, devices, and security basics. Perfect for quick revision and interview preparation.

    Introduction to Computer Networks#

    What is a Computer Network#

    A computer network is a collection of interconnected devices that can communicate and share resources with each other. These devices, ranging from computers and servers to printers and smartphones, use transmission media and protocols to exchange data.

    Why Networks are Needed#

    • Resource sharing (printers, storage, applications)
    • Cost reduction through hardware and software sharing
    • Improved communication and collaboration
    • Centralized data management and backup
    • Increased reliability through alternative paths

    Types of Networks#

    Network TypeCoverageTypical Use
    PAN (Personal Area Network)Few metersConnecting personal devices like phone, laptop, Bluetooth devices
    LAN (Local Area Network)Building or campusOffice networks, school computer labs, home networks
    MAN (Metropolitan Area Network)City-wideCable TV networks, city government connectivity
    WAN (Wide Area Network)Country or globalInternet, multinational corporate networks

    Network Topologies#

    Bus Topology: All devices connect to a single central cable. Simple but a break in the main cable brings down the entire network.

    Star Topology: All devices connect to a central hub or switch. Easy to install and manage, but central device failure affects all connected devices.

    Ring Topology: Each device connects to two other devices, forming a circular path. Data travels in one direction, reducing collision risk.

    Mesh Topology: Every device connects to every other device. Provides high redundancy and reliability but expensive to implement.

    Hybrid Topology: Combination of two or more different topologies. Used in larger networks to leverage benefits of multiple topologies.

    Network Topologies

    OSI Model#

    The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes networking functions into seven distinct layers.

    The Seven Layers Explained#

    Layer 1: Physical Layer Handles the physical connection between devices. Converts data into bits for transmission over physical media like cables or radio waves. Defines voltage levels, cable specifications, and data rates.

    Layer 2: Data Link Layer Provides node-to-node data transfer and handles error correction from the physical layer. Organizes bits into frames and manages MAC addresses. Switches and bridges operate at this layer.

    Layer 3: Network Layer Responsible for packet forwarding and routing. Determines the best path for data transmission using logical addresses (IP addresses). Routers operate at this layer.

    Layer 4: Transport Layer Ensures complete data transfer with error recovery and flow control. Segments and reassembles data. TCP and UDP protocols work here.

    Layer 5: Session Layer Manages sessions between applications. Establishes, maintains, and terminates connections. Handles authentication and reconnection after interruptions.

    Layer 6: Presentation Layer Translates data between application and network formats. Handles encryption, compression, and data formatting. Ensures data from sender is readable by receiver.

    Layer 7: Application Layer Closest to end users. Provides network services directly to applications. HTTP, FTP, SMTP protocols operate at this layer.

    OSI Layers and Functions#

    LayerNameFunctionExample Devices/Protocols
    7ApplicationUser interface and application supportHTTP, FTP, SMTP, DNS
    6PresentationData translation, encryption, compressionSSL, TLS, JPEG, ASCII
    5SessionSession management and synchronizationNetBIOS, RPC, SQL
    4TransportEnd-to-end delivery, error recoveryTCP, UDP, SPX
    3NetworkLogical addressing, routingIP, ICMP, ARP, Routers
    2Data LinkPhysical addressing, error detectionEthernet, PPP, Switches
    1PhysicalBit transmission, hardware specsCables, Hubs, Repeaters

    Mnemonic to Remember the Layers#

    Please Do Not Throw Sausage Pizza Away (Physical, Data Link, Network, Transport, Session, Presentation, Application)

    OSI Model

    TCP/IP Model#

    The TCP/IP model is a practical, streamlined framework based on standard protocols used on the internet.

    The Four Layers#

    Application Layer Combines the functions of OSI's Application, Presentation, and Session layers. Handles high-level protocols, data representation, and session management. Includes HTTP, FTP, SMTP, and DNS.

    Transport Layer Corresponds to OSI's Transport layer. Provides reliable or unreliable delivery and error checking. Uses TCP for reliable connections and UDP for faster, connectionless communication.

    Internet Layer Equivalent to OSI's Network layer. Handles logical addressing and routing. The core protocol is IP, supported by ICMP and ARP.

    Network Access Layer Combines OSI's Data Link and Physical layers. Manages hardware addressing and physical transmission over the network medium.

    TCP/IP Model

    Protocol Examples by Layer#

    LayerProtocols
    ApplicationHTTP, HTTPS, FTP, SMTP, POP3, DNS, DHCP
    TransportTCP, UDP
    InternetIPv4, IPv6, ICMP
    Network AccessEthernet, Wi-Fi, PPP, ARP

    OSI vs TCP/IP Comparison#

    AspectOSI ModelTCP/IP Model
    Layers7 layers4 layers
    DevelopmentTheoretical standardPractical, protocol-based
    ApproachLayer-by-layer separationProtocol-specific grouping
    UsageReference modelActual implementation
    TransportConnection-oriented and connectionlessTCP (connection-oriented), UDP (connectionless)
       

    Networking Devices#

    Device Descriptions#

    Hub: Basic device that connects multiple Ethernet devices. Broadcasts data to all ports regardless of destination. Operates at Physical layer.

    Switch: Intelligent device that forwards data only to specific destination ports using MAC addresses. Operates at Data Link layer.

    Router: Connects different networks and directs data packets between them using IP addresses. Operates at Network layer.

    Bridge: Connects two network segments and filters traffic based on MAC addresses. Reduces unnecessary traffic.

    Repeater: Amplifies and regenerates signals to extend network distance. Operates at Physical layer.

    Gateway: Translates data between different network protocols or architectures. Can operate at multiple layers.

    Modem: Modulates and demodulates signals for transmission over telephone or cable lines. Converts digital to analog and vice versa.

    Access Point: Allows wireless devices to connect to a wired network. Extends wireless coverage.

    Device Reference Table#

    DeviceOSI LayerPurpose
    HubPhysicalConnects devices, broadcasts to all ports
    SwitchData LinkForwards data to specific MAC addresses
    RouterNetworkRoutes between networks using IP addresses
    BridgeData LinkConnects and filters between network segments
    RepeaterPhysicalExtends network distance by signal amplification
    GatewayMultipleTranslates between different protocols
    ModemPhysicalConverts digital/analog signals for transmission
    Access PointData LinkProvides wireless connectivity to wired network

    IP Addressing#

    IPv4 Format#

    IPv4 addresses are 32-bit numbers written as four decimal octets separated by dots. Each octet ranges from 0 to 255.

    Example: 192.168.1.10

    IPv6 Basics#

    IPv6 addresses are 128-bit hexadecimal numbers written as eight groups of four hexadecimal digits separated by colons. Developed to address IPv4 exhaustion.

    Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

    Public vs Private IP Addresses#

    TypeDescriptionExample Ranges
    PublicGlobally unique, routable on internetAssigned by ISP
    PrivateUsed within local networks, not routable on internet10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16

    Static vs Dynamic IP#

    Static IP: Manually assigned, permanent address. Used for servers and devices needing constant access.

    Dynamic IP: Automatically assigned by DHCP server. Changes periodically. Common for client devices.

    Loopback Address#

    127.0.0.1 (IPv4) or ::1 (IPv6) used to test network software on local machine without sending packets over network.

    Subnet Mask#

    A 32-bit number that divides an IP address into network and host portions. Uses binary 1s for network bits and 0s for host bits.

    Example: 255.255.255.0 indicates first 24 bits are network portion.

    CIDR Notation#

    Classless Inter-Domain Routing notation specifies IP address and network prefix length.

    Example: 192.168.1.0/24 indicates 24 bits for network portion, 8 bits for hosts.

    Subnetting#

    Why Subnetting is Needed#

    • Efficient IP address utilization
    • Improved network performance through reduced broadcast traffic
    • Enhanced security by isolating network segments
    • Simplified network management

    Basic Formula#

    Number of subnets = 2^n where n is number of bits borrowed from host portion Number of hosts per subnet = 2^h - 2 where h is remaining host bits

    Simple Example Calculation#

    Network: 192.168.1.0/24 Requirement: Create 4 subnets

    Borrow 2 bits from host portion (2^2 = 4 subnets) New subnet mask: /26 or 255.255.255.192

    Resulting subnets:

    • 192.168.1.0/26 (hosts: 192.168.1.1 - 192.168.1.62)
    • 192.168.1.64/26 (hosts: 192.168.1.65 - 192.168.1.126)
    • 192.168.1.128/26 (hosts: 192.168.1.129 - 192.168.1.190)
    • 192.168.1.192/26 (hosts: 192.168.1.193 - 192.168.1.254)

    Host Calculation#

    For /26 subnet (64 addresses total):

    • Network address: first address
    • Broadcast address: last address
    • Usable hosts: 62 (total - 2)

    Common Networking Protocols#

    ProtocolPortPurpose
    HTTP80Web page transfer, unencrypted
    HTTPS443Secure web page transfer with encryption
    FTP20, 21File transfer between client and server
    SSH22Secure remote terminal access and command execution
    SMTP25Email sending and relaying between mail servers
    POP3110Email retrieval from mail server to client
    DNS53Domain name to IP address resolution
    DHCP67, 68Automatic IP address assignment to devices
    Telnet23Remote terminal access (unencrypted, insecure)

    Network Security Basics#

    Firewall#

    A security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. Can be hardware-based, software-based, or both. Creates a barrier between trusted internal and untrusted external networks.

    VPN#

    Virtual Private Network creates encrypted connections over public networks. Provides secure remote access to private networks, masking user location and encrypting all transmitted data.

    SSL/TLS#

    Secure Socket Layer and Transport Layer Security are cryptographic protocols providing secure communication over networks. Used extensively in web browsing (HTTPS), email, and VoIP. TLS is the modern successor to SSL.

    Encryption#

    Process of converting data into unreadable format using algorithms and keys. Ensures data confidentiality during transmission and storage. Common types include symmetric (same key for encryption/decryption) and asymmetric (public/private key pairs).

    Authentication#

    Verification of user or device identity before granting network access. Methods include passwords, biometrics, digital certificates, and multi-factor authentication combining multiple verification methods.

    Network Security

    Important Networking Commands#

    CommandDescriptionExample
    pingTests connectivity to a target by sending ICMP echo requestsping google.com
    tracert / tracerouteShows the path packets take to reach destinationtracert 192.168.1.1
    ipconfigDisplays IP configuration on Windows systemsipconfig /all
    ifconfigDisplays network configuration on Linux/Unix systemsifconfig eth0
    netstatShows network connections, routing tables, interface statisticsnetstat -an
    nslookupQueries DNS to obtain domain name or IP address mappingnslookup example.com

    Conclusion#

    This cheat sheet explains the basic networking concepts like OSI & TCP/IP models, IP addressing, subnetting, common protocols, and basic security. It also includes useful command-line tools for network troubleshooting.

    It’s helpful for quick learning, interview preparation, and revision of networking fundamentals.

    If you like it, please share it with your friends!

    Want to Master Spring Boot and Land Your Dream Job?

    Struggling with coding interviews? Learn Data Structures & Algorithms (DSA) with our expert-led course. Build strong problem-solving skills, write optimized code, and crack top tech interviews with ease

    Learn more
    Computer networks
    Internet
    Was it helpful?

    Subscribe to our newsletter

    Read articles from Coding Shuttle directly inside your inbox. Subscribe to the newsletter, and don't miss out.