<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:굴림;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"\@맑은 고딕";}
@font-face
        {font-family:"\@굴림";
        panose-1:2 11 6 0 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:굴림;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:굴림;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"맑은 고딕";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"맑은 고딕";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=KO link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Hi Junxiao,<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Thank you for your quick and good comments.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>We have to admit that we have not fully check the unit-test cases yet..<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Our tests was mainly compatibility test with applications and forwarding. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>When we look over the unit-test error cases, there are some conflicts on face implementations between what test codes assume and what MW-NFD modifies to separate input thread with forwarding thread. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>We’ll check each error cases, and will fix if it is a real error, or update the unit-test codes to accommodate new MW-NFD arch.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>For ndfc commands processing changing forwarding worker’s tables, we use udp socket between management thread and forwarding woker threads. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>The message queue was one of our considerations, but we chose udp socket, because it is more simple than message queue method.   If message queue is used, management thread should wait the responses from all worker threads asynchronously, through another message queues or global variables. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>There should be some unique command ID and ID-related response structure to check whether all workers return OK, and <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>it requires  another polling operation to check the responses. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>If we use udp socket, management thread can just wait the response from each worker synchronously. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Of course, asynchronous operation of message queue methods can enhance commands processing time a little,  with more complex operation. So we decided to use udp because it is sufficient to handle nfdc commands. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>For command parameter passing, we use shared pointer of </span><span lang=EN-US style='font-family:"Courier New"'><ndn::nfd::ControlParameters>, </span><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>because it makes fixed udp message size for all commands, and it works. <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>If shared pointer passing between threads are a little risky coding style, we can use pointer of global variable, or we can just send parameter itself in the udp message.  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Would you let us know more detail about your concerns on shared pointer passing between threads? <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>We appreciate more comments from NFD developers like you, because we might miss some points should be checked first for proper operation as a NFD-compatible forwarder.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Thanks again, <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Sung Hyuk Byun<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Junxiao Shi <shijunxiao@email.arizona.edu> <br><b>Sent:</b> Saturday, February 20, 2021 8:19 AM<br><b>To:</b> Sung Hyuk Byun <shbyun@etri.re.kr><br><b>Cc:</b> <nfd-dev@lists.cs.ucla.edu> <nfd-dev@lists.cs.ucla.edu><br><b>Subject:</b> Re: [EXT][Nfd-dev] Multi-Worker NFD (MW-NFD) 0.7.1 Release<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div><p class=MsoNormal><span lang=EN-US>Hi Sung<o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>I had a quick look at your codebase, and I found a few strange things.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>I'll only mention one below.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>In mw-nfd/daemon/mw-nfd/mw-nfd-global.cpp file </span><span lang=EN-US style='font-family:"Courier New"'>emitMwNfdcCommand </span><span lang=EN-US>function contains the following code:<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><a href="https://github.com/etri/mw-nfd/blob/44fd00a55b1a80595c5e677f74762334a25d9a39/daemon/mw-nfd/mw-nfd-global.cpp#L127" target="_blank">https://github.com/etri/mw-nfd/blob/44fd00a55b1a80595c5e677f74762334a25d9a39/daemon/mw-nfd/mw-nfd-global.cpp#L127</a><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>char buf[MW_NFD_CMD_BUF_SIZE]={0,};<br>mw_nfdc_ptr nfdc = (mw_nfdc_ptr)buf;<br>struct sockaddr_in worker, their;<br>auto params = make_shared<ndn::nfd::ControlParameters>(parameters);<br><br>for (i = 0; i < g_forwardingWorkers; i++) {<br>  // omitted code to assign 'worker' address<br><br>  nfdc->mgr = mgr;<br>  nfdc->verb = verb;<br>  nfdc->ret = MW_NFDC_CMD_OK;<br>  nfdc->netName = netName;<br>  nfdc->parameters = params;<br><br>  sendto(g_nfdcSocket, buf, sizeof(buf), 0, (struct sockaddr*)&worker, addr_len);<br>  setCommandRx(i, true);<br><br>  numbytes = recvfrom(g_nfdcSocket, buf, sizeof(buf), 0, (struct sockaddr*)&their, &addr_len);<br>  if (numbytes) {<br>    retval += nfdc->retval;<br>    ret = nfdc->ret;<br>  }<br>  setCommandRx(i, false);<br>}</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>The relevant data structure is:<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>typedef struct mw_nfdc_cmd {<br>  int32_t mgr;<br>  int32_t verb;<br>  int32_t ret;<br>  size_t retval;<br>  bool netName;<br>  std::shared_ptr<ndn::Interest> interest;<br>  std::shared_ptr<ndn::nfd::ControlParameters> parameters;<br>} mw_nfdc, *mw_nfdc_ptr;</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Effectively, you are sending the memory representation of </span><span lang=EN-US style='font-family:"Courier New"'>std::shared_ptr<ndn::nfd::ControlParameters></span><span lang=EN-US> instance over a UDP socket. I think this can cause undefined behavior.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>I wonder why you chose to send the management command as a UDP packet to the worker thread, instead of sending an encoded command via a pair of message queues?<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Also, many unit tests are failing. Please check them.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>You should use AddressSanitizer to ensure there's no memory leak and undefined behavior.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Yours, Junxiao<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div><p class=MsoNormal><span lang=EN-US>On Fri, Feb 19, 2021 at 7:03 AM Sung Hyuk Byun via Nfd-dev <<a href="mailto:nfd-dev@lists.cs.ucla.edu" target="_blank">nfd-dev@lists.cs.ucla.edu</a>> wrote:<o:p></o:p></span></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>Deal all<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>We are pleased to announce the Multi-Worker NFD (MW-NFD) 0.7.1 which is an high-speed NDN forwarder fully compatible with NFD 0.7.1, and it can be downloaded from <a href="https://github.com/etri/mw-nfd" target="_blank">https://github.com/etri/mw-nfd</a>. <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>MW-NFD has parallel forwarding worker who keeps NFD's forwarding architecture, and can have multiple input threads dedicated to each physical port.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>We had demonstrated MW-NFD's forwarding performance in ACM ICN 2020 with the paper "MW-NFD (Multi-Worker NFD): An NFD-compatible High-speed NDN Forwarder" ( <a href="https://dl.acm.org/doi/10.1145/3405656.3420233" target="_blank">https://dl.acm.org/doi/10.1145/3405656.3420233</a> ) <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>MW-NFD support all management features with nfdc command, and all face types of NFD, except NDN-LP Reliability option in point-to-point faces, which will be supported in future release. <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>It also has additional forwarding enhancement features : dual_cs and pit-token-hash.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>More information can be found at <a href="https://github.com/etri/mw-nfd/blob/main/MW-NFD-CONFIG.md" target="_blank">https://github.com/etri/mw-nfd/blob/main/MW-NFD-CONFIG.md</a> .<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>If you have any questions, comments, or bug reports, please let us know through email or this mailing list. <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>Regards, <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>Sung Hyuk Byun <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US><a href="mailto:shbyun@etri.re.kr" target="_blank">shbyun@etri.re.kr</a> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US><o:p> </o:p></span></p></div></div></blockquote></div></div></div></body></html>