Why readings for WiFi link speed and bandwidth don't correlate?












0














I want to get the "speed" for my WiFi connection.



From NetworkCapabilities class, I get:



Link downstream bandwidth: 1048576 Kbps
Link upstream bandwidth: 1048576 Kbps


However, using WiFiInfo class I get:



Link speed:                200000 Kbps


Why values are different?



From my research, I concluded, that NetworkCapabilities class doesn't actually MEASURE bandwidth - it just returns EXPECTED values for detected technology (WiFi, cellular, etc.). I guess, that WiFiInfo does the same thing. I ran the code many times during extended period of time and got the same values you see above.





Code



Here is the code with NetworkCapabilities:



val connectivityManager = context.getSystemService(ConnectivityManager::class.java)    

val networkCapabilities: NetworkCapabilities?
get() = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)

networkCapabilities?.linkDownstreamBandwidthKbps // 1048576
networkCapabilities?.linkUpstreamBandwidthKbps // 1048576


Here is the code with WiFiInfo:



val wifiManager = context.getSystemService(WifiManager::class.java)
wifiManager.connectionInfo.linkSpeed // returns 200 Mbps









share|improve this question






















  • probably NetworkCapabilities will return you the max link speed available for your device and connection type
    – Vladyslav Matviienko
    Nov 21 '18 at 10:34










  • So you are saying that there is a different link available except WiFi on my device that is faster than WiFi? I've checked available link types (NetworkCapabilities.hasTransport(Int)) and the only true I got was for NetworkCapabilities.TRANSPORT_WIFI. Am I doing it right? Why google guys even call it "transport"? I think it should be "link" (as in OSI model).
    – Sevastyan
    Nov 21 '18 at 11:14






  • 1




    WIFI of type AC is probably able to link to 1GBPS. Anyway that is just my guess
    – Vladyslav Matviienko
    Nov 21 '18 at 12:13










  • That's probably the case. Thanks for giving a lead on this.
    – Sevastyan
    Nov 21 '18 at 13:05
















0














I want to get the "speed" for my WiFi connection.



From NetworkCapabilities class, I get:



Link downstream bandwidth: 1048576 Kbps
Link upstream bandwidth: 1048576 Kbps


However, using WiFiInfo class I get:



Link speed:                200000 Kbps


Why values are different?



From my research, I concluded, that NetworkCapabilities class doesn't actually MEASURE bandwidth - it just returns EXPECTED values for detected technology (WiFi, cellular, etc.). I guess, that WiFiInfo does the same thing. I ran the code many times during extended period of time and got the same values you see above.





Code



Here is the code with NetworkCapabilities:



val connectivityManager = context.getSystemService(ConnectivityManager::class.java)    

val networkCapabilities: NetworkCapabilities?
get() = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)

networkCapabilities?.linkDownstreamBandwidthKbps // 1048576
networkCapabilities?.linkUpstreamBandwidthKbps // 1048576


Here is the code with WiFiInfo:



val wifiManager = context.getSystemService(WifiManager::class.java)
wifiManager.connectionInfo.linkSpeed // returns 200 Mbps









share|improve this question






















  • probably NetworkCapabilities will return you the max link speed available for your device and connection type
    – Vladyslav Matviienko
    Nov 21 '18 at 10:34










  • So you are saying that there is a different link available except WiFi on my device that is faster than WiFi? I've checked available link types (NetworkCapabilities.hasTransport(Int)) and the only true I got was for NetworkCapabilities.TRANSPORT_WIFI. Am I doing it right? Why google guys even call it "transport"? I think it should be "link" (as in OSI model).
    – Sevastyan
    Nov 21 '18 at 11:14






  • 1




    WIFI of type AC is probably able to link to 1GBPS. Anyway that is just my guess
    – Vladyslav Matviienko
    Nov 21 '18 at 12:13










  • That's probably the case. Thanks for giving a lead on this.
    – Sevastyan
    Nov 21 '18 at 13:05














0












0








0







I want to get the "speed" for my WiFi connection.



From NetworkCapabilities class, I get:



Link downstream bandwidth: 1048576 Kbps
Link upstream bandwidth: 1048576 Kbps


However, using WiFiInfo class I get:



Link speed:                200000 Kbps


Why values are different?



From my research, I concluded, that NetworkCapabilities class doesn't actually MEASURE bandwidth - it just returns EXPECTED values for detected technology (WiFi, cellular, etc.). I guess, that WiFiInfo does the same thing. I ran the code many times during extended period of time and got the same values you see above.





Code



Here is the code with NetworkCapabilities:



val connectivityManager = context.getSystemService(ConnectivityManager::class.java)    

val networkCapabilities: NetworkCapabilities?
get() = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)

networkCapabilities?.linkDownstreamBandwidthKbps // 1048576
networkCapabilities?.linkUpstreamBandwidthKbps // 1048576


Here is the code with WiFiInfo:



val wifiManager = context.getSystemService(WifiManager::class.java)
wifiManager.connectionInfo.linkSpeed // returns 200 Mbps









share|improve this question













I want to get the "speed" for my WiFi connection.



From NetworkCapabilities class, I get:



Link downstream bandwidth: 1048576 Kbps
Link upstream bandwidth: 1048576 Kbps


However, using WiFiInfo class I get:



Link speed:                200000 Kbps


Why values are different?



From my research, I concluded, that NetworkCapabilities class doesn't actually MEASURE bandwidth - it just returns EXPECTED values for detected technology (WiFi, cellular, etc.). I guess, that WiFiInfo does the same thing. I ran the code many times during extended period of time and got the same values you see above.





Code



Here is the code with NetworkCapabilities:



val connectivityManager = context.getSystemService(ConnectivityManager::class.java)    

val networkCapabilities: NetworkCapabilities?
get() = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork)

networkCapabilities?.linkDownstreamBandwidthKbps // 1048576
networkCapabilities?.linkUpstreamBandwidthKbps // 1048576


Here is the code with WiFiInfo:



val wifiManager = context.getSystemService(WifiManager::class.java)
wifiManager.connectionInfo.linkSpeed // returns 200 Mbps






android networking kotlin wifi android-wifi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 9:49









SevastyanSevastyan

2,7362920




2,7362920












  • probably NetworkCapabilities will return you the max link speed available for your device and connection type
    – Vladyslav Matviienko
    Nov 21 '18 at 10:34










  • So you are saying that there is a different link available except WiFi on my device that is faster than WiFi? I've checked available link types (NetworkCapabilities.hasTransport(Int)) and the only true I got was for NetworkCapabilities.TRANSPORT_WIFI. Am I doing it right? Why google guys even call it "transport"? I think it should be "link" (as in OSI model).
    – Sevastyan
    Nov 21 '18 at 11:14






  • 1




    WIFI of type AC is probably able to link to 1GBPS. Anyway that is just my guess
    – Vladyslav Matviienko
    Nov 21 '18 at 12:13










  • That's probably the case. Thanks for giving a lead on this.
    – Sevastyan
    Nov 21 '18 at 13:05


















  • probably NetworkCapabilities will return you the max link speed available for your device and connection type
    – Vladyslav Matviienko
    Nov 21 '18 at 10:34










  • So you are saying that there is a different link available except WiFi on my device that is faster than WiFi? I've checked available link types (NetworkCapabilities.hasTransport(Int)) and the only true I got was for NetworkCapabilities.TRANSPORT_WIFI. Am I doing it right? Why google guys even call it "transport"? I think it should be "link" (as in OSI model).
    – Sevastyan
    Nov 21 '18 at 11:14






  • 1




    WIFI of type AC is probably able to link to 1GBPS. Anyway that is just my guess
    – Vladyslav Matviienko
    Nov 21 '18 at 12:13










  • That's probably the case. Thanks for giving a lead on this.
    – Sevastyan
    Nov 21 '18 at 13:05
















probably NetworkCapabilities will return you the max link speed available for your device and connection type
– Vladyslav Matviienko
Nov 21 '18 at 10:34




probably NetworkCapabilities will return you the max link speed available for your device and connection type
– Vladyslav Matviienko
Nov 21 '18 at 10:34












So you are saying that there is a different link available except WiFi on my device that is faster than WiFi? I've checked available link types (NetworkCapabilities.hasTransport(Int)) and the only true I got was for NetworkCapabilities.TRANSPORT_WIFI. Am I doing it right? Why google guys even call it "transport"? I think it should be "link" (as in OSI model).
– Sevastyan
Nov 21 '18 at 11:14




So you are saying that there is a different link available except WiFi on my device that is faster than WiFi? I've checked available link types (NetworkCapabilities.hasTransport(Int)) and the only true I got was for NetworkCapabilities.TRANSPORT_WIFI. Am I doing it right? Why google guys even call it "transport"? I think it should be "link" (as in OSI model).
– Sevastyan
Nov 21 '18 at 11:14




1




1




WIFI of type AC is probably able to link to 1GBPS. Anyway that is just my guess
– Vladyslav Matviienko
Nov 21 '18 at 12:13




WIFI of type AC is probably able to link to 1GBPS. Anyway that is just my guess
– Vladyslav Matviienko
Nov 21 '18 at 12:13












That's probably the case. Thanks for giving a lead on this.
– Sevastyan
Nov 21 '18 at 13:05




That's probably the case. Thanks for giving a lead on this.
– Sevastyan
Nov 21 '18 at 13:05












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409290%2fwhy-readings-for-wifi-link-speed-and-bandwidth-dont-correlate%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409290%2fwhy-readings-for-wifi-link-speed-and-bandwidth-dont-correlate%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Create new schema in PostgreSQL using DBeaver

Deepest pit of an array with Javascript: test on Codility

Costa Masnaga