編輯擷取自Cisco文章:
Packet Flow 封包交換流程
Network Diagram 網路架構圖
DHCP Relay with Packet Captures on the DHCP RELAY SERVER Inside and Outside Interface
以下是從DHCP Relay Server的Inside和OutSide埠所抓取的DHCP Relay封包解析內容。
Make a note of content highligted in RED, because that is how the DHCP RELAY SERVER modifies various fields.
請注意內文中紅字註解的部分,紅字部分的不同就是每一個流程的關鍵部分。
1. In order to start the DHCP process, boot the system and send a broadcast message (DHCPDISCOVER) to the destination address 255.255.255.255 - UDP port 67.
1. Client重開機後,會送出一個稱為(DHCPDISCOVER)的廣播封包,目的地位置(destination address)是 255.255.255.255,使用 UDP port 67。目的是為了尋找同一個L3網段內是否有DHCP Server。這個送出的封包是L3廣播封包,在同一個L3網段中的所有IP都會收到這個封包,包含DHCP Relay Server的Inside埠(192.0.2.1)。
2. Normally, DHCP RELAY SERVER would drop the broadcast, but because it is configured to act as a DHCP relay, it forwards the DHCPDISCOVER message as a unicast packet to the DHCP server's IP sourcing from the interface IP that faces the server. In this case, it is the outside interface IP address. Notice the change in the IP header and relay agent field:
3. The server sends back a DHCPOFFER message as a unicast packet to the DHCP RELAY SERVER, destined to the relay agent IP set up in DHCPDISCOVER- UDP port 67. In this case, it is the IP address of the inside interface (giaddr), wheredhcprelay is enabled. Notice the destination IP in the layer 3 header:
4. DHCP RELAY SERVER sends this packet out of the inside interface - UDP port 68. Notice the change in the IP header while the packet leaves the inside interface:
5. Once client receive the DHCPOFFER message, send a DHCPREQUEST message in order to indicate that you accept the offer.
6. DHCP RELAY SERVER passes the DHCPREQUEST to the DHCP server.
7. Once the server gets the DHCPREQUEST, it sends the DHCPACK back in order to confirm the offered IP.
8. DHCP RELAY SERVER passes the DHCPACK from the DHCP server to you, and that completes the transaction.
9. Finished
完成。