Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1353710
  • 博文数量: 188
  • 博客积分: 4847
  • 博客等级: 上校
  • 技术积分: 2124
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-06 13:49
个人简介

Who am I?

文章分类

全部博文(188)

分类: 信息化

2013-09-10 21:14:33

CIDR notation is a compact representation of an IP address and its associated routing prefix. The notation is constructed from the IP address and the prefix size, the latter being equivalent to the number of leading 1bits in the routing prefix mask. The IP address is expressed according to the standards of IPv4 or IPv6. It is followed by a separator character, the slash ('/') character, and the prefix size expressed as a decimal number.

The address may denote a single, distinct interface address or the beginning address of an entire network. The maximum size of the network is given by the number of addresses that are possible with the remaining, least-significant bits below the prefix. This is often called the host identifier.

For example:

  • 192.168.100.0/24 represents the given IPv4 address and its associated routing prefix 192.168.100.0, or equivalently, its subnet mask 255.255.255.0.
  • the IPv4 block 192.168.100.0/22 represents the 1024 IPv4 addresses from 192.168.100.0 to 192.168.103.255.
  • the IPv6 block 2001:db8::/48 represents the IPv6 addresses from 2001:db8:0:0:0:0:0:0 to 2001:db8:0:ffff:ffff:ffff:ffff:ffff.
  •  ::1/128 represents the IPv6 loopback address. Its prefix size is 128, i.e. the size of the address itself, indicating that this facility consists of only this one address.

Before CIDR notation, IPv4 networks were represented using dot-decimal notation for both the address and thesubnet mask. Thus, 192.168.100.0/24 would be written as 192.168.100.0/255.255.255.0.

The number of addresses of a subnet defined by the mask or prefix can be calculated as 2address size - prefix size, in which the address size is 128 for IPv6 and 32 for IPv4. For example, in IPv4, a prefix size of /29 gives: 232-29 = 23 = 8 addresses.

阅读(1038) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~