0
0
Computer Networksknowledge~5 mins

Transmission media (wired, wireless) in Computer Networks - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Transmission media (wired, wireless)
O(n)
Understanding Time 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.

Scenario Under Consideration

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 Repeating Operations

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.
How Execution Grows With Input

As the data size increases, the total time to send all bits grows directly with it.

Input Size (n)Approx. Operations
10 bits10 send operations
100 bits100 send operations
1000 bits1000 send operations

Pattern observation: Doubling the data size doubles the number of send operations and thus the time.

Final Time Complexity

Time Complexity: O(n)

This means the time to send data grows in direct proportion to the amount of data being sent.

Common Mistake

[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.

Interview Connect

Understanding how transmission time scales with data size helps you explain network performance clearly and confidently in real-world discussions.

Self-Check

"What if we could send multiple bits at once instead of one by one? How would the time complexity change?"