network, IP address, subnetting

1. Several terminologies:

Address:

Subnet:

Subnet mask: A 32-bit combination used to describe which portion of an adress refers to the subnet and which part refers to the host.

Interface: A network connection

Net ID:

Host ID:

Subnetwork ID:

2. IP Address:

An IP address is an adress used in order to uniquely identify a device on an IP network. It is made up of 32 binary bits which can be divisible into a network portion and host portion with the help of a subnet mask. 32-bits are brokern into 4 octets(8 bits = 1 octet), for example: 172.16.81.00 = 10101100 | 00010000 | 01010001 | 00000000

There are five different classes of networks, A to E. Classes D and E are reserved.

Given an IP address, its class can be dertermined from the three high-order bits(the three left-most bits in the first octet.)

Class A: the first one bit is zero, and the first one byte is used to NetID, the rest bytes are Node ID. The range of Class A address is 1.0.0.0 - 127.255.255.255). where is 0.0.0.0 ?

0 x x x x x x x |---------------------------------the rest 24 bits------------------|

Class B: the first two bits are 10, and the first two bytes are used to NetID,the rest bytes are Node ID.

1 0 x x x x x x x x x x x x x x |--------------------------the rest 16 bits------|

Class C: the first three bits are 110, and the first three bytes are used to NetID, the rest byte is Node ID.

1 1 0 x x x x x x x x x x x x x x x x x x x x x |-----------the rest 8 bits----|

Class D: the first four bits are 1110, and the first four bytes are used to NetID.

1 1 1 0 |-------------------------the rest 28 bits reserved ----------------------|

Class E: the first four bits are 1111, and the first four bytes are used to NetID.

1 1 1 1 |-------------------------the rest 28 bits reserved ----------------------|

3. Network Mask:

A network mask is a 32-bit binary mask used to divide an IP address into subnets and specify the network‘s available hosts. Class A ,B, C networks have default maskes, also known as natural masks.

Class A: 255.0.0.0

Class B: 255.255.0.0

Class C: 255.255.255.0

The mask is to help determin which part of IP address is Net ID and which part is host ID.

Any address bits which have corresponding mask bits set to 1 represents the network ID; Any address bits which have conresppinging mask bits set to 0 represents the host ID.

4. Subnetting:

In order to create multiple logical networks that exist within a single Class A , B, or C network, we need subnetting.

By extending the default mask (255.255.255.0) to be (255.255.224), we have taken three bits(indicated by ""host) from the original host portion and used them to make subnets. Totally we can make 8 subnets from these three bits with the remaining 5 bits for host ID bits. Each subnet can have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of all zeros or all ones are not allowed.

For exampel, given a class C network of 204.170.4.0 which has a natural mask of 255.255.255.0. Now a given a extended mask 255.255.224.0. So the 8 subnets are:

204.170.4.0  255.255.255.224  host address range from 1 to 30.

204.170.4.32 255.255.255.224  host address range from 33 to 62

204.170.4.64  255.255.255.224  host address range from

204.170.4.96  255.255.255.224  host address range from

204.170.4.128  255.255.255.224  host address range from

204.170.4.160  255.255.255.224  host address range from

204.170.4.192  255.255.255.224  host address range from

204.170.4.224  255.255.255.224  host address range from

There is another way to denote the mask. One is 255.255.255.224 and another way is /27. The second way is called CIDR(), prefix/length.

For example, 204.17.5.32/27 denotes the network 204.17.5.32 255.255.255.224

5. Determing how many subnets and available hosts/devices in each subnet

how many subnets are there in each Class network?  Depending on how many bits are borrowed from the host bits.  2^n, n means the bits that ‘s used for subnetting.

how many hosts/devices in each subnet? Depending on how many bits are used for host.  2^m-2, m bits are used for host

For example,  Class B network, given a mask of 255.255.248.0(/21), then we can calculate that 2^5 subnets available, and 2^11 host addresses and 2^11 -2 can be assigned to devices.

7. Given  the address/mask, and determin the subnet

     

原文地址:https://www.cnblogs.com/sarah-zhang/p/12105250.html

时间: 2024-08-27 14:34:41

network, IP address, subnetting的相关文章

If application data needs to be sent to IP address xx.xx.xx.xx, how does it work in underneath network?

This is to illustrate the communication between two separate machines which don't have a direct physical connection. Application data is generated and passed to layer 3 (network layer) which wrapps up the data with the destination IP address. Then ha

oracle 11g RAC安装节点二执行结果错误CRS-5005: IP Address: 192.168.1.24 is already in use in the network

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oins

Linux下network提示Determining if ip address

[[email protected] NetworkManager]# service network restart正在关闭接口 eth0: [确定]关闭环回接口: [确定]弹出环回接口: [确定]弹出界面 eth0: Determining if ip address 192.168.8.102 is already in use for device eth0... vi /etc/sysconfig/network-scripts/ifcfg-eth0 添加   ARPCHECK=no

linux/centos6.5 network提示Determining if ip address * is already in use for device eth0

系统:centos 6.5 今天,在重启网卡的时候发现了如下的问题 [[email protected] ~]# service network restart 正在关闭接口 eth0: [确定] 关闭环回接口: [确定] 弹出环回接口: [确定] 弹出界面 eth0: Determining if ip address 192.168.100.201 is already in use for device eth0... [确定] 开始以为是IP地址冲突了,但是经排查,发现就只有这台服务器上

Windows Azure Virtual Network (7) 设置Azure Virtual Machine固定公网IP (Virtual IP Address, VIP) (2)

<Windows Azure Platform 系列文章目录> 在笔者之前的博客中Windows Azure Virtual Network (6) 设置Azure Virtual Machine固定公网IP (Virtual IP Address, VIP) (1),笔者介绍了如何在创建虚拟机的时候,将固定公网地址进行绑定. 很遗憾,在很多情况下,客户已经使用Azure Management Portal创建了新的虚拟机.以前的办法只能将DNS删除,并且保留VHD,然后重新创建新的Cloud

【资料整理】cisco [OSI, IP Address, Network Segment, Subnet Mask]

### Concept ### ---------------------- from 20110712 to 20110716 1.Network segment { router; switch; bridge; } 2.LAN blocks { broadcast domain; broadcast  storm; multicast; low brandwidth; } 3.benefits of the router { ! forward broadcast; filter msgs

Windows Azure Cloud Service (44) 将Cloud Service加入Virtual Network Subnet,并固定Virtual IP Address(VIP)

<Windows Azure Platform 系列文章目录> 在之前的文章中,笔者已经详细介绍了如何将Virtual Machine加入Virtual Network,并且绑定固定的Private IP和Virtual IP Address (公网IP地址) Windows Azure Virtual Network (5) 设置Azure Virtual Machine固定Private IP       Windows Azure Virtual Network (6) 设置Azure

router 分配ip address(dhcp)和dhcp中继

路由器的主要功能是网络寻址,有时候也需要用来分配ip地址.但用路由器分配地址又会加大路由器的负载,所以,有的时候我们可以把分配地址的工作交给一台PC. 1.使用router分配ip address: Router>en Router#conf t Enter configuration commands, one per line.  End with CNTL/Z. Router(config)#int vlan 1 Router(config-if)#ip dhcp pool vlan1  

Debian static ip address

1 // /etc/network/interfaces 2 auto eth0 3 iface eth0 inet static 4 address <Your ip address> 5 netmask <Your netmask> 6 gateway <Your gateway address> 7 broadcast <Your broadcast address> 8 9 // /etc/resolv.conf 10 nameserver <