zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    简单的BMCP位图图片压缩算法
    163相册验证码图片的识别手记之二 识别
    认父亲的DbParameter!!
    文件同步精灵(初版)
    163相册验证码图片的识别手记之一 去除干扰
    C#中WebService里的回车符"\r"丢失问题
    PHP 杂谈《重构改善既有代码的设计》之二 对象之间搬移特性
    PHP5计划任务离线功能的原理
    (转)程序员疫苗:代码注入
    window7环境,不安装Oracle,使用PL/SQL Developer结合oracle精简客户端,管理Oracle数据库
  • 原文地址:https://www.cnblogs.com/oxspirt/p/6224909.html
Copyright © 2011-2022 走看看