考了一个computer network的期中考试,搞了半天也没弄明白subnet和基本IP address的,感觉很郁闷,于是花了一个小时好好研究了一下,记录在此。
为啥要用:
一般来说,IP address分为前段network,后端为host number,有三种格式,Class A B C,即使是B或C,里面host容量也挺大的,一个机构如果用不了那么多,那就多花钱不值得。于是就用submask盖一下,让只有后边几个数代表host 的number。
咋用:
A subnet mask of 255.255.255.0 tells the computer to use the first three numbers as the network and the last as the node. A mask of 255.255.0.0 would tell it to use only the first two numbers as network and the rest as the node.
例如:
虚: Subnet Mask 255.255.240.000 11111111.11111111.11110000.00000000
实: IP Address 150.215.017.009 10010110.11010111.00010001.00001001
结果:Subnet Address 150.215.016.000 10010110.11010111.00010000.00000000
The subnet address, therefore, is 150.215.016.000.
后记:
An IP address of the form 255.0.0.0 (1 number for network, 3 for node) is called a Class A network
An IP address of the form 255.255.0.0. (2 for network, 2 for node) is called a Class B
An IP address of the form 255.255.255.0 (3 for network, 1 for node - most common) is called a Class C network.
Reference:
https://answers.yahoo.com/question/index?qid=20100524090500AAn9e1c