An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.Content is provided to you AS IS for your information and personal use only.Download presentation by click this link.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.During download, if you can't get a presentation, the file might be deleted by the publisher.
Event Type • Packet • exchange of data packet between layers or nodes • communication between entities at the same layer • Timer • act as a trigger • An event is identified by the following: • Node • Layer • Protocol • Event ID
Packet Event • to simulate transmission of packets across the network • using packet field of Message structure • at each layer, packet header is attached/removed • to send packet to another layer, MESSAGE_Send()
Timer Event • periodic alarms for event scheduling • trigger • the event types are defined in • HOME/include/api.h ★ The delay time 0 means “immediate event”.
QualNet Simulator Architecture • Initialization • Event Handling • Finalization ★ Each of these functions is performed hierarchically. Node Layer Protocol
Protocol Life Cycle Three main functions that are called by Simulator: • Initialization • Called at Time 0 • Initialization of variables • Event Processing • Called as needed • Creation • Scheduling • Handling • Finalization • Called at end of simulation • Printing Statistics
Protocol Life Cycle QualNet Event Handling: Packets, timers etc Initialization Function Message (Packet or Timer) Processing Function • Modify State Variables • Increment Local Statistics • Generate / Forward Packets QualNet FinalizationFunction
Event Handling • call a dispatcher function of appropriate node, layer, protocol when a event occurs • handle & scheduling event, change system states
Finalization • call finalization function for each protocol running at that layer • print the statistics to output • free all instances and terminate simulation
2011.05.16. Adding a Network Layer Unicast Routing Protocol
Defining Data Structure for Protocol • In user’s Protocol.h • Protocol parameters • Protocol state • Statistics variables • Routing table AODV data structure in routing_aodv.h
IP callback functions • Network Layer routing protocol interacts with IP to route packets and to handle protocol events. • Routing protocol registers the functions with IP as part of initialization. • Home/libraries/developer/src/network_ip.cpp
APIs for MAC Layer Communication • APIs to communicate with MAC Layer for Network Layer Routing Protocols to handle an event (transmitting packets to a node’s peers using MAC Layer services)
Modifying IP Function • NetworkRoutingGetAdminDistance() • definition of the priority of routing protocol • HOME/libraries/developer/src/network_ip.cpp
Processing Routing Packets • Define IP Protocol Number for user’s protocol • HOME/libraries/developer/src/network_ip.h
DeliverPacket() • IP Protocol Number from IP header based switching • checking packet’s • routing protocol type • interface • call routing protocol’s packet handler function
Queue • the base class that is used to derive specific queue classes • queue variables • interface functions for queue operations • refer to Programmer’s Guide 4.4.7.1(p.207)Figure 4-99, Figure 4-100, Figure 4-101