Вы находитесь на странице: 1из 11

Subnetting Examples

Prepared By:

Maria Lorremar Sun MECE 1221

Subnetting Examples
Problem 1:

In this problem, we need to identify IP class, subnet mask and consider the required 6 subnets.

Suppose you want to subnet the network 192.168.0.0 into 6 segments. Device an IP subnet plan, giving the network, first host, last host and broadcast IP addresses for each subnet. Also specify the subnet mask you would use.

Solution:
Step 1: Calculate required number of bits to borrow for subnetting.

using the formula 2n-2 = x


The formula will specify the number of possible subnets from the value of bits to borrow. -2 subnets since all 0s and 1s cannot be used

where: n = number of bits borrowed x = number of subnets required

2n-2 = 6 2n = 8 n=3

Since Sinceour ournetwork networkis isaaclass classC Caddress, address,our our default mask will be 255.255.255.0. In binary, default mask will be 255.255.255.0. In binary, 11111111.11111111.11111111.00000000 11111111.11111111.11111111.00000000 We Wecan canonly onlymanipulate manipulatethe thelast lastoctet. octet. Borrowing 3 bits from it will leave us Borrowing 3 bits from it will leave us55bits bits( (the the 0s in the last octet ) for the host. 0s in the last octet ) for the host. 11111111.11111111.11111111.11100000 11111111.11111111.11111111.11100000 Computing for Computing forthe thepossible possiblenumber numberof ofhosts hostswill will 5 give -2==30 30hosts hostsper persubnet subnet giveus us225-2

Subnet, 3 bits / Host, 5 bits

Subnetting Examples
Step 2: Calculate the subnet mask Subnet mask has all 1s in the network + subnet part of the address. Hence, 11111111.11111111.11111111.11100000 = 255.255.255.224

Default subnet mask is changed due to additional 3 bits borrowed.

Step 3: Calculate all subnet network address

192. 11000000 11000000 11000000 11000000 11000000 11000000

168. 10101000 10101000 10101000 10101000 10101000 10101000

0. 00000000 00000000 00000000 00000000 00000000 00000000

Subnet Netw ork Addresses

00100000 01000000 01100000 10000000 10100000 11000000

192.168.0.32 192.168.0.64 192.168.0.96 192.168.0.128 192.168.0.160 192.168.0.192

We cannot alter the first three octets since this is a class C IP address.

From the three borrowed bits, we count up sequentially from 001110 ( all 0s and 1s cannot be used )

Subnet SubnetNetwork Network Address Addressis isall all0s 0sin in the host ID field. the host ID field.

Subnetting Examples
Step 4: Calculate all addresses of the first host, last host and broadcast on each subnet.
Subnet Netw ork Addresses 1st Subnet 2nd Subnet 3rd Subnet 4th Subnet 5th Subnet 6th Subnet First Host Last Host Broadcast Address

192.168.0.32 192.168.0.64 192.168.0.96 192.168.0.128 192.168.0.160 192.168.0.192

192.168.0.33 192.168.0.65 192.168.0.97 192.168.0.129 192.168.0.161 192.168.0.193

192.168.0.62 192.168.0.94 192.168.0.126 192.168.0.158 192.168.0.190 192.168.0.222

192.168.0.63 192.168.0.95 192.168.0.127 192.168.0.159 192.168.0.191 192.168.0.223

As computed, each subnet will have 30 hosts. The range from the first host to the last host will give you 30 hosts each.

192. 11000000 11000000 11000000 11000000 11000000 11000000

168. 10101000 10101000 10101000 10101000 10101000 10101000

0. 00000000 00000000 00000000 00000000 00000000 00000000

Broadcast Addresses

00111111 01011111 01111111 10011111 10111111 11011111

192.168.0.63 192.168.0.95 192.168.0.127 192.168.0.159 192.168.0.191 192.168.0.223

Broadcast Broadcast Address Address is all 1s in the is all 1s in thehost host ID field. ID field.

Subnetting Examples
Problem 2:
Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network in Figure 1 with the host requirements shown.
Looking at the figure, you can see that we are required to create five subnets. The maximum number of hosts is 28.

Figure 1.

Subnetting Examples
Solution:
Step 1: Calculate required number of bits to borrow for subnetting.

using the formula 2n = x


In this example, we will assume that we can use the subnet zero for the purpose of showing address optimization later. Instead of using the previous examples formula, lets consider this one. If we choose 2 bits, It will result to only 4 subnets which is lower than what is required. So 3 bits is appropriate.

where: n = number of bits borrowed x = number of subnets required

2n = 8 2n = 8 n=3

Note: Note: In Inthe thepast, past,there therewere were limitations to the use of a limitations to the use of asubnet subnet00 (all (allsubnet subnetbits bitsare areset setto tozero) zero)and and all ones subnet ( all subnet bits set all ones subnet ( all subnet bits set to one ). Some to one ). Somedevices deviceswould wouldnot notallow allowthe theuse use of these subnets. However, Cisco systems of these subnets. However, Cisco systems devices deviceswill willallow allowthe theuse useof ofthese thesesubnets subnets when the IP subnet zero command is when the IP subnet zero command is configured. configured.

Step 2: Calculate the subnet mask Subnet mask has all 1s in the network + subnet bits. Hence, 11111111.11111111.11111111.11100000 = /27 = 255.255.255.224
Number of 1s in the binary system

Subnetting Examples
Instead of using 204.15.5.0 255.255.255.224 we can use 204.15.5.0/27 Host ID field consists of 5 bits so, possible number of host is 2 5 2 = 30 hosts per subnet Step 3: Calculate all subnet network address
Cisco system configured to accept usage of IP subnet zero

204. 11001100 11001100 11001100 11001100 11001100

15. 00001111 00001111 00001111 00001111 00001111

5. 00000101 00000101 00000101 00000101 00000101

Subnet Netw ork Addresses

00000000 00100000 01000000 01100000 10000000

204.15.5.0/27 204.15.5.32/27 204.15.5.64/27 204.15.5.96/27 204.15.5.128/27

Subnetting Examples
Step 4: Calculate all addresses of the first host, last host and broadcast on each subnet.
Subnet Netw ork Addresses 1st Subnet 2nd Subnet 3rd Subnet 4th Subnet 5th Subnet First Host Last Host Broadcast Address

204.15.5.0/27 204.15.5.32/27 204.15.5.64/27 204.15.5.96/27 204.15.5.128/27

204.15.5.1/27 204.15.5.33/27 204.15.5.65/27 204.15.5.97/27 204.15.5.129/27

204.15.5.30/27 204.15.5.62/27 204.15.5.94/27 204.15.5.126/27 204.15.5.158/27

204.15.5.31/27 204.15.5.63/27 204.15.5.95/27 204.15.5.127/27 204.15.5.159/27

As computed, each subnet will have 30 hosts. The range from the first host to the last host will give you 30 hosts each.

Note: Note:/XX /XXindicates indicatesthe thesubnet subnet mask maskof ofan anaddress. address.

Subnetting Examples
Problem 3:
Given the same network and requirements as in Problem 2, develop a subnetting scheme using VLSM, given: netA: must support 14 hosts netB: must support 28 hosts netC: must support 2 hosts netD: must support 7 hosts netE: must support 28 hosts

Solution:
Step 1: Calculate required number of hosts for each subnet.

using the formula 2m-2 = y


For netB & netE:

where: m = number of bits on Host ID field y = number of hosts required

2m-2 = 28
We can have 5 bits on the host ID field meaning 5 0s counting from the last bit of the last octet

2m = 30 m=5

Since Sincethe thehost hostfield fieldis isalways alwayson onthe thelast lastoctet octet and the last bits, well count 5 0s from the and the last bits, well count 5 0s from theend end bits: bits: 11111111.11111111.11111111.11100000 11111111.11111111.11111111.11100000 The Thenumber numberof of1s 1swill willgive giveus usthe thesubnet subnetmask mask which is /27 ( 27 1s ) which is /27 ( 27 1s )

Subnetting Examples
For netA:

2m-2 = 14
We can have 4 bits on the host ID field meaning 4 0s counting from the last bit of the last octet

2m = 16 m=4

Since Sincethe thehost hostfield fieldis isalways alwayson onthe thelast lastoctet octet and the last bits, well count 4 0s from the and the last bits, well count 4 0s from theend end bits: bits: 11111111.11111111.11111111.11110000 11111111.11111111.11111111.11110000 The Thenumber numberof of1s 1swill willgive giveus usthe thesubnet subnetmask mask which is /28 ( 28 1s ) which is /28 ( 28 1s )

**For netD:

2m-2 = 7
We can have 4 bits on the host ID field meaning 4 0s counting from the last bit of the last octet

2m = 9 m=4

Since Sincethe thehost hostfield fieldis isalways alwayson onthe thelast lastoctet octet and the last bits, well count 4 0s from the and the last bits, well count 4 0s from theend end bits: bits: 11111111.11111111.11111111.11110000 11111111.11111111.11111111.11110000 The Thenumber numberof of1s 1swill willgive giveus usthe thesubnet subnetmask mask which whichis is/28 /28( (28 281s 1s) )

We cannot use 3 bits since it will only yield 6 hosts and we need 7 hosts **For netD:

Subnetting Examples
For netC:

2m-2 = 2
We can have 2 bits on the host ID field meaning 2 0s counting from the last bit of the last octet

2m = 4 m=2

Since Sincethe thehost hostfield fieldis isalways alwayson onthe thelast lastoctet octet and the last bits, well count 2 0s from the and the last bits, well count 2 0s from theend end bits: bits: 11111111.11111111.11111111.11111100 11111111.11111111.11111111.11111100 The Thenumber numberof of1s 1swill willgive giveus usthe thesubnet subnetmask mask which is /30 ( 30 1s ) which is /30 ( 30 1s )

Step 2: Calculate all addresses of the subnet, first host and last host
Subnet Netw ork Addresses netB netE netA netD netC First Host Last Host # of hosts

204.15.5.0/27 204.15.5.32/27 204.15.5.64/28 204.15.5.80/28 204.15.5.96/30

204.15.5.1/27 204.15.5.33/27 204.15.5.65/28 204.15.5.81/28 204.15.5.97/30

204.15.5.30/27 204.15.5.62/27 204.15.5.78/28 204.15.5.94/28 204.15.5.98/30

30 30 14 14 2

This illustrates how VLSM helped save more than half of the address space

Note: Note:Because Becauseof ofdifferent differentsubnet subnetmask, mask,routers routers in a VLSM network must understand this type in a VLSM network must understand this typeof of subnetting and must be configured. Native IP subnetting and must be configured. Native IP routers routersonly onlyunderstand understandStatic Staticlength lengthsubnet subnet mask. mask.

Вам также может понравиться