Week 4 - samuelwilson02/tech-journal GitHub Wiki

IP Addressing and Subnetting

Basics

  • modern networks use MAC addresses and IP addresses
  • an IP address is a 32-bit number written as 4 numbers (0-255, i.e. 8 bits = 1 octet), separated by dots (called packet address format)
  • every IP has two parts: Network ID (in the beginning) and the Host ID (the rest)

Subnet Mask/CIDR

  • the subnet mask tells you how many bits belong to the Net ID
  • written as "slash" number - /24 - called the Prefix Mask or CIDR notation
  • /24 = first 24 bits (3 octets) are the Net ID -> 255.255.255.0
  • remaining bits are the Host ID
  • sometimes a singe octet is split between Net ID and Host ID (when the prefix isn't a multiple of 8)
  • every Host ID must be unique in a network

Assigned Network IDs

  • organizations are assigned a Net ID to use (e.g. Champlain College = 216.93.144.0/20)
  • all hosts on a network share the same Net ID portion; the network address itself (all 0s host bits) can't be assigned to a device

Subnetting (splitting networks)

  • Most organizations need more than one network - using host bits to make new networks helps:
  1. prevent one network from getting overcrowded (broadcast traffic issues)
  2. improved organization/management
  3. enhanced security
  • to subnet: borrow bits from the Host ID to create additional Net IDs (e.g. go from /20 -> /24), creates several smaller subnetworks
    • first subnet - 216.92.144.0, second subnet - 216.93.145.0/24
  • all 0s in the Host ID = the network address itself -> cannot be assigned to a host
  • all 1s in the Host ID = the broadcast address -> cannot be assigned to a host
  • smaller networks are easier to manage and less complicated
Class Range Default Prefix Typical Use
A 1.0.0.0 - 127.255.255.255 /8 ISPs, large corporations
B 128.0.0.0 - 191.255.255.255 /16 universities, large businesses
C 192.0.0.0 - 223.255.255.255 /24 small businesses, home networks
D/E -- -- Exist but not applicable, multicast/experimental

Reserved Ranges

  • 127.0.0.0/8 - Loopback (used to test if your own NIC/network stack is working - e.g. 127.0.0.1)
  • 169.254.0.0/16 - link-local (auto assigned when no DHCP is available; local hosts only, not routable