Wednesday, May 7, 2014

Overview of Classfull IP Addressing



Now let us take a quick look at IPv4 Class full addressing:


Class
Address Range
N/w’s
Hosts per N/w
A
0.0.0.0 – 127.255.255.255
128
16777216-2 = 16777214
B
128.0.0.0 – 191.255.255.255
16384
65536-2 = 65534
C
192.0.0.0  - 223.255.25.255
2,097,152
256-2 = 254
D
224.0.0.0 – 239.255.255.255
Reserved for Multicasting
-
E
240.0.0.0 – 255.255.255.255
R & D

 
How can you say whether an IP addressing scheme is classful or not?

            The subnet mask helps us to identify the type of IP addressing.  The subnet mask is used to separate the network and host bits. It is also a 32 bit field, the network portion will be indicated by a 1 and the host portion will be indicated by 0.

For example, we know that a Class A address has a network component of 8 bits (first 8 bits) and the host component has 24 bits , so the subnet mask for the Class A addresses is: 11111111.00000000.00000000.00000000, in decimal it would be:  255.0.0.0
Similarly for Class B:  11111111.11111111.00000000.00000000 = 255.255.0.0
For Class C: 11111111.11111111.11111111.00000000 = 255.255.255.0

            So if you see a network number that has the default subnet mask, then we can say that the IP address is a Classful IP addressing.


Disadvantages of Classful IP addressing:

            Assume that you have four LAN segments with 50 users each in your organization and you want to assign separate network for each of those segments.

Then probably you will have to choose four class C networks but in this type of scenario, since a single class C address has 254 usable addresses and your segment has only 50 users then for each network you are approximately wasting 200 IP addresses, so a total of 800 IP addresses. Since this is your private network that is fine.
            But if we use class full addressing in Public network then there will be a lot of unusable IP addresses and we will fall short of IP address very soon. (Of course we presently short of them and started using IPv6)
            This problem has been addressed by developing new concepts such as Sub-netting, Classless Routing and Variable Length Subnet Masks, the upcoming posts will discuss about them.

Sunday, March 16, 2014

IPv4 Classes in detail, Network and Host components, Types of IP Addresses:



            So far we’ve learnt that IPv4 is classified into five classful networks namely:

Class-A (0.0.0.0 to 127.255.255.255)
Class-B (128.0.0.0 to 191.255.255.255)
Class-C (192.0.0.0 to 223.255.255.255)
Class-D (224.0.0.0 to 239.255.255.255)
Class-E (240.0.0.0 to 255.255.255.255)

What is meant by Network Component and Host component of an IP address?

The network component is used for identifying a network, similar to Street Number.
The Host component is used to identify a specific host (or network device) in a network, similar to House number.

Network and Host portion of each of the classes:

Class-A:

            In this the first 8 bits are defined for network portion and the rest of the 24 bits for host portion.           

For example, in the Class-A IP address: 10.0.1.100
The first octet value: 10 represent the network component and the remaining address: 0.1.100 is the host component.

How many networks are there in Class- A? And how many hosts can be there in a single Class-A network?

To understand we need to do some calculations:
  1. The leading/parity bit in Class-A is ‘0’ (Only one bit).
  2. The size of the network component in Class A is 8 bits.
Now the number of network bits = 2n-2p.
Where n- size of the network component
            p- Number of parity bits
 It means that a single Class-A network consists of 16,777,214 host assignable IP addresses. (The ‘-2’ is for network and broadcast addresses, which we will discuss shortly)


Class-B:

            In this the first 16 bits are defined for network portion and the rest of the 16 bits for host portion.           

For example, in the Class-B IP address: 150.25.10.5
The first two octet values: 150.25 represent the network component and the remaining address: 10.5 is the host component.

How many networks are there in Class- B? And how many hosts can be there in a single Class-B network?

To understand we need to do some calculations:
  1. The leading/parity bit in Class-B is ‘10’ (Two bits).
  2. The size of the network component in Class B is 16 bits.
Now the number of network bits = 2n-2p.
Where n- size of the network component
            p- Number of parity bits

 It means that a single Class-B network consists of 65534 host assignable IP addresses. (The ‘-2’ is for network and broadcast addresses, which we will discuss shortly)

Class-C:

            In this the first 24 bits are defined for network portion and the rest of the 8 bits for host portion.           

For example, in the Class-C IP address: 192.168.10.5
The first three octet values: 192.168.10 represent the network component and the remaining address: .5 is the host component.

How many networks are there in Class- C? And how many hosts can be there in a single Class-C network?

To understand we need to do some calculations:
  1. The leading/parity bit in Class-C is ‘110’ (Three bits).
  2. The size of the network component in Class C is 24 bits.
Now the number of network bits = 2n-2p.
Where n- size of the network component
            p- Number of parity bits
It means that a single Class-C network consists of 254 host assignable IP addresses. (The ‘-2’ is for network and broadcast addresses, which we will discuss shortly).

Class-D:

            The Class-D address range: 224.0.0.0 to 239.255.255.255 is used for multicasting. Multicasting is nothing but sending a single message to group of selected machines.
            For example, the routing protocol: OSPF uses 224.0.0.5 to send hello packets to all OSPF routers on a network segment.

Class-E:

            This range of IP addresses: 240.0.0.0 to 255.255.255.255 are left for future experimental purposes nothing but research and development.

Types of IP addresses:

Network Address/Network ID:
            The IP address with all zeros in the host portion is called a network address. It is used to identify the network/subnet of a host.

For example,

Broadcast Address:

            The IP address with all ones in the host portion is called as a broadcast address. This address is used to send a single piece of information to all the devices on a single network.

For example,

 Reserved Addresses:

            There are few address ranges reserved for some special purposes.

            For example, the Class-A IP address range: 127.0.0.0 to 127.255.255.255 is reserved for loopback addressing which are primarily used for testing whether the NIC card has correctly loaded the Internet Protocol.

            Another example, the Class-B address range: 169.254.0.0 to 169.254.255.255 is reserved for auto configuration of IP address. It means whenever a device is not assigned an IP address or if it is unable to get an IP address from the DHCP (Dynamic Host Configuration Protocol) server then the NIC card will automatically assign one of the IP address from the given address range.
           
Private IP Addresses:

            Computers not connected to the Internet such as factory machines that communicate only within the LAN segment doesn’t need to have a globally unique IP address.
            So three ranges of IP addresses are defined for private networks:

1 (One) Class-A network: 10.0.0.0 to 10.255.255.255
16 Class-B networks: 172.16.0.0 to 172.31.255.255
256 Class-C networks: 192.168.0.0 to 192.168.255.255

Public IP Addresses:

            The IP addresses from the Class-A,B and C other than private IP addresses and reserved IP addresses are considered as public IP addresses.
            Public IP addresses are used by Internet servers such as webservers, DNS servers and routers.
For example the public IP address of the  www.google.com is:


From the above output we can understand that the web-server of google.com is hosted on the server with IP address: 74.125.236.211. If we type this IP address in the address bar of browser than it will take us to google.com page.    

In the next post we will overview the Classful IPv4 addressing and the problems with Classful addressing method and solutions.