From 26f53b8cee427f91dd228d8c4c21eced72856fa5 Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Fri, 22 Mar 2024 13:38:59 +0100 Subject: [PATCH] showcases: added 'Webserver Emulation Showcase' --- showcases/emulation/index.rst | 1 + showcases/emulation/webserver/doc/index.rst | 76 +++++++++++++++++++++ showcases/emulation/webserver/doc/media | 1 + showcases/emulation/webserver/omnetpp.ini | 2 +- 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 showcases/emulation/webserver/doc/index.rst create mode 120000 showcases/emulation/webserver/doc/media diff --git a/showcases/emulation/index.rst b/showcases/emulation/index.rst index 1c72f5d8793..075485b94f5 100644 --- a/showcases/emulation/index.rst +++ b/showcases/emulation/index.rst @@ -6,6 +6,7 @@ The following showcases demonstrate INET's emulation support: .. toctree:: :maxdepth: 1 + webserver/doc/index babel/doc/index voip/doc/index voip/doc/mininet diff --git a/showcases/emulation/webserver/doc/index.rst b/showcases/emulation/webserver/doc/index.rst new file mode 100644 index 00000000000..d31389eea98 --- /dev/null +++ b/showcases/emulation/webserver/doc/index.rst @@ -0,0 +1,76 @@ +Webserver Emulation Showcase +============================ + +Goals +----- + +The goal of this showcase is to demonstrate the integration and operation of a +real-world application within an OMNeT++/INET simulation environment. +Specifically, it involves running a Python-based webserver and executing several +wget commands from host operating system environments. These are interfaced with +simulated network components, illustrating the capabilities of OMNeT++ in hybrid +simulations that involve both emulated and simulated network elements. + +| INET version: ``4.6`` +| Source files location: `inet/showcases/emulation/webserver `__ + + +The Model +--------- + +The showcase uses the following network: + +.. figure:: media/Network.png + +Here is the NED definition of the network: + +.. literalinclude:: ../WebserverShowcase.ned + :start-at: WebserverShowcase + :language: ned + +This network consists of a server connected to an Ethernet switch, along with a +configurable number of clients also connected to the switch. The server will run +a real Python webserver, and the clients will perform HTTP GET requests using +wget. + + +Configuration +------------- + +The behavior of the model is controlled by the following INI file configuration: + +.. literalinclude:: ../omnetpp.ini + :language: ini + +This configuration sets up the real-time scheduler to synchronize the simulation +time with the wall clock time, allowing interaction between the simulated model +and real applications. It also specifies the number of clients in the simulation +and various other network settings. + + +Results +------- + +Upon running the simulation, the webserver on the host OS will respond to HTTP +GET requests initiated by the wget commands from the simulated clients. The +interaction can be observed in the simulation's event log, and network +performance metrics such as response time and throughput can be analyzed based +on the simulation results. + +The following terminal screenshot shows the running webserver and wget processes: + +.. figure:: media/ps.png + +The output of the processes appears in the Qtenv log window. Here is the output of one of the wget commands: + +.. figure:: media/wget_module_log.png + +Sources: :download:`omnetpp.ini <../omnetpp.ini>`, +:download:`WebserverShowcase.ned <../WebserverShowcase.ned>`, + +Discussion +---------- + +Use `this +page `__ in +the GitHub issue tracker for commenting on this showcase. \ No newline at end of file diff --git a/showcases/emulation/webserver/doc/media b/showcases/emulation/webserver/doc/media new file mode 120000 index 00000000000..08e6cd5e97b --- /dev/null +++ b/showcases/emulation/webserver/doc/media @@ -0,0 +1 @@ +../../../../media/showcases/emulation/webserver/doc/ \ No newline at end of file diff --git a/showcases/emulation/webserver/omnetpp.ini b/showcases/emulation/webserver/omnetpp.ini index 7f5a9c11ead..8d7728b81ab 100644 --- a/showcases/emulation/webserver/omnetpp.ini +++ b/showcases/emulation/webserver/omnetpp.ini @@ -73,5 +73,5 @@ unshare-user-namespace = true *.client[*].app[0].process.command = "wget -o /dev/stdout http://192.168.0.1:8080/WebserverShowcase.ned" *.client[*].app[0].process.startTime = 0.5s *.client[*].app[0].process.onExit = "relaunch" -*.client[*].app[0].process.relaunchDelay = 1s +*.client[*].app[0].process.relaunchDelay = 0.1s *.client[*].app[0].process.printStdout = true