Understand IP addresses and differentiate between types

Resources | Subject Notes | Computer Science

IP Addresses

An IP address (Internet Protocol address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It allows devices to locate each other on the network and exchange data.

Types of IP Addresses

There are two main versions of IP addresses currently in use: IPv4 and IPv6.

IPv4 Addresses

IPv4 addresses are 32-bit numerical addresses, typically written in dotted decimal notation (e.g., 192.168.1.1). Each octet (group of 8 bits) can have a value from 0 to 255.

IPv4 addresses are further divided into classes, although the classful addressing scheme is largely obsolete. Common classes include:

  • Class A: Network address starts with 1.
  • Class B: Network address starts with 10.
  • Class C: Network address starts with 192.

A private IPv4 address range is also defined for use within local networks:

  • 10.0.0.0 - 10.255.255.255
  • 172.16.0.0 - 172.31.255.255
  • 192.168.0.0 - 192.168.255.255

IPv6 Addresses

IPv6 addresses are 128-bit numerical addresses, written in hexadecimal notation (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

IPv6 was developed to address the limitations of IPv4, particularly the exhaustion of available addresses. It offers a vastly larger address space.

IPv6 addresses are categorized into different types:

  • Unicast: Identifies a single network interface.
  • Multicast: Identifies a group of network interfaces.
  • Anycast: Identifies a group of network interfaces, with traffic being routed to the nearest interface in the group.

Table of IP Address Types

IP Address Type Address Length Notation Typical Use
IPv4 32 bits Dotted decimal (e.g., 192.168.1.1) Internet communication, local networks
IPv6 128 bits Hexadecimal (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334) Future internet communication, large networks
Unicast (IPv6) Single interface (e.g., 2001:db8:85a3:0:0:8a2e:370:7334) Communication with a specific device
Multicast (IPv6) Group of interfaces (e.g., 2001:db8:85a3::1) Sending data to multiple devices simultaneously
Anycast (IPv6) Group of interfaces, nearest is used (e.g., 2001:db8:85a3::1) Routing traffic to the closest server in a group

Public vs. Private IP Addresses

Public IP addresses are globally unique addresses assigned to devices connected to the internet. They are used for communication with devices on other networks.

Private IP addresses are used within local networks (e.g., home or office networks). They are not globally unique and are typically used for communication between devices within the same network.

The private IP address ranges mentioned earlier (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are reserved for private networks.

Suggested diagram: A diagram showing a home network with devices having private IP addresses and a router with a public IP address connecting to the internet.