樹莓派 3B+ 筦窺︰ GigaBit ︰ 300MBit ! 標準數據?

傳說在機械化的黃金時代,流傳著一則故事︰

那時每一根小『螺絲釘』和小『螺絲帽』都是獨特的,不要說從這個工廠到那個工廠,就算在同一個工廠內,它們也都各有各的不同 。只有那些沒有螺絲帽可以匹配的螺絲釘或沒有螺絲釘可以匹配的螺絲帽,才會被歸類成不好的。就這樣過了很多年,直到有一天艾索 ISO 出現了,推動『標準化』運動,自此一切都改變了 …。傳聞 ,最後一根獨特的小螺絲釘說︰『艾索,你這個老狐狸!…』。終究這些風塵往事早已被世人遺忘

無獨有偶 ── 發生過的事,總會再次發生 ──,其後,Douglas McIlroy 先生在寫命令列的外殼程式的時候,提出了管線 pipline 的概念,並用『 | 』符號代表。比如說『甲命令 | 乙命令』,講的是把甲命令的輸出結果當成乙命令的輸入來使用。之後於 1973 年 Ken Thompson 把它擴大為 『管子pipe 的標準,寫進了 Unix 作業系統 ,影響至今,於是開起了一個標準串流的時代。那什麼是標準串流呢?它就是之前在『除蟲!除錯?終端機。』一文中 IPO 模型抽象化後的相容性輸出入結構,應用於命令列的各個相容的指令的輸出入檔案 ── 當然也可以是裝置檔 ── 可串接性 chainable 的標準化。它定義了『標準輸入』stdin、『標準輸出』stdout、『標準錯誤』stderr,打開了程式間溝通的橋樑。舉例來說,假如 more 代表一頁一頁的讀,cat /boot/config.txt | more 就是一頁一頁的讀取樹莓派的開機組構檔 config.txt。

……

日後有人也許將再次發現把一些小程式 ── 容易寫、不容易寫錯 ── 串接起來,常常可以完成許多令人驚訝的事,這就是

Unix 的哲學上第一條所說的︰小即是美

無論人們所面對的『問題』是什麼?,『分割征服』的老方法依然有用 ── 古時所謂的大事化小、小事化無 ──。這在今天的『軟體工程學』上來說,也是如此。正由於標準化帶來了平凡與普通 ──  一說一般性,另說無差別, 正所以能建立軟體世界的溝通平台。這有什麼好處呢?因為過去軟體設計曾經是一門藝術,或者說屬於天生有才之輩,以致於難以學習模仿;然而到了今天之所以有工程學之實,其實是來自眾多前人的努力以及豐富的想像力。

這跟瑪利歐的水管有什麼關係?優尼克司的管子帶給人們思考的樂趣,而瑪利歐的水管則帶來了驚奇 ── 好玩就好

─── 《瑪利歐的水管 PIPE

 

□ ︰ 醫病為什麼要先量『身高』、『體重』的呢?

○ ︰ 恐怕你不勝『藥力』也。

□ ︰ 可是…我只是……牙疼之痛而已哩??

○ ︰ 不管診斷怎樣『病徵』,知道某偏離『某標準』多少!十分『重要 』!!

○ ︰ 此乃所謂『統計相關』勒◎

※ 註︰

身高體重指數

身高體重指數(又稱身體質量指數英文為 Body Mass Index,簡稱 BMI)是一個計算值,主要用於統計用途。

「身高體重指數」這個概念,是由19世紀中期的比利時統計學家數學家凱特勒(Lambert Adolphe Jacques Quetelet)最先提出。它的定義如下:

\displaystyle {\mbox{BMI}}={\frac {w}{h^{2}}}
w = 體重,單位:公斤;
h = 身高,單位:公尺;
BMI = 身高體重指數,單位:公斤/平方公尺

BMI的統計意義

BMI 原來的設計是一個用於公眾健康研究的統計工具。當需要知道肥胖是否為某一疾病的致病原因時,可以把病人的身高及體重換算成 BMI ,再找出其數值及病發率是否有線性關連。由於BMI主要反應整體體重,無法區別體重中體脂肪組織與非脂肪組織(包括肌肉 、器官),同樣身高體重的人可算出相同的 BMI ,但其實脂肪量不同[1],因此其實 BMI 是整體營養狀態的指標。以往拿來做為肥胖的指標,是因發現 BMI 與體脂肪在統計上有高度相關;但在同樣 BMI之下,仍會有體脂肪率的差異。

 

事物若『無差異』,何須『統計』耶?!

當然『有不同』,所以才『統計』呦!?

假使『環境』不清楚,『數據』要怎樣比較呀☺

Re: New Raspberry Pi model 3B+ 1.4 GHz, 330Mbit Ethernet, 802.11ac, PoE

Thu Mar 15, 2018 3:54 pm

in the meantime though – booted with a fresh card to test the LAN wired network speed… yip. faster….
pi@raspberrypi:~ iperf3 -c 192.168.2.222 Connecting to host 192.168.2.222, port 5201 [  4] local 192.168.2.223 port 58150 connected to 192.168.2.222 port 5201 [ ID] Interval           Transfer     Bandwidth       Retr  Cwnd [  4]   0.00-1.00   sec  34.8 MBytes   292 Mbits/sec   55    105 KBytes        [  4]   1.00-2.00   sec  34.6 MBytes   290 Mbits/sec   60   53.7 KBytes        [  4]   2.00-3.00   sec  35.2 MBytes   295 Mbits/sec   56   38.2 KBytes        [  4]   3.00-4.00   sec  33.5 MBytes   281 Mbits/sec   47   29.7 KBytes        [  4]   4.00-5.00   sec  33.6 MBytes   281 Mbits/sec   37   25.5 KBytes        [  4]   5.00-6.00   sec  31.8 MBytes   267 Mbits/sec   48    147 KBytes        [  4]   6.00-7.00   sec  32.5 MBytes   273 Mbits/sec   50   62.2 KBytes        [  4]   7.00-8.00   sec  34.8 MBytes   292 Mbits/sec   39   96.2 KBytes        [  4]   8.00-9.00   sec  34.4 MBytes   289 Mbits/sec   46   22.6 KBytes        [  4]   9.00-10.00  sec  34.6 MBytes   290 Mbits/sec   48   39.6 KBytes        - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval           Transfer     Bandwidth       Retr [  4]   0.00-10.00  sec   340 MBytes   285 Mbits/sec  486             sender [  4]   0.00-10.00  sec   339 MBytes   284 Mbits/sec                  receiver  iperf Done. pi@raspberrypi:~

Re: New Raspberry Pi model 3B+ 1.4 GHz, 330Mbit Ethernet, 802.11ac, PoE

Thu Mar 15, 2018 4:02 pm

pi-man-uk1 wrote:

Thu Mar 15, 2018 3:54 pm

booted with a fresh card to test the LAN wired network speed… yip.

Your numbers are a bit low (would expect well above 300 Mbits/sec and also the count of retransmits is not that great — I would check the network cable and run UDP tests in parallel) and unfortunately once the data that is transmitted over the wire lives on an USB disk we’re bottlenecked even more by USB2: viewtopic.php?f=63&t=207897#p1285923

……

Re: New Raspberry Pi model 3B+ 1.4 GHz, 330Mbit Ethernet, 802.11ac, PoE

Thu Mar 15, 2018 4:06 pm

interesting… i’ll check the cables….

still good though I was logging the last lines of output before the upgrade (pi3 before).

so gone from 93 Mbits/sec to 284 Mbits/sec….

good to know that I could get a bit more though perhaps !

yes, not sure about those retransmits, wasn’t seieng that on the old machine.

Mar 15 15:55:12 [  4]   0.00-10.00  sec   112 MBytes  94.0 Mbits/sec    0             sender
Mar 15 15:55:12 [  4]   0.00-10.00  sec   112 MBytes  93.8 Mbits/sec                  receiver
Mar 15 16:00:11 [  4]   0.00-10.00  sec   112 MBytes  94.0 Mbits/sec    0             sender
Mar 15 16:00:11 [  4]   0.00-10.00  sec   112 MBytes  93.8 Mbits/sec                  receiver

………

Re: New Raspberry Pi model 3B+ 1.4 GHz, 330Mbit Ethernet, 802.11ac, PoE

Thu Mar 15, 2018 4:12 pm

you were right… new patch cable (last one was home made, lesson learned).

new result…

well that was easy thanks… now only if I can get my old card booting !

pi@raspberrypi:~ iperf3 -c 192.168.2.222 Connecting to host 192.168.2.222, port 5201 [  4] local 192.168.2.223 port 58170 connected to 192.168.2.222 port 5201 [ ID] Interval           Transfer     Bandwidth       Retr  Cwnd [  4]   0.00-1.00   sec  37.6 MBytes   315 Mbits/sec    0    154 KBytes        [  4]   1.00-2.00   sec  37.0 MBytes   311 Mbits/sec    0    154 KBytes        [  4]   2.00-3.00   sec  37.2 MBytes   312 Mbits/sec    0    154 KBytes        [  4]   3.00-4.00   sec  37.0 MBytes   311 Mbits/sec    0    154 KBytes        [  4]   4.00-5.00   sec  37.3 MBytes   313 Mbits/sec    0    154 KBytes        [  4]   5.00-6.00   sec  37.0 MBytes   310 Mbits/sec    0    154 KBytes        [  4]   6.00-7.00   sec  37.4 MBytes   314 Mbits/sec    0    154 KBytes        [  4]   7.00-8.00   sec  36.8 MBytes   309 Mbits/sec    0    154 KBytes        [  4]   8.00-9.00   sec  37.5 MBytes   314 Mbits/sec    0    154 KBytes        [  4]   9.00-10.00  sec  37.1 MBytes   311 Mbits/sec    0    154 KBytes        - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval           Transfer     Bandwidth       Retr [  4]   0.00-10.00  sec   372 MBytes   312 Mbits/sec    0             sender [  4]   0.00-10.00  sec   372 MBytes   312 Mbits/sec                  receiver  iperf Done. pi@raspberrypi:~ 

 

還是先認識人一般使用什麼『工具』,知道如何『度量』好◎

Differences between Iperf and SpeedTest

Image courtesy of http://openspeedtest.com/

Image courtesy of http://openspeedtest.com/

Do your users often complain about network slowness? Whether the complaints are legit or not, network engineers need evidence on the actual bandwidth available to the users. For this purpose there are two free tools: iperf and speedtest-cli. Both tools send as much traffic as the client is capable of transmitting and then reports the average data rate.

When running bandwidth tests, the results are dependent on three values:

  1. the connection speed of the client’s network interface card
  2. bandwidth available between the source and destination,
  3. connection speed of the server’s network interface card.

While Iperf and speedtest-cli sound like they perform the same function, the use cases are different.

……

To conclude, use iperf for internal and advanced bandwidth measurements and speedtest for getting an estimate of download and upload speeds. I hope this article provided some useful insights. Share your thoughts, questions, or comments here below. Cheers!

───