Home > Experiential Learning > Experiential Learning of Networking Technologies: Understanding Network Delays

Experiential Learning of Networking Technologies: Understanding Network Delays

Experiment 4


This is an experiment to understand the impact of queuing and processing delays. The setup is identical to Experiment 3, but now the server application on Hb can spawn multiple server processes. To minimize noise in the timing measurements, these processes are pre-spawned by the server application, before it receives any client requests. Thus, there is no processing overhead of spawning child processes, which can vary depending upon the machine status. In our setup, the server application spawns three child processes, and thus the server can handle three concurrent client requests.

The reader should now replicate the earlier experiment with tsleep = 10 ms, and start the three concurrent clients. The average response time for each client program drops from about 20 ms to about 13.2 ms since the server’s CPU is free to handle each client’s request using separate processes. There is no queuing delay as each client request is processed by a separate application process.
We note that if the processing delay was due to CPU-bound computation on the server, the above strategy may exacerbate the delay especially on a single core CPU. For a multi core CPU system, as long as the number of server applications is less than number of CPU cores and each server process is assigned a different core, processing delay of one server application will not impact the processing by other server application. However, when processing delay of application is higher and leads to queuing of request, a different approach would be necessary, such as improving the algorithmic efficiency of the computation, using additional servers, etc.

Concluding Remarks


The end-of-semester feedback given by students on this experiential learning approach has been very encouraging. The students taught using this approach have fared much better, both in getting better jobs as well as later in professional life. A large number of them have said this has kindled their interest in the field of networking. Prior to this approach, students used to find the subject dry and difficult to understand.


Appendix I


Partial sample code of client and server program for experiments.

Client program code sample:

import socket
import time

sock = socket.socket(socket.AF_INET,
srvr_addr = (‘’, 9997)

sum = 0.0
for i in range(1,1000):
start_time = time.time()
sent = sock.sendto(msg, srvr_addr)
data, server = sock.recvfrom(4096)
end_time = time.time()
sum = sum + end_time – start_time

#compute resp time for one request
resp_time = sum / 1000

print “Resp time = “, resp_time


Server program code sample:

import socket
import time

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_address = (‘’, 9997)

while True:
data, addr = sock.recvfrom(2000)
if data:
time.sleep(.010) #srv proc time
sent = sock.sendto(data, addr)



[1] ACM/IEEE Computer Society, “Computer Science Curricula 2013: Curriculum Guidelines for Undergraduate Degree Programs in Computer Science”, Joint Task Force on Computing Curricula, Association for Computing Machinery (ACM) and IEEE Computer Society, ACM, New York, NY, 2013.

[2] RFC 768, “User Datagram Protocol (UDP),”, Request for Comments 768. John Postel, ISI, August 1980.

[3] Kurose, Ross, “Computer Networks: A Top Down Approach” 7th edition, Pearson Education Inc, 2016.

[4] Peterson, Davie, “Computer Networks: A Systems Approach” 5th edition, Morgan Kaufmann, 2012.

[5] Forouzan, “Data Communications and Networking”, 4th edition, The McGraw-Hill, 2011.

[6] Wireshark: https://www.wireshark.org,  Last accessed 2017-11-30.

[7] Grigorik, “High Performance Browser Networking, Chapter 10”, O’Reilly, 2014.

Pages ( 4 of 4 ): « Previous123 4