I am sending this custom packet over a TCP socket
pkt = IP(len=16384, src='192.168.240.243', dst=ip,
id=RandShort(), ttl=64)/TCP(sport=5000,
dport=5000, flags="S", window=200,
options=[('MSS', 1460), ('WScale', 2)])/CustomLayer(type=1, update=2)/"SENT"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((ip, 5000))
except socket.error:
print 'User not connected'
spkt = str(pkt)
s.send(spkt)
The packet is correctly sent and received, but I can't send more than one. If I try for example to include this in a while(i<10), only one packet is received, the others are marked as [TCP Retransmission] looking in Wireshark.
How can I send the packet more than once within the same socket?