忍者ブログ

醤油みたいな使いかっての良いブログにしたい
04 2024/05 1 2 3 45 6 7 8 9 10 1112 13 14 15 16 17 1819 20 21 22 23 24 2526 27 28 29 30 31 06

05.17.11:59

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

  • 05/17/11:59

05.20.23:33

DHCPパケットを見てみた

DHCPサーバー:Windows Server 2008 R2(192.168.1.117)
DHCPクライアント:Windows 7

まずは基本的な Discover, Offer, Request, Ack から。
=====================================
0.0.0.0     255.255.255.255 DHCP Discover
192.168.1.117 255.255.255.255 DHCP Offer
0.0.0.0     255.255.255.255 DHCP Request
192.168.1.117 255.255.255.255 DHCP ACK
=====================================

Offer 以降はユニキャストでよさそうな気もするけど、ブロードキャストでやり取りするのね。

パケットの中身の少々見てみる。

■Discover
=====================================
Transaction ID: 0x2c255782
Seconds elapsed: 0
Bootp flags: 0x8000 (Broadcast)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Next server IP address: 0.0.0.0 (0.0.0.0)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Vmware_58:86:07 (00:0c:29:58:86:07)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (t=53,l=1) DHCP Message Type = DHCP Discover
Option: (t=61,l=7) Client identifier
Option: (t=12,l=12) Host Name = "Win7-test01"
Option: (t=60,l=8) Vendor class identifier = "MSFT 5.0"
Option: (t=55,l=12) Parameter Request List
=====================================

当然ですけど、Client IP Address とかはまだ空っぽ。
自分のホスト名を通知したりするんですね。

■Offer
=====================================
Message type: Boot Reply (2)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x2c255782
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 192.168.1.200 (192.168.1.200)
Next server IP address: 192.168.1.117 (192.168.1.117)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Vmware_58:86:07 (00:0c:29:58:86:07)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (t=53,l=1) DHCP Message Type = DHCP Offer
Option: (t=1,l=4) Subnet Mask = 255.255.255.0
Option: (t=58,l=4) Renewal Time Value = 4 days
Option: (t=59,l=4) Rebinding Time Value = 7 days
Option: (t=51,l=4) IP Address Lease Time = 8 days
Option: (t=54,l=4) DHCP Server Identifier = 192.168.1.117
Option: (t=15,l=12) Domain Name = "syoyu.local"
Option: (t=6,l=4) Domain Name Server = 192.168.1.115
=====================================

Your (client) IP addressの192.168.1.200 を貸してやるけどどうだいー?
とDHCPサーバーが応答。リース期限とかの情報も含まれてますね。

■Request
=====================================
Message type: Boot Request (1)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x2c255782
Seconds elapsed: 0
Bootp flags: 0x8000 (Broadcast)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Next server IP address: 0.0.0.0 (0.0.0.0)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Vmware_58:86:07 (00:0c:29:58:86:07)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (t=53,l=1) DHCP Message Type = DHCP Request
Option: (t=61,l=7) Client identifier
Option: (t=50,l=4) Requested IP Address = 192.168.1.200
Option: (t=54,l=4) DHCP Server Identifier = 192.168.1.117
Option: (t=12,l=12) Host Name = "Win7-test01"
Option: (t=81,l=27) Client Fully Qualified Domain Name
Option: (t=60,l=8) Vendor class identifier = "MSFT 5.0"
Option: (t=55,l=12) Parameter Request List
=====================================

クライアントがそれ(Requested IP Address = 192.168.1.200)くださいーとRequest

■Ack
=====================================
Message type: Boot Reply (2)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x2c255782
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 192.168.1.200 (192.168.1.200)
Next server IP address: 0.0.0.0 (0.0.0.0)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Vmware_58:86:07 (00:0c:29:58:86:07)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (t=53,l=1) DHCP Message Type = DHCP ACK
Option: (t=58,l=4) Renewal Time Value = 4 days
Option: (t=59,l=4) Rebinding Time Value = 7 days
Option: (t=51,l=4) IP Address Lease Time = 8 days
Option: (t=54,l=4) DHCP Server Identifier = 192.168.1.117
Option: (t=1,l=4) Subnet Mask = 255.255.255.0
Option: (t=81,l=3) Client Fully Qualified Domain Name
Option: (t=15,l=12) Domain Name = "syoyu.local"
Option: (t=6,l=4) Domain Name Server = 192.168.1.115
=====================================

最後にサーバーがOK!とAck
PR
URL
FONT COLOR
COMMENT
Vodafone絵文字 i-mode絵文字 Ezweb絵文字
PASS

TRACK BACK

トラックバックURLはこちら