1 / 12

GloMoSim

GloMoSim. Editing the Code…. Basic Structure. /application contains code for the application layer /bin for executable and input/output files /doc contains the documentation /include contains common include files /mac contains the code for the mac layer

melosa
Télécharger la présentation

GloMoSim

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.

E N D

Presentation Transcript


  1. GloMoSim Editing the Code…

  2. Basic Structure /application contains code for the application layer /bin for executable and input/output files /doc contains the documentation /include contains common include files /mac contains the code for the mac layer /main contains the basic framework design /network contains the code for the network layer /radio contains the code for the physical layer /transport contains the code for the transport layer /scenarios contains directories of various sample configuration topologies

  3. In the Directory • All Code is in C • Find the protocol you want to edit • For Example: ODMRP • Network Layer • ODMRP.H and ODMRP.PC • Header File • Basic Definition of all your functions and data objects • PC File • Actual Functions

  4. Layers • Code is very layered • Pass messages between layers • Usually a general Layer library interfaces with a specific library • Network.pc • ODMRP.pc • ZRP.PC • In between layer communication done by • Glomo_**** Functions

  5. Sample code typedef struct{ unsigned char query; NODE_ADDR lastAddr; unsigned char seqNumber; unsigned char hopCount; } OdmrpIpOptionType; • Read code along with IETF Documentation • Do a google search for protocol spec that you are studying

  6. Obtaining the Data • Data is Printed to Glomo.Stat • Select what layer you want the statistics for • Config.in APPLICATION-STATISTICS YES TCP-STATISTICS NO UDP-STATISTICS NO ROUTING-STATISTICS NO NETWORK-LAYER-STATISTICS NO MAC-LAYER-STATISTICS NO RADIO-LAYER-STATISTICS NO CHANNEL-LAYER-STATISTICS NO MOBILITY-STATISTICS NO

  7. Sifting through the Data • Sample Output from 1 node: Glomo.stat Node: 0, Layer: RoutingOdmrp, Number of Join Queries Txed = 91 Node: 0, Layer: RoutingOdmrp, Number of Join Replies Txed = 0 Node: 0, Layer: RoutingOdmrp, Number of Acks Txed = 0 Node: 0, Layer: RoutingOdmrp, Number of CTRL Packets Txed = 91 Node: 0, Layer: NetworkIp, Number of Packet Attepted to be Sent to MAC: 91 Node: 0, Layer: NetworkIp, Number of Packets Routed For Another Node: 1595 Node: 0, Layer: NetworkIp, Number of Packets Delivered To this Node: 0 • Stats Printed for Each Node • You’ll Probably need to add Statistics

  8. Adding Stats • Go through Header and search for Stat /* Total number of join query txed. */ int numQueryTxed; • Add your counter here • Edit the initialize function in the code • Search for InitStats in .PC • Initialize your extra stat to zero • Add code to increment your counter • Edit the “Finalize” function • Add a print statement in there.

  9. Scheduling Events • Two type of Messages • Packets/ Cell Messages • Inter-node packets • Inter-layer packets • Non-Packet Messages • Inter-layer event messages • Self scheduled (timer) events

  10. Message Parameters • Message Destination: • Node ID • Layer in that node • Protocol in that layer (optional) • Instance (Interface) optional • Message Event Type • Event Specific Parameters called info • Both packets and non-packet messages • Packet payload • Current header position

  11. Message Functions • GLOMO_MsgAlloc(node, destId, layer, protocol, event_type); • GLOMOsgAddHeader(node, msg, header_size) • GLOMO_MsgSend(node, msg, delay); • GLOMO_MsgFree(node,msg); • GLOMO_MsgCopy(node,msg);

  12. Layer Interaction With Events • Packets going through layers are annotated with information that simulate inter-layer parameter passing • Likewise for Non packets and self events • Packets are sent to event handler • C structures are used to define set of parameters for simulated API function call: typedef struct { NODE_ID sourceID; } PacketMacToRadio; • Each event type must be given its unique (within its context) “Event Type ID” number.

More Related