IP Address Problems

  • IP Address Exhaustion

    • Class A, B, and C address structure inefficient
    • Class B too large for most organizations, but future proof
    • Class C too small
  • IP routing table size
    • Growth in # of networks in Internet reflected in # of table entries
    • Stress on router processing power and memory allocation
  • Short-term solution:
    • Classless Interdomain Routing (CIDR), RFC 1518
    • New allocation policy (RFC 2050)
    • Private IP Addresses set aside for intranets(企业内部网) (NAT)
  • Long-term: IPv6 with much bigger address space

Classless Interdomain Routing Scheme

  • CIDR uses an arbitrary(任意的) prefix length to indicate the network number

    • 205.100.0.0/22
    • /22 means mask: 11111111 11111111 11111100 00000000 - 255.255.252.0,means the mask is 22 bits long
  • Packets are routed according to the prefix w/o address classes
    • An entry in CIDR routing table contains 32-bit IP address and 32-bit mask
  • Enables supernetting to allow a single routing entry to cover a block of classful addresses

CIDR Aggregation(聚合)

  • A company is allocated the following four contiguous(相邻的) /24 networks. At some router, it is often true that all of the four networks use the same outgoing line. CIDR aggregation can be done to reduce the number of entry at the router.

    • 128.56.24.0/24; 10000000 00111000 00011000 00000000
    • 128.56.25.0/24; 10000000 00111000 00011001 00000000
    • 128.56.26.0/24; 10000000 00111000 00011010 00000000
    • 128.56.27.0/24. 10000000 00111000 00011011 00000000
      By Per-bit AND
    • 128.56.24.0/22 10000000 00111000 00011000 00000000
      (Instead of 4 entries in routing table, one entry is sufficient by CIDR)

CIDR Scheme and Range

  • CIDR deals with Routing Table Explosion Problem

    • Networks represented by prefix and mask
    • Summarize a contiguous group of class C addresses using variable-length mask, if all of them use the same outgoing line
  • Solution: Route according to prefix of address, not class
    • Routing table entry has <IP address, network mask>
    • Example: 192.32.136.0/21
    • 11000000 00100000 10001000 00000001 min address
    • 11111111 11111111 11111--- -------- mask
    • 11000000 00100000 10001--- -------- IP prefix
    • 11000000 00100000 10001111 11111110 max address
    • Eight C networks: 192.32.136.0/24 to 192.32.143.0/24

CIDR Supernetting Example (1)

  • Summarize a contiguous group of class C addresses using variable-length mask
  • Example: 150.158.16.0/20
    • IP Address (150.158.16.0) & mask length (20)
    • IP address = 10010110 10011110 00010000 00000000
    • Mask = 11111111 11111111 11110000 00000000
    • Contains 16 Class C blocks:
    • From 10010110 10011110 00010000 00000000
      i.e. 150.158.16.0/24
    • Up to 10010110 10011110 00011111 00000000
      i.e. 150.158.31.0/24

CIDR Supernetting Example (2)

  • A router has the following CIDR entries in its routing table:

    • Address/mask - - - - -Next hop
    • 128.56.24.0/22 - - - - - Interface 0
    • 128.56.60.0/22 - - - - -Interface 1
    • default - - - - -Router 2

    A packet comes with IP address of 128.56.63.10. What does the router do?

  • 128.56.63.10 and mask 22 bits
  • First, the address will be transform into binary, then use MASK by AND operation to get the prefix, finally it will match the table, if match a interface, go to it.
    • IP address = 10000000 00111000 01111111 00001010
    • Mask = 11111111 11111111 11111100 00000000
      By Per-bit AND
    • Prefix = 10000000 00111000 01111100 00001010
      i.e. 128.56.60
    • Router table lookup and match, should go to interface 1

New Address Allocation Policy

  • Class A & B assigned only for clearly demonstrated need
  • Consecutive(连续的) blocks of class C assigned (up to 64 blocks)
    • All IP addresses in the range have a common prefix, and every address with that prefix is within the range
    • Arbitrary prefix length for network ID improves efficiency
  • Address assignment should reflect the physical topology of the network
    • Facilitates the aggregation of logical packet flows into physical flows

Longest Prefix Match

  • By CIDR, multiple entries may match a given IP destination address ,but different prefix
  • Example: perform CIDR on the following three /24 IP addresses (but 128.56.24.0/24 to a different port)
    • 128.56.25.0/24;
    • 128.56.26.0/24;
    • 128.56.27.0/24;
    • By CIDR aggregation(Per-bits AND): 128.56.24.0/22
    • What if a packet with destination IP address 128.56.24.1 comes? It belongs to another port

Example of Longest Prefix Match

Classless Interdomain Routing (CIDR)的更多相关文章

  1. Netmask, 子网与 CIDR (Classless Interdomain Routing)

    Netmask, 子网与 CIDR (Classless Interdomain Routing) 我们前面谈到 IP 是有等级的,而设定在一般计算机系统上面的则是 Class A, B, C.现在我 ...

  2. [转]CIDR简介

    IP Subnetting and Variable Length Subnet Masks Subnetting Basics 子网划分(subnetting)的优点: 1.减少网络流量 2.提高网 ...

  3. IP协议

    因特网协议(Internet Protocol, IP)是Internet的核心协议之一, 工作在网络层.IP协议提供节点间的寻址,路由以及顺序控制, 流量控制等服务. IP协议分为IPv4和IPv6 ...

  4. (转) IPv6相关RFC

    转自http://blog.csdn.net/lucien_cc/article/details/12688477 IPv6 Spec RFC 2460 : Internet Protocol, Ve ...

  5. IPv6 tutorial 4 IPv6 address syntax

    https://4sysops.com/archives/ipv6-tutorial-part-4-ipv6-address-syntax/ Now that you know about the n ...

  6. How Network Load Balancing Technology Works--reference

    http://technet.microsoft.com/en-us/library/cc756878(v=ws.10).aspx In this section Network Load Balan ...

  7. wireshark filter manualpage

    NAME wireshark-filter - Wireshark filter syntax and reference SYNOPSIS wireshark [other options] [ - ...

  8. 【计算机网络】 一个小白的网络层学习笔记:总结下IP,NAT和DHCP

    前言:这篇文章是学习网络层协议时候总结的笔记,前面的主要部分介绍的都是IP协议, 后半部分介绍NAT协议和DHCP协议 参考书籍 <计算机网络-自顶向下>       作者 James F ...

  9. OSPF(Open Shortest Path First)

    1.概述 路由协议OSPF全称为Open Shortest Path First,也就开放的最短路径优先协议,因为OSPF是由IETF开发的,所以所有厂商都可以用. OSPF的流量使用IP协议号. O ...

随机推荐

  1. MySQL:ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

    错误:ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) 原因 :登录帐户错误(ODB ...

  2. java爬虫之入门基础

    相比于C#,java爬虫,python爬虫更为方便简要,首先呢,python的urllib2包提供了较为完整的访问网页文档的API,再者呢对于摘下来的文章,python的beautifulsoap提供 ...

  3. Java 方法重载和多态

    先来看看什么是方法重载? 方法重载的要求是:方法名相同,参数列表不同(不同的参数类型或者参数顺序或者参数个数).至于方法的其他部分,如方法返回值类型和修饰符,与方法重载没有任何关系.最好加上@Over ...

  4. Java Object类的equals()方法

    所有类都从Object类中继承了equals方法,Object类中equals方法源代码如下: public boolean equals(Object obj)     {         retu ...

  5. 2013 Warm up 3 -- Skill --- dp

    题意:求n位数字,满足非递减的个数. dp[ i ] [ j ] = sum( dp[i -1] [ k ] );  k =>( j , 9); #include<iostream> ...

  6. python 2.7支持中文

    在代码的第一行加上#coding=utf-8 return render_template('index.html',message=u"小明小明")print u'你要打印的字符 ...

  7. webapi下载文件

    [HttpGet] public IHttpActionResult ExportData() { ... var dt = ExcelHelper.ListToDataTable(list); va ...

  8. php扩展库

    php调用C/C++动态链接库 字数997 阅读28 评论0 喜欢0 本人最近在找实习,移动开发方向.有意者可直接与本人联系.谢谢! 一.简介 一般而言,php速度已经比较快,但是,对于一些较高级开发 ...

  9. hihoCoder 1148 2月29日

    时间限制:2000ms 单点时限:1000ms 内存限制:256MB 描述 给定两个日期,计算这两个日期之间有多少个2月29日(包括起始日期). 只有闰年有2月29日,满足以下一个条件的年份为闰年: ...

  10. redis 在linux安装

    转自:http://futeng.iteye.com/blog/2071867 下载 官网下载 安装 tar zxvf redis-2.8.9.tar.gz cd redis-2.8.9 #直接mak ...