# Introduction to IP Addressing
## What is an IP Address
An IP address is a unique numerical label assigned to every device that connects to a computer network using the Internet Protocol for communication. The IP address serves two main purposes. First, it identifies the host or device on the network. Second, it provides the location of the device in the network, enabling the routing of data packets from a source device to a destination device. Without IP addresses, routers would have no way to determine where to send packets, and the internet could not function.
## Why IP Addressing is Necessary
In a network with many devices, each device must be uniquely identifiable so that data sent from one device reaches the correct destination and not some other device. IP addresses provide this unique identification at the network level. Unlike MAC addresses which identify devices at the hardware level within a local network, IP addresses provide a hierarchical addressing scheme that allows the location of devices within the overall network topology to be inferred from the address itself. This hierarchical structure is what makes routing scalable across the global internet.
## Structure of an IP Address
An IP address consists of two parts. The network portion identifies which network the device belongs to. The host portion identifies the specific device within that network. Routers use the network portion to determine where to forward packets. Once a packet reaches the correct network, the destination device is identified by the host portion. The division between the network portion and host portion is determined by the subnet mask, which is a separate value used alongside the IP address.
## IP Version 4
IPv4 is the original version of the Internet Protocol that has been in use since the early internet. An IPv4 address is a 32-bit number, which means it consists of 32 binary digits. For human readability, IPv4 addresses are written in dotted decimal notation, which divides the 32 bits into four groups of 8 bits each, called octets, and writes each octet as a decimal number from 0 to 255, separated by dots. For example, 192.168.1.1 is an IPv4 address where 192, 168, 1, and 1 are the four octets. A 32-bit address space allows for approximately 4.3 billion unique addresses, which seemed more than sufficient when IPv4 was designed but has proven insufficient given the explosive growth of the internet.
## IP Version 6
IPv6 was developed to address the exhaustion of IPv4 addresses. An IPv6 address is a 128-bit number, providing an address space of approximately 340 undecillion addresses, which is effectively unlimited for any foreseeable purpose. IPv6 addresses are written in hexadecimal notation, divided into eight groups of 16 bits each, separated by colons. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334 is an IPv6 address. Consecutive groups of zeros can be abbreviated using a double colon.
## Static and Dynamic IP Addresses
An IP address can be assigned in two ways. A static IP address is a fixed address that does not change. It is configured manually by a network administrator and remains the same every time the device connects to the network. Static addresses are typically used for servers and network infrastructure devices that need to be reliably reachable at the same address. A dynamic IP address is assigned automatically by a DHCP server each time a device connects to the network. The address may be different each time the device connects, though DHCP servers often assign the same address to the same device based on its MAC address. Dynamic addressing is used for most client devices because it simplifies network management.Back to Subject