Hi everyone, first of all this is my first post on StackOverflow \o/
Well, for my job I have to build an "nbnsStrom" script to study his comportement on FWs. An original (compiled) virus send at 25 000 packet/second when mine laboriously reach 1000 packet/second. I tried multithreading but my CPU is already at 100% with my original script. Do I need to port my script in C or I missed something with python performance.
My main function
def main():
packets_sent = 0
c_range = ip_ranges() #return a list
packet = Ether()/ IP()/UDP(sport=137,dport=137,len=58)/NBNSQueryRequest(FLAGS=0x0110, QUESTION_NAME='WPAD')
start_time = time.time()
for ip in c_range:
packet[IP].dst = ip
sr1(packet, verbose=False)
packets_sent +=1
timer = time.time() - start_time
print "ratio : "+` packets_sent/timer`+" p/s"
Thank you for reading and please, excuse my english which is not my native language, Cheers !