Lec 9
Subnet
 Computer Networks
 Al-Mustansiryah University
 Elec. Eng. Department College of Engineering
Fourth Year Class
3.1
The first address in a block is
normally not assigned to any device;
it is used as the network address that
represents the organization
to the rest of the world.
Note
3.2
 Host IP Address: 138.101.114.250
 Network Mask: 255.255.0.0
 Subnet Mask: 255.255.255.192
Given the following Host IP Address, Network Mask and Subnet mask find the
following information:
 Major Network Information
 Major Network Address
 Major Network Broadcast Address
 Range of Hosts if not subnetted
 Subnet Information
 Subnet Address
 Range of Host Addresses (first host and last host)
 Broadcast Address
 Other Subnet Information
 Total number of subnets
 Number of hosts per subnet
Subnetting – Example
3.3
Major Network Information
 Host IP Address: 138.101.114.250
 Network Mask: 255.255.0.0
 Subnet Mask: 255.255.255.192
 Major Network Address: 138.101.0.0
 Major Network Broadcast Address: 138.101.255.255
 Range of Hosts if not Subnetted: 138.101.0.1 to
138.101.255.254
3.4
Step 1:
Translate Host IP Address and Subnet Mask into binary notation
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
255. 255. 255. 192
Step 1: Convert to Binary
128 64 32 16 8 4 2 1
3.5
Step 2:
Determine the Network (or Subnet) where this Host address
lives:
1. Draw a line under the mask
2. Perform a bit-wise AND operation on the IP Address and the Subnet
Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
3. Express the result in Dotted Decimal Notation
4. The result is the Subnet Address of this Subnet or “Wire” which is
138.101.114.192
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192
Step 2: Find the Subnet Address
3.6
Step 3:
Determine which bits in the address contain Network (subnet)
information and which contain Host information:
 Use the Network Mask: 255.255.0.0 and divide (Great Divide) the
from the rest of the address.
 Use Subnet Mask: 255.255.255.192 and divide (Small Divide) the
subnet from the hosts between the last “1” and the first “0” in the
subnet mask.
G.D. S.D.
IP Address 10001010 01100101 01110010 11 111010
Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range
Step 3: Subnet Range / Host Range
3.7
Host Portion
 Subnet Address: all 0’s
 First Host: all 0’s and a 1
 Last Host: all 1’s and a 0
 Broadcast: all 1’s
G.D. S.D.
IP Address 10001010 01100101 01110010 11 111010
Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range
First Host 10001010 01100101 01110010 11 000001
138 101 114 193
Last Host 10001010 01100101 01110010 11 111110
138 101 114 254
Broadcast 10001010 01100101 01110010 11 111111
138 101 114 255
Step 4: First Host / Last Host
3.8
G.D. S.D.
IP Address 10001010 01100101 01110010 11 111010
Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range
First Host 10001010 01100101 01110010 11 000001
138 101 114 193
Last Host 10001010 01100101 01110010 11 111110
138 101 114 254
Broadcast 10001010 01100101 01110010 11 111111
138 101 114 255
 Total number of subnets
 Number of subnet bits 10
 210 = 1,024
 1,024 total subnets
 Subtract one “if” all-zeros subnet cannot be used
 Subtract one “if” all-ones subnet cannot be used
 1,022 total subnets
Step 5: Total Number of Subnets
3.9
G.D. S.D.
IP Address 10001010 01100101 01110010 11 111010
Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range
First Host 10001010 01100101 01110010 11 000001
138 101 114 193
Last Host 10001010 01100101 01110010 11 111110
138 101 114 254
Broadcast 10001010 01100101 01110010 11 111111
138 101 114 255
 Total number of hosts per subnet
 Number of host bits 6
 26 = 64
 64 host per subnets
 Subtract one for the subnet address
 Subtract one for the broadcast address
 62 hosts per subnet
Step 6: Total Number of Hosts per
Subnet
3.10
An ISP is granted a block of addresses starting with
190.100.0.0/16 (65,536 addresses). The ISP needs to
distribute these addresses to three groups of customers as
follows:
a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128
addresses.
c. The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many addresses are
still available after these allocations.
Example 3.10
3.11
Solution
Figure 3.9 shows the situation.
Example 3.10 (continued)
Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each host.
The prefix length is then 32 − 8 = 24. The addresses are
3.12
Example 3.10 (continued)
Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each host.
The prefix length is then 32 − 7 = 25. The addresses are
3.13
Example 3.10 (continued)
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26. The addresses are
Number of granted addresses to the ISP: 65,536
Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576
3.14
Figure 3.9 An example of address allocation and distribution by an ISP
3.15
Table 3.3 Addresses for private networks
3.16
Example 3.11 :A company is granted the site address 211.80.64.0 .The company
needs six subnets. Design the subnets?
Solution:
No. of subnet must be power of 2 therefore we design 8 subnets
No.of subnet bits=Log2(8)=3 bits
Ip address 211.80.64.0 is class c
Net Sub Host
24 Bit 3 Bit 8 Bit
3.17
Subnet NET . Subnet . Host Subnet IP
Subnet 0
211.80.64 000 00000 211.80.64.0
211.80.64 000 11111 211.80.64.31
Subnet 1
211.80.64 001 00000 211.80.64.32
211.80.64 001 11111 211.80.64. 63
Subnet 2
211.80.64 010 00000 211.80.64.64
211.80.64 010 11111 211.80.64. 95
Subnet 3 211.80.64 011 00000 211.80.64.96
211.80.64 011 11111 211.80.64. 127
Subnet 4 211.80.64 100 00000 211.80.64. 128
211.80.64 100 11111 211.80.64. 159
Subnet 5 211.80.64 101 00000 211.80.64. 160
211.80.64 101 11111 211.80.64. 191
Subnet 6 211.80.64 110 00000 211.80.64. 192
211.80.64 110 11111 211.80.64. 223
Subnet 7 211.80.64 111 00000 211.80.64. 224
211.80.64 111 11111 211.80.64. 255
3.18
172.16.1.0
172.16.2.0
172.16.3.0
172.16.4.0
172.16.3.255
(Directed Broadcast)
255.255.255.255
(Local Network Broadcast)
X
172.16.255.255
(All Subnets Broadcast)
Broadcast Address
3.19

Subneting.ppt

  • 1.
    Lec 9 Subnet  ComputerNetworks  Al-Mustansiryah University  Elec. Eng. Department College of Engineering Fourth Year Class 3.1
  • 2.
    The first addressin a block is normally not assigned to any device; it is used as the network address that represents the organization to the rest of the world. Note 3.2
  • 3.
     Host IPAddress: 138.101.114.250  Network Mask: 255.255.0.0  Subnet Mask: 255.255.255.192 Given the following Host IP Address, Network Mask and Subnet mask find the following information:  Major Network Information  Major Network Address  Major Network Broadcast Address  Range of Hosts if not subnetted  Subnet Information  Subnet Address  Range of Host Addresses (first host and last host)  Broadcast Address  Other Subnet Information  Total number of subnets  Number of hosts per subnet Subnetting – Example 3.3
  • 4.
    Major Network Information Host IP Address: 138.101.114.250  Network Mask: 255.255.0.0  Subnet Mask: 255.255.255.192  Major Network Address: 138.101.0.0  Major Network Broadcast Address: 138.101.255.255  Range of Hosts if not Subnetted: 138.101.0.1 to 138.101.255.254 3.4
  • 5.
    Step 1: Translate HostIP Address and Subnet Mask into binary notation 138. 101. 114. 250 IP Address 10001010 01100101 01110010 11111010 Mask 11111111 11111111 11111111 11000000 255. 255. 255. 192 Step 1: Convert to Binary 128 64 32 16 8 4 2 1 3.5
  • 6.
    Step 2: Determine theNetwork (or Subnet) where this Host address lives: 1. Draw a line under the mask 2. Perform a bit-wise AND operation on the IP Address and the Subnet Mask Note: 1 AND 1 results in a 1, 0 AND anything results in a 0 3. Express the result in Dotted Decimal Notation 4. The result is the Subnet Address of this Subnet or “Wire” which is 138.101.114.192 138. 101. 114. 250 IP Address 10001010 01100101 01110010 11111010 Mask 11111111 11111111 11111111 11000000 Network 10001010 01100101 01110010 11000000 138 101 114 192 Step 2: Find the Subnet Address 3.6
  • 7.
    Step 3: Determine whichbits in the address contain Network (subnet) information and which contain Host information:  Use the Network Mask: 255.255.0.0 and divide (Great Divide) the from the rest of the address.  Use Subnet Mask: 255.255.255.192 and divide (Small Divide) the subnet from the hosts between the last “1” and the first “0” in the subnet mask. G.D. S.D. IP Address 10001010 01100101 01110010 11 111010 Mask 11111111 11111111 11111111 11 000000 Network 10001010 01100101 01110010 11 000000  subnet   host  counting range counting range Step 3: Subnet Range / Host Range 3.7
  • 8.
    Host Portion  SubnetAddress: all 0’s  First Host: all 0’s and a 1  Last Host: all 1’s and a 0  Broadcast: all 1’s G.D. S.D. IP Address 10001010 01100101 01110010 11 111010 Mask 11111111 11111111 11111111 11 000000 Network 10001010 01100101 01110010 11 000000  subnet   host  counting range counting range First Host 10001010 01100101 01110010 11 000001 138 101 114 193 Last Host 10001010 01100101 01110010 11 111110 138 101 114 254 Broadcast 10001010 01100101 01110010 11 111111 138 101 114 255 Step 4: First Host / Last Host 3.8
  • 9.
    G.D. S.D. IP Address10001010 01100101 01110010 11 111010 Mask 11111111 11111111 11111111 11 000000 Network 10001010 01100101 01110010 11 000000  subnet   host  counting range counting range First Host 10001010 01100101 01110010 11 000001 138 101 114 193 Last Host 10001010 01100101 01110010 11 111110 138 101 114 254 Broadcast 10001010 01100101 01110010 11 111111 138 101 114 255  Total number of subnets  Number of subnet bits 10  210 = 1,024  1,024 total subnets  Subtract one “if” all-zeros subnet cannot be used  Subtract one “if” all-ones subnet cannot be used  1,022 total subnets Step 5: Total Number of Subnets 3.9
  • 10.
    G.D. S.D. IP Address10001010 01100101 01110010 11 111010 Mask 11111111 11111111 11111111 11 000000 Network 10001010 01100101 01110010 11 000000  subnet   host  counting range counting range First Host 10001010 01100101 01110010 11 000001 138 101 114 193 Last Host 10001010 01100101 01110010 11 111110 138 101 114 254 Broadcast 10001010 01100101 01110010 11 111111 138 101 114 255  Total number of hosts per subnet  Number of host bits 6  26 = 64  64 host per subnets  Subtract one for the subnet address  Subtract one for the broadcast address  62 hosts per subnet Step 6: Total Number of Hosts per Subnet 3.10
  • 11.
    An ISP isgranted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses. c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations. Example 3.10 3.11
  • 12.
    Solution Figure 3.9 showsthe situation. Example 3.10 (continued) Group 1 For this group, each customer needs 256 addresses. This means that 8 (log2 256) bits are needed to define each host. The prefix length is then 32 − 8 = 24. The addresses are 3.12
  • 13.
    Example 3.10 (continued) Group2 For this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to define each host. The prefix length is then 32 − 7 = 25. The addresses are 3.13
  • 14.
    Example 3.10 (continued) Group3 For this group, each customer needs 64 addresses. This means that 6 (log264) bits are needed to each host. The prefix length is then 32 − 6 = 26. The addresses are Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576 3.14
  • 15.
    Figure 3.9 Anexample of address allocation and distribution by an ISP 3.15
  • 16.
    Table 3.3 Addressesfor private networks 3.16
  • 17.
    Example 3.11 :Acompany is granted the site address 211.80.64.0 .The company needs six subnets. Design the subnets? Solution: No. of subnet must be power of 2 therefore we design 8 subnets No.of subnet bits=Log2(8)=3 bits Ip address 211.80.64.0 is class c Net Sub Host 24 Bit 3 Bit 8 Bit 3.17
  • 18.
    Subnet NET .Subnet . Host Subnet IP Subnet 0 211.80.64 000 00000 211.80.64.0 211.80.64 000 11111 211.80.64.31 Subnet 1 211.80.64 001 00000 211.80.64.32 211.80.64 001 11111 211.80.64. 63 Subnet 2 211.80.64 010 00000 211.80.64.64 211.80.64 010 11111 211.80.64. 95 Subnet 3 211.80.64 011 00000 211.80.64.96 211.80.64 011 11111 211.80.64. 127 Subnet 4 211.80.64 100 00000 211.80.64. 128 211.80.64 100 11111 211.80.64. 159 Subnet 5 211.80.64 101 00000 211.80.64. 160 211.80.64 101 11111 211.80.64. 191 Subnet 6 211.80.64 110 00000 211.80.64. 192 211.80.64 110 11111 211.80.64. 223 Subnet 7 211.80.64 111 00000 211.80.64. 224 211.80.64 111 11111 211.80.64. 255 3.18
  • 19.
    172.16.1.0 172.16.2.0 172.16.3.0 172.16.4.0 172.16.3.255 (Directed Broadcast) 255.255.255.255 (Local NetworkBroadcast) X 172.16.255.255 (All Subnets Broadcast) Broadcast Address 3.19

Editor's Notes

  • #20 Purpose: This figure explains how broadcast addresses work. Emphasize: A range of addresses is needed to allocate address space. A valid range of addresses is between subnet zero and the directed broadcast. The following RFCs provide more information about broadcasts: RFC 919, Broadcasting Internet Datagrams RFC 922, Broadcasting IP Datagrams in the Presence of Subnets Cisco’s support for broadcasts generally complies with these two RFCs. It does not support multisubnet broadcasts that are defined in RFC 922.