4 1 IP Addressing Lyst7910
4 1 IP Addressing Lyst7910
4 1 IP Addressing Lyst7910
• The Internet Protocol addresses are 32 bits in length; this gives us a maximum of 232
addresses. These addresses are referred to as IPv4 (IP version 4) addresses or simply IP
addresses if there is no confusion.
• This means that, theoretically, if there were no restrictions, more than 4 billion
(4,29,49,67,296) devices could be connected to the Internet. The actual number is much less
because of the restrictions imposed on the addresses.
• The need for more addresses, in addition to other concerns about the IP layer, motivated a
new design of the IP layer called the new generation of IP or IPv6 (lP version 6). In this version,
the Internet uses 128-bit addresses that give much greater flexibility in address allocation (3.4
*1038). These addresses are referred to as IPv6 (IP version 6) addresses.
• They are unique in the sense that each address defines one, and only one, connection to the Internet.
Two devices on the Internet can never have the same address at the same time.
• The IPv4 addresses are universal in the sense that the addressing system must be accepted by any host
that wants to be connected to the Internet.
• The IP address is the address of the connection, not the host or the router, because if the device is
moved to another network, the IP address may be changed.
• Binary Notation - In binary notation, the IPv4 address is displayed as 32 bits. Each octet is
often referred to as a byte. So, it is common to hear an IPv4 address referred to as a 32-bit
address or a 4-byte address. An example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010
• Dotted-Decimal Notation - To make the IPv4 address more compact and easier to read,
Internet addresses are usually written in decimal form with a decimal point (dot) separating
the bytes. The following is the dotted decimal notation of the above address: 117.149.29.2
• In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Each class
occupies some part of the address space.
• Now-a-days it has become obsolete because of many problems, now the new scheme referred
to as classless addressing, uses a variable-length network prefix.
• The whole address space was divided into five classes (class A, B, C, D, and E).
• Two hosts in two different networks can have the same host ID.
• Only those devices which have the network layer will have IP Address, switches, hubs and
repeaters does not have any IP Address.
Types of Casting
• Casting in a network is basically of three type: Unicast, Multicast and Broadcast.
• Unicast: Transmitting data from one source host to one destination host is called as unicast. It
is a one to one transmission.
• Limited Broadcast: Transmitting data from one source host to all other hosts residing in the
same network is called as limited broadcast. Limited Broadcast Address for any network is
• All 32 bits set to 1 = 11111111.11111111.11111111.11111111 = 255.255.255.255
• Direct Broadcast: Transmitting data from one source host to all other hosts residing in
some other network is called as direct broadcast.
• Direct Broadcast Address for any network is the IP Address where, Network ID is the IP
Address of the network where all the destination hosts are present and Host ID bits are
all set to 1.
o Having all the computer from different departments in a company on the same networks is
less secure from company prospective.
o So, if an organization was granted a large block in class A or B, it could divide the addresses
into several contiguous groups and assign each group to smaller networks (called subnets) or,
in rare cases, share part of the addresses with neighbours.
Disadvantages
• Identification of a station is difficult
• Not possible to directed broadcast from outside network.
• Subnet mask is a 32-bit number which is a sequence of 1’s followed by a sequence of 0’s where:
o 1’s represents the Network ID part along with the subnet ID.
o 0’s represents the host ID part.
(A) 255.255.255.0
(B) 255.255.255.128
(C) 255.255.255.192
(D) 255.255.255.224
<------------------16-----------------> <------------------16----------------->
Net Id Host Id
5 bits
<------------------------21------------------------> <-----------11----------->
Net Id Host Id
11111111 11111111 11111000 00000000
c) 192.168.1.135 d) 192.168.1.155
(C) 62 subnets and 1022 hosts. (D) 64 subnets and 1024 hosts.
<--------------------------------26----------------------------------> <------6------>
Net Id Host Id
11111111 11111111 11111111 11000000
• flexibility is not there is classful addressing, we cannot have the exact allocation as we want for e.g. if
some company wants 50 IP address then must go for 256, resulting into address depletion.
• Wastage of addresses, for example: Class E addresses were almost never used, wasting the whole
class.
• Conclusion: The Internet was faced with the problem of the addresses being rapidly used up, resulting
in no more addresses available for organizations and individuals that needed to be connected to the
Internet.
• The class privilege is removed from the distribution to compensate for the address depletion, so no
class.
• Here we can ask exact set of IP address which are required and a Variable-length blocks are assigned
which satisfy the request.
• To solve this problem now we have a new CIDR notation, this notation is informally referred to as slash
notation and formally as classless interdomain routing or CIDR.
The mask by setting 27 leftmost bits to 1 and 5 rightmost bits to 0 in dotted-decimal notation is:
The mask by setting 27 leftmost bits to 1 and 5 rightmost bits to 0 in dotted-decimal notation is:
255.255.255.224 (11111111 11111111 11111111 11100000)
• Number of addresses in the block: N = NOT (mask) + 1 =
• 00000000 00000000 00000000 00011111 + 1 = 0.0.0.31 + 1 = 32 addresses
<-----------------------------------27---------------------------------> <---------5------->
Net Id Host Id
11001000 00001010 00001011 10010000
11001000 00001010 00001011 10000000
11001000 00001010 00001011 10000001
Q Consider the network having IP Address 20.30.40.10/25 Divide this network into two subnets.
• The prefix length for each sub-network should be found using the following formula: nsub = 32 − log2Nsub
• The starting address in each sub-network should be divisible by the number of addresses in that sub-network.
This can be achieved if we first assign addresses to larger sub-networks.
• Subnetting leads to loss of IP Addresses, in each subnet we lose two IP addresses one for
network address and one for DBA.
o The size of a class C block with a maximum number of 256 addresses did not satisfy the needs of most
organizations. Even a midsize organization needed more addresses.
o One solution was super netting. In super netting, an organization can combine several blocks to create a larger
range of addresses. In other words, several networks are combined to create a super network or a supernet.
o An organization can apply for a set of class C blocks instead of just one. For example, an organization that needs
1000 addresses can be granted four contiguous class C blocks. The organization can then use these addresses to
create one super network.
203.197.2.53 11001011 11000101 00000010 00110101 203.197.2.53 11001011 11000101 00000010 00110101
255.255.128.0 11111111 11111111 10000000 00000000 255.255.192.0 11111111 11111111 10000000 00000000
203.197.0.0 11001011 11000101 00000000 00000000 203.197.0.0 11001011 11000101 00000000 00000000
203.197.75.201 11001011 11000101 01001011 11001001 203.197.75.201 11001011 11000101 01001011 11001001
255.255.128.0 11111111 11111111 10000000 00000000 255.255.192.0 11111111 11111111 11000000 00000000
203.197.0.0 11001011 11000101 00000000 00000000 203.197.64.0 11001011 11000101 00100000 00000000