当前位置:网站首页>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 ).


边栏推荐
猜你喜欢

Lmsoc: a socially sensitive pre training method

Using redis bitmap to realize personnel online monitoring

Machine learning (x) reinforcement learning

SQL 注入绕过(四)

SQL injection Bypass (2)

【永艺XY椅】试用体验

Jenkins - access the Jenkins user-defined parameter variable, and handle the variable value containing spaces

766. toplitz matrix

Figure out the difference between MIT, BSD and Apache open source protocols

《低代码解决方案》——覆盖工单、维修和财务全流程的数字化售后服务低代码解决方案
随机推荐
解决ionic4 使用hammerjs手势 press 事件,页面无法滚动问题
Jenkins - built in variable access
SQL injection Bypass (2)
Review of drug discovery-03-molecular design and optimization
SQL 注入繞過(二)
将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
Cesium Color 颜色(赋值)随机颜色
[Yocto RM] 2 - Yocto Project Terms
[Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
Numpy----np.reshape()
fiddle如何使用代理
Jenkins - email notification plug-in
Cesium anti aliasing (lines, borders, etc.)
[Yocto RM]3 - Yocto Project Releases and the Stable Release Process
mysql面试百题集
Appium automation test foundation - Supplement: app package name and appactivity
【永艺XY椅】试用体验
JS 随机数(随机数 小数)
Cesium 点击获取经纬度(二维坐标)
Capacitor