INTRODUCTION to SUBNETTING How to Maximize Network Addresses
Total Page:16
File Type:pdf, Size:1020Kb
Volume 1 • Issue 8 September–October 2000 Introduction to Industrial Ethernet, Part 5. Part 4 was featured in Issue 6, the MAY–JUNE 2000. If you would like a copy, please send your request to EXTENSION [email protected] A Technical Supplement to control NETWORK © 2000 Contemporary Control Systems, Inc. INTRODUCTION TO SUBNETTING How to maximize network addresses. By George Thomas, Contemporary Controls INTRODUCTION address to distinguish it from the Class Addressing other computers. With IP In a previous article we discussed addressing, servers and IPv4 is called a classful system the Internet Protocol and the workstations are all termed hosts under RFC 761 with IP addresses structure of IP addresses. An IP but each address not only identifies being defined as belonging to one address identifies the source and a host but the address of the of five classes A, B, C, D or E. destination of a directed or unicast network on which the host resides. Classes A, B and C define different possible combinations of network message and is defined in RFC 761. This is because IP is an and host addresses. Class D is IPv4 is the most common version internetworking protocol that not reserved for multicasting. of IP addressing requiring 32-bit only allows communication Multicasting is the ability of one addresses. Although IPv6, the 128- between hosts on the same host to communicate with many bit version, will be used in the network, but communication other hosts with one transmission future, this article will restrict the between hosts on different and is beyond the scope of this discussion to IPv4. IPv6 was networks as well. The 32-bit IP article. Class E is reserved for future developed because the explosive address identifies a particular host growth of the Internet will soon use. The classes of interest to along with the network on which subnetting are A, B and C. deplete the inventory of available the host resides. The structure of IP addresses. At one time, 32-bit addressing is defined so that any With class A addresses, the first byte addresses seemed to provide more host on the public Internet can be of the address identifies the network than enough addresses but there found by any other host. address while the three remaining was much waste in initial bytes identify the host. With class B assignments and the class structure The format of the 32-bit address is addresses, the first two bytes of IP addresses was inefficient. In <netid, hostid> and it is usually identify the network address while order to make more efficient usage shown as four bytes of data. the remaining two identify the host of IP address, the concept of Although each byte could be address. With class C addresses, the subnetting was introduced with represented as a binary, decimal or first three bytes identify the network RFC 950. This article introduces hexadecimal number, the decimal- address while the last byte identifies this concept. dot-decimal notation is the most the host. That seems simple enough popular. Therefore, the range of IP but how do you know you are addresses can span 0.0.0.0 to looking at either an A, B, C, D or E Networks and Hosts 255.255.255.255. For example address? 193.5.8.254 is a valid IP address but When we talk about a network we it is difficult to determine which part The four-byte IP address is viewed usually envision a cluster of of the address is the network ID from left to right with the first byte workstations with one or more and which part is the host ID. To on the left. This is the most servers connected to a local area significant byte. The first few bits understand the two you need to network. Each server and (most significant) of that byte know about class addressing. workstation would have a unique identify the class of address. For a 1 class A address, the left most bit SUBNETTING mask. Only those bits that are set as must be a zero. For a class B a 1 will be considered when address, the first two bits must be a Subnetting creates additional defining a network address. In this 10. For a class C address, the first network IDs at the expense of host case, all the bits in the first byte of three bits must be a 110. For a IDs and can be used with either A, the IP address will be considered. class D address, the first four bits B or C class addresses. If you look The natural mask for a class B must be a 1110. For a class E at figure 2, you will notice that a address is 255.255.0.0 and for a class address, the first four bits must be a class B address uses 14 bits for C address it is 255.255.255.0. In 1111. Therefore, it is only necessary network addressing and 16 bits for order to create more network to observe the first byte of the IP host addressing. By simply addresses (subnets) we need to address to determine its class. reassigning one of the host bits to a move the mask bits to the right Figure 1 shows the decimal value of network bit, you would double the (changing 0 bits into 1s) in order to the first byte for each class. number of available network convert host bits into network bits. addresses but halve the number of The best way to understand the host addresses. Carrying the concept is to use an example. Reserved Addresses argument further, move eight of the host bits (actually the complete third There are some reserved IP address byte) to the network side. The result besides those identified as classes D is 22 bits for network addressing Class A 1-126 and E. For example, the class A and eight bits for host addressing Class B 128-191 network address 0.X.X.X cannot be which is quite similar to a class C Class C 192-223 used since it is used to indicate address. These additional network “this” network. Class A address addresses are called subnets and not Class D 224-239 127.X.X.X is reserved for loop back networks because to the Internet, Class E 240-254 testing. With the host portion of the the original address is still a class B address, you cannot have an all 0s network address but locally the Figure 1. The class of an IP address host, which refers to the network class B network address can be can be quickly identified by address where the hosts reside. broken down to manageable observing only the first byte. Likewise you cannot use the all 1s subnets that function as actual host address because that indicates network addresses. Why use a broadcast which is a message to subnets? Subnets are interconnected all hosts on the network. Therefore, using routers, and routers improve Assume we begin with IP address with any host addressing on either a network performance by reducing 165.10.0.0. From figure 1 we know class A, B or C network, you lose 2 traffic and minimizing disruption that this is a class B address with a host addresses. Still with 4 billion due to broadcast messages. Large network address of 165.10 with the possible addresses from a 32-bit networks become more manageable capability of assigning up to 65,534 address space, you would think when subnets are deployed. hosts. We do not want 65,534 hosts there are plenty of addresses even on one network but would like to with reserved addresses. The have up to 500 hosts on each subnet. In order to have 500 hosts problem is that there was much MASKING waste when addresses were on one subnet, we need to have 9 originally assigned. For example, a To create subnets you need a bits of host addressing. Currently, class A address can handle 16 subnet mask that defines which bits we have 16 bits of host addressing million hosts per one network ID. will be used to create the new since we possess a class B address. That is an enormous amount of network address out of the 32-bit IP That means that we can reassign 7 hosts for just one network. Even a addresses. By “ANDing” the 32-bit of those bits to signify subnet bits. class B address can handle 65 IP address with a 32-bit mask, we Therefore, the subnet mask would thousand hosts per network ID. A create a 32-IP address that be 255.255.254.0. In binary it class C address can handle only 254 represents <netid, subnetid> would be: hosts per network ID which may be becoming our new network address. 11111111.11111111.11111110.00000000 too little for some networks. A What do these masks look like? If scheme was needed to obtain a we start with a basic class A address The natural mask for a class B better balance between network and and do not define any subnets, the address is 255.255.0.0 so in order to host assignments and that is called mask would look like 255.0.0.0 create subnets we moved mask bits subnetting. which is called a natural or default to the right in order to convert more 2 host bits to network bits. It must be Address Network Address Host Address remembered that these mask bits Identifier must be contiguous from the left.