<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I'd like to talk about how to discover Kimchi peers.<br>
<br>
Now I just talk about discover a peer in a same network here.<br>
<br>
I will use a <a
href="http://en.wikipedia.org/wiki/Multicast_address#Local_subnetwork">local
multicast subnetwork address</a> to find peers in one network. <br>
Choose 224.0.0.132 as the kimchi multicast address, and 8000 as the
port.<br>
<br>
For cross network that need the router support multicast, so I give
up discover a peer cross network.<br>
I will let user add the remote peers manully.<br>
<br>
In the whole system all peers are equal. There will not be a center
discover service.<br>
<br>
We will define two kinds of multicast message Notify and Search.<br>
the format as follow. <br>
<pre wrap=""> # ____________________________________________
# | head | message body | tail |
# |___________________|_________________|______|
# |sizeof(messageBody)| json message | EOL |
# |___________________|_________________|______|</pre>
<br>
the flow of discover Kimchi peers:<br>
1. one host multicast a "search" message. in this message it tell
himself information, and ask others tell their information.<br>
Like this: <br>
{"search": {"domain": "kimchi-host1", "IP": "192.168.0.3",
"httpport": "8000", "httpsport": "8001"}}<br>
this means "hello, I'm a kimchi host, this is my information, can
you tell me who you are?"<br>
2. others received a search will response an "notify" message.<br>
Like this:<br>
{"notify": {"domain": "kimchi-host1", "IP": "192.168.0.3",
"httpport": "8000", "httpsport": "8001"}}<br>
this tells others that "hi, I'm a kimchi host, I'm alive and
this is my information"<br>
<br>
o (user) 1 is "search"<br>
/\ --------> 2 is
"notify"<br>
| 1 _____
________________<br>
kimchi-host1
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
------2-<---| DB |<----2-----|multicast listen |<--2--<br>
| |____|
|_______________| |<br>
----------------------1-------------------------------> |<br>
|<br>
_____ |_____<br>
| |<br>
|
switch |<br>
| |<br>
|___________|<br>
o (user)
|<br>
/\ ---------
-----------------------------2----------------------- --->|<br>
| | _____
________________ |<br>
kimchi-host3 ------1<---| DB |<---1------|multicast listen
|<---1--|<br>
|____|
|_______________| <br>
<br>
<br>
we need to discuss:<br>
1. should we support beat heart? <br>
every kimchi host will send periodic notify to tell others himself
information?<br>
<br>
<br>
2. should we support a "quit" message?<br>
"quit" message tell other peers, that this kimchi quit normally.
others can remove this from peers list.<br>
But the kimchi can not send "quit" when aborting abnormally. <br>
<br>
3. Do we store the local peers information in DB?<br>
we can collection the local peers and send them immediately when
user need to discover the peers. <br>
<br>
We will extend to support remote peers, these information need to be
stored in DB.<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center </pre>
</body>
</html>