[ifmapdev] Question about metadata deletes.

4 views
Skip to first unread message

Terry Simons

unread,
May 16, 2010, 8:17:22 AM5/16/10
to ifmapdev
I've run into an issue where I need to delete an ip-mac record from
the map server, but I only have the IP address.

It's a limitation in the way that ISC DHCP handles on expiry events.
Since there isn't a packet tied to a lease expiration there isn't any
way for me to get the MAC address (that I know of).

So I have code (really messy ugly code) that can publish a DHCP lease,
and delete the record upon lease release, but the delete doesn't work
for lease expirations because of the missing MAC address.

I can think of a couple ways to work around this, but they're both
ugly.

Thanks,

- Terry

Roger Chickering

unread,
May 16, 2010, 3:44:02 PM5/16/10
to ifma...@googlegroups.com
Hi Terry,

Thanks for taking an interest in IF-MAP and integrating IF-MAP into ISC DHCP!

An IF-MAP client is responsible for keeping track of metadata it has published, so the client can remove metadata it has published when that metadata is no longer valid. This means that the DHCP client should keep track of the MAC address associated with each lease so it can remove the ip-mac link when the lease expires.

An alternative that is more expensive in terms of protocol is to issue an IF-MAP search to find the ip-mac link that was previously published. Search starting at the IP address identifier with a depth of 1 and match-links-filter set to "meta:ip-mac[@publisher-id = 'your pub-id']". The result will be the ip-mac link, which may be deleted in a subsequent operation.

-Roger

Terry Simons

unread,
May 16, 2010, 4:19:24 PM5/16/10
to ifmapdev
Hi Roger,

Yeah... I'm kind of cheating a little bit in that I'm simply a hooking
the ISC DHCP server to call my script, which does all of the work.

Since my script is invoked on each event individually it's has no
concept of state, and the ISC DHCP server doesn't know anything about
IF-MAP.

I think that it is a reasonable expectation that the MAC address be
present inside the on expiry event, but I'll have to dig a bit more on
that and possibly file a bug with the ISC folks.

Andrew Benton

unread,
May 16, 2010, 4:24:23 PM5/16/10
to ifma...@googlegroups.com
both of roger's suggestions will work. i think the latter, though
indeed more expensive in terms of requests, is much easier in terms of
client state, so i would recommend that as a first pass. just issue an
ifmap search for the ip-mac link and pull out the mac address.

amb

Terry Simons

unread,
May 16, 2010, 7:14:52 PM5/16/10
to ifmapdev
Gah... that's what I get for not going to sleep until 7AM. ;)

Yes, those are both the scenarios I had thought of, but my brain must
have been dozing when I replied earlier.

I think beating the IFMAP server up is probably the wrong solution...

What I am going to do (and what I had considered last night) is freeze/
thawing a data structure that is a key/value pair of IP/MAC and having
my script load that and save it every time a change is made.

The thing that makes that ugly is that I'll need to use file locking
to prevent race conditions. It's probably not a bad thing. Since any
request coming in from the DHCP server is forked this should actually
behave nicely.

- Terry
Reply all
Reply to author
Forward
0 new messages