Computer Network: Ip Addressing & Subnetting
Computer Network: Ip Addressing & Subnetting
Basics of IP Addressing
Exercise on IP Address
Addressing
What is Addressing ?
Addressing means identification. In order to identify a house we use the address of the
house. Similarly to identify a computer an address is used.
In TCP/IP there are three different levels of addresses.
The physical address and logical address are used to identify a computer. The port
address is used to identify a process or program that runs in the computer. (Not the
Input/Output Ports).
Physical Address
The physical address is in the Network Interface Card (NIC). It is a hardware setting and
normally we cannot change that setting and it was set by the manufacturer of NIC. This is also
called the MAC address.
For Ethernet, the MAC address is a 48 bit or 12 Hex number (one Hex number is 4 bits).
The widely used protocol is TCP/IP and the logical address is called IP Address.
(The logical address operates in the Network Layer-Layer 3).
IP Address
The 32 bits are represented in following manner. Byte 1. Byte 2. Byte 3. Byte 4
one byte is 8 bits
and 255.255.255.255
(This is called the dotted decimal representation)
Network ID and Host ID
The network address is same as the telephone number system. We have the
flexibility to have a telephone number system in a logical way. For instance all
numbers in Kandy area starts with 081 Area Code. Therefore, if we get a call from
Colombo to Kandy the Colombo Exchange analyzes the first three digits only.
Then it can decide the correct route. Similarly all the exchanges up to Kandy
analyze only the first 2 digits only. Therefore, the processing and routine becomes
simpler.
IP means Identification
Classful addressing
Concept of classes . A, B, C, D & E.
Class A - First byte [ 0-127] , Bin 0….
Class B – First byte [128- 191], Bin, 10….
Class C - First byte [192-223], Bin, 110……
Class D - First byte [224-239], Bin, 1110…..
Class E - First byte[240-255], Bin, 1111….
252.5.15.111 – Class E
14.23.120.8 - Class A
Not: in classful addressing, a large part of the available addresses were wasted.
Classless addressing
Classful
Three type classes of IP Address
Example:
Suppose a particular address scheme has only 8 bits. If 3 bits allocated for
Network ID (Net ID) and remaining 5 bits is allocated to Host ID.
Both in Network ID and Host ID all 0s and all 1s are reserved for special
purposes.
Therefore, the actual maximum no. Networks = 23 - 2 = 6
For the Network Address, the Host ID part of the IP Address will be considered as
0
Eg: 103.58.35.1
153.105.25.10
This is a Class B Address
Why
Wastage in the Classful IP Addresses
Efficiently using the IP addresses
Mask (Default Mask)
The mask can help us to find the netid and the host id
The mask is in the form /n where n can be 8, 16 or 24 in classful addressing
/n this notation is also called slash notation or Classless Inderdomain Routing
(CIDR)
Class A - 255.0.0.0
Class B -255.255.0.0
Class C – 255.255.255.0
Classless addressing
However, In classless addressing the mask for a block (range) can take any value
from 0 to 32
The address and the /n notation completely define the whole block(first address ,
last address and the number of addresses)
First address in the block can be found by setting the rightmost 32-n bits to 0s.
The last address in the block can be found by setting the rightmost 32-n bits to 1s.
The number of addresses in the block can be found by using the formula 2^(32-n)
Subnetting
Public IP
Public IP id defined over Internet
Private IP
If we have a network which is not connected to Internet (not a part of
Internet) any IP address range can be used without obtaining any permission
IPv6 Addresses
Why .
Despite all short term solutions such as classless addressing, DHCP, Network Address
Translation (NAT), address depletion is still a long term problem for the internet
IPv6 Structure