Subnetting March 7 (Day); March 2 (Night) Introduction to Network Addresses: o TCP/IP is the most widely used protocol in the world. The Internet uses only IP addressing. In order for a host to access the Internet, it must have an IP address. o IP addresses consist of four numbers (between 0-255) separated by dots. Each number is known as an octet. o Because each octet can be between 0-255, it can be represented by 8 bits. Therefore, the entire address is represented by 32 bits. o In its most basic form, the IP address has two parts: a network ID and a host ID. The network ID portion of an IP address refers to the network. Hosts on a network can communicate directly only with devices that have the same network ID. Hosts might share the same physical segment, but if they have different network IDs, they usually cannot communicate with each other – unless there is another device that can make a connection between the networks. This device is usually a router. Host Net A Host Net A Router Host Net B Host Net B Once data reaches the appropriate network, it uses the host portion of the IP address to find the individual computer. o All networks have a network address. Usually, it is going to be the lowest value in that particular network. Classes of Network Addresses: o There are five classes of IP addresses (A through E). Only the first three classes (A-C) are used regularly. o Summary of Network Classes: Class A B C 1st Octet 1-126 128-191 192-223 Network/ Host ID N.H.H.H N.N.H.H N.N.N.H # of Networks 126 16,382 2,097,150 Hosts per Network 16,777,216 65,536 256 o In class A addresses, the first octet is the network ID and the last three octets are host ID. Because the last three octets are dedicated to host addresses, this means you can have 16,777,216 hosts on a class A network. We know this because 2^24=16,777,216 OR 256 x 256x 256=16,777,216. o In class B addresses, the first two octets are the network ID and the last two octets are host ID. Because the last two octets are dedicated to host addresses, this means you can have 65,536 hosts on a class A network. o We know this because 2^16=65,536 OR 256 x 256=65,536. In class C addresses, the first three octets are the network ID and the last octet is the host. Because the last octet is dedicated to host addresses, this means you can have 256 hosts on a class A network. We know this because 28=256 OR 256. What is Subnetting: o Network administrators sometimes need to divide networks, especially large ones, into smaller networks. These smaller divisions are called subnetworks. o Each subnetwork is connected to one another by a device known as a router. o Larger networks are broken down into subnetworks through the use of a numbering scheme known as the subnet mask. o Routers use the “ANDing” process to determine if a destination host is on the same network or not. Basically, you multiply the binary equivalent of the IP address by the binary equivalent of the subnet mask to get the network address. o Here are the default subnet masks. Class A uses 255.0.0.0. Class B uses 255.255.0.0. Class C uses 255.255.255.0. o Let’s apply the ANDing process and the subnet mask to calculate the network address for the host 200.1.1.5. Decimal form Binary form Host address 200.1.1.5 11001000.00000001.00000001.00000101 Subnet mask 255.255.255.0 11111111.11111111.11111111.00000000 Resulting network address (binary 11001000.00000001.00000001.00000000 form): Resulting network address (dec form): 200.1.1.0 Creating a Custom Subnet Mask for a Class C Address: o Let’s pretend that we want less than 256 hosts on one network with a network address of 200.1.1.0. We want two subnets and to separate them with a router for security reasons and to reduce traffic. o The first step to subnetting is to determine how many subnets we need. In this case we need two. o The next step is to see how many bits we should borrow from the host portion of the network address, begin to add the bits from the right to left until the total is equal to or greater than the number of subnets we need. 128 64 32 16 8 4 2 1 2 + 1 = 3 which is greater than the number of subnets we need. o After we know how many bits to borrow, we take them from the left side of the fourth octet of the host address. Bits we need to borrow 128 64 32 16 8 4 2 1 1 1 0 0 0 0 0 0 Our custom subnet mask is going to be 255.255.255.192. The 192 comes from the value of the first two bits from the left. (The 192 comes from 128 + 64). o Since we borrow two bits for the network ID. This means we may have 22=4 subnets. o Since we borrow two bits for the network ID, this leaves only six bits for the host ID. This means that we may have 26=64 hosts on each subnet. o Here’s a chart that demonstrates the four subnets we can create. Subnet No. 0 1 2 3 o Network Address 200.1.1.0 200.1.1.64 200.1.1.128 200.1.1.192 Range of Available Addresses 200.1.1.0 – 200.1.1.63 200.1.1.64 – 200.1.1.127 200.1.1.128 – 200.1.1.191 200.1.1.192 – 200.1.1.255 Based on our example, can a host of 200.1.1.5 send data directly to a host of 200.1.1.70? o Based on our example, can a host of 200.1.1.5 send data directly to a host of 200.1.1.60?