• subnetting and the subnet mask


    原文:https://www.techopedia.com/6/28587/internet/8-steps-to-understanding-ip-subnetting/5

    Step 4 - Subnetting and the Subnet Mask

    To subnet a network is to create logical divisions of the network. Subnetting, therefore, involves dividing the network into smaller portions called subnets. Subnetting applies to IP addresses because this is done by borrowing bits from the host portion of the IP address. In a sense, the IP address then has three components - the network part, the subnet part and, finally, the host part.

    We create a subnet by logically grabbing the last bit from the network component of the address and using it to determine the number of subnets required. In the following example, a Class C address normally has 24 bits for the network address and eight for the host, but we are going to borrow the left-most bit of the host address and declare it as identifying the subnet.

    If the bit is a 0, then that will be one subnet; if the bit is a 1, that would be the second subnet. Of course, with only one borrowed bit we can only have two possible subnets. By the same token, that also reduces the number of hosts we can have on the network to 127 (but actually 125 useable addresses given all zeros and all ones are not recommended addresses), down from 255.

    So how can you tell how many bits should be borrowed, or, in other words, how many subnets we want to have on our network?

    The answer is with a subnet mask.

    Subnet masks sound a lot scarier than they really are. All that a subnet mask does is indicate how many bits are being “borrowed” from the host component of an IP address. If you can’t remember anything about subnetting, remember this concept. It is the foundation of all subnetting.

    The reason a subnet mask has this name is that it literally masks out the host bits being borrowed from the host address portion of the IP address.

    In the following diagram, there is a subnet mask for a Class C address. The subnet mask is 255.255.255.128 which, when translated into bits, indicates which bits of the host part of the address will be used to determine the subnet number.

    Of course, more bits borrowed means fewer individually addressable hosts that can be on the network. Sometimes, all the combinations and permutations can be confusing, so here are some tables of subnet possibilities.

    Note that this combination of IP addresses and subnet masks in the charts are written as two separate values, such as Network Address = 205.112.45.60, Mask = 255.255.255.128, or as an IP address with the number of bits indicated as being used for the mask, like 205.112.45.60/25.

    Subnet masks work because of the magic of Boolean logic. To best understand how a subnet mask actually does its thing, you must remember that a subnet mask is only relevant when getting to a subnet. In other words, determining what subnet an IP address lives on is the only reason for a subnet mask. It’s devices like routers and switches that make use of subnet masks.

  • 相关阅读:
    Android Studio的project中两个build.gradle配置的区别
    build script和all projects作用和区别
    让overflow:auto页面滚动条出现时不跳动
    GreenDao设置数据版本
    Greendao 缓存问题
    js中文编码到C#后台解码
    content-type: application/json没有设置导致的500错误
    Android的Device File Explorer刷新文件
    adb server version (31) doesn't match this client (40); killing...
    Sqlserver远程过程调用失败
  • 原文地址:https://www.cnblogs.com/oxspirt/p/6224909.html
Copyright © 2020-2023  润新知