# IPv4 - DHCP [TOC] ## 課程影片 ### Introduction to DHCP (with demos in Linux) {%youtube SL56sVAzxSE %} ### 第 7LMN 講 路由器運作原理以及網路互連技術 L07 12 13 14 {%youtube 4aRXm4ujh7g %} ### Lec36 計算機網路 第四章 Internet Protocol Layer (10/19) {%youtube XrpQl7gtAlg %} ## 目標:動態地分配 IP 位址 現在已經有分配一個網段的 IP 了,問題就是哪台機器要拿哪個 IP? ## DHCP 封包格式 取自 [RFC2131](https://datatracker.ietf.org/doc/html/rfc2131): ```c 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | op (1) | htype (1) | hlen (1) | hops (1) | +---------------+---------------+---------------+---------------+ | xid (4) | +-------------------------------+-------------------------------+ | secs (2) | flags (2) | +-------------------------------+-------------------------------+ | ciaddr (4) | +---------------------------------------------------------------+ | yiaddr (4) | +---------------------------------------------------------------+ | siaddr (4) | +---------------------------------------------------------------+ | giaddr (4) | +---------------------------------------------------------------+ | | | chaddr (16) | | | | | +---------------------------------------------------------------+ | | | sname (64) | +---------------------------------------------------------------+ | | | file (128) | +---------------------------------------------------------------+ | | | options (variable) | +---------------------------------------------------------------+ ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up