Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 27 21:26:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8S4QEBu020232 for ; Sat, 27 Sep 2008 21:26:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8S4TwnD007158 for ; Sat, 27 Sep 2008 21:29:58 -0700 Message-Id: <200809280429.m8S4TwnD007158@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Final Part1 Date: Sat, 27 Sep 2008 21:29:58 -0700 From: Bill Cheng Someone wrote: > When two nodes are trying to connect to each other simultaneously the > specification has mentioned a way to break the tie. > The question is : > Do we first establish both the connections and then > disconnect an one of them after we decide which connection to keep. > > or we establish one connection at first only Since you cannot control when things happen, I'm not sure how you can "establish one connection first". Let's say that nodes A and B connect to each simultaneously. >From the point of view of node A, it's connecting to node B over connection #1, while some node is connecting to node A over connection #2 (A doesn't know that this is node B yet). As soon as connection #1 is established, A will send HELLO to B, and in the HELLO message, A tells B A's well-known port number. Simultaneously, as soon as connection #2 is established, A will receive a HELLO message. From the content of the HELLO message, A realizes that node B is at the other end connection #2. Now A has to break the tie. Please don't try to get around this problem! Just implement a solution for it! -- Bill Cheng // bill.cheng@usc.edu