V9
Velocity9
Computer Network
Documentation

CIDR, Subnetting, Internet Gateway, and More

Detailed notes on CIDR, Subnetting, Internet Gateway, NAT, and DHCP in computer networks.

๐ŸŒ Computer Network Notes: CIDR, Subnetting, Internet Gateway, and More

๐Ÿงฎ CIDR (Classless Inter-Domain Routing)

Definition: CIDR is a method for allocating IP addresses and routing that replaces the older classful addressing system. It allows more efficient use of IP address space.
Key Points:

  • Introduced in 1993 to replace Class A, B, and C networks.
  • Uses the format: IP_address/prefix_length (e.g., 192.168.1.0/24).
  • The prefix length indicates the number of bits used for the network portion of the address.
  • Example:
    • 192.168.1.0/24 โ†’ 255.255.255.0 (256 addresses)
    • 10.0.0.0/16 โ†’ 255.255.0.0 (65,536 addresses)
      Advantages:
  • Efficient IP address utilization.
  • Reduces the size of routing tables.
  • Supports route aggregation (supernetting).
    Disadvantages:
  • Slightly more complex to calculate and manage compared to classful addressing.

๐Ÿงฉ Subnetting

Definition: Subnetting divides a single IP network into smaller logical sub-networks (subnets).
Purpose:

  • Improves network management, security, and performance.
  • Efficient use of available IP addresses.
    Key Concepts:
  • A subnet mask identifies the network and host portions of an IP address.
  • Example:
    • IP: 192.168.1.100
    • Subnet Mask: 255.255.255.0 โ†’ /24
    • Network Address: 192.168.1.0
    • Broadcast Address: 192.168.1.255
      Formula:
  • Subnets = 2โฟ (n = borrowed bits)
  • Hosts per subnet = 2สฐ โˆ’ 2 (h = host bits)
    Advantages:
  • Reduces network congestion.
  • Better control and security per subnet.
    Disadvantages:
  • Complex configuration for large networks.

๐ŸŒ‰ Internet Gateway

Definition: An Internet Gateway connects a private network (LAN) to the Internet, acting as a bridge between the two.
Key Functions:

  • Provides a path for traffic to reach the Internet.
  • Performs Network Address Translation (NAT).
  • Enforces firewall and security rules.
    Types:
  1. Default Internet Gateway (AWS/Cloud) โ€“ Routes traffic from private subnets to the Internet.
  2. Hardware/Software Gateways โ€“ Routers or firewalls in enterprise setups.
    Advantages:
  • Enables Internet connectivity.
  • Adds control and security.
    Disadvantages:
  • Can become a bottleneck if overloaded.

๐Ÿ” NAT (Network Address Translation)

Definition: NAT translates private IP addresses into public IPs before sending packets to the Internet.
Purpose:

  • Conserves public IP addresses.
  • Adds a security layer by hiding internal IPs.
    Types:
  1. Static NAT โ€“ One-to-one mapping.
  2. Dynamic NAT โ€“ Uses a pool of public IPs.
  3. PAT (Port Address Translation) โ€“ Many private IPs share one public IP via ports.
    Advantages:
  • Saves IPs.
  • Adds obscurity for internal hosts.
    Disadvantages:
  • Can break certain apps (e.g., VoIP).
  • Adds processing overhead.

โš™๏ธ DHCP (Dynamic Host Configuration Protocol)

Definition: DHCP automatically assigns IP addresses and other configuration details (DNS, gateway) to devices.
Key Functions:

  • Automates IP configuration.
  • Uses UDP ports 67 (server) and 68 (client).
    DHCP Process (DORA):
  1. Discover โ€“ Client broadcasts for IP.
  2. Offer โ€“ Server offers IP.
  3. Request โ€“ Client requests the offered IP.
  4. Acknowledge โ€“ Server confirms.
    Advantages:
  • Simplifies IP management.
  • Avoids conflicts.
    Disadvantages:
  • If server fails, new devices canโ€™t get IPs.
  • Not ideal for static devices.

๐Ÿงญ Summary Table

ConceptFull FormFunctionKey FeatureAdvantageLayer
CIDRClassless Inter-Domain RoutingEfficient IP allocationVariable-length subnet maskSaves address spaceNetwork
Subnettingโ€”Divides network into smaller subnetsImproves managementEfficient IP useNetwork
Internet Gatewayโ€”Connects LAN to InternetPerforms NAT and routingInternet accessNetwork
NATNetwork Address TranslationMaps private to public IPsHides internal addressesIP conservationNetwork
DHCPDynamic Host Configuration ProtocolAssigns IPs automaticallyDORA processSimplifies managementApplication

Summary:

  • CIDR enables flexible IP allocation.
  • Subnetting divides a network for better management.
  • Internet Gateways connect private networks to the Internet.
  • NAT conserves public IPs and secures internal systems.
  • DHCP automates IP assignment and simplifies configuration.
Need help with this topic?