Subject: Re: Question about SLP

From: Erik Guttman <[email-masked]>
Date: Wed, 7 Mar 2001 10:28:17 +0100 (MET)

Alex,

> Hello Mr. Guttman:
> 
> I hope you have time to answer my question. I am a
> student at University of Toronto in Canada and I am
> working in a simulation of bandwidth consumption when
> using SLP. I dont have experience using SLP so I dont
> know whichs could be some typical lenghts for the
> following and parameters:
> -How long is a URL in bytes?

That depends on the URL :-)

For instance "service:bandwidth-tracker://zoid.ut.edu.ca:9999"
would be strlen("service:bandwidth-tracker://zoid.ut.edu.ca:9999") 
bytes long.

> -How long is the predicate in bytes?

The length of the predicate string, ie. strlen("(&(a=b)(c=d))")

> -How long is the previous responders address spec?

The length of the previous responders string, ie.
strlen("1.2.3.4,3.3.3.3,123.134.145.167")

> -How long is the Naming Authority String in bytes?

That depends on whether there is a naming authority.

"service:foo://host" has no explicit naming authority -
IANA is implied.

"service:foo.42://host" has an explicit naming authority,
namely "42" (which is Sun Microsystems, see
http://www.isi.edu/in-notes/iana/assignments/enterprise-numbers) In this case,
the length of the naming authority is two, ie. strlen("42") The use of naming
authorities is expanded from RFC 2608 in 

ftp://ftp.ietf.org/internet-drafts/draft-guttman-svrloc-vendor-ext-03.txt

> I hope you can provide a brief answer to those, if not
> could you direct me to some source of information
> please?

One note - since the strings above are UTF-8, strlen() itself may not
be enough to determine the length.  Some ANSI library implementation
string functions check to see if the characters are legal ASCII.  UTF-8
characters are NOT legal ASCII in many cases.  Further, the notion of
length is different with UTF-8.  In SLP we mean "how many bytes follow"
by length.  In UTF-8, you can have n bytes representing one character,
but that is not what we are counting with the string length fields.
Also - escaped values in strings extend the number of bytes in the
string.  The string lengths are counts of how many bytes follow, however
they are encoded...

Note that for strings in the URL: service type, naming authority, and
the URL itself, the strings are effectively encoded in ASCII so ANSI
strlen() will work.

> Thank you so much.

You are welcome,

Erik