Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

there is not a one-to-one correspondence between a packet and the length #12

Description

I modify the packet generator like this to send the random size packet:

         chunk.queue.ifindex = devices_registered[i];
         working = 1;

+        int offset = 0;

      for (j = 0; j < chunk_size; j++) {
+            
+            packet_size = rand() % 2 + 400;

              chunk.info[j].len = packet_size;
//        chunk.info[j].offset = j * PS_ALIGN(packet_size, 64);
+            chunk.info[j].offset = offset;
+           offset = PS_ALIGN(offset + packet_size, 64);

             if (num_flows == 0){

then I run the command like this:
./packet_generator -i xge0 -p 512 -s 64

I use the libpcap reading the packet at another mechine, use the libnids processing the packet, I find some packet's cap_length - linkoffset is less than ip header's ip total length , like this:

  caplen - linkoffset < ntohs(iph->ip_len)

But the length is not random, it is also the packet we build, it's length should be 401 , but when I receive, it is 400.

For help!!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions