본문 바로가기

Network

dhcp(Dynamic Host Configuration Protocol)

dchp(Dynamic Host Configuration Protocol)

RFC 2131
ftp://ftp.isi.edu/in-notes/rfc2131.txt

dchp 동작원리
http://www.ebora.net/htmlup2/net-app2.htm
http://www.exchangeserver.or.kr/mirae/3/sw4_1.htm

1.IP lease 탐색(Discover)
TCP/IP초기화  Broadcast : Discover
67/UDP사용, DHCPDISCOVER(Client broadcast to locate available servers.)

2. IP lease 제공(Offer)모든 서버가 제공
Client의 하드웨어 주소
  자신의 IP Pool 범위 내에서 제공할 IP 주소
  Subnet mask
  Lease 기간
서버 식별자(DHCP 서버 IP주소)68/UDP사용, DHCPOFFER(Server to client in response to DHCPDISCOVER with offer of configuration parameters.)

이 Lease Request를 DHCPDISCOVER(67/UDP사용) 메시지 형태로 보낸다. 메시지의 패킷의 원본, 목적지 주소를 살펴 보면 원본 주소는 0.0.0.0을 사용하고 목적지 주소는 255.255.255.255를 사용한다. 그 정보와 함께 자신의 MAC 주소와 호스트 이름을 포함해서 보낸다.

3. IP lease의 선택(Selection)
IP 선택 후 lease해 줄 것을 요청(Request) – Broadcast
DHCPREQUEST 메시지에는 서버의 서버 식별자(IP주소)가 들어 있고, Client가 쓰게 될 IP 주소가 적혀 있다 
DHCPREQUEST(Client message to servers either (a) requesting offered parameters from one server and implicitly declining offers from all others, (b) confirming correctness of previously allocated address after, e.g., system reboot, or (c) extending the lease on a particular network address.)

4. IP lease의 긍정 응답(Acknowledge)
IP를 제공한 서버는 Broadcast로 긍정 응답
이외의 서버는 제공을 철회
DHCPACK(Server to client with configuration parameters, including committed network address.)


Message Use
------- ---
DHCPDISCOVER - Client broadcast to locate available servers.
DHCPOFFER - Server to client in response to DHCPDISCOVER with offer of configuration parameters.
DHCPREQUEST - Client message to servers either (a) requesting offered parameters from one server and implicitly declining offers from all others, (b) confirming correctness of previously allocated address after, e.g., system reboot, or (c) extending the lease on a particular network address.
DHCPACK - Server to client with configuration parameters, including committed network address.
DHCPNAK - Server to client indicating client's notion of network address is incorrect (e.g., client has moved to newsubnet) or client's lease as expired
DHCPDECLINE - Client to server indicating network address is already in use.
DHCPRELEASE - Client to server relinquishing network address and cancelling remaining lease.
DHCPINFORM - Client to server, asking only for local configuration parameters; client already has externally configured network address.

dhcp로 ip를 받기 위해선 Null 주소를 할당 하고 dhcp 주소를 찾아서 broadcast를 하는 군요... 이유는 당연하겠지만 자신의 ip 주소도 없을 뿐더러 dhcp server의 ip 주소도 모르니 말입니다. ^^
반응형