SFWR 4C03: Computer Networks & Computer Security Jan 17-21, 2005
Lecturer: Kartik Krishnan Lecture 7-9
Internet Protocol Address
Addressing is a critical component of the internet abstraction. To give the appearance of a single, uniform system, all host computers must use an uniform addressing scheme. Unfortunately, physical network addresses (discussed in the previous lecture) do not suffice because an internet can include multiple network technologies, each with its own address format. Thus, the addresses used by two technologies may be incompatible because they are of different sizes or have different formats.
Each host on the internet is assigned a unique 32 bit internet address (IP address) that is used in all communication with that host. An IP address does not identify a specific computer. Instead, each IP address identifies a connection between the computer and a network. A computer with multiple network connections, e.g., a router must be assigned one IP address for each connection.
Users, application programs, and the higher layers of the protocol software (TCP,IP) use IP addresses to communicate. On the other hand physical ad- dresses are used by the lower layers of the protocol software such as the network interface layer.
Conceptually, each 32 bit IP address is divided into two parts: a prefix and a suffix. This two level hierarchy is designed to make routing efficient. The address prefix is some sort of network id, and it identifies the physical network to which the computer is attached, while the suffix (host id) identifies an individual computer on that network. Each physical network in the internet is assigned a unique prefix and each computer on a given physical network is assigned a unique address suffix. Routing through the internet is based on the network portion of the address. Once the packet reaches the destination network, the host id is used to direct the frame to the appropriate destination machine.
In a classful addressing scheme, each IP address is said to be self-identifying because the boundary between prefix and suffix can be computed from the address alone, without reference to external information. In particular, the class of an address can be determined from the three higher order bits. There are five classes of 32 bit IP addresses.
1. Class A: Class A addresses start with a 0 in the first bit and use the first octet for the network address, leaving three octets for the host address.
Hence, the first octet of a class A address has a value between 0 and 127
7-9-1
(i.e., binary numbers 00000000 and 01111111 respectively). A class A network consists of (2
24), i.e., 16,777,216 host computers.
2. Class B: Organizations that did not require such a large number of hosts could be allocated a class B address. A class B address starts with 10 in the first two bits and uses the first two octets for the network address and the last two octets for the host address. A class B address consists of 2
16, i.e., 65536 host computers.
3. Class C: Even smaller organizations could be allocated class C addresses that start with 110 in the first three bits and use the first three octets for the network address and only the last octet for the host address. Each class C network has 2
8, i.e., 256 hosts.
4. Class D: Class D addresses begin with 1110 are used for multicast traffic sent to a collection of machines.
5. Class E: Class E addresses starting with 11110 are reserved for future use.
The division along octet boundaries motivated the representation of IP ad- dresses in dotted-decimal notation, which represents each octet as a decimal number ranging from 0 to 255. There are some special address conventions:
1. An IP address consisting of 32 zeros refers to the concerned host computer.
2. An IP address with the net id of zeros refers to a particular host computer.
3. An IP address consisting of all ones is used for limited broadcast.
4. An IP address with a valid net id and a host id of all ones is intended as a directed broadcast for all the hosts on that network.
5. Finally, the address 127.0.0.1 is intended as a loopback address. This is used for testing TCP/IP and inter-process communications on the local computer.
The Internet Corporation for Assigned Names and Numbers (ICANN) assigns net id’s, while the local Internet Service Provider or the System Administrator on a University network typically assigns the host id’s.
Classless interdomain routing (CIDR) and Sub- net Masks
Restricting IP addresses to 32 bits imposes a major limitation in the number
of hosts on the Internet. The rapid increase in the number of computers on
the Internet in the 1990s led to a depletion of available address space. The
original ARPANET was only designed to support a relatively small number of
hosts. Allocating 32 bit addresses in three main classes seemed reasonable at
that time. The version of the IP protocol with a 32 bit address space is referred
to as version 4 (IPv4). The latest version of this protocol (IPv6) calls for a
128 bit address space. However, IPv6 requires significant changes throughout
much of the internet. Instead, people have found alternative ways to limit the
depletion of the IPv4 address space.
A variety of techniques have been applied to limit the explosion in the num- ber of IP addresses. To slow the depletion of IP addresses, the Internet in- frastructure evolved to support greater flexibility in the allocation of blocks of IP addresses. The restriction of having fixed address blocks was abandoned in the early 1990s with the introduction of classless interdomain routing (CIDR).
CIDR allows the division between the network and host portions of the IP ad- dress to occur at any point in the 32 bit number. A CIDR network, then, is identified by a network address and a mask length that indicates how many bits are devoted to the network part of the address. As an example, consider the
PC
Music French English Art
Physics Ethernet
Math To
ISP
EE CS Router
Main router
Figure 1:
campus network at McMaster University shown in figure 1. We will assume that
all machines at McMaster University are assigned class B addresses (with 14 bits
for the network number and 16 bits for the host number). We will assume that the first two bytes in these IP addresses are 130 and 50 respectively. Let us assume that McMaster University has 35 departments in all, each with its own LAN network, constituting a subnet. So, Mac decides to take away some bits from the host number to create a subnet number for each department. It uses a 6 bit subnet number and a 10 bit host number, allowing for up to 64 Ethernets, each with a maximum of 1022 hosts (all zeros and all ones are not available, as mentioned earlier!). To implement subnetting, the main router on campus needs a subnet mask that indicates the split between network + subnet number and host, as shown in figure 2. The subnet mask can also be represented in dotted decimal notation as 255.255.252.0. An alternative notation is /22 to indicate that the subnet mask is 22 bits long. Outside the network, the subnetting is
32 Bits
Subnet mask
10 Network Subnet Host
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0