IP Addressing
• IPv4 address is a 32 bit address : uniquely
  identifies a device on an IP network.
                232 = 4,294,967,296 addresses
   • Note: IPv6 (128 bit IP address) 2128 = 3.4 * 1038
          IP Addressing: introduction
• IP address: 32-bit                     223.1.1.1
  identifier for host,                                            223.1.2.1
                                         223.1.1.2
  router interface                              223.1.1.4    223.1.2.9
• interface: connection                                           223.1.2.2
  between host, router                  223.1.1.3    223.1.3.27
  and physical link
   – router’s typically have
     multiple interfaces                  223.1.3.1            223.1.3.2
   – host may have multiple
     interfaces
   – IP addresses associated
     with interface, not host, 223.1.1.1 = 11011111 00000001 00000001 00000001
     or router
                                             223         1          1         1
                                                                              #2
IP address = (netid, hostid)
R2’s Routing Table
                     4
           R2’s Routing Table
                                           R2
The IP addresses must of course be resolved into
physical address for actual transmission to take place
                                                         5
Finding the class in binary notation
Finding the class in decimal notation
         IP Address Classes
• Class A: The first octet is the network
  portion. Octets 2, 3, and 4 are for
  subnets/hosts
• Class B: The first two octets are the
  network portion. Octets 3 and 4 are for
  subnets/hosts
• Class C: The first three octets are the
  network portion. Octet 4 is for
  subnets/hosts
    IP Addresses Conventions
• The smallest hostid (all 0’s) is never
  assigned to an individual host, instead it is
  used to refer to the network
• IP addresses can refer to hosts or
  networks
• Examples:
  – (6,8) = host #8 on network #6
  – (9,0) = network #9
    IP Addresses Conventions
              (cont)
• The largest hostid (all 1’s) is never
  assigned to an individual host, instead it is
  used to refer to a directed broadcast
• Example:
  – (00000101,111111111111111111111111) = all
    hosts on network #5
/8
                              27-2 = 126 networks
                              224-2 = 16,777,214 hosts / network
/16
                              214 = 16,384 networks
                              216-2 = 65,534 hosts / network
/24
                              221 = 2,097,152 networks
                              28-2 = 254 hosts / network
Class D: (IP Multicasting)
      0          4
          1110
Class E: (Experimental use)
      0          4
          1111
 Classes of IP Addresses (cont)
• A small number (~27) of class A networks
  with a large number (~224) of hosts
• A medium number (~214) of class B
  networks with a medium number (~216) of
  hosts
• A large number (~221) of class C networks
  with a small number (~28) of hosts
      Limitations to Classful Addressing
• Running out of address space soon
  232 = 4,294,967,296 addresses
• Class boundaries did not foster
  efficient allocation of address space
  Lack of address class to support medium size company
  -- Class B: 65534 hosts/network, too big!
  -- Class C: 254 hosts/network,     too small!
  -- Use multiple class C addresses,
      increase routing table!
  • A mask is a 32-bit binary number.
  • The mask is ANDeD with IP address
    to get
      • The bloc address (Network address)
      • Mask And IP address = Block Address
Default Subnet Mask
CLASS A - 255.0.0.0              32 binary bits can be divisible into a
CLASS B - 255.255.0.0            network portion and host portion with the
CLASS C - 255.255.255.0          help of a subnet mask.
A Subnet mask distinguishes which portion of the address identifies the
network and which portion of the address identifies the node
IP Address Classes
          IP addressing: CIDR
• classful addressing:
  – inefficient use of address space, address space exhaustion
  – e.g., class B net allocated enough addresses for 65K hosts,
    even if only 2K hosts in that network
• CIDR: Classless InterDomain Routing
  – network portion of address of arbitrary length
  – address format: a.b.c.d/x, where x is # bits in network portion of
    address
                    network                        host
                      part                         part
     11001000 00010111 00010000 00000000
                       200.23.16.0/23
                                                                    #16
        Subnet and Supernet
            Extensions
• each physical network must have its own unique
  netid
• Problem: the number of physical networks grew
  so fast that all netids would be exhausted
  (especially class B)
• Solutions
  – Subnetting – allows multiple physical networks to
    share the same netid
  – Supernetting – allows more complete utilization of the
    address space
A network with two levels of
 hierarchy (not subnetted)
                Telephone number analogy
               A network with three levels of
                   hierarchy (subnetted)
Subnetting is done by borrowing bits from the host part and add them the
network part
                       Subnetting
Idea: Add one more level (subnet number) to the class hierarchy
    Subnet Mask