Bugzilla – Bug 287
Simple device/channel call stack issue
Last modified: 2008-08-15 11:40:56 EDT
The SimpleChannel and SimpleNetDevice are forwarding devices such that SimpleNetDevice::Send calls SimpleChannel::Send, which calls SimpleNetDevice::Receive on the other end. This means that the call stack resulting from invoking a Scheduler event can contain all the calls down the network stack AND all the upcalls up the network stack on the other side. So potentially, packets can be received at the other node before the state on the sender side has been fully updated to reflect having sent the data. E.g. in the case of TCP, the ACK comes back before the call to Socket::Send completes, wreaking havoc. There is a potential stack overflow issue as well if both sides send data back in response. It seems to make sense to break this call stack issue at the line between the Channel::Send and the NetDevice::Receive on the other end. The NetDevice::Receive could be scheduled with Simulator::ScheduleNow(...) so that it logically occurs at the "now" time, but allows the call stack to unravel up to the next Scheduler event.
Created attachment 229 [details] ScheduleNow instead of calling up the rx side Is it just this easy? Anyone opposed to pushing this?
(In reply to comment #1) > Created an attachment (id=229) [details] > ScheduleNow instead of calling up the rx side > > Is it just this easy? Anyone opposed to pushing this? looks good to me.
fixed 3534:e170f2c17e03