TH 06 ‐ IP and RFC 1918 - gautam-amitesh/OCI GitHub Wiki

IP

In networking, IP stands for Internet Protocol which is communication protocol used to interconnect network devices over the internet. Think of the IP as a postal system and imagine a letter needs to be delivered to A201, Astha Residency, Bindal Enclave, Phi IV, Greater Noida, Uttar Pradesh originating from C402, Nayra Residency, Boaring Road, Patna, Bihar:

  • IP Address: this is the exact destination address written outside of the envelope
  • The Protocol: rules that the post office uses to read the state (Uttar Pradesh), then the city (Greater Noida), then the sector to pass the envelop from one sorting facility to the next

IP address / IPv4 (Architectural limitation)

An IP Address is a unique 32-bit number which is written in four segments (203.0.113.45). For a growing user-base in 1990s it became impossible to provide a unique IP Address to every single device connected to the network which was the assumption in the early days of the internet. Mathematically, a 32-bit system can only generate about 4.3 billion unique addresses, so we simply ran out of numbers.

RFC 1918 (Hotfix)

In 1996 IETF published Request For Comments (RFC) 1918. This document solved the problem of IPv4 address by presenting a new standard that designed three CLASS of IP addresses and permanently reserved each CLASS of IP addresses for different network size. There was a restriction that these addresses cannot be routed on the public internet.

  • Every IP network is defined by two mandatory limits (not assignable to any individual system):

    • Network ID (first address) eg. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16
    • Broadcast ID (last address) eg. 10.255.255.255/8, 172.31.255.255/12, and 192.168.255.255/16
  • CLASS of IP Addresses (IP Addresses are assigned between Network ID and Broadcast ID):

    • CLASS A: 10.0.0.0/8 to 10.255.255.255/8 (used by large enterprises and corporate networks)
    • CLASS B: 172.16.0.0/12 to 172.31.255.255/12 (used by medium-sized networks, often in data centers or virtual machines)
    • CLASS C: 192.168.0.0/16 to 192.168.255.255/16 (default for almost all home routers and small networks)
  • Working of RFC 1918

    • Our local devices only have private RFC 1918 addresses with which they cannot communicate with the outside internet and here comes the NAT (Network Address Translation)
    • Our router uses NAT
    • Our system can communicate with our router with private IP
    • When our system sends a request to the router, the router takes that request, and replaces private IP with router's public IP
    • Our router sends the request to the internet, gets the response, next it routes the data back to our private IP