![]() ![]() But a VLSM may not have a mask that falls on a byte boundary so one of the bytes may have a value other than 0 or 255. Since masks are created by writing some number of ones followed by zeroes, an all-ones byte will have the value 255 and an all-zeroes byte will have a value of 0, as shown above. So let's carry out that operation for the Class C address and mask above: Address:Īfter performing this calculation, the software now knows that the NET_ID is 192.168.18.0. In VLSM and Classless Inter-Domain Routing (CIDR) notation, the mask would be referred to as a /24 ("slash-24"), because there are 24 one bits in the mask.īut how does this really work? When the software needs to determine the NET_ID portion of this address (for routing purposes, for example), the 32-bit subnet mask is logically ANDed with the 32-bit address, the result being that any address bit corresponding with a 1-bit in the subnet mask maintains its value (either 0 or 1) and any address bit corresponding with a 0-bit in the subnet mask is forced to 0. It's easy for us to look at this by examination and see that the all-ones bytes refer to the network ID portion of the address and we can see that the NET_ID is 192.168.18 (which we sort of knew anyway because the first three bytes of a Class C are the NET_ID). In binary, the address (with spaces inserted for readability) is: Suppose we have the Class C address 192.168.18.55 with the regular 24-bit Class C subnet mask 255.255.255.0. In this ways, we can either aggregate many NET_IDs into a single entry in a routing table or we can segment one Class C address, for example, into several subaddresses. VLSM allows us to build masks that are of pretty much any length and are not restricted to the byte boundaries of classful addressing. Variable length subnet masking (VLSM) is essential to support classless addressing. In the parlance of subnet masking, these masks would be said to be 8, 16, or 24 bits in length but that is a misnomer it really only refers to the number if one bits since masks really are always 32 bits long. ![]() With classful addressing, then, the subnet mask will have 8, 16, or 24 one bits for Class A, B, and C addresses, respectively. Subnet masks are composed of some number of 1 bits followed by enough 0 bits to form a 32-bit value, where the bit positions with a 1 correspond with the bit positions in the IP address that are part of the NET_ID. Subnet masks, like the IP address itself, are 32 bits in length. The purpose of a subnet mask is to provide IP, routing protocols, and any other software that has to deal with addresses with a way in which the NET_ID and HOST_ID can be determined. In standard "classful" addressing, Class A addresses devote 1 byte to the network ID and 3 bytes to the host ID, Class B addresses devote 2 bytes to the network ID and 2 bytes to the host ID, and Class C addresses devote 3 bytes to the network ID and 1 byte to the host ID. Dotted decimal notation lets us examine an IP address one byte at a time. While the computer stores the IP address in binary, we typically use dotted decimal notation to write out addresses because we find it easier to read. IP addresses are 32 bits, or four 8-bit bytes, in length. Now, we can apply what we know about binary numbers to IP addresses and subnet masks. Given this information, we can convert the binary number 11010011 to decimal as follows. Let's first review the powers of 2 (we're only going to go as far as we need to for an 8-bit byte because IP addresses have 8-bit bytes). We can easily convert a binary number to a more understandable decimal value. ![]() We interpret binary numbers in exactly the same way as decimal numbers, except that each column of a binary number represents a different power of 2 rather than 10. In particular, it will help us understand binary (base 2). Now this is pretty simplistic, I admit, but understanding this is the basis for understanding any numeric base. Back when we were kids, we were taught that each digit in a decimal number stood for a different power of 10. Let's start with something that we're all pretty comfortable with, namely decimal (base 10) numbers. To truly understand how to derive IP masks and apply them to addresses, you must understand binary numbers and how to convert them to decimal. Heldman, with the title "Binary Numbers and Subnet Masks" in Windows 2000 Magazine, January 2001. An edited version of this paper appeared as a sidebar to the article "Hanging Out With the Classless Crowd" by W.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |