updates.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 11 Oct 2001 09:29:31 +0000 (09:29 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 11 Oct 2001 09:29:31 +0000 (09:29 +0000)
CHANGES
apps/silcd/packet_receive.c
apps/silcd/packet_send.c
apps/silcd/server.c
doc/draft-riikonen-silc-pp-04.nroff
doc/draft-riikonen-silc-spec-04.nroff

diff --git a/CHANGES b/CHANGES
index 5eb2d3314b65be4f54cba2d4f35f1df23f8ac4ea..6790253677de55ffe60a9884aa875893c78ea351 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,14 @@
+Thu Oct 11 12:14:19 EDT 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * Check for existing server ID in silc_server_new_server
+         and in silc_server_connect_to_router_final and remove the
+         old entry if it exists.  Affected file silcd/packet_receive.c,
+         silcd/server.c.
+
+       * Send the channel message always to only one router, either
+         in upstream or downstream.  Affected file is
+         silcd/packet_send.c.
+
 Tue Oct  9 17:45:43 EDT 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Wrote the definition of the backup resuming protocol to the
index a7f07df9b56d2e4fcbe35d04edc9d6541a129e90..47d7cf0a135fba1b4bdc0c013bc1a71fe9290946 100644 (file)
@@ -1618,7 +1618,7 @@ SilcServerEntry silc_server_new_server(SilcServer server,
                                       SilcPacketContext *packet)
 {
   SilcBuffer buffer = packet->buffer;
-  SilcServerEntry new_server;
+  SilcServerEntry new_server, server_entry;
   SilcServerID *server_id;
   SilcIDListData idata;
   unsigned char *server_name, *id_string;
@@ -1670,10 +1670,25 @@ SilcServerEntry silc_server_new_server(SilcServer server,
   }
   silc_free(id_string);
 
+  /* Check that we do not have this ID already */
+  server_entry = silc_idlist_find_server_by_id(server->local_list, 
+                                              server_id, TRUE, NULL);
+  if (server_entry) {
+    silc_idcache_del_by_context(server->local_list->servers, server_entry);
+  } else {
+    server_entry = silc_idlist_find_server_by_id(server->global_list, 
+                                                server_id, TRUE, NULL);
+    if (server_entry) 
+      silc_idcache_del_by_context(server->global_list->servers, server_entry);
+  }
+
   /* Update server entry */
   idata->status |= SILC_IDLIST_STATUS_REGISTERED;
   new_server->server_name = server_name;
   new_server->id = server_id;
+  
+  SILC_LOG_DEBUG(("New server id(%s)",
+                 silc_id_render(server_id, SILC_ID_SERVER)));
 
   /* Add again the entry to the ID cache. */
   silc_idcache_add(server->local_list->servers, server_name, server_id, 
index c42daec9404c9e25f8d1fdb239c350b3c6278772..535ebc0ed5c3cee2c3695426dda5aa807d186a7d 100644 (file)
@@ -639,6 +639,7 @@ void silc_server_packet_relay_to_channel(SilcServer server,
   uint32 routed_count = 0;
   SilcIDListData idata;
   SilcHashTableList htl;
+  bool gone = FALSE;
 
   SILC_LOG_DEBUG(("Relaying packet to channel"));
 
@@ -753,7 +754,12 @@ void silc_server_packet_relay_to_channel(SilcServer server,
           channel keys are cell specific and we have different channel
           key than the remote router has. */
        if (sock->type == SILC_SOCKET_TYPE_ROUTER) {
+
+         if (gone)
+           continue;
+
          SILC_LOG_DEBUG(("Remote is router, encrypt with session key"));
+         gone = TRUE;
 
          /* If private key mode is not set then decrypt the packet
             and re-encrypt it */
index 4b58bda6bd8980411ede2a44f413020f4a6b6baa..101235e43e54834fcc8d5c81eb022e3764d78307 100644 (file)
@@ -872,6 +872,21 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router_final)
 
   SILC_LOG_INFO(("Connected to router %s", sock->hostname));
 
+  /* Check that we do not have this ID already */
+  id_entry = silc_idlist_find_server_by_id(server->local_list, 
+                                          ctx->dest_id, TRUE, NULL);
+  if (id_entry) {
+    silc_idcache_del_by_context(server->local_list->servers, id_entry);
+  } else {
+    id_entry = silc_idlist_find_server_by_id(server->global_list, 
+                                            ctx->dest_id, TRUE, NULL);
+    if (id_entry) 
+      silc_idcache_del_by_context(server->global_list->servers, id_entry);
+  }
+
+  SILC_LOG_DEBUG(("New server id(%s)",
+                 silc_id_render(ctx->dest_id, SILC_ID_SERVER)));
+
   /* Add the connected router to local server list */
   id_entry = silc_idlist_add_server(server->local_list, strdup(sock->hostname),
                                    SILC_ROUTER, ctx->dest_id, NULL, sock);
index 40c8fe34a265019e00c1b29687199d184c65db06..858dd119f5dade282915158e521953f4f5dd5f6a 100644 (file)
@@ -2628,6 +2628,19 @@ to create route cache based on these informations.  If faster route for
 destination does not exist in router's route cache the packet MUST be
 routed to the primary route (default route).
 
+However, there are some issues when routing channel messages to group
+of users.  Routers are responsible of routing the channel message to
+other routers, local servers and local clients as well.  Routers MUST
+send the channel message to only one router in the network, preferrably
+to the shortest route to reach the channel users.  The message can be
+routed into either upstream or downstream.  After the message is sent
+to a router in the network it MUST NOT be sent to any other router in
+either same route or other route.  The message MUST NOT be routed to
+the router it came from.
+
+When routing for example private messages they should be routed to the
+shortest route always to reach the destination client as fast as possible.
+
 For server which receives a packet to be routed to its locally connected
 client the server MUST check whether the particular packet type is
 allowed to be routed to the client.  Not all packets may be sent by
@@ -2638,6 +2651,20 @@ that may be sent to indirectly connected entities.  It is clear that
 server cannot send, for example, disconnect packet to client that is not
 directly connected to the server.
 
+Routers form a ring in the SILC network.  However, routers may have other
+direct connections to other routers in the network too.  This can cause
+interesting routing problems in the network.  Since the network is ring,
+the packets usually should be routed into counter clock-wise direction,
+or if it cannot be used then always clock-wise (primary route) direction.
+Problems may arise when a faster direct route exists and router is routing
+a channel messages.  Currently channel messages must be routed either
+in upstream or downstream, they cannot be routed to other direct routes.
+The SILC protocol should have a shortest path discovery protocol, and some
+existing routing protocol, that can handle a ring network with other direct
+routes inside the ring (hybrid ring-mesh network), MAY be defined to be
+used with the SILC protocol.  Additional specifications MAY be written
+on the subject.
+
 
 .ti 0
 2.12 Packet Broadcasting
index 22d93d60de2a11f5005fa233118568ab6cee2830..3a97b1dbc59fc6fc59deba437a316e61dcf7c7d6 100644 (file)
@@ -376,7 +376,7 @@ be connected in a specific way.
 Every router has their primary route which is a connection to another
 router in the network.  Unless there is only two routers in the network
 must not routers use each other as their primary routes.  The router
-connections in the network must form a circular.
+connections in the network must form a ring.
 
 
 
@@ -2012,6 +2012,9 @@ as Destination ID in the SILC Packet Header.  The server MUST then
 distribute the message to all clients on the channel by sending the
 channel message destined explicitly to a client on the channel.
 
+See the [SILC2] for description of channel messege routing for router
+servers.
+
 See [SILC2] for description of channel message encryption and decryption
 process.