Читать книгу Networking All-in-One For Dummies - Lowe Doug, Doug Lowe - Страница 171

The great subnet roundup

Оглавление

You should know about a few additional restrictions that are placed on subnets and subnet masks. In particular

 The minimum number of network ID bits is eight. As a result, the first octet of a subnet mask is always 255.

 The maximum number of network ID bits is 30. You have to leave at least two bits for the host ID portion of the address to allow for at least two hosts. If you use all 32 bits for the network ID, that leaves no bits for the host ID. Obviously, that won't work. Leaving just one bit for the host ID won’t work, either, because a host ID of all ones is reserved for a broadcast address, and all zeros refers to the network itself. Thus, if you use 31 bits for the network ID and leave only 1 for the host ID, host ID 1 would be used for the broadcast address, and host ID 0 would be the network itself, leaving no room for actual hosts. That's why the maximum network ID size is 30 bits.SUBNETS VERSUS VLANsAll of this talk of subnets might have you wondering: What’s the difference between subnets and virtual local area networks (VLANs)? If you’ve read Book 1, Chapter 2, you know that VLANs are a divide-and-conquer technique for managing large networks. Subnetting is also a divide-and-conquer technique.So, are they the same thing, and do they serve the same purpose?The answer is: No, but sort of kind of. But really, no.Although VLANs and subnets seem similar, VLANs are a layer 2 construct, and subnets are a layer 3 construct.In other words, VLANs have nothing to do with IP addresses and subnets have nothing to do with MAC addresses.That being said, it is very common — and usually desirable — to design your network with a one-to-one correspondence between VLANs and IP subnets. This usually simplifies the task of managing both.As an example, suppose you want to divide a single-office network with just a hundred or fewer users into three groups: End-user devices like computers and printers, servers and network devices, and Voice over Internet Protocol (VoIP) phones. You could use three VLANs to do this — call them VLAN 10, VLAN 20, and VLAN 30.You could then use three subnets — 192.168.10.x, 192.168.20.x, and 192.168.30.x.There’s a natural correspondence between these three VLANs and the three subnets, and network setup and management will be easier because the VLANs and subnets correspond to one another.Although you can have a single VLAN that supports multiple subnets, in most networks there is a one-to-one correspondence that allows the benefits of VLANs and subnets to complement one another.

 Because the network ID portion of a subnet mask is always composed of consecutive bits set to 1, only eight values are possible for each octet of a subnet mask: 0, 128, 192, 224, 248, 252, 254, and 255.

 A subnet address can't be all zeros or all ones. Thus, the number of unique subnet addresses is two less than two raised to the number of subnet address bits. For example, with three subnet address bits, six unique subnet addresses are possible (23 – 2 = 6). This implies that you must have at least two subnet bits. (If a single-bit subnet mask were allowed, it would violate the “can’t be all zeros or all ones” rule because the only two allowed values would be 0 or 1.)

Networking All-in-One For Dummies

Подняться наверх