author | Tom Henderson <tomh@tomh.org> |
Sun, 15 Jun 2008 21:27:13 -0700 | |
changeset 3273 | 8bbd6b509c0f |
parent 3272 | 50726baf47b3 |
child 3274 | eaa3a345b05e |
doc/tutorial/Makefile | file | annotate | diff | comparison | revisions | |
doc/tutorial/callbacks.texi | file | annotate | diff | comparison | revisions | |
doc/tutorial/figures/buffer.dia | file | annotate | diff | comparison | revisions | |
doc/tutorial/figures/packet.obj | file | annotate | diff | comparison | revisions | |
doc/tutorial/figures/sockets-overview.dia | file | annotate | diff | comparison | revisions | |
doc/tutorial/packets.texi | file | annotate | diff | comparison | revisions | |
doc/tutorial/routing.texi | file | annotate | diff | comparison | revisions | |
doc/tutorial/sockets.texi | file | annotate | diff | comparison | revisions | |
doc/tutorial/tutorial.texi | file | annotate | diff | comparison | revisions |
--- a/doc/tutorial/Makefile Fri Jun 13 17:20:55 2008 -0700 +++ b/doc/tutorial/Makefile Sun Jun 15 21:27:13 2008 -0700 @@ -7,8 +7,8 @@ CSS = --css-include=tutorial.css SPLIT = --split section -DIA_SOURCES = buffer.dia pp.dia dumbbell.dia star.dia sockets-overview.dia -TGIF_SOURCES = packet.obj helpers.obj +DIA_SOURCES = pp.dia dumbbell.dia star.dia +TGIF_SOURCES = helpers.obj DIA_EPS = ${DIA_SOURCES:.dia=.eps} DIA_PNG = ${DIA_SOURCES:.dia=.png}
--- a/doc/tutorial/callbacks.texi Fri Jun 13 17:20:55 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,330 +0,0 @@ -@node ns-3 Callbacks -@chapter ns-3 Callbacks - -Some new users to @command{ns-3} are unfamiliar with an extensively used -programming idiom used throughout the code: the ``ns-3 callback''. This -chapter provides some motivation on the callback, guidance on how to use -it, and details on its implementation. - -@menu -* Motivation:: -* Using the Callback API:: -* Callback locations in ns-3:: -* Implementation details:: -@end menu - -@node Motivation -@section Motivation - -Consider that you have two simulation models A and B, and you wish -to have them pass information between them during the simulation. One -way that you can do that is that you can make A and B each explicitly -knowledgable about the other, so that they can invoke methods on each -other. - -@verbatim -class A { -public: - void ReceiveInput ( // parameters ); - ... -} - -(in another source file:) - -class B { -public: - void ReceiveInput ( // parameters); - void DoSomething (void); - ... - -private: - A* a_instance; // pointer to an A -} - -void -B::DoSomething() -{ - // Tell a_instance that something happened - a_instance->ReceiveInput ( // parameters); - ... -} -@end verbatim - -This certainly works, but it has the drawback that it introduces a -dependency on A and B to know about the other at compile time (this -makes it harder to have independent compilation units in the simulator) -and is not generalized; if in a later usage scenario, B needs to talk -to a completely different C object, the source code for B needs to be -changed to add a ``c_instance'' and so forth. It is easy to see that -this is a brute force mechanism of communication that can lead to -programming cruft in the models. - -This is not to say that objects should not know about one another -if there is a hard dependency between them, but that often the model -can be made more flexible if its interactions are less constrained at -compile time. - -This is not an abstract problem for network simulation research, -but rather it has been a source of problems in previous simulators, -when researchers want to extend or modify the system to do different -things (as they are apt to do in research). Consider, for example, -a user who wants to add an IPsec security protocol sublayer -between TCP and IP: -@verbatim ------------- ----------- -| TCP | | TCP | ------------- ----------- - | becomes -> | ------------ ----------- -| IP | | IPsec | ------------ ----------- - | - ----------- - | IP | - ----------- -@end verbatim -If the simulator has -made assumptions, and hard coded into the code, that IP always talks -to a transport protocol above, the user may be forced to hack the -system to get the desired interconnections. - -An alternative that provides this flexibility is to use a level of -indirection that is commonly known in programming as a callback. -A callback function is not invoked explicitly by the caller but is -rather delegated to another function that receives the callback -function's address and can call it. - -You may be familiar with function pointers in C or C++; these can -be used to implement callbacks. For more information on introductory -callbacks, an online reference is: -@uref{http://www.inquiry.com/techtips/cpp_pro/10min/10min0300.asp,,Declaring Function Pointers and Implementing Callbacks} and -@uref{http://en.wikipedia.org/wiki/Callback_(computer_science),,Callback (computer science)-- Wikipedia}. - -The callback API in @command{ns-3} is designed to minimize the overall -coupling between various pieces of of the simulator -by making each module depend on the callback API -itself rather than depend on other modules. It acts as a sort of -third-party to which work is delegated and which forwards this -work to the proper target module. This callback API, being based -on C++ templates, -is type-safe; that is, it performs static type checks to enforce -proper signature compatibility between callers and callees. It -is therefore more type-safe to use than traditional function -pointers, but the syntax may look imposing at first. This section -is designed to walk you through the callback system so that you -can be comfortable using it in @command{ns-3}. - -@node Using the Callback API -@section Using the Callback API - -The Callback API is fairly minimal, providing only two services: -@itemize @bullet -@item callback type declaration: a way to declare a type of callback -with a given signature, and, -@item callback instantiation: a way to instantiate a -template-generated forwarding callback which can forward any calls -to another C++ class member method or C++ function. -@end itemize - -This is best observed via walking through an example, based on -@code{samples/main-callback.cc}. - -@node Using the Callback API with static functions -@subsection Using the Callback API with static functions - -Consider a function: -@verbatim -static double -CbOne (double a, double b) -{ - std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl; - return a; -} -@end verbatim - -Consider also the following main program snippett: -@verbatim -int main (int argc, char *argv[]) -{ - // return type: double - // first arg type: double - // second arg type: double - Callback<double, double, double> one; -} -@end verbatim - -This class template Callback implements what is known as the Functor -Design Pattern. It is used to declare the type of a callback. It contains -one mandatory argument (the return type of the function to be assigned -to this callback) and up to five optional arguments, which each specify -the type of the arguments (if your function has more than five arguments, -then this can be handled by extending the callback implementation). - -So in the above, we have a declared a callback named "one" that will -eventually hold a function pointer. The function that it will hold -must return double and must support two double arguments. If one -tries to pass a function whose signature does not match the declared -callback, the compilation will fail. - -Now, we need to tie together this callback instance and the actual -target function (CbOne). Notice above that CbOne has the same function -signature types as the callback-- this is important. We can -pass in any such properly-typed function to this callback. Let's -look at this more closely: -@verbatim -static double CbOne (double a, double b) {} - ^ ^ ^ - | ---| ------| - | | | -Callback<double, double, double> one; -@end verbatim -You can only bind a function to a callback if they have the matching -signature. The first template argument is the return type, and the -additional template arguments are the types of the arguments of -the function signature. - -Now, let's bind our callback "one" to the function that matches its -signature: -@verbatim - // build callback instance which points to cbOne function - one = MakeCallback (&CbOne); -@end verbatim - -Then, later in the program, if the callback is to be used, it can be -used as follows: -@verbatim -// this is not a null callback - NS_ASSERT (!one.IsNull ()); - // invoke cbOne function through callback instance - double retOne; - retOne = one (10.0, 20.0); -@end verbatim - -The check @code{IsNull()} ensures that the callback is not null; that there -is a function to call behind this callback. Then, @code{one()} returns the -same result as if @code{CbOne()} had been called directly. - - -@node Using the Callback API with member functions -@subsection Using the Callback API with member functions - -Generally, you will not be calling static functions but instead -public member functions of an object. In this case, an extra -argument is needed to the MakeCallback function, to tell the system -on which object the function should be invoked. Consider this example, -also from main-callback.cc: - -@verbatim -class MyCb { -public: - int CbTwo (double a) { - std::cout << "invoke cbTwo a=" << a << std::endl; - return -5; - } -}; - -int main () -{ - ... - // return type: int - // first arg type: double - Callback<int, double> two; - MyCb cb; - // build callback instance which points to MyCb::cbTwo - two = MakeCallback (&MyCb::CbTwo, &cb); - ... -} -@end verbatim - -Here, we pass a (raw) pointer to the @code{MakeCallback<>} function, -that says, when @code{two ()} is invoked, to call the @code{CbTwo} function -on the object pointed to by @code{&cb}. - -A variation of this is used when objects are referred to by ns-3 smart -pointers. The MakeCallback API takes a raw pointer, so we need to -call @code{PeekPointer ()} to obtain this raw pointer. So the example -above would look like: - -@verbatim -class MyCb : public Object { -public: - int CbTwo (double a) { - std::cout << "invoke cbTwo a=" << a << std::endl; - return -5; - } -}; - -int main () -{ - ... - // return type: int - // first arg type: double - Callback<int, double> two; - Ptr<MyCb> cb = CreateObject<MyCb> (); - // build callback instance which points to MyCb::cbTwo - two = MakeCallback (&MyCb::CbTwo, PeekPointer (cb)); - ... -} -@end verbatim - -@node Building Null Callbacks -@subsection Building Null Callbacks - -It is possible for callbacks to be null; hence it may be wise to -check before using them. There is a special construct for a null -callback, which is preferable to simply passing "0" as an argument; -it is the @code{MakeNullCallback<>} construct: -@verbatim - two = MakeNullCallback<int, double> (); - // invoking a null callback is just like - // invoking a null function pointer: - // it will crash at runtime. - //int retTwoNull = two (20.0); - NS_ASSERT (two.IsNull ()); -@end verbatim - -@node Callback locations in ns-3 -@section Callback locations in @command{ns-3} - -Where are callbacks frequently used in @command{ns-3}? Here are some of the -more visible ones to typical users: - -@subsection Socket API -@subsection Layer-2/Layer-3 API -@subsection Tracing subsystem -@subsection Routing -Route Reply - -@node Implementation details -@section Implementation details - -This section is advanced explanation for C++ experts interested in -the implementation, and may be skipped by most users. - -This code was originally written based on the techniques described -@uref{http://www.codeproject.com/cpp/TTLFunction.asp,,here}. -It was subsequently rewritten to follow the architecture -outlined in -@uref{http://www.amazon.com/Modern-C\%2B\%2B-Design-Programming-Patterns/dp/0201704315/ref=pd_bbs_sr_1/102-0157303-1900156?ie=UTF8\&s=books\&qid=1187982662\&sr=1-1,,Modern C++ Design: Generic Programming and Design Patterns Applied-- Alexandrescu}, chapter 5, "Generalized Functors". - -This code uses: -@itemize @bullet -@item default template parameters to saves users from having to -specify empty parameters when the number of parameters -is smaller than the maximum supported number -@item the pimpl idiom: the Callback class is passed around by -value and delegates the crux of the work to its pimpl pointer. -@item two pimpl implementations which derive from CallbackImpl -FunctorCallbackImpl can be used with any functor-type -while MemPtrCallbackImpl can be used with pointers to -member functions. -@item a reference list implementation to implement the Callback's -value semantics. -@end itemize - -This code most notably departs from the Alexandrescu -implementation in that it does not use type lists to specify -and pass around the types of the callback arguments. -Of course, it also does not use copy-destruction semantics -and relies on a reference list rather than autoPtr to hold -the pointer.
--- a/doc/tutorial/figures/buffer.dia Fri Jun 13 17:20:55 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1623 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/"> - <dia:diagramdata> - <dia:attribute name="background"> - <dia:color val="#ffffff"/> - </dia:attribute> - <dia:attribute name="pagebreak"> - <dia:color val="#000099"/> - </dia:attribute> - <dia:attribute name="paper"> - <dia:composite type="paper"> - <dia:attribute name="name"> - <dia:string>#A4#</dia:string> - </dia:attribute> - <dia:attribute name="tmargin"> - <dia:real val="2.8222000598907471"/> - </dia:attribute> - <dia:attribute name="bmargin"> - <dia:real val="2.8222000598907471"/> - </dia:attribute> - <dia:attribute name="lmargin"> - <dia:real val="2.8222000598907471"/> - </dia:attribute> - <dia:attribute name="rmargin"> - <dia:real val="2.8222000598907471"/> - </dia:attribute> - <dia:attribute name="is_portrait"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="scaling"> - <dia:real val="1"/> - </dia:attribute> - <dia:attribute name="fitto"> - <dia:boolean val="false"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - <dia:attribute name="grid"> - <dia:composite type="grid"> - <dia:attribute name="width_x"> - <dia:real val="1"/> - </dia:attribute> - <dia:attribute name="width_y"> - <dia:real val="1"/> - </dia:attribute> - <dia:attribute name="visible_x"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="visible_y"> - <dia:int val="1"/> - </dia:attribute> - <dia:composite type="color"/> - </dia:composite> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#d8e5e5"/> - </dia:attribute> - <dia:attribute name="guides"> - <dia:composite type="guides"> - <dia:attribute name="hguides"/> - <dia:attribute name="vguides"/> - </dia:composite> - </dia:attribute> - </dia:diagramdata> - <dia:layer name="Background" visible="true"> - <dia:object type="Flowchart - Box" version="0" id="O0"> - <dia:attribute name="obj_pos"> - <dia:point val="5,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="4.95,-17.05;8.05,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="5,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="3"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Count#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="6.5,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O1"> - <dia:attribute name="obj_pos"> - <dia:point val="8,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="7.95,-17.05;11.05,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="8,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="3"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Size#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="9.5,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O2"> - <dia:attribute name="obj_pos"> - <dia:point val="10.825,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="10.775,-17.05;15.225,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="10.825,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="4.3499999999999996"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Initial Start#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="13,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O3"> - <dia:attribute name="obj_pos"> - <dia:point val="15,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="14.95,-17.05;19.05,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="15,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="4"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Dirty Start#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="17,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O4"> - <dia:attribute name="obj_pos"> - <dia:point val="22.925,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="22.875,-17.05;29.1,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="22.925,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="6.1249999999999964"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="inner_color"> - <dia:color val="#90ee90"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Unused Area#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="25.9875,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O5"> - <dia:attribute name="obj_pos"> - <dia:point val="19,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="18.95,-17.05;23.05,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="19,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="4"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Dirty Size#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="21,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O6"> - <dia:attribute name="obj_pos"> - <dia:point val="17,-15"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="16.93,-15.3378;29.4316,-14.6622"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="17,-15"/> - <dia:point val="20,-11"/> - <dia:point val="26.0375,-11"/> - <dia:point val="29,-15"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O3" connection="13"/> - <dia:connection handle="3" to="O9" connection="11"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O7"> - <dia:attribute name="obj_pos"> - <dia:point val="21,-15"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="20.93,-15.3378;42.4316,-14.6622"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="21,-15"/> - <dia:point val="24,-11"/> - <dia:point val="39.0375,-11"/> - <dia:point val="42,-15"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O5" connection="13"/> - <dia:connection handle="3" to="O9" connection="15"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O8"> - <dia:attribute name="obj_pos"> - <dia:point val="9.5,-15"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="9.4309,-15.4359;48.4563,-9.59687"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="9.5,-15"/> - <dia:point val="23.5,-6"/> - <dia:point val="41.125,-10"/> - <dia:point val="48.125,-15"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O1" connection="13"/> - <dia:connection handle="3" to="O14" connection="15"/> - </dia:connections> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O9"> - <dia:attribute name="obj_pos"> - <dia:point val="29,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="28.95,-17.05;42.05,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="29,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="13"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="inner_color"> - <dia:color val="#a52a2a"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Dirty Area#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="35.5,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O10"> - <dia:attribute name="obj_pos"> - <dia:point val="13,-15"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="12.9296,-15.34;40.43,-11.1632"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="13,-15"/> - <dia:point val="18,-9"/> - <dia:point val="37,-11"/> - <dia:point val="40,-15"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O2" connection="13"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O11"> - <dia:attribute name="obj_pos"> - <dia:point val="40,-22"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="30.9298,-29.0702;40.0702,-21.9298"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="40,-22"/> - <dia:point val="31,-29"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="1" to="O13" connection="11"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O12"> - <dia:attribute name="obj_pos"> - <dia:point val="40,-22"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="39.9293,-29.0707;47.0707,-21.9293"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="40,-22"/> - <dia:point val="47,-29"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="1" to="O13" connection="15"/> - </dia:connections> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O13"> - <dia:attribute name="obj_pos"> - <dia:point val="31,-31"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="30.95,-31.05;47.05,-28.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="31,-31"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="16"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Virtual Zero Area#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="39,-29.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O14"> - <dia:attribute name="obj_pos"> - <dia:point val="42,-17"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="41.95,-17.05;48.175,-14.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="42,-17"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="6.1249999999999964"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="inner_color"> - <dia:color val="#90ee90"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Unused Area#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="45.0625,-15.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:group> - <dia:object type="Flowchart - Box" version="0" id="O15"> - <dia:attribute name="obj_pos"> - <dia:point val="5,-31"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="4.95,-31.05;9.05,-28.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="5,-31"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="4"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Data#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="7,-29.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O16"> - <dia:attribute name="obj_pos"> - <dia:point val="9,-31"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="8.95,-31.05;15.15,-28.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="9,-31"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="6.1000000000000014"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Zero Area Size#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="12.05,-29.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O17"> - <dia:attribute name="obj_pos"> - <dia:point val="15,-31"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="14.95,-31.05;21.05,-28.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="15,-31"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="6"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Used start#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="18,-29.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O18"> - <dia:attribute name="obj_pos"> - <dia:point val="21,-31"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="20.95,-31.05;26.05,-28.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="21,-31"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="5"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Used Size#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="23.5,-29.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - </dia:group> - <dia:group> - <dia:object type="Flowchart - Box" version="0" id="O19"> - <dia:attribute name="obj_pos"> - <dia:point val="5,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="4.95,-2.05;9.05,0.05"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="5,-2"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="4"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Data#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="7,-0.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O20"> - <dia:attribute name="obj_pos"> - <dia:point val="9,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="8.95,-2.05;15.15,0.05"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="9,-2"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="6.1000000000000014"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Zero Area Size#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="12.05,-0.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O21"> - <dia:attribute name="obj_pos"> - <dia:point val="15,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="14.95,-2.05;21.05,0.05"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="15,-2"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="6"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Used start#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="18,-0.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O22"> - <dia:attribute name="obj_pos"> - <dia:point val="21,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="20.95,-2.05;26.05,0.05"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="21,-2"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="5"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Used Size#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="23.5,-0.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - </dia:group> - <dia:object type="Standard - Line" version="0" id="O23"> - <dia:attribute name="obj_pos"> - <dia:point val="7,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="4.49821,-15.1254;7.05702,-1.94298"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="7,-2"/> - <dia:point val="5,-15"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O19" connection="2"/> - <dia:connection handle="1" to="O0" connection="11"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O24"> - <dia:attribute name="obj_pos"> - <dia:point val="7,-29"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="4.49858,-29.0575;7.05754,-16.8685"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="7,-29"/> - <dia:point val="5,-17"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O15" connection="13"/> - <dia:connection handle="1" to="O0" connection="0"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O25"> - <dia:attribute name="obj_pos"> - <dia:point val="12.05,-31"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="11.9915,-34.0955;39.3889,-30.6111"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="12.05,-31"/> - <dia:point val="13,-36"/> - <dia:point val="36,-34"/> - <dia:point val="39,-31"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O16" connection="2"/> - <dia:connection handle="3" to="O13" connection="2"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O26"> - <dia:attribute name="obj_pos"> - <dia:point val="18,-29"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="17.9318,-29.0682;33.2055,-21.5098"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="18,-29"/> - <dia:point val="22,-22"/> - <dia:point val="30,-23"/> - <dia:point val="33,-22"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O17" connection="13"/> - <dia:connection handle="3" to="O28" connection="0"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O27"> - <dia:attribute name="obj_pos"> - <dia:point val="24,-29"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="23.9293,-29.0707;41.5,-21.95"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="24,-29"/> - <dia:point val="28,-25"/> - <dia:point val="41,-27"/> - <dia:point val="41,-22"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="3" to="O28" connection="4"/> - </dia:connections> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O28"> - <dia:attribute name="obj_pos"> - <dia:point val="33,-22"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="32.95,-22.05;41.05,-19.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="33,-22"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="8"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="inner_color"> - <dia:color val="#1e90ff"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Used#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="37,-20.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O29"> - <dia:attribute name="obj_pos"> - <dia:point val="35,-8"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="34.95,-8.05;42.05,-5.95"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="35,-8"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="7"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="inner_color"> - <dia:color val="#1e90ff"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Used#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="38.5,-6.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O30"> - <dia:attribute name="obj_pos"> - <dia:point val="12.05,0"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="11.9807,-0.294111;39.3576,4.18349"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="12.05,0"/> - <dia:point val="16,6"/> - <dia:point val="36,5"/> - <dia:point val="38.9,0"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O20" connection="13"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O31"> - <dia:attribute name="obj_pos"> - <dia:point val="40,-6"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="32.9318,-6.06822;40.0682,-1.93178"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="40,-6"/> - <dia:point val="33,-2"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="1" to="O33" connection="0"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O32"> - <dia:attribute name="obj_pos"> - <dia:point val="40,-6"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="39.9329,-6.06708;42.0671,-1.93292"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="40,-6"/> - <dia:point val="42,-2"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="1" to="O33" connection="4"/> - </dia:connections> - </dia:object> - <dia:object type="Flowchart - Box" version="0" id="O33"> - <dia:attribute name="obj_pos"> - <dia:point val="33,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="32.95,-2.05;42.05,0.05"/> - </dia:attribute> - <dia:attribute name="elem_corner"> - <dia:point val="33,-2"/> - </dia:attribute> - <dia:attribute name="elem_width"> - <dia:real val="9"/> - </dia:attribute> - <dia:attribute name="elem_height"> - <dia:real val="2"/> - </dia:attribute> - <dia:attribute name="show_background"> - <dia:boolean val="true"/> - </dia:attribute> - <dia:attribute name="padding"> - <dia:real val="0.10000000000000001"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Virtual Zero Area#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="37.5,-0.75"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="1"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O34"> - <dia:attribute name="obj_pos"> - <dia:point val="18,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="17.9343,-7.50205;35.1202,-1.93435"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="18,-2"/> - <dia:point val="25,-5"/> - <dia:point val="28,-6"/> - <dia:point val="35,-7"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O21" connection="2"/> - <dia:connection handle="3" to="O29" connection="7"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - BezierLine" version="0" id="O35"> - <dia:attribute name="obj_pos"> - <dia:point val="23.5,-2"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="23.4296,-8.86763;42.2683,-1.92958"/> - </dia:attribute> - <dia:attribute name="bez_points"> - <dia:point val="23.5,-2"/> - <dia:point val="26,-5"/> - <dia:point val="36,-11"/> - <dia:point val="42,-8"/> - </dia:attribute> - <dia:attribute name="corner_types"> - <dia:enum val="0"/> - <dia:enum val="0"/> - </dia:attribute> - <dia:attribute name="end_arrow"> - <dia:enum val="22"/> - </dia:attribute> - <dia:attribute name="end_arrow_length"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:attribute name="end_arrow_width"> - <dia:real val="0.5"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O22" connection="2"/> - <dia:connection handle="3" to="O29" connection="4"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O36"> - <dia:attribute name="obj_pos"> - <dia:point val="33,-20"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="32.95,-20.05;33.05,-16.95"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="33,-20"/> - <dia:point val="33,-17"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="line_style"> - <dia:enum val="4"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O28" connection="11"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O37"> - <dia:attribute name="obj_pos"> - <dia:point val="41,-20"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="40.95,-20.05;41.05,-16.95"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="41,-20"/> - <dia:point val="41,-17"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="line_style"> - <dia:enum val="4"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O28" connection="15"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O38"> - <dia:attribute name="obj_pos"> - <dia:point val="35,-15"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="34.95,-15.05;35.05,-7.95"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="35,-15"/> - <dia:point val="35,-8"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="line_style"> - <dia:enum val="4"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="1" to="O29" connection="0"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O39"> - <dia:attribute name="obj_pos"> - <dia:point val="40,-22"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="39.95,-22.05;40.05,-5.95"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="40,-22"/> - <dia:point val="40,-6"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="line_style"> - <dia:enum val="4"/> - </dia:attribute> - </dia:object> - <dia:object type="Standard - Line" version="0" id="O40"> - <dia:attribute name="obj_pos"> - <dia:point val="42,-15"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="41.95,-15.05;42.05,-7.95"/> - </dia:attribute> - <dia:attribute name="conn_endpoints"> - <dia:point val="42,-15"/> - <dia:point val="42,-8"/> - </dia:attribute> - <dia:attribute name="numcp"> - <dia:int val="1"/> - </dia:attribute> - <dia:attribute name="line_style"> - <dia:enum val="4"/> - </dia:attribute> - <dia:connections> - <dia:connection handle="0" to="O9" connection="15"/> - <dia:connection handle="1" to="O29" connection="4"/> - </dia:connections> - </dia:object> - <dia:object type="Standard - Text" version="1" id="O41"> - <dia:attribute name="obj_pos"> - <dia:point val="5,1"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="5,0.175;7.125,1.55"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Buffer#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="5,1"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="0"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - <dia:attribute name="valign"> - <dia:enum val="3"/> - </dia:attribute> - </dia:object> - <dia:object type="Standard - Text" version="1" id="O42"> - <dia:attribute name="obj_pos"> - <dia:point val="6,-14"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="6,-14.825;9.825,-13.45"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#BufferData#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="6,-14"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="0"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - <dia:attribute name="valign"> - <dia:enum val="3"/> - </dia:attribute> - </dia:object> - <dia:object type="Standard - Text" version="1" id="O43"> - <dia:attribute name="obj_pos"> - <dia:point val="5,-32"/> - </dia:attribute> - <dia:attribute name="obj_bb"> - <dia:rectangle val="5,-32.825;7.125,-31.45"/> - </dia:attribute> - <dia:attribute name="text"> - <dia:composite type="text"> - <dia:attribute name="string"> - <dia:string>#Buffer#</dia:string> - </dia:attribute> - <dia:attribute name="font"> - <dia:font family="sans" style="0" name="Helvetica"/> - </dia:attribute> - <dia:attribute name="height"> - <dia:real val="1.1000000000000001"/> - </dia:attribute> - <dia:attribute name="pos"> - <dia:point val="5,-32"/> - </dia:attribute> - <dia:attribute name="color"> - <dia:color val="#000000"/> - </dia:attribute> - <dia:attribute name="alignment"> - <dia:enum val="0"/> - </dia:attribute> - </dia:composite> - </dia:attribute> - <dia:attribute name="valign"> - <dia:enum val="3"/> - </dia:attribute> - </dia:object> - </dia:layer> -</dia:diagram>
--- a/doc/tutorial/figures/packet.obj Fri Jun 13 17:20:55 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -%TGIF 4.1.43-QPL -state(0,37,100.000,0,64,0,32,0,9,1,1,1,0,0,0,1,0,'Courier-Bold',1,103680,0,3,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0). -% -% @(#)$Header$ -% %W% -% -unit("1 pixel/pixel"). -color_info(11,65535,0,[ - "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, - "red", 65535, 0, 0, 65535, 0, 0, 1, - "green", 0, 65535, 0, 0, 65535, 0, 1, - "blue", 0, 0, 65535, 0, 0, 65535, 1, - "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, - "pink", 65535, 49344, 52171, 65535, 49344, 52171, 1, - "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, - "CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1, - "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, - "black", 0, 0, 0, 0, 0, 0, 1, - "DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1 -]). -script_frac("0.6"). -fg_bg_colors('black','white'). -dont_reencode("FFDingbests:ZapfDingbats"). -page(1,"",1,''). -box('black','',32,48,240,256,0,3,1,0,0,0,0,0,0,'3',0,[ -]). -text('black',64,10,1,0,1,121,28,3,22,6,0,0,0,0,2,121,28,0,0,"",0,0,0,0,32,'',[ -minilines(121,28,0,0,0,0,0,[ -mini_line(121,22,6,0,0,0,[ -str_block(0,121,22,6,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,138240,121,22,6,0,0,0,0,0,0,0, - "class Packet")]) -]) -])]). -text('black',416,100,1,0,1,116,28,15,22,6,0,0,0,0,2,116,28,0,0,"",0,0,0,0,122,'',[ -minilines(116,28,0,0,0,0,0,[ -mini_line(116,22,6,0,0,0,[ -str_block(0,116,22,6,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,138240,116,22,6,0,0,0,0,0,0,0, - "class Buffer")]) -]) -])]). -text('black',48,178,4,0,1,83,69,32,14,4,0,0,0,0,2,83,69,0,0,"",0,0,0,0,192,'',[ -minilines(83,69,0,0,0,0,0,[ -mini_line(80,14,4,0,0,0,[ -str_block(0,80,14,4,0,-1,0,0,0,[ -str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0, - "private data:")]) -]), -mini_line(59,14,3,0,0,0,[ -str_block(0,59,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,59,14,3,0,0,0,0,0,0,0, - "- unique id")]) -]), -mini_line(83,14,3,0,0,0,[ -str_block(0,83,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,83,14,3,0,0,0,0,0,0,0, - "- Buffer object")]) -]), -mini_line(76,14,3,0,0,0,[ -str_block(0,76,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,76,14,3,0,0,0,0,0,0,0, - "- Tags object")]) -]) -])]). -text('black',112,288,1,0,1,103,28,82,22,6,0,0,0,0,2,103,28,0,0,"",0,0,0,0,310,'',[ -minilines(103,28,0,0,0,0,0,[ -mini_line(103,22,6,0,0,0,[ -str_block(0,103,22,6,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,138240,103,22,6,0,-1,0,0,0,0,0, - "class Tags")]) -]) -])]). -text('black',48,50,5,0,1,175,86,176,14,4,0,0,0,0,2,175,86,0,0,"",0,0,0,0,64,'',[ -minilines(175,86,0,0,0,0,0,[ -mini_line(105,14,4,0,0,0,[ -str_block(0,105,14,4,0,-1,0,0,0,[ -str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0, - "public functions:")]) -]), -mini_line(80,14,3,0,0,0,[ -str_block(0,80,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,80,14,3,0,-1,0,0,0,0,0, - "- constructors")]) -]), -mini_line(175,14,3,0,0,0,[ -str_block(0,175,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,175,14,3,0,-1,0,0,0,0,0, - "- add/remove/peek at Headers")]) -]), -mini_line(155,14,3,0,0,0,[ -str_block(0,155,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,155,14,3,0,-1,0,0,0,0,0, - "- add/remove/peek at Tags")]) -]), -mini_line(88,14,3,0,0,0,[ -str_block(0,88,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,88,14,3,0,0,0,0,0,0,0, - "- fragmentation")]) -]) -])]). -box('black','',384,144,614,352,0,3,1,245,0,0,0,0,0,'3',0,[ -]). -text('black',400,274,4,0,1,204,69,246,14,4,0,0,0,0,2,204,69,0,0,"",0,0,0,0,288,'',[ -minilines(204,69,0,0,0,0,0,[ -mini_line(80,14,4,0,0,0,[ -str_block(0,80,14,4,0,-1,0,0,0,[ -str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0, - "private data:")]) -]), -mini_line(193,14,3,0,0,0,[ -str_block(0,193,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,193,14,3,0,0,0,0,0,0,0, - "- struct BufferData, a dynamically")]) -]), -mini_line(160,14,3,0,0,0,[ -str_block(0,160,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,160,14,3,0,0,0,0,0,0,0, - "varying byte buffer to which")]) -]), -mini_line(204,14,3,0,0,0,[ -str_block(0,204,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,204,14,3,0,0,0,0,0,0,0, - "data can be prepended or appended")]) -]) -])]). -text('black',400,146,5,0,1,188,86,247,14,4,0,0,0,0,2,188,86,0,0,"",0,0,0,0,160,'',[ -minilines(188,86,0,0,0,0,0,[ -mini_line(105,14,4,0,0,0,[ -str_block(0,105,14,4,0,-1,0,0,0,[ -str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0, - "public functions:")]) -]), -mini_line(172,14,3,0,0,0,[ -str_block(0,172,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,172,14,3,0,0,0,0,0,0,0, - "- Iterators to move byte buffer")]) -]), -mini_line(171,14,3,0,0,0,[ -str_block(0,171,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,171,14,3,0,0,0,0,0,0,0, - "pointers forward or backward")]) -]), -mini_line(188,14,3,0,0,0,[ -str_block(0,188,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,188,14,3,0,0,0,0,0,0,0, - "- functions to read and write data")]) -]), -mini_line(132,14,3,0,0,0,[ -str_block(0,132,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,132,14,3,0,-1,0,0,0,0,0, - "of various sized chunks")]) -]) -])]). -box('black','',96,324,304,532,0,3,1,264,0,0,0,0,0,'3',0,[ -]). -text('black',112,454,4,0,1,167,69,265,14,4,0,0,0,0,2,167,69,0,0,"",0,0,0,0,468,'',[ -minilines(167,69,0,0,0,0,0,[ -mini_line(80,14,4,0,0,0,[ -str_block(0,80,14,4,0,-1,0,0,0,[ -str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0, - "private data:")]) -]), -mini_line(167,14,3,0,0,0,[ -str_block(0,167,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,167,14,3,0,0,0,0,0,0,0, - "- singly linked-list of TagData")]) -]), -mini_line(158,14,3,0,0,0,[ -str_block(0,158,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,158,14,3,0,0,0,0,0,0,0, - "structures, with a reference")]) -]), -mini_line(32,14,3,0,0,0,[ -str_block(0,32,14,3,0,0,0,0,0,[ -str_seg('black','Times-Roman',0,80640,32,14,3,0,0,0,0,0,0,0, - "count")]) -]) -])]). -text('black',112,326,5,0,1,155,86,266,14,4,0,0,0,0,2,155,86,0,0,"",0,0,0,0,340,'',[ -minilines(155,86,0,0,0,0,0,[ -mini_line(105,14,4,0,0,0,[ -str_block(0,105,14,4,0,-1,0,0,0,[ -str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0, - "public functions:")]) -]), -mini_line(80,14,3,0,0,0,[ -str_block(0,80,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,80,14,3,0,-1,0,0,0,0,0, - "- constructors")]) -]), -mini_line(155,14,3,0,0,0,[ -str_block(0,155,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,155,14,3,0,-1,0,0,0,0,0, - "- templates to add, remove,")]) -]), -mini_line(148,14,3,0,0,0,[ -str_block(0,148,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,148,14,3,0,-1,0,0,0,0,0, - "or peek at Tags of various")]) -]), -mini_line(31,14,3,0,0,0,[ -str_block(0,31,14,3,0,-1,0,0,0,[ -str_seg('black','Times-Roman',0,80640,31,14,3,0,-1,0,0,0,0,0, - "types")]) -]) -])]). -poly('black','',2,[ - 59,245,96,320],0,2,1,272,0,0,3,0,0,0,0,'2',0,0, - "0","",[ - 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[ -]). -poly('black','',2,[ - 123,246,288,320],0,2,1,280,0,0,3,0,0,0,0,'2',0,0, - "0","",[ - 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[ -]). -poly('black','',2,[ - 141,219,379,147],0,2,1,286,0,0,3,0,0,0,0,'2',0,0, - "0","",[ - 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[ -]). -poly('black','',2,[ - 132,226,375,335],0,2,1,287,0,0,3,0,0,0,0,'2',0,0, - "0","",[ - 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[ -]).
--- a/doc/tutorial/packets.texi Fri Jun 13 17:20:55 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,620 +0,0 @@ -@node ns-3 Packets -@chapter ns-3 Packets - -The design of the Packet framework of @emph{ns} was heavily guided by a few -important use-cases: -@itemize @bullet -@item avoid changing the core of the simulator to introduce -new types of packet headers or trailers -@item maximize the ease of integration with real-world code -and systems -@item make it easy to support fragmentation, defragmentation, -and, concatenation which are important, especially in wireless systems. -@item make memory management of this object efficient -@item allow actual application data or dummy application bytes for -emulated applications -@end itemize - -@emph{ns} Packet objects contain a buffer of bytes: protocol headers and -trailers are serialized in this buffer of bytes using user-provided -serialization and deserialization routines. The content of this byte -buffer is expected to match bit-for-bit the content of a real packet on -a real network implementing the protocol of interest. - -Fragmentation and defragmentation are quite natural to implement within -this context: since we have a buffer of real bytes, we can split it in -multiple fragments and re-assemble these fragments. We expect that this -choice will make it really easy to wrap our Packet data structure within -Linux-style skb or BSD-style mbuf to integrate real-world kernel code in -the simulator. We also expect that performing a real-time plug of the -simulator to a real-world network will be easy. - -Because we understand that simulation developers often wish to store in -packet objects data which is not found in the real packets (such as -timestamps or any kind of similar in-band data), the @emph{ns} Packet class -can also store extra per-packet "Tags" which are 16 bytes blobs of data. -Any Packet can store any number of unique Tags, each of which is -uniquely identified by its C++ type. These tags make it easy to attach -per-model data to a packet without having to patch the main Packet -class or Packet facilities. - -Memory management of Packet objects is entirely automatic and extremely -efficient: memory for the application-level payload can be modelized by -a virtual buffer of zero-filled bytes for which memory is never allocated -unless explicitely requested by the user or unless the packet is fragmented. -Furthermore, copying, adding, and, removing headers or trailers to a packet -has been optimized to be virtually free through a technique known as -Copy On Write. - -Packets (messages) are fundamental objects in the simulator and -their design is important from a performance and resource management -perspective. There -are various ways to design the simulation packet, and tradeoffs -among the different approaches. In particular, there is a -tension between ease-of-use, performance, and safe interface -design. - -There are a few requirements on this object design: -@itemize @bullet -@item Creation, management, and deletion of this object -should be as simple as possible, while avoiding the -chance for memory leaks and/or heap corruption; -@item Packets should support serialization and deserialization -so that network emulation is supported; -@item Packets should support fragmentation and concatenation -(multiple packets in a data link frame), especially for wireless -support; -@item It should be natural for packets to carry actual application -data, or if there is only an emulated application and there is -no need to carry dummy bytes, smaller packets could be used with -just the headers and a record of the payload size, but not actual -application bytes, conveyed in the simulated packet. -@item Packets should facilitate BSD-like operations on mbufs, for -support of ported operating system stacks. -@item Additional side-information should be supported, such as -a tag for cross-layer information. -@end itemize - -@section Packet design overview - -Unlike @emph{ns-2}, in which Packet objects contain a buffer of C++ -structures corresponding to protocol headers, each network packet in -@emph{ns-3} contains a byte Buffer and a list of Tags: -@itemize @bullet -@item The byte buffer stores the serialized content of the chunks -added to a packet. The serialized representation of these chunks is -expected to match that of real network packets bit for bit -(although nothing forces you to do this) which means that the content -of a packet buffer is expected to be that of a real packet. -Packets can also be created with an arbitrary zero-filled payload -for which no real memory is allocated. -@item The list of tags stores an arbitrarily large set of arbitrary -user-provided data structures in the packet. Each Tag is uniquely -identified by its type; only one instance of each -type of data structure is allowed in a list of tags. These tags typically -contain per-packet cross-layer information or flow identifiers (i.e., -things that you wouldn't find in the bits on the wire). Each tag -stored in the tag list can be at most 16 bytes. -Trying to attach bigger data structures will trigger -crashes at runtime. The 16 byte limit is a modifiable compilation -constant. -@end itemize - -@float Figure,fig:packets -@caption{Implementation overview of Packet class.} -@image{figures/packet} -@end float - -Figure @ref{fig:packets} is a high-level overview of the Packet -implementation; more detail on the byte Buffer implementation -is provided later in Figure @ref{fig:buffer}. -In \nsthree, the Packet byte buffer is analogous to a Linux skbuff -or BSD mbuf; it is a serialized representation of the actual -data in the packet. The tag list is a container for extra -items useful for simulation convenience; if a Packet is converted -to an emulated packet and put over an actual network, the tags -are stripped off and the byte buffer is copied directly -into a real packet. - -The Packet class has value semantics: it can be freely copied around, -allocated on the stack, and passed to functions as arguments. Whenever -an instance is copied, the full underlying data is not copied; it -has ``copy-on-write'' (COW) semantics. Packet instances can be passed -by value to function arguments without any performance hit. - -The fundamental classes for adding to and removing from the byte -buffer are @code{class Header} and @code{class Trailer}. -Headers are more common but the below discussion also largely applies to -protocols using trailers. Every protocol header that needs to -be inserted and removed from a Packet instance should derive from -the abstract Header base class and implement the private pure -virtual methods listed below: -@itemize @bullet -@item @code{ns3::Header::SerializeTo()} -@item @code{ns3::Header::DeserializeFrom()} -@item @code{ns3::Header::GetSerializedSize()} -@item @code{ns3::Header::PrintTo()} -@end itemize -Basically, the first three functions are used to serialize and deserialize -protocol control information to/from a Buffer. For example, -one may define @code{class TCPHeader : public Header}. The -TCPHeader object will typically consist of some private data -(like a sequence number) and public interface access functions -(such as checking the bounds of an input). But the underlying -representation of the TCPHeader in a Packet Buffer is 20 serialized -bytes (plus TCP options). The TCPHeader::SerializeTo() function would -therefore be designed to write these 20 bytes properly into -the packet, in network byte order. The last function is used -to define how the Header object prints itself onto an output stream. - -Similarly, user-defined Tags can be appended to the packet. -Unlike Headers, Tags are not serialized into a contiguous buffer -but are stored in an array. By default, Tags are limited to 16 bytes in -size. Tags can be flexibly defined to be any type, but there -can only be one instance of any particular object type in -the Tags buffer at any time. The implementation makes use -of templates to generate the proper set of Add(), Remove(), -and Peek() functions for each Tag type. - -@section Packet interface - -The public member functions of a Packet object are as follows: - -@subsection Constructors -@verbatim - /** - * Create an empty packet with a new uid (as returned - * by getUid). - */ - Packet (); - /** - * Create a packet with a zero-filled payload. - * The memory necessary for the payload is not allocated: - * it will be allocated at any later point if you attempt - * to fragment this packet or to access the zero-filled - * bytes. The packet is allocated with a new uid (as - * returned by getUid). - * - * \param size the size of the zero-filled payload - */ - Packet (uint32_t size); -@end verbatim - -@subsection Adding and removing Buffer data -The below code is reproduced for Header class only; similar functions -exist for Trailers. -@verbatim - /** - * Add header to this packet. This method invokes the - * ns3::Header::serializeTo method to request the header to serialize - * itself in the packet buffer. - * - * \param header a reference to the header to add to this packet. - */ - void Add (Header const &header); - /** - * Deserialize header from this packet. This method invokes the - * ns3::Header::deserializeFrom method to request the header to deserialize - * itself from the packet buffer. This method does not remove - * the data from the buffer. It merely reads it. - * - * \param header a reference to the header to deserialize from the buffer - */ - void Peek (Header &header); - /** - * Remove a deserialized header from the internal buffer. - * This method removes the bytes read by Packet::peek from - * the packet buffer. - * - * \param header a reference to the header to remove from the internal buffer. - */ - void Remove (Header const &header); - /** - * Add trailer to this packet. This method invokes the - * ns3::Trailer::serializeTo method to request the trailer to serialize - * itself in the packet buffer. - * - * \param trailer a reference to the trailer to add to this packet. - */ -@end verbatim - -@subsection Adding and removing Tags -@verbatim - /** - * Attach a tag to this packet. The tag is fully copied - * in a packet-specific internal buffer. This operation - * is expected to be really fast. - * - * \param tag a pointer to the tag to attach to this packet. - */ - template <typename T> - void AddTag (T const &tag); - /** - * Remove a tag from this packet. The data stored internally - * for this tag is copied in the input tag if an instance - * of this tag type is present in the internal buffer. If this - * tag type is not present, the input tag is not modified. - * - * This operation can be potentially slow and might trigger - * unexpectedly large memory allocations. It is thus - * usually a better idea to create a copy of this packet, - * and invoke removeAllTags on the copy to remove all - * tags rather than remove the tags one by one from a packet. - * - * \param tag a pointer to the tag to remove from this packet - * \returns true if an instance of this tag type is stored - * in this packet, false otherwise. - */ - template <typename T> - bool RemoveTag (T &tag); - /** - * Copy a tag stored internally to the input tag. If no instance - * of this tag is present internally, the input tag is not modified. - * - * \param tag a pointer to the tag to read from this packet - * \returns true if an instance of this tag type is stored - * in this packet, false otherwise. - */ - template <typename T> - bool PeekTag (T &tag) const; - /** - * Remove all the tags stored in this packet. This operation is - * much much faster than invoking removeTag n times. - */ - void RemoveAllTags (void); -@end verbatim - -@subsection Fragmentation -@verbatim - /** - * Create a new packet which contains a fragment of the original - * packet. The returned packet shares the same uid as this packet. - * - * \param start offset from start of packet to start of fragment to create - * \param length length of fragment to create - * \returns a fragment of the original packet - */ - Packet CreateFragment (uint32_t start, uint32_t length) const; - - /** - * Concatenate the input packet at the end of the current - * packet. This does not alter the uid of either packet. - * - * \param packet packet to concatenate - */ - void addAtEnd (Packet packet); - - /oncatenate the input packet at the end of the current - * packet. This does not alter the uid of either packet. - * - * \param packet packet to concatenate - */ - void AddAtEnd (Packet packet); - /** - * Concatenate the fragment of the input packet identified - * by the offset and size parameters at the end of the current - * packet. This does not alter the uid of either packet. - * - * \param packet to concatenate - * \param offset offset of fragment to copy from the start of the input packet - * \param size size of fragment of input packet to copy. - */ - void AddAtEnd (Packet packet, uint32_t offset, uint32_t size); - /** - * Remove size bytes from the end of the current packet - * It is safe to remove more bytes that what is present in - * the packet. - * - * \param size number of bytes from remove - */ - void RemoveAtEnd (uint32_t size); - /** - * Remove size bytes from the start of the current packet. - * It is safe to remove more bytes that what is present in - * the packet. - * - * \param size number of bytes from remove - */ - void RemoveAtStart (uint32_t size); -@end verbatim - -@subsection Miscellaneous -@verbatim - /** - * \returns the size in bytes of the packet (including the zero-filled - * initial payload) - */ - uint32_t GetSize (void) const; - /** - * If you try to change the content of the buffer - * returned by this method, you will die. - * - * \returns a pointer to the internal buffer of the packet. - */ - uint8_t const *PeekData (void) const; - /** - * A packet is allocated a new uid when it is created - * empty or with zero-filled payload. - * - * \returns an integer identifier which uniquely - * identifies this packet. - */ - uint32_t GetUid (void) const; -@end verbatim - -@section Using Headers -@emph{walk through an example of adding a UDP header} - -@section Using Tags -@emph{walk through an example of adding a flow ID} - -@section Using Fragmentation -@emph{walk through an example of link-layer fragmentation/reassembly} - -@section Sample program -The below sample program (from @code{ns3/samples/main-packet.cc}) illustrates -some use of the Packet, Header, and Tag classes. - -@verbatim -/* -*- Mode:C++; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */ -#include "ns3/packet.h" -#include "ns3/header.h" -#include <iostream> - -using namespace ns3; - -/* A sample Header implementation - */ -class MyHeader : public Header { -public: - MyHeader (); - virtual ~MyHeader (); - - void SetData (uint16_t data); - uint16_t GetData (void) const; -private: - virtual void PrintTo (std::ostream &os) const; - virtual void SerializeTo (Buffer::Iterator start) const; - virtual void DeserializeFrom (Buffer::Iterator start); - virtual uint32_t GetSerializedSize (void) const; - - uint16_t m_data; -}; - -MyHeader::MyHeader () -{} -MyHeader::~MyHeader () -{} -void -MyHeader::PrintTo (std::ostream &os) const -{ - os << "MyHeader data=" << m_data << std::endl; -} -uint32_t -MyHeader::GetSerializedSize (void) const -{ - return 2; -} -void -MyHeader::SerializeTo (Buffer::Iterator start) const -{ - // serialize in head of buffer - start.WriteHtonU16 (m_data); -} -void -MyHeader::DeserializeFrom (Buffer::Iterator start) -{ - // deserialize from head of buffer - m_data = start.ReadNtohU16 (); -} - -void -MyHeader::SetData (uint16_t data) -{ - m_data = data; -} -uint16_t -MyHeader::GetData (void) const -{ - return m_data; -} - -/* A sample Tag implementation - */ -struct MyTag { - uint16_t m_streamId; -}; - -static TagRegistration<struct MyTag> g_MyTagRegistration ("ns3::MyTag", 0); - - -static void -Receive (Packet p) -{ - MyHeader my; - p.Peek (my); - p.Remove (my); - std::cout << "received data=" << my.GetData () << std::endl; - struct MyTag myTag; - p.PeekTag (myTag); -} - - -int main (int argc, char *argv[]) -{ - Packet p; - MyHeader my; - my.SetData (2); - std::cout << "send data=2" << std::endl; - p.Add (my); - struct MyTag myTag; - myTag.m_streamId = 5; - p.AddTag (myTag); - Receive (p); - return 0; -} -@end verbatim - -@section Implementation details - -@subsection Private member variables - -A Packet object's interface provides access to some private -data: -@verbatim - Buffer m_buffer; - Tags m_tags; - uint32_t m_uid; - static uint32_t m_global_uid; -@end verbatim -Each Packet has a Buffer and a Tags object, and a 32-bit unique ID (m\_uid). -A static member variable keeps track of the UIDs allocated. Note -that real network packets do not have a UID; the UID is therefore an -instance of data that normally would be stored as a Tag in the packet. -However, it was felt that a UID is a special case that is so often -used in simulations that it would be more convenient to store it -in a member variable. - -@subsection Buffer implementation - -Class Buffer represents a buffer of bytes. Its size is -automatically adjusted to hold any data prepended -or appended by the user. Its implementation is optimized -to ensure that the number of buffer resizes is minimized, -by creating new Buffers of the maximum size ever used. -The correct maximum size is learned at runtime during use by -recording the maximum size of each packet. - -Authors of new Header or Trailer classes need to know the public -API of the Buffer class. (add summary here) - -The byte buffer is implemented as follows: -@verbatim - struct BufferData { - uint32_t m_count; - uint32_t m_size; - uint32_t m_initialStart; - uint32_t m_dirtyStart; - uint32_t m_dirtySize; - uint8_t m_data[1]; - }; - struct BufferData *m_data; - uint32_t m_zeroAreaSize; - uint32_t m_start; - uint32_t m_size; -@end verbatim - -@itemize @bullet -@item @code{BufferData::m_count}: reference count for BufferData structure -@item @code{BufferData::m_size}: size of data buffer stored in BufferData structure -@item @code{BufferData::m_initialStart}: offset from start of data buffer where data was first inserted -@item @code{BufferData::m_dirtyStart}: offset from start of buffer where every Buffer which holds a reference to this BufferData instance have written data so far -@item @code{BufferData::m_dirtySize}: size of area where data has been written so far -@item @code{BufferData::m_data}: pointer to data buffer -@item @code{Buffer::m_zeroAreaSize}: size of zero area which extends before @code{m_initialStart} -@item @code{Buffer::m_start}: offset from start of buffer to area used by this buffer -@item @code{Buffer::m_size}: size of area used by this Buffer in its BufferData structure -@end itemize - -@float Figure,fig:buffer -@caption{Implementation overview of a packet's byte Buffer.} -@image{figures/buffer,15cm} -@end float - -This data structure is summarized in Figure @ref{fig:buffer}. -Each Buffer holds a pointer to an instance of a BufferData. Most -Buffers should be able to share the same underlying BufferData and -thus simply increase the BufferData's reference count. If they have to -change the content of a BufferData inside the Dirty Area, and if the -reference count is not one, they first create a copy of the BufferData and -then complete their state-changing operation. - -@subsection Tags implementation -Tags are implemented by a single pointer which points to the start of a -linked list ofTagData data structures. Each TagData structure points -to the next TagData in the list (its next pointer contains zero to -indicate the end of the linked list). Each TagData contains an integer -unique id which identifies the type of the tag stored in the TagData. -@verbatim -struct TagData { - struct TagData *m_next; - uint32_t m_id; - uint32_t m_count; - uint8_t m_data[Tags::SIZE]; -}; -class Tags { - struct TagData *m_next; -}; -@end verbatim - -Adding a tag is a matter of inserting a new TagData at the head of -the linked list. Looking at a tag requires you to find the relevant -TagData in the linked list and copy its data into the user data -structure. Removing a tag and updating the content of a tag -requires a deep copy of the linked list before performing this operation. -On the other hand, copying a Packet and its tags is a matter of -copying the TagData head pointer and incrementing its reference count. - -Tags are found by the unique mapping betweent the Tag type and -its underlying id. This is why at most one instance of any Tag -can be stored in a packet. The mapping between Tag type and -underlying id is performed by a registration as follows: -@verbatim -/* A sample Tag implementation - */ -struct MyTag { - uint16_t m_streamId; -}; -@end verbatim - -@emph{add description of TagRegistration for printing} - -@subsection Memory management - -@emph{Describe free list.} - -@emph{Describe dataless vs. data-full packets.} - -@subsection Copy-on-write semantics -The current implementation of the byte buffers and tag list is based -on COW (Copy On Write). An introduction to COW can be found in Scott -Meyer's "More Effective C++", items 17 and 29). This design feature -and aspects of the public interface borrows from the packet design -of the Georgia Tech Network Simulator. -This implementation of COW uses a customized reference counting -smart pointer class. - -What COW means is that -copying packets without modifying them is very cheap (in terms of CPU -and memory usage) and modifying them can be also very cheap. What is -key for proper COW implementations is being -able to detect when a given modification of the state of a packet triggers -a full copy of the data prior to the modification: COW systems need -to detect when an operation is ``dirty'' and must therefore invoke -a true copy. - -Dirty operations: -@itemize @bullet -@item Packet::RemoveTag() -@item Packet::Add() -@item both versions of ns3::Packet::AddAtEnd() -@end itemize - -Non-dirty operations: -@itemize @bullet -@item Packet::AddTag() -@item Packet::RemoveAllTags() -@item Packet::PeekTag() -@item Packet::Peek() -@item Packet::Remove() -@item Packet::CreateFragment() -@item Packet::RemoveAtStart() -@item Packet::RemoveAtEnd() -@end itemize - -Dirty operations will always be slower than non-dirty operations, -sometimes by several orders of magnitude. However, even the -dirty operations have been optimized for common use-cases which -means that most of the time, these operations will not trigger -data copies and will thus be still very fast. -
--- a/doc/tutorial/routing.texi Fri Jun 13 17:20:55 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,373 +0,0 @@ -@node ns-3 routing overview -@chapter ns-3 routing overview - -This chapter describes the overall design of routing in the -@code{src/internet-stack} -module, and some details about the routing approachs currently -implemented. - -@node Routing-Overview -@section Overview - -We intend to support traditional routing approaches and protocols, -ports of open source routing implementations, and facilitate research -into unorthodox routing techniques. -For simulations that are not primarily focused on routing and that -simply want correct routing tables to occur somehow, we have an -global centralized routing capability. A singleton object -(GlobalRouteManager) be instantiated, builds a network map, and -populates a forwarding table on each node at time t=0 in the -simulation. Simulation script writers can use the same node -API to manually enter routes as well. - -@node Support for multiple routing protocols -@section Support for multiple routing protocols - -Typically, multiple routing protocols are supported in user space and -coordinate to write a single forwarding table in the kernel. Presently -in @command{ns-3}, the implementation instead allows for multiple routing -protocols to build/keep their own routing state, and the IPv4 implementation -will query each one of these routing protocols (in some order determined -by the simulation author) until a route is found. - -We chose this approach because it may better -faciliate the integration of disparate routing approaches that may -be difficult to coordinate the writing to a single table, approaches -where more information than destination IP address (e.g., source -routing) is used to determine the next hop, and on-demand -routing approaches where packets must be cached. - -There are presently two routing protocols defined: -@itemize @bullet -@item class Ipv4StaticRouting (covering both unicast and multicast) -@item Optimized Link State Routing (a MANET protocol defined in -@uref{http://www.ietf.org/rfc/rfc3626.txt,,RFC 3626}) -@end itemize -but first we describe how multiple routing protocols are supported. - -@subsection class Ipv4RoutingProtocol - -@code{class Ipv4RoutingProtocol} derives from ns-3 Object which means -that it supports interface aggregation and reference counting. Routing -protocols should inherit from this class, defined in src/node/ipv4.cc. - -The main function that must be supported by these protocols is called -@code{RequestRoute}. -@verbatim - * This method is called whenever a node's IPv4 forwarding engine - * needs to lookup a route for a given packet and IP header. - * - * The routing protocol implementation may determine immediately it - * should not be handling this particular the route request. For - * instance, a routing protocol may decline to search for routes for - * certain classes of addresses, like link-local. In this case, - * RequestRoute() should return false and the routeReply callback - * must not be invoked. - * - * If the routing protocol implementations assumes it can provide - * the requested route, then it should return true, and the - * routeReply callback must be invoked, either immediately before - * returning true (synchronously), or in the future (asynchronous). - * The routing protocol may use any information available in the IP - * header and packet as routing key, although most routing protocols - * use only the destination address (as given by - * ipHeader.GetDestination ()). The routing protocol is also - * allowed to add a new header to the packet, which will appear - * immediately after the IP header, although most routing do not - * insert any extra header. - */ - virtual bool RequestRoute (uint32_t ifIndex, - const Ipv4Header &ipHeader, - Ptr<Packet> packet, - RouteReplyCallback routeReply) = 0; -@end verbatim - -This class also provides a typedef (used above) for a special Callback -that will pass to the callback function the Ipv4Route that is found (see the -Doxygen documentation): -@verbatim - typedef Callback<void, bool, const Ipv4Route&, Ptr<Packet>, const Ipv4Header&> RouteReplyCallback; -@end verbatim - -@subsection Ipv4::AddRoutingProtocol - -Class Ipv4 provides a pure virtual function declaration for the -method that allows one to add a routing protocol: -@verbatim - void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol, - int16_t priority); -@end verbatim -This method is implemented by class Ipv4L3Protocol in the internet-stack -module. - -The priority variable above governs the priority in which the routing -protocols are inserted. Notice that it is a signed int. -When the class Ipv4L3Protocol is instantiated, a single routing -protocol (Ipv4StaticRouting, introduced below) is added at priority -zero. Internally, a list of Ipv4RoutingProtocols is stored, and -and the routing protocols are each consulted in decreasing order -of priority to see whether a match is found. Therefore, if you -want your Ipv4RoutingProtocol to have priority lower than the static -routing, insert it with priority less than 0; e.g.: -@verbatim - m_ipv4->AddRoutingProtocol (m_routingTable, -10); -@end verbatim - -@subsection Ipv4L3Protocol::Lookup - -The main function for obtaining a route is shown below: -@verbatim -Ipv4L3Protocol::Lookup ( - uint32_t ifIndex, - Ipv4Header const &ipHeader, - Ptr<Packet> packet, - Ipv4RoutingProtocol::RouteReplyCallback routeReply) -@end verbatim - -This function will search the list of routing protocols, in priority order, -until a route is found. It will then invoke the RouteReplyCallback -and no further routing protocols will be searched. If the caller does -not want to constrain the possible interface, it can be wildcarded -as such: -@verbatim - Lookup (Ipv4RoutingProtocol::IF_INDEX_ANY, ipHeader, packet, routeReply); -@end verbatim - -@node Roadmap and Future work -@section Roadmap and Future work - -Some goals for future support are: - -Users should be able to trace (either debug print, or redirect to a trace -file) the routing table in a format such as used in an -Unix implementation: -@verbatim -# netstat -nr (or # route -n) -Kernel IP routing table -Destination Gateway Genmask Flags MSS Window irtt Iface -127.0.0.1 * 255.255.255.255 UH 0 0 0 lo -172.16.1.0 * 255.255.255.0 U 0 0 0 eth0 -172.16.2.0 172.16.1.1 255.255.255.0 UG 0 0 0 eth0 - -# ip route show -192.168.99.0/24 dev eth0 scope link -127.0.0.0/8 dev lo scope link -default via 192.168.99.254 dev eth0 -@end verbatim - -Global computation of multicast routing should be implemented as well. -This would ignore group membership and ensure that a copy of every -sourced multicast datagram would be delivered to each node. -This might be implemented as an RPF mechanism that functioned on-demand -by querying the forwarding table, -and perhaps optimized by a small multicast forwarding cache. It is -a bit trickier to implement over wireless links where the input -interface is the same as the output interface; other aspects of the -packet must be considered and the forwarding logic slightly changed -to allow for forwarding out the same interface. - -In the future, work on bringing XORP or quagga routing to ns, but it will -take several months to port and enable. - -There are presently no roadmap plans for IPv6. - -@node Static routing -@section Static routing - -The internet-stack module provides one routing protocol (Ipv4StaticRouting) -by default. This routing protocol allows one to add unicast or multicast -static routes to a node. - -@node Unicast routing -@section Unicast routing - -The unicast static routing API may be accessed via the functions -@verbatim -void Ipv4::AddHostRouteTo () -void Ipv4::AddNetworkRouteTo () -void Ipv4::SetDefaultRoute () -uint32_t Ipv4::GetNRoutes () -Ipv4Route Ipv4::GetRoute () -@end verbatim - -@uref{http://www.nsnam.org/doxygen/index.html,,Doxygen} documentation -provides full documentation of these methods. These methods are forwarding -functions to the actual implementation in Ipv4StaticRouting, when using -the internet-stack module. - -@node Multicast routing -@section Multicast routing - -The following function is used to add a static multicast route -to a node: -@verbatim -void -Ipv4StaticRouting::AddMulticastRoute (Ipv4Address origin, - Ipv4Address group, - uint32_t inputInterface, - std::vector<uint32_t> outputInterfaces); -@end verbatim - -A multicast route must specify an origin IP address, a multicast group and -an input network interface index as conditions and provide a vector of -output network interface indices over which packets matching the conditions -are sent. - -Typically there are two main types of multicast routes: routes of the -first kind are used during forwarding. All of the conditions must be -exlicitly provided. The second kind of routes are used to get packets off -of a local node. The difference is in the input interface. Routes for -forwarding will always have an explicit input interface specified. Routes -off of a node will always set the input interface to a wildcard specified -by the index Ipv4RoutingProtocol::IF\_INDEX\_ANY. - -For routes off of a local node wildcards may be used in the origin and -multicast group addresses. The wildcard used for Ipv4Adresses is that -address returned by Ipv4Address::GetAny () -- typically "0.0.0.0". Usage -of a wildcard allows one to specify default behavior to varying degrees. - -For example, making the origin address a wildcard, but leaving the -multicast group specific allows one (in the case of a node with multiple -interfaces) to create different routes using different output interfaces -for each multicast group. - -If the origin and multicast addresses are made wildcards, you have created -essentially a default multicast address that can forward to multiple -interfaces. Compare this to the actual default multicast address that is -limited to specifying a single output interface for compatibility with -existing functionality in other systems. - -Another command sets the default multicast route: -@verbatim -void -Ipv4StaticRouting::SetDefaultMulticastRoute (uint32_t outputInterface); -@end verbatim - -This is the multicast equivalent of the unicast version SetDefaultRoute. -We tell the routing system what to do in the case where a specific route -to a destination multicast group is not found. The system forwards -packets out the specified interface in the hope that "something out there" -knows better how to route the packet. This method is only used in -initially sending packets off of a host. The default multicast route is -not consulted during forwarding -- exact routes must be specified using -AddMulticastRoute for that case. - -Since we're basically sending packets to some entity we think may know -better what to do, we don't pay attention to "subtleties" like origin -address, nor do we worry about forwarding out multiple interfaces. If the -default multicast route is set, it is returned as the selected route from -LookupStatic irrespective of origin or multicast group if another specific -route is not found. - -Finally, a number of additional functions are provided to fetch and -remove multicast routes: -@verbatim - uint32_t GetNMulticastRoutes (void) const; - - Ipv4MulticastRoute *GetMulticastRoute (uint32_t i) const; - - Ipv4MulticastRoute *GetDefaultMulticastRoute (void) const; - - bool RemoveMulticastRoute (Ipv4Address origin, - Ipv4Address group, - uint32_t inputInterface); - - void RemoveMulticastRoute (uint32_t index); -@end verbatim - -@node Global centralized routing -@section Global centralized routing - -Presently, global centralized IPv4 @emph{unicast} routing over both -point-to-point and shared (CSMA) links is supported. -The global centralized routing will be modified in the future to -reduce computations once profiling finds the performance bottlenecks. - -@node Global Unicast Routing API -@section Global Unicast Routing API - -The public API is very minimal. User scripts include the following: -@verbatim -#include "ns3/global-route-manager.h" -@end verbatim - -After IP addresses are configured, the following function call will -cause all of the nodes that have an Ipv4 interface to receive -forwarding tables entered automatically by the GlobalRouteManager: -@verbatim - GlobalRouteManager::PopulateRoutingTables (); -@end verbatim - -@emph{Note:} A reminder that the wifi NetDevice is not yet supported -(only CSMA and PointToPoint). - -@node Global Routing Implementation -@section Global Routing Implementation - -A singleton object (GlobalRouteManager) is responsible for populating -the static routes on each node, using the public Ipv4 API of that node. -It queries each node in the topology for a "globalRouter" interface. -If found, it uses the API of that interface to obtain a "link state -advertisement (LSA)" for the router. Link State Advertisements -are used in OSPF routing, and we follow their formatting. - -The GlobalRouteManager populates a link state database with LSAs -gathered from the entire topology. Then, for each router in the topology, -the GlobalRouteManager executes the OSPF shortest path first (SPF) -computation on the database, and populates the routing tables on each -node. - -The quagga (http://www.quagga.net) OSPF implementation was used as the -basis for the routing computation logic. -One benefit of following an existing OSPF SPF implementation is that -OSPF already has defined link state advertisements for all common -types of network links: -@itemize @bullet -@item point-to-point (serial links) -@item point-to-multipoint (Frame Relay, ad hoc wireless) -@item non-broadcast multiple access (ATM) -@item broadcast (Ethernet) -@end itemize -Therefore, we think that enabling these other link types will be more -straightforward now that the underlying OSPF SPF framework is in place. - -Presently, we can handle IPv4 point-to-point, numbered links, as well -as shared broadcast (CSMA) links, and we do not do equal-cost multipath. - -The GlobalRouteManager first walks the list of nodes and aggregates -a GlobalRouter interface to each one as follows: -@verbatim - typedef std::vector < Ptr<Node> >::iterator Iterator; - for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++) - { - Ptr<Node> node = *i; - Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> (node); - node->AggregateObject (globalRouter); - } -@end verbatim - -This interface is later queried and used to generate a Link State -Advertisement for each router, and this link state database is -fed into the OSPF shortest path computation logic. The Ipv4 API -is finally used to populate the routes themselves. - -@node Optimized Link State Routing (OLSR) -@section Optimized Link State Routing (OLSR) - -This is the first dynamic routing protocol for @command{ns-3}. The implementation -is found in the src/routing/olsr directory, and an example script is in -examples/simple-point-to-point-olsr.cc. - -The following commands will enable OLSR in a simulation. - -@verbatim - olsr::EnableAllNodes (); // Start OLSR on all nodes - olsr::EnableNodes(InputIterator begin, InputIterator end); // Start on - // a list of nodes - olsr::EnableNode (Ptr<Node> node); // Start OLSR on "node" only -@end verbatim - -Once instantiated, the agent can be started with the Start() command, -and the OLSR "main interface" can be set with the SetMainInterface() -command. A number of protocol constants are defined in olsr-agent-impl.cc. -
--- a/doc/tutorial/sockets.texi Fri Jun 13 17:20:55 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,243 +0,0 @@ -@node Sockets APIs -@chapter Sockets APIs - -The @uref{http://en.wikipedia.org/wiki/Berkeley_sockets,,sockets API} -is a long-standing API used by user-space applications to access -network services in the kernel. A ``socket'' is an abstraction, like -a Unix file handle, that allows applications to connect to other -Internet hosts and exchange reliable byte streams and unreliable -datagrams, among other services. - -ns-3 provides two types of sockets APIs, and it is important to -understand the differences between them. The first is a @emph{native} -ns-3 API, while the second uses the services of the native API to -provide a @uref{http://en.wikipedia.org/wiki/POSIX,,POSIX-like} -API as part of an overall application process. Both APIs strive -to be close to the typical sockets API that application writers -on Unix systems are accustomed to, but the POSIX variant is much -closer to a real system's sockets API. - -@section ns-3 sockets API - -The native sockets API for ns-3 provides an interface to various -types of transport protocols (TCP, UDP) as well as to packet sockets -and, in the future, Netlink-like sockets. However, users are cautioned -to understand that the semantics are @strong{not} the exact same as -one finds in a real system (for an API which is very much aligned -to real systems, see the next section). - -@code{class ns3::Socket} is defined in @code{src/node/socket.cc,h}. -Readers will note that many public member functions are aligned -with real sockets function calls, and all other things being equal, -we have tried to align with a Posix sockets API. However, note that: - -@itemize @bullet -@item ns-3 applications handle a smart pointer to a Socket object, not -a file descriptor; -@item there is no notion of synchronous API or a ``blocking'' API; -in fact, the model for interaction between application and socket is -one of asynchronous I/O, which is not typically found in real systems -(more on this below); -@item the C-style socket address structures are not used; -@item the API is not a complete sockets API, such as supporting -all socket options or all function variants; -@item many calls use @code{ns3::Packet} class to transfer data -between application and socket. This may seem a little funny to -people to pass ``Packets'' across a stream socket API, but think -of these packets as just fancy byte buffers at this level (more -on this also below). -@end itemize - -@subsection Basic operation and calls - -@float Figure,fig:sockets-overview -@caption{Implementation overview of native sockets API} -@image{figures/sockets-overview, 10cm} -@end float - -@subsubsection Creating sockets - -An application that wants to use sockets must first create one. -On real systems, this is accomplished by calling socket(): -@verbatim - int - socket(int domain, int type, int protocol); -@end verbatim -which creates a socket in the system and returns an integer descriptor. - -In ns-3, we have no equivalent of a system call at the lower layers, -so we adopt the following model. There are certain @emph{factory} -objects that can create sockets. Each factory is capable of creating -one type of socket, and if sockets of a particular type are able to -be created on a given node, then a factory that can create such sockets -must be aggregated to the Node. -@verbatim - static Ptr<Socket> CreateSocket (Ptr<Node> node, TypeId tid); -@end verbatim -Examples of TypeIds to pass to this method are @code{TcpSocketFactory}, -@code{PacketSocketFactory}, and @code{UdpSocketFactory}. - -This method returns a smart pointer to a Socket object. Here is an -example: -@verbatim - Ptr<Node> n0; - // Do some stuff to build up the Node's internet stack - Ptr<Socket> localSocket = Socket::CreateSocket (n0, TcpSocketFactory::GetTypeId ()); -@end verbatim - -In some ns-3 code, sockets will not be explicitly created by user's -main programs, if an ns-3 application does it. For instance, for -@code{class ns3::OnOffApplication}, the function @code{StartApplication()} -performs the socket creation, and the application holds the socket -pointer. - -@subsubsection Using sockets - -Below is a typical sequence of socket calls for a TCP client in a -real implementation: -@itemize @bullet -@item @code{sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);} -@item @code{bind(sock, ...);} -@item @code{connect(sock, ...);} -@item @code{send(sock, ...);} -@item @code{recv(sock, ...);} -@item @code{close(sock);} -@end itemize - -There are analogs to all of these calls in ns-3, but we will focus on -two aspects here. First, most usage of sockets in real systems -requires a way to manage I/O between the application and kernel. -These models include @emph{blocking sockets}, @emph{signal-based I/O}, -and @emph{non-blocking sockets} with polling. In ns-3, we make use -of the callback mechanisms to support a fourth mode, which is -analogous to POSIX @emph{asynchronous I/O}. - -In this model, on the sending side, if the @code{send()} call were to -fail because of insufficient buffers, the application suspends the -sending of more data until a function registered at the -@code{SetSendCallback()} callback is invoked. An application can -also ask the socket how much space is available by calling -@code{GetTxAvailable ()}. A typical sequence of events for -sending data (ignoring connection setup) might be: - -@itemize @bullet -@item @code{SetSendCallback (MakeCallback(&HandleSendCallback));} -@item @code{Send ();} -@item @code{Send ();} -@item ... -@item @code{// Send fails because buffer is full} -@item (wait until HandleSendCallback() is called) -@item (HandleSendCallback() is called by socket, since space now available) -@item @code{Send (); // Start sending again} -@end itemize - -Similarly, on the receive side, the socket user does not block on -a call to @code{recv()}. Instead, the application sets a callback -with @code{SetRecvCallback ()} in which the socket will notify the -application when (and how much) there is data to be read, and -the application then calls @code{Recv()} to read the data until -no more can be read. - -@subsection Packet vs. buffer variants - -There are two basic variants of @code{Send()} and @code{Recv()} supported: -@verbatim - virtual int Send (Ptr<Packet> p) = 0; - int Send (const uint8_t* buf, uint32_t size); - - Ptr<Packet> Recv (void); - int Recv (uint8_t* buf, uint32_t size); -@end verbatim - -The non-Packet variants are left for legacy API reasons. When calling -the raw buffer variant of @code{Send()}, the buffer is immediately -written into a Packet and the @code{Send (Ptr<Packet> p)} is invoked. - -Users may find it semantically odd to pass a Packet to a stream socket -such as TCP. However, do not let the name bother you; think of -@code{ns3::Packet} to be a fancy byte buffer. There are a few reasons why -the Packet variants are more likely to be preferred in ns-3: - -@itemize @bullet -@item Users can use the Tags facility of packets to, for example, encode -a flow ID or other helper data. -@item Users can exploit the copy-on-write implementation to avoid -memory copies (on the receive side, the conversion back to a -@code{uint8_t* buf} may sometimes incur an additional copy). -@item Use of Packet is more aligned with the rest of the ns-3 API -@end itemize - -@subsection Sending dummy data - -Sometimes, users want the simulator to just pretend that there is an -actual data payload in the packet (e.g. to calculate transmission delay) -but do not want to actually produce or consume the data. This is -straightforward to support in ns-3; have applications call -@code{Create<Packet> (size);} instead of @code{Create<Packet> (buffer, size);}. -Similarly, passing in a zero to the pointer argument in the raw buffer -variants has the same effect. Note that, if some subsequent code tries -to read the Packet data buffer, the fake buffer will be converted to -a real (zero'ed) buffer on the spot, and the efficiency will be lost there. - -@subsection Socket options - -@emph{to be completed} - -@subsection Socket errno - -@emph{to be completed} - -@subsection Example programs - -@emph{to be completed} - -@section POSIX-like sockets API - -@emph{this capability is under development and is scheduled for -inclusion in August 2008 timeframe; see the repository -http://code.nsnam.org/mathieu/ns-3-simu for details} - -The below is excerpted from Mathieu's post to ns-developers list -on April 4, 2008. - -"To summarize, the goal is that the full posix/socket API is defined in -src/process/simu.h: each posix type and function is re-defined there -with a simu_ or SIMU_ prefix to avoid ugly name clashes and collisions -(feel free to come up with a better prefix). - -Each process is created with a call to ProcessManager::Create and is -attached to that ProcessManager instance. So, if the ProcessManager -(which is aggregated to a Node in src/helper/process-helper.cc) is -killed when the simulation ends, the system will automatically reclaim -all the resources of each process associated to each manager. The same -happens when an application "exits" from its main function. - -The example application defines two posix "processes": the function -ClientProgram creates a udp socket on the localhost port 2000 and the -function ServerProgram creates a udp socket on the localhost port 2000. -The code does not work right now because I did not get the details of -simu_read right yet but, I do plan to make this work at some point. - -I really think that this approach is worthwhile for many reasons, a few -of which are outlined below: -@itemize @bullet -@item makes porting real world application code _much_ easier - -@item makes write applications for new users much easier because they can -read the bsd socket api reference and documentation and write code -directly. - -@item can be used to write applications which work in both simulation and -in the real world at the same time. To do this, all you have to do is -write your application to use the simu_ API, and, then, you can chose at -compile-time which implementation of that API you want to use: you can -pick one implementation which forwards all calls to the system BSD -socket API or another one which forwards all calls to the attached -ProcessManager. Arguably, I did not implement the version which forwards -to system BSD sockets but, that should be pretty trivial. -@end itemize - -So, anyway, comments about the overall API would be welcome. Students -interested in the gsoc project for real-world code integration should -consider looking at this also." -
--- a/doc/tutorial/tutorial.texi Fri Jun 13 17:20:55 2008 -0700 +++ b/doc/tutorial/tutorial.texi Sun Jun 15 21:27:13 2008 -0700 @@ -92,21 +92,6 @@ * Statistics:: Part 4: Creating New or Revised Topologies * Helper Functions:: -* Other-network-topologies:: -Part 5: Key ns-3 objects and systems -* ns-3 Packets:: -* ns-3 Callbacks:: -* Sockets APIs:: -* ns-3 routing overview:: -Part 6: Extending ns-3 -* Nonlinear-Thinking:: -* Summary:: -* Object-Model:: -* The-Doxygen-Documentation-System:: -* How-To-Change-Things:: -* How-To-Set-Default-Values:: -* How-To-Write-A-New-Application:: -@ Troubleshooting @end menu @include introduction.texi @@ -114,13 +99,6 @@ @include attributes.texi @include statistics.texi @include helpers.texi -@include packets.texi -@include callbacks.texi -@include sockets.texi -@c @include output.texi -@include routing.texi -@c @include other.texi -@include troubleshoot.texi @printindex cp