Bug 1006 - UDP socket tx buffer back pressure needed
UDP socket tx buffer back pressure needed
Status: ASSIGNED
Product: ns-3
Classification: Unclassified
Component: internet
pre-release
All All
: P3 enhancement
Assigned To: Adrian S.-W. Tam
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-13 17:43 EDT by Josh Pelkey
Modified: 2011-12-13 04:11 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Pelkey 2010-10-13 17:43:08 EDT
Please see this post from Mathieu (and follow-ups), which I will cut/paste a snippet from below:
http://mailman.isi.edu/pipermail/ns-developers/2010-March/007607.html

*** 

The problem
--------------

Both Packet and Udp sockets suffer from similar problems in ns-3: if
your application generates a lot of traffic without its own congestion
control, all of the packets generated will be dropped by the egress
NetDevice when its tx queue becomes full and the application has no way
of knowing when this happens. I would like to fix this (mostly because
the datagram sockets in ns-3-simu need this information to block the udp
traffic generation applications).

***

This is somewhat related to bug 141, which could easily be marked WONTFIX now but should definitely be closed when this bug is addressed.
Comment 1 Adrian S.-W. Tam 2011-12-12 23:00:21 EST
I did exactly the same thing in a previous research project (modification was done in ns-3.4). The current ns-3 model is a "non-blocking" socket, which the send call will succeed anyway. But I think many real-world application expects a blocking socket, which does not return the call until the lower layer can really take the data.

Doing this will add a boolean m_blocking variable to ns3::Socket, so when m_blocking==false, the current code is run, but when m_blocking==true, we need to return immediately doing nothing for the Send call and invoke a callback when the socket becomes available again.

Let me take up this as an enhancement, but since it is near code freeze time, I will wait until the release to commit the code.
Comment 2 Tommaso Pecorella 2011-12-13 04:11:59 EST
I fear that the solution is not that simple.

In a non-blocking system the time do advance between pre-tx and post-tx, as the tx is blocking. It implies that there is a time lapse *inside* the calling function.

In an event-driven simulation this implies that the application's Tx function is sort-of split in two:
1) pre-tx-call, executed at the intended time, and
2) post-tx-call, executed when the lower layer is "ready to accept data". basically a callback.

Adding a status in the Socket is the basis, but we need to handle the time-lapse as well, or any time-related feature will be screwed.

Example: an app sending a packet 10ms **after** the previous one has been sent. With blocking send the packets will be not isochronous, and that's what we'd like. If we don't handle the point above, they'll be still isochronous.

Mind, I'm totally up to support this feature, I'm just pointing out that it's not that simple to support it.

Tommaso