<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>Are you sure that you have anything in queue?  Do you have bursts or traffic/are you links fully saturated all the time?</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Dec 5, 2013, at 3:44 PM, Amin Karami <<a href="mailto:amin@ac.upc.edu">amin@ac.upc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Yes, I used this code:<br>
      <br>
        //  get current queue size<br>
        uint32_t k;<br>
        Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();<br>
        Ptr<Channel> CH1 = node->GetDevice(2)->GetChannel();<br>
        Ptr<NetDevice> toDev = CH1->GetDevice (1);<br>
        PointerValue txQueue;<br>
        toDev->GetAttribute ("TxQueue", txQueue);<br>
        k = txQueue.Get<DropTailQueue> ()->GetNPackets();<br>
      <br>
      <br>
      When i print "k", it is zero. Is there any wrong in my code? If my
      code is true, i may call wrong GetDevice number!<br>
      <br>
      /Amin<br>
      <br>
      <br>
      On 12/06/2013 12:17 ق.ظ, Ilya Moiseenko wrote:<br>
    </div>
    <blockquote cite="mid:832B3DCA-2CA5-4E1F-9B59-784F0A9A4DC4@ucla.edu" type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      The parent class Queue has a method “GetNPackets”
      <div><a moz-do-not-send="true" href="http://www.nsnam.org/docs/release/3.18/doxygen/classns3_1_1_queue.html#a50dcb693d5325708d8c90770f795eabc">http://www.nsnam.org/docs/release/3.18/doxygen/classns3_1_1_queue.html#a50dcb693d5325708d8c90770f795eabc</a></div>
      <div><br>
      </div>
      <div>Ilya</div>
      <div><br>
        <div>
          <div>On Dec 5, 2013, at 3:10 PM, Amin Karami <<a moz-do-not-send="true" href="mailto:amin@ac.upc.edu">amin@ac.upc.edu</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
            <div bgcolor="#FFFFFF" text="#000000">
              <div class="moz-cite-prefix">Hi llya!<br>
                I want to print the number of filled elements in queue
                in an interface in a specific time, not original
                (predefined) size of the queue. I think, i posted wrong
                title for my question :-)<br>
                I could not find related attribute in your suggested
                link. I found these attributes: <b style="font-family:
                  'Lucida Grande', Verdana, Geneva, Arial, sans-serif;
                  font-size: 12px; font-style: normal; font-variant:
                  normal; letter-spacing: normal; line-height: 15px;
                  orphans: auto; text-align: left; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);">Mode, </b><b style="font-family: 'Lucida Grande', Verdana, Geneva,
                  Arial, sans-serif; font-size: 12px; font-style:
                  normal; font-variant: normal; letter-spacing: normal;
                  line-height: 15px; orphans: auto; text-align: left;
                  text-indent: 0px; text-transform: none; white-space:
                  normal; widows: auto; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; background-color:
                  rgb(255, 255, 255);">MaxPackets, </b><b style="font-family: 'Lucida Grande', Verdana, Geneva,
                  Arial, sans-serif; font-size: 12px; font-style:
                  normal; font-variant: normal; letter-spacing: normal;
                  line-height: 15px; orphans: auto; text-align: left;
                  text-indent: 0px; text-transform: none; white-space:
                  normal; widows: auto; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; background-color:
                  rgb(255, 255, 255);">MaxBytes</b><br>
                <br>
                Is there any suggestion?<br>
                <br>
                <br>
                Thank you in advance.<br>
                <br>
                /Amin<br>
                <br>
                On 12/05/2013 07:59 ب.ظ, Ilya Moiseenko wrote:<br>
              </div>
              <blockquote cite="mid:47A853E0-017A-4981-8E20-B04905415746@ucla.edu" type="cite">
                <pre wrap="">Hi Amin

1) m_maxPackets is indeed private.
However, you can access this value by attribute named “MaxPackets"
See <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.nsnam.org/docs/release/3.18/doxygen/classns3_1_1_drop_tail_queue.html">http://www.nsnam.org/docs/release/3.18/doxygen/classns3_1_1_drop_tail_queue.html</a> for details

2) Technically you can do this in NS3. And in real life routers can have different queue sizes. 


Ilya

On Dec 4, 2013, at 2:35 AM, Amin Karami <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:amin@ac.upc.edu"><amin@ac.upc.edu></a> wrote:

</pre>
                <blockquote type="cite">
                  <pre wrap="">Hi Alex,
I am going to print Queue length in a specific interface of a router. I wrote below function:

void PeriodicStatsPrinter (Ptr<Node> node, Time next)
Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();
Ptr<Channel> CH = node->GetDevice(2)->GetChannel(); \\ 2nd interface of the node
Ptr<NetDevice> toDev = CH->GetDevice (1); \\ access to its queue
PointerValue txQueue;
toDev->GetAttribute ("TxQueue", txQueue);
std::cout << Simulator::Now ().ToDouble (Time::S) << "\t"
<< Names::FindName (node) << "\t"
<< "Max Packets of Queue: " << txQueue.Get<DropTailQueue> ()->m_maxPackets << "\n";

1- But, i faced with this error:
../scratch/RTT/<a moz-do-not-send="true" href="http://rtt.cc/">RTT.cc</a>: In function ‘void PeriodicStatsPrinter(ns3::Ptr<ns3::Node>, ns3::Time)’:
../scratch/RTT/<a moz-do-not-send="true" href="http://rtt.cc/">RTT.cc</a>:44:6: error: expected primary-expression before ‘<<’ token
./ns3/drop-tail-queue.h:68:12: error: ‘uint32_t ns3::DropTailQueue::m_maxPackets’ is private
../scratch/RTT/<a moz-do-not-send="true" href="http://rtt.cc/">RTT.cc</a>:44:58: error: within this context

2- Could i define two Queue lengths for a specific interface in routers? from inside and outside of a link. Or both should be equal?


/Amin
_______________________________________________
ndnSIM mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a>
</pre>
                </blockquote>
              </blockquote>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
  </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></div></body></html>