-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containernet.addDockerHost hang at buffered read #12
Comments
Thanks for the report on this issue. I haven't encountered this issue before and will need some time to delve into it. Once I figure out the possible problem (blocking) in the |
Thank you for the swift response. I have been doing some testing on my own too, and running some other blocking process instead of net.addDockerHost(
"srsepc",
dcmd="bash",
dimage="srsran",
docker_args={
"devices": ["/dev/net/tun"],
"cap_add": ["SYS_NICE", "NET_ADMIN"]
},
) The
|
Sorry that I can't easily reproduce this blocking with e.g. ping command (use a infinite ping command in |
Yeah that could make sense actually. As for the Dockerfile, the whole repo is hosted at comnetsemu-srsran. You can use the make.sh script to build everything |
I think I may be onto something. Now this is quite the problem. Is it possible to initialize interfaces for a As a sidenote, I see you've been quite busy fixing things here and there (especially the tooling, which I was gonna open a pull request for, at some point), nice job and congrats for v0.3.0! |
Aha! Makes sense! Thanks for the explanation. When net = Containernet(controller=Controller, link=TCLink)
# Do not give special dcmd or use "bash" to just let the Docker container start without running the actual application
core = net.addDockerHost("5gc", dimage="my_fancy_5g_core", ip="192.168.0.111/24")
s1 = net.addSwitch("s1")
net.addLink(core, s1, bw=1000, delay="1ms", intfName1="core1-s1", intfName2="s1-core1")
# Start the network, now interfaces will be created and available for processes running on the core container
net.start()
# Now use the cmd() method to execute the actual program, so it will bind the available interfaces, blabla
ret = core.cmd("./start_my_fancy_5g_core.sh")
if not ret:
raise RuntimeError("Error! Blabla") So the DockerHost is currently not a application container, but rather a system container like LXC. Because a Host node in Mininet is to emulate a physical machine in real world. Then currently ComNetsEmu has an another type called I agree that this may not be the best and elegant approach. But emulation of a nested virtual environment on a single laptop was an open question for me, so I decided to use this Docker-in-Docker design to avoid using nested VM approach (e.g. running KVM inside Virtualbox).
Based on my explanation above. Would you think the "workaround" for starting the srsEPC after calling
Thanks so much! Sorry for the delayed reply. My PhD contract ends this month and I'm busy writing my PhD thesis recently 🙈 . I was in a hurry in 2019 to meet the deadline, so tooling and some code were a little bit messy... I try to cleanup them before the end of my PhD journey. If you have any good ideas and feature suggestions, feel free to open issues. Have a nice day. |
Good idea, it was the first thing I tried to implement but now some other problems popped up (although now the programs succesfully bind to the right IPs/interfaces). Since calling
The logs also go on with these lines, one after the other:
Why are the containers being killed? It looks like they're being treated as if they're hanging or something, but they're working as intended. Is I guess I'll try the docker-in-docker/ |
Did you run run the |
You're right, thanks for the heads up! Now the containers all start happily. However, yet another problem popped up, one of the containers cannot bind to one of its IPs, might as well ask here even though it's kinda off topic. I need to have a container with two separate IPs:
The container fails to bind to the first IP with a connection timeout. I'm pretty sure this is an issue with hardcoding link IPs with Hastily made network diagram:
And the connections for
|
Congrats that all containers are working without blocking. Unfortunately, Mininet's API is not designed for the scenario when the node has multiple network interfaces... So I normally use "hard-coding" workaround currently:
I have not implemented an API or mechanism for better management of multiple interfaces (for clearer management and dataplane traffic separation) for DockerHost and AppContainer yet. Maybe it's a nice TODO for the 0.4.0 🙈 |
Thank you for the workaround, I almost got it to work (!) but then I just gave up and rewrote the whole network topology. Now both RF data and standard network traffic go through a single switch and everything works! Turns out hardcoding IPs is fine as long as the host has a single IP and it's defined in the |
Thanks for the feedback! I'm very happy that everything works. Yes, currently By the way, just in case you have time some when, could you add some bullet points (very brief description is just OK) about "Nice to have" features or improvements of ComNetsEmu? This helps me a lot 😉 Have a nice day 🎉 |
I'm creating a Docker host with the following code (a small excerpt from the whole topology):
The code hangs indefinitely at
addDockerHost
, when sending aSIGINT
the stacktrace is as follows:Click to expand (stacktrace)
Using
setLogLevel("debug")
, the logs stop with these last lines:Click to expand (full debug logs)
I tried replicating the topology in docker-compose and everything works (only relevant lines):
And running the single Docker CLI command in the same way comnetsemu does still works fine, with
docker exec
not hanging and successfully attaching to the running container.Notes:
apt
)The text was updated successfully, but these errors were encountered: