Danjel
Danjel

Reputation: 81

How to send ACK with data payload using python

I am trying to send an ACK with a data payload using the socket library but I cannot understand how to do it.

Is this supported and if not, what are the alternatives?

Upvotes: 0

Views: 4335

Answers (3)

Danjel
Danjel

Reputation: 81

As my python script was acting as a TCP server, all I had to do is use the socket.send() method to send the data payload.

This is how it looks in wireshark

enter image description here

1st line : script/server is receiving the data from client

2nd line : ack from server

3rd line: script is sending the data payload

4th line: ack from client

Although this is not a data payload in the 1st ACK, the client treated the reply as a successful one.

Upvotes: 0

ofrommel
ofrommel

Reputation: 2177

Take a look at Scapy. You can forge all the packets you want with it and it's a fairly simple API.

Upvotes: 1

Ali Aqrabawi
Ali Aqrabawi

Reputation: 143

you can't do this , Socket library uses high level APIs like : bind() listen() accept() ... etc

the acks will be handled for you ,

Upvotes: 0

Related Questions