Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PRRT
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
26
Issues
26
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LARN
PRRT
Commits
caf62602
Commit
caf62602
authored
Apr 27, 2018
by
Andreas Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Estimating P_GG, P_BB, mu and rho.
parent
feadf321
Pipeline
#2246
failed with stages
in 51 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
12 deletions
+90
-12
prrt/cprrt.pxd
prrt/cprrt.pxd
+5
-0
prrt/proto/channelStateInformation.c
prrt/proto/channelStateInformation.c
+26
-4
prrt/proto/channelStateInformation.h
prrt/proto/channelStateInformation.h
+10
-2
prrt/proto/processes/dataReceiver.c
prrt/proto/processes/dataReceiver.c
+10
-2
prrt/proto/socket.c
prrt/proto/socket.c
+15
-0
prrt/proto/socket.h
prrt/proto/socket.h
+4
-0
prrt/proto/stores/receptionTable.c
prrt/proto/stores/receptionTable.c
+1
-1
prrt/proto/types/lossStatistics.h
prrt/proto/types/lossStatistics.h
+3
-3
prrt/prrt.pyx
prrt/prrt.pyx
+16
-0
No files found.
prrt/cprrt.pxd
View file @
caf62602
...
...
@@ -148,6 +148,11 @@ cdef extern from "proto/socket.h":
uint32_t
PrrtSocket_get_btlbw_fwd
(
PrrtSocket
*
s
);
uint32_t
PrrtSocket_get_btlbw_back
(
PrrtSocket
*
s
);
double
PrrtSocket_get_P_GG
(
PrrtSocket
*
s
);
double
PrrtSocket_get_P_BB
(
PrrtSocket
*
s
);
double
PrrtSocket_get_mu
(
PrrtSocket
*
s
);
double
PrrtSocket_get_rho
(
PrrtSocket
*
s
);
bint
PrrtSocket_get_app_limited
(
PrrtSocket
*
socket
)
bint
PrrtSocket_enable_thread_pinning
(
PrrtSocket
*
socket
)
...
...
prrt/proto/channelStateInformation.c
View file @
caf62602
#include <stdlib.h>
#include <math.h>
#include "../defines.h"
#include "../util/common.h"
#include "../util/dbg.h"
#include "channelStateInformation.h"
#include "clock.h"
#include "receiver.h"
#include "channelStateInformation.h"
PrrtChannelStateInformation
*
PrrtChannelStateInformation_create
()
{
...
...
@@ -44,10 +45,15 @@ void PrrtChannelStateInformation_update_rtprop(PrrtChannelStateInformation *csi,
pthread_mutex_unlock
(
&
csi
->
lock
);
}
void
PrrtChannelStateInformation_update_plr
(
PrrtChannelStateInformation
*
csi
,
prrtSequenceNumber_t
erasures
,
prrtSequenceNumber_t
packets
)
{
void
PrrtChannelStateInformation_update_loss_information
(
PrrtChannelStateInformation
*
csi
,
PrrtLossStatistics
stats
)
{
pthread_mutex_lock
(
&
csi
->
lock
);
csi
->
plr
=
((
float
)
erasures
)
/
packets
;
csi
->
plr
=
PrrtLossStatistics_get_packet_loss_rate
(
stats
);
float
L_B
=
PrrtLossStatistics_get_avg_burst_length
(
stats
);
csi
->
P_GG
=
(
isnan
(
L_B
))
?
0
:
1
-
(
1
.
0
/
L_B
);
float
L_G
=
PrrtLossStatistics_get_avg_gap_length
(
stats
);
csi
->
P_BB
=
(
isnan
(
L_G
))
?
0
:
1
-
(
1
.
0
/
L_G
);
csi
->
mu
=
(
1
-
csi
->
P_BB
)
/
(
2
-
csi
->
P_GG
-
csi
->
P_BB
);
csi
->
rho
=
csi
->
P_GG
+
csi
->
P_BB
-
1
;
pthread_mutex_unlock
(
&
csi
->
lock
);
}
...
...
@@ -84,6 +90,22 @@ prrtPacketLossRate_t PrrtChannelStateInformation_get_plr(PrrtChannelStateInforma
return
csi
->
plr
;
}
double
PrrtChannelStateInformation_get_P_GG
(
PrrtChannelStateInformation
*
csi
)
{
return
csi
->
P_GG
;
}
double
PrrtChannelStateInformation_get_P_BB
(
PrrtChannelStateInformation
*
csi
)
{
return
csi
->
P_BB
;
}
double
PrrtChannelStateInformation_get_mu
(
PrrtChannelStateInformation
*
csi
)
{
return
csi
->
mu
;
}
double
PrrtChannelStateInformation_get_rho
(
PrrtChannelStateInformation
*
csi
)
{
return
csi
->
rho
;
}
prrtDeliveryRate_t
PrrtChannelStateInformation_get_delivery_rate
(
PrrtChannelStateInformation
*
csi
)
{
return
csi
->
deliveryRate
;
}
...
...
prrt/proto/channelStateInformation.h
View file @
caf62602
...
...
@@ -3,6 +3,7 @@
#include <stdbool.h>
#include "types/packet.h"
#include "types/lossStatistics.h"
typedef
struct
prrtChannelStateInformation
{
pthread_mutex_t
lock
;
...
...
@@ -23,6 +24,10 @@ typedef struct prrtChannelStateInformation {
uint8_t
btlbw_filter_length
;
bool
appLimited
;
double
P_GG
;
double
P_BB
;
double
mu
;
double
rho
;
}
PrrtChannelStateInformation
;
PrrtChannelStateInformation
*
PrrtChannelStateInformation_create
(
void
);
...
...
@@ -33,11 +38,14 @@ prrtDeliveryRate_t PrrtChannelStateInformation_get_btlbw(PrrtChannelStateInforma
bool
PrrtChannelStateInformation_get_app_limited
(
PrrtChannelStateInformation
*
csi
);
prrtPacketLossRate_t
PrrtChannelStateInformation_get_plr
(
PrrtChannelStateInformation
*
csi
);
void
PrrtChannelStateInformation_update_plr
(
PrrtChannelStateInformation
*
csi
,
prrtSequenceNumber_t
erasures
,
prrtSequenceNumber_t
packets
);
void
PrrtChannelStateInformation_update_loss_information
(
PrrtChannelStateInformation
*
csi
,
PrrtLossStatistics
stats
);
void
PrrtChannelStateInformation_update_delivery_rate
(
PrrtChannelStateInformation
*
csi
,
PrrtPacket
*
packet
,
prrtDeliveryRate_t
rate
);
void
PrrtChannelStateInformation_update_app_limited
(
PrrtChannelStateInformation
*
csi
,
bool
appLimited
);
bool
PrrtChannelStateInformation_destroy
(
PrrtChannelStateInformation
*
csi
);
double
PrrtChannelStateInformation_get_P_GG
(
PrrtChannelStateInformation
*
csi
);
double
PrrtChannelStateInformation_get_P_BB
(
PrrtChannelStateInformation
*
csi
);
double
PrrtChannelStateInformation_get_mu
(
PrrtChannelStateInformation
*
csi
);
double
PrrtChannelStateInformation_get_rho
(
PrrtChannelStateInformation
*
csi
);
void
PrrtChannelStateInformation_print
(
PrrtChannelStateInformation
*
csi
);
...
...
prrt/proto/processes/dataReceiver.c
View file @
caf62602
...
...
@@ -221,8 +221,16 @@ void handle_feedback_packet(PrrtSocket *prrtSocket, PrrtPacket *prrtPacket, prrt
PrrtChannelStateInformation_update_rtprop
(
prrtSocket
->
receiver
->
csi
,
(
prrtTimedelta_t
)
(
receiveTime
-
forwardTripTimestamp
));
debug
(
DEBUG_DATARECEIVER
,
"PrrtChannelStateInformation_update_rtprop "
);
PrrtChannelStateInformation_update_plr
(
prrtSocket
->
receiver
->
csi
,
feedbackPayload
->
erasureCount
,
feedbackPayload
->
packetCount
);
debug
(
DEBUG_DATARECEIVER
,
"PrrtChannelStateInformation_update_plr "
);
PrrtLossStatistics
stats
=
{
.
burstCount
=
feedbackPayload
->
burstCount
,
.
burstLength
=
feedbackPayload
->
burstLength
,
.
erasureCount
=
feedbackPayload
->
erasureCount
,
.
gapCount
=
feedbackPayload
->
gapCount
,
.
gapLength
=
feedbackPayload
->
gapLength
,
.
packetCount
=
feedbackPayload
->
packetCount
};
PrrtChannelStateInformation_update_loss_information
(
prrtSocket
->
receiver
->
csi
,
stats
);
debug
(
DEBUG_DATARECEIVER
,
"PrrtChannelStateInformation_update_loss_information "
);
return
;
error:
...
...
prrt/proto/socket.c
View file @
caf62602
...
...
@@ -532,6 +532,21 @@ prrtDeliveryRate_t PrrtSocket_get_btlbw_back(PrrtSocket *s) {
return
0
;
}
double
PrrtSocket_get_P_GG
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_P_GG
(
s
->
receiver
->
csi
);
}
double
PrrtSocket_get_P_BB
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_P_BB
(
s
->
receiver
->
csi
);
}
double
PrrtSocket_get_mu
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_mu
(
s
->
receiver
->
csi
);
}
double
PrrtSocket_get_rho
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_rho
(
s
->
receiver
->
csi
);
}
bool
PrrtSocket_get_app_limited
(
PrrtSocket
*
s
)
{
return
PrrtChannelStateInformation_get_app_limited
(
s
->
receiver
->
csi
);
...
...
prrt/proto/socket.h
View file @
caf62602
...
...
@@ -131,6 +131,10 @@ prrtDeliveryRate_t PrrtSocket_get_delivery_rate_fwd(PrrtSocket *s);
prrtDeliveryRate_t
PrrtSocket_get_btlbw_fwd
(
PrrtSocket
*
s
);
prrtDeliveryRate_t
PrrtSocket_get_btlbw_back
(
PrrtSocket
*
s
);
bool
PrrtSocket_get_app_limited
(
PrrtSocket
*
s
);
double
PrrtSocket_get_P_GG
(
PrrtSocket
*
s
);
double
PrrtSocket_get_P_BB
(
PrrtSocket
*
s
);
double
PrrtSocket_get_mu
(
PrrtSocket
*
s
);
double
PrrtSocket_get_rho
(
PrrtSocket
*
s
);
char
*
PrrtSocket_inet_ntoa
(
struct
in_addr
*
in
);
uint16_t
PrrtSocket_ntohs
(
uint16_t
v
);
...
...
prrt/proto/stores/receptionTable.c
View file @
caf62602
...
...
@@ -8,7 +8,7 @@ PrrtReceptionTable *PrrtReceptionTable_create(void) {
check_mem
(
t
);
t
->
start
=
0
;
t
->
nextNumberAfterWindow
=
0
;
t
->
windowSize
=
10
00
;
t
->
windowSize
=
2
00
;
t
->
bitmap
=
Bitmap_create
(
false
,
SEQNO_SPACE
);
pthread_mutexattr_t
attr
;
...
...
prrt/proto/types/lossStatistics.h
View file @
caf62602
...
...
@@ -14,8 +14,8 @@ typedef struct lossStatistics {
PrrtLossStatistics
PrrtLossStatistics_add
(
PrrtLossStatistics
a
,
PrrtLossStatistics
b
);
#define LossStatistics_get_packet_loss_rate(stats) (((float) stats.erasureCount) / stats.packetCount)
#define LossStatistics_get_avg_gap_length(stats) (((float) stats.gapLength) / stats.gapCount)
#define LossStatistics_get_avg_burst_length(stats) (((float) stats.burstLength) / stats.burstCount)
#define
Prrt
LossStatistics_get_packet_loss_rate(stats) (((float) stats.erasureCount) / stats.packetCount)
#define
Prrt
LossStatistics_get_avg_gap_length(stats) (((float) stats.gapLength) / stats.gapCount)
#define
Prrt
LossStatistics_get_avg_burst_length(stats) (((float) stats.burstLength) / stats.burstCount)
#endif //PRRT_LOSS_STATISTICS_H
\ No newline at end of file
prrt/prrt.pyx
View file @
caf62602
...
...
@@ -253,6 +253,22 @@ cdef class PrrtSocket:
def
__get__
(
self
):
return
cprrt
.
PrrtSocket_get_app_limited
(
self
.
_c_socket
)
property
P_GG
:
def
__get__
(
self
):
return
cprrt
.
PrrtSocket_get_P_GG
(
self
.
_c_socket
)
property
P_BB
:
def
__get__
(
self
):
return
cprrt
.
PrrtSocket_get_P_BB
(
self
.
_c_socket
)
property
mu
:
def
__get__
(
self
):
return
cprrt
.
PrrtSocket_get_mu
(
self
.
_c_socket
)
property
rho
:
def
__get__
(
self
):
return
cprrt
.
PrrtSocket_get_rho
(
self
.
_c_socket
)
def
__dealloc__
(
self
):
if
self
.
_c_socket
!=
NULL
:
cprrt
.
PrrtSocket_close
(
self
.
_c_socket
)
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