An address is a data structure understood by a network which uniquely identifies the recipient endpoint within the network.
There are similariries to other form address: Most people are familiar with the idea of a postal address that allows a postman to find a person's house; a computer processor may use a memory address to uniquely identify a location in memory.
The traditional Internet has used the IPv4 network protocol. This assigns an address to host interfaces (computers, or other network endpoints) and to router interfaces. Ecah address is a 32-bit number (4 bytes). The address is allocated so that no two systems have the same IP address. Some systems have more than one IP address, in which case they may be reached by any of their IP addresses.
Each IP address is logically composed of two parts, the network part, which identifyies the IP network number (often the covering a set of systems within one LAN broadcast domain) and the host part (which identifies the host within the specific IP network). This is a flat allocation technique, the assignment of host numbers may be on a first-come-first-served basis or any other method, and can be automated, for instance using teh Dynamic Host Configuration Protocol (DHCP).
Administrators of a specific IP network may freely allocate host addresses within their network, without co-ordination with other any other administrators in the Internet. However, they are not allowed to allocate host addresses belonging to a network number which has not been assigned to them. If they require additional addresses, they must apply for a new block of addresses (i.e., a new network number), which will not normally be consecutive with what was previously assigned. These network numbers can purchased from a registry.
IPv4 addresses are normally written in a format known as "dotted decimal notation". In this format, each byte of the 4-byte address is expressed as a decimal (base 10) number (i.e. 0 to 255). The four decimal numbers are separated by "dots" or "periods" as shown below:
The IPv4 address "22.214.171.124" corresponds to a hexadecimal value of 0x8107010A.
An IP address may be unicast (for a specific end system), network broadcast (for all systems on a LAN) or multicast (for a group of end systems). A network broadcast address sets the destination to the network address, and then fills each position of the host part of the address with a binary '1'.
The special value '0.0.0.0' is reserved for an unknown address. This is seldom used as a packet address, and is not normally valid.
The IPv4 network address is identified as the bit-wise logical AND of the 32-bit IPv4 address with another 32-bit quantity, the netmask. All systems with the same network number share the same netmask (sometimes called a "subnet mask"). This value is often learned using DHCP.
The subnet mask is organised so that each bit with a logical '1' indicates a bit in teh address value that is a part of the network number, and a logical '0' for each bit which is a part of the host number. The netmask may be written in dotted decimal notation, or alternatively as a hexadecimal number.
e.g., a 24-bit network number has a netmask which may be written as 255.255.255.0, this is identical to 0xFFFFFF00.
Hence, the IP address 126.96.36.199 with a netmask of 255.255.255.0 indicates the network number is 188.8.131.52.
A 24-bit network number leaves a host part of 8 bits. That is a network with space for 254 hosts. (Remember the host number "0" is reserved for the network itself, and the all one's host address is reserved for use as the network broadcast address). Sometimes the netmask is represented by writing the IP address followed by as a slash ('/') with the number of consective "1" bits used to form the network number. The above netmask can therfore also be represented as "/24" (i.e., there are 24 '1's before the '0's). Here are a few more examples:
|IP address||subnet mask||network number||host part||network broadcast address|
The last two lines show the same network divided in two different ways. Since each network must have a single netmask, only one of the two different ways may be used at any one time. Furthermore, it is important that all systems connected to this network have the same netmask to operate correctly, can you figure out why?
How can the receiver identify this is a broadcast IP packet when the IP source address was 192.168.10.2/24?
The address uses the addressing information to set the local broadcast address, (all 1’s in the host part of the net mask). All hosts in the same IP network share a common broadcast address.
In this cases the mask is 24b, that is bits (32-24) form the host part. So the broadcaster address is: 192.168.10.255
Stateful configuration allows a DHCP server to assign IP addresses and subnet maskes using athe Dynamic Host Configuration Protocol (DHCP).
Since the widespread use of IPv4, the number of addresses available to purchase has been reducing, so that there are now relatively few addresses available for adding new networks. IPv6 provides a solution to this probelm, and can purchased in teh same as IPv4 addresses. IPv6 uses 128-bit addresses, siginificantly increasing the number of addresses available for allocation. IPv6 addresses are always represented in hexadecimal, and never in dotted decimal format.
Like IPv4, IPv6 uses a subnet mask to identify which part of the address represents the network number and which is available to indentify host interfaces. Since the address is 128-bits in length, the subnet mask also needs to be 128-bits long. there is no broadcast address in IPv6, instead IPv6 multicast is used to communicate with systems on the same broadcast network.
Since IP addresses are long numbers, they are not easily remembered by humans, therefore most users instead choose to remember a logical name in place of an IP address. A system known as the DNS maps between the 32-bit IPv4 addresses and their corresponding logical names (and 128-bit IPv6 addresses when this is used). To ease reading by human users, the DNS is arranged in a hierarchical structure.
IP packet header