<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I tried the following scenario on a couple of platform (OSX, Linux Ubuntu, FreeBSD), getting exactly the same sequences of random variables.</div><div><br></div><div>Please note that you don't need to (and I would highly recommend to not use it) setting seed manually.  Rather, you just set Run parameter (e.g., using --RngRun command line argument), which should take care of initializing proper seeds to produce statistically different results.</div><div><pre style="color: rgb(0, 0, 32); "><span style="color: rgb(0, 74, 67);">#</span><span style="color: rgb(0, 74, 67);">include </span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(64, 1, 90);">ns3/core-module.h</span><span style="color: rgb(128, 0, 0);">"</span>

<span style="color: rgb(32, 0, 128); font-weight: bold;">using</span> <span style="color: rgb(32, 0, 128); font-weight: bold;">namespace</span> ns3<span style="color: rgb(64, 96, 128);">;</span>

<span style="color: rgb(32, 0, 128); font-weight: bold;">int</span> <span style="color: rgb(64, 0, 0);">main</span> <span style="color: rgb(48, 128, 128);">(</span><span style="color: rgb(32, 0, 128); font-weight: bold;">int</span> argc<span style="color: rgb(48, 128, 128);">,</span> <span style="color: rgb(32, 0, 128); font-weight: bold;">char</span> <span style="color: rgb(48, 128, 128);">*</span><span style="color: rgb(48, 128, 128);">*</span>argv<span style="color: rgb(48, 128, 128);">)</span>
<span style="color: rgb(64, 96, 128);">{</span>
  CommandLine cmd<span style="color: rgb(64, 96, 128);">;</span>
  cmd<span style="color: rgb(48, 128, 128);">.</span>Parse <span style="color: rgb(48, 128, 128);">(</span>argc<span style="color: rgb(48, 128, 128);">,</span> argv<span style="color: rgb(48, 128, 128);">)</span><span style="color: rgb(64, 96, 128);">;</span>

  UniformVariable rng <span style="color: rgb(48, 128, 128);">=</span> UniformVariable<span style="color: rgb(48, 128, 128);">(</span><span style="color: rgb(48, 128, 128);">)</span><span style="color: rgb(64, 96, 128);">;</span>

  <span style="color: rgb(32, 0, 128); font-weight: bold;">for</span> <span style="color: rgb(48, 128, 128);">(</span><span style="color: rgb(32, 0, 128); font-weight: bold;">int</span> i <span style="color: rgb(48, 128, 128);">=</span> <span style="color: rgb(0, 140, 0);">0</span><span style="color: rgb(64, 96, 128);">;</span> i <span style="color: rgb(48, 128, 128);"><</span> <span style="color: rgb(0, 140, 0);">80</span><span style="color: rgb(64, 96, 128);">;</span> i<span style="color: rgb(48, 128, 128);">+</span><span style="color: rgb(48, 128, 128);">+</span><span style="color: rgb(48, 128, 128);">)</span>
    <span style="color: rgb(64, 96, 128);">{</span>
      <span style="color: rgb(32, 0, 128); font-weight: bold;">int</span> j <span style="color: rgb(48, 128, 128);">=</span> rng<span style="color: rgb(48, 128, 128);">.</span>GetInteger<span style="color: rgb(48, 128, 128);">(</span><span style="color: rgb(0, 140, 0);">0</span><span style="color: rgb(48, 128, 128);">,</span> <span style="color: rgb(0, 140, 0);">10000</span><span style="color: rgb(48, 128, 128);">)</span><span style="color: rgb(64, 96, 128);">;</span> <span style="color: rgb(89, 89, 121);">//[0, totnodes-1]</span>
      <span style="color: rgb(0, 102, 238);">std</span><span style="color: rgb(64, 96, 128);">::</span><span style="color: rgb(0, 48, 96);">cout</span> <span style="color: rgb(48, 128, 128);"><</span><span style="color: rgb(48, 128, 128);"><</span> j <span style="color: rgb(48, 128, 128);"><</span><span style="color: rgb(48, 128, 128);"><</span> <span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(16, 96, 182);"> </span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(64, 96, 128);">;</span>
    <span style="color: rgb(64, 96, 128);">}</span>
  <span style="color: rgb(0, 102, 238);">std</span><span style="color: rgb(64, 96, 128);">::</span><span style="color: rgb(0, 48, 96);">cout</span> <span style="color: rgb(48, 128, 128);"><</span><span style="color: rgb(48, 128, 128);"><</span> <span style="color: rgb(0, 102, 238);">std</span><span style="color: rgb(64, 96, 128);">::</span>endl<span style="color: rgb(64, 96, 128);">;</span>
<span style="color: rgb(64, 96, 128);">}</span></pre><div>I saved this code into scratch/test.cc, run it, and got following results:</div></div><div><br></div><div><div>[cawka@pistons ns-3 (ndnSIM)]$ for i in 1 2 3 4 5 6 7 8 9 10; do ./waf --run "test --RngRun=$i"; done</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.157s)</div><div>8166 6069 4956 3816 3691 8066 1008 5848 9391 6261 8220 5593 2457 8367 199 8387 9440 8354 617 5144 2215 3409 3763 3649 9586 4880 3519 3031 9221 7007 4731 3000 4601 1127 7602 47 5801 7522 5891 5209 1736 3425 8731 1568 3718 3795 7177 2675 6579 2865 5415 3707 5817 4688 1609 1246 8150 6344 4088 6243 5294 600 763 4677 5512 7143 9628 2485 1847 9964 7226 8578 7545 9183 5713 5198 6435 9111 4051 2675</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.148s)</div><div>6836 8126 6338 1457 4522 9102 8629 1901 6583 7050 8165 5193 6360 1606 6991 1493 2432 6110 8139 385 6567 6950 5474 8799 2557 1641 4976 6722 8343 8748 945 1360 7982 2278 792 9658 5460 8282 3015 705 2489 6197 5304 6084 741 3509 486 9977 3126 92 8881 9976 6669 5062 2970 6478 996 1079 4607 3506 2010 6872 5250 5818 6999 9061 2883 3599 8191 6183 389 2872 7 8334 8062 1185 8966 3747 2843 4720</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.149s)</div><div>7754 9677 8897 8782 2536 6827 184 9025 9117 3114 4018 807 6157 3916 6165 7242 5752 2978 1976 6881 2728 825 4978 449 8038 1586 8321 1450 3539 2518 4202 3821 8324 3316 6982 5512 7140 7936 5000 65 6720 3300 1111 1652 3912 334 5360 9679 5620 1737 8375 6948 6505 902 4164 4602 6266 7707 3196 7860 912 8028 4526 150 7724 1387 4690 3128 9344 8088 906 8713 2241 1284 7278 792 3854 9230 4738 4058</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.148s)</div><div>4812 1701 7360 7202 9972 7867 5035 6534 4766 63 4228 8649 7604 1282 3240 9539 1144 535 8625 8984 8058 6740 7778 3838 9918 388 3301 8898 3612 2354 3577 7935 615 8127 9955 9007 5499 6295 4635 716 4637 6180 4551 2043 3237 177 5538 6605 6331 2212 8716 5137 4375 1596 630 2598 3502 2706 7814 8111 9549 5638 4812 5219 640 8738 8108 5767 6887 689 3700 6985 3184 9221 9729 1536 6384 1688 2444 625</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.154s)</div><div>219 9515 1401 5270 5898 5489 7782 3923 3359 123 4529 9802 1346 1266 9154 9863 967 6289 9752 9162 1888 5686 3424 4143 9870 1242 6474 2198 6062 800 9982 5425 7258 7556 8475 4276 200 7074 6852 1149 8491 4963 9586 8346 7666 8139 3834 2416 7433 8554 8287 5808 8729 7414 6836 6723 7314 9410 1786 868 5152 7410 7398 2536 3339 4053 9412 2015 2175 7734 961 4048 615 7455 6203 8590 26 3763 6203 7995</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.148s)</div><div>8283 2702 6861 2181 7208 725 1478 2561 5361 1397 1783 4394 8875 9200 628 9893 724 9267 3058 3537 1715 9245 6824 771 8225 5378 1894 6306 6007 7457 4930 3410 699 4253 9170 426 1743 8761 7310 1278 4424 87 7358 7550 9819 4127 3552 7709 40 8366 2237 1582 9702 2688 1664 7997 7265 9600 4445 8765 8613 734 7356 4142 4498 6991 2072 5396 9457 6417 6131 8349 2086 3810 4421 2144 7779 3448 8575 5342</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.148s)</div><div>3282 2327 5280 743 978 6156 5143 3702 542 8938 7255 4051 1846 4040 453 67 6332 3241 8418 3983 277 6150 7040 1599 4082 9066 1545 8279 8111 20 8988 6899 6949 6234 8634 2115 3680 6894 8448 7625 9395 5924 1927 1781 9331 5156 3375 1848 333 598 1438 6814 9232 7275 8674 105 900 3919 5914 6809 9725 4668 7135 1183 9414 1689 7224 8710 4513 802 5440 3675 94 8849 2910 4748 4696 825 6379 1280</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.147s)</div><div>1755 3495 8686 5045 9265 59 71 5920 1365 6983 5992 8990 8494 1427 5696 5178 8805 8272 4827 7965 68 6687 6511 9864 2625 6090 842 1256 6032 7217 4272 6389 2089 7499 574 5018 72 7781 233 9008 4796 8529 7786 4001 6709 2648 4927 2409 7890 1057 4921 7292 8082 9470 7730 2201 3431 5738 9730 8219 4796 4845 2860 3937 6259 5255 124 7410 6194 8214 6563 4152 63 236 884 2191 4516 1412 5884 7052</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.158s)</div><div>9494 3021 8744 5436 8835 170 9883 1765 8187 2564 7727 6168 891 6451 7727 4001 7312 911 2621 5720 6113 4053 1735 2187 3582 6082 3156 1521 7042 3971 1716 909 7041 2953 3806 7903 1536 1068 986 2583 7439 2977 3074 4226 5816 7419 5391 1047 3880 3491 1796 2333 1396 6107 8951 7582 3771 3318 2118 3378 3472 1404 913 7920 5101 2410 6406 6048 3376 2743 9428 9021 7551 7256 9172 6283 6464 3548 8861 8190</div><div>Waf: Entering directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>Waf: Leaving directory `/export/data/cawka/ndnSIM/ns-3/build'</div><div>'build' finished successfully (1.155s)</div><div>3200 5221 5686 4691 5942 746 9130 4307 5063 1495 9208 8163 8515 8128 5770 4358 6549 4527 6249 1418 3737 7933 8995 7456 7621 5809 2122 5098 4127 4419 7502 2221 9731 8782 7024 8321 549 6686 3355 8392 7511 5699 3722 2258 5022 3904 3701 5681 5660 556 2908 6966 710 1521 2462 6115 3770 5139 790 5291 9082 5028 2811 9959 2456 2767 5814 1735 9248 774 156 5760 8877 5197 4355 9554 4244 8469 4443 3765</div></div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Jul 2, 2013, at 9:10 AM, Xiaoke Jiang <<a href="mailto:shock.jiang@gmail.com">shock.jiang@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
                <div style="font-family: Helvetica; font-size: 13px; ">Yes, I mean RngRun parameter.<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 97, 65); "><span style="">    </span>UniformVariable<span style=""> rng = </span>UniformVariable<span style="">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">    <span style="color: #006141">SeedManager</span>::SetSeed (seed);</div><p style="margin: 0px; font-size: 11px; font-family: Monaco; "></p><div style="margin: 0px; "><span style="color: #931a68">    int</span> j = rng.GetInteger(0, gwN-1); <span style="color: #4e9072">//[0, </span><span style="text-decoration: underline ; color: #4e9072">totnodes</span><span style="color: #4e9072">-1]</span></div><div><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">Only random number here.</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div></div></div>
                <div><div><br></div><div style="font-family: Futura; font-size: 13px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="'comic sans ms', sans-serif">thanks</font><br><br><font face="garamond, serif"><font size="4">My Regards,</font><br></font></div><hr align="left" size="1" style="color: rgb(34, 34, 34); font-size: small; font-family: arial; width: 210px; min-height: 1px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="garamond, serif"><div><span style="font-size: 10.5pt; ">Xiaoke (Shock) Jiang (蒋小可)</span></div><div><span style="font-size: 10.5pt; "><br></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Ph.D. Candidate,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Department of Computer Science and Technology,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Tsinghua University, Beijing, P.R.China. 100084</font></span></div></font></div></div></div><p style="color: #A0A0A8;">On Tuesday, July 2, 2013 at 11:16 PM, Alex Afanasyev wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div>Technically, you should be getting the same sequence of random values in NS-3... Just a couple of questions, by "same random seed" do you mean RngRun parameter?  Do you use only NS-3 provided random variables or rely also on system's rand (system's rand may give different results on different platforms)?</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Jul 1, 2013, at 10:02 PM, Xiaoke Jiang <<a href="mailto:shock.jiang@gmail.com">shock.jiang@gmail.com</a>> wrote:</div><br><blockquote type="cite">
                <div style="font-family: Helvetica; font-size: 13px; ">The server is ubuntu with AMD CPU. But I set the same seed in the script.<br></div>
                <div><div><br></div><div style="font-family: Futura; font-size: 13px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="'comic sans ms', sans-serif">thanks</font><br><br><font face="garamond, serif"><font size="4">My Regards,</font><br></font></div><hr align="left" size="1" style="color: rgb(34, 34, 34); font-size: small; font-family: arial; width: 210px; min-height: 1px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="garamond, serif"><div><span style="font-size: 10.5pt; ">Xiaoke (Shock) Jiang (蒋小可)</span></div><div><span style="font-size: 10.5pt; "><br></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Ph.D. Candidate,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Department of Computer Science and Technology,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Tsinghua University, Beijing, P.R.China. 100084</font></span></div></font></div></div></div><p style="color: #A0A0A8;">On Tuesday, July 2, 2013 at 12:59 PM, Cesar Ghali wrote:</p><blockquote type="cite">
                    <span><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div>More details would be helpful, but I think it can be normal especially if powerful server has a different platform than the Mac OS. The random numbers generators could be implemented differently on both platforms.</div><div><br></div><div>Cesar</div><div><br></div><br><div><div>On Jul 1, 2013, at 9:50 PM, Xiaoke Jiang <<a href="mailto:shock.jiang@gmail.com">shock.jiang@gmail.com</a>> wrote:</div><br><blockquote type="cite">
                <div>Dear All,</div><div><span style="white-space:pre">       </span>I have written a script and set the same random seed. But I run the script on different machine, one is mac os air, the other is a powerful server. And I get different results, Is it normal?</div>
                <div><div><br></div><div style="font-family: Futura; font-size: 13px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="'comic sans ms', sans-serif">thanks</font><br><br><font face="garamond, serif"><font size="4">My Regards,</font><br></font></div><hr align="left" size="1" style="color: rgb(34, 34, 34); font-size: small; font-family: arial; width: 210px; min-height: 1px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="garamond, serif"><div><span style="font-size: 10.5pt; ">Xiaoke (Shock) Jiang (蒋小可)</span></div><div><span style="font-size: 10.5pt; "><br></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Ph.D. Candidate,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Department of Computer Science and Technology,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Tsinghua University, Beijing, P.R.China. 100084</font></span></div></font></div></div></div>
            _______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br></blockquote></div><br></div><div><div>_______________________________________________</div><div>ndnSIM mailing list</div><div><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a></div><div><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div></div></span>
                  
                  
                  
                  
                </blockquote><div>
                    <br>
                </div>
            _______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br></blockquote></div><br></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>
            _______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></body></html>