If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Computers and the Internet>Unit 3

Lesson 2: Connecting networks

# Bit rate, bandwidth, and latency

All of the computing devices on the Internet are communicating in binary. Whether they are connected via wired or wireless, they are sending electromagnetic signals that represent streams of 1s and 0s.
Let's explore how those bits are sent and how quickly they can be sent.

### Sending streams of 1s and 0s

When computers need to internally represent the number $5$ ($101$ in binary), they can use three wires to represent the three bits: one wire on, one wire off, one wire on.
If a computer wants to send the number $5$ to another computer, they can't use as many wires as they want. In fact, they may only have a single wire to send information over. Instead, they can send the number $5$ over three time periods: first sending an on pulse (and waiting), then sending nothing (and waiting), then sending an on pulse.
As long as the two computers agree on the time period, then they can transfer information to each other, turning binary data into signals and turning the signals back to binary data.
In an electrical connection (such as Ethernet), the signal would be a voltage or current. In an optical connection (such as a fiber-optic cable), the signal would be the intensity of light.
The process of turning binary data into a time-based signal is known as line coding. There are various line coding schemes that can be used based on the needs of the connection.

### Bit rate

Network connections can send bits very fast. We measure that speed using the bit rate, the number of bits of data that are sent each second.
The earliest Internet connections were just $75$ bps (bits per second). These days, connections are more often measured in Mbps (megabits per second).
A megabit is huge: $1$ million bits! A $10$ Mbps connection transfers data at $10$ million bits per second.
That's one bit every $100$ nanoseconds ($0.0000001$ seconds).
We also measure bit rate in smaller units like kilobits ($1$ thousand bits) or much bigger units like gigabits ($1$ billion bits) and even petabits ($1$ quadrillion bits).
UnitNumber of bits
kilobit$1000$$1$ thousand
megabit${1000}^{2}$$1$ million
gigabit${1000}^{3}$$1$ billion
terabit${1000}^{4}$$1$ trillion
petabit${1000}^{5}$$1$ quadrillion

### Bandwidth

We use the term bandwidth to describe the maximum bit rate of a system. If a network connection has a bandwidth of $100$ Mbps, that means it can't transfer more than $100$ megabits per second. Fortunately, that's still a lot!
Ever heard the term "broadband Internet"? That refers to a connection with a minimum bandwidth of $256$ Kbps. That's enough bandwidth for basic Internet use like checking emails and reading websites, but not quite enough for watching online videos. As of 2016, only 40% of people in developing nations have access to even broadband Internet.
When I was a kid, our Internet connection had a bandwidth of $56$ Kbps (kilobits per second). How many bits per second could that transfer?

### Latency

Another way to measure the speed of a computer network is latency. You might guess what that means from the word itself: latency measures how late the bits arrive. To put it in more formal terms: latency is the time between the sending of a data message and the receiving of that message, measured in milliseconds.
We typically measure the "round-trip" latency of a request. Let's walk through a real example to see what that means.
My computer sends a message to the Google server. $30$ milliseconds later, Google receives the message. $40$ milliseconds later, my computer gets an acknowledgement from Google that it received the message.
That's a total round-trip latency of $70$ ms. The latency depends on a number of physical factors: the type of connection from my computer to Google, the distance from my computer to the Google servers, and the congestion in the network (which may mean my request has to wait in line).
There's a major limiting factor to latency: the speed of light. Nothing can move faster than light, not even our very important Internet requests. The speed of light is $1$ foot per nanosecond, which means a trip length of at least $30$ ms from Los Angeles to Tokyo. We can't do much about the speed of light, but we can decrease latency by reducing congestion and improving our physical connections.

### Internet speed

Speed is a combination of bandwidth and latency. Computers split up messages into packets, and they can't send another message until the first packet is received. Even if a computer is on a connection with high bandwidth, its speed of sending and receiving messages will still be limited by the latency of the connection.
You can measure the current speed of a network using an Internet speed test: a website that downloads and uploads data while tracking how quickly the data is transferred.
Here are the results from an Internet speed test from my home laptop:
The latency (also called the ping rate) was just $18$ ms. That's fast enough for most multi-player online games.
The download bit rate is $39$ Mbps and the upload bit rate is $5.85$ Mbps, significantly less. Actually, that's expected. Internet providers often support a much faster download speed than upload speed, because Internet users spend much more time downloading data (reading articles, watching movies) than uploading data (writing blog posts, submitting forms).
🔍 What's the speed of your Internet connection? What bandwidth does your Internet provider promise? What type of physical connection are you using? This is a great opportunity to get a deeper understanding of the physical infrastructure you use every day.

## Want to join the conversation?

• Why is that 1kb=1000b, but 1kB=1024B? Someone can help me?
• A kilobyte should always be 1000 bytes, the reason being that this is more consistent with the general use of the prefix kilo.
1 kibibyte, though, is 1024 bytes, which is more in line with the way we generally think about chunks of bits in computer science.
• Is a Bit And a Byte the same value?
• A bit is a single binary digit (i.e. 1 or 0). A byte is 8 bits and can represent 256 different values.
• how many bits would it take to make a program
• First of all, file sizes are almost always measured in terms of bytes rather than bits.

Second, the program size depends on whether you are talking about the source code or the final executable.

Since a source code file is essentially just text, it is usually a number of kilobytes. (Of course, the overall program can have multiple source code files that work together.)

For the final executable program, the size can vary greatly depending on the programming language, how the program is written, the compiler used (assuming the language is compiled), etc. For modern programs, the size can vary between a couple of megabytes and hundreds of gigabytes.
• would having a higher upload speed cause the computer latency to rise?
• Latency in this context is referring to the time it takes between your device sending a request to an external resource and that external resource responding.

Neither pushing a request to a server nor receiving the server's response would be hurt by having a higher upload speed. In fact, having a higher upload speed would increase your bandwidth or network throughput, meaning you would see an increase in performance for certain tasks.
• If the latency is high, we cannot use the maximum bandwidth of the device, right?
• That's correct. Latency and bandwidth are two crucial factors that affect the performance of Internet-connected devices, especially when it comes to tasks like online gaming, video streaming, and real-time communication.

Latency: Latency, often referred to as "ping," is the time it takes for data to travel from your device to a server and back. High latency results in delays between your actions and the corresponding response. In online gaming, for instance, high latency can lead to input lag, making it difficult to play competitively.

Bandwidth: Bandwidth refers to the amount of data that can be transmitted over a network in a given amount of time. It's often measured in bits per second (bps) or its multiples (Mbps, Gbps). Bandwidth determines how quickly data can be downloaded or uploaded. For tasks like streaming high-definition videos or large file downloads, high bandwidth is essential.

The relationship between latency and bandwidth is such that high latency can limit the effective use of available bandwidth. Here's why:

High Latency: When latency is high, even if your connection has a high bandwidth capacity, there will be delays in the transmission of data. This delay can cause interruptions, buffering, and slower response times. For example, in online gaming, even if you have a fast connection, high latency can result in delayed reactions and a less smooth gameplay experience.

Low Latency: On the other hand, when latency is low, data can travel quickly between your device and the server. This means that even if your bandwidth is not extremely high, you'll experience more responsive and smoother interactions. For real-time activities like video conferencing, low latency is crucial for natural conversations.

In summary, both latency and bandwidth contribute to the overall quality of your internet experience. While high bandwidth is essential for tasks that involve transferring large amounts of data, low latency is crucial for real-time interactions and tasks where immediate responsiveness is required.
• What is latency? I am confused. Can you help me?
• the latency is the time between sending and receiving data or packets or messages whatever you want to call it. lets say you send me a text , in 20 milliseconds i received it, then in 30 milliseconds you get the 'delivered' under that message letting you and your device know I got the message, 20+30 = 50, meaning your latency is 50ms. the time between receiving(20ms) the time between notifying you in this case (30ms), = latency. Latency 50ms, hope this helps.
• Can someone please explain to me what a kibibyte is, and can you also explain what the prefix kibi- means?
(1 vote)
• So Kilobyte is base 10 as kilo means 1000 (10³). So 1 kilobyte = 1,000 bytes.

However traditionally kilo- was also used as to refer to 1024 bytes (2¹⁰ Bytes) because 1024 is "approximately 1024", and it was convenient I guess.

Obviously this is very confusing so in December 1998 the IEC (a body that makes international standards) created the prefixes Kebi-, Mebi-, Gibi-, etc. to explicitly differentiate the two. Thus kilobyte = 1000 bytes and kibibyte = 1024 bytes