IPv4 Address


  • networks in an internetwork need a unique way of identifying each logical network and host
    • at Data Link layer: MAC address
      • only for local delivery of frames
    • at Network layer: IP address
      • used to forward packets
  • IP address provides 2 pieces of info:
    • network number (Network ID)
      • common to all hosts on the same IP network
    • host number (Host ID)
      • identifies a host within an IP network

32-bit IPv4 Addressing

  • IPv4 address is 32 bits long
    • raw form: 11000110001100110110010000000001
    • subdivided into four group of 8 bits (1 byte)
      • called octets
    • raw form grouped: 11000110 00110011 01100100 00000001
  • to make IP address easier to use, it is formatted using dotted decimal notation
    • requires each octet to be converted to a decimal value
    • separated by a period
    • decimal value: 198.51.100.1

Binary-Decimal Conversion

Examples demonstrating binary to decimal conversion:

  • in base 2 (binary) digits are either 0 or 1
    • values are powers of 2:
      • memorize these values to perform binary/decimal conversions using columnar method

Convert Binary to Decimal

11000110 represented in base 2

  • the first two rows shows the place value of each digit
  • third row shows the binary octet
  • fourth and fifth row show that where there is a 1 in the octet, the decimal place value is added to the sum

Convert Decimal to Binary

Convert to binary:

  • if all bits in an octet are set to 1, then = 255
  • an IPv4 address can be any number from 0.0.0.0 to 255.255.255.255
    • some addresses are not permitted
    • some are reserved for special use