Home | | Network Programming and Management | Crashing of Server Host

Chapter: Network Programming and Management : Application Development

Crashing of Server Host

Next scenario is to see what happens when the server host crashes. To simulate this we must run the client and server on different hosts. We then start server, start the client, type in a line to the client to verifyIT2351-NPM/ U-2/ 13 that the connection is up, disconnect the server host from the network, and type in another line at the client.

Crashing of Server Host:

 

Next scenario is to see what happens when the server host crashes. To simulate this we must run the client and server on different hosts. We then start server, start the client, type in a line to the client to verifyIT2351-NPM/ U-2/ 13 that the connection is up, disconnect the server host from the network, and type in another line at the client. This also covers the scenario of the server host being unreachable when the client sends data (some immediate router is down after the connection has been established).

The following steps take place.

1.    When the server host crashes, nothing is sent out on the existing network connections. That is we are assuming the host crashes, and is not shut down by the operator

 

2.    We type a line of input to the client, it is written by writen and is sent by the client TCP as a data segment. The client then blocks in the call to readline waiting for the echoed reply.

 

If we watch the network with tcpdump, we will see the client TCP continually retransmit the data segment, trying to receive ACK from the server. Berkley derived implementations transmit the date segments 12 times, waiting around 9 minutes before giving up. When the client finally gives up, an error is returned to the client process. Since the client is blocked in the call to readline, it returns an error. Assuming the server host had crashed and there were no responses  at all to the client‘s data segments, the error is ETIMEDOUT. But if some intermediate router determine that the server was unreachable and responded with ICMP destination unreachable

message, then error is either EHOSTUNREACH or ENETUNREACH.

 

To detect that the server is unreachable even before 9 minutes, place a time out call to readline. To find the crash of server even if client is not sending data actively, another technique is used which used SO_KEEPALIVE socket option

 

Shutdown of Server

 

When a Unix system is shutdown, the init process normally sends the SIGTERM signal to all processes ( this signal can be caught), waits some fixed amount of time (often between 5 and 20 seconds), and then sends SIGKILL signal (which we cannot catch) to any process still running. This gives all running processes a short amount of time to clean up and terminate.

 

If we do not catch SIGTERM and terminate, our server will be terminated by SIGKILL signal.

 

When the process terminates, all the open descriptors are closed, and we then follow the same sequence of stepsdiscussed under ―termination of server process.

 

We need to select the select or poll function in the client to have the client detect the termination of the server process as soon it occurs.

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Network Programming and Management : Application Development : Crashing of Server Host |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.