InternetCloud
=============

This component can be used to model the throughput, packet delay and packet drop of 
the Internet or other large scale networks.

The idea behind this component is loosely based on the DELFOI component originally
developed by Philipp Berndt.

The cloud component is actually a "router" component with some special abilities 
to introduce processing delay and limit the datarate between its ports. Routing tables
and IP addresses for the interfaces must be configured by the IPv4NetworkConfigurator
module.      

This component models the packet delay and packet drop behavior of the 
internet by specifying the packet delay, datarate and packet loss parameters 
for each in- and outbound connection pair (path) in an XML configuration file. 

Path parameters may contain NED expressions containing random variables. They are
re-evaluated each time a packet is processed (i.e. they behave as 'volatile' 
parameters). 

Path parameters are configured by the <traffic> elements in the configuration file.
<traffic> elements can specify match expressions for the source and destination endpoints
in addition to the base path parameters. Whenever a packet is transmitted from source to 
destination, the parameters from the first matching <traffic> element will be used to 
determine the delay and drop behavior.

The Internet is modeled as independent paths connecting the input and output gates 
in the cloud. In real life, a packet travels through several routers where each router 
introduces a processing delay. Additionally links between the routers limit the
maximum throughput possible along the path.

IN ------> R1 ------> R2 ------> R3 ------> OUT 
     R1    D1    R2   D2    R3   D3    R4
     
- The total processing delay is: Dpath = sum(D1,D2,D3)
- The maximum usable datarate on the path is Rpath = min(R1,R2,R3,R4)
  (i.e. the bottleneck on the path)

In a real life scenario, routers and links are shared among different paths (i.e. 
delay values on different paths are not independent of each other because they share
the links between, and queues inside the routers). This is NOT modeled in the current 
implementation. (NOTE: while no components are shared between the different paths 
inside a cloud module, the outbound connections attached to the component
are shared by the outgoing traffic so packets may experience additional delay
because of the queuing that happens at the egress ports).

TIP: If you want to model shared links and components you can use several InternetCloud
modules to build up a hierarchical model similarly how the real Internet is structured.
(i.e. one module for modeling the Internet backbone, the other module for the national 
network etc.)    

Possible enhancements:

 - At the moment the configuration must be created manually as an XML file. 
   It would be possible to create the configuration, based on data derived 
   from real measurements on the Internet. (i.e. using a script to convert 
   data downloadable from speedtest.net). Scripts in the original DELFOI pull
   request might be a good starting point:
   https://github.com/inet-framework/inet/pull/8
   
 - The model can be extended to handle several "different states" of the 
   Internet by implementing a state model and changing the actual path parameters
   based on the global internet state. The configuration format supports several 
   independent "parameter sets" to support this scenario.  Only the first parameter 
   set is used at the moment.  
   