Lec 9 Subnet 3.1 Computer Networks Al-Mustansiryah University Elec. Eng. Department College of Engineering Fourth Year Class Lec 9 Subnet 3.1
Note 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. 3.2
Subnetting – Example 3.3 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 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: Convert to Binary 128 64 32 16 8 4 2 1 Step 1: Translate Host IP Address and Subnet Mask into binary notation 3.5
Step 2: Find the Subnet Address 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 3.6
Step 3: Subnet Range / Host Range 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. 3.7
Step 4: First Host / Last Host 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 3.8
Step 5: 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 3.9
Step 6: 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 3.10
Example 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. 3.11
Example 3.10 (continued) Solution Figure 3.9 shows the situation. 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
Solution: Net Sub Host 24 Bit 3 Bit 8 Bit 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
3.18 Subnet NET . Subnet . Host Subnet IP Subnet 0 211.80.64 000 00000 211.80.64.0 11111 211.80.64.31 Subnet 1 001 211.80.64.32 211.80.64. 63 Subnet 2 010 211.80.64.64 211.80.64. 95 Subnet 3 011 211.80.64.96 211.80.64. 127 Subnet 4 100 211.80.64. 128 211.80.64. 159 Subnet 5 101 211.80.64. 160 211.80.64. 191 Subnet 6 110 211.80.64. 192 211.80.64. 223 Subnet 7 111 211.80.64. 224 211.80.64. 255 3.18
Broadcast Address 172.16.3.0 172.16.4.0 172.16.1.0 172.16.2.0 172.16.3.255 (Directed Broadcast) 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. X 255.255.255.255 (Local Network Broadcast) 172.16.255.255 (All Subnets Broadcast) 3.19