Thursday, 16 November 2017

IP Address Classes

IP Address Classes:- 


The IPv4 address space has been structured into several classes. The value of the first octet of an address determines the class of the network:


Class A networks range from 1 to 127. The default subnet mask is 255.0.0.0. Thus, by default, the first octet defines the network, and the last three octets define the host. This results in a maximum of 127 Class A networks, with 16,777,214 hosts per network!
Example of a Class A address:
Address: 64.32.254.100
Subnet Mask: 255.0.0.0
Class B networks range from 128 to 191. The default subnet mask is
255.255.0.0. Thus, by default, the first two octets define the network, and the last two octets define the host. This results in a maximum of 16,384 Class B networks, with 65,534 hosts per network.
Example of a Class B address:
Address: 152.41.12.195
Subnet Mask: 255.255.0.0


Class C networks range from 192 to 223. The default subnet mask is
255.255.255.0. Thus, by default, the first three octets define the network, and the last octet defines the host. This results in a maximum of 2,097,152 Class C networks, with 254 hosts per network.
Example of a Class C address:

Address: 207.79.233.6
Subnet Mask: 255.255.255.0

Class D networks are reserved for multicast traffic. Class D addresses do not use a subnet mask and not in use in general life  also.


CIDR  :-- Classless Inter-Domain Routing

Classless Inter-Domain Routing (CIDR) is a simplified method of
representing a subnet mask. CIDR identifies the number of binary bits set to a 1 (or on) in a subnet mask, preceded by a slash.
For example, a subnet mask of 255.255.255.240 would be represented as follows in binary:

11111111.11111111.11111111.11110000
The first 28 bits of the above subnet mask are set to 1. The CIDR notation for this subnet mask would thus be /28.
The CIDR mask is often appended to the IP address. For example, an IP
address of 192.168.1.1 and a subnet mask of 255.255.255.0 would be
represented as follows using CIDR notation:
                            
                                                          192.168.1.1/24




Address Classes vs. Subnet Mask:-----

Remember the following three rules:

• The first octet on an address dictates the class of that address.
• The subnet mask determines what part of an address identifies the
network, and what part identifies the host.
• Each class has a default subnet mask. A network using its default
subnet mask is referred to as a classful network.
For example, 10.1.1.1 is a Class A address, and its default subnet mask is 255.0.0.0 (/8 in CIDR).
It is entirely possible to use subnet masks other than the default. For
example, a Class B subnet mask can be applied to a Class A address:

10.1.1.1 /16

However, this does not change the class of the above address. It remains a Class A address, which has been subnetted using a Class B mask. Remember, the only thing that determines the class of an IP address is the first octet of that address. Likewise, the subnet mask is the only thing that determines what part of an address identifies the network, and what part identifies the host.

Subnet and Broadcast Addresses
On each IP network, two host addresses are reserved for special use:
• The subnet (or network) address
• The broadcast address
Neither of these addresses can be assigned to an actual host.
The subnet address is used to identify the network itself. A routing table contains a list of known networks, and each network is identified by its subnet address. Subnet addresses contain all 0 bits in the host portion of the address.
For example, 192.168.1.0/24 is a subnet address. This can be determined by looking at the address and subnet mask in binary:

IP Address: 11000000.10101000.00000001.00000000
Subnet Mask: 11111111.11111111.11111111.00000000

Note that all host bits in the address are set to 0.
The broadcast address identifies all hosts on a particular network. A packet sent to the broadcast address will be received and processed by every host on that network. Broadcast addresses contain all 1 bits in the host portion of the address.
For example, 192.168.1.255/24 is a broadcast address. Note that all host bits are set to 1:
IP Address: 11000000.10101000.00000001.11111111
Subnet Mask: 11111111.11111111.11111111.00000000

Broadcasts are one of three types of IP packets:

Unicasts are packets sent from one host to one other host

Multicasts are packets sent from one host to a group of hosts

Broadcasts are packets sent from one host to all other hosts on the
local network A router, by default, will never forward a multicast or broadcast packet from one interface to another.
A switch, by default, will forward a multicast or broadcast packet out every port, except for the port that originated the multicast or broadcast.