Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LinuxStackHelper delays sysctl.set calls until 100ms into simulation #101

Open
tomhenderson opened this issue Jan 31, 2020 · 1 comment
Open

Comments

@tomhenderson
Copy link
Collaborator

tomhenderson commented Jan 31, 2020

Description of the problem

I encountered a problem that my calls to LinuxStackHelper::SysctlSet() were not taking effect, and then I traced it to the fact that my TCP sockets were created after a few milliseconds into the simulation, while the stack helper is deferring its set until 100ms in. Below is a workaround but something cleaner (to execute around time 0) should be devised.

diff --git a/helper/linux-stack-helper.cc b/helper/linux-stack-helper.cc
index 18c0919..0af2707 100644
--- a/helper/linux-stack-helper.cc
+++ b/helper/linux-stack-helper.cc
@@ -186,7 +186,7 @@ LinuxStackHelper::SysctlSet (NodeContainer c, std::string path, std::string valu
                          "You may need to do it via DceManagerHelper::Install ()");
         }
       // i.e., TaskManager::Current() needs it.
-      Simulator::ScheduleWithContext (node->GetId (), Seconds (0.1),
+      Simulator::ScheduleWithContext (node->GetId (), MicroSeconds (1),
                                       MakeEvent (&LinuxSocketFdFactory::Set, sock,
                                                  path, value));
     }
@tomhenderson tomhenderson changed the title LinuxStackHelper delays sysctl.set calls until 500ms into simulation LinuxStackHelper delays sysctl.set calls until 100ms into simulation Jan 31, 2020
@teto
Copy link
Member

teto commented Jan 31, 2020

I remember having the same issue. I think the change might be good enough for now. I would merge the PR.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants