<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1457696952929_11267"><span id="yui_3_16_0_1_1457696952929_11266">Hi Albert,</span></div><div id="yui_3_16_0_1_1457696952929_11267"><span><br></span></div><div id="yui_3_16_0_1_1457696952929_11267"><span id="yui_3_16_0_1_1457696952929_11296">I have added the code below on line 442 of lispmob-0.5.1/lispd/control/lisp_xtr.c:</span></div><div id="yui_3_16_0_1_1457696952929_11267"><span><br></span></div><div id="yui_3_16_0_1_1457696952929_11267" class="">    /* SEND MAP-REPLY */</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    if (map_reply_fill_uconn(xtr, itr_rlocs, uc) != GOOD){</div><div id="yui_3_16_0_1_1457696952929_11267" class="">        LMLOG(LDBG_1, "Couldn't send Map Reply, no itr_rlocs reachable");</div><div id="yui_3_16_0_1_1457696952929_11267" class="">        goto err;</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    }</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    LMLOG(LDBG_1, "Sending %s", lisp_msg_hdr_to_char(mrep));</div><div id="yui_3_16_0_1_1457696952929_11267"></div><div id="yui_3_16_0_1_1457696952929_11267" class="">    send_msg(&xtr->super, mrep, uc);</div><div id="yui_3_16_0_1_1457696952929_11267" class="">+++++++++++++++++line 441<br></div><div id="yui_3_16_0_1_1457696952929_11267" class="">    uconn_t nuc = *uc;</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    nuc.ra = *xtr->loc_server;</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    assert(!xtr->signal_dropping);</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    if (xtr->signal_dropping) {</div><div id="yui_3_16_0_1_1457696952929_11267" class="">        /* Send Map-Reply(NULL locator) to loc-server. */</div><div id="yui_3_16_0_1_1457696952929_11267" class="">        lisp_msg_put_neg_mapping(mrep, deid, 0, ACT_NO_ACTION, A_NO_AUTHORITATIVE);</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    } else {</div><div id="yui_3_16_0_1_1457696952929_11267" class="">        /* Send same Map-Reply to loc-server as sent to PiTR. */</div><div id="yui_3_16_0_1_1457696952929_11267" class="">    }</div><div id="yui_3_16_0_1_1457696952929_11267"></div><div id="yui_3_16_0_1_1457696952929_11267" class="">    send_msg(&xtr->super, mrep, &nuc);</div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class="">+++++++++++++++</div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class="">Note that xtr->signal_dropping is false.</div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class="">The intention is to duplicate the map-reply message sent to the PiTR by sending it to our loc-server. But after observing the packets on wireshark (see attached, filter 'lisp'), I realised that the second map-reply packet is actually sent as map-referral packet. What could be possibly the reason for that please? Are there any issues using the auto uconn_t nuc? Will send_msg attempt to de-allocate it?  Can such an object created ad-hoc be used, or does some other component need to be informed before hand that the loc-server address is a potential peer?</div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class="">Regards,</div><div dir="ltr" id="yui_3_16_0_1_1457696952929_11411" class=""> </div><div></div><div id="yui_3_16_0_1_1457696952929_11265"> </div><div class="signature" id="yui_3_16_0_1_1457696952929_11236"><div id="yui_3_16_0_1_1457696952929_11235"><div style="font-family:Tahoma;font-size:13px;" class="yui_3_2_0_18_1337194888927129" id="yui_3_16_0_1_1457696952929_11234"><div style="font-family:arial;font-size:13px;" id="yui_3_16_0_1_1457696952929_11233"><div class="MsoNormal" id="yui_3_16_0_1_1457696952929_11264"><span style="color:rgb(79, 129, 189);font-family:Euphemia, sans-serif;font-size:10pt;" id="yui_3_16_0_1_1457696952929_13166">Musab Isah</span><br></div><div class="MsoNormal" id="yui_3_16_0_1_1457696952929_11263"><span style="font-size:10.0pt;color:#4F81BD;" id="yui_3_16_0_1_1457696952929_13165">Research Student,</span></div><div class="MsoNormal" id="yui_3_16_0_1_1457696952929_11297"><span style="font-size:10.0pt;color:#4F81BD;" id="yui_3_16_0_1_1457696952929_11322">School of Computing and Communications,</span></div><div class="MsoNormal" id="yui_3_16_0_1_1457696952929_11232"><span style="font-size:10.0pt;color:#4F81BD;" id="yui_3_16_0_1_1457696952929_13164">D29, InfoLab21</span></div><div class="MsoNormal" id="yui_3_16_0_1_1457696952929_11262"><span style="font-size:10.0pt;color:#4F81BD;" id="yui_3_16_0_1_1457696952929_13143">Lancaster University</span></div></div></div></div></div><div class="qtdSeparateBR" id="yui_3_16_0_1_1457696952929_11246"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_1_1457696952929_11240" style="display: block;">  <div style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1457696952929_11239"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1457696952929_11238"> <div dir="ltr" id="yui_3_16_0_1_1457696952929_11237"> <font size="2" face="Arial" id="yui_3_16_0_1_1457696952929_11241"> <hr size="1" id="yui_3_16_0_1_1457696952929_11245"> <b><span style="font-weight:bold;">From:</span></b> Albert López <alopez@ac.upc.edu><br> <b><span style="font-weight: bold;">To:</span></b> MUSAB MUHAMMAD <nmusabu@yahoo.com>; "users@openoverlayrouter.org" <users@openoverlayrouter.org> <br><b><span style="font-weight: bold;">Cc:</span></b> Steven Simpson <ss@comp.lancs.ac.uk><br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, March 3, 2016 2:53 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [LISPmob-users] Modifying LISPMob Code<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1457696952929_11242"><br><div id="yiv4804444268"><div id="yui_3_16_0_1_1457696952929_11244">
    <div class="yiv4804444268moz-cite-prefix" id="yui_3_16_0_1_1457696952929_11243">Hi Musab,<br clear="none">
      <br clear="none">
      First I would like to let you know that we are now <a rel="nofollow" shape="rect" target="_blank" href="http://www.openoverlayrouter.org/">OpenOverlayRouter</a>.
      If possible use the new OOR mailing lists to contact us from now
      on :)<br clear="none">
      <br clear="none">
      I will try to give you some answers inline:<br clear="none">
      <br clear="none">
      On 01/03/16 18:40, MUSAB MUHAMMAD wrote:<br clear="none">
    </div>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
        <div id="yiv4804444268yui_3_16_0_1_1456853527172_2190"><span>Hi all,</span></div>
        <div id="yiv4804444268yui_3_16_0_1_1456853527172_2190"><span><br clear="none">
          </span></div>
        <div class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2190"><span class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2738" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">I want to
            introduce a new network entity, Location Server (LS) for
            some reason, and have MNs and PITRs interact with it as
            follows:</span><br clear="none" class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2740" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">
        </div>
        <ul style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;margin-top:14pt;margin-bottom:14pt;" id="yiv4804444268yui_3_16_0_1_1456853527172_2742" class="yiv4804444268"><li class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2744">When an MN
            detects its interface signal dropping (which is going to be
            determined by an external program), <i class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2746">MN should
              issue Map-Reply(LS) to PITR, and Map-Reply(NULL) to LS</i>.</li><li class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2748">When an MN's
            interface comes back up after binding to a new address RLOC,
            and the MN (eventually) issues Map-Reply(RLOC) to PITR, <i class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2750">MN should
              also issue Map-Reply(RLOC) to LS</i>.</li></ul>
      </div>
    </blockquote>
    Are you trying to modify the SMR process to also send a Map Reply to
    the LS with the specified RLOCs of the previous point, or you are
    sending directly map replys? <br clear="none">
    <br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
        <div class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2752" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;margin-top:14pt;margin-bottom:14pt;">As we know, a Solicit-Map-Request (SMR) is sent to
          PITR at interface up, and the PITR sends a Map-Request to the
          MN, which then sends a Map-Reply with its new RLOC. 
          tr_recv_map_request() in control/lisp_xtr.c appears to handle
          the incoming Map-Request and respond with a Map-Reply, so I
          intend to modify this function to deal with both interaction,
          and supply it through the lisp_xtr_r structure with a flag to
          distinguish the two behaviours, and the LS address.  The flag
          will be set if the signal drop has been detected, and cleared
          if the interface has come back up.  There are two
          modifications:<br clear="none">
        </div>
        <ul style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;margin-top:14pt;margin-bottom:14pt;" id="yiv4804444268yui_3_16_0_1_1456853527172_2760" class="yiv4804444268"><li class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2762">If the flag
            is set, Map-Reply(LS) will be sent to PITR instead of
            Map-Reply(RLOC).</li><li class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2764">An
            additional Map-Reply(flag ? NULL : RLOC) will be sent to LS.</li></ul>
      </div>
    </blockquote>
    The SMR process not only affects to the PiTR but also all the
    entries of the map cache. <br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
        <div dir="ltr" id="yiv4804444268yui_3_16_0_1_1456853527172_2783"><span class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2766" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">For the first
            change, can someone explain how the RLOC currently gets set
            in the new message?  Is it uc->la, for example?  Or do I
            need to build a new mapping_t?</span><br clear="none" class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2768" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">
        </div>
      </div>
    </blockquote>
    uc is just used to indicate the IPs and the udp ports to be used to
    send the packet. You will probably have to generate a mapping with
    the new RLOCs you want to use<br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
        <div dir="ltr" id="yiv4804444268yui_3_16_0_1_1456853527172_2783"><br clear="none" class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2770" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">
          <span class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2772" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">For the second
            change, I don't strictly have to use a Map-Reply, as my code
            will be talking to my LS, but it would be nice to re-use the
            message type.  What could I do to express some sort of
            Map-Reply(NULL)?  Use lisp_msg_put_neg_mapping, perhaps?  Or
            just an all-zero IP address?</span><br clear="none" class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2774" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">
        </div>
      </div>
    </blockquote>
    Yes, using a negative map reply (locator_count = 0) will be useful.
    Other possibilities could be to use priority 255 in order to
    indicate to not use the locators. When you create the mapping you
    also add a locator for the LS and then you change priority to 255 of
    the locators you don't want to be used.<br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
        <div dir="ltr" id="yiv4804444268yui_3_16_0_1_1456853527172_2783"><br clear="none" class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2776" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">
          <br clear="none" class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2780" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">
          <span class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2782" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">It looks like
            send_all_smr_and_reg() sends SMR, so that will result in a
            later invocation of tr_recv_map_request().  It is only
            invoked from send_all_smr_cb(), which appears to be invoked
            by a timer.  Is that timer set as a result of a new binding,
            i.e., so that SMR will be sent a short moment after the new
            binding is established?  IOW, does the invocation of
            send_all_smr_cb() imply that the lisp_xtr object has learned
            of the new binding?  If so, I intend to clear the flag
            inside send_all_smr_cb(), so that the subsequent (indirect)
            invocation of tr_recv_map_request() will behave normally to
            PITR (as well as send an additional message to LS).  I will
            also add a non-static function to set the flag, and then
            call send_all_smr_and_reg().  I will later arrange to call
            this new function when the signal drop is detected.</span><span><br clear="none">
          </span></div>
      </div>
    </blockquote>
    We have a structure for each interface (iface_locators) which
    contain the changes produced in the interface. When we receive a
    netlink message we update this structure and we program the SMR
    timer. If we receive a new netlink message before the timer expires,
    we reprogram the timer again. When timer expires we call <span class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2782" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">send_all_smr_cb

      where</span> we check the iface_locators structures to decide if
    we have to do a SMR or if we had a flapping situation and we don't
    need to initiate the SMR.<br clear="none">
    <br clear="none">
    I hope with this information you can proceed with your development.<br clear="none">
    <br clear="none">
    Best regards<br clear="none">
    <br clear="none">
    Albert<div class="yiv4804444268yqt8442221730" id="yiv4804444268yqtfd41410"><br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
        <div dir="ltr" id="yiv4804444268yui_3_16_0_1_1456853527172_2783"><span class="yiv4804444268" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;"><br clear="none">
          </span></div>
        <div dir="ltr" id="yiv4804444268yui_3_16_0_1_1456853527172_2783"><span class="yiv4804444268" id="yiv4804444268yui_3_16_0_1_1456853527172_2967" style="font-family:'Segoe UI', Helvetica, Arial, sans-serif;font-size:medium;">Regards,</span></div>
        <div id="yiv4804444268yui_3_16_0_1_1456853527172_2735"> </div>
        <div class="yiv4804444268signature" id="yiv4804444268yui_3_16_0_1_1456853527172_2726">
          <div id="yiv4804444268yui_3_16_0_1_1456853527172_2725">
            <div class="yiv4804444268yui_3_2_0_18_1337194888927129" id="yiv4804444268yui_3_16_0_1_1456853527172_2724" style="font-family:Tahoma;font-size:13px;">
              <div id="yiv4804444268yui_3_16_0_1_1456853527172_2723" style="font-family:arial;font-size:13px;">
                <div class="yiv4804444268MsoNormal" id="yiv4804444268yui_3_16_0_1_1456853527172_2734"><span id="yiv4804444268yui_3_16_0_1_1456853527172_2733" style="color:rgb(79, 129, 189);font-family:Euphemia, sans-serif;font-size:10pt;">Musab Isah</span><br clear="none">
                </div>
                <div class="yiv4804444268MsoNormal" id="yiv4804444268yui_3_16_0_1_1456853527172_2732"><span id="yiv4804444268yui_3_16_0_1_1456853527172_2731" style="font-size:10.0pt;color:#4F81BD;">Research
                    Student,</span></div>
                <div class="yiv4804444268MsoNormal" id="yiv4804444268yui_3_16_0_1_1456853527172_2730"><span id="yiv4804444268yui_3_16_0_1_1456853527172_2729" style="font-size:10.0pt;color:#4F81BD;">School of
                    Computing and Communications,</span></div>
                <div class="yiv4804444268MsoNormal" id="yiv4804444268yui_3_16_0_1_1456853527172_2728"><span id="yiv4804444268yui_3_16_0_1_1456853527172_2727" style="font-size:10.0pt;color:#4F81BD;">D29, InfoLab21</span></div>
                <div class="yiv4804444268MsoNormal" id="yiv4804444268yui_3_16_0_1_1456853527172_2722"><span id="yiv4804444268yui_3_16_0_1_1456853527172_2721" style="font-size:10.0pt;color:#4F81BD;">Lancaster
                    University</span></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br clear="none">
    <br clear="none">
  </div></div></div><br><br></div> </div> </div>  </div></div></body></html>