The Computer Network Model
--------------------------

This model of a Computer Network represents a network of LANs. The nodes
communicate with each other through routers. Every LAN has a router
associated with it and all the communication between the nodes take place
through the routers. The router has the routing information stored in a
sort of a static table. The network topology is static and the routing is
also static. Though there might be a path between two nodes the routing
algorithm does not guarantee delivery. Also the packet is timed out after
some hops. 

NET object files
----------------

1) ConfigNet.hh,cc

This object reads the network topology information from a configuration
file "Net.config". The format for the configuration file is described
towards the end. You may have to give the absolute path to the Net.config
file for parallel simulation in this file (ConfigNet.cc). The network
topology is stored in this object. All the nodes in the simulation have a
pointer to this node which enables them to know the network topology.

2) Node.hh,cc

This object models a normal computer terminal. This object generates the
network traffic. Any packet that is sent originates from a node and ends
in another node. A packet is sent from a node to another node through the
router object. Every node is connected to its corresponding router which is
the gateway to the outside world for this node. The traffic generated by
every node can be specified as some distribution in the configuration
file. The packet destinations are randomly chosen from any of the
available nodes excluding itself. The packet sixe is not of nay
consequence. It is assumed that the packets can be anywhere between 64
bytes to 1024 bytes but the time taken for transmitting any packetbetween
these sizes is almost a constant. 

The time taken for a packet to reach from a node to a router is referred
to as the LAN delay and can be specified as a constant in the
configuration file. 

3) Router.hh,.cc   OR    BuffLessRouter.hh,.cc

There are two different implementations of router files. In the first one
(Router.hh,.cc) the messages are enqueued in the router and then
despatched while in the second impementation the messages are sent as
and when they are received.  The first impementation captures the state
of the system more accurately than the second one. The second
implementation consumes far less memory as the state of the system is
very small and as a result is faster than the first implementation

By default first implementation is used by the model. To make use of
the second implementation add the complier flag -DNO_BUFF

Description of Router:
---------------------

This object models a router terminal. Routers are the gateways to the
external world for the nodes. The router has all the router informtion
stored in a table. The routing algorithm is still not complete. Even
though there might be a route existing between two nodes, that does not
guarantee that the packet will be delivered to the destination
node. Rouitng algorithm is non-deterministic. A router services a set
of nodes (LAN). All the communication to and from these set of nodes
pass through the router. The routers take some time for routing the
packets (service time) which can be modelled as some distribution. This
distribution can be specified in the configuration file.

The nodes that a router is connected to must be specified in the
configuration file. Also the other routers that this router is connected
to must be specified. The delay for transmitting the packet from a router
to router is the WAN Delay which is a constant and must be specified in the
configuration file.

4) StatCollector.hh,cc

Collects all the statistics of the simulation. It calculates the number of
messages received/not received. It calcluates the average message
latencies. 

[b] NET Configuration file (Net.config)
---------------------------------------

This file contains the network topology and the other parameters needed
for the Computer Network simulation. The format is discussed below and
an example is also shown.

1) Number of nodes
2) Number of routers '-' ( Router id, Router id... Router id >= number of nodes)
3) Router Connections 
   router id '-' ( node id, ... node id, router id, ... router id)
   ..
   ..
   ..

   Note: Suppose I want to mention that node 3 to 9 are connected to a
   router then I can say 3..9.

4) Network Traffic Information
   Node id , distribution for generating the packets
   ..
   ..
   ..
   ..

5) Number of packets to be generted by each node
6) Router service times (time taken for routing each packet)
7) LAN Delay (Delay for transmitting a packet from a node to a router) 
8) WAN Delay (Delay for transmitting a packet from a node to a router) 
9) Number of LPs   

------------------------------------------------------------------------
A sample config file
--------------------
15
3 - (16, 17, 18)

16 - (1..6, 17, 18)
17 - (7..11, 16, 18)
18 - (12..15, 17, 16)x

1..6 poisson 200 30 
7..12 poisson 50 50 
13..15 poisson 25 25
25

16..18 normal 25 5 100

20
40

1
------------------------------------------------------------------------

Remember before starting the simulation the Net.config file needs to be filled
up. Also you may need to add the absolute path to this file in your
ConfigNet.cc file. 


