Transmission media (wired, wireless) in Computer Networks - Time & Space Complexity
When studying transmission media, it is important to understand how the time to send data changes as the amount of data grows.
We want to know how the time needed to transmit data increases when we send more information over wired or wireless media.
Analyze the time complexity of the following data transmission process.
function transmitData(dataSize, mediaSpeed) {
for (let i = 0; i < dataSize; i++) {
sendBitOverMedia(i, mediaSpeed);
}
}
function sendBitOverMedia(bitIndex, speed) {
// Simulates sending one bit over the media at given speed
wait(1 / speed);
}
This code simulates sending each bit of data one by one over a transmission medium at a certain speed.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Sending each bit individually over the media.
- How many times: Exactly once per bit, so the number of times equals the data size.
As the data size increases, the total time to send all bits grows directly with it.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 bits | 10 send operations |
| 100 bits | 100 send operations |
| 1000 bits | 1000 send operations |
Pattern observation: Doubling the data size doubles the number of send operations and thus the time.
Time Complexity: O(n)
This means the time to send data grows in direct proportion to the amount of data being sent.
[X] Wrong: "Sending data over wireless is always slower regardless of data size."
[OK] Correct: The time depends mainly on data size and media speed, not just the type. Wireless can be fast or slow depending on conditions.
Understanding how transmission time scales with data size helps you explain network performance clearly and confidently in real-world discussions.
"What if we could send multiple bits at once instead of one by one? How would the time complexity change?"