Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LARN
PRRT
Commits
e4cd39e1
Commit
e4cd39e1
authored
Mar 15, 2018
by
Andreas Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bps conversion. Add missing tracking field.
parent
02539561
Pipeline
#2061
failed with stages
in 21 seconds
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
7 deletions
+63
-7
prrt/cprrt.pxd
prrt/cprrt.pxd
+5
-1
prrt/proto/bbr.c
prrt/proto/bbr.c
+17
-4
prrt/proto/bbr.h
prrt/proto/bbr.h
+3
-0
prrt/proto/receiver.c
prrt/proto/receiver.c
+2
-1
prrt/proto/socket.c
prrt/proto/socket.c
+15
-1
prrt/proto/socket.h
prrt/proto/socket.h
+3
-0
prrt/prrt.pyx
prrt/prrt.pyx
+18
-0
No files found.
prrt/cprrt.pxd
View file @
e4cd39e1
include
"posix/time.pxd"
from
libc.stdint
cimport
uint32_t
,
uint16_t
,
uint8_t
,
int32_t
from
libc.stdint
cimport
uint32_t
,
uint16_t
,
uint8_t
,
int32_t
,
uint64_t
from
libc.string
cimport
const_char
cdef
extern
from
"pthread.h"
nogil
:
...
...
@@ -147,6 +147,10 @@ cdef extern from "proto/socket.h":
float
PrrtSocket_get_plr
(
PrrtSocket
*
socket
)
uint32_t
PrrtSocket_get_delivery_rate
(
PrrtSocket
*
socket
)
uint32_t
PrrtSocket_get_btlbw
(
PrrtSocket
*
socket
)
uint32_t
PrrtSocket_get_bbr_state
(
PrrtSocket
*
s
)
uint64_t
PrrtSocket_get_full_bw
(
PrrtSocket
*
s
)
bint
PrrtSocket_get_filled_pipe
(
PrrtSocket
*
s
)
bint
PrrtSocket_get_app_limited
(
PrrtSocket
*
socket
)
bint
PrrtSocket_enable_thread_pinning
(
PrrtSocket
*
socket
)
...
...
prrt/proto/bbr.c
View file @
e4cd39e1
...
...
@@ -9,7 +9,7 @@ uint32_t BBR_Inflight(BBR* bbr, float gain)
if
(
bbr
->
rtprop
==
Inf
)
return
InitialCwnd
;
/* no valid RTT samples yet */
uint32_t
quanta
=
3
*
bbr
->
send_quantum
;
uint32_t
estimated_bdp
=
bbr
->
bw
*
bbr
->
rtprop
;
uint32_t
estimated_bdp
=
(
bbr
->
bw
*
bbr
->
rtprop
)
/
(
1000
*
1000
*
8
)
;
return
(
uint32_t
)(
gain
*
estimated_bdp
+
quanta
);
}
...
...
@@ -30,7 +30,7 @@ void BBR_UpdateBtlBw(BBR* bbr, PrrtRateSample* rs, prrtByteCount_t packet_delive
bbr
->
round_start
=
false
;
}
if
((
rs
->
delivery_rate
>=
bbr
->
bw
||
!
rs
->
is_app_limited
)
&&
rs
->
delivery_rate
!=
0
)
{
bbr
->
bw
=
(
uint32_t
)
WindowedFilter_push
(
bbr
->
btlBwFilter
,
(
uint32_t
)
rs
->
delivery_rate
);
bbr
->
bw
=
(
uint32_t
)
WindowedFilter_push
(
bbr
->
btlBwFilter
,
(
uint32_t
)
(
rs
->
delivery_rate
)
)
;
debug
(
DEBUG_BBR
,
"Current BtlBw: %u, RS delivery rate: %u"
,
bbr
->
bw
,
(
uint32_t
)
rs
->
delivery_rate
);
}
}
...
...
@@ -197,7 +197,7 @@ void BBR_SetCwnd(BBR* bbr, PrrtPacketTracking* packetTracking)
void
BBR_SetPacingRateWithGain
(
BBR
*
bbr
,
float
pacing_gain
)
{
uint32_t
rate
=
(
uint32_t
)
(
pacing_gain
*
(
float
)
bbr
->
bw
);
uint32_t
rate
=
(
uint32_t
)
(
pacing_gain
*
(
(
float
)
bbr
->
bw
)
/
(
1000
*
1000
*
8
))
;
debug
(
DEBUG_BBR
,
"Current rate: %u, Pacing gain: %f, BtlBw: %u, Calc Rate: %u, Filled pipe: %u"
,
bbr
->
pacing_rate
,
pacing_gain
,
bbr
->
bw
,
rate
,
bbr
->
filled_pipe
);
if
(
rate
!=
0
&&
(
bbr
->
filled_pipe
||
rate
>
bbr
->
pacing_rate
))
...
...
@@ -278,3 +278,16 @@ uint32_t BBR_getRTProp(BBR* bbr)
{
return
bbr
->
rtprop
;
}
uint32_t
BBR_getState
(
BBR
*
bbr
)
{
return
bbr
->
state
;
}
bool
BBR_getFilledPipe
(
BBR
*
bbr
)
{
return
bbr
->
filled_pipe
;
}
uint64_t
BBR_getFullBw
(
BBR
*
bbr
)
{
return
bbr
->
full_bw
;
}
prrt/proto/bbr.h
View file @
e4cd39e1
...
...
@@ -78,6 +78,9 @@ void BBR_destroy(BBR* bbr);
uint32_t
BBR_getPacingRate
(
BBR
*
bbr
);
uint32_t
BBR_getCwnd
(
BBR
*
bbr
);
prrtDeliveryRate_t
BBR_getBtlBw
(
BBR
*
bbr
);
uint32_t
BBR_getState
(
BBR
*
bbr
);
uint64_t
BBR_getFullBw
(
BBR
*
bbr
);
bool
BBR_getFilledPipe
(
BBR
*
bbr
);
uint32_t
BBR_getRTProp
(
BBR
*
bbr
);
#endif //PRRT_BBR_H
prrt/proto/receiver.c
View file @
e4cd39e1
...
...
@@ -173,6 +173,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
pthread_cond_wait
(
&
recv
->
recordNotFoundCv
,
&
recv
->
lock
);
packet
=
PrrtInFlightPacketStore_get_packet
(
inflightPacketStore
,
seqnum
);
}
recv
->
packetTracking
->
bytes_delivered
=
packet
->
delivered
;
PrrtReceiver_updateRateSample
(
recv
->
rateSample
,
packet
,
receiveTime
,
recv
->
packetTracking
);
...
...
@@ -185,7 +186,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
recv
->
packetTracking
->
packets_delivered
++
;
recv
->
packetTracking
->
packets_in_flight
=
(
prrtSequenceNumber_t
)
(
PrrtInFlightPacketStore_get_queue_size
(
recv
->
dataInflightPacketStore
)
+
PrrtInFlightPacketStore_get_queue_size
(
recv
->
redundancyInflightPacketStore
));
recv
->
packetTracking
->
prior_inflight
=
recv
->
packetTracking
->
packets_in_flight
;
if
(
recv
->
rateSample
!=
NULL
)
{
if
(
recv
->
rateSample
!=
NULL
&&
result
)
{
BBR_OnACK
(
recv
->
bbr
,
recv
->
csi
,
recv
->
rateSample
,
recv
->
packetTracking
);
}
return
result
;
...
...
prrt/proto/socket.c
View file @
e4cd39e1
...
...
@@ -586,7 +586,7 @@ bool PrrtSocket_uses_thread_pinning(PrrtSocket *s) {
}
uint32_t
PrrtSocket_get_rtprop
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_rtp
rop
(
s
->
receiver
->
csi
);
return
BBR_getRTP
rop
(
s
->
receiver
->
bbr
);
}
prrtPacketLossRate_t
PrrtSocket_get_plr
(
PrrtSocket
*
s
)
{
...
...
@@ -601,6 +601,20 @@ prrtDeliveryRate_t PrrtSocket_get_btlbw(PrrtSocket *s) {
return
BBR_getBtlBw
(
s
->
receiver
->
bbr
);
}
uint32_t
PrrtSocket_get_bbr_state
(
PrrtSocket
*
s
)
{
return
BBR_getState
(
s
->
receiver
->
bbr
);
}
bool
PrrtSocket_get_filled_pipe
(
PrrtSocket
*
s
)
{
return
BBR_getFilledPipe
(
s
->
receiver
->
bbr
);
}
uint64_t
PrrtSocket_get_full_bw
(
PrrtSocket
*
s
)
{
return
BBR_getFullBw
(
s
->
receiver
->
bbr
);
}
bool
PrrtSocket_get_app_limited
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_app_limited
(
s
->
receiver
->
csi
);
}
prrt/proto/socket.h
View file @
e4cd39e1
...
...
@@ -134,6 +134,9 @@ uint32_t PrrtSocket_get_rtprop(PrrtSocket *s);
prrtPacketLossRate_t
PrrtSocket_get_plr
(
PrrtSocket
*
s
);
prrtDeliveryRate_t
PrrtSocket_get_delivery_rate
(
PrrtSocket
*
s
);
prrtDeliveryRate_t
PrrtSocket_get_btlbw
(
PrrtSocket
*
s
);
uint64_t
PrrtSocket_get_full_bw
(
PrrtSocket
*
s
);
bool
PrrtSocket_get_filled_pipe
(
PrrtSocket
*
s
);
uint32_t
PrrtSocket_get_bbr_state
(
PrrtSocket
*
s
);
bool
PrrtSocket_get_app_limited
(
PrrtSocket
*
s
);
#endif // PRRT_SOCKET_H
prrt/prrt.pyx
View file @
e4cd39e1
...
...
@@ -192,6 +192,24 @@ cdef class PrrtSocket:
raise
Exception
(
"Not a sender."
)
return
cprrt
.
PrrtSocket_get_btlbw
(
self
.
_c_socket
)
property
bbr_state
:
def
__get__
(
self
):
if
not
self
.
isSender
:
raise
Exception
(
"Not a sender."
)
return
cprrt
.
PrrtSocket_get_bbr_state
(
self
.
_c_socket
)
property
bbr_filled_pipe
:
def
__get__
(
self
):
if
not
self
.
isSender
:
raise
Exception
(
"Not a sender."
)
return
cprrt
.
PrrtSocket_get_filled_pipe
(
self
.
_c_socket
)
property
bbr_full_bw
:
def
__get__
(
self
):
if
not
self
.
isSender
:
raise
Exception
(
"Not a sender."
)
return
cprrt
.
PrrtSocket_get_full_bw
(
self
.
_c_socket
)
property
app_limited
:
def
__get__
(
self
):
if
not
self
.
isSender
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment