TCP/IPherIP compile and addressIP subnetwork(Subnets) have a classIP addressIP Subnetting and Subnet Masking


IP分组首部中有两个极其重要的字段,就是源地址和目的地址

  • Source Address (SA) - from where
  • 目的地址(DA)-到哪儿去

接口(interface): 主机/路由器与物理链路的连接

  • Implementing network layer functions
  • 路由器通常有多个接口
  • Hosts typically have only one or two interfaces (e.g., wired Ethernet interface, wireless 802.11 interface)

IP address: 32-bit (IPv4) number identifies the interface of the host, router ** IP address associated with each interface **

Paste_Image.png

How do I assign an IP address to an interface?

Instead of directly assigning an ip address to each host, we continue to borrow the idea of common divisions, first classifying them and then subdividing them specifically within classes, so this leads to the concept of subnets.

IP subnets (Subnets)

  • Device interfaces whose IP addresses have the same network number
  • 不跨越路由器(第三及以上层网络设备)可以彼此物理联通的接口

We divide the ip address into two parts, the high bit part, we treat as the network number, all the same, then belong to the same subnet, the status bit is divided into the host number, distinguishing between different specific host interfaces.

IP address:

  • Network number (NetID) - high bit
  • HostID - low bit

Paste_Image.png

There is a class IP address

Paste_Image.png

Paste_Image.png

IP子网划分与子网掩码

For further segmentation, sometimes we need more classifications, so it is also a question of how to divide the subnets further. 我们采取与之前相同的策略,将主机号的一部分比特位提出来作为子网号

IP address:

  • Network number (NetID) - high bit
  • SubID - part of the original network host number bits
  • HostID - low bit

image.png

如果我们拿两个比特位作为子网号,那么就可以分出四个子网

image.png

So the question is again, how to determine whether the subnet is divided? How many bits are used to divide subnets? Answering this question requires the use of subnet masks, which is a very important concept Subnet mask Shaped like an IP address:

  • 32-bit
  • 点分十进制形式

取值:

  • NetID、 SubID位全取1
  • HostID位全取0

Subnet address + subnet mask → accurate subnet size determination

例如:

  • The default subnet mask for network A is: 255.0.0.0
  • B网的默认子网掩码为: 255.255.0.0
  • C网的默认子网掩码为: 255.255.255.0
  • The subnet mask of network B, which borrows 3 bits for subnetting, is: 255.255.224.0

例如:

  • Subnets 201.2.3.0, 255.255.255.0, divided into 4 subnets of equal length Then two bits are to be utilized.

image.png

How does a router determine which subnet it should forward IP packets to? Extract the subnet address by bitwise summing the destination IP address of the IP group with the subnet mask

例如:

  • Destination IP address: 172.32.1.112, subnet mask: 255.255.254.0

image.png

  • Subnet address: 172.32.0.0 (subnet mask: 255.255.254.0)
  • 地址范围: 172.32.0.0~172.32.1.255
  • Assignable address range: 172.32.0.1 to 172.32.1.254
  • 广播地址: 172.32.1.255

Recommended>>
1、Learn about public network penetration
2、Microsoft Research is developing an AI drawing robot say what you want to draw
3、NetEase Planet allegedly collects important privacy of users with pseudo blockchain game suspected to pave the way for financial business
4、Must See Notes for 2018 Score
5、You can skip the hospital later AI doctors diagnose faster than specialists

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号