-1

I need to save all the sent ping packets in a .pcap format to work on it latter but when I try to save them there is no packet in the file and its empty. I would be thankful if someone could tell me which part I'm doing wrong.here is the code I'm using to capture ping packets.

**.crcMode = "computed"               
**.fcsMode = "computed"           
**.numPcapRecorders = 1                          
**.pcapRecorder[1].pcapLinkType = 105    
**.pcapRecorder[1].pcapFile = "results/all2.pcap" 
**.pcapRecorder[1].verbose = true            
**.pcapRecorder[1].alwaysFlush = true              
**.pcapRecorder[1].packetFilter = "ping* or Ping*"

Thanks in advance for your help.

Bests,

h.bahar
  • 1
  • 2

1 Answers1

1

The array indexing starts at 0. So if there is only one PCAP recorder per module, it is pcapRecorder[0].

adamgeorge309
  • 301
  • 1
  • 6
  • actually there are two and the other one just works fine but I cant capture ping packets. – h.bahar Nov 25 '21 at 12:31
  • According to your configuration `**.numPcapRecorders = 1`, there is a **single** PCAP recorder configured, so @adamgeorge309 is correct that using index 1 does NOT match anything in your network. – Rudi Nov 25 '21 at 13:49
  • you are right, I'm sorry It was a typo here, in my code it is ok as you said, but seems there is something wrong with my filter. – h.bahar Nov 25 '21 at 14:14
  • Does it work if you use * as the filter? – adamgeorge309 Nov 26 '21 at 09:17
  • Also, is the link layer header type set correctly? It's currently set to 802.11, which might be correct depending on where you are capturing packets. – adamgeorge309 Nov 26 '21 at 10:18
  • yes it works with ARP packets and * but not ping. about the second question I dont understand you, but I'm using PingApp to send pings. – h.bahar Nov 27 '21 at 13:21
  • Regarding the second question, apparently, the link-layer header type is no longer a parameter of the PCAP recorder module (it figures it out automatically now). So the question is irrelevant. – adamgeorge309 Nov 29 '21 at 10:12
  • sorry, I'm new to Omnet++ and I didn't get you, would you please tell me if there is any way to do so? I need to know how many packets and from which source to what destination in what time is sent? so using PingApp I should do something else? – h.bahar Nov 29 '21 at 15:21
  • It works for me in INET 4.3 – adamgeorge309 Dec 01 '21 at 13:33
  • would you please tell me the filter you are using? – h.bahar Dec 04 '21 at 22:45
  • I used the same filter you used in the code above, ping* or Ping* – adamgeorge309 Dec 06 '21 at 09:01