How to generate icmp packets with increamented sequence number

590 views
Skip to first unread message

jigs9...@gmail.com

unread,
Feb 11, 2014, 8:46:55 AM2/11/14
to osti...@googlegroups.com
Hi,
 
Can anyone please suggest me how to generate ICMP stream with increamented sequence number. I tried to generate ICMP stream but I always get seq no as '0'.
 
ICMP 60 Echo (ping) request  id=0x04d2, seq=0/0, ttl=127
ICMP 60 Echo (ping) request  id=0x04d2, seq=0/0, ttl=127
ICMP 60 Echo (ping) request  id=0x04d2, seq=0/0, ttl=127
ICMP 60 Echo (ping) request  id=0x04d2, seq=0/0, ttl=127
 
In ''Internet Control Message Protocol' feild I kept sequence as '0'. Do I need to set this to have icmp packets with increamented sequence number?
 
Thanks and regards
Jigar

Srivats P

unread,
Feb 13, 2014, 8:10:01 AM2/13/14
to Jigar Prajapati, ostinato
As implemented currently the ICMP protocol builder doesn't allow you
to increment the sequence number. You can instead use a userscript to
simulate ICMP and populate incrementing sequence number.

You will need to use the advanced mode to populate the list of
protocols in the stream - use "UserScript" instead of ICMP and use the
below userscript -

protocol.protocolFrameSize = function() { return 8; }

protocol.protocolFrameValue = function(index)

{

var type = 8; // Echo Request

var code = 0;

var id = 0x9127; // example value

var seq = 0x1234+index; // example value

var sum = (type << 8 | code) + id + seq + (0xFFFF &
~protocol.protocolFramePayloadCksum());

var pfv = new Array(8);

pfv[0] = type;

pfv[1] = code;

while(sum>>16)

sum = (sum & 0xFFFF) + (sum >> 16);

sum = ~sum;

pfv[2] = sum >> 8;

pfv[3] = sum & 0xFF;

pfv[4] = id >> 8;

pfv[5] = id & 0xFF;

pfv[6] = seq >> 8;

pfv[7] = seq & 0xFF;

return pfv;

}

protocol.protocolId = function() { return 0x1; }

protocol.protocolFrameValueVariable = false;

protocol.protocolFrameVariableCount = 10;

Srivats
> --
> Get Ostinato News and Updates on Twitter - Follow @ostinato
> (http://twitter.com/ostinato)
> ---------
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To post to this group, send email to osti...@googlegroups.com
> To unsubscribe from this group, send email to
> ostinato+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ostinato?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ostinato+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
http://ostinato.org/
@ostinato
Reply all
Reply to author
Forward
0 new messages