Why application protocols enable user services in Computer Networks - Performance Analysis
We want to understand how the time needed to use application protocols changes as more users or data are involved.
How does the work grow when the protocol handles more requests or services?
Analyze the time complexity of the following simplified protocol interaction.
for user_request in requests:
parse_request(user_request)
find_service_handler(user_request.type)
process_request(user_request)
send_response(user_request)
This code shows how an application protocol handles multiple user requests one by one.
Look for repeated actions in the code.
- Primary operation: Looping over each user request to process it.
- How many times: Once for every request received.
As the number of user requests grows, the total work grows too.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | About 10 times the work |
| 100 | About 100 times the work |
| 1000 | About 1000 times the work |
Pattern observation: The work grows directly with the number of requests.
Time Complexity: O(n)
This means the time to handle requests grows in a straight line as more requests come in.
[X] Wrong: "Handling more requests takes the same time as handling one request."
[OK] Correct: Each request needs its own processing, so more requests mean more total time.
Understanding how protocols scale with requests helps you explain system behavior clearly and confidently.
"What if the protocol handled multiple requests at the same time? How would the time complexity change?"