IP数据包

本文介绍了IP地址的分类,包括A、B、C、D、E类,并讲解了子网划分、CIDR格式以及IP协议的工作原理,涉及ARP协议在同网段和不同网段的数据包转发。此外,还详细解析了IP协议包结构,包括版本、首部长度、区分服务、总长度等字段,最后阐述了如何构造IP数据报。
摘要由CSDN通过智能技术生成

IP地址

IP地址的构成
每个IP地址包括主机号,网络号,同一物理网络下的IP地址网络号相同。IP地址为32位,IP基本分为三大类

  • A类:前八位代表网络号,后24位代表主机号,该地址分配给政府机关单位使用
  • B类:前16位代表网络号,后16位代表主机号,该地址分配给中等规模的企业使用
  • C类:前24位表示网络号,后8位代表主机号,该地址分配给任何需要的人用
  • D类:不分网络ID和主机ID,该地址用于多播
  • E类:不分网络ID和主机ID,该地址用于实验

区分这几类IP:

  • A类:网络ID的第一位以0开始的地址
  • B类:网络ID的第一位以10开始的地址
  • C类:网络ID的第一位以110开始的地址
  • D类:地址以1110开始的地址
  • E类:地址以11110开始的地址

特殊IP地址在这里插入图片描述

子网划分
子网划分是将IP地址的主机ID部分划分为子网ID和主机ID,其中,子网ID用来寻找网络内的子网,主机ID用来寻找子网中的主机。子网掩码用来指明地址中有多少用于子网ID,保留多少位用于实际的主机ID

CIDR格式
无类域间路由,IP分类以后导致IP地址浪费的情况ÿ

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MICROSOFT FOUNDATION CLASS LIBRARY : ReadIP0802 AppWizard has created this ReadIP0802 application for you. This application not only demonstrates the basics of using the Microsoft Foundation classes but is also a starting point for writing your application. This file contains a summary of what you will find in each of the files that make up your ReadIP0802 application. ReadIP0802.dsp This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally. ReadIP0802.h This is the main header file for the application. It includes other project specific headers (including Resource.h) and declares the CReadIP0802App application class. ReadIP0802.cpp This is the main application source file that contains the application class CReadIP0802App. ReadIP0802.rc This is a listing of all of the Microsoft Windows resources that the program uses. It includes the icons, bitmaps, and cursors that are stored in the RES subdirectory. This file can be directly edited in Microsoft Visual C++. ReadIP0802.clw This file contains information used by ClassWizard to edit existing classes or add new classes. ClassWizard also uses this file to store information needed to create and edit message maps and dialog data maps and to create prototype member functions. resReadIP0802.ico This is an icon file, which is used as the application s icon. This icon is included by the main resource file ReadIP0802.rc. resReadIP0802.rc2 This file contains resources that are not edited by Microsoft Visual C++. You should place all resources not editable by the resource editor in this file. AppWizard creates one dialog class: ReadIP0802Dlg.h, ReadIP0802Dlg.cpp - the dialog These files contain your CReadIP0802Dlg class. This class defines the behavior of your application s main dialog. The dialog s template is in ReadIP0802.rc, which can be edited in Microsoft Visual C++. Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named ReadIP0802.pch and a precompiled types file named StdAfx.obj. Resource.h This is the standard header file, which defines new resource IDs. Microsoft Visual C++ reads and updates this file. Other notes: AppWizard uses "TODO:" to indicate parts of the source code you should add to or customize. If your application uses MFC in a shared DLL, and your application is in a language other than the operating system s current language, you will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. For example, MFC42DEU.DLL contains resources translated to German.) If you don t do this, some of the UI elements of your application will remain in the language of the operating system.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值