# Network Cheat Sheet ## Port Numbers to Remember 20 FTP Data 21 FTP Control 22 SSH 23 Telnet 25 SMTP 53 DNS 67 DHCP Server 68 DHCP Client 80 HTTP 110 POP3 143 IMAP 161 SNMP 443 HTTPS 3306 MySQL 3389 RDP Remote Desktop ## Subnet Mask Quick Reference /8 = 255.0.0.0 = 16777214 hosts /16 = 255.255.0.0 = 65534 hosts /24 = 255.255.255.0 = 254 hosts /25 = 255.255.255.128 = 126 hosts /26 = 255.255.255.192 = 62 hosts /27 = 255.255.255.224 = 30 hosts /28 = 255.255.255.240 = 14 hosts /29 = 255.255.255.248 = 6 hosts /30 = 255.255.255.252 = 2 hosts ## OSI Layers One Line Each 7 Application - HTTP FTP DNS SMTP 6 Presentation - SSL TLS JPEG encryption 5 Session - NetBIOS RPC session management 4 Transport - TCP UDP port numbers 3 Network - IP ICMP ARP routing 2 Data Link - Ethernet WiFi MAC frames 1 Physical - cables signals bits volts ## Private IP Ranges 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 ## Special Addresses 127.0.0.1 = loopback localhost 0.0.0.0 = default route or unspecified 255.255.255.255 = broadcast all networks 169.254.0.0/16 = link local APIPA auto-assigned when DHCP fails ## TCP vs UDP Summary TCP = reliable ordered connection-oriented slow UDP = unreliable no-order connectionless fast TCP uses SYN SYN-ACK ACK handshake UDP just sends data directly TCP for HTTP HTTPS FTP SSH SMTP IMAP UDP for DNS DHCP SNMP NTP VoIP streaming ## Routing Protocol Quick Compare RIP - distance vector - hop count - max 15 hops - slow convergence OSPF - link state - cost bandwidth - fast convergence - large networks EIGRP - Cisco advanced distance vector - composite metric - DUAL BGP - path vector - between AS - internet routing - policy based ## Common Network Troubleshooting Commands ping - test reachability traceroute or tracert - trace path nslookup or dig - DNS lookup ipconfig or ifconfig - show IP config netstat - show connections and ports arp -a - show ARP table route print or ip route - show routing table wireshark or tcpdump - packet capture ## Networking Mnemonics OSI layers top to bottom: All People Seem To Need Data Processing OSI layers bottom to top: Please Do Not Throw Sausage Pizza Away Subnetting steps: N-S-H-B (Network Subnets Hosts Broadcast) TCP handshake: SYN SYN-ACK ACK DHCP: DORA Discover Offer Request Acknowledge ## VLANs Summary VLAN separates broadcast domains on same switch Access port - one VLAN - connects to end devices Trunk port - multiple VLANs - connects switches and routers 802.1Q tag - 4 bytes added to frame - contains 12 bit VLAN ID Native VLAN - untagged on trunk - default is VLAN 1 change for security Inter-VLAN routing - needs router or Layer 3 switch