• To overcome address depletion and give more organizations access to the Internet, classless addressing was designed and implemented. In this scheme, there are no classes, but the addresses are still granted in blocks.


  • In classless addressing, when an entity, small or large, needs to be connected to the Internet, it is granted a block (range) of addresses. The size of the block (the number of addresses) varies based on the nature and size of the entity.


  • For example, a household may be given only two addresses; a large organization may be given thousands of addresses. An ISP, as the Internet service provider, may be given thousands or hundreds of thousands based on the number of customers it may serve.


  • To simplify the handling of addresses, the Internet authorities impose three restrictions on classless address blocks :


    1. The addresses in a block must be contiguous, one after another.


    2. The number of addresses in a block must be a power of 2 (l, 2, 4, 8, ... ).


    3. The first address must be evenly divisible by the number of addresses.


  • Mask : A better way to define a block of addresses is to select any address in the block and the mask. A mask is a 32-bit number in which the 'n' leftmost bits are 1's and the 32 - n rightmost bits are O's. However, in classless addressing the mask for a block can take any value from 0 to 32. It is very convenient to give just the value of 'n' preceded by a slash (CIDR notation).


  • First Address :The first address in the block can be found by setting the 32 - n rightmost bits in the binary notation of the address to O's.


  • Last Address : The last address in the block can be found by setting the 32 - n rightmost bits in the binary notation of the address to 1's.


  • Number of Addresses : The number of addresses in the block is the difference between the last and first address. It can easily be found using the formula 232-n.



Show a block of addresses, in both binary and dotted-decimal notation, granted to a small business that needs 16 addresses.


  • We can see that the restrictions are applied to this block. The addresses are contiguous. The number of addresses is a power of 2 (16 = 24), and the first address is divisible by 16


  • The first address, when converted to a decimal number, is 3,440,387,360, which when divided by 16 results in 215,024,210.


  • Classless Addressing

Q. A block of addresses is granted to a small organization. We know that one of the addresses is 205.16.37.39/28. What is the first address in the block?


  • The binary representation of the given address is 11001101 00010000 00100101 00100111. If we set 32 - 28 rightmost bits to 0, we get 11001101 000100000100101 0010000 or 205.16.37.32.



Q. Find the last address for the block. We know that one of the addresses is 205.16.37.39/28.


  • The binary representation of the given address is 11001101 00010000 00100101 00100111. If we set 32 - 28 rightmost bits to 1, we get 11001101 00010000 001001010010 1111 or 205.16.37.47.



Q. Find the number of addresses. We know that one of the addresses is 205.16.37.39/28.


  • The value of n is 28, which means that number of addresses is 232-28 or 16.



Q. Find a. The first address h. The last address c. The number of addresses; We know that one of the addresses is 205.16.37.39/28


  • The first address can be found by ANDing the given addresses with the mask. ANDing here is done bit by bit. The result of ANDing 2 bits is 1 if both bits are Is; the result is 0 otherwise.


    1. Address : 11001101 00010000 00100101 00100111


    2. Mask : 11111111 11111111 11111111 11110000


    3. First address : 11001101 00010000 00100101 00100000


  • The last address can be found by ORing the given addresses with the complement of the mask. ORing here is done bit by bit. The result of ORing 2 bits is 0 if both bits are Os; the result is 1 otherwise. The complement of a number is found by changing each 1 to 0 and each 0 to 1


    1. Address : 11001101 00010000 00100101 00100111


    2. Mask : 00000000 00000000 00000000 00001111


    3. Last address : 11001101 00010000 00100101 00101111


  • The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it.


    1. Mask complement : 000000000 00000000 00000000 00001111


    2. Number of addresses: 15 + 1 = 16






  • An organization that is granted a large block of addresses may want to create clusters of networks (called subnets) and divide the addresses between the different subnets.


  • The rest of the world still sees the organization as one entity; however, internally there are several subnets.


  • All messages are sent to the router address that connects the organization to the rest of the Internet; the router routes the message to the appropriate subnets. The organization, however, needs to create small subblocks of addresses, each assigned to specific subnets. The organization has its own mask; each subnet must also have its own.


  • As an example, suppose an organization is given the block 17.12.40.01/26, which contains 64 addresses. The organization has three offices and needs to divide the addresses into three subblocks of 32, 16, and 16 addresses.



Q. As an example, suppose an organization is given the block 17.12.40.0126, which contains 64 addresses. The organization has three offices and needs to divide the addresses into three sub-blocks of 32, 16, and 16 addresses.


  • Suppose the mask for the first subnet is nl, then 232-n1 must be 32, which means that n1 = 27


  • Suppose the mask for the second subnet is n2, then 232-n2 must be 16, which means that n2 = 28


  • Suppose the mask for the third subnet is n3, then 232-n3 must be 16, which means that n3 = 28


  • In subnet 1, the address 17.12.14.29127 can give us the subnet address if we use the mask /27 because


    1. Host : 0001 0001 00001100 0000 1110 000 1110I


    2. Mask : /27


    3. Subnet : 00010001 00001100 00001110 00000000 ..... (17.12.14.0)


  • In subnet 2, the address 17.12.14.45/28 can give us the subnet address if we use the mask /28 because


    1. Host : 00010001 00001100 00001110 00101101


    2. Mask : /28


    3. Subnet : 00010001 00001100 00001110 00100000 ..... (17.12.14.32)


  • In subnet 3, the address 17.12.14.50/28 can give us the subnet address if we use the mask /28 because


    1. Host : 00010001 00001100 00001110 00110010


    2. Mask : /28


    3. Subnet : 00010001 00001100 00001110 00110000 ..... (17.12.14.48)


    Classless Addressing




  • The number of home users and small businesses that want to use the Internet is ever increasing. In the beginning, a user was connected to the Internet with a dial-up line, which means that she was connected for a specific period of time. An ISP with a block of addresses could dynamically assign an address to this user.


  • An address was given to a user when it was needed. But the situation is different today. Home users and small businesses can be connected by an ADSL line or cable modem. In addition, many are not happy with one address; many have created small networks with several hosts and need an IP address for each host. With the shortage of addresses, this is a serious problem.


  • A solution to this problem is called network address translation (NAT). NAT enables a user to have a large set of addresses internally and one address, or a small set of addresses, externally. The traffic inside can use the large set; the traffic outside, the small set


  • Range Total
    10.0.0.0 to 10.255.255.255 224
    172.16.0.0 to 172.31.255.255 220
    192.168.0.0 to 192.168.255.255 216
  • Any organization can use an address out of this set without permission from the Internet authorities. Everyone knows that these reserved addresses are for private networks. They are unique inside the organization, but they are not unique globally. No router will forward a packet that has one of these addresses as the destination address.


  • The site must have only one single connection to the global Internet through a router that runs the NAT software.


  • The private network uses private addresses. The router that connects the network to the global address uses one private address and one global address. The private network is transparent to the rest of the Internet; the rest of the Internet sees only the NAT router.


  • Network Address Translation (NAT)

Address Translation


  • All the outgoing packets go through the NAT router, which replaces the source address in the packet with the global NAT address. All incoming packets also pass through the NAT router, which replaces the destination address in the packet (the NAT router global address) with the appropriate private address.


  • NAT router know the destination address for a packet coming from the Internet by a translation table. There may be tens or hundreds of private IP addresses, each belonging to one specific host.


  • In its simplest form, a translation table has only two columns: the private' address and the external address (destination address of the packet). When the router translates the source address of the outgoing packet, it also makes note of the destination address-where the packet is going. When the response comes back from the destination, the router uses the source address of the packet (as the external address) to find the private address of the packet.


  • Network Address Translation (NAT)




  • Address depletion is still a long-term problem for the Internet based on IPv4. This and other problems in the IP protocol itself, such as lack of accommodation for real-time audio and video transmission, and encryption and authentication of data for some applications, have been the motivation for IPv6.


  • An IPv6 address consists of 16 bytes (octets); it is 128 bits long.


  • Hexadecimal Colon Notation : To make addresses more readable, IPv6 specifies hexadecimal colon notation. In this notation, 128 bits is divided into eight sections, each 2 bytes in length. Two bytes in hexadecimal notation requires four hexadecimal digits. Therefore, the address consists of 32 hexadecimal digits, with every four digits separated by a colon


  • IPv6 ADDRESSES
  • Abbreviation : Although the IP address, even in hexadecimal format, is very long, many of the digits are zer9s. In this case, we can abbreviate the address. The leading zeros of a section (four digits between two colons) can be omitted. Only the leading zeros can be dropped, not the trailing zeros


  • IPv6 ADDRESSES

Expand the address 0:15::1:12:1213 to its original.


  • We first need to align the left side of the double colon to the left of the original pattern and the right side of the double colon to the right of the original pattern to find now many Os we need to replace the double colon.


  • This means that the original address is


  • 0000:0015:0000:0000:0000:0001 :0012: 1213






  • IPv6 has a much larger address space; 2128 addresses are available. The designers of IPv6 divided the address into several categories. A few leftmost bits, called the type prefix, in each address define its category.


  • The type prefix is variable in length, but it is designed such that no code is identical to the first part of any other code. In this way, there is no ambiguity; when an address is given, the type prefix can easily be determined.


  • The third column shows the fraction of each type of address relative to the whole address space.


  • Address Space and type prefix




  • Unicast Addresses A unicast address defines a single computer. The packet sent to a unicast address must be delivered to that specific computer. IPv6 defines two types ofunicast addresses: geographically based and provider-based.


  • Multicast Addresses Multicast addresses are used to define a group of hosts instead of just one. A packet sent to a multicast address must be delivered to each member of the group.


  • Anycast Addresses :IPv6 also defines anycast addresses. An anycast address, like a multicast address, also defines a group of nodes. However, a packet destined for an any cast address is delivered to only one ofthe members of the anycast group, the nearest one (the one with the shortest route). Although the definition of an anycast address is still debatable, one possible use is to assign an anycast address to all routers of an ISP that covers a large logical area in the Internet. The routers outside the ISP deliver a packet destined for the ISP to the nearest ISP router. No block is assigned for anycast addresses.


  • Reserved Addresses Another category in the address space is the reserved address. These addresses start with eight Os (type prefix is 0000 0000).


  • An unspecified address is used when a host does not know its own address and sends an inquiry to find its address. A loopback address is used by a host to test itself without going into the network. A compatible address is used during the transition from IPv4 to IPv6. It is used when a computer using IPv6 wants to send a message to another computer using IPv6, but the message needs to pass through a part of the network that still operates in IPv4. A mapped address is also used during transition. However, it is used when a computer that has migrated to IPv6 wants to send a packet to a computer still using IPv4.


  • Local Addresses These addresses are used when an organization wants to use IPv6 protocol without being connected to the global Internet. In other words, they provide addressing for private networks. Nobody outside the organization can send a message to the nodes using these addresses. A link local address is used in an isolated subnet; a site local address is used in an isolated site with several subnets.