COSC 6377: Introduction to Computer Networks

HW3: Investigating Latency

Due: November 15, 2023

Lets investigate latency on web apps.


Our HTTP server is lazy. It introduces unnecessary delay before it sends a response to the client. It introduces delays that are different for differnet students to try to fool them. Our goal is to investigate what this delay function is!


Write a program that sends a POST request to a webapp with HTTP payload formatted as if this is a request triggered by an HTML form submission with one form field "truncid". Truncid is the last two digits of your student id number. Lets call that number delay seed. If the first digit of the delay seed is 0, just use the second digit. If the two digits are 00, then use just 0. The IP address and port of the server will be provided to you in the class. The endpoint is "/delayme".


The server will respond with a json with one attribute "status". This attribute has one of two values: "GOOD" or "BAD". If your request is working correctly, it will return "GOOD". Run your code to make sure it is returning "GOOD" before moving to the next step.


We will now make some measurements. Instrument your code so that you can record the time between the request and the response. Make multiple measurements so that you have an idea about what the delay is. Analyze the delays to understand how the server may be computing the delay as a function of the provided "truncid". We have also provided an endpoint "/donotdelayme" that returns a response to your request without introducing any delay. You may find this second endpoint useful for your analysis but you are not required to use it if your investigation does not require it.


Please write a short report on how you investigated the delay introduced by the server and your conclusions. Please include graphs, tables, numbers, screenshots as necessary. Please include the code you wrote in the appendix of the pdf. Your submission should be a single pdf file.