当前位置:网站首页>Dynamic Host Configuration Protocol
Dynamic Host Configuration Protocol
2022-06-28 02:26:00 【ZhuMou】
One . Two tools for describing protocols
1.1 MSC(Message Sequence Chart)

Message sequence diagrams include : Entity 、 Messages and actions , And the timeline . Its function is to describe the function of the protocol from the overall interaction . The reason is that on the whole , Because it covers all entities in the protocol implementation , The difference in STD Describe only one entity . Interaction by message and action To embody .
When calling by telephone MSC chart :

It can be seen that ,entity produce action,action produce message,message And often bring other entity Of action.
How to draw a picture MSC? First, identify all the entities in the agreement . For every entity , Determine what they can do action And what can be sent message. Then it is to determine the interaction relationship between entities .
1.2 STD(State Transition Diagram)

STD It is also used to introduce the protocol functions , It's just that compared to MSC Focus on the whole ,STD Focus on one entity in the agreement . STD Contained in the :event,message,state.event and state All belong to STD The entity described , and incoming message From other entities , and outgoing message From this entity .
It can be seen from the figure above , Draw a picture STD chart We need to first list all the... That the entity may be in under the agreement state. And then we'll make it clear state Transformation conditions between (incoming message or event) And transformation results (outgoing message).

1.3 TLV
We know message There are many field, It corresponds to different functions . such as TCP packet This message There is one of them. Source IP Address Of field, Its function is to store and send the TCP packet Of the source host IP Address . For the purpose of realizing specific functions , There are some field It's indefinite (variable length), such as TFTP message Medium Error Domain , In order to store the variable length string of error prompt ,Error The domain itself is of indefinite length .
So the question is how do we deal with message Medium variable length field Well ?TLV Format ( Or coding style ).
TLV yes type-length-value Abbreviation , It represents variable length field The information stored in should be organized so that it can be decoded : Store fixed length type, Indication type ( For example, different error types ); Store fixed length length, instructions value The length of ; Store variable length value, Its length consists of length Given .

Two .IP address allocation --- DHCP Introduce
DHCP Dynamic host configuration protocol , The function is to configure relevant information for the host that wants to access the network , The main one is IP Address . There are two ways to allocate network related configuration information : Static allocation ( That is, it is manually entered by the user ) And dynamic allocation ( By a server Distribute ). There are two commonly used dynamic configuration protocols :BOOTstrap Protocol and DHCP. The differences and similarities between the two are :
| DHCP | BOOTP | |
| function | For the host ( There is a hard disk and boot file Of ) Configure relevant network information | The host can use BOOTP obtain IP Address , But the most important function is that the diskless workstation uses this protocol and TFTP obtain boot file. |
| Transport layer | UDP, DHCP client Of port by 67. | UDP |
| Validity period of the configuration | The network configuration information has a valid period . Reallocate after expiration . | The term of validity is unlimited , That is, it will not rebind or update the network configuration |
| message Format | The two are the same |
3、 ... and .DHCP The entities involved and the period of validity
3.1 DHCP server
3.2 DHCP client

3.3 DHCP lease

Four .DHCP message

Focus on the domains to be introduced (field) yes OPTIONS. Its variable length , follow TLV Format . We introduce when type by 53 when ( Express OPTIONS Stored DHCP message Type information for ) The case when .
here length and type Each occupies one byte ,type = 53 and length = 1.value It also takes one byte , It can be for :
value = 1; DHCPDISCOVER value = 2; DCHPOFFER value = 3;DHCPREQUEST value = 4; DHCPDECLINE value = 5; DHCPACK value = 6;DHCPNAK value = 7; DHCPRELEASE value = 8;DHCPINFORM


5、 ... and .DHCP operation
DHCP It mainly includes three operations , When we parted IP address Acquisition , release sb. before the sentence expires IP Address , to update IP The lease term of the address . Each operation corresponds to different functions , We can draw MSC chart .
5.1 IP The address for

From the above to IP Description of the address acquisition process , We can extract three entity:DHCP host, DHCP server and other DHCP server(offer Not accepted server).

5.2 Early Lease Termination( Give up early IP Address )

5.3 Lease Renewal
IP The lease term of the address has expired and needs to be updated .
Be careful ,client By selected server After refusing (DHCPNAK), It will not enter the third or fourth picture . These four figures are in parallel ( This is a combination STD It is obvious that ).


边栏推荐
猜你喜欢

SQL 注入绕过(二)

嵌入式必学,硬件资源接口详解——基于ARM AM335X开发板 (上)

Appium自动化测试基础 — ADB常用命令(一)

To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine

树莓派实现温控风扇智能降温

Jenkins - 邮件通知 Email Notification 插件

Jenkins - Pipeline concept and creation method

将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)

Jenkins - 访问 Jenkins 自定义参数变量,处理变量值中含有空格

How fiddle uses agents
随机推荐
The interviewer asked: can you simulate the new operator of JS
云平台kvm迁移本地虚拟机记录
[Yocto RM]1 - System Requirements
Cesium Click to obtain longitude and latitude (2D coordinates)
Appium自动化测试基础 — ADB常用命令(一)
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
mysql面试百题集
MySQL十种锁,一篇文章带你全解析
TI AM3352/54/59 工业核心板硬件说明书
后勤事务繁杂低效?三步骤解决企业行政管理难题
Cesium obtains the latitude and longitude range of the screen
Jenkins - Pipeline concept and creation method
Appium automation test foundation ADB common commands (I)
A set of sai2 brushes is finally finished! Share with everyone!
Jenkins - 邮件通知 Email Notification 插件
树莓派实现温控风扇智能降温
geojson 格式说明(格式详解)
How fiddle uses agents
【sylixos】NEW_ Example of type 1 character drive
Introduction to hybrid apps