[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in CBR packet sequence numbers?




Hi all,

I was trying to monitor the sequence numbers of packets sent out by a CBR
source, and wrote a command function to return the sequence number (in
cbr_traffic.cc). However I found that the sequence number returned was
always zero, even though the seqno_ is incremented in the next_interval() 
function.  

It looks like the seqno_ gets reset to zero each time a packet is
transmitted. In that case, is the sequence number stored in some other
place, or does the packet get stamped with the same sequence number (0 or
1) each time?

I did a small hack by adding a variable myseq_ and incrementing it in the
next_interval() function. This works perfectly. I'm attaching the command
function I used to test this.

Thanks,
Amol


//Replace myseq_ with seqno_ to check out the actual sequence no.
int CBR_Traffic::command(int argc, const char*const* argv)
{
        Tcl& tcl = Tcl::instance();
        if (argc == 2) {
                if (strcmp(argv[1], "seqno") == 0) {
                        tcl.resultf("%d", myseq_);
                        // printf("\n seq no = %d",myseq_);
                        return (TCL_OK);
                }
        }

        return (TrafficGenerator::command(argc, argv));
}