DHCP Relay Agent

Discussion in 'Networks' started by tripwire45, Dec 7, 2003.

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    I'm having trouble understanding something. Say a DHCP client boots and sends the initial DHCP Discovery message as a broadcast. The only DHCP server is on a different subnet and the message has to cross a router enabled for DHCP relay agent. The Discovery message contains the source address of 0.0.0.0 and the destination address of 255.255.255.255 and the client's MAC address.

    When the Discovery message hits the router, it should strip off the layer 2 MAC address from the packet and encapsulate it with the MAC address of the interface that connects to the other subnet. Then the message goes on to the DHCP server. When the server sends out the DHCPOFFER message, it is as a unicast and contains a verification of the senders MAC address and it's own IP address as well as other lease information.

    If the original sender's MAC address was stripped off, how can the server know it? Also, does the router contain a list of MAC addresses in cache (I know it keeps layer 3 network information in the routing tables) so that the message can be routed to the specific sender?

    Sorry to seem confused here, but as much research as I've done on relay agents, I can't find the specific answer to this question. Thanks a bunch.
     
    Certifications: A+ and Network+
  2. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Trip,

    I did a bit of digging and came up with a couple of RFC's which are relevant.

    RFC1542 is quite old and relates to BootP had this quote

    RFC2131 is relatively more recent and more detailed about he dhcp process.

    That deals with how the the server reacts but as to your question I read somewhere, but can't find it again, that the router / relay agent upon recieving the DHCPrequest with all 0's as the IP address replaces that with it's own IP address and then forwards the request to the DHCP server as unicast. In that way the Server knows which subnet the request came from.

    Don't know if this will help clear on of the confusion or not :) let us know.
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    Thanks, Phil. I understood how the server knew but was unclear as to how exactly the DHCP relay agent on the router knew. I didn't think the router would keep MAC addresses in cache the way it keeps IP address routes but, if it sends the DHCPOFFER back to the original host's subnet with 0.0.0.0 as the destination address, then the DHCP client will get the packet. I appreciate the help.
     
    Certifications: A+ and Network+
  4. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Reading this part of my last quote

    When forwarding on the DHCPDiscover the Relay Agent places it's ip address in the giaddr section so when the Server comes to reply it checks to see if there is a relay agent ip address in the request (giaddr) if there is it sends the return message to the DHCP Server port on the relay agent. From that I'd say the relay agent then deals with broadcasting the DHCPOffer to the client on it's own subnet, I guess if all goes well from that point on the client has an address with which to communicate with the server and complete negotiations.
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  5. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    My understanding is that the client doesn't actually receive the IP address assignment until the DHCPACK message completes and even then, the client sends a duplicate IP address check before it actually starts communicating on the network. Naturally, when the time comes to renew the address, it uses it's source IP address and the DHCP server's IP as the destination address to do the renewal. Saves a bit of time that way. Thanks again.
     
    Certifications: A+ and Network+
  6. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    Thanks for asking the question Trip, looking into it broadened my understanding of DHCP all round. The relay agent stuff is one of those areas that I just accepted that it worked but didn't get too deep into how it worked.
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  7. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    No problem, Phil...tho I think I'm the real "winner" here since I learned a lot more about relay agent from what you presented here. Hopefully, the rest of the "younguns" out there have at least peeked into this thread to glean some insights into this subject. :)
     
    Certifications: A+ and Network+
  8. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    You're quite correct Trip, that's where guessing gets me :D I just found this on the MS website which explains quite nicely everything I had to dig around in the RFC's for :)
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  9. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,924
    74
    229
    Been following this one all day, "Old-timer" :wink:

    I know I should be learning much more in this area, but whilst I'm knee-deep in all the other stuff I need to take in right now, I'm afraid my brain collapsed way before I could contribute anything to it. :aaah

    So well done to Trip and Phil - more great info for the rest of us to refer to - thanks, Guys :D
     
    Certifications: MCP, A+, Network+
    WIP: Clarity
  10. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    I think one of the benefits of a thread like this is that, even if only a few people participate, a larger number of the membership can follow it and get a bit more understanding of certain topics. It's even appropriate for them to throw in questions of their own. I learned quite a bit about DHCP over the past little bit because of this research project of mine. I also learn by watching the threads of others more knowledgable than I, discuss certain subjects. It's one of the advantages of forum life as opposed to say, Phil and I discussing this via PM or e-mail. Then, the discussion would be isolated to the two of us and no one else would benefit.
     
    Certifications: A+ and Network+

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.