💯
University Notes
  • Introduction
  • High Level Math
    • Function, limitation, and continuity
      • What is function?
      • Two kinds of infinity
      • The limitation of a function
      • A model for getting limitation
    • Derivative and differential
      • Formulas of derivative
      • Use derivative formula
      • Goes deeper
      • Use derivative
        • Function analyzing in theory
          • First derivative
          • Second derivative
          • Domain and Extreme Value
          • Overall change
        • Derivative use in reality
    • Integration
      • Indefinite integral
        • Basic formulas
        • Use formula
        • Goes deeper
        • Integration by parts
      • Definite integral
        • Properties of definite integral
        • Second fundamental theorem of calculus
        • Multi-method for solving definite integral
    • Multivariable calculus
      • Limitation
      • Partial derivatives
      • Differential
      • Multiple integral
    • Series
    • Linear algebra
    • GaoKao
      • 1
      • The road for starting
      • Polar Coordinates
      • Tangent Line
  • Electrical Engineering
    • The Terminologys
    • DC
      • The circuit rule
      • KCL and KVL
      • Superposition
    • AC
      • Intuition
      • Resistor
      • Inductor
      • Capacitor
      • AC circuit
      • 三相电
        • 星形联结
        • 三角形联结
        • 实际电路
    • Voltage and Current Rule in Circuit
    • Response
      • Foundations
      • 零输入响应
      • 零状态响应
      • 一阶电路的全响应
  • Analog Electronics
    • Technical terms 1
    • DC stable source circuit 的分析与应用
      • 二极管的特性与应用
        • 半导体
        • PN junction
        • Diode
        • 测试二极管
      • 整流滤波电路的分析与应用
        • Rectifier circuit
      • 直流稳压电路的分析
        • Zener diode
        • Shunt voltage regulators
    • Thyristor
    • Technical terms 2
    • Amplifying circuit
      • Bipolar Junction Transistor
      • Common Emitter Configuration
      • Biasing
      • Analysis
      • Mess
      • Negative-feedback amplifier
      • Integrated Operational Amplifier
    • Algorithms
      • What's the ouput of a voltage rectifier circuit
      • PNP or NPN
      • Judging the state of a BJT
      • What's common in BJT
      • Does a amplifying circuit normal
      • What's the feedback type
      • What kind of distortion you are encounter
  • Digital Electronic Technology
    • Logic Gate
    • Logic expressions
    • Karnaugh map
    • Number system
    • Multiplexer
    • Flip-flop
  • Principles of Communications
    • Overviews
    • PCM
    • HDB3
    • Modulations
    • Cyclic code
  • Data Communications and Networking
    • Something about IPv4
  • Micro Control System 51 Series
    • The Delay function
    • The Interrupt function
  • Maintenance of Railway Optical Cable Lines
    • Questions
    • Pictures
  • Mobile Communications
    • Concepts
    • Coding and Modulation
    • Key Technologies
    • Mobile communication network structure
    • Radio wave Propagation and Interference
    • GSM
    • CDMA
    • GPRS
    • 3G
    • 4G
    • Base Station Maintenance
  • Multimedia Communication
    • Concept of Multimedia
    • Compression
    • Lossless Compression
    • Audio
    • Lossy Audio Coding
    • Graph Compression
    • All for the exam
  • Power system for Communication Devices
    • Overview
    • AC power Distribution Panel
    • UPS
    • HF Switched-mode Power Supply
    • Battery
    • Earthing or Use Lightning Arrester
    • Power Supply Monitoring System
    • All for the exam
  • Optical fiber Communication system
    • What is Optical fiber Communication system
      • Prepare
      • Something About Optical fiber
      • Passive Optical Devices
      • Active Optical Devices
      • Optical transmitter Test
      • Optical receiver Test
      • Compose an Optical Communication System
    • SDH (Synchronous Digital Hierarchy)
      • Frame Structure of SDH
      • SDH Equipments
      • Clock System
      • ZXONM E300 Practice
      • SDH protection
    • WDM (Wavelength-Division Multiplexing)
    • OTN (Optical Transport Network)
      • OverHead of OTN
      • OTN Alarms & Errors
      • Do it again, what's happened?
  • Communication Tech English
    • Fundamentals of Electricity
    • Digital Communications
    • Optical Communications
  • High-speed railway Communication Technology
    • Overview
    • Base Knowledge
    • FH98
    • MDS3400
    • Everything is for the exam
  • GSM for Railway
    • Overview
    • Wired Parts
    • Digital dispatch Communication System
    • Basic Knowledge of GSM-R
    • Key technologies for GSM-R
    • Structure of GSM-R
    • GSM-R Network Mode
    • Wireless Channels for GSM-R
    • Mobility Management
    • Connection Management
    • Security Management
    • GPRS
    • GSM-R/GPRS Wireless Access Platform
    • GSM-R Features
    • GSM-R Numbering Plan
    • ASCI
  • Network Configuration Training
    • Words I have learned
  • Broadband Access Technology
    • Using Copper Line
    • Using Optical Fiber
    • Wireless
    • All for the test
  • CIR
    • Basci Knowledge
    • Testing Equipment
    • The Structure of CIR
    • All for the exam
  • LTE
  • Script for ChaoXing
  • Transmission and access network
Powered by GitBook
On this page
  • 前言
  • 什么是IP
  • 地址要分类
  • (1)
  • (2)
  • 后续

Was this helpful?

  1. Data Communications and Networking

Something about IPv4

前言

虽然IP v6是未来的主流,但目前学校以及大量我国单位还在用旧的v4

什么是IP

Internet Protocol

其用十进制表示,看起来像这样:192.168.1.1 (就是4段0~255的数)

用2进制表示,是这样:11111111.11111111.111111111.00000000 = 255.255.255.0

平时写代码的时候,只是操作单个主机、单个IP。

一旦把管理范围扩大,我们就需要管理整个网络了,所以真实世界的IP不是孤立存在的,而是成群结队的出现。

比如一个范围由192.168.0.0到192.168.255.255的网络

  1. 这个网络的第一个IP地址, 192.168.0.0,被当成这个网络的标识

  2. 该网络的最后一个地址,192.168.255.255,会被当成广播地址,向它发信息,那条信息会被广播到该网络的每一个地址

由此一来,IP必须由两部分组成:网络号+主机号

举个例子:在网络202.93.0.0里,某个IP202.93.44.55的主机号是44.55,网络号是202.93

地址要分类

人们最开始把所有IP v4地址像这样分(假设网络号=c,主机号=x):

Class      Theoretical Address Range
A      0.0.0.0 to 127.255.255.255      c.x.x.x
B      128.0.0.0 to 191.255.255.255      c.c.x.x
C      192.0.0.0 to 223.255.255.255      c.c.c.x
D      224.0.0.0 to 239.255.255.255      I don't know

IPv4总数是2的32次方=4,294,967,296,不够用

所以聪明的人类又开始动歪脑筋折磨后人了(但事实上只需要写一个程序自动帮我们计算,只是不知道为什么学校要求学生手动计算这个东西,真麻烦)

具体的原理可以参照 Data Communications and Networking - Behrouz A. Forouzan 这本书

我这里只讲一讲应试教育的解题方法(其实我压根就不该写这么多,直接写题目才是正确的套路)

题目:将一个 B类 的网络172.17.0.0划分为14个子网,求每个子网的子网掩码 and 每个子网的IP范围

(1)

因为 是B类网,所以 122.17固定不变,0.0可变; 0.0变为 2进制 为00000000.00000000

因为要划分为 14 个子网,我们需要思考2的多少次方刚好 > 14

23=82^3=823=8 ,24=162^4=1624=16

因为 24=162^4=1624=16 刚好大于 14,所以我们要占用主机位2进制前4位来划分子网

因为子网掩码本质上是用 1 代表 网络位,0代表主机位

所以该题的子网掩码的2进制形式变为了 11111111.11111111.11110000.00000000

把它变成10进制: 8个1为255,8个0为0

11110000的转换方法:

0×20+0×21+0×22+0×23+1×24+1×25+1×26+1×27=0+0+0+0+16+32+64+128=0+48+64+128=112+128=240\begin{align*} &0 \times 2^0 + 0 \times 2^1 + 0 \times 2^2 + 0 \times 2^3 + 1 \times 2^4 + 1 \times 2^5 + 1 \times 2^6 + 1 \times 2^7 \\ \\ &= 0 + 0 + 0 + 0 + 16 + 32 + 64 + 128 \\ \\ &= 0 + 48 + 64 + 128 \\ \\ &= 112 + 128 \\ \\ &= 240 \end{align*}​0×20+0×21+0×22+0×23+1×24+1×25+1×26+1×27=0+0+0+0+16+32+64+128=0+48+64+128=112+128=240​

所以最终该题子网掩码变为了 255.255.240.0

(2)

不知道原因,但我从我课本的描述中总结出了地址划分的规律

假设主机位被占用的个数为 xxx,B=8−xB = 8 - xB=8−x ,2B−12^B - 12B−1 为每个子网的范围

在这道题,主机位被占用的个数为 4,B=8−4=4B=8-4=4B=8−4=4

24−1=16−1=152^4 - 1 = 16 - 1 = 1524−1=16−1=15 ,得到了每个子网的范围后,就可以开始写表了

初始地址为 172.17.0.1

172.17.0.1 ~ 172.17.15.254
172.17.16.1 ~ 172.17.31.254
172.17.32.1 ~ 172.17.47.254
... ...
172.17.224.1 ~ 172.17.239.254
172.17.240.1 ~ 172.17.255.254

不要问我 首和尾 哪儿去了,一个用于标识网络,一个用于广播

后续

至于更多的题,我暂时不想写了

PreviousData Communications and NetworkingNextMicro Control System 51 Series

Last updated 5 years ago

Was this helpful?