Computer Networks Cheat Sheet

OSI Model Layers

LayerNameData UnitFunctionExamples
7ApplicationDataNetwork process to applicationHTTP, FTP, SMTP, DNS
6PresentationDataData representation, encryptionSSL/TLS, JPEG, MPEG
5SessionDataDialog control, synchronizationNetBIOS, PPTP, RPC
4TransportSegmentEnd-to-end communicationTCP, UDP
3NetworkPacketPath determination, logical addressingIP, ICMP, ARP
2Data LinkFramePhysical addressing, error detectionEthernet, Wi-Fi, PPP
1PhysicalBitMedia, signal transmissionCables, hubs, repeaters

TCP/IP Model

LayerNameProtocolsFunctionComparison to OSI
4ApplicationHTTP, FTP, SMTP, DNS, DHCPProcess-to-process communicationCombines OSI layers 5-7
3TransportTCP, UDPPort-to-port communicationOSI layer 4
2InternetIP, ICMP, ARP, IGMPHost-to-host communicationOSI layer 3
1Network AccessEthernet, Wi-Fi, PPPNetwork media accessCombines OSI layers 1-2

Network Protocols

ProtocolLayerPortDescriptionCharacteristics
TCPTransportN/ATransmission Control ProtocolConnection-oriented, reliable, ordered
UDPTransportN/AUser Datagram ProtocolConnectionless, fast, unreliable
HTTPApplication80HyperText Transfer ProtocolWeb page transfer
HTTPSApplication443HTTP SecureEncrypted HTTP
FTPApplication20, 21File Transfer ProtocolFile transfer
SMTPApplication25Simple Mail Transfer ProtocolEmail transmission
POP3Application110Post Office ProtocolEmail retrieval
IMAPApplication143Internet Message Access ProtocolAdvanced email access
DNSApplication53Domain Name SystemName to IP resolution
DHCPApplication67, 68Dynamic Host Configuration ProtocolAutomatic IP assignment
SNMPApplication161, 162Simple Network Management ProtocolNetwork device monitoring

IP Addressing

ClassRangeDefault Subnet MaskNetwork BitsHost BitsMax NetworksMax Hosts
A1.0.0.0 - 126.255.255.255255.0.0.082412616,777,214
B128.0.0.0 - 191.255.255.255255.255.0.0161616,38465,534
C192.0.0.0 - 223.255.255.255255.255.255.02482,097,152254
D224.0.0.0 - 239.255.255.255N/AMulticastMulticastMulticastMulticast
E240.0.0.0 - 255.255.255.255N/AExperimentalExperimentalExperimentalExperimental

Subnetting

Subnet MaskBinaryWildcardNetworksHostsUseful IPs
255.0.0.011111111.00000000.00000000.000000000.255.255.255116,777,21616,777,214
255.128.0.011111111.10000000.00000000.000000000.127.255.25528,388,6088,388,606
255.192.0.011111111.11000000.00000000.000000000.63.255.25544,194,3044,194,302
255.224.0.011111111.11100000.00000000.000000000.31.255.25582,097,1522,097,150
255.240.0.011111111.11110000.00000000.000000000.15.255.255161,048,5761,048,574
255.248.0.011111111.11111000.00000000.000000000.7.255.25532524,288524,286
255.252.0.011111111.11111100.00000000.000000000.3.255.25564262,144262,142
255.254.0.011111111.11111110.00000000.000000000.1.255.255128131,072131,070
255.255.0.011111111.11111111.00000000.000000000.0.255.25525665,53665,534

Routing Protocols

ProtocolTypeAlgorithmUpdate MethodUse Case
RIP (v1/v2)Distance VectorDistance VectorPeriodic updatesSmall networks, simple configuration
OSPFLink StateDijkstra's AlgorithmTriggered updatesLarge networks, complex topologies
EIGRPHybridDUAL AlgorithmPartial updatesCisco networks, fast convergence
BGPPath VectorPath VectorIncremental updatesInternet backbone, inter-AS routing
IS-ISLink StateSPF AlgorithmLink state updatesService provider networks

Network Devices

DeviceLayerFunctionUse CaseAdvantages
RepeaterPhysicalAmplify signalsExtend cable lengthSignal amplification
HubPhysicalConnect multiple devicesSimple network connectionsLow cost, simple
BridgeData LinkConnect network segmentsSegment collision domainsFilter traffic
SwitchData LinkConnect devices with MAC learningModern network connectionsFast, intelligent filtering
RouterNetworkConnect networks, route packetsConnect different networksPath selection, traffic control
GatewayApplicationProtocol conversionConnect different network typesProtocol translation
FirewallNetwork/ApplicationSecurity filteringNetwork securitySecurity, access control

Network Topologies

TopologyDescriptionAdvantagesDisadvantagesUse Case
BusSingle cable connects all devicesEasy to install, low costSingle point of failure, difficult to troubleshootSmall networks
StarAll devices connect to central hub/switchEasy to install and manage, failure of one device doesn't affect othersRequires more cable, hub failure affects allMost LANs
RingEach device connects to two others forming a ringEqual access, predictable performanceSingle break affects entire networkToken Ring networks
MeshEvery device connects to every other deviceHigh reliability, multiple pathsExpensive, complexCritical networks
TreeHierarchical structure with rootScalable, easy to manageRoot failure affects entire networkLarge networks
HybridCombination of topologiesFlexible, scalableComplex, expensiveLarge enterprise networks

Network Security

TechnologyFunctionDescriptionAdvantagesDisadvantages
FirewallAccess ControlFilters network traffic based on rulesPrevents unauthorized accessMay block legitimate traffic
VPNSecure CommunicationCreates encrypted tunnel over public networkSecure remote accessPerformance overhead
IDSIntrusion DetectionMonitors network for suspicious activityReal-time threat detectionFalse positives
IPSIntrusion PreventionBlocks detected threatsPrevents attacks in real-timeMay impact performance
AAAAuthentication/Authorization/AuditingNetwork access control frameworkComprehensive access controlComplexity
802.1XPort-based Network Access ControlAuthenticates devices before network accessSecure network accessRequires infrastructure support

Wireless Technologies

StandardFrequencyMax SpeedRangeYearCharacteristics
802.11a5 GHz54 MbpsShorter range1999OFDM, more channels
802.11b2.4 GHz11 MbpsLonger range1999Lower speed, longer range
802.11g2.4 GHz54 MbpsLonger range2003Backward compatible with b
802.11n2.4/5 GHz600 MbpsImproved range2009MIMO, 40 MHz channels
802.11ac5 GHz6.9 GbpsShorter range2013Multi-user MIMO, beamforming
802.11ax (Wi-Fi 6)2.4/5 GHz9.6 GbpsImproved efficiency2019OFDMA, improved density
802.11be (Wi-Fi 7)2.4/5/6 GHz46 GbpsEnhanced range2024320 MHz channels, 4K QAM

Network Troubleshooting Commands

CommandOSPurposeCommon Use
pingAllTest IP connectivityCheck if host is reachable
tracert (traceroute)Windows (Unix)Trace route to destinationIdentify network path and delays
ipconfig (ifconfig)Windows (Unix)Display IP configurationView network settings
netstatAllDisplay network connectionsCheck active connections and ports
nslookup (dig)AllDNS lookupResolve domain names to IPs
arpAllARP table managementView MAC address mappings
telnetAllTest port connectivityCheck if port is open
routeAllDisplay/modify routing tableView routing information