Printf statements in Qualnet 6.1 and regarding trace file

0 views
Skip to first unread message

kanwal.p...@gmail.com

unread,
Mar 28, 2014, 2:13:14 PM3/28/14
to Qualn...@googlegroups.com
Dear Ankur,

I am working on QoS of  ODMRP protocol. I am facing a very basic problem. I just want to know first of all, where does the output of printf statements present in the code get displayed in Qualnet. I want to compute time taken by a join query message from one node to the other node. For that purpose I edited code of multicast_odmrp.cpp as follows:
1) I added one variable in the join query packet  named "timeStamp"

typedef struct
{
    unsigned char  pktType;
    unsigned char  reserved;
    unsigned char  ttlVal;
    unsigned char  hopCount;
    NodeAddress  mcastAddress;
    int          seqNumber;
    NodeAddress  srcAddr;
    NodeAddress  lastAddr;
    unsigned int protocol;
    clocktype timeStamp;
} OdmrpJoinQuery;

2) In the function odmrpSendQuery() , there already exists code for generating time at which join query is send

clocktype randDelay = (clocktype)
        (RANDOM_erand(odmrp->broadcastJitterSeed) * ODMRP_BROADCAST_JITTER);

I simply stored this value in my variable and sent the Join query message. So that when received at another node, difference between the value of this variable and the time value when packet is received at that node could be taken out to find out the propagation delay.
So I added this code to the already existing code , where the values of other variables of the packet are set :

3) option.timeStamp = randDelay;
    printf ("Value of timesStamp is %d ", option.timeStamp);

 There is no compilation error for this code in Microsoft Visual C++ 2010. But when I run a particular ODMRP scenario to see the output of this printf statement in Quanet GUI output window, nothing is displayed over there. I want to see value of this variable and want to print it in output window , when my scenario runs. We can display error messages in Qualnet GUI output window, But how to print the normal printf statements, or is there any other syntax for the same and I am using the wrong one. If so, please correct me. I don't want to use finalization function for this variable, as we normally do to print the output in analyzer. I just want to see the value in the printf statement. 

4) And if you think time taken by a join query mesage from node1 to node 2 gets displayed in trace file of the scenario, then please help and guide , how to read the trace file , as no such information is even provided in programmer' guide. Trace file just have codes for different protocols. I am not able to simplify the details of a trace file. Please post any help material regarding Qualnet's trace file if you have, as in case of NS2 we get all this info easily from trace file only. 

Please spare some time from your busy schedule to answer this query. As we are beginners in Qualnet, need your guidance.

Thanks
Kanwal
Reply all
Reply to author
Forward
0 new messages