I
I
Ilya Kaznacheev2014-06-28 19:49:39
Computer networks
Ilya Kaznacheev, 2014-06-28 19:49:39

How to acknowledge receipt of a TCP data packet and start transmitting?

I am a server I establish a connection via 3 way handshake, then I start receiving data from the client:

IP header
  |-Version 		: 4
  |-IP Header Length 	: 5
  |-Type of Service 	: 0
  |-Identification 	: 26888
  |-TTL 		: 64
  |-Flag 		: 2
  |-Offset 		: 0
  |-Protocol 		: 6
  |-IP Chechsum 	: 54121
  |-Source Address 	: 127.0.0.1
  |-Dest. Address 	: 127.0.0.1

TCP header
  |-Source Port 	: 37987
  |-Dest Port 		: 8000
  |-Sequence Number 	: 568308831
  |-Acknowledgement 	: 1354809856
  |-TCP offset 		: 5
  |-TCP flag 		: 24 (PSH ACK)
  |-Window 		: 43690
  |-Checksum 		: 65144
  |-Urgent Pointer 	: 0

Data : 
GET mysite.com?addr=index.html HTTP/1.1
Host: 127.0.0.1:8000
Accept-Encoding: identity


Then I answer him with an ACK packet, the offset in Acknowledgment for the length of the received data is 96 (returns len(), apparently with carriage return characters, etc.)

IP header
  |-Version 		: 4
  |-IP Header Length 	: 5
  |-Type of Service 	: 0
  |-Identification 	: 2
  |-TTL 		: 64
  |-Flag 		: 2
  |-Offset 		: 0
  |-Protocol 		: 6
  |-IP Chechsum 	: 15564
  |-Source Address 	: 127.0.0.1
  |-Dest. Address 	: 127.0.0.1

TCP header
  |-Source Port 	: 8000
  |-Dest Port 		: 37987
  |-Sequence Number 	: 1354809856
  |-Acknowledgement 	: 568308927
  |-TCP offset 		: 5
  |-TCP flag 		: 16 (ACK)
  |-Window 		: 53270
  |-Checksum 		: 17592
  |-Urgent Pointer 	: 0

Data is empty


but the client sends me his data again and again! How to stop worrying and start living receiving packages and start sending? (the question is how to convey to the client that I have accepted everything and no longer need)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2014-06-28
@Color

Everything seems to be correct. Finally show the session dump from under
sudo tcpdump -i lo -X -v port 8000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question