This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Who send data first after TCP connection is established?

0

Hello everybody.

Maybe is just a silly question but I have no clear answer.

When I see examples of TCP three way handshake (even those shown in RFC 793), the device which first send the SYN segment (client) is always the device which, after connection is estableshed, begins sending data to the device which was listening (server).

But is the opposite possible? Can the server begin sending data after connection is estableshed by the client? Is this documented anywhere? Could you provide some samples? I didn't find anything regarding this question.

Regards.

asked 03 Oct '13, 07:58

selecnor's gravatar image

selecnor
11224
accept rate: 0%


2 Answers:

3

Can the server begin sending data after connection is established by the client?

Certainly !

The sequence of transmissions depends completely upon the programming of the 'client' and the 'server'.

In fact, the two sides might be 'peers' with each sending data to the other simultaneously.

IOW: the TCP connection provides two one-way pipes (A-->B & B-->A) which can be used however desired and with whatever co-ordination between the pipes is desired.

answered 03 Oct '13, 08:37

Bill%20Meier's gravatar image

Bill Meier ♦♦
3.2k1850
accept rate: 17%

Thank you, clear and short explanations as i needed. By the way, how does awarding point work? ;-)

(03 Oct '13, 08:56) selecnor
1

(Hit the 'accept' button (checkmark icon) to the left of the answer to 'accept' the answer; points will be awarded).

(03 Oct '13, 09:08) Bill Meier ♦♦

by the way, just as an example of the sender sending data after the handshake you could take a look at a passive FTP-DATA session.

(03 Oct '13, 09:41) Jasper ♦♦

But what then happens if, suppose, both the client and server send a message simultaneously — wouldn't the TCP of both sides then wait for ack message, which, of course, never appear because they both are awaiting?

(23 Apr '15, 01:40) Hi-Angel
1

Sending and receiving are independently handled and guarded by timers. If the timer expires before a new segment is send an 'empty' TCP packet will be send anyway just to convey the flags and protocol values.

(23 Apr '15, 04:30) Jaap ♦

2

Other examples include Telnet (which isn't used that much) which will advertise capabilities and a prompt, as well as a modern version SSH. Here you can see after the 3-way handshake, in frame 266, the Server advertises what type of SSH server it is, without input from the client.alt text

answered 03 Oct '13, 18:07

martyvis's gravatar image

martyvis
8911525
accept rate: 7%