Lecture Notes Introduction To IP Addressing
Lecture Notes Introduction To IP Addressing
▪ An IP address is a 32-bit number. It uniquely identifies a host (computer or other device, such
as a printer or router) on a TCP/IP network.
▪ IP addresses are normally expressed in dotted-decimal format, with four numbers separated
by periods, such as 192.168.123.132. To understand how subnet masks are used to
distinguish between hosts, networks, and subnetworks, examine an IP address in binary
notation.
▪ For example, the dotted-decimal IP address 192.168.123.132 is (in binary notation) the 32-
bit number 11000000101010000111101110000100. This number may be hard to make
sense of, so divide it into four parts of eight binary digits.
▪ These 8-bit sections are known as octets. The example IP address, then, becomes
11000000.10101000.01111011.10000100. This number only makes a little more sense, so for
most uses, convert the binary address into dotted-decimal format (192.168.123.132). The
decimal numbers separated by periods are the octets converted from binary to decimal
notation.
Subnet mask
▪ The second item, which is required for TCP/IP to work, is the subnet mask. The subnet mask
is used by the TCP/IP protocol to determine whether a host is on the local subnet or on a
remote network.
▪ In TCP/IP, the parts of the IP address that are used as the network and host addresses aren't
fixed. Unless you have more information, the network and host addresses above can't be
determined. This information is supplied in another 32-bit number called a subnet mask. The
subnet mask is 255.255.255.0 in this example. It isn't obvious what this number means
unless you know 255 in binary notation equals 11111111. So, the subnet mask is
11111111.11111111.11111111.00000000.
▪ Lining up the IP address and the subnet mask together, the network, and host portions of the
address can be separated:
▪ The first 24 bits (the number of ones in the subnet mask) are identified as the network
address. The last 8 bits (the number of remaining zeros in the subnet mask) are identified as
the host address. It gives you the following addresses:
Decimal Binary
255.255.255.192 1111111.11111111.1111111.11000000
255.255.255.224 1111111.11111111.1111111.11100000
Network classes
Internet addresses are allocated by the InterNIC, the organization that administers the Internet.
These IP addresses are divided into classes. The most common of them are classes A, B, and C.
Classes D and E exist, but aren't used by end users. Each of the address classes has a different default
subnet mask. You can identify the class of an IP address by looking at its first octet. Following are the
ranges of Class A, B, and C Internet addresses, each with an example address:
▪ Class A networks use a default subnet mask of 255.0.0.0 and have 0-127 as their first octet.
The address 10.52.36.11 is a class A address. Its first octet is 10, which is between 1 and 126,
inclusive.
▪ Class B networks use a default subnet mask of 255.255.0.0 and have 128-191 as their first
octet. The address 172.16.52.63 is a class B address. Its first octet is 172, which is between
128 and 191, inclusive.
▪ Class C networks use a default subnet mask of 255.255.255.0 and have 192-223 as their first
octet. The address 192.168.123.132 is a class C address. Its first octet is 192, which is
between 192 and 223, inclusive.