Ignore:
Timestamp:
Aug 6, 2009, 2:32:48 PM (15 years ago)
Author:
mies
Message:
 
File:
1 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
Note: See TracChangeset for help on using the changeset viewer.