Building Local Area Networks IP ADDRESSING AND SUBNETTING
Building Local Area Networks IP ADDRESSING AND SUBNETTING
Introduction This presentation will cover the basics of IP Addressing and Subnetting. Topics Covered will include: What is an IP Address What are Classes What is a Network Address What are Subnet Masks and Subnet Addresses How Subnet masks are defined What is CIDR
What is an IP Address? An IP address is a unique identifier for a host connection on an IP network An IP address is a 32 bit binary number represented as 4 decimal values, each representing 8 bits, in the range of 0 to 255. Example – 140. 179. 220. 200 (dotted decimal) or in binary 10001100. 10110011. 110111001000 Every IP address has 2 parts, one part identifies the network and the other identifies the node.
Address Classes 5 Different Address Classes. You determine the class by examining the first 4 bits of the IP address Class Binary Start Decimal End Decimal Class A 0 xxx 1 126 Class B 10 xx 128 191 Class C 110 X 192 223 Class D 1110 224 239 Class E 1111 240 254
Address Classes (continued) Addresses beginning with 127 decimal are reserved for loopback and internal testing of layer 2 network activity on the local machine Class D addresses are reserved for multicasting Class E addresses are reserved for future use
Address Classes (continued) Determining which part of the IP address belongs to the network (N)and which part belongs to the host(h). Class A – NNNN. hhhhhhhh Class B – NNNNNNNN. hhhh Class C – NNNNNNNN. hhhh 140. 179. 220. 200 is a Class B so the first 2 octets identify the network address 140. 179. 0. 0 If the address was then set to 140. 179. 255 this would be a broadcast address for that network and all nodes would receive communication
IP Address Class Network and Host Capacities
Private Subnets There are 3 network address ranges reserved for private networks. These are internal IP networks that sit behind a proxy server or external router interface. Routers on the internet by default will not forward packets coming from these addresses 10. 0 to 10. 255 172. 16. 0. 0 to 172. 31. 255 192. 168. 0. 0 to 192. 168. 255
Subnetting Dividing the network in to smaller segments Subnetted for various reasons: Better organization Use of different physical media (FDDI, Ethernet, WAN) Security More efficient use of address space Improved network performance
Subnet Masking Applying a subnet mask to an IP address enables identification of network part and the host parts of the address The network bits are represented by 1’s and the host bits represented by 0’s Default Subnet Masks Class A – 255. 0. 0. 0 – 1111. 00000000 (/8) Class B – 255. 0. 0 – 11111111. 0000 (/16) Class C – 255. 0 – 11111111. 0000 (/24)
Classful method is inefficient The classful method of allocating IP addresses is inefficient For example: 192. 168. 1. 0 – this will allow for 254 hosts 192. 168. 2. 0 – this will allow for 254 hosts What if you only wanted 30 hosts on each subnet? You would waste 224 IP addresses
Classless Inter Domain Routing (CIDR) Invented to avoid wasting IP addresses Networks may be divided into smaller ranges (Subnetting) A network address and a subnet mask may include multiple subnets within one address range (Supernetting)
Creating Subnets using CIDR Number of Subnets = 2 n where n is the number of bits borrowed 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 Example - we have an IP address of 192. 168. 1. 0 /24 Class C – 11111111. 0000 255. 0 We want to create 8 subnets to make more efficient use of the address space Converting 8 into a power of 2 gives us 23 We therefore borrow 3 bits to create our new subnet mask which will be /27 11111111. 11100000 which in decimal is 255. 224 We now calculate the number of hosts in each subnet by counting the number of zero bits in the subnet mask (n) and calculating 2(n) -2 (We subtract one each for network and broadcast addresses) 25 -2 = 30 hosts. Therefore the 8 address blocks will be: 192. 168. 1. 0 – 192. 168. 1. 31 192. 168. 1. 32 – 192. 168. 1. 63 192. 168. 1. 64 – 192. 168. 1. 95 192. 168. 1. 96 – 192. 168. 1. 127 192. 168. 1. 128 and so on…………(each with 30 host addresses)
CIDR Example Class C Network – 200. 133. 175. 0 You would like to create 16 subnets Calculate the new Subnet Mask How many hosts per subnet?
Creating Subnets using CIDR Number of Subnets = 2 n where n is the number of bits borrowed 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 Class C IP address - 200. 133. 175. 0 Class C – 11111111. 0000 255. 0 We want to create 16 subnets to make more efficient use of the address space 16 is 24 We therefore borrow 4 bits to create our new subnet mask which will be /28 11111111. 11110000 which in decimal is 255. 240 We now calculate the number of hosts in each subnet by counting the number of zero bits in the subnet mask (n) and calculating 2(n) -2 24 -2 = 14 hosts. Therefore the 16 address blocks will be: 192. 168. 1. 0 – 192. 168. 1. 15 192. 168. 1. 16 – 192. 168. 1. 31 192. 168. 1. 32 – 192. 168. 1. 47 192. 168. 1. 48– 192. 168. 1. 63 192. 168. 1. 64 and so on…………(each with 14 host addresses)
Packet Tracer Activity Using the previous worked example, create 2 of the subnets in Packet tracer. Allocate the correct block of IP addresses to each subnet together with the appropriate Subnet Mask
- Slides: 16