The following document may be useful to students with their exercises on subnetting. corrections welcome to cavi-instructors@ciscovision.org also questions and requests for clarifications. Network classes: Classes of ip addresses are as follows: class a: 1-127, first bit in most significant byte 0 subnet mask: 255.0.0.0 class b: 128-191, first bits in first byte 10 netmask 255.255.0.0 class c: 192-223, first bits in first byte 110 netmask 255.255.255.0 the subnet mask tells the computer which bits are part of the network portion of the address and which bits are part of the host portion, with all the network bits set to 1 in the subnet mask. Note the following: There are 2 or 3 parts to an ip address. Network portion, which tells the computer which network the ip address is on. host portion; specifies which host this is. Network portion is made up of the class bits and the borrowed bits. Subnets of the supernet are created by using the borrowed bits example follows. Subnetting 172.16.0.0/16 into class c-sized networks: Borrow 8 bits from the host portion so that ip address is made up of nnnnnnnn.nnnnnnnn.bbbbbbbb.hhhhhhhh where N are class-based network bits, b are borrowed bits and h are host bits. note that there are 16 classful network bits, 8 borrowed bits and 8 host bits. Note that the borrowed bits are used to show which subnet we are referring to and combinations are from 00000000 to 11111111 Let us work another example: If we are subnetting the network 192.168.1.0/24 into 4 networks. Firstly we have 8 bits currently allocated to host portion. If we want 4 networks we need to find the number of bits that will provide this number of cominations. 2 to the power of what will give us 4? 2^2=4 so we need to borrow 2 bits. This gives us nnnnnnnn.nnnnnnnn.nnnnnnnn.bbhhhhhh This gives us 6 bits for host portion. To find the number of hosts we do 2^6-2 which is 62 hosts per network. Range of subnet in binary is 000000 (network) to 111111 (broadcast) subnet bits can be set to 4 combinations 00 01 10 and 11 Students have asked for a formula to calculate the 5th network and so on this can be done as follows: figure how many bits are in the host portion of the address; call this b. now you can find out the nth usable network with the formula n*2^b Here is an example. subnets are 172.16.0.0/24 subnetted from 172.16.0.0/16 you want the 5th usable network. 5*2^8 = 1280 put your first 2 octetts in as 172.16 now convert 1280 to binary and put it in the last 2 bytes. converted to dotted decimal this should be 192.168.5.0/24 this is the network address of the 5th usable network.