Internet Protocol - Version 4 (IPv4)

IPv4 addresses are logical addresses of 32bit (4 byte), usually expressed as dotted quad.

192.168.1.10

Each number being in the range 0-255 (one byte). This means in IPv4 there are \(2^{32}\) = 4,294,967,296 unique addresses.

Each IP consist of two parts:

network number:

uniquely identifies the network

host identifier:

a unique number within the network for a host

Note, that these two parts are not separated by the dots, but are determined by the subnet mask of the network. The subnet mask defines how many bits of the 32bit IP address are used for the network number, and how many bits are used for the host identifier.

Subnet masks are either specified using a dotted quad (32bit) or using a prefix, which simply is the number of bits allocated to the network portion.

192

168

1

10

11000000

10101000

00000001

00001010

255

255

255

0

11111111

11111111

11111111

00000000

prefix = 24

Class-less Inter Domain Routing (CIDR) Notation

To fully specify a network address, you need both the IP address and the subnet mask.

IP:      192.168.1.1
Netmask: 255.255.255.0

A more compact representation of both numbers is to use CIDR notation. It adds a slash / after the IP and appends the network prefix:

192.168.1.1/24

Specifying an IP Network

A common way to specify a network and its subnet is to set the host identifier portion of the IP address to 0 and write the address and subnet in CIDR notation.

Network:

IP:      192.168.1.0
Netmask: 255.255.255.0

Network in CIDR notation:

192.168.1.0/24

Broadcast Address

The broadcast address of a network is a special address that can be used to send a packet to all network hosts of a network. It is obtained by setting all bits to 1s in the host identifier portion of the IP. For the 192.168.1.0/24 network, the broadcast address is 192.168.1.255.

192

168

1

255

11000000

10101000

00000001

11111111

Network ID

Host ID