views:

25

answers:

2

Say our client is sending the packets at a constant rate. Now, if server goes down temporarily there can be two situations

(We are using the TCP protocol)

1) The packet won't be delivered to the server. Consequently, the other packets in the line have to wait for the server to respond. And the communication can be carried out from there.

2) The packet won't be delivered and will be tried again, but the other packages won't be affected by this packet.

Say, packets A, B and C are to be transferred. While I am sending packet A the server goes down temporarily, then the packets B and C will be sent at the time they were initially scheduled to be or they will be sent once A is received by the server.

+1  A: 

When you say "goes down temporarily", what do you mean? I can see two different scenarios.

Scenario 1: The connection between Server and Client is interrupted.

Packet A is sent on its way. Unfortunately, as it is winding its ways through he cables, one cable breaks and A is lost. Meanwhile, depending on the exact state of the TCP windowing algorithm, packets B and C may or may not be sent (as that would depend on the window size, the size of A/B7C and the amount of as-yet unacknowledged bytes sent). I guess that is saying both your "1" and "2" may be right?

If B and/or C have been sent, there will be no ack of A, until it has been resent. If they have been sent, once A has arrived, the server will ack up until the end of the last frame received in sequence (so, C, if taht is the case).

Scenario 2: The sever goes down

If this happens, all TCP state will be lost and connections will have to be re-established after the server has finished rebooting.

Vatine
I am talking about Scenario 1. @I guess that is saying both your "1" and "2" may be right?
abhishekgupta92
is wat my is my problem.. both seem 2 b ryt.. but i hav 2 cum up wid 1 of dem.. or explain in which case.. which should be correct...
abhishekgupta92
@abhishekgupta92: What would happen depends on what you mean by "server goes down". If it's just the network in-between, either your 1 or your 2 could happen, depending on a whole host of variables.
Vatine
i meant that network in-between case..
abhishekgupta92
Well, then it would be either your 1 or your 2, depending on the TCP window size and what was last ACKed.
Vatine
+2  A: 

TCP is a stream-oriented protocol. This means that if, on a single TCP connection, you send A followed by B then the reciever will never see B until after it has seen A.

If you send A and B over separate TCP connections, then it is possible for B to arrive before A.

caf
thanks this solves my doubt :-)
abhishekgupta92