Dynamic Host Configuration Protocol (DHCP)

download Dynamic Host Configuration Protocol (DHCP)

of 18

description

DHCP

Transcript of Dynamic Host Configuration Protocol (DHCP)

14Dynamic Host Configuration Protocol (DHCP)

DHCP client/server IP Address DHCP DHCP

: DHCP DHCP DHCP (DHCP client, DHCP server, , DHCP relay agent) Microsoft Windows 6 Dynamic Host Configuration Protocol TCP / IP Microsoft Windows \Fundamentals CD-ROM

DHCP MessagesDHCP client DHCP server DHCP DHCP 8 User Datagram Protocol (UDP) DHCP client DHCP 255.255.255.255 DHCP client unicast DHCP DHCP client UDP 68 DHCP server DHCP relay agent 67 DHCP 8 : DHCPDISCOVER DHCP client DHCP server DHCPOFFER DHCP server DHCP client DHCPDISCOVER DHCPREQUEST DHCP client DHCP server DHCP server ( DHCP ) DHCPACK DHCP server DHCP client DHCPREQUEST DHCPNAK DHCP server DHCP client DHCPREQUEST subnet DHCP client DHCPDECLINE DHCP client DHCP server DHCPRELEASE DHCP client DHCP server DHCPINFORM DHCP client DHCP server DHCP server Windows Server 2008 DHCP, RFCs 2131 2132

: RFCs \Standards\Chap14_DHCP CD-ROM

DCHP Message Format 14-1 DHCP DHCP : Message Op Code (Op) 1 ( 1) ( 2) Hardware Address Type (Htype) 1 DHCP client Hardware Type Address Resolution Protocol (ARP) 3 Address Resolution Protocol (ARP) ARP Hardware Type http://www.iana.org/assignment/arp-parameters. Hardware Address Length (Hlen) 1 IEEE 802 Ethernet IEEE 802.11 6

14-1 DHCP Message Format Hops 1 DHCP relay agents 0 DHCP relay agents DHCP DHCP client DHCP server hop DHCP 16 16 DHCP relay agents DHCP relay agent DHCP DHCP relay agents Remote Access windows server 2008 4 hops Transaction ID (Xid) 4 DHCP client DHCP Seconds (Secs) 2 DHCP client address Flags 2 flags DHCP client RFC 2131 high-order Broadcast flag DHCP client Broadcast flag ( 0) ( 1) unicast IP datagrams Windows Server 2008 Windows Vista-based DHCP clients Broadcast flag 1 (broadcast ) DHCP server flag unicast ( Broadcast flag 0) Broadcast ( Broadcast flag 1) Client IP Address (Ciaddr) 4 IP Address DHCP client DHCP client DHCP IP address ARP address Your IP Address (Yiaddr) 4 IP address DHCP client DHCP server Server IP Address (Siaddr) 4 IP address DHCP server IP address Gateway IP Address (Giaddr) 4 DHCP relay agent DHCP client DHCP relay agent subnet DHCP client broadcast DHCP DHCPDISCOVER DHCPREQUEST subnet DHCP client DHCP server DHCP client Client Hardware Address (Chaddr) 16 hardware address DHCP client Byte hardware address DHCP server relay agent hardware address IEEE 802-based media access control (MAC) address 6 Ethernet 802.11 network adapter DHCP client 10 0 Server Host Name (Sname) 64 DHCP server DHCP server Windows Server 2008 Boot File Name (File) 128 boot image BOOTP client BOOTP DHCP diskless boot file Trivial File Transfer Protocol (TFTP) server boot file DHCP Options variable-length DHCP options

Broadcast Flag DHCP server Windows Server 2008 Broadcast flag Flag broadcast-based DHCP DHCP client DHCP server Broadcast flag registry IgnoreBroadcastFlag 0IgnoreBroadcastFlagLocation: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DhcpServer\Parameters Data type: REG_DWORD Valid range: 01 Default value: 1 Present by default: No

14-1 DHCP 236 variable-length DHCP options DHCP UDP DHCP UDP datagram variable-length DHCP maximum transmission unit (MTU) 264 20 IP header 8 UDP header Ethernet IP MTU 1,500 DHCP options

DHCP OptionsDHCP options IP Address DHCP header DHCP options IP Address DHCP client Your IP Address DHCP options DHCP client default gateway DHCP server Windows Server 2008 DHCP option RFC 2131 2132 vendor-specific DHCP options Windows-based DHCP clients 14-2 DHCP options

14-2 DHCP option Option Type A 1 DHCP option http://www.iana.org/assignments/bootp-dhcp-parameters Option Length A 1 DHCP option Option Length Option Data variable-length DHCP option fixed-length options fixed-length options data variable-length options data fixed-length options Pad (Option Type 0) End (Option Type 255) 14-1 DHCP options Windows-based DHCP clients ServersOption NameOption Code (Decimal)Option Length ValueOption Description

Pad0N/A DHCP Pad option con-sists option code 0

Subnet Mask14 subnet mask DHCPOFFER DHCPACK

Router3Variable: 4 client subnet

Domain NameServers6Variable: 4 DNS servers

OptionOption Code (Decimal) Option Option

Host Name12Variable length: 1 client DHCPDISCOVER, DHCPREQUEST DHCPNAK

DNS Domain Name15Variable-length: ASCII char-acters 1 DNS domain DHCP client host DNS

Perform Router Discovery311 client Router Discovery subnet

Static Route33Variable: 8 class-based desti-nation next-hop () static routes DHCP client

Vendor-specific Information43Variable length clients servers vendor-specific information vendorspecific RFC 2132

WINS/NBNS Servers44Variable: 4 WINS server primary secondary

NetBIOS Over TCP/IP Node Type461 NetBIOS 1 B-node (broadcast)2 P-node (point-to-point)4 M-node (mixed)8 H-node (hybrid)

NetBIOS Scope ID47Variable: 1 NetBIOS over TCP/IP

Requested Address504 DHCP client () address DHCPREQUEST, DHCPDECLINE DHCPDISCOVER

OptionOption Code (Decimal) Option Option

Lease Time514

DHCP Message Type531 DHCP 1 DHCPDISCOVER2 DHCPOFFER3 DHCPREQUEST4 DHCPDECLINE5 DHCPACK6 DHCPNAK7 DHCPRELEASE8 DHCPINFORM DHCP

Server Identifier544 DHCP server DHCOFFER, DHCPREQUEST, DHCPACK, DHCPDECLINE DHCPRELEASE

Parameter Request List55Variable length: 1 DHCP options DHCP client option DHCP option DHCPDISCOVER, DHCPREQUEST DHCPINFORM

Renewal Time (T1)584 client DHCPOFFER DHCPACK

Rebinding Time(T2)594 client rebinding DHCPOFFER DHCPACK

OptionOption Code (Decimal) Option Option

Client Identifie61Variable length: 2 Ethernet 6 DHCP client Windows-based DHCP clients MAC address client DHCPDISCOVER DHCPREQUEST, DHCPDECLINE, DHCPNAK, DHCPRELEASE

Dynamic DNS Update81Variable length fully qualified domain name (FQDN) DHCP server FQDN DNS server DHCPREQUEST

Classless StaticRoute121Variable: 5 subnet mask next-hop () static routes DHCP client RFC 3442

Classless StaticRoute249Variable: 5 subnet mask next-hop () static routes DHCP client 121

End255N/A options DHCP DHCP option Option Code 255

DHCP clients Windows Server 2008 Windows Vista DHCP Options Parameter Request () 1 (0x01) Subnet Mask 15 (0x0F) DNS Domain Name 3 (0x03) Router 6 (0x06) DNS Servers 44 (0x2C) WINS/NBNS Servers 46 (0x2E) NetBIOS Node Type 47 (0x2F) NetBIOS Scope ID 31 (0x1F) Perform Router Discover 33 (0x21) Static Route 21 (0x79) Classless Static Routes 249 (0xF9) Classless Static Routes 43 (0x2B) Vendor-Specific Information

DHCP Message Exchanges DHCP DHCP-leased DHCP servers 14-3 DHCP DHCP client DHCP server subnet DHCP client

14-3 DHCP

14-01 \Captures CD-ROM DHCPDISCOVER ( 1) 14-01 Network Monitor 3.1Frame: - Ethernet: Etype = Internet IP (IPv4) + DestinationAddress: *BROADCAST + SourceAddress: 00123F17E0CF EthernetType: Internet IP (IPv4), 2048(0x800) + Ipv4: Next Protocol = UDP, Packet ID = 10839, Total IP Length = 328 + Udp: SrcPort = BOOTP client(68), DstPort = BOOTP server(67), Length = 308 - Dhcp: Boot Request, MsgType = DISCOVER, TransactionID = 0xBCBCFAE3 OpCode: Boot Request, 1(0x01) Hardwaretype: Ethernet HardwareAddressLength: 6 (0x6)HopCount: 0 (0x0)TransactionID: 3166501603 (0xBCBCFAE3) Seconds: 0 (0x0) - Flags: 32768 (0x8000) Broadcast: (1...............) Broadcast Reserved: (.000000000000000) ClientIP: 0.0.0.0 YourIP: 0.0.0.0 ServerIP: 0.0.0.0 RelayAgentIP: 0.0.0.0 - ClientHardwareAddress: 00-12-3F-17-E0-CFEthernetAddress: 00-12-3F-17-E0-CF ServerHostName: BootFileName: MagicCookie: 99.130.83.99 - MessageType: DISCOVER Code: DHCP Message Type, 53(0x35) Length: 1 UINT8(s) Value: DISCOVER, 1(0x1) - AutoConfigure: Auto Configure (1) Code: Auto-Configure, 116(0x74) Length: 1 UINT8(s) Value: Auto Configure (1) - clientID: (Type 1) Code: Client-identifier, 61(0x3D) Length: 7 UINT8(s) Type: HardwareAddress(1) ClientID: Binary Large Object (6 Bytes) - RequestedIPAddress: 10.0.0.3 Code: Requested IP Address, 50(0x32) Length: 4 UINT8(s) IpAddress: 10.0.0.3 - HostName: VistaPC Code: Host Name, 12(0x0C) Length: 7 UINT8(s) Name: VistaPC - VendorClassIdentifier: MSFT 5.0 Code: Class-identifier, 60(0x3C) Length: 8 UINT8(s) VendorClassIdentifier: MSFT 5.0 - ParameterRequestList: Code: Parameter Request List, 55(0x37) Length: 12 UINT8(s) Parameter: Subnet Mask, 1(0x01) Parameter: Domain Name, 15(0x0F) Parameter: Router, 3(0x03) Parameter: Domain Name Server, 6(0x06) Parameter: NetBIOS over TCP/IP Name Server, 44(0x2C) Parameter: NetBIOS over TCP/IP Node Type, 46(0x2E) Parameter: NetBIOS over TCP/IP Scope, 47(0x2F) Parameter: Perform Router Discovery, 31(0x1F) Parameter: Static Route, 33(0x21) Parameter: Classless Static Route Option, 121(0x79) Parameter: Classless Static Route, 249(0xF9) Parameter: Vendor specific information, 43(0x2B) - End: Code: End of Options, 255(0xFF)

DHCP client Ethernet network adapter Hardware 1 Hardware Address Length 6 MAC address DHCP client Client Hardware Address DHCP client ID 3166501603 DHCP DHCP DHCP client Broadcast flag Flag 1 broadcast DHCP (Client , , Server Gateway ) 0.0.0.0 Magic Cookie option string 99.130.83.99 DHCP BOOTP DHCP DHCPDISCOVER DHCP client 10.0.0.3. DHCP client VistaPC DHCPOFFER ( 2) 14-01Frame: - Ethernet: Etype = Internet IP (IPv4) + DestinationAddress: *BROADCAST + SourceAddress: 00123F2B3407 EthernetType: Internet IP (IPv4), 2048(0x800) + Ipv4: Next Protocol = UDP, Packet ID = 572, Total IP Length = 328 + Udp: SrcPort = BOOTP server(67), DstPort = BOOTP client(68), Length = 308 - Dhcp: Boot Reply, MsgType = OFFER, TransactionID = 0xBCBCFAE3 OpCode: Boot Reply, 2(0x02) Hardwaretype: Ethernet HardwareAddressLength: 6 (0x6) HopCount: 0 (0x0) TransactionID: 3166501603 (0xBCBCFAE3) Seconds: 0 (0x0) - Flags: 0 (0x0) Broadcast: (0...............) No Broadcast Reserved: (.000000000000000) ClientIP: 10.0.0.3 YourIP: 10.0.0.3 ServerIP: 10.0.0.1 RelayAgentIP: 0.0.0.0 - ClientHardwareAddress: 00-12-3F-17-E0-CF EthernetAddress: 00-12-3F-17-E0-CF ServerHostName: BootFileName: MagicCookie: 99.130.83.99 - MessageType: OFFER Code: DHCP Message Type, 53(0x35) Length: 1 UINT8(s) Value: OFFER, 2(0x2) - SubnetMask: 255.0.0.0 Code: Subnet Mask, 1(0x01) Length: 4 UINT8(s) IpAddress: 255.0.0.0- RenewTimeValue: Subnet Mask: 4 day(s),0 hour(s) 0 minute(s) 0 second(s) Code: Renewal (T1) Time Value, 58(0x3A) Length: 4 UINT8(s) Timeout: 4 day(s),0 hour(s) 0 minute(s) 0 second(s) - RebindingTimeValue: Subnet Mask: 7 day(s),0 hour(s) 0 minute(s) 0 second(s) Code: Rebinding (T2) Time Value, 59(0x3B) Length: 4 UINT8(s) Timeout: 7 day(s),0 hour(s) 0 minute(s) 0 second(s) - IPAddressLeaseTime: Subnet Mask: 8 day(s),0 hour(s) 0 minute(s) 0 second(s) Code: IP Address Lease Time, 51(0x33) Length: 4 UINT8(s) Timeout: 8 day(s),0 hour(s) 0 minute(s) 0 second(s) - ServerIdentifier: 10.0.0.1 Code: Server Identifier, 54(0x36) Length: 4 UINT8(s) IpAddress: 10.0.0.1 - DomainName: contoso.com Code: Domain Name, 15(0x0F) Length: 12 UINT8(s) Name: contoso.com - DomainNameServer: 10.0.0.1 Code: Domain Name Server, 6(0x06) Length: 4 UINT8(s) IpAddress: 10.0.0.1 - End: Code: End of Options, 255(0xFF) Broadcast flag DHCPDISCOVER broadcast DHCP client 10.0.0.3 DHCP server 10.0.0.1 DHCP Message Type DHCPOFFER Subnet mask 255.0.0.0 T1 4 T2 7 8 Network adapter contoso.com DNS server network adapter 10.0.0.1 DHCPREQUEST ( 3) 14-01Frame: - Ethernet: Etype = Internet IP (IPv4) + DestinationAddress: *BROADCAST + SourceAddress: 00123F17E0CFEthernetType: Internet IP (IPv4), 2048(0x800) + Ipv4: Next Protocol = UDP, Packet ID = 10840, Total IP Length = 350 + Udp: SrcPort = BOOTP client(68), DstPort = BOOTP server(67), Length = 330 - Dhcp: Boot Request, MsgType = REQUEST, TransactionID = 0xBCBCFAE3 OpCode: Boot Request, 1(0x01) Hardwaretype: Ethernet HardwareAddressLength: 6 (0x6) HopCount: 0 (0x0) TransactionID: 3166501603 (0xBCBCFAE3) Seconds: 0 (0x0) - Flags: 32768 (0x8000) Broadcast: (1...............) Broadcast Reserved: (.000000000000000) ClientIP: 0.0.0.0 YourIP: 0.0.0.0 ServerIP: 0.0.0.0 RelayAgentIP: 0.0.0.0 - ClientHardwareAddress: 00-12-3F-17-E0-CF EthernetAddress: 00-12-3F-17-E0-CF ServerHostName: BootFileName: MagicCookie: 99.130.83.99 - MessageType: REQUEST Code: DHCP Message Type, 53(0x35) Length: 1 UINT8(s) Value: REQUEST, 3(0x3) - clientID: (Type 1) Code: Client-identifier, 61(0x3D) Length: 7 UINT8(s) Type: HardwareAddress(1) ClientID: Binary Large Object (6 Bytes) - RequestedIPAddress: 10.0.0.3 Code: Requested IP Address, 50(0x32) Length: 4 UINT8(s) IpAddress: 10.0.0.3 - ServerIdentifier: 10.0.0.1 Code: Server Identifier, 54(0x36) Length: 4 UINT8(s) IpAddress: 10.0.0.1 - HostName: VistaPC Code: Host Name, 12(0x0C) Length: 7 UINT8(s) Name: VistaPC - FullyQualifiedDomainName: Code: Fully Qualified Domain Name, 81(0x51) Length: 22 UINT8(s) - Flag: 0 (0x0) MBZ: (0000....) 0 N: (....0...) SHOULD NOT perform the A RR (FQDN to address) DNS updates E: (.....0..) ASCII encoding of the Domain Name field (deprecated) O: (......0.) the server has not overridden the clients preference for the S bit S: (.......0) SHOULD NOT perform the A RR (FQDN to address) DNS updates RCODE1: 0 (0x0) RCODE2: 0 (0x0) DomainName: VistaPC.contoso.com - VendorClassIdentifier: MSFT 5.0Code: Class-identifier, 60(0x3C) Length: 8 UINT8(s) VendorClassIdentifier: MSFT 5.0 - ParameterRequestList: Code: Parameter Request List, 55(0x37) Length: 12 UINT8(s) Parameter: Subnet Mask, 1(0x01) Parameter: Domain Name, 15(0x0F) Parameter: Router, 3(0x03) Parameter: Domain Name Server, 6(0x06) Parameter: NetBIOS over TCP/IP Name Server, 44(0x2C) Parameter: NetBIOS over TCP/IP Node Type, 46(0x2E) Parameter: NetBIOS over TCP/IP Scope, 47(0x2F) Parameter: Perform Router Discovery, 31(0x1F) Parameter: Static Route, 33(0x21) Parameter: Classless Static Route Option, 121(0x79) Parameter: Classless Static Route, 249(0xF9) Parameter: Vendor specific information, 43(0x2B) - End: Code: End of Options, 255(0xFF) DHCP client Broadcast flag Flags broadcast DHCP client address DHCP server 10.0.0.1 DHCP DHCPREQUES DHCP client 10.0.0.3 DHCP client FQDN vistapc.contoso.com DHCP server DNS DHCPACK ( 4) 14-01Frame: - Ethernet: Etype = Internet IP (IPv4) + DestinationAddress: *BROADCAST + SourceAddress: 00123F2B3407 EthernetType: Internet IP (IPv4), 2048(0x800) + Ipv4: Next Protocol = UDP, Packet ID = 573, Total IP Length = 328 + Udp: SrcPort = BOOTP server(67), DstPort = BOOTP client(68), Length = 308 - Dhcp: Boot Reply, MsgType = ACK, TransactionID = 0xBCBCFAE3 OpCode: Boot Reply, 2(0x02) Hardwaretype: Ethernet HardwareAddressLength: 6 (0x6) HopCount: 0 (0x0) TransactionID: 3166501603 (0xBCBCFAE3) Seconds: 0 (0x0) - Flags: 0 (0x0) Broadcast: (0...............) No Broadcast Reserved: (.000000000000000)ClientIP: 0.0.0.0 YourIP: 10.0.0.3 ServerIP: 0.0.0.0 RelayAgentIP: 0.0.0.0 - ClientHardwareAddress: 00-12-3F-17-E0-CF EthernetAddress: 00-12-3F-17-E0-CF ServerHostName: BootFileName: MagicCookie: 99.130.83.99 - MessageType: ACK Code: DHCP Message Type, 53(0x35) Length: 1 UINT8(s) Value: ACK, 5(0x5) - RenewTimeValue: Subnet Mask: 4 day(s),0 hour(s) 0 minute(s) 0 second(s) Code: Renewal (T1) Time Value, 58(0x3A) Length: 4 UINT8(s) Timeout: 4 day(s),0 hour(s) 0 minute(s) 0 second(s) - RebindingTimeValue: Subnet Mask: 7 day(s),0 hour(s) 0 minute(s) 0 second(s) Code: Rebinding (T2) Time Value, 59(0x3B) Length: 4 UINT8(s) Timeout: 7 day(s),0 hour(s) 0 minute(s) 0 second(s) - IPAddressLeaseTime: Subnet Mask: 8 day(s),0 hour(s) 0 minute(s) 0 second(s) Code: IP Address Lease Time, 51(0x33) Length: 4 UINT8(s) Timeout: 8 day(s),0 hour(s) 0 minute(s) 0 second(s) - ServerIdentifier: 10.0.0.1 Code: Server Identifier, 54(0x36) Length: 4 UINT8(s) IpAddress: 10.0.0.1 - SubnetMask: 255.0.0.0 Code: Subnet Mask, 1(0x01) Length: 4 UINT8(s) IpAddress: 255.0.0.0 - FullyQualifiedDomainName: Code: Fully Qualified Domain Name, 81(0x51) Length: 3 UINT8(s) - Flag: 0 (0x0) MBZ: (0000....) 0 N: (....0...) SHOULD NOT perform the A RR (FQDN to address) DNS updates E: (.....0..) ASCII encoding of the Domain Name field (deprecated) O: (......0.) the server has not overridden the clients preference for the S bit S: (.......0) SHOULD NOT perform the A RR (FQDN to address) DNS updates RCODE1: 255 (0xFF) RCODE2: 255 (0xFF) - DomainName: contoso.com Code: Domain Name, 15(0x0F) Length: 12 UINT8(s) Name: contoso.com - DomainNameServer: 10.0.0.1 Code: Domain Name Server, 6(0x06) Length: 4 UINT8(s) IpAddress: 10.0.0.1 - End: Code: End of Options, 255(0xFF) Broadcast flag DHCPREQUEST DHCP client 10.0.0.3 DHCP Massage Type DHCPACK DHCP server DNS dynamic DHCP client DHCP client DHCP server DHCP relay agent DHCP relay agent DHCPDISCOVER DHCPREQUEST, Hops, IP Address DHCP relay agent Gateway IP Address DHCP server DHCP server DHCPOFFER DHCPACK DHCP relay agent DHCP relay agent ( flag flag 0) DHCP client Lease IP address DHCP Client DHCP DHCPREQUEST DHCPACK DHCP Client Subnet DHCP Server DHCP Client DHCPREQUEST DHCPACK Unicast DHCP Client Subnet IP address DHCPREQUEST DHCPACK DHCPREQUEST DHCPACK Broadcast Subnet DHCP Client DHCPREQUEST DHCP Server DHCP Server DHCPNAK DHCP Client Client IP address Client DHCP DHCP Client IP address Subnet Wireless IEEE802.11 Access Point DHCP Client Subnet 14-4 DHCP

14-4 DHCP DHCP Client Subnet Windows-Based DHCP DHCPREQUEST Broadcast DHCP DHCP Server DHCP address Server DHCP Server Broadcast Server Subnet DHCPREQUEST Client DHCP Server DHCPNAK DHCP Client Windows-Based DHCP DHCP Server Broadcast ARP Request Default-gateway IP address Default-gateway DHCP Client Subnet Detecting Unauthorized DHCP Server DHCP Server DHCP Server Windows Server 2008-Based Server DHCP Server Active Directory DHCP Server DHCP Server Server DHCPINFORM DHCPACK Server 14-5

14-5 DHCP Server Sever Sever DHCP Server DHCPINFORM DHCP Server Subnet Server DHCPACK DHCP Server DHCP Server Lightweight Directory Access Protocol (LDAP) Active Directory Server Server DHCP Server Updating DNS Entry DHCP IP IP address DNS DNS Windows Server 2008 Windows Vista DNS dynamic Windows Server 2008 Windows Vista DNS DNS Server DHCP Client FQDN DHCP Server DHCPREQUEST DHCPREQUEST DHCP Server DNS Server DHCP Client DHCP Client DHCP Server Windows Server 2008 DNS DHCP Client Client DNS

DHCP DHCP DHCP Header DHCP options DHCP relay agent DHCP DHCP clients DHCP servers Subnet DHCP DHCP client IP address IP address Windows Server 2008 DHCP Server standalone Active Directory