perfsonar-dev - Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing]
Subject: perfsonar development work
List archive
Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing]
Chronological Thread
- From: Nina Jeliazkova <>
- To: "" <>
- Subject: Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing]
- Date: Thu, 14 Aug 2008 11:41:47 +0300
- Openpgp: id=EEABA669
Hello all, We had recently a discussion with Szymon and Maciej on the best way to resolve the case, where a query against gLS returns more than one possible homeLS. The case was first reported for a traceroute Szymon used for a demo 1 49 ms 48 ms 48 ms pionier-gw.rt1.poz.pl.geant2.net [62.40.124.182] PerfsonarUI uses an XQuery (attached) to ask for subnets, matching given IP address and subnet mask (e.g. 62.40.124.182/32 in this case). The The IP address (62.40.124.182) matches two home LS - the GN2 one with subnet /23 and Pionier one with /32 . The excerpt of the response is below: http://loco4.man.poznan.pl:8180/xml-ls-gn2/services/LookupService <nmtl3:subnet> <nmtl3:address type="ipv4">62.40.124.0</nmtl3:address> <nmtl3:netmask>23</nmtl3:netmask> </nmtl3:subnet> http://ls.perfsonar.pionier.net.pl:8080/xml-ls/services/LookupService <nmtl3:subnet> <nmtl3:address type="ipv4">62.40.124.182</nmtl3:address> <nmtl3:netmask>32</nmtl3:netmask> </nmtl3:subnet> I've updated perfsonarUI to always select most specific subnet, if there are more than one, e.g. if there is /32 and /23 then /32 will allways be selected. For the use case PerfsonarUI is dealing with, namely looking for matches for a list of IP addresses coming from a traceroute (subnet mask /32 only) , it seems quite reasonable. However, Maciej had a different view ( don't restrict the answer to one subnet, present everything to the user, see emails below ), so we thought it will be best to move the discussion into the developers mailing list. In summary, my question is as follows (having in mind only the use case when the user is asking for list of IPs coming from a traceroute and a given eventtype, i.e. subnet mask 32 )
Best regards, Nina Maciej Glowiak написа: Nina Jeliazkova wrote: Maciej, -- --------------------------------- Dr. Nina Nikolova-Jeliazkova Institute for Parallel Processing Bulgarian Academy of Sciences Acad. G. Bonchev St 25-A 1113 Sofia, Bulgaria Tel: +359 886 802011 ICQ: 10705013 www: http://ambit.acad.bg/nina --------------------------------- PGP Public Key http://cert.acad.bg/pgp-keys/keys/nina-nikolova-0xEEABA669.asc 8E99 8BAD D804 1A43 27B7 7F87 CF04 C7D1 EEAB A669 --------------------------------------------------------------- |
<?xml version='1.0' encoding='UTF-8'?><nmwg:message type="LSQueryRequest" id="msg1" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/" xmlns:xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/" xmlns:psui="http://ggf.org/ns/nmwg/tools/org/perfsonar-ui/1.0/" > <nmwg:metadata id="meta1"> <xquery:subject id="sub1"> declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/"; declare namespace nmwgt="http://ggf.org/ns/nmwg/topology/2.0/"; declare namespace perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"; declare namespace psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"; declare namespace xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/"; declare namespace psui="http://ggf.org/ns/nmwg/tools/org/perfsonar-ui/1.0/"; declare namespace summary="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/summarization/2.0/"; declare namespace nmtl3="http://ogf.org/schema/network/topology/l3/20070828/"; declare function psui:testPartSubnet($ip as xs:integer, $msb as xs:integer, $lsb as xs:integer, $sumip as xs:integer, $netmask as xs:integer) as xs:boolean { if ($ip < 0) then false() else if ($msb > $netmask ) then true() else if ($lsb > $netmask ) then true() else if ($lsb = $msb) then ($ip mod 2) = ($sumip mod 2) else let $ip2 := $ip idiv 2 let $sumip2 := $sumip idiv 2 let $mod := $ip - $ip2 let $smod := $sumip - $sumip2 let $lsb := $lsb -1 return ($mod = $smod) and psui:testPartSubnet($ip2,$msb,$lsb,$sumip2,$netmask) }; declare function psui:isSubnet($ip as xs:string, $sumip as xs:string, $netmask as xs:integer) as xs:boolean { let $ips := fn:tokenize($ip,'\.') let $sumips := fn:tokenize($sumip,'\.') return psui:testPartSubnet(xs:integer(fn:number($ips[1])),1,8,xs:integer(fn:number($sumips[1])),$netmask) and psui:testPartSubnet(xs:integer(fn:number($ips[2])),9,16,xs:integer(fn:number($sumips[2])),$netmask) and psui:testPartSubnet(xs:integer(fn:number($ips[3])),17,24,xs:integer(fn:number($sumips[3])),$netmask) and psui:testPartSubnet(xs:integer(fn:number($ips[4])),25,32,xs:integer(fn:number($sumips[4])),$netmask) }; <psui:lookupInformation> { for $m in /nmwg:store[@type='LSStore']/nmwg:metadata let $service:=$m/perfsonar:subject/psservice:service let $metaid:=data($m/@id) let $summary:=/nmwg:store[@type='LSStore']/nmwg:data[@metadataIdRef=$m/@id]/nmwg:metadata/summary:subject let $address:=$summary/nmtl3:network/nmtl3:subnet return <psui:lookupService> {$service} { for $e in $summary/nmtl3:network where ( psui:isSubnet('62.40.124.182',$e/nmtl3:subnet/nmtl3:address,$e/nmtl3:subnet/nmtl3:netmask) ) return $e } </psui:lookupService> } </psui:lookupInformation> </xquery:subject> <nmwg:eventType>service.lookup.xquery</nmwg:eventType> </nmwg:metadata> <nmwg:data metadataIdRef="meta1" id="d1"/> </nmwg:message>
- Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Nina Jeliazkova, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Szymon Trocha, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Jason Zurawski, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Nicolas Simar, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Nina Jeliazkova, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Joe Metzger, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Michael Bischoff, 08/14/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Nina Jeliazkova, 08/15/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Nina Jeliazkova, 08/15/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Jeff W. Boote, 08/15/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Szymon Trocha, 08/25/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Jeff W. Boote, 08/15/2008
- Re: [pS-dev] Multiple homeLS per IP address [Was :Re: [Fwd: Re: psUI demo] XQuery for subnet testing], Michael Bischoff, 08/14/2008
Archive powered by MHonArc 2.6.16.