Client–server model: HTTP requests, caching, queues, peer-to-peer and GET vs POST

Computer ScienceNetworks & the InternetAges 17–18

Loading…

Use with my class ✨ Customize with AI Report a problem

Many clients keep sending HTTP requests to one server. A request that hits the cache is answered instantly, while the rest must queue and wait for the server, which processes them one by one at a rate that depends on page size and bandwidth. Students raise the number of users to watch the queue grow and response time spike once demand outruns capacity, then raise the cache hit rate or bandwidth to bring the system back to normal. A peer-to-peer view sends the same file to N computers through one server and through the peers themselves, comparing time, load per node and resilience when the server or peers go offline; a form view shows GET and POST requests, with or without HTTPS.

Lesson: Client–server and peer-to-peer networks: HTTP requests and responses, GET and POST, caching, bandwidth and server load

What it shows

On the web a browser, the client, sends an HTTP request and a server sends back the page. In the queue view, requests that hit the cache are answered at once and the rest wait; when requests reaching the server times the service time, the utilization ρ, reaches 1, the queue grows without limit. The peer-to-peer view compares sharing a file: a server alone needs N·F ÷ u_s, while peers that pass pieces on keep the time almost flat as N grows and survive the server leaving. The form view shows GET data in the URL, POST data in the body, and what HTTPS hides.

How to use

In the default view press Run, raise Requests arriving per second until the overload warning appears, then fix it with Cache hit rate or Server bandwidth. Switch View to the peer-to-peer comparison, add peers and compare the two finishing times and server loads; press Server goes offline or 25% of peers leave mid-download. In the GET and POST view, submit the Log in form with each method and with HTTPS, and compare the address bar, history and eavesdropper panel.

Parameters you can change

  • Requests arriving per second 1–60 requests/s
  • Cache hit rate 0–95 %
  • Server bandwidth 1–200 Mbps
  • Page size 50–3000 KB
  • Simulation speed 1–5 x
  • View Client–server: requests and queue, Client–server vs peer-to-peer (file sharing), Form submission: GET and POST
  • Number of peers (P2P view) 2–40 peers
  • File size (P2P view) 10–1000 MB
  • Upload speed of each peer (P2P view) 1–100 Mbps
  • Form method (GET/POST view) GET, POST
  • Use HTTPS (GET/POST view)

Questions to explore

  1. Why does a higher cache hit rate reduce the load on the server?
  2. With 40 Mbps of bandwidth, how many 3000 KB pages per second can the server send?
  3. When the queue keeps growing, does raising bandwidth or the cache hit rate fix it faster?