Subnetting.pdf
Document Details
Uploaded by Deleted User
Full Transcript
# Subnetting ## 1. Introduction * The original intent of the IP addresses was that the network part of the IP address would uniquely identify exactly one physical network. * Subnets: use a single IP network number and allocate the IP addresses with that network number to several networks. *...
# Subnetting ## 1. Introduction * The original intent of the IP addresses was that the network part of the IP address would uniquely identify exactly one physical network. * Subnets: use a single IP network number and allocate the IP addresses with that network number to several networks. * The mechanism by which a single network number can be shared among multiple networks involves configuring all nodes on each subnet with a _subnet mask_. * In subnet the hosts may be on different physical networks but share a single network number. * Each host in the subnet is configured with IP address and Subnet mask. The subnet number is calculated by doing "bitwise AND" between IP address and subnet mask. ## 2. Example * Subnet mask: 255.255.255.128 * Subnet number: 128.96.34.0 * Subnet mask: 255.255.255.128 * Subnet number: 128.96.34.128 * Subnet mask: 255.255.255.0 * Subnet number: 128.96.33.0 ## 3. Router Work * The job of the router also changes when subnetting is introduced. The router uses a forwarding table entry: (_SubnetNumber_, _SubnetMask_, _NextHop_) * D = destination IP address * D1 = SubnetMask & D * If D1 = SubnetNumber: * If NextHop is an interface, deliver datagram directly to destination. * Else deliver datagram to NextHop (a router). * Example forwarding table: | SubnetNumber | SubnetMask | NextHop | |:---: |:---:| :---: | | 128.96.34.0 | 255.255.255.128 | Interface 0 | | 128.96.34.128 | 255.255.255.128 | Interface 1 | | 128.96.33.0 | 255.255.255.0 | R2 | ## 4. Create Subnets Example * Create 6 subnets from the IP network address 192.168.1.128. Find the subnet mask and maximum no. of node per subnet and list of networks. * 2<sup>n</sup> = No. of subnets. But we can use only 2<sup>n</sup> – 2 subnets only. * From given data, 2<sup>n</sup> = 8, so n=3 (3 bits needed from host id). But we can use 6 subnets. * So total possible subnets are 8. From that 6 subnets can be used. ## 5. Find Subnet Mask * Default subnet mask for class c address = 255.255.255.0 * In binary = 11111111.11111111.11111111.00000000 * We need 3 bits: 11111111.11111111.11111111.11100000 => 255.255.255.224 * So subnet mask is 255.255.255.224 ## 6. Find Network ID * Binary AND between IP address and subnet mask: * 192.168.1.128 => 11000000.10101000. 00000001. 10000000 * 255.255.255.224=> 11111111. 11111111. 11111111. 11100000 * 192.168.1.128 => 11000000.10101000. 00000001. 10000000 ## 7. Find No. of Hosts Per Subnet * Balance bits are 5. * So 2<sup>5</sup> - 2 = 30 hosts can be in single subnet. ## 8. Subnet List Example | Sub Network Number | Hosts From | Hosts To | Broadcast Address | Remarks | |:---: |:---:| :---: |:---:| :---: | | 192.168.1.0 | 192.168.1.1 | 192.168.1.30 | 192.168.1.31 | Unusable | | 192.168.1.32 | 192.168.1.33 | 192.168.1.62 | 192.168.1.63 | Usable | | 192.168.1.64 | 192.168.1.65 | 192.168.1.94 | 192.168.1.95 | Usable | | 192.168.1.96 | 192.168.1.97 | 192.168.1.126 | 192.168.1.127 | Usable | | 192.168.1.128 | 192.168.1.129 | 192.168.1.158 | 192.168.1.159 | Usable | | 192.168.1.160 | 192.168.1.161 | 192.168.1.190 | 192.168.1.191 | Usable | | 192.168.1.192 | 192.168.1.193 | 192.168. 1.222 | 192.168. 1.223 | Usable | | 192.168.1.224 | 192.168.1.225 | 192.168.1.254 | 192.168.1.255 | Unusable | ## 9. Create Subnets Example 2 * For the IP network address 192.128.0.128, create subnets with 60 hosts per subnet. Find the subnet mask, no. of subnets and list of subnets.