next up previous
Next: BRIANA: The BRITE Analysis Up: Extending BRITE Previous: Overriding the Generate method

An example of adding a new model to BRITE

One interesting topology generator that was recently made publicly available is Inet [13] developed at the University of Michigan at Ann Arbor.

Let's imagine a scenario in which BRITE is used as a framework to develop a new topology generation model. We illustrate this scenario by incorporating a simplified version of Inet's generation model into BRITE's framework. We provide the guidelines and pseudo-code in the context of the C++ version. Adding a new model to the Java version is similar. The actual Inet generator is much more complex than what we are conveying in this example but its actual interface is concise and clean which facilitates its use as an example.

As was explained in Section 6.1, we need to consider mainly two issues: the passing of parameters and the generation functionality.

Inet basically receives the following parameters (we ignore the rest):

  1. n: topology size
  2. d: fraction of nodes of degree one
  3. p: plane size

Therefore we create a ToyInetPar class deriving from ModelPar, as shown in code excerpt 11. ProgramC++ excerpt
\begin{Program}
% latex2html id marker 727\footnotesize\begin{verbatim}class...
...e size};\end{verbatim}\caption{ToyInet model Parameter structure}\end{Program}

BRITE will be instructed to generate a topology according to the new ToyInet model, by specifying the model type along with the required parameters in a configuration file as shown in Listing 6.1.


\begin{Listing}
% latex2html id marker 734\footnotesize\begin{verbatim}...

The next step is to provide a parsing routine specific for the Inet model. Such a parsing routine, built using the basic parsing facilities of BRITE, is shown in code excerpt 12.


\begin{Program}
% latex2html id marker 741\footnotesize\begin{verbatim}InetP...
... in_par;
}\end{verbatim}\caption{Parsing routine for ToyInet model}\end{Program}

Now we have the parameter passing done. The next step is to add the generation functionality according to the Inet model. We can do that by creating a new InetModel class derived directly from the base Model class and overriding its Generate method. This is shown in code excerpt 13.


\begin{Program}
% latex2html id marker 749\footnotesize\begin{verbatim}class...
...end{verbatim}\caption{ToyInet new model class and Generate methods}\end{Program}


next up previous
Next: BRIANA: The BRITE Analysis Up: Extending BRITE Previous: Overriding the Generate method
Alberto Medina 2001-04-12