hw6 - message from the server. • Server: the server...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI 415 Data Communication Networks Homework 6 Due 03/31/08 Saad Mneimneh Visiting Professor Hunter College of CUNY Nagle algorithm This problem intends for you to experiment with the effect of enabling/disabling Nagle’s algorithm. By default, the TCP implementation enables Nagle’s algo- rithm. To disable Nagle’s algorithm, a client may set the socket option as follows: #include <netinet/tcp.h> . . . socklen_t i; setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i)); (a) Modify the program of HW2 to do the following: Client: the client repeats the following 50 times: (1) send a message with one character, (2) send another message with one character, wait for a
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: message from the server. • Server: the server accepts messages from the client and sends a message back to the client only when the number of characters received is a multiple of 2. (b) Using the time() function which gives the number of seconds elapsed since 01/01/1900, measure the time it takes for the client to send all the characters. Estimate how much time the server waits before sending a non-biggybacked acknowledgement. For instance: #include <ctime> . . . time_t t1=time(0); //the code you need to measure the time for goes here time_t t2=time(0); cout<<t2-t1; (c) Repeat part (b) with Nagle’s algorithm disabled....
View Full Document

This note was uploaded on 03/27/2010 for the course CSCI 415 taught by Professor Saadmneimneh during the Spring '08 term at CUNY Hunter.

Ask a homework question - tutors are online