Browse Source

Added brief part about the network statecharts

Yentl Van Tendeloo 5 years ago
parent
commit
3973c30113

BIN
doc/_build/doctrees/communication_models.doctree


BIN
doc/_build/doctrees/index.doctree


BIN
doc/_build/doctrees/models.doctree


+ 46 - 0
doc/_build/html/_sources/communication_models.txt

@@ -0,0 +1,46 @@
+Communication models
+====================
+
+The network communication in the Modelverse builds on top of the raw socket implementation of Python.
+Whereas we use normal HTTP requests, we explicitly opted not to use these libraries.
+Many of these libraries hide important implementation details, such as how successive requests are handled (sequential, threaded, ...), whether or not to keep connections open and reuse them, which HTTP version to implement, and so on.
+As the HTTP protocol is a simple protocol, we reimplemented it completely in SCCD (StateCharts and Class Diagrams).
+
+There are two network components: a server in the MvS, and a server and client in the MvK.
+
+MvS server
+----------
+
+.. image:: img/mvs_server.svg
+
+The MvS server mainly just waits for incoming HTTP requests and presents the message to the MvS interface itself.
+Each part of the processing happens in a seperate orthogonal component, but in all cases, processing happens sequentially, and buffers are implemented in between each layer.
+This way, we can be certain that invocations on the MvS will always happen sequentially.
+
+The statechart consists of two parts.
+
+The topmost part is the HTTP server itself, which waits from messages from the sockets.
+When it starts up, a socket is created that listens to incoming connections.
+Messages from the socket are then processed.
+Apart from setting up the sockets, this component serializes all requests that get sent to the MvS: events are placed in a queue, and are only executed on the MvS when it has finished processing the previous request.
+
+The bottommost part is the socket server, which wraps around the socket and keeps fetching from the socket until it gets a complete HTTP request.
+The HTTP request is then split from the other data on the socket, and forwarded as a single request to the HTTP server.
+We explicitly need to check and split HTTP requests, as our protocol allows users to bundle multiple HTTP requests simultaneously.
+These requests will just come one after the other, so the socket buffer might contain two messages at the same time, or even fragments of a second request.
+A message is forwarded as soon as it is completely reconstructed.
+
+MvK server
+----------
+
+.. image:: img/mvk_server.svg
+
+.. note::
+    This figure shows the intended model, not the optimized model.
+    For performance reasons, many of these parts are merged together in the *run_local_modelverse.py* script.
+    As a result, it only implements the *MvKController*, *Server*, and *Socket* classes.
+    A more elaborate statechart implementation also exists, which does implements this whole figure.
+
+The MvK server again has a HTTP server, similar to the one of the MvS, but also has a HTTP client.
+
+Apart from this, there is also a 

+ 1 - 1
doc/_build/html/_sources/index.txt

@@ -20,4 +20,4 @@ Contents:
    Advanced examples <advanced>
    Common problems and solutions <problems>
    Internal workings <internal>
-   Models <models>
+   Network communication models <communication_models>

+ 3 - 9
doc/_build/html/_sources/models.txt

@@ -1,11 +1,5 @@
-Models
-======
-
-Practically every part of the Modelverse is modelled one way or the other.
-We briefly touch upon the different aspects and how they are modelled.
-
 Network interface
------------------
+=================
 
 The network communication in the Modelverse builds on top of the raw socket implementation of Python.
 Whereas we use normal HTTP requests, we explicitly opted not to use these libraries.
@@ -16,11 +10,11 @@ There are two network components: a server in the MvS, and a server and client i
 These are discussed next.
 
 MvS server
-^^^^^^^^^^
+----------
 
 .. image:: img/mvs_server.svg
 
 MvK server
-^^^^^^^^^^
+----------
 
 .. image:: img/mvk_server.svg

+ 141 - 0
doc/_build/html/communication_models.html

@@ -0,0 +1,141 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Communication models &#8212; Modelverse 0.4.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '0.4.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <link rel="top" title="Modelverse 0.4.0 documentation" href="index.html" />
+    <link rel="prev" title="Internal workings" href="internal.html" /> 
+  </head>
+  <body role="document">
+    <div class="related" role="navigation" aria-label="related navigation">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="internal.html" title="Internal workings"
+             accesskey="P">previous</a> |</li>
+        <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> &#187;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body" role="main">
+            
+  <div class="section" id="communication-models">
+<h1>Communication models<a class="headerlink" href="#communication-models" title="Permalink to this headline">¶</a></h1>
+<p>The network communication in the Modelverse builds on top of the raw socket implementation of Python.
+Whereas we use normal HTTP requests, we explicitly opted not to use these libraries.
+Many of these libraries hide important implementation details, such as how successive requests are handled (sequential, threaded, ...), whether or not to keep connections open and reuse them, which HTTP version to implement, and so on.
+As the HTTP protocol is a simple protocol, we reimplemented it completely in SCCD (StateCharts and Class Diagrams).</p>
+<p>There are two network components: a server in the MvS, and a server and client in the MvK.</p>
+<div class="section" id="mvs-server">
+<h2>MvS server<a class="headerlink" href="#mvs-server" title="Permalink to this headline">¶</a></h2>
+<img alt="_images/mvs_server.svg" src="_images/mvs_server.svg" /><p>The MvS server mainly just waits for incoming HTTP requests and presents the message to the MvS interface itself.
+Each part of the processing happens in a seperate orthogonal component, but in all cases, processing happens sequentially, and buffers are implemented in between each layer.
+This way, we can be certain that invocations on the MvS will always happen sequentially.</p>
+<p>The statechart consists of two parts.</p>
+<p>The topmost part is the HTTP server itself, which waits from messages from the sockets.
+When it starts up, a socket is created that listens to incoming connections.
+Messages from the socket are then processed.
+Apart from setting up the sockets, this component serializes all requests that get sent to the MvS: events are placed in a queue, and are only executed on the MvS when it has finished processing the previous request.</p>
+<p>The bottommost part is the socket server, which wraps around the socket and keeps fetching from the socket until it gets a complete HTTP request.
+The HTTP request is then split from the other data on the socket, and forwarded as a single request to the HTTP server.
+We explicitly need to check and split HTTP requests, as our protocol allows users to bundle multiple HTTP requests simultaneously.
+These requests will just come one after the other, so the socket buffer might contain two messages at the same time, or even fragments of a second request.
+A message is forwarded as soon as it is completely reconstructed.</p>
+</div>
+<div class="section" id="mvk-server">
+<h2>MvK server<a class="headerlink" href="#mvk-server" title="Permalink to this headline">¶</a></h2>
+<img alt="_images/mvk_server.svg" src="_images/mvk_server.svg" /><div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">This figure shows the intended model, not the optimized model.
+For performance reasons, many of these parts are merged together in the <em>run_local_modelverse.py</em> script.
+As a result, it only implements the <em>MvKController</em>, <em>Server</em>, and <em>Socket</em> classes.
+A more elaborate statechart implementation also exists, which does implements this whole figure.</p>
+</div>
+<p>The MvK server again has a HTTP server, similar to the one of the MvS, but also has a HTTP client.</p>
+<p>Apart from this, there is also a</p>
+</div>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+        <div class="sphinxsidebarwrapper">
+  <h3><a href="index.html">Table Of Contents</a></h3>
+  <ul>
+<li><a class="reference internal" href="#">Communication models</a><ul>
+<li><a class="reference internal" href="#mvs-server">MvS server</a></li>
+<li><a class="reference internal" href="#mvk-server">MvK server</a></li>
+</ul>
+</li>
+</ul>
+
+  <h4>Previous topic</h4>
+  <p class="topless"><a href="internal.html"
+                        title="previous chapter">Internal workings</a></p>
+  <div role="note" aria-label="source link">
+    <h3>This Page</h3>
+    <ul class="this-page-menu">
+      <li><a href="_sources/communication_models.txt"
+            rel="nofollow">Show Source</a></li>
+    </ul>
+   </div>
+<div id="searchbox" style="display: none" role="search">
+  <h3>Quick search</h3>
+    <form class="search" action="search.html" method="get">
+      <div><input type="text" name="q" /></div>
+      <div><input type="submit" value="Go" /></div>
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related" role="navigation" aria-label="related navigation">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="internal.html" title="Internal workings"
+             >previous</a> |</li>
+        <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> &#187;</li> 
+      </ul>
+    </div>
+    <div class="footer" role="contentinfo">
+        &#169; Copyright 2016, Yentl Van Tendeloo.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
+    </div>
+  </body>
+</html>

+ 3 - 2
doc/_build/html/index.html

@@ -111,8 +111,9 @@
 <li class="toctree-l2"><a class="reference internal" href="internal.html#adding-a-precompiled-function">Adding a precompiled function</a></li>
 </ul>
 </li>
-<li class="toctree-l1"><a class="reference internal" href="models.html">Models</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="models.html#network-interface">Network interface</a></li>
+<li class="toctree-l1"><a class="reference internal" href="communication_models.html">Network communication models</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="communication_models.html#mvs-server">MvS server</a></li>
+<li class="toctree-l2"><a class="reference internal" href="communication_models.html#mvk-server">MvK server</a></li>
 </ul>
 </li>
 </ul>

+ 6 - 14
doc/_build/html/models.html

@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Models &#8212; Modelverse 0.4.0 documentation</title>
+    <title>Network interface &#8212; Modelverse 0.4.0 documentation</title>
     
     <link rel="stylesheet" href="_static/classic.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -45,12 +45,8 @@
         <div class="bodywrapper">
           <div class="body" role="main">
             
-  <div class="section" id="models">
-<h1>Models<a class="headerlink" href="#models" title="Permalink to this headline">¶</a></h1>
-<p>Practically every part of the Modelverse is modelled one way or the other.
-We briefly touch upon the different aspects and how they are modelled.</p>
-<div class="section" id="network-interface">
-<h2>Network interface<a class="headerlink" href="#network-interface" title="Permalink to this headline">¶</a></h2>
+  <div class="section" id="network-interface">
+<h1>Network interface<a class="headerlink" href="#network-interface" title="Permalink to this headline">¶</a></h1>
 <p>The network communication in the Modelverse builds on top of the raw socket implementation of Python.
 Whereas we use normal HTTP requests, we explicitly opted not to use these libraries.
 Many of these libraries hide important implementation details, such as how successive requests are handled (sequential, threaded, ...), whether or not to keep connections open and reuse them, which HTTP version to implement, and so on.
@@ -58,12 +54,11 @@ As the HTTP protocol is a simple protocol, we reimplemented it completely in SCC
 <p>There are two network components: a server in the MvS, and a server and client in the MvK.
 These are discussed next.</p>
 <div class="section" id="mvs-server">
-<h3>MvS server<a class="headerlink" href="#mvs-server" title="Permalink to this headline">¶</a></h3>
+<h2>MvS server<a class="headerlink" href="#mvs-server" title="Permalink to this headline">¶</a></h2>
 <img alt="_images/mvs_server.svg" src="_images/mvs_server.svg" /></div>
 <div class="section" id="mvk-server">
-<h3>MvK server<a class="headerlink" href="#mvk-server" title="Permalink to this headline">¶</a></h3>
+<h2>MvK server<a class="headerlink" href="#mvk-server" title="Permalink to this headline">¶</a></h2>
 <img alt="_images/mvk_server.svg" src="_images/mvk_server.svg" /></div>
-</div>
 </div>
 
 
@@ -74,14 +69,11 @@ These are discussed next.</p>
         <div class="sphinxsidebarwrapper">
   <h3><a href="index.html">Table Of Contents</a></h3>
   <ul>
-<li><a class="reference internal" href="#">Models</a><ul>
-<li><a class="reference internal" href="#network-interface">Network interface</a><ul>
+<li><a class="reference internal" href="#">Network interface</a><ul>
 <li><a class="reference internal" href="#mvs-server">MvS server</a></li>
 <li><a class="reference internal" href="#mvk-server">MvK server</a></li>
 </ul>
 </li>
-</ul>
-</li>
 </ul>
 
   <h4>Previous topic</h4>

BIN
doc/_build/html/objects.inv


File diff suppressed because it is too large
+ 1 - 1
doc/_build/html/searchindex.js


+ 42 - 0
doc/communication_models.rst

@@ -0,0 +1,42 @@
+Communication models
+====================
+
+The network communication in the Modelverse builds on top of the raw socket implementation of Python.
+Whereas we use normal HTTP requests, we explicitly opted not to use these libraries.
+Many of these libraries hide important implementation details, such as how successive requests are handled (sequential, threaded, ...), whether or not to keep connections open and reuse them, which HTTP version to implement, and so on.
+As the HTTP protocol is a simple protocol, we reimplemented it completely in SCCD (StateCharts and Class Diagrams).
+
+There are two network components: a server in the MvS, and a server and client in the MvK.
+
+MvS server
+----------
+
+.. image:: img/mvs_server.svg
+
+The MvS server mainly just waits for incoming HTTP requests and presents the message to the MvS interface itself.
+Each part of the processing happens in a seperate orthogonal component, but in all cases, processing happens sequentially, and buffers are implemented in between each layer.
+This way, we can be certain that invocations on the MvS will always happen sequentially.
+
+The statechart consists of two parts.
+
+The topmost part is the HTTP server itself, which waits from messages from the sockets.
+When it starts up, a socket is created that listens to incoming connections.
+Messages from the socket are then processed.
+Apart from setting up the sockets, this component serializes all requests that get sent to the MvS: events are placed in a queue, and are only executed on the MvS when it has finished processing the previous request.
+
+The bottommost part is the socket server, which wraps around the socket and keeps fetching from the socket until it gets a complete HTTP request.
+The HTTP request is then split from the other data on the socket, and forwarded as a single request to the HTTP server.
+We explicitly need to check and split HTTP requests, as our protocol allows users to bundle multiple HTTP requests simultaneously.
+These requests will just come one after the other, so the socket buffer might contain two messages at the same time, or even fragments of a second request.
+A message is forwarded as soon as it is completely reconstructed.
+
+MvK server
+----------
+
+.. image:: img/mvk_server.svg
+
+.. note::
+    This figure shows the intended model, not the optimized model.
+    For performance reasons, many of these parts are merged together in the *run_local_modelverse.py* script.
+    As a result, it only implements the *MvKController*, *Server*, and *Socket* classes.
+    A more elaborate statechart implementation also exists, which does implements this whole figure.

+ 1 - 1
doc/index.rst

@@ -20,4 +20,4 @@ Contents:
    Advanced examples <advanced>
    Common problems and solutions <problems>
    Internal workings <internal>
-   Models <models>
+   Network communication models <communication_models>

+ 0 - 26
doc/models.rst

@@ -1,26 +0,0 @@
-Models
-======
-
-Practically every part of the Modelverse is modelled one way or the other.
-We briefly touch upon the different aspects and how they are modelled.
-
-Network interface
------------------
-
-The network communication in the Modelverse builds on top of the raw socket implementation of Python.
-Whereas we use normal HTTP requests, we explicitly opted not to use these libraries.
-Many of these libraries hide important implementation details, such as how successive requests are handled (sequential, threaded, ...), whether or not to keep connections open and reuse them, which HTTP version to implement, and so on.
-As the HTTP protocol is a simple protocol, we reimplemented it completely in SCCD (StateCharts and Class Diagrams).
-
-There are two network components: a server in the MvS, and a server and client in the MvK.
-These are discussed next.
-
-MvS server
-^^^^^^^^^^
-
-.. image:: img/mvs_server.svg
-
-MvK server
-^^^^^^^^^^
-
-.. image:: img/mvk_server.svg