Browse Source

Merge pull request #398 from murat-dogan/master

Add Multiple Data Channel Option
Paul-Louis Ageneau 4 years ago
parent
commit
dd4949e78e

+ 394 - 150
examples/client-benchmark/README.md

@@ -1,8 +1,9 @@
 # libdatachannel - client-benchmark
 # libdatachannel - client-benchmark
 
 
-This directory contains a native client to open Data Channels with WebSocket signaling using libdatachannel and benchmark functionalities. It offers two functionalities;
+This directory contains a native client to open Data Channels with WebSocket signaling using libdatachannel and benchmark functionalities. It offers three functionalities;
 - Benchmark: Bi-directional data transfer benchmark (Also supports One-Way testing)
 - Benchmark: Bi-directional data transfer benchmark (Also supports One-Way testing)
 - Constant Throughput Set: Send desired amount of data per second
 - Constant Throughput Set: Send desired amount of data per second
+- Multiple Data Channel: Create desried count of data channel 
 
 
 ## Start Signaling Server
 ## Start Signaling Server
 - Start one of the signaling server from the examples folder. For example start  `signaling-server-nodejs` like;
 - Start one of the signaling server from the examples folder. For example start  `signaling-server-nodejs` like;
@@ -12,7 +13,7 @@ This directory contains a native client to open Data Channels with WebSocket sig
 
 
 ## Start `client-benchmark` Applications
 ## Start `client-benchmark` Applications
 
 
-Start 2 applications by using example calls below. Than copy one of the client's ID and paste to the other peer's screen to start offering process.
+Start 2 applications by using example calls below. Then copy one of the client's ID and paste to the other peer's screen to start offering process.
 
 
 ## Usage Examples
 ## Usage Examples
 
 
@@ -23,63 +24,90 @@ Start 2 applications by using example calls below. Than copy one of the client's
 Example Output (Offering Peer's Output);
 Example Output (Offering Peer's Output);
 ```bash
 ```bash
 Stun server is stun:stun.l.google.com:19302
 Stun server is stun:stun.l.google.com:19302
-The local ID is: EQmF
-Url is ws://localhost:8000/EQmF
+The local ID is: H1E3
+Url is ws://localhost:8000/H1E3
 Waiting for signaling to be connected...
 Waiting for signaling to be connected...
-2021-03-25 14:21:58.045 INFO  [21386] [rtc::impl::TcpTransport::connect@159] Connected to localhost:8000
-2021-03-25 14:21:58.045 INFO  [21386] [rtc::impl::TcpTransport::runLoop@327] TCP connected
-2021-03-25 14:21:58.046 INFO  [21386] [rtc::impl::WsTransport::incoming@118] WebSocket open
+2021-04-10 19:51:31.319 INFO  [16449] [rtc::impl::TcpTransport::connect@163] Connected to localhost:8000
+2021-04-10 19:51:31.319 INFO  [16449] [rtc::impl::TcpTransport::runLoop@331] TCP connected
+2021-04-10 19:51:31.321 INFO  [16449] [rtc::impl::WsTransport::incoming@118] WebSocket open
 WebSocket connected, signaling ready
 WebSocket connected, signaling ready
 Enter a remote ID to send an offer:
 Enter a remote ID to send an offer:
-0tDf
-Offering to 0tDf
-Creating DataChannel with label "benchmark"
-2021-03-25 14:22:07.972 INFO  [21379] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
-2021-03-25 14:22:07.973 INFO  [21379] [rtc::impl::PeerConnection::changeSignalingState@992] Changed signaling state to new
-2021-03-25 14:22:07.973 INFO  [21379] [rtc::impl::PeerConnection::changeGatheringState@981] Changed gathering state to in-progress
+n790
+Offering to n790
+Creating DataChannel with label "DC-1"
+2021-04-10 19:51:32.464 INFO  [16442] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
+2021-04-10 19:51:32.465 INFO  [16442] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to new
+2021-04-10 19:51:32.465 INFO  [16442] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to in-progress
 Gathering State: in-progress
 Gathering State: in-progress
-2021-03-25 14:22:07.974 INFO  [21379] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
-2021-03-25 14:22:07.974 WARN  [21379] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:239: Local description already has the maximum number of host candidates
+2021-04-10 19:51:32.465 INFO  [16442] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
 Benchmark will run for 300 seconds
 Benchmark will run for 300 seconds
-2021-03-25 14:22:07.976 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
-2021-03-25 14:22:07.976 INFO  [21396] [rtc::impl::PeerConnection::changeState@964] Changed state to connecting
+2021-04-10 19:51:32.466 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
+2021-04-10 19:51:32.466 INFO  [16450] [rtc::impl::PeerConnection::changeState@1016] Changed state to connecting
 State: connecting
 State: connecting
-2021-03-25 14:22:08.055 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
-2021-03-25 14:22:08.055 INFO  [21386] [rtc::impl::PeerConnection::changeSignalingState@992] Changed signaling state to connecting
-2021-03-25 14:22:08.105 WARN  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:426: Send failed, errno=101
-2021-03-25 14:22:08.105 WARN  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1483: STUN message send failed, errno=101
-2021-03-25 14:22:08.105 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN binding failed
-2021-03-25 14:22:08.107 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1302: STUN server binding successful
-2021-03-25 14:22:08.107 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2148: Candidate gathering done
-2021-03-25 14:22:08.107 INFO  [21396] [rtc::impl::PeerConnection::changeGatheringState@981] Changed gathering state to complete
-Gathering State: complete
-2021-03-25 14:22:08.155 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
-2021-03-25 14:22:08.206 INFO  [21396] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
-#1 Received: 0 KB/s   Sent: 0 KB/s   BufferSize: 0
-2021-03-25 14:22:09.059 INFO  [21399] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
-2021-03-25 14:22:09.069 INFO  [21382] [rtc::impl::SctpTransport::processNotification@708] SCTP connected
-2021-03-25 14:22:09.069 INFO  [21382] [rtc::impl::PeerConnection::changeState@964] Changed state to connected
+2021-04-10 19:51:32.489 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
+2021-04-10 19:51:32.489 INFO  [16449] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to connecting
+2021-04-10 19:51:32.490 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
+2021-04-10 19:51:32.491 INFO  [16453] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
+2021-04-10 19:51:32.497 INFO  [16443] [rtc::impl::SctpTransport::processNotification@713] SCTP connected
+2021-04-10 19:51:32.497 INFO  [16443] [rtc::impl::PeerConnection::changeState@1016] Changed state to connected
 State: connected
 State: connected
-DataChannel from 0tDf open
-#2 Received: 41488 KB/s   Sent: 42465 KB/s   BufferSize: 65535
-#3 Received: 43925 KB/s   Sent: 43729 KB/s   BufferSize: 65535
-#4 Received: 42491 KB/s   Sent: 42361 KB/s   BufferSize: 65535
-#5 Received: 45878 KB/s   Sent: 45682 KB/s   BufferSize: 65535
-Stats# Received Total: 174 MB   Sent Total: 175 MB   RTT: 17 ms
-
-#6 Received: 43665 KB/s   Sent: 43599 KB/s   BufferSize: 65535
-#7 Received: 45749 KB/s   Sent: 45488 KB/s   BufferSize: 65535
-#8 Received: 44055 KB/s   Sent: 44055 KB/s   BufferSize: 65535
-#9 Received: 21572 KB/s   Sent: 58199 KB/s   BufferSize: 65535
-#10 Received: 22940 KB/s   Sent: 55005 KB/s   BufferSize: 65535
-Stats# Received Total: 353 MB   Sent Total: 422 MB   RTT: 15 ms
-
-#11 Received: 27501 KB/s   Sent: 53112 KB/s   BufferSize: 65535
-#12 Received: 29914 KB/s   Sent: 48162 KB/s   BufferSize: 65535
-#13 Received: 31869 KB/s   Sent: 45946 KB/s   BufferSize: 65535
-#14 Received: 22484 KB/s   Sent: 53636 KB/s   BufferSize: 65535
-#15 Received: 16294 KB/s   Sent: 56833 KB/s   BufferSize: 65535
-Stats# Received Total: 482 MB   Sent Total: 682 MB   RTT: 13 ms
+DataChannel from n790 open
+2021-04-10 19:51:32.542 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1328: STUN server binding successful
+2021-04-10 19:51:32.589 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
+#1
+      DC-1 Received: 40789 KB/s   Sent: 41180 KB/s   BufferSize: 65535
+      TOTL Received: 40789 KB/s   Sent: 41180 KB/s
+2021-04-10 19:51:34.039 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN server binding failed (timeout)
+2021-04-10 19:51:34.039 INFO  [16450] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2206: Candidate gathering done
+2021-04-10 19:51:34.039 INFO  [16450] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to complete
+Gathering State: complete
+#2
+      DC-1 Received: 41709 KB/s   Sent: 41774 KB/s   BufferSize: 65535
+      TOTL Received: 41709 KB/s   Sent: 41774 KB/s
+#3
+      DC-1 Received: 42165 KB/s   Sent: 42360 KB/s   BufferSize: 65535
+      TOTL Received: 42165 KB/s   Sent: 42360 KB/s
+#4
+      DC-1 Received: 42880 KB/s   Sent: 42750 KB/s   BufferSize: 65535
+      TOTL Received: 42880 KB/s   Sent: 42750 KB/s
+#5
+      DC-1 Received: 41771 KB/s   Sent: 42097 KB/s   BufferSize: 65535
+      TOTL Received: 41771 KB/s   Sent: 42097 KB/s
+Stats# Received Total: 210 MB   Sent Total: 211 MB   RTT: 20 ms
+
+#6
+      DC-1 Received: 46235 KB/s   Sent: 30433 KB/s   BufferSize: 65535
+      TOTL Received: 46235 KB/s   Sent: 30433 KB/s
+#7
+      DC-1 Received: 47116 KB/s   Sent: 28413 KB/s   BufferSize: 65535
+      TOTL Received: 47116 KB/s   Sent: 28413 KB/s
+#8
+      DC-1 Received: 46923 KB/s   Sent: 32520 KB/s   BufferSize: 65535
+      TOTL Received: 46923 KB/s   Sent: 32520 KB/s
+#9
+      DC-1 Received: 44513 KB/s   Sent: 34020 KB/s   BufferSize: 65535
+      TOTL Received: 44513 KB/s   Sent: 34020 KB/s
+#10
+      DC-1 Received: 41966 KB/s   Sent: 36166 KB/s   BufferSize: 65535
+      TOTL Received: 41966 KB/s   Sent: 36166 KB/s
+Stats# Received Total: 438 MB   Sent Total: 373 MB   RTT: 19 ms
+
+#11
+      DC-1 Received: 42617 KB/s   Sent: 39619 KB/s   BufferSize: 65535
+      TOTL Received: 42617 KB/s   Sent: 39619 KB/s
+#12
+      DC-1 Received: 43792 KB/s   Sent: 43338 KB/s   BufferSize: 65535
+      TOTL Received: 43792 KB/s   Sent: 43338 KB/s
+#13
+      DC-1 Received: 41715 KB/s   Sent: 41585 KB/s   BufferSize: 65535
+      TOTL Received: 41715 KB/s   Sent: 41585 KB/s
+#14
+      DC-1 Received: 39860 KB/s   Sent: 33822 KB/s   BufferSize: 65535
+      TOTL Received: 39860 KB/s   Sent: 33822 KB/s
+#15
+      DC-1 Received: 47576 KB/s   Sent: 25352 KB/s   BufferSize: 65535
+      TOTL Received: 47576 KB/s   Sent: 25352 KB/s
+Stats# Received Total: 655 MB   Sent Total: 558 MB   RTT: 13 ms
 ```
 ```
 
 
 ### Benchmark for 300 seconds (Only Send, One Way)
 ### Benchmark for 300 seconds (Only Send, One Way)
@@ -92,64 +120,92 @@ Start second peer as;
 
 
 Example Output (Offering Peer's Output);
 Example Output (Offering Peer's Output);
 ```bash
 ```bash
+Not Sending data. (One way benchmark).
 Stun server is stun:stun.l.google.com:19302
 Stun server is stun:stun.l.google.com:19302
-The local ID is: XLLn
-Url is ws://localhost:8000/XLLn
+The local ID is: 7EaP
+Url is ws://localhost:8000/7EaP
 Waiting for signaling to be connected...
 Waiting for signaling to be connected...
-2021-03-25 14:34:24.479 INFO  [22332] [rtc::impl::TcpTransport::connect@159] Connected to localhost:8000
-2021-03-25 14:34:24.479 INFO  [22332] [rtc::impl::TcpTransport::runLoop@327] TCP connected
-2021-03-25 14:34:24.479 INFO  [22332] [rtc::impl::WsTransport::incoming@118] WebSocket open
+2021-04-10 19:54:36.857 INFO  [16632] [rtc::impl::TcpTransport::connect@163] Connected to localhost:8000
+2021-04-10 19:54:36.857 INFO  [16632] [rtc::impl::TcpTransport::runLoop@331] TCP connected
+2021-04-10 19:54:36.858 INFO  [16632] [rtc::impl::WsTransport::incoming@118] WebSocket open
 WebSocket connected, signaling ready
 WebSocket connected, signaling ready
 Enter a remote ID to send an offer:
 Enter a remote ID to send an offer:
-Okt4
-Offering to Okt4
-Creating DataChannel with label "benchmark"
-2021-03-25 14:34:37.948 INFO  [22325] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
-2021-03-25 14:34:37.949 INFO  [22325] [rtc::impl::PeerConnection::changeSignalingState@992] Changed signaling state to new
-2021-03-25 14:34:37.949 INFO  [22325] [rtc::impl::PeerConnection::changeGatheringState@981] Changed gathering state to in-progress
+UDL4
+Offering to UDL4
+Creating DataChannel with label "DC-1"
+2021-04-10 19:54:53.381 INFO  [16625] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
+2021-04-10 19:54:53.382 INFO  [16625] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to new
+2021-04-10 19:54:53.382 INFO  [16625] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to in-progress
 Gathering State: in-progress
 Gathering State: in-progress
-2021-03-25 14:34:37.950 INFO  [22325] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
-2021-03-25 14:34:37.951 WARN  [22325] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:239: Local description already has the maximum number of host candidates
+2021-04-10 19:54:53.383 INFO  [16625] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
 Benchmark will run for 300 seconds
 Benchmark will run for 300 seconds
-2021-03-25 14:34:37.952 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
-2021-03-25 14:34:37.952 INFO  [22334] [rtc::impl::PeerConnection::changeState@964] Changed state to connecting
+2021-04-10 19:54:53.384 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
+2021-04-10 19:54:53.384 INFO  [16646] [rtc::impl::PeerConnection::changeState@1016] Changed state to connecting
 State: connecting
 State: connecting
-2021-03-25 14:34:37.969 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
-2021-03-25 14:34:37.969 INFO  [22332] [rtc::impl::PeerConnection::changeSignalingState@992] Changed signaling state to connecting
-2021-03-25 14:34:37.970 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
-2021-03-25 14:34:37.971 INFO  [22337] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
-2021-03-25 14:34:37.977 INFO  [22327] [rtc::impl::SctpTransport::processNotification@708] SCTP connected
-2021-03-25 14:34:37.977 INFO  [22327] [rtc::impl::PeerConnection::changeState@964] Changed state to connected
+2021-04-10 19:54:53.475 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
+2021-04-10 19:54:53.475 INFO  [16632] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to connecting
+2021-04-10 19:54:53.527 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1328: STUN server binding successful
+2021-04-10 19:54:53.575 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
+2021-04-10 19:54:53.625 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
+#1
+      DC-1 Received: 0 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 0 KB/s   Sent: 0 KB/s
+2021-04-10 19:54:54.481 INFO  [16653] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
+2021-04-10 19:54:54.491 INFO  [16627] [rtc::impl::SctpTransport::processNotification@713] SCTP connected
+2021-04-10 19:54:54.491 INFO  [16627] [rtc::impl::PeerConnection::changeState@1016] Changed state to connected
 State: connected
 State: connected
-DataChannel from Okt4 open
-2021-03-25 14:34:38.019 WARN  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:426: Send failed, errno=101
-2021-03-25 14:34:38.019 WARN  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1483: STUN message send failed, errno=101
-2021-03-25 14:34:38.019 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN binding failed
-2021-03-25 14:34:38.022 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1302: STUN server binding successful
-2021-03-25 14:34:38.022 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2148: Candidate gathering done
-2021-03-25 14:34:38.022 INFO  [22334] [rtc::impl::PeerConnection::changeGatheringState@981] Changed gathering state to complete
+DataChannel from UDL4 open
+#2
+      DC-1 Received: 84326 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 84326 KB/s   Sent: 0 KB/s
+#3
+      DC-1 Received: 99387 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 99387 KB/s   Sent: 0 KB/s
+2021-04-10 19:54:57.025 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN server binding failed (timeout)
+2021-04-10 19:54:57.025 INFO  [16646] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2206: Candidate gathering done
+2021-04-10 19:54:57.025 INFO  [16646] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to complete
 Gathering State: complete
 Gathering State: complete
-2021-03-25 14:34:38.069 INFO  [22334] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
-#1 Received: 0 KB/s   Sent: 92223 KB/s   BufferSize: 65535
-#2 Received: 0 KB/s   Sent: 89291 KB/s   BufferSize: 65535
-#3 Received: 0 KB/s   Sent: 95087 KB/s   BufferSize: 65535
-#4 Received: 0 KB/s   Sent: 101050 KB/s   BufferSize: 65535
-#5 Received: 0 KB/s   Sent: 99778 KB/s   BufferSize: 0
-Stats# Received Total: 0 MB   Sent Total: 480 MB   RTT: 8 ms
-
-#6 Received: 0 KB/s   Sent: 100366 KB/s   BufferSize: 65535
-#7 Received: 0 KB/s   Sent: 101201 KB/s   BufferSize: 65535
-#8 Received: 0 KB/s   Sent: 100892 KB/s   BufferSize: 65535
-#9 Received: 0 KB/s   Sent: 101288 KB/s   BufferSize: 65535
-#10 Received: 0 KB/s   Sent: 95676 KB/s   BufferSize: 65535
-Stats# Received Total: 0 MB   Sent Total: 982 MB   RTT: 8 ms
-
-#11 Received: 0 KB/s   Sent: 96254 KB/s   BufferSize: 65535
-#12 Received: 0 KB/s   Sent: 105473 KB/s   BufferSize: 65535
-#13 Received: 0 KB/s   Sent: 95549 KB/s   BufferSize: 65535
-#14 Received: 0 KB/s   Sent: 100366 KB/s   BufferSize: 65535
-#15 Received: 0 KB/s   Sent: 101336 KB/s   BufferSize: 65535
-Stats# Received Total: 0 MB   Sent Total: 1484 MB   RTT: 8 ms
+#4
+      DC-1 Received: 94871 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 94871 KB/s   Sent: 0 KB/s
+#5
+      DC-1 Received: 96259 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 96259 KB/s   Sent: 0 KB/s
+Stats# Received Total: 377 MB   Sent Total: 0 MB   RTT: 2 ms
+
+#6
+      DC-1 Received: 92873 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 92873 KB/s   Sent: 0 KB/s
+#7
+      DC-1 Received: 87724 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 87724 KB/s   Sent: 0 KB/s
+#8
+      DC-1 Received: 95123 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 95123 KB/s   Sent: 0 KB/s
+#9
+      DC-1 Received: 100022 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 100022 KB/s   Sent: 0 KB/s
+#10
+      DC-1 Received: 98124 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 98124 KB/s   Sent: 0 KB/s
+Stats# Received Total: 853 MB   Sent Total: 0 MB   RTT: 2 ms
+
+#11
+      DC-1 Received: 103628 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 103628 KB/s   Sent: 0 KB/s
+#12
+      DC-1 Received: 106166 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 106166 KB/s   Sent: 0 KB/s
+#13
+      DC-1 Received: 98410 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 98410 KB/s   Sent: 0 KB/s
+#14
+      DC-1 Received: 99854 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 99854 KB/s   Sent: 0 KB/s
+#15
+      DC-1 Received: 98487 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 98487 KB/s   Sent: 0 KB/s
+Stats# Received Total: 1362 MB   Sent Total: 0 MB   RTT: 2 ms
 ```
 ```
 
 
 ### Constant Throughput Set 8000 byte, for 300 seconds, send buffer 10000 byte
 ### Constant Throughput Set 8000 byte, for 300 seconds, send buffer 10000 byte
@@ -159,61 +215,249 @@ Stats# Received Total: 0 MB   Sent Total: 1484 MB   RTT: 8 ms
 Example Output (Offering Peer's Output);
 Example Output (Offering Peer's Output);
 ```bash
 ```bash
 Stun server is stun:stun.l.google.com:19302
 Stun server is stun:stun.l.google.com:19302
-The local ID is: 1w9O
-Url is ws://localhost:8000/1w9O
+The local ID is: 5zkC
+Url is ws://localhost:8000/5zkC
 Waiting for signaling to be connected...
 Waiting for signaling to be connected...
-2021-03-25 14:29:38.697 INFO  [21844] [rtc::impl::TcpTransport::connect@159] Connected to localhost:8000
-2021-03-25 14:29:38.697 INFO  [21844] [rtc::impl::TcpTransport::runLoop@327] TCP connected
-2021-03-25 14:29:38.698 INFO  [21844] [rtc::impl::WsTransport::incoming@118] WebSocket open
+2021-04-10 19:52:49.788 INFO  [16530] [rtc::impl::TcpTransport::connect@163] Connected to localhost:8000
+2021-04-10 19:52:49.788 INFO  [16530] [rtc::impl::TcpTransport::runLoop@331] TCP connected
+2021-04-10 19:52:49.789 INFO  [16530] [rtc::impl::WsTransport::incoming@118] WebSocket open
 WebSocket connected, signaling ready
 WebSocket connected, signaling ready
 Enter a remote ID to send an offer:
 Enter a remote ID to send an offer:
-zi4B
-Offering to zi4B
-Creating DataChannel with label "benchmark"
-2021-03-25 14:29:48.729 INFO  [21837] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
-2021-03-25 14:29:48.729 INFO  [21837] [rtc::impl::PeerConnection::changeSignalingState@992] Changed signaling state to new
-2021-03-25 14:29:48.729 INFO  [21837] [rtc::impl::PeerConnection::changeGatheringState@981] Changed gathering state to in-progress
+WawD
+Offering to WawD
+Creating DataChannel with label "DC-1"
+2021-04-10 19:52:57.720 INFO  [16523] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
+2021-04-10 19:52:57.721 INFO  [16523] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to new
+2021-04-10 19:52:57.721 INFO  [16523] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to in-progress
 Gathering State: in-progress
 Gathering State: in-progress
-2021-03-25 14:29:48.729 INFO  [21837] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
-2021-03-25 14:29:48.730 WARN  [21837] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:239: Local description already has the maximum number of host candidates
+2021-04-10 19:52:57.722 INFO  [16523] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
 Benchmark will run for 300 seconds
 Benchmark will run for 300 seconds
-2021-03-25 14:29:48.730 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
-2021-03-25 14:29:48.731 INFO  [21866] [rtc::impl::PeerConnection::changeState@964] Changed state to connecting
+2021-04-10 19:52:57.722 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
+2021-04-10 19:52:57.722 INFO  [16533] [rtc::impl::PeerConnection::changeState@1016] Changed state to connecting
 State: connecting
 State: connecting
-2021-03-25 14:29:48.732 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
-2021-03-25 14:29:48.732 INFO  [21844] [rtc::impl::PeerConnection::changeSignalingState@992] Changed signaling state to connecting
-2021-03-25 14:29:48.782 WARN  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:426: Send failed, errno=101
-2021-03-25 14:29:48.782 WARN  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1483: STUN message send failed, errno=101
-2021-03-25 14:29:48.782 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN binding failed
-2021-03-25 14:29:48.787 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1302: STUN server binding successful
-2021-03-25 14:29:48.787 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2148: Candidate gathering done
-2021-03-25 14:29:48.787 INFO  [21866] [rtc::impl::PeerConnection::changeGatheringState@981] Changed gathering state to complete
+2021-04-10 19:52:57.725 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
+2021-04-10 19:52:57.727 INFO  [16530] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to connecting
+2021-04-10 19:52:57.826 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
+2021-04-10 19:52:57.828 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
+2021-04-10 19:52:57.829 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1328: STUN server binding successful
+2021-04-10 19:52:57.884 INFO  [16535] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
+2021-04-10 19:52:57.907 INFO  [16526] [rtc::impl::SctpTransport::processNotification@713] SCTP connected
+2021-04-10 19:52:57.907 INFO  [16526] [rtc::impl::PeerConnection::changeState@1016] Changed state to connected
+State: connected
+DataChannel from WawD open
+#1
+      DC-1 Received: 6515 KB/s   Sent: 6577 KB/s   BufferSize: 0
+      TOTL Received: 6515 KB/s   Sent: 6577 KB/s
+#2
+      DC-1 Received: 7998 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 7998 KB/s   Sent: 7999 KB/s
+#3
+      DC-1 Received: 7933 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 7933 KB/s   Sent: 7999 KB/s
+2021-04-10 19:53:01.275 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN server binding failed (timeout)
+2021-04-10 19:53:01.275 INFO  [16533] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2206: Candidate gathering done
+2021-04-10 19:53:01.275 INFO  [16533] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to complete
 Gathering State: complete
 Gathering State: complete
-2021-03-25 14:29:48.832 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
-2021-03-25 14:29:48.882 INFO  [21866] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
-2021-03-25 14:29:49.735 INFO  [21869] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
-2021-03-25 14:29:49.742 INFO  [21841] [rtc::impl::SctpTransport::processNotification@708] SCTP connected
-2021-03-25 14:29:49.742 INFO  [21841] [rtc::impl::PeerConnection::changeState@964] Changed state to connected
+#4
+      DC-1 Received: 8070 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 8070 KB/s   Sent: 8000 KB/s
+#5
+      DC-1 Received: 7984 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 7984 KB/s   Sent: 8000 KB/s
+Stats# Received Total: 39 MB   Sent Total: 39 MB   RTT: 0 ms
+
+#6
+      DC-1 Received: 8004 KB/s   Sent: 7998 KB/s   BufferSize: 0
+      TOTL Received: 8004 KB/s   Sent: 7998 KB/s
+#7
+      DC-1 Received: 7997 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 7997 KB/s   Sent: 8000 KB/s
+#8
+      DC-1 Received: 8008 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 8008 KB/s   Sent: 8000 KB/s
+#9
+      DC-1 Received: 8007 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 8007 KB/s   Sent: 8000 KB/s
+#10
+      DC-1 Received: 7999 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 7999 KB/s   Sent: 7999 KB/s
+Stats# Received Total: 81 MB   Sent Total: 81 MB   RTT: 0 ms
+
+#11
+      DC-1 Received: 7997 KB/s   Sent: 8001 KB/s   BufferSize: 0
+      TOTL Received: 7997 KB/s   Sent: 8001 KB/s
+#12
+      DC-1 Received: 7981 KB/s   Sent: 7997 KB/s   BufferSize: 0
+      TOTL Received: 7981 KB/s   Sent: 7997 KB/s
+#13
+      DC-1 Received: 8024 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 8024 KB/s   Sent: 8000 KB/s
+#14
+      DC-1 Received: 7990 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 7990 KB/s   Sent: 7999 KB/s
+#15
+      DC-1 Received: 8001 KB/s   Sent: 8002 KB/s   BufferSize: 0
+      TOTL Received: 8001 KB/s   Sent: 8002 KB/s
+Stats# Received Total: 122 MB   Sent Total: 122 MB   RTT: 0 ms
+```
+
+### Constant Throughput Set 8000 byte, for 300 seconds, send buffer 10000 byte, 5 Data Channel
+
+> `./client-benchmark -p -d 300 -r 8000 -b 10000 -c 5` 
+
+Example Output (Offering Peer's Output);
+```bash
+Stun server is stun:stun.l.google.com:19302
+The local ID is: QZ46
+Url is ws://localhost:8000/QZ46
+Waiting for signaling to be connected...
+2021-04-10 19:57:28.562 INFO  [17117] [rtc::impl::TcpTransport::connect@163] Connected to localhost:8000
+2021-04-10 19:57:28.562 INFO  [17117] [rtc::impl::TcpTransport::runLoop@331] TCP connected
+2021-04-10 19:57:28.563 INFO  [17117] [rtc::impl::WsTransport::incoming@118] WebSocket open
+WebSocket connected, signaling ready
+Enter a remote ID to send an offer:
+lTZA
+Offering to lTZA
+Creating DataChannel with label "DC-1"
+2021-04-10 19:57:37.371 INFO  [17110] [rtc::impl::IceTransport::IceTransport@106] Using STUN server "stun.l.google.com:19302"
+2021-04-10 19:57:37.372 INFO  [17110] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to new
+2021-04-10 19:57:37.373 INFO  [17110] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to in-progress
+2021-04-10 19:57:37.373 INFO  [17110] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to gathering
+Gathering State: in-progress
+Creating DataChannel with label "DC-2"
+2021-04-10 19:57:37.373 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connecting
+Creating DataChannel with label "DC-3"
+2021-04-10 19:57:37.374 INFO  [17119] [rtc::impl::PeerConnection::changeState@1016] Changed state to connecting
+Creating DataChannel with label "DC-4"
+Creating DataChannel with label "DC-5"
+State: Benchmark will run for connecting300 seconds
+
+2021-04-10 19:57:37.376 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:610: Using STUN server stun.l.google.com:19302
+2021-04-10 19:57:37.378 INFO  [17117] [rtc::impl::PeerConnection::changeSignalingState@1044] Changed signaling state to connecting
+2021-04-10 19:57:37.423 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:1328: STUN server binding successful
+2021-04-10 19:57:37.476 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to connected
+2021-04-10 19:57:37.478 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:787: Changing state to completed
+2021-04-10 19:57:38.383 INFO  [17122] [rtc::impl::DtlsTransport::runRecvLoop@503] DTLS handshake finished
+2021-04-10 19:57:38.392 INFO  [17113] [rtc::impl::SctpTransport::processNotification@713] SCTP connected
+2021-04-10 19:57:38.392 INFO  [17113] [rtc::impl::PeerConnection::changeState@1016] Changed state to connected
 State: connected
 State: connected
-DataChannel from zi4B open
-#1 Received: 0 KB/s   Sent: 78 KB/s   BufferSize: 0
-#2 Received: 8002 KB/s   Sent: 7999 KB/s   BufferSize: 0
-#3 Received: 8002 KB/s   Sent: 7998 KB/s   BufferSize: 0
-#4 Received: 7995 KB/s   Sent: 8000 KB/s   BufferSize: 0
-#5 Received: 8000 KB/s   Sent: 8001 KB/s   BufferSize: 0
-Stats# Received Total: 33 MB   Sent Total: 33 MB   RTT: 0 ms
-
-#6 Received: 8001 KB/s   Sent: 7999 KB/s   BufferSize: 0
-#7 Received: 7997 KB/s   Sent: 7998 KB/s   BufferSize: 0
-#8 Received: 8001 KB/s   Sent: 7999 KB/s   BufferSize: 0
-#9 Received: 7998 KB/s   Sent: 8001 KB/s   BufferSize: 0
-#10 Received: 8003 KB/s   Sent: 7998 KB/s   BufferSize: 0
-Stats# Received Total: 74 MB   Sent Total: 74 MB   RTT: 0 ms
-
-#11 Received: 7990 KB/s   Sent: 7998 KB/s   BufferSize: 0
-#12 Received: 7999 KB/s   Sent: 8000 KB/s   BufferSize: 0
-#13 Received: 8001 KB/s   Sent: 8002 KB/s   BufferSize: 0
-#14 Received: 7998 KB/s   Sent: 7999 KB/s   BufferSize: 0
-#15 Received: 8000 KB/s   Sent: 7998 KB/s   BufferSize: 0
-Stats# Received Total: 115 MB   Sent Total: 115 MB   RTT: 0 ms
+DataChannel from lTZA open
+DataChannel from lTZA open
+#DataChannel from lTZA open
+DataChannel from lTZA open
+1
+      DC-5 Received: 0 KB/s   Sent: 79 KB/s   BufferSize: 0
+      DC-3 Received: 0 KB/s   Sent: 0 KB/s   BufferSize: 0
+      DC-4 Received: 0 KB/s   Sent: 79 KB/s   BufferSize: 0
+      DC-2 Received: 0 KB/s   Sent: 0 KB/s   BufferSize: 0
+      DC-1 Received: 0 KB/s   Sent: 0 KB/s   BufferSize: 0
+      TOTL Received: 0 KB/s   Sent: 158 KB/s
+DataChannel from lTZA open
+#2
+      DC-5 Received: 7960 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      DC-3 Received: 7804 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      DC-4 Received: 7883 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      DC-2 Received: 7882 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      DC-1 Received: 7804 KB/s   Sent: 8000 KB/s   BufferSize: 0
+      TOTL Received: 39333 KB/s   Sent: 40000 KB/s
+#3
+      DC-5 Received: 7966 KB/s   Sent: 7996 KB/s   BufferSize: 81504
+      DC-3 Received: 8047 KB/s   Sent: 7996 KB/s   BufferSize: 81504
+      DC-4 Received: 7958 KB/s   Sent: 7996 KB/s   BufferSize: 81504
+      DC-2 Received: 7958 KB/s   Sent: 7996 KB/s   BufferSize: 81504
+      DC-1 Received: 8067 KB/s   Sent: 7996 KB/s   BufferSize: 163597
+      TOTL Received: 39996 KB/s   Sent: 39980 KB/s
+2021-04-10 19:57:40.926 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:843: STUN server binding failed (timeout)
+2021-04-10 19:57:40.926 INFO  [17119] [rtc::impl::IceTransport::LogCallback@339] juice: agent.c:2206: Candidate gathering done
+2021-04-10 19:57:40.926 INFO  [17119] [rtc::impl::PeerConnection::changeGatheringState@1033] Changed gathering state to complete
+Gathering State: complete
+#4
+      DC-5 Received: 7970 KB/s   Sent: 8002 KB/s   BufferSize: 0
+      DC-3 Received: 7957 KB/s   Sent: 8002 KB/s   BufferSize: 0
+      DC-4 Received: 7910 KB/s   Sent: 8002 KB/s   BufferSize: 0
+      DC-2 Received: 7967 KB/s   Sent: 8002 KB/s   BufferSize: 0
+      DC-1 Received: 7957 KB/s   Sent: 8002 KB/s   BufferSize: 0
+      TOTL Received: 39761 KB/s   Sent: 40010 KB/s
+#5
+      DC-5 Received: 7996 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-3 Received: 8006 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-4 Received: 8078 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-2 Received: 8015 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-1 Received: 7928 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 40023 KB/s   Sent: 39995 KB/s
+Stats# Received Total: 165 MB   Sent Total: 166 MB   RTT: 1 ms
+
+#6
+      DC-5 Received: 7968 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-3 Received: 7962 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-4 Received: 7965 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-2 Received: 7970 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-1 Received: 8044 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 39909 KB/s   Sent: 39995 KB/s
+#7
+      DC-5 Received: 6658 KB/s   Sent: 8001 KB/s   BufferSize: 82228
+      DC-3 Received: 6584 KB/s   Sent: 8001 KB/s   BufferSize: 163596
+      DC-4 Received: 6572 KB/s   Sent: 8001 KB/s   BufferSize: 163596
+      DC-2 Received: 6571 KB/s   Sent: 8001 KB/s   BufferSize: 163596
+      DC-1 Received: 6492 KB/s   Sent: 8001 KB/s   BufferSize: 163596
+      TOTL Received: 32877 KB/s   Sent: 40005 KB/s
+#8
+      DC-5 Received: 5773 KB/s   Sent: 7997 KB/s   BufferSize: 0
+      DC-3 Received: 6555 KB/s   Sent: 7997 KB/s   BufferSize: 0
+      DC-4 Received: 6164 KB/s   Sent: 7997 KB/s   BufferSize: 0
+      DC-2 Received: 6241 KB/s   Sent: 7997 KB/s   BufferSize: 0
+      DC-1 Received: 5454 KB/s   Sent: 7997 KB/s   BufferSize: 0
+      TOTL Received: 30187 KB/s   Sent: 39985 KB/s
+#9
+      DC-5 Received: 7442 KB/s   Sent: 8002 KB/s   BufferSize: 326921
+      DC-3 Received: 7580 KB/s   Sent: 8002 KB/s   BufferSize: 326921
+      DC-4 Received: 7363 KB/s   Sent: 8002 KB/s   BufferSize: 326921
+      DC-2 Received: 7524 KB/s   Sent: 8002 KB/s   BufferSize: 326921
+      DC-1 Received: 7362 KB/s   Sent: 8002 KB/s   BufferSize: 408769
+      TOTL Received: 37271 KB/s   Sent: 40010 KB/s
+#10
+      DC-5 Received: 6134 KB/s   Sent: 7999 KB/s   BufferSize: 244963
+      DC-3 Received: 8032 KB/s   Sent: 7999 KB/s   BufferSize: 326286
+      DC-4 Received: 5897 KB/s   Sent: 7999 KB/s   BufferSize: 326286
+      DC-2 Received: 5657 KB/s   Sent: 7999 KB/s   BufferSize: 326286
+      DC-1 Received: 5581 KB/s   Sent: 7999 KB/s   BufferSize: 326286
+      TOTL Received: 31301 KB/s   Sent: 39995 KB/s
+Stats# Received Total: 343 MB   Sent Total: 372 MB   RTT: 16 ms
+
+#11
+      DC-5 Received: 6117 KB/s   Sent: 7998 KB/s   BufferSize: 570756
+      DC-3 Received: 6594 KB/s   Sent: 7998 KB/s   BufferSize: 570756
+      DC-4 Received: 6354 KB/s   Sent: 7998 KB/s   BufferSize: 570756
+      DC-2 Received: 6116 KB/s   Sent: 7998 KB/s   BufferSize: 570756
+      DC-1 Received: 5959 KB/s   Sent: 7998 KB/s   BufferSize: 570756
+      TOTL Received: 31140 KB/s   Sent: 39990 KB/s
+#12
+      DC-5 Received: 6840 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-3 Received: 7468 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-4 Received: 7472 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-2 Received: 7473 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      DC-1 Received: 7236 KB/s   Sent: 7999 KB/s   BufferSize: 0
+      TOTL Received: 36489 KB/s   Sent: 39995 KB/s
+#13
+      DC-5 Received: 8105 KB/s   Sent: 7989 KB/s   BufferSize: 0
+      DC-3 Received: 8020 KB/s   Sent: 7989 KB/s   BufferSize: 0
+      DC-4 Received: 8097 KB/s   Sent: 7989 KB/s   BufferSize: 0
+      DC-2 Received: 8106 KB/s   Sent: 7989 KB/s   BufferSize: 0
+      DC-1 Received: 8018 KB/s   Sent: 7989 KB/s   BufferSize: 0
+      TOTL Received: 40346 KB/s   Sent: 39945 KB/s
+#14
+      DC-5 Received: 8042 KB/s   Sent: 8007 KB/s   BufferSize: 0
+      DC-3 Received: 8029 KB/s   Sent: 8007 KB/s   BufferSize: 0
+      DC-4 Received: 8038 KB/s   Sent: 8007 KB/s   BufferSize: 0
+      DC-2 Received: 8035 KB/s   Sent: 8007 KB/s   BufferSize: 0
+      DC-1 Received: 8036 KB/s   Sent: 8007 KB/s   BufferSize: 0
+      TOTL Received: 40180 KB/s   Sent: 40035 KB/s
+#15
+      DC-5 Received: 7981 KB/s   Sent: 8001 KB/s   BufferSize: 0
+      DC-3 Received: 7987 KB/s   Sent: 8001 KB/s   BufferSize: 0
+      DC-4 Received: 7980 KB/s   Sent: 8001 KB/s   BufferSize: 0
+      DC-2 Received: 7974 KB/s   Sent: 8001 KB/s   BufferSize: 0
+      DC-1 Received: 7972 KB/s   Sent: 8001 KB/s   BufferSize: 82497
+      TOTL Received: 39894 KB/s   Sent: 40005 KB/s
+Stats# Received Total: 538 MB   Sent Total: 581 MB   RTT: 3 ms
 ```
 ```

+ 92 - 65
examples/client-benchmark/main.cpp

@@ -31,6 +31,7 @@
 #include <atomic>
 #include <atomic>
 #include <chrono>
 #include <chrono>
 #include <future>
 #include <future>
+#include <iomanip>
 #include <iostream>
 #include <iostream>
 #include <memory>
 #include <memory>
 #include <random>
 #include <random>
@@ -61,7 +62,8 @@ string randomId(size_t length);
 // Benchmark
 // Benchmark
 const size_t messageSize = 65535;
 const size_t messageSize = 65535;
 binary messageData(messageSize);
 binary messageData(messageSize);
-atomic<size_t> receivedSize = 0, sentSize = 0;
+unordered_map<string, atomic<size_t>> receivedSizeMap;
+unordered_map<string, atomic<size_t>> sentSizeMap;
 bool noSend = false;
 bool noSend = false;
 
 
 // Benchmark - enableThroughputSet params
 // Benchmark - enableThroughputSet params
@@ -188,63 +190,67 @@ int main(int argc, char **argv) try {
 	auto pc = createPeerConnection(config, ws, id);
 	auto pc = createPeerConnection(config, ws, id);
 
 
 	// We are the offerer, so create a data channel to initiate the process
 	// We are the offerer, so create a data channel to initiate the process
-	const string label = "benchmark";
-	cout << "Creating DataChannel with label \"" << label << "\"" << endl;
-	auto dc = pc->createDataChannel(label);
+	for (int i = 1; i <= params.dataChannelCount(); i++) {
+		const string label = "DC-" + std::to_string(i);
+		cout << "Creating DataChannel with label \"" << label << "\"" << endl;
+		auto dc = pc->createDataChannel(label);
+		receivedSizeMap.emplace(label, 0);
+		sentSizeMap.emplace(label, 0);
 
 
-	// Set Buffer Size
-	dc->setBufferedAmountLowThreshold(bufferSize);
+		// Set Buffer Size
+		dc->setBufferedAmountLowThreshold(bufferSize);
 
 
-	dc->onOpen([id, wdc = make_weak_ptr(dc)]() {
-		cout << "DataChannel from " << id << " open" << endl;
-		if (noSend)
-			return;
+		dc->onOpen([id, wdc = make_weak_ptr(dc), label]() {
+			cout << "DataChannel from " << id << " open" << endl;
+			if (noSend)
+				return;
 
 
-		if (enableThroughputSet)
-			return;
+			if (enableThroughputSet)
+				return;
 
 
-		if (auto dcLocked = wdc.lock()) {
-			try {
-				while (dcLocked->bufferedAmount() <= bufferSize) {
-					dcLocked->send(messageData);
-					sentSize += messageData.size();
+			if (auto dcLocked = wdc.lock()) {
+				try {
+					while (dcLocked->bufferedAmount() <= bufferSize) {
+						dcLocked->send(messageData);
+						sentSizeMap.at(label) += messageData.size();
+					}
+				} catch (const std::exception &e) {
+					std::cout << "Send failed: " << e.what() << std::endl;
 				}
 				}
-			} catch (const std::exception &e) {
-				std::cout << "Send failed: " << e.what() << std::endl;
 			}
 			}
-		}
-	});
+		});
 
 
-	dc->onBufferedAmountLow([wdc = make_weak_ptr(dc)]() {
-		if (noSend)
-			return;
+		dc->onBufferedAmountLow([wdc = make_weak_ptr(dc), label]() {
+			if (noSend)
+				return;
 
 
-		if (enableThroughputSet)
-			return;
+			if (enableThroughputSet)
+				return;
 
 
-		auto dcLocked = wdc.lock();
-		if (!dcLocked)
-			return;
+			auto dcLocked = wdc.lock();
+			if (!dcLocked)
+				return;
 
 
-		// Continue sending
-		try {
-			while (dcLocked->isOpen() && dcLocked->bufferedAmount() <= bufferSize) {
-				dcLocked->send(messageData);
-				sentSize += messageData.size();
+			// Continue sending
+			try {
+				while (dcLocked->isOpen() && dcLocked->bufferedAmount() <= bufferSize) {
+					dcLocked->send(messageData);
+					sentSizeMap.at(label) += messageData.size();
+				}
+			} catch (const std::exception &e) {
+				std::cout << "Send failed: " << e.what() << std::endl;
 			}
 			}
-		} catch (const std::exception &e) {
-			std::cout << "Send failed: " << e.what() << std::endl;
-		}
-	});
+		});
 
 
-	dc->onClosed([id]() { cout << "DataChannel from " << id << " closed" << endl; });
+		dc->onClosed([id]() { cout << "DataChannel from " << id << " closed" << endl; });
 
 
-	dc->onMessage([id, wdc = make_weak_ptr(dc)](variant<binary, string> data) {
-		if (holds_alternative<binary>(data))
-			receivedSize += get<binary>(data).size();
-	});
+		dc->onMessage([id, wdc = make_weak_ptr(dc), label](variant<binary, string> data) {
+			if (holds_alternative<binary>(data))
+				receivedSizeMap.at(label) += get<binary>(data).size();
+		});
 
 
-	dataChannelMap.emplace(id, dc);
+		dataChannelMap.emplace(label, dc);
+	}
 
 
 	const int duration = params.durationInSec() > 0 ? params.durationInSec() : INT32_MAX;
 	const int duration = params.durationInSec() > 0 ? params.durationInSec() : INT32_MAX;
 	cout << "Benchmark will run for " << duration << " seconds" << endl;
 	cout << "Benchmark will run for " << duration << " seconds" << endl;
@@ -271,25 +277,39 @@ int main(int argc, char **argv) try {
 			binary tempMessageData(byteToSendThisLoop);
 			binary tempMessageData(byteToSendThisLoop);
 			fill(tempMessageData.begin(), tempMessageData.end(), std::byte(0xFF));
 			fill(tempMessageData.begin(), tempMessageData.end(), std::byte(0xFF));
 
 
-			if (dc->isOpen() && dc->bufferedAmount() <= bufferSize * byteToSendOnEveryLoop) {
-				dc->send(tempMessageData);
-				sentSize += tempMessageData.size();
+			for (const auto &[label, dc] : dataChannelMap) {
+				if (dc->isOpen() && dc->bufferedAmount() <= bufferSize * byteToSendOnEveryLoop) {
+					dc->send(tempMessageData);
+					sentSizeMap.at(label) += tempMessageData.size();
+				}
 			}
 			}
 		}
 		}
 
 
 		if (printCounter >= STEP_COUNT_FOR_1_SEC) {
 		if (printCounter >= STEP_COUNT_FOR_1_SEC) {
-			unsigned long _receivedSize = receivedSize.exchange(0);
-			unsigned long _sentSize = sentSize.exchange(0);
 			const double elapsedTimeInSecs =
 			const double elapsedTimeInSecs =
 			    std::chrono::duration<double>(steady_clock::now() - printTime).count();
 			    std::chrono::duration<double>(steady_clock::now() - printTime).count();
 			printTime = steady_clock::now();
 			printTime = steady_clock::now();
 
 
-			cout << "#" << i / STEP_COUNT_FOR_1_SEC
-			     << " Received: " << static_cast<int>(_receivedSize / (elapsedTimeInSecs * 1000))
-			     << " KB/s"
-			     << "   Sent: " << static_cast<int>(_sentSize / (elapsedTimeInSecs * 1000))
-			     << " KB/s"
-			     << "   BufferSize: " << dc->bufferedAmount() << endl;
+			unsigned long receiveSpeedTotal = 0;
+			unsigned long sendSpeedTotal = 0;
+			cout << "#" << i / STEP_COUNT_FOR_1_SEC << endl;
+			for (const auto &[label, dc] : dataChannelMap) {
+				unsigned long channelReceiveSpeed = static_cast<int>(
+				    receivedSizeMap[label].exchange(0) / (elapsedTimeInSecs * 1000));
+				unsigned long channelSendSpeed =
+				    static_cast<int>(sentSizeMap[label].exchange(0) / (elapsedTimeInSecs * 1000));
+
+				cout << std::setw(10) << label << " Received: " << channelReceiveSpeed << " KB/s"
+				     << "   Sent: " << channelSendSpeed << " KB/s"
+				     << "   BufferSize: " << dc->bufferedAmount() << endl;
+
+				receiveSpeedTotal += channelReceiveSpeed;
+				sendSpeedTotal += channelSendSpeed;
+			}
+			cout << std::setw(10) << "TOTL"
+			     << " Received: " << receiveSpeedTotal << " KB/s"
+			     << "   Sent: " << sendSpeedTotal << " KB/s" << endl;
+
 			printStatCounter++;
 			printStatCounter++;
 			printCounter = 0;
 			printCounter = 0;
 		}
 		}
@@ -308,12 +328,16 @@ int main(int argc, char **argv) try {
 
 
 	dataChannelMap.clear();
 	dataChannelMap.clear();
 	peerConnectionMap.clear();
 	peerConnectionMap.clear();
+	receivedSizeMap.clear();
+	sentSizeMap.clear();
 	return 0;
 	return 0;
 
 
 } catch (const std::exception &e) {
 } catch (const std::exception &e) {
 	std::cout << "Error: " << e.what() << std::endl;
 	std::cout << "Error: " << e.what() << std::endl;
 	dataChannelMap.clear();
 	dataChannelMap.clear();
 	peerConnectionMap.clear();
 	peerConnectionMap.clear();
+	receivedSizeMap.clear();
+	sentSizeMap.clear();
 	return -1;
 	return -1;
 }
 }
 
 
@@ -346,13 +370,16 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 	});
 	});
 
 
 	pc->onDataChannel([id](shared_ptr<DataChannel> dc) {
 	pc->onDataChannel([id](shared_ptr<DataChannel> dc) {
-		cout << "DataChannel from " << id << " received with label \"" << dc->label() << "\""
-		     << endl;
+		const string label = dc->label();
+		cout << "DataChannel from " << id << " received with label \"" << label << "\"" << endl;
 
 
 		cout << "###########################################" << endl;
 		cout << "###########################################" << endl;
 		cout << "### Check other peer's screen for stats ###" << endl;
 		cout << "### Check other peer's screen for stats ###" << endl;
 		cout << "###########################################" << endl;
 		cout << "###########################################" << endl;
 
 
+		receivedSizeMap.emplace(dc->label(), 0);
+		sentSizeMap.emplace(dc->label(), 0);
+
 		// Set Buffer Size
 		// Set Buffer Size
 		dc->setBufferedAmountLowThreshold(bufferSize);
 		dc->setBufferedAmountLowThreshold(bufferSize);
 
 
@@ -360,7 +387,7 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 			try {
 			try {
 				while (dc->bufferedAmount() <= bufferSize) {
 				while (dc->bufferedAmount() <= bufferSize) {
 					dc->send(messageData);
 					dc->send(messageData);
-					sentSize += messageData.size();
+					sentSizeMap.at(label) += messageData.size();
 				}
 				}
 			} catch (const std::exception &e) {
 			} catch (const std::exception &e) {
 				std::cout << "Send failed: " << e.what() << std::endl;
 				std::cout << "Send failed: " << e.what() << std::endl;
@@ -370,7 +397,7 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 		if (!noSend && enableThroughputSet) {
 		if (!noSend && enableThroughputSet) {
 			// Create Send Data Thread
 			// Create Send Data Thread
 			// Thread will join when data channel destroyed or closed
 			// Thread will join when data channel destroyed or closed
-			std::thread([wdc = make_weak_ptr(dc)]() {
+			std::thread([wdc = make_weak_ptr(dc), label]() {
 				steady_clock::time_point stepTime = steady_clock::now();
 				steady_clock::time_point stepTime = steady_clock::now();
 				// Byte count to send for every loop
 				// Byte count to send for every loop
 				int byteToSendOnEveryLoop = throughtputSetAsKB * stepDurationInMs;
 				int byteToSendOnEveryLoop = throughtputSetAsKB * stepDurationInMs;
@@ -399,7 +426,7 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 
 
 						if (dcLocked->bufferedAmount() <= bufferSize) {
 						if (dcLocked->bufferedAmount() <= bufferSize) {
 							dcLocked->send(tempMessageData);
 							dcLocked->send(tempMessageData);
-							sentSize += tempMessageData.size();
+							sentSizeMap.at(label) += tempMessageData.size();
 						}
 						}
 					} catch (const std::exception &e) {
 					} catch (const std::exception &e) {
 						std::cout << "Send failed: " << e.what() << std::endl;
 						std::cout << "Send failed: " << e.what() << std::endl;
@@ -409,7 +436,7 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 			}).detach();
 			}).detach();
 		}
 		}
 
 
-		dc->onBufferedAmountLow([wdc = make_weak_ptr(dc)]() {
+		dc->onBufferedAmountLow([wdc = make_weak_ptr(dc), label]() {
 			if (noSend)
 			if (noSend)
 				return;
 				return;
 
 
@@ -424,7 +451,7 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 			try {
 			try {
 				while (dcLocked->isOpen() && dcLocked->bufferedAmount() <= bufferSize) {
 				while (dcLocked->isOpen() && dcLocked->bufferedAmount() <= bufferSize) {
 					dcLocked->send(messageData);
 					dcLocked->send(messageData);
-					sentSize += messageData.size();
+					sentSizeMap.at(label) += messageData.size();
 				}
 				}
 			} catch (const std::exception &e) {
 			} catch (const std::exception &e) {
 				std::cout << "Send failed: " << e.what() << std::endl;
 				std::cout << "Send failed: " << e.what() << std::endl;
@@ -433,12 +460,12 @@ shared_ptr<PeerConnection> createPeerConnection(const Configuration &config,
 
 
 		dc->onClosed([id]() { cout << "DataChannel from " << id << " closed" << endl; });
 		dc->onClosed([id]() { cout << "DataChannel from " << id << " closed" << endl; });
 
 
-		dc->onMessage([id, wdc = make_weak_ptr(dc)](variant<binary, string> data) {
+		dc->onMessage([id, wdc = make_weak_ptr(dc), label](variant<binary, string> data) {
 			if (holds_alternative<binary>(data))
 			if (holds_alternative<binary>(data))
-				receivedSize += get<binary>(data).size();
+				receivedSizeMap.at(label) += get<binary>(data).size();
 		});
 		});
 
 
-		dataChannelMap.emplace(id, dc);
+		dataChannelMap.emplace(label, dc);
 	});
 	});
 
 
 	peerConnectionMap.emplace(id, pc);
 	peerConnectionMap.emplace(id, pc);

+ 14 - 1
examples/client-benchmark/parse_cl.cpp

@@ -51,6 +51,7 @@ Cmdline::Cmdline(int argc, char *argv[]) // ISO C++17 not allowed: throw (std::s
 	                                       {"enableThroughputSet", no_argument, NULL, 'p'},
 	                                       {"enableThroughputSet", no_argument, NULL, 'p'},
 	                                       {"throughtputSetAsKB", required_argument, NULL, 'r'},
 	                                       {"throughtputSetAsKB", required_argument, NULL, 'r'},
 	                                       {"bufferSize", required_argument, NULL, 'b'},
 	                                       {"bufferSize", required_argument, NULL, 'b'},
+										   {"dataChannelCount", required_argument, NULL, 'c'},
 	                                       {"help", no_argument, NULL, 'h'},
 	                                       {"help", no_argument, NULL, 'h'},
 	                                       {NULL, 0, NULL, 0}};
 	                                       {NULL, 0, NULL, 0}};
 
 
@@ -68,9 +69,10 @@ Cmdline::Cmdline(int argc, char *argv[]) // ISO C++17 not allowed: throw (std::s
 	_p = false;
 	_p = false;
 	_r = 300;
 	_r = 300;
 	_b = 0;
 	_b = 0;
+	_c = 1;
 
 
 	optind = 0;
 	optind = 0;
-	while ((c = getopt_long(argc, argv, "s:t:w:x:d:r:b:enhvop", long_options, &optind)) != -1) {
+	while ((c = getopt_long(argc, argv, "s:t:w:x:d:r:b:c:enhvop", long_options, &optind)) != -1) {
 		switch (c) {
 		switch (c) {
 		case 'n':
 		case 'n':
 			_n = true;
 			_n = true;
@@ -147,6 +149,15 @@ Cmdline::Cmdline(int argc, char *argv[]) // ISO C++17 not allowed: throw (std::s
 			}
 			}
 			break;
 			break;
 
 
+		case 'c':
+			_c = atoi(optarg);
+			if (_c <= 0) {
+				std::string err;
+				err += "parameter range error: c must be > 0";
+				throw(std::range_error(err));
+			}
+			break;
+
 		case 'h':
 		case 'h':
 			_h = true;
 			_h = true;
 			this->usage(EXIT_SUCCESS);
 			this->usage(EXIT_SUCCESS);
@@ -196,6 +207,8 @@ libdatachannel client implementing WebRTC Data Channels with WebSocket signaling
           Send a constant data per second (KB). See throughtputSetAsKB params.\n\
           Send a constant data per second (KB). See throughtputSetAsKB params.\n\
    [ -r ] [ --throughtputSetAsKB ] (type=INTEGER, range>0...INT_MAX, default=300)\n\
    [ -r ] [ --throughtputSetAsKB ] (type=INTEGER, range>0...INT_MAX, default=300)\n\
           Send constant data per second (KB).\n\
           Send constant data per second (KB).\n\
+   [ -c ] [ --dataChannelCount ] (type=INTEGER, range>0...INT_MAX, default=1)\n\
+          Dat Channel count to create.\n\
    [ -h ] [ --help ] (type=FLAG)\n\
    [ -h ] [ --help ] (type=FLAG)\n\
           Display this help and exit.\n";
           Display this help and exit.\n";
 	}
 	}

+ 4 - 2
examples/client-benchmark/parse_cl.h

@@ -45,6 +45,7 @@ private:
   bool _p;
   bool _p;
   int _r;
   int _r;
   int _b;
   int _b;
+  int _c;
 
 
   /* other stuff to keep track of */
   /* other stuff to keep track of */
   std::string _program_name;
   std::string _program_name;
@@ -69,9 +70,10 @@ public:
   bool h () const { return _h; }
   bool h () const { return _h; }
   int durationInSec () const { return _d; }
   int durationInSec () const { return _d; }
   bool noSend () const { return _o; }
   bool noSend () const { return _o; }
-  int bufferSize() const { return _b;}
+  int bufferSize() const { return _b; }
   bool enableThroughputSet () const { return _p; }
   bool enableThroughputSet () const { return _p; }
-  int throughtputSetAsKB() const { return _r;}  
+  int throughtputSetAsKB() const { return _r; }  
+  int dataChannelCount() const { return _c; }
 };
 };
 
 
 #endif
 #endif