Ignore:
Timestamp:
Aug 6, 2009, 2:32:48 PM (15 years ago)
Author:
mies
Message:
 
Location:
source/ariba/overlay/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/chord/Chord.cpp

    r5736 r5743  
    5757
    5858        // create routing table
    59         this->table = new chord_routing_table(_nodeid, 2);
     59        this->table = new chord_routing_table(_nodeid, 4);
    6060        orphan_removal_counter = 0;
    6161        discovery_count = 0;
     
    7171
    7272/// helper: sets up a link using the base overlay
    73 LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node) {
     73LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node, const NodeID& remoteRelay ) {
    7474        logging_debug("Request to setup link to " << endp.toString() );
    7575
     76        // check if we already have a connection
    7677        for (int i=0; i<table->size(); i++)
    7778                if ((*table)[i]->id == node && !((*table)[i]->info.isUnspecified()))
     
    8990
    9091        // establish link via base overlay
    91         return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID);
     92        return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID, remoteRelay );
    9293}
    9394
     
    105106        Discovery dmsg;
    106107        dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
     108        dmsg.setSourceRelay(baseoverlay.getRelayNode(destination));
    107109        dmsg.setFollowType(Discovery::normal);
    108110        dmsg.setTTL((uint8_t) ttl);
     
    120122                Discovery dmsg;
    121123                dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
     124                dmsg.setSourceRelay(baseoverlay.getRelayNode(nodeid));
    122125                dmsg.setFollowType(Discovery::successor);
    123126                dmsg.setTTL((uint8_t)3);
     
    130133                Discovery dmsg;
    131134                dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
     135                dmsg.setSourceRelay(baseoverlay.getRelayNode(nodeid));
    132136                dmsg.setFollowType(Discovery::predecessor);
    133137                dmsg.setTTL((uint8_t)3);
     
    332336                // check if source node can be added to routing table and setup link
    333337                if (m->getSource() != nodeid && table->is_insertable(m->getSource()))
    334                         setup(*dmsg->getSourceEndpoint(), m->getSource() );
     338                        setup(*dmsg->getSourceEndpoint(), m->getSource(), dmsg->getSourceRelay() );
    335339
    336340                // delegate discovery message
  • source/ariba/overlay/modules/chord/Chord.h

    r5668 r5743  
    8181
    8282        // helper: sets up a link using the "base overlay"
    83         LinkID setup( const EndpointDescriptor& endp, const NodeID& node = NodeID::UNSPECIFIED );
     83        LinkID setup( const EndpointDescriptor& endp,
     84                const NodeID& node = NodeID::UNSPECIFIED,
     85                const NodeID& remoteRelay = NodeID::UNSPECIFIED );
    8486
    8587        // helper: sends a message using the "base overlay"
  • source/ariba/overlay/modules/chord/messages/Discovery.h

    r5681 r5743  
    7070                this->follow_type = msg.follow_type;
    7171                this->ttl = msg.ttl;
     72                this->source_relay = msg.source_relay;
    7273                this->source_endpoint = msg.source_endpoint;
    7374        }
     
    99100        }
    100101
     102        inline void setSourceRelay( const NodeID& relay ) {
     103                source_relay = relay;
     104        }
     105
     106        inline const NodeID& getSourceRelay() const {
     107                return source_relay;
     108        }
    101109private:
    102110        uint8_t follow_type;
    103111        uint8_t ttl;
    104112        EndpointDescriptor source_endpoint;
     113        NodeID source_relay;
    105114};
    106115
     
    112121
    113122        // serialize end-point
    114         X && source_endpoint;
     123        X && source_relay && source_endpoint;
    115124} sznEnd();
    116125
  • source/ariba/overlay/modules/onehop/OneHop.cpp

    r5624 r5743  
    154154        } else {
    155155                bootstrapLinks.push_back(
    156                                 baseoverlay.establishLink( bootstrapEp,
     156                                baseoverlay.establishDirectLink( bootstrapEp,
    157157                                        OverlayInterface::OVERLAY_SERVICE_ID )
    158158                                        );
     
    314314
    315315                        logging_debug( "building up link to node in overlay " << node.toString() );
    316                         const LinkID link = baseoverlay.establishLink( *((*i).second),
     316                        const LinkID link = baseoverlay.establishDirectLink( *((*i).second),
    317317                                                        OverlayInterface::OVERLAY_SERVICE_ID );
    318318
Note: See TracChangeset for help on using the changeset viewer.