WWDC2003 Session 105
Transcript
Kind: captions
Language: en
good afternoon and welcome to the
rendezvous session I'm Craig Keithley
I'm apples io technology evangelist and
world wide developer relations one of
those Iowa technologies is rendezvous
and over the past year we've been
working very hard to bring rendezvous to
as many products as possible I have over
a hundred and twenty developers actively
working on projects more than 35 or
thereabouts-- have shipped there's more
on the way if you are at the session
earlier this week for open source you
saw that open play now has added rotted
route support so in the future games
that use open play will automatically
enable rhonda rooms a big step forward
so if you're a game developer and you're
here to learn more about rendezvous best
recommendation i have for you is go
check out open play you're going to get
benefits of Oakland played plus the
benefits of rendezvous automatically you
know as we look over the history of
networking communications there are a
couple of important stages you know I
can think back to the first time I used
a dial-up modem dialed into ARPANET from
my local university and how exciting
that was and then as appletalk came out
in the mid 80s and I was able to easily
network products this is the next
generation it's the way that people
should be doing zero configuration
networking it's plug and play it's how
we want to make devices work so to go
into that the this session will detail
what Ronnie who is what we've been doing
for the past year the new features that
are coming in Panther the new API that
will be available to you in the future
and we want to go over some hints for
software developers and hardware
developers this will run the range both
from software techniques to licensing
the logo all of you if you're doing
rendezvous development should be
licensing the logo it's free it's an
easy way for your customers to know that
they bought a product that works with
rendezvous so without very much further
ado let's bring up Stuart Cheshire we
will go into all this thank you
[Applause]
once again just like the last year it's
a great turnout I'd like to ask
everybody to shuffle in and fill up the
seats because there are still people
standing in the doorway and people
trying to get in so if there any gaps
close them up
so I'd like to just get a show of hands
how many people saw the WWDC
presentation last year on rendezvous
okay about half that's good so I'm not
going to repeat that material this year
I'm going to do a quick overview to
remind you what it was all about but if
you want to see more detail about that
pull out your old DVDs from last year
and have a look or if you weren't here
last year then you know you might be
able to find one from a friend and have
a look at that so right now I'm just
going to quickly skip through to refresh
your memory we're going to talk about
why we did rendezvous we're going to
talk about what we did to solve the
problems and we can talk about how we
made it all work so let's get on with
that quick it we've got a lot to cover
so the Y is 20 years ago many people in
this room are probably not old enough to
remember that but 20 years ago there was
huge competition in wide area networking
or all these different protocols and
devices from one vendor normally
wouldn't work with devices from another
bender and this was obviously not a good
situation and the good news is that in
the last 20 years they've all died and
the only thing we seriously considered
these days is tcp/ip which is great so
now let's look at local communications
in the similar era 10 to 20 years ago we
had all these different connectors on
our computer and the good news is those
have pretty much died and gone away as
well unfortunately we still have all
these different ways of connecting to
something like a local printer and as
time moves forwards the list is getting
longer these are not all technologies
that Apple ships but they're all local
communication technologies that are in
the market place that people working on
and developing so what did they do to
solve this incompatibility problem in
the wide area and the answer was they
picked one protocol and said everything
talks that protocol and yeah there may
be some little benefits of another
protocol but there's a bigger benefit in
having the standard so we should do the
same thing for local communications and
going even further naps
the protocols local communication should
be the same one that is already one in
wide area communications now when I say
that a lot of people react by saying
well that's crazy nobody wants to type
in subnet masks and IP addresses just to
print on their inkjet printer and of
course they don't want to the point is
to make it so that you don't need to do
all of that to make IP work so the
answer to solve this problem you all
know that's why you're here its
rendezvous and the press has been saying
marvelous things about rendezvous there
were lots and lots of good stories about
it one of my favorite headlines is a
backstage pass for the future I think
that really sums it up Tim O'Reilly very
well known and widely respected person
in the industry said this about
rendezvous it is truly revolutionary
it's one of the things that's going to
have the largest impact on application
design over the next couple of years
we're just at the beginning of the
second internet revolution and
rendezvous is a big part of it you can't
get much better than that so here's the
quick recap of last year what you need
to do to do IP networking well you need
an address you need to be able to use
names and you need to be able to browse
the network to see what's there very
simple solutions the point of this is to
make it simple when you've got a
gigahertz processor and lots of RAM most
software problems can be done with
enough effort but when you've got a
little inkjet printer for fifty dollars
with a tiny amount of firmware in a slow
process you don't have that luxury so
one of our overwhelming goals of
rendezvous and driving principles is
making something that isn't just for
Macs and PCs it's for all of the other
little devices out there as well and not
just the devices that currently do
networking but many of the devices that
don't do networking at all right now so
in that principle of simplicity you need
an IP address pick one at random send an
ARP request if nobody answers you can
use that address just like Apple talk
did very simple there's a range of
addresses reserved by iono for this
purpose and there's an internet draft
describing how to do it and you can find
that at zero comp torg but what I said
is pretty much summing up how you do
linked local addressing
link local great sync isn't new you've
probably seen it before when you see 169
dot 254 in the control panel you say
networking is broken and it's
understandable why people think that but
they think that because on its own a
self-assigned address isn't very useful
in Jaguar we introduce the rest of the
technologies to make it useful and now
you can do things with that link local
address even if you can't communicate
with the global internet and buy books
from Amazon or do whatever you want like
that it's been around since 1998 in mac
and windows it's in OS 10 it's in linux
pretty widespread you may know it under
the names autonet auto IP and of course
ipv6 already has linked local addressing
rendezvous works both on v4 and v6 so
naming similar principle as before dhcp
is great if you have a dhcp server
that's great but if you don't make up
your own address same thing here DNS is
if you have a DNS server there's no
reason not to use it but if you just
have two computers and you want to
exchange the file and you forgot to
bring a DNS server with you that
shouldn't cripple you so multicast DNS
is how you do name lookups when you
don't have a dns server same packet
format same query syntax just multicast
it every device has a little responder
just like an apple talk NBP responder
and when it sees a request for its name
it answers again we want to make this
very simple the specifications for that
you can find it multicast DNS dot org
but again to description i gave is most
of what you need to know about it the
client has been in since mac OS 9 it's
in 10 of course it's in Linux there are
several products projects if you go to
dot local dot org you'll find several
people working on multicast DNS for
linux microsoft characteristically vague
i can say that at the IETF plenary
presentation last summer in Japan they
described multicast DNS as a vital
technology for ipv6 and said it was
under consideration and or underway at
Microsoft so you have to take that for
what it's worth what this gives us is
the ability
laser eye to dot local into your web
browser and connect to the configuration
page of your printer without having to
know what address it picture itself so
this is a huge step forward over typing
dr. desk my dear dresses but of course
we're not content to stop there because
appletalk did better than that and we
want IP to do better than that so we
want to raise the bar we want you to be
able to find what's on the network
without having to know what name to type
in now devices we know are going to need
link-local addressing any way to work
usefully they're going to need local
naming to work anyway rather than add a
third different body of code to do
service discovery the insight we
realized is that the multicast dns code
also gives you service discovery for
free and for the guys making the
fifty-dollar inkjet printer that's a big
win I'll explain quickly how that works
you do a standard DNS query for record
type PTR and here the query is
semantically saying find me devices on
the network that speak the IPP printing
protocol because I'm an IPP printing
client and that's what I'm looking for
you do that query and you get back one
or more responses from the devices on
the network that implement IPP and we
want these names to be user friendly
just like Apple talk so these are
structured names with three parts and
the first part is to use a friendly name
that you display in a graphic user
interface normal host names in DNS are
limited to letter digits and hyphens and
they have to be short because you want
to type them on a command line but these
things you pick in a browser so they can
be long they can have spaces they can
have upper case lower case punctuation
full utf-8 you can put counting
character then because you don't have to
type them you just click on them and
list the names of structure just like
the old appletalk name type and zone and
here its service name is the first part
the second two labels are the service
type in other words the protocol name of
the service and the remainder is the
domain now right now the only domain we
support is got local for multicast but
this applies exactly the same for
wide-area unicast lookups using a
conventional DNS server because it's
using standard DNS quit which nothing
different about the queries here
it's just a convention for what you ask
for what responses you expect to get
back service types important points here
a service is identified by the protocol
it speaks human beings think in terms of
objects like printers but from a
software point of view if you've got an
IPP client what you're interested in is
finding things that speak IPP some of
them may be printer some may not there
may be printers that don't speak IPP and
you can't talk to them it's no benefit
finding something you can't talk to so
at the network level what you're looking
for is the software entities that
implement a particular protocol not bits
of hardware and that's an important
point because many service discovery
protocols get that wrong they look for
hardware and then having found the
hardware you're not quite sure what it
does and then you have to go through a
whole negotiation phase so having found
the names of the services on the network
what is it that we found the name of and
the answer is in DNS we found the name
of that service record and the txt
record describing that service so when
it's time to print you want to know the
IP address and port number where that
service can be reached now with DHCP or
link local addressing the addresses
might not be the same from day to day
just like Apple talk so when the user
picks the default printer we don't save
the IP address because that might be
wrong tomorrow what we save is the
rendezvous name and then on demand we
resolve that for an address by doing
this query and the answer we get back is
that the sales printing service today
can be found on 4631 at my printer dot
local it's a postscript printer so it's
page description languages post grip and
clever thing about DNS is it can give
you answers you didn't ask for if it
thinks that you're likely to need to
know that information to say is you
asking another question and in this case
the responder said well you didn't ask
for the address of printer dot local
because you didn't know it's printed on
local when you ask the question but you
going to want to know that so I'll give
you the answer anyway so there you see
the address has been put in the packet
automatically so one query one response
you have the information you need to
print on that printer this was launched
with great fanfare last year and Jaguar
it's in Darwin so it's very easy to get
it and runs on any platform
you want there are also other
independent implementations completely
separate from Apple which is which is
great just like the others specification
is freely available and you can get it
from DNS cache SD for dns service
discovery toward so that was the recap
of where we were last year what's
happened since then we ship jaguar and
we shipped a few bits of software that
we use in rendezvous i chat is an
obvious example finding their to
apprentice is another obvious example
although this time last year there
weren't many rendezvous printers on the
market that's changed dramatically
finding apple share service is another
example since then we've done some more
updates and we've advertised some more
services you will see HTTP when you turn
on personal web sharing you'll see it
showing up in Safari you might say that
too many of them are showing up in
Safari it kind of shows how many people
have accidentally turned on personal web
sharing but don't actually have a web
page there that they're intending to
share Apple of ships hardware products
using rendezvous the obvious candidates
are the ones that don't have a screening
keyboard so the only way to find them is
over the network and you need to be able
to do that no matter how Gus did the
network is you need to be able to find
it if if the airport base station is
your DHCP server then you don't have
dhcp until you've connected to it to
turn on dhcp so the bootstrap problem
there software products you've all seen
Safari you've all seen iTunes the shake
network video transcoding software is
another thing that uses on David a lot
of products from third parties
absolutely amazing to me for a
technology to get this much adoption in
just one year I can't think of any other
new technology that's had such an
overnight success and I think that says
a lot about the cost-benefit ratio of
rendezvous it is so easy to do and the
benefit is so immediate and so obvious
that there is really no reason not to
use rendezvous anywhere that you do
networking were you looking for service
your advert at you providing a service
adding those few extra lights do
rendezvous in such an obvious win so
printers were the first candidate
because Apple tour printers were the
mainstay of network printing
and those are the first people to jump
on board rendezvous got some other
little bits of hardware which I'll show
you later on tivo's in the home great
example you have music and photos on
your Mac and you don't want to sit
around the computer to watch them you
want to sit in the living room and watch
them on the TV I talked about TiVo last
year as a purely hypothetical example of
something I thought would be good and
the great news is that they actually did
it in less than a year later they're
shipping that is a real product
customers chaparral raid just like xlr8
another example of a headless device
Martian net drive is another great
product little box $400 puts in your
garage turn it on it's a network file
server no screen no keyboard it just
shows up on the network you can figure
it through safari which shows up
automatically using rendezvous and saves
it gives you a place to store the data
in your house so your computer doesn't
have to be turned on all the time lots
lots of software products network
databases games Hydra is a great example
I'll show you that in a minute as well
ftp clients and servers lots and lots of
software things because it's so easy to
do we have rendezvous on other platforms
the crocodile rendezvous ftp server for
windows advertisers using rendezvous on
windows and shows up in the ftp
rendezvous menus on all ftp clients on
mac and windows swamp wolf has taken the
apple darwin code and done some extra
work on that to turn it into a system
service for windows and i hope to show
you that a bit later as well j
rendezvous is an implementation of java
written information of rendezvous
written in pure native java interesting
exercise in showing what java can do and
the people doing that are running it on
cell phones apparently they have cell
phones that have a java ranging in them
and so everything you write has to be in
java i don't know about their product
plans but we can only speculate that way
that might be going and there's
apparently a version in python as well
lots of things that
people are doing and Linux as always has
a lot of open source efforts going on
local dog is an interesting resource for
the Linux work so time for some demos
let's go to number four please
alright so let's plug plug in and see
what we have on this network so i
connect the cable and let's see what
okay first thing we have a brother
printer here one of the first companies
to ship a rendezvous printer let's turn
that on
okay well that's okay we have links late
i'll give that a second so if you're
buying a printer now pretty much all the
printer vendors have printers with
rendezvous built in but if you have an
old one laying around that doesn't have
rendezvous this is a great little
product from seh intercon network print
server this little box here implements a
print server so i plug it into the
parallel port on this old printer here
this is just an obsolete printer i found
lying around in the chorus at apple
that's the reason you notice obsolete is
because it doesn't have rendezvous but
there's hope for it because we have this
so this is the brother took a minute
just a power on and just like that
without knowing what address it picked
for itself we're now connected to its
status page and we can do the toner
levels and view all of its configuration
information so easy one-click connection
I plugged in the intercom print server
and it shows up as well and that's it
when I was bringing all this equipment
and setting it up the conference
organizers were saying you're mad you
can't do this just like this is not the
keynote you don't have two hours to set
up you know you've got 15 minutes
between sessions I said it's ok guys its
rendezvous just I don't need to set it
up
so we'll we'll see whether they were
right this is something i love have to
tell you about this people work in data
centers probably familiar with all the
equipment in the 19-inch racks that's
got serial ports onyx for configuration
and set up and we don't have serial
ports on our computers anymore so you
end up meeting one of these USB to
serial adapter as well this is like that
except this is an Ethernet to serial
adapter and you just take this and plug
this into the serial port on whatever
device you want to configure and it
advertises telnet service so now you
don't have to run Cyril wires all over
your data center it's just on the
networks like anything else and you can
telnet to it and I forget the price of
these I think these are about fifty
dollars these are even cheaper than USB
to serial adapters and this does
Ethernet so this is a cool site player
if you go to site player com sorry I
think I think sites left is the place to
look all right good yep site SI te pla
ye are in fact why don't i plug it in
and then we'll see so plug it in light
is on okay this thing has 16 k a flash
memory and in that 16 cade the guys
implemented TCP IP UDP our dhcp client
dns client rendezvous web server telnet
server okay and a knob
and of that 16 k9k of it is the HTML
text of the web pages so it's got 7k for
code and this is not even assembly code
this is C absolutely incredible so there
we go site player click it and Safari
should open a window and just like that
we connected to it have access to its
configuration page so well rendezvous is
all about enabling IP so in as much as
you can run IP over USB which you can do
with various products that I think
emulate ethernet over USB then
rendezvous just works transparently like
any other IP device but if you've got a
device that doesn't speak IP then it's
kind of operating in a different world
things things like this intercom print
server are the kind of gateway from the
IP world to that world so I was going to
bring some equipment with me but
unfortunately most of the things these
days that use serial ports kind of 50
19-inch racks and are a bit bulky but
this is one thing I found at home this
is a little voice over IP product it's
got ethernet on it but you have to
connect the serial port with a terminal
to configure it so this is a great thing
for connecting to the site player maybe
we'll get time to look at that more
later I think maps for this round of
demos let let's go back to the slides
please
[Applause]
alright so what new features do we have
to offer you in Panther Jack you had
ipv6 supporting the colonel but
rendezvous didn't use it the good news
now is that rendezvous is using it it
sends its queries over v4 and v6 annual
advertise services that are running on
v4 and v6 so when you resolve you can
now expect be getting v6 arcaders back
as well as v4 and you should pay
attention to that in your code
generation was always before we have
subtype browsing for more selective
queries that's described in the draft we
have a lot of performance improvements
both in terms of CPU performance and in
terms of smarter algorithms to make use
the network more efficiently these are
things that we all had planned on the
road map but didn't make it into Jaguar
we have a cool feature that gives you
faster pershing of stale cache data
which has been very widely requested
I'll talk a bit more about that network
administrator's last year at the
feedback forum asked us for a way to
enumerate all services on the network
now for a software vendor finding
everything on the network isn't very
useful if you can't communicate with it
it's only useful to find things that you
know how to communicate with but for an
administration put points of view
finding everything on the network is
useful so we we had to work out a way to
do that there was elegant and efficient
and we did do that so that's now in
Panther we have a bunch of new client
applications using rendezvous services
and we have some slight improvements for
the api's that reflect feedback we got
from developers over the last year one
of the trade-offs in any network
protocol including rendezvous is if
you're going to present a list of
resources on the network you have a
trade-off between the timeliness of that
data and the accuracy of it and how
quickly you pull the network and if
you're willing to pull the network once
a second you can have very up-to-date
data but of course that would be bad so
we try to make rendezvous very efficient
on the network and very frugal with its
use of packets and that means it will
cache data typically for up to two hours
and what that means is that if you shut
down your Mac gracefully it sends a
goodbye packet and it disappears from
Oprah's browser list but if you just
yank the cable ethernet cable out of the
printer it doesn't get a chance to send
a goodbye packet and people see these
stale entries showing up in the browser
list and that's frustrating because they
see the printer they tried to print they
get an error they go back to the list
it's still there they try again they get
another error very frustrating so what
we do now is we don't continue you pull
the networks because that would be bad
but when you try to print or use a
service and fail then internally the
code kind of ask itself a question it
says well why were they trying to use
that service well maybe it's because
it's in the browser list and if it
didn't respond that maybe it shouldn't
be in the browser list so the time to
live on that cache entry shortened from
two hours down to a few seconds the
Machine sends a couple of queries and if
it doesn't get an answer then it's flush
from the cache Nick disappears and that
produces a dramatic difference in user
perception they see the stale printer
they try to print it doesn't work they
go back to the list and it's not there
anymore somebody must have just turn the
printer off now that's not actually what
happened it was actually turned off half
an hour ago but the important thing this
is very important from a sort of human
factors point of view is that the person
has a consistent mental model for what
happened and then they're not frustrated
because at least it makes sense them
what going even beyond that when the
other machines on the network see you do
a couple of queries and not get any
answer then they also conclude that that
data must be still and delete it from
their caches as well so only one person
has to try to access the stale printer
and equably gets the benefit of having
it disappear so big improvement in user
experience there without any extra
packets on the wire which is great
[Applause]
one of the future plans i said this only
works right now we've got local with
local multicast but we are planning i'm
not announcing any dates or timetable
here but we are planning to do this
globally using unicast dns queries and
dns dynamic update so where that in mind
when writing your code don't assume that
the domain will always be dot local okay
so back to number four please
so one of my earliest memories of
computing when I was very young was the
big teletype machines that printed out
on rolls of paper at 110 bored and that
was how everybody connected to the UNIX
and mainframe was was over these serial
connections and the DNA of that kind of
lives on in OS 10 and terminal may
actually be the oldest DNA in that sense
that that's in OS 10 this is emulating a
roll of paper on a teletype and there
are lots of things using rendezvous in
panther but I thought going all the way
back to the start would be interesting
so can something as ancient as this
benefit from rendezvous and this is
pretty neat command shift k and we've
got a little server list and right there
is telnet connection to this site player
box let's put it into character mode and
let's plug it into this piece of
prehistoric hardware I was talking about
getting this demo set up with the
hardest demo of everything I did and if
you remember using Cyril puts this stack
of gender changes in DC and DPA and CTS
are tsx on X off-board rates and you
know you type stuff and nothing happens
and you know is it turned on what's good
but I finally found a combination that
works let's power this guy on and see
what happens all right so you know we
can set its IP address we can reboot it
we can let it do its thing and this
could be something over the other side
of the data center and you just tell net
to it and in fact all the serial ports
on your data center just show up these
things here
all right thank you back to the slides
so what new api's do we have the good
news is their modest improvements they
are not things that are can require you
to gut your code and change it NS net
services is unchanged CF net services is
unchanged we've made some minor updates
to the low-level dns service discovery
api's but the old calls are still
supported so your current applications
will continue to work and just to remind
you of the architecture at the coop on
top of the colonel at the lowest level
is the mbms responder demon that
implements the protocol the dns service
discovery API is communicate with that
demon to communicate what services you
want to register and what things you
want to browse for led on top of that is
the core foundation CF net service and
then on top of that is the co co NS net
service and depending on whether you're
writing a Coco application or a row of
VFD command line tool influences which
of those api's you would want to use
it's really personal preference but at
the low level the new dns service
register call offers a few improvements
some people need to advertise services
on a specific interface on multi-home
machines this is not common but if you
want to do that you can now specify an
interface when you pass empty string for
the name to register the system will use
the default name for you but you don't
know what that name is that's kind of
the point of passing empty string is it
saves you needing to know what it is but
if you're writing an application where
you want to filter yourself out of the
list of results you get back knowing
what name the machine picked for you is
useful so we've added that we've raised
the limit on text record size the
guidance for txt records remains the
same they're intended to be a few bites
of ancillary information but we did have
some applications that legitimately
needed a little bit more and the txt
record was when we thought about it the
correct way to solve that applications
problems so we've raised that limit a
little bit we don't want to raise it
above 1,400 because we want these things
to fit in single Ethernet packets things
get much less efficient when you have to
fragment the IP packets
txt record can contain arbitrary binary
data that was almost true in the past
except ascii one was used as a delimiter
now it's just an opaque blob of data
rates passed as a pointer to data and
length so you can pass through binary
data now and we've added a new facility
which came as a request from the
printing industry for what we call
placeholder names or flagship names and
the idea there is if you have a printer
that offers IPP printing and you call it
sales and you have another printer but
also offers printing but it's using PDL
data stream protocol instead each
services its own namespace and most of
the time this is good you can have a
file server called sales department in a
printer call sales department and that's
not a conflict because they're different
things but having two printers call
sales department is confusing so the
printer guy said when we register a
printer name called sales department we
want to know that no one else is using
that name not just for IPP printing but
for any kind of printing and the
solution to that problem is that for
each family of protocols like printing
one protocol is picked as kind of the
flagship protocol of the fleet and even
if you don't implement that protocol you
register a service a fake service with
the port number of zero for the flagship
protocol so a printer that only speaks
IPP would also register an LPR printing
service with no port number it won't
show up in any browser lists when people
are browsing for LPR printers but if
another printer tries to register that
name it will get a name conflict and
will be told you can't have that name
because that's in use so this allows
protocols to be grouped into families
that kind of are conceptually common
functionality even though they're a
different protocol browsing again if you
want to pick a specific interface you
can and the result the replies that come
back indicate which interface the reply
was found on and when you have two
services with the same name one on
Ethernet one on airport knowing which
one you're talking about is useful it
doesn't happen very often but when it
does happen they solves that problem and
the resolve call similarly will
take an interface ID which is what you
got from the browser's call right now
the resolve call always gives you the IP
address and the port number and the txt
record and normally that's what you want
to connect to a service but certain
specialized applications want to monitor
for changes in information continuously
ichat is the best example of this
because I chat uses the txt record to
encode your status about busy idle away
and because of that all the ichat
clients leave their resolves active
because they want to keep getting
callbacks when that information changes
but they don't need to be constantly
querying for IP address and port number
they only want to know about the txt
record so the new call lets you be more
selective and consequently more gentle
on the network by only asking for what
you really care about txt record limit
as I said has been raised in this call
as well and you can fetch crew binary
data in this court and we've made a
number of efficiency improvement so that
when things like ichat do leave their
queries active on the network it
generates a lot for your packets some
specialized calls if you want to make a
proxy responder which is advertising
services on their behalf so you've got
old network printers that don't have
rendezvous and you want to run a proxy
that advertises on their behalf the
register record call lets you register a
whole bunch of Records more efficiently
and lets you do specialized DNS records
it lets you reg to any arbitrary DNS
record whereas the previous calls are
focused around the standard DNS service
discovery conventions DNS servers query
lets you query an arbitrary record and
the reconfirm record is one of the
triggers for the mechanism of torque map
before for the fast fast cash expiration
if you get an IP address back from
dinner service discovery and when you
try to open a TCP connection it doesn't
work you can call this routine to give a
hint to MDS responders that that data it
gave you may not be good anymore and it
should go back and check on the network
obviously use that cautiously because if
you had a bug that could do bad things
for the network so in the last year
we've had a lot of software developers
use run
boo and we've found some common themes
emerging as things we had to help them
with so I'm going to talk about some of
those today so obvious advice use
rendezvous and put the logo on the box
if you're a software developer it's very
similar to using the QuickTime logo if
you use rendezvous on OS 10 you can use
the logo and that's the message to your
customers that you have a quality
product that's easy to use people were
confused initially about naming and
unfortunately it is just a little bit
confusing there are two kinds of name
there are short names that you type on
the command line you want them to be
short and easy to type and don't have
funny characters in the more punctuation
and that's good for command-line
interfaces but when your browser seng
there's no reason to be restricted to
that so in Jaguar there are two names in
the sharing control panels does the
computer name and there was the thing
that was labeled the rendezvous name and
it is the rendezvous name in the sense
that it's your link local host name for
command line use but a lot of people
took that to mean that rendezvous names
have to be lowercase letters digits and
hyphens just like host names that's not
the case and when you register service
most of the time use empty string and
the system will just use the default
computer name for you and if there's a
name conflict on the network it will add
a number two on the end and re-register
so it'll handle all of that for you if
the user changes the name in the sharing
panel then it will update the name of
your service automatically so for most
applications using empty string is what
you want if you want to specify a
different name that's fine as well
itunes is an example of that in iTunes
you can give a name to your music
library which may not relate to the name
of your computer because it's really
naming the music it's not naming the
piece of hardware where the music is
living so pick which is appropriate for
your application very important the
service types are how you identify what
service a client is looking for and if
different people use the same service
type then this is going to cause
conflicts that's not good clients are
going to browse and find things that
don't actually make sense
good example of this is web dev is a
file sharing protocol that runs over
HTTP which is a reasonable design
decision but it's a private design
decision for the protocol if you have a
webdav server don't advertise it as
underscore HTTP because even though it
is using HTTP it's not something that a
user necessarily expect to see in their
web browser and connect to and see
something that's human meaningful now
you may have a web interface your server
as well in which case you advertise that
but underscore HTTP means something a
human being would like to look at in
their web browser web dev as a file
sharing protocol should be advertiser's
underscore web dev and the fact that
it's led on top of HTTP is just an
implementation detail and if you think
about this everything runs on top of TCP
and everything runs on top of IP but
that doesn't mean all protocols are the
same the fact that they share a common
trend a foundation doesn't mean that
they're semantically of the same
protocol you don't have to pay to read
for a protocol name you just fill in the
form if you want to play around and
experiment all legal service names are
14 characters or less so make a longer
name when you know you won't conflict
with a real product some developers have
concerns that by registering their
service they give away the product
they're working on so that's fine to
work with some kind of temporary
placeholder name but when you ship do
the eye on a form and get a legal
service name because that way you own it
and you can take action if other people
come and trample on your service name
and mess up your product just like using
empty string for name when you extra
service or when you browse the services
use empty string for domain empty string
means do the default do the right thing
that the system has been configured to
do and right now that means local but in
future that will mean different things
and if you pass local we'll assume you
meant you only want local so unless
that's really what you mean pass empty
string another common error partly
because the sample code we gave our kind
of illustrating how to do resolves and
people assume that you had to do it that
way you don't need to resolve everything
you find that very hard on the network
you only need to resolve when you're
ready to actually use as a service
and the related point is don't store an
IP address and port number the
preference file because it might be
wrong don't even sort of host name store
the service name look it up on demand
don't assume ipv4 anymore every Jaguar
and Panther system runs ipv6 and when
you browse you will find ipv6 addresses
so you should either use them or you
should very least be aware of them and
handle them properly in your code don't
don't crash or bail out just because you
get a sockaddr that's not AF inet when
you do a result remember to cancel it
afterwards because as long as that
result is active like ichat it's
constantly querying the network saying
has the data change has the data changed
and you do this enough it can be a big
burden on the network so after you've
established your TCP connection you can
cancel the result now remember that our
resolve can and usually will return more
than one results if you've got
multi-homing if you've got v6 you may
have link local addresses and global
addresses and v4 addresses and the
resolved call will give you all of those
you don't know which if any of those
addresses are reachable to you so if you
really want to write a robust
application you have to try connecting
to each of those and see which one works
but having succeeded it's time to kill
the result because you don't need it
anymore common error in the applications
that were resolving everything they
found which is bad in the first place
when they got a removed message for
service going away they would do is stop
resolve on that object and that doesn't
work when you have a NS net service
object and you start to resolve on it
you have to stop the resolve on that
object not a different object that
happens to contain the same service name
and that was an easy mistake to make but
when you every resolve you start you've
got to keep your own data structures in
memory your own list of resolves so that
you can actually get to those objects
and cancel them when they're finished
don't overload rendezvous I know it's
great and if we loves it but you can
take things too far I track is an
example of good use
rendezvous day they need to communicate
information to all the pairs on the
network and the choice was use their own
multicast protocol or use rendezvous and
we looked at the design and we said well
you know what there's no point you
inventing your own thing rendezvous is
there put the data in the txt record
leave a resolve active that is the right
thing to do and it's the most efficient
on the network but before you make that
decision look at it and make an informed
decision about whether that's really the
right way to do it general pieces like
this is not really rendezvous but it's
good advice black network design now
that normal products are doing that's
working this gets more important any
periodic polling on the network is bad
and in your lab it might seem fine but
you put a satirist machines doing that
and the suddenly things add up very very
fast 100 Megan Gigabit Ethernet can
carry a lot of traffic but Airport is
much slower and multicast or broadcast
over Airport is even slower than that
Airport slows down from 54 megabits to
one megabit to send a broadcast packet
so even a small number of broadcasts are
disproportionately expensive on an
airport be very careful with that also
the history of IP has assumed well-known
port numbers and that is less and less
true especially now with fast user
switching you can't assume your
application will get deported expect
because a milk another copy or
application might already be running so
past zero when you bind you'll get a
random port and the good news is
rendezvous advertises your pork you
don't need to exports anymore when
you're using rendezvous final sanity
check when the product is done and it
works and everything seems to be good
have a look at the wire have a look at
the packets on the wire with a network
sniffer like ether ill or Easter peak or
TCP dump newer versions of them already
understand multicast DNS if you've got
an older version it's very easy to add
multicast DNS support because it's
standard DNS packet format you just need
to tell the packet sniffer that port 53
53 is DNS packets and here's an example
how to do it with ether peek you just
open the decoder file find the DNS line
35 hex is 50 30
duplicate that line and put in 14 e 9
which is 53 53 in hex you don't need to
write that down because you can find out
on a multicast DNS website have a look
at the packets on the wire and see if
there's anything that you might be able
to improve it's very easy to have an
application we're sitting in front of
the computer everything is working fine
but on the wire it's sending a hundred
packets per second and you say ok
there's more to correctness than just
does the right thing appear on the
screen so hardware developers similar
kind of advice put random in your
products pass the conformist test and
put the logo on the product the
conformance test is Apple's assurance
and your assurance and the customers
assurance that products with the
rendezvous logo do in fact work well and
do give the experience that people are
expecting so putting rondalee in the
product is more than just another
checklist item on the list of features
it really is about does the products
work better is it easy to use can you
just plug it in like this and have it
work and too often people overlook that
one of my friends got some product
recently some home base station thing
and it said on the box that had upnp and
after he spent three hours getting it
set up he went through the menus and
there was a check box that said enable
upnp which is off by default so they
just missed the point of like they put
all that code in the product and then
missed the point of why they put it
there so we aren't people to make
mistakes like that don't skip link-local
addressing something we've heard from
some developers is well you give us the
multicast dns code on the darwin site so
that's great but you don't give us links
loads addressing so we can't do that
it's too hard and the reason we don't
have the sample code there is because
there really isn't any sample code to
give because the algorithm is send an
ARP packet listen for now reply and if
you get one pick a different random
number
and the way you send and receive art
packets is so platform specific that it
would be different in every platform
it's not a standard API the way socket
is because it's generally down at the
kernel level and that means that the
only remaining sample code we have left
to give you is a random number generator
which would kind of be insulting your
intelligence so it really is very very
simple and it is a vital part of
rendezvous because everything you're
seeing up on the stage here is using the
enclosed addressing right that's how I
can just plug it in and have it work and
I didn't bring a DHCP server and that's
an important part of making network
products that cannot fail and that's
part of rendezvous it's the when you
plug it in it will work no excuses no
well well you didn't have the right
subnet mask in your dhcp client ID was
none of that nonsense right you plug it
in it works and for that to be the case
you can't be relying on things like DHCP
and other infrastructure on the network
DHCP is great definitely put a DHCP
client in but don't make it your only
way of configuring if you're ever in
doubt about how fast the things would
respond or things like that think about
USB you saw when I plugged in these
devices here they all showed up within a
few seconds there are some vendors who
came to us with a thing that would tried
DHCP 45 minutes before it gave up and we
had to say look nobody wants to wait
five minutes struggling you know not
sure why their printer isn't showing up
because about 30 seconds in you know
they're taking a screwdriver to it and
changing dip switch settings and
fiddling with and thinking the ethernet
cables bad and and doing more damage so
USB is active within a few seconds and
rendezvous network devices should be as
well another common thing with network
devices when you change your
configuration setting you have to power
cycle them to make them work don't do
that all Ethernet hardware pretty much
these days gives you link change
detection so when you detect the cable
is connected configure a link-local
address and advertise your services on
that interface just like plugging the
USB cable you don't have to parasites or
print when you plug in the USB cable and
you shouldn't have to Paris like it when
you plug in the ethernet cable
the easiest way to get at the multicast
DNS and bnsf discovery into your product
is just to take our code it's about 75 k
which is not big in today's world of
bloated multi megabyte applications if
you're if you're doing something truly
tiny then contact us and we can work
with you because as I say we've got some
developers doing really tiny
implementations they cut a lot of
corners to do that but talk to us and we
can set you up with something that's
appropriate but the most full-featured
fully tested code is the same code
that's in Panther you know that's being
run on millions of machines so that is
really the codes that you have the most
confidence in okay so some other
interesting sessions you might want to
go to the first one is already over but
you'll have it on your DVD so you can
review that if you want we have got
networking sessions and networking
feedback tomorrow and Friday Craig is
our develop relations guy if you have
any questions contact him for the
specifications zeroconf that org
multicast dns at all Dino's st dot org
all have those drafts they've just been
updated last week so they're they're up
to date with all the latest stuff in
Panther we have apple developer
information we also have the apple
rendezvous mailing list which is a great
place to ask questions so that's often a
good place to ask your first question
instead of going straight to quake with
a question many times asking on the list
will get you an answer