Sie sind auf Seite 1von 8

Experiment No.

07
Implement sub-netting concept using Network tool.
Name of the Student:-
__________________________________________________

Roll No.____________ Subject:-_________________________

Date of Practical Performed:-_______ Staff Signature with


Date:

Theory:

Subnetting is a form of hierarchical routing.


Subnets are usually represented via an address plus a subnet mask or netmask.
e.g.
nickm@elaine17.Stanford.EDU > ifconfig hme0
hme0:flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST
> mtu 1500.
Inet 171.64.15.82 netmask ffffff00 broadcast 171.64.15.255.Netmask
ffffff00: the first 24 bits are the subnet ID, and the last 8 bits are the host ID.
Can also be represented by a prefix + length, e.g. 171.64.15.0/24, or just
171.64.15/24.
MASKING :

Masking is a process that extracts the address of the physical network from an
IP address.
Masking can be done whether we have subnetting or not.
Not subnetted the network: Masking extracts the network address an IP address.
Subnetted the network: Masking extracts the subnetwork address an IP address.

In masking, we perform a mathematical operation on a 32-bit IP address at the


bit level using another 32-bit number called the mask.
To get the network or subnetwork address, we must apply the bit-wise-and
operation on the IP address an the mask.
The part of the mask containing 1s defines the netid(network portion) or
combination of netid and subnetid(subnetwork portion), The part of the mask
containing 0s defines the hostid.
Conclusion:Thus, implemented subnetting concept using network tool.

Frequently Asked Questions

1. What is subnetting?

------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------

2. Which class of addresses are used in subnetting

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------

3. What are different types of subnetting?

------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------

4. What is classless addressing?

-------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
--------------------------------------------------------------

5. How many bits are used in subnetting?

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---------------------------------------
Experiment No. 08
Write a program to implement find out class of a given IP address, subnet mask&
first & last IP address of that block.

Name of the Student:-


__________________________________________________

Roll No.____________ Subject:-_________________________

Date of Practical Performed:-_______ Staff Signature with


Date:

Theory:
The network address is the beginning address of each block. It can be found by
applying the default mask to any of the addresses in the block (including itself). It
retains the netid of the block and sets the hostid to zero. An Internet Protocol address
(IP address) is a numerical label assigned to each device connected to a computer
network that uses the Internet Protocol for communication. An IP address serves two
principal functions: host or network interface identification and location addressing.
Subnet mask:
A subnet mask is a number that defines a range of IP addresses that can be used in a
network. (It is not something you wear on your head to keep subnets out.) ... A
common subnet mask for a Class C IP address is 255.255.255.0. Each section of the
subnet mask can contain a number from 0 to 256, just like an IP address.
Conclusion: Hence wrote a program to implement find out class of a given IP address,
subnet mask& first & last IP address of that block.

Program : To find out the Class of a given IP Address.

main() { int a,b,c,d; clrscr();


printf("Enter 1st byte of ip address ");
scanf("%d",&a); printf("Enter 2nd
byte of ip address "); scanf("%d",&b);
printf("Enter 3rd byte of ip address ");
scanf("%d",&c);
printf("Enter 4th byte of ip address ");
scanf("%d",&d); printf("ip
address:%d.%d.%d.%d",a,b,c,d);
if(a>=0&&a<=127)
{ printf("It is class A address");
printf("Subnet mask is=255.0.0.0");
} else
if(a>=128&&a<=191)
{ printf("It is B class address");
printf("Subnet mask is=255.255.0.0");
} else
if(a>=192&&a<=223)
{ printf("Is is class C address");
printf("Subnet mask is=255.255.255.0");
} else
if(a>=224&&a<=239)
{ printf("It is class D address");
printf("Subnet mask is=255.255.255.255");
} getch();
}

Please write output for all classes of IP addresses.

Conclusion: Thus,

Frequently Asked Questions

1. What are the ranges for A Class & B Class IP Addresses?

------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------

2. What are the ranges for C Class & D Class IP Addresses?

-------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
--------------------------------------------------------------

3. How many bits are used for Network addresses & Host Addresses in B Class?

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------

4. How many networks can be used in C Class IP Addresses?

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
--------------------------------------------------------------

5. How many hosts can be connected to each network in A Class IP Addresses?


-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-----------------------

Das könnte Ihnen auch gefallen