The IP Address

An address is a data structure understood by a network which uniquely identifies the recipient within the network. Addresses in other places than computer networks: Addresses are used by the postal system to allow a postman to find a person's house; to allow a computer to uniquely identify a location in memory.

A unicast/broadcast IP address is a 32 bit value (i.e. four bytes) which is allocated to each system in the Internet. The 32-bgit value uniquely identifies this system, and therefore no two systems may 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 consists of two parts, the network part (identifying the network number, or LAN collision domain, to which the computer is attached) and the host part (which identifies the host within the local network). This is therefore a flat allocation technique. 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.

IP 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:

IP address "129.7.1.10" corresponds to a hexadecimal value of 0x8107010A.

The IP network address is identified as the bit-wise logical AND of the 32-bit IP address with another 32-bit number, the netmask. All systems with the same network number share the same netmask (sometimes called a "subnet mask"). This has a bit with a logical '1' for each bit 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 0xFFFFF00.

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.

Hence, the IP address 129.7.1.10 with a netmask of 255.255.255.0 indicates the network number is 129.7.1.0.

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 bits used to form the network number. The above netmask can therefore also be represented as "/24". Here are a few more examples:

IP address subnet mask network number host part network broadcast address
7.7.7.7/8 255.0.0.0 7.0.0.0 7.7.7 7.255.255.255

139.133.7.10/24

255.255.255.0 139.133.7.0 10 139.133.7.255
129.5.255.2/16 255.255.0.0 129.5.0.0 255.2 129.5.255.255
131.108.2.1/24 255.255.255.0 131.108.2.0 1 131.108.2.255
131.108.2.1/30 255.255.255.251 131.108.2.0 1 131.108.2.3

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?

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 IP addresses and their corresponding logical names. To ease reading by human users, the DNS is arranged in a hierarchical structure.


See also:

IP packet header


Gorry Fairhurst - Department of Engineering, University of Aberdeen, Scotland, UK.

http://www.erg.abdn.ac.uk/users/gorry Date: 10/11/1995 Revised: 7/10/2003