sequence number algorithm

Hello everyone. My goal in this program is to create a network packet that send request by using sequence number. I wanted to combine two sequence number in one packet (for example, /prefixseq0 and /prefixseq1 in one packet) and the replying packet also consist of this two sequence number. the next requesting packet will consist of /prefixseq2 and /prefixseq3 in one packet and so on.
i think the problem for me is with this line nameWithSequence->appendSeqNum (seq); function to append the sequence number to the packet.

I tried different combinations but it didnt work. Any help would be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
uint32_t seq=std::numeric_limits<uint32_t>::max (); //invalid
 while (m_retxSeqs.size ())
    {
      seq = *m_retxSeqs.begin ();
      m_retxSeqs.erase (m_retxSeqs.begin ());
      break;
    }

  if (seq == std::numeric_limits<uint32_t>::max ())
    {
      if (m_seqMax != std::numeric_limits<uint32_t>::max ())
        {
          if (m_seq >= m_seqMax)
            {
              return; // we are totally done
            }
        }

      seq = m_seq+=2;
    }

  //
  Ptr<Name> nameWithSequence = Create<Name> (m_interestName);
  nameWithSequence->appendSeqNum (seq);// & << seq+1;


  Ptr<Interest> interest = Create<Interest> ();
  interest->SetNonce               (m_rand.GetValue ());
  interest->SetName                (nameWithSequence);
  interest->SetInterestLifetime    (m_interestLifeTime);

  // NS_LOG_INFO ("Requesting Interest: \n" << *interest);
  NS_LOG_INFO ("> Interest for"  << seq << "and" << seq+1) ;
Last edited on
Topic archived. No new replies allowed.