DHCP Relay Agent - How Relay Agent Work

프로그래밍 2011. 2. 18. 17:47
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
DHCP(Dynamic Host Configuration Protocol) 동작원리

어느 분의 요청이 있어서 한 번 알아보았다.
네트워크 쪽은 잘 모르는 편이라서 정의를 한 번 찾아보니 아래와 같았다.


 "DHCP 릴레이 에이전트(dhcprelay)"는 DHCP 서버가없는 서브넷으로부터 다른 서브넷에 존재하는 1개 이상의 DCHP 서버에게 DHCP 또는 BOOTP 요청을 중계(Relay) 해 준다. 즉, 만일에 DHCP서버가 동일 서브넷의 밖에 있을 경우에, 동일 서브넷 내부에는 반드시 DHCP Relay Agent 가 있어야 한다.


- DHCP 관리자는네트워크 각 Sub-network에 모두 DHCP Server를 둘 필요 없이 통상 라우터 또는 기타 호스트로 하여금 DHCP 메세지들을전달(Relay)토록 할 수 있다.

 

DHCP 클라이언트가정보를 요청하는 경우, DHCP 릴레이 에이전트는 그 요청을 DHCP 릴레이 에이전트가 시작될 때 지정된 DHCP 서버 목록으로 전송한다.DHCP 서버가 응답을 보내오면, 원래 요청을 보낸 네트워크 상에서 그 응답을 브로드캐스트 하거나  유니캐스트 한다.


출처 :http://www.ktword.co.kr/abbr_view.php?m_temp1=2591


아래는 DHCP Relay Agent가 동작하는 방법이다.

How Relay Agents Work


Thefollowing figure shows how Client C on Subnet 2 obtains a DHCP address leasefrom DHCP Server 1 on Subnet 1.


Using a Relay Agent



  1. DHCP Client C broadcasts a DHCPDiscover message on Subnet 2 as a UDP datagram over well-known UDP port 67, which is the port reserved and shared for BOOTP and DHCP server communication.

  2. The relay agent, in this case a DHCP relay-enabled router, examines the Gateway IP Address field (also known as the giaddr field) in the DHCP message header. If the field has an IP address of 0.0.0.0, the agent fills the Gateway IP Address field with the IP address assigned to the interface on which the DHCPDiscover was received, and forwards the DHCPDiscover message as a unicast message to the DHCP server on Subnet 1.

  1. When DHCP Server 1 receives the DHCPDiscover message, it examines the Gateway IP Address field to determine if the packet was relayed. The DHCP server then determines whether it can supply an IP address lease to clients on the subnet indicated by the address in the Gateway IP Address field.

    For example, if the Gateway IP Address field has an IP address of 192.168.45.2, the DHCP server checks its DHCP scopes for a scope range that includes 192.168.45.2 (the gateway IP address in the packet). To find a match, the DHCP server determines whether the IP address 192.168.45.2 matches the network ID of each scope. It determines the network ID of each scope by ANDing any IP address in the scope with its corresponding subnet mask. In this case, the DHCP server checks to see which scope includes addresses for Subnet 2. If a scope exists that matches this criterion, the DHCP server selects an available address from the matched scope to use in an IP address lease offer response to the client.

  1. DHCP Server 1 sends a DHCPOffer message directly to the relay agent identified in the Gateway IP Address field.

  1. The relay agent relays the DHCPOffer message to the DHCP client.
    Depending on the value of the Broadcast flag in the DHCPOffer message (which was copied from the DHCPDiscover message), the DHCP relay agent either unicasts or broadcasts the DHCPOffer message.

  1. By using a similar process, a DHCPRequest message is relayed from client to server, and a DHCPAck message is relayed from server to client.

용어 설명은 출처에서 참고바랍니다.

출처 :http://technet.microsoft.com/en-us/library/cc780760(WS.10).aspx
posted by 어린왕자악꿍