Commit 23934970 authored by Andreas Schmidt's avatar Andreas Schmidt

Merge branch 'feature/socketMerging' into feature/congestionControl

parents 92e34718 00f430d8
Pipeline #2203 failed with stages
in 13 seconds
......@@ -25,7 +25,7 @@ import prrt
port = int(sys.argv[1])
s = prrt.PrrtSocket(port=port, isSender=False)
s = prrt.PrrtSocket(port=port)
while True:
d = s.recv()
......@@ -44,7 +44,7 @@ import prrt
host = sys.argv[1]
port = int(sys.argv[2])
s = prrt.PrrtSocket(port=port, isSender=True)
s = prrt.PrrtSocket(port=port)
s.connect(host, port)
for i in range(10):
......
......@@ -93,9 +93,7 @@ cdef extern from "proto/receiver.h":
cdef extern from "proto/socket.h":
cdef struct prrtSocket:
int dataSocketFd
int feedbackSocketFd
pthread_t receiveFeedbackThread
int socketFd
pthread_t sendDataThread
pthread_mutex_t outQueueFilledMutex
......@@ -119,7 +117,7 @@ cdef extern from "proto/socket.h":
ctypedef prrtSocket PrrtSocket
cdef PrrtSocket* PrrtSocket_create(bint isSender, const uint32_t target_delay)
cdef PrrtSocket* PrrtSocket_create(const uint32_t target_delay)
bint PrrtSocket_bind(PrrtSocket *sock_ptr, const_char *ipAddress, const uint16_t port)
int PrrtSocket_close(const PrrtSocket *sock_ptr)
int PrrtSocket_connect(PrrtSocket *sock_ptr, const_char *host, const uint16_t port)
......@@ -139,13 +137,15 @@ cdef extern from "proto/socket.h":
bint PrrtSocket_set_coding_parameters(PrrtSocket *s, uint8_t k, uint8_t n, uint8_t c, uint8_t *n_cycle)
PrrtCodingConfiguration *PrrtSocket_get_coding_parameters(PrrtSocket *s)
bint PrrtSocket_uses_thread_pinning(PrrtSocket *socket)
uint32_t PrrtSocket_get_rtprop(PrrtSocket *socket)
bint PrrtSocket_uses_thread_pinning(PrrtSocket *socket)
uint32_t PrrtSocket_get_rtt(PrrtSocket *socket)
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_rtprop_fwd(PrrtSocket *socket)
float PrrtSocket_get_plr_fwd(PrrtSocket *socket)
uint32_t PrrtSocket_get_delivery_rate_fwd(PrrtSocket *socket)
uint32_t PrrtSocket_get_btlbw_fwd(PrrtSocket *s);
uint32_t PrrtSocket_get_btlbw_back(PrrtSocket *s);
uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s)
uint64_t PrrtSocket_get_full_bw(PrrtSocket *s)
bint PrrtSocket_get_filled_pipe(PrrtSocket *s)
......@@ -158,10 +158,9 @@ cdef extern from "proto/socket.h":
uint32_t PrrtSocket_get_pipe(PrrtSocket *s)
uint32_t PrrtSocket_get_delivered(PrrtSocket *s)
bint PrrtSocket_get_bbr_round_start(PrrtSocket *s)
uint32_t PrrtSocket_get_bbr_app_limited(PrrtSocket *socket)
bint PrrtSocket_get_bbr_is_app_limited(PrrtSocket *socket)
bint PrrtSocket_enable_thread_pinning(PrrtSocket *socket)
cdef extern from "proto/stores/packetDeliveryStore.h":
......
......@@ -9,7 +9,6 @@ add_library(PRRT ../defines.h
../xlap/xlap.c ../xlap/xlap.h
applicationConstraints.c applicationConstraints.h
processes/dataReceiver.c processes/dataReceiver.h
processes/feedbackReceiver.c processes/feedbackReceiver.h
processes/dataTransmitter.c processes/dataTransmitter.h
stores/dataPacketStore.c stores/dataPacketStore.h
stores/deliveredPacketTable.c stores/deliveredPacketTable.h
......
......@@ -74,7 +74,7 @@ static bool send_feedback(PrrtSocket *sock_ptr, struct sockaddr_in remote, prrtS
struct sockaddr_in targetaddr;
memset((char *) &targetaddr, 0, sizeof(targetaddr));
targetaddr.sin_family = AF_INET;
targetaddr.sin_port = htons((uint16_t) (remote_port + 1));
targetaddr.sin_port = htons((uint16_t) (remote_port));
struct hostent *hp;
hp = gethostbyname(remote_host);
......@@ -97,7 +97,7 @@ static bool send_feedback(PrrtSocket *sock_ptr, struct sockaddr_in remote, prrtS
check(PrrtPacket_encode(buf, MAX_PAYLOAD_LENGTH, feedback_pkt_ptr), "Buffer for encoding feedback is too small");
check(sendto(sock_ptr->feedbackSocketFd, buf, length, 0, (struct sockaddr *) &targetaddr, sizeof(targetaddr)) ==
check(sendto(sock_ptr->socketFd, buf, length, 0, (struct sockaddr *) &targetaddr, sizeof(targetaddr)) ==
length, "Sending feedback failed.");
free(buf);
......@@ -207,6 +207,21 @@ static void handle_redundancy_packet(PrrtSocket *socket, PrrtPacket *packet) {
return;
}
void handle_feedback_packet(const PrrtSocket *prrtSocket, const PrrtPacket *prrtPacket, prrtTimestamp_t receiveTime) {
check(prrtPacket != NULL, "Cannot be null");
debug(DEBUG_DATARECEIVER, "handle_feedback_packet");
PrrtPacketFeedbackPayload *feedbackPayload = (PrrtPacketFeedbackPayload *) prrtPacket->payload;
prrtTimestamp_t forwardTripTimestamp = feedbackPayload->forwardTripTimestamp_us;
prrtTimedelta_t rtt = (prrtTimedelta_t) (receiveTime - forwardTripTimestamp);
PrrtReceiver_on_ack(prrtSocket->receiver, feedbackPayload, receiveTime, rtt);
return;
error:
PERROR("handle_feedback_packet failed.");
}
void receive_from_socket(PrrtSocket *socket_ptr, unsigned char buffer_ptr[65528], ssize_t *received_size,
struct sockaddr_in *remote_ptr, socklen_t *remote_len_ptr, struct timespec *packet_timestamp_ptr,
uint64_t *packet_cyclestamp_ptr) {
......@@ -230,7 +245,7 @@ void receive_from_socket(PrrtSocket *socket_ptr, unsigned char buffer_ptr[65528]
msg.msg_control = &control;
msg.msg_controllen = sizeof(control);
*received_size = recvmsg(socket_ptr->dataSocketFd, &msg, 0);
*received_size = recvmsg(socket_ptr->socketFd, &msg, 0);
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
switch (cmsg->cmsg_type) {
......@@ -244,7 +259,7 @@ void receive_from_socket(PrrtSocket *socket_ptr, unsigned char buffer_ptr[65528]
}
}
} else {
*received_size = recvfrom(socket_ptr->dataSocketFd, buffer_ptr, MAX_PAYLOAD_LENGTH, 0,
*received_size = recvfrom(socket_ptr->socketFd, buffer_ptr, MAX_PAYLOAD_LENGTH, 0,
(struct sockaddr *) remote_ptr, remote_len_ptr);
clock_gettime(CLOCK_REALTIME, packet_timestamp_ptr);
}
......@@ -259,6 +274,7 @@ void *receive_data_loop(void *ptr) {
PrrtSocket *sock_ptr = ptr;
while (1) {
debug(DEBUG_DATARECEIVER, "About to receive.");
XlapTimestampPlaceholder tsph1;
XlapTimestampPlaceholder tsph2;
XlapTimestampPlaceholder tsph3;
......@@ -271,20 +287,16 @@ void *receive_data_loop(void *ptr) {
receive_from_socket(sock_ptr, buffer, &n, &remote, &addrlen, &packet_recv_timestamp, &packet_recv_cyclestamp);
debug(DEBUG_HARDSTAMPING, "Packet TS:\t%ld.%09ld; Who? %s", (long) packet_recv_timestamp.tv_sec,
packet_recv_timestamp.tv_nsec, inet_ntoa(remote.sin_addr));
prrtTimestamp_t prrt_recv_timestamp = PrrtClock_TimespecToPrrtTimestamp(packet_recv_timestamp);
sock_ptr->lastReceivedTimestamp = prrt_recv_timestamp;
XlapTimeStampClock(&tsph1, ts_any_packet, 0, LinkReceive);
XlapTimeStampCycle(&tsph1, ts_any_packet, 0, LinkReceive);
PrrtPacket *packet = (PrrtPacket *) calloc(1, sizeof(PrrtPacket));
check_mem(packet);
XlapTimeStampCycle(&tsph2, ts_any_packet, 0, DecodeStart);
check(PrrtPacket_decode(buffer, (uint16_t) n, packet), "Decode failed.");
XlapTimeStampCycle(&tsph3, ts_any_packet, 0, DecodeEnd);
prrtSequenceNumber_t seqno = packet->sequenceNumber;
prrtTimestamp_t prrt_recv_timestamp = PrrtClock_TimespecToPrrtTimestamp(packet_recv_timestamp);
prrtPacketType_t packetType = PrrtPacket_type(packet);
debug(DEBUG_DATARECEIVER, "received packet %d:%u", (int) packetType, seqno);
......@@ -298,8 +310,12 @@ void *receive_data_loop(void *ptr) {
} else if (packetType == PACKET_TYPE_REDUNDANCY) {
kind = ts_redundancy_packet;
sentTimestamp = PrrtPacket_get_redundancy_timestamp(packet);
} else if (packetType == PACKET_TYPE_FEEDBACK) {
kind = ts_feedback_packet;
}
if (packetType == PACKET_TYPE_DATA || packetType == PACKET_TYPE_REDUNDANCY) {
sock_ptr->lastReceivedTimestamp = prrt_recv_timestamp;
XlapCycleStampValue(sock_ptr, kind, seqno, ChannelReceive, packet_recv_cyclestamp);
XlapTimeStampValue(sock_ptr, kind, seqno, ChannelReceive, packet_recv_timestamp);
......@@ -318,14 +334,19 @@ void *receive_data_loop(void *ptr) {
}
send_feedback(sock_ptr, remote, seqno, prrt_recv_timestamp, sentTimestamp, packetType);
XlapTimeStampCycle(sock_ptr, kind, seqno, HandlePacketEnd);
} else if (packetType == PACKET_TYPE_FEEDBACK) {
handle_feedback_packet(sock_ptr, packet, prrt_recv_timestamp);
PrrtPacket_destroy(packet);
} else {
PrrtPacket_print(packet);
PrrtPacket_destroy(packet);
}
debug(DEBUG_DATARECEIVER, "Cleanup");
PrrtSocket_cleanup(sock_ptr);
debug(DEBUG_DATARECEIVER, "Cleaned");
}
error:
PNOTIMPLEMENTED("SHOULD IMPLEMENT ERROR HANDLER HERE");
PNOTIMPLEMENTED("SHOULD IMPLEMENT ERROR HANDLER HERE");
}
......@@ -28,14 +28,14 @@ bool send_to_socket(PrrtSocket* sock_ptr, PrrtReceiver *recv, uint8_t* buf, prrt
msg.msg_control = control;
msg.msg_controllen = 0;
sendmsg(sock_ptr->dataSocketFd, &msg, 0);
sendmsg(sock_ptr->socketFd, &msg, 0);
*packet_clockstamp = __builtin_ia32_rdtsc();
msg.msg_control = control;
iov.iov_len = MAX_PAYLOAD_LENGTH;
do {
msg.msg_controllen = 1024;
got = recvmsg(sock_ptr->dataSocketFd, &msg, MSG_ERRQUEUE);
got = recvmsg(sock_ptr->socketFd, &msg, MSG_ERRQUEUE);
} while(got < 0 && errno == EAGAIN && check++ < check_max);
check(!(got < 0 && errno == EAGAIN), "Failed to get stamp. Gave up.");
......@@ -59,7 +59,7 @@ bool send_to_socket(PrrtSocket* sock_ptr, PrrtReceiver *recv, uint8_t* buf, prrt
}
} else {
// TODO: [LATENCY] By knowing the time encoding etc. that happens upfront, one could make an adjustment here.
check(sendto(sock_ptr->dataSocketFd, buf, length, 0, recv->ai->ai_addr, recv->ai->ai_addrlen) ==
check(sendto(sock_ptr->socketFd, buf, length, 0, recv->ai->ai_addr, recv->ai->ai_addrlen) ==
length, "Sendto failed.");
clock_gettime(CLOCK_REALTIME, packet_timestamp);
*packet_clockstamp = __builtin_ia32_rdtsc();
......@@ -194,9 +194,10 @@ void *send_data_loop(void *ptr) {
packet->index = (uint8_t) (packet->sequenceNumber - block->baseSequenceNumber);
PrrtPacketDataPayload *payload = packet->payload;
payload->groupRTprop_us = PrrtSocket_get_rtprop(sock_ptr);
payload->groupRTprop_us = PrrtSocket_get_rtprop_fwd(sock_ptr);
PrrtPacket *packetToSend = PrrtPacket_copy(packet);
debug(DEBUG_DATATRANSMITTER, "Send: %i", packet->sequenceNumber);
send_packet(sock_ptr, packetToSend);
XlapTimeStampClock(sock_ptr, ts_data_packet, packet->sequenceNumber, PrrtTransmitEnd);
XlapTimeStampCycle(sock_ptr, ts_data_packet, packet->sequenceNumber, PrrtTransmitEnd);
......@@ -220,6 +221,5 @@ void *send_data_loop(void *ptr) {
PrrtBlock_destroy(block);
block = NULL;
}
PrrtSocket_cleanup(sock_ptr);
}
}
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/poll.h>
#include "../../defines.h"
#include "../../util/common.h"
#include "../../util/dbg.h"
#include "../clock.h"
#include "../socket.h"
#include "feedbackReceiver.h"
static void handle_feedback(PrrtSocket *prrtSocket, const size_t length)
{
char bufin[MAX_PAYLOAD_LENGTH];
PrrtPacket *prrtPacket = NULL;
ssize_t n;
struct sockaddr_in remote;
socklen_t addrlen = sizeof(remote);
struct pollfd fds;
int timeout_msecs = 1000;
fds.fd = prrtSocket->feedbackSocketFd;
fds.events = POLLIN;
n = poll(&fds, 1, timeout_msecs);
check(n >= 0, "Select failed.");
if(n == 0) {
return;
}
prrtTimestamp_t receiveTime = PrrtClock_get_current_time_us();
n = recvfrom(prrtSocket->feedbackSocketFd, bufin, length, 0, (struct sockaddr *) &remote, &addrlen);
check(n >= 0, "Receiving feedback failed.");
prrtPacket = calloc(1, sizeof(PrrtPacket));
check_mem(prrtPacket);
PrrtPacket_decode(bufin, (uint16_t) n, prrtPacket);
PrrtPacketFeedbackPayload *feedbackPayload = (PrrtPacketFeedbackPayload *) prrtPacket->payload;
prrtTimestamp_t forwardTripTimestamp = feedbackPayload->forwardTripTimestamp_us;
prrtTimedelta_t rtt = (prrtTimedelta_t) (receiveTime - forwardTripTimestamp);
PrrtReceiver_on_ack(prrtSocket->receiver, feedbackPayload, receiveTime, rtt);
error:
if(prrtPacket != NULL) { PrrtPacket_destroy(prrtPacket); }
}
void *receive_feedback_loop(void *ptr)
{
PrrtSocket *sock_ptr = ptr;
while (!atomic_load_explicit(&sock_ptr->closing, memory_order_acquire)) {
handle_feedback(sock_ptr, MAX_PAYLOAD_LENGTH);
}
return NULL;
// error:
// PERROR("Feedback reception failed.%s","");
// return NULL;
}
#ifndef PRRT_FEEDBACK_RECEIVER_H
#define PRRT_FEEDBACK_RECEIVER_H
void * receive_feedback_loop(void *ptr);
#endif //PRRT_FEEDBACK_RECEIVER_H
......@@ -44,7 +44,6 @@ PrrtReceiver *PrrtReceiver_create(const char *host, uint16_t port) {
check(pthread_mutexattr_init(&attr) == EXIT_SUCCESS, "Mutex attr init failed.");
check(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) == EXIT_SUCCESS, "Setting type failed.");
check(pthread_mutex_init(&recv->lock, &attr) == 0, "lock init failed.");
return recv;
error:
......@@ -263,7 +262,6 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
BBR_OnACK(recv->bbr, recv->csi, recv->rateSample, recv->packetTracking, rtt);
}
}
check(pthread_mutex_unlock(&recv->lock) == 0, "Unlock failed.");
return result;
......@@ -301,4 +299,4 @@ void PrrtReceiver_add_outstanding_packet_state(PrrtReceiver *recv, PrrtPacket *p
error:
PERROR("Lock error.%s", "");
}
\ No newline at end of file
}
This diff is collapsed.
......@@ -27,9 +27,7 @@
typedef struct prrtSocket {
int dataSocketFd;
int feedbackSocketFd;
pthread_t receiveFeedbackThread;
int socketFd;
struct sockaddr_in *address;
bool isBound;
......@@ -44,7 +42,6 @@ typedef struct prrtSocket {
pthread_t receiveDataThread;
PrrtPacketDeliveryStore* packetDeliveryStore;
PrrtPacketTimeoutTable *packetTimeoutTable;
PrrtDataPacketStore *dataPacketStore;
PrrtRepairBlockStore *repairBlockStore;
......@@ -62,7 +59,6 @@ typedef struct prrtSocket {
prrtSequenceNumber_t sequenceNumberRepetition;
prrtSequenceNumber_t sequenceNumberRedundancy;
prrtSequenceNumber_t sequenceNumberFeedback;
bool isSender;
prrtTimestamp_t lastSentTimestamp;
prrtTimestamp_t lastReceivedTimestamp;
......@@ -79,7 +75,6 @@ typedef struct prrtSocket {
_Atomic (XlapTimestampTable *) tstable[2];
pthread_attr_t *receiveFeedbackThreadAttr;
pthread_attr_t *sendDataThreadAttr;
pthread_attr_t *receiveDataThreadAttr;
......@@ -92,7 +87,7 @@ typedef struct prrtSocket {
} PrrtSocket;
PrrtSocket *PrrtSocket_create(bool is_sender, prrtTimedelta_t target_delay_us);
PrrtSocket *PrrtSocket_create(prrtTimedelta_t target_delay_us);
bool PrrtSocket_enable_hardware_timestamping(PrrtSocket *s, const char * interface_name);
......@@ -135,11 +130,11 @@ bool PrrtSocket_closing(PrrtSocket *s);
bool PrrtSocket_uses_thread_pinning(PrrtSocket *s);
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);
uint32_t PrrtSocket_get_rtprop_fwd(PrrtSocket *s);
prrtPacketLossRate_t PrrtSocket_get_plr_fwd(PrrtSocket *s);
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);
uint64_t PrrtSocket_get_full_bw(PrrtSocket *s);
bool PrrtSocket_get_filled_pipe(PrrtSocket *s);
uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s);
......@@ -154,6 +149,6 @@ prrtByteCount_t PrrtSocket_get_send_quantum(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_delivered(PrrtSocket *s);
bool PrrtSocket_get_bbr_round_start(PrrtSocket *s);
bool PrrtSocket_get_app_limited(PrrtSocket *s);
#endif // PRRT_SOCKET_H
......@@ -38,9 +38,6 @@ cdef extern from "proto/types/packetTimeout.c":
cdef extern from "proto/types/lossStatistics.c":
pass
cdef extern from "proto/processes/feedbackReceiver.c":
pass
cdef extern from "proto/processes/dataReceiver.c":
pass
......@@ -120,57 +117,40 @@ class PrrtCodingConfiguration:
cdef class PrrtSocket:
cdef cprrt.PrrtSocket* _c_socket
cdef bint isSender
def __cinit__(self, port, isSender, target_delay = 1, thread_pinning = False):
def __cinit__(self, port, target_delay = 1, thread_pinning = False):
target_delay_us = target_delay * 1000**2
self._c_socket = cprrt.PrrtSocket_create(isSender, target_delay_us)
self._c_socket = cprrt.PrrtSocket_create(target_delay_us)
if thread_pinning:
cprrt.PrrtSocket_enable_thread_pinning(self._c_socket)
cprrt.PrrtSocket_bind(self._c_socket, "0.0.0.0", port)
self.isSender = isSender
property plr:
property plr_fwd:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_plr(self._c_socket)
return cprrt.PrrtSocket_get_plr_fwd(self._c_socket)
property thread_pinning:
def __get__(self):
return cprrt.PrrtSocket_uses_thread_pinning(self._c_socket)
property target_delay:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_sock_opt(self._c_socket, "targetdelay") * 0.000001
property app_queue_size:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_sock_opt(self._c_socket, "app_queue_size")
def __set__(self, value):
if not self.isSender:
raise Exception("Not a sender.")
cprrt.PrrtSocket_set_sock_opt(self._c_socket, "app_queue_size", value)
property rtt:
property rtt_fwd:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_rtprop(self._c_socket) * 0.000001
return cprrt.PrrtSocket_get_rtprop_fwd(self._c_socket) * 0.000001
property coding_configuration:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
cdef cprrt.PrrtCodingConfiguration *params = cprrt.PrrtSocket_get_coding_parameters(self._c_socket)
return PrrtCodingConfiguration(params.n, params.k, list(<uint8_t[:params.c]> params.n_cycle))
......@@ -182,99 +162,72 @@ cdef class PrrtSocket:
n_cycle[i] = x
cprrt.PrrtSocket_set_coding_parameters(self._c_socket, params.k, params.n, c, n_cycle)
property delivery_rate:
property delivery_rate_fwd:
def __get__(self):
return cprrt.PrrtSocket_get_delivery_rate_fwd(self._c_socket)
property btlbw_fwd:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_delivery_rate(self._c_socket)
return cprrt.PrrtSocket_get_btlbw_fwd(self._c_socket)
property btlbw:
property btlbw_back:
def __get__(self):
return cprrt.PrrtSocket_get_btlbw(self._c_socket)
return cprrt.PrrtSocket_get_btlbw_back(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 bbr_cycle_index:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_cycle_index(self._c_socket)
property bbr_pacing_gain:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_pacing_gain(self._c_socket)
property bbr_cwnd:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_cwnd(self._c_socket)
property bbr_inflight:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_inflight(self._c_socket)
property bbr_pacing_rate:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_pacing_rate(self._c_socket)
property bbr_send_quantum:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_send_quantum(self._c_socket)
property bbr_pipe:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_pipe(self._c_socket)
property bbr_delivered:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_delivered(self._c_socket)
property bbr_is_app_limited:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_bbr_is_app_limited(self._c_socket)
property bbr_app_limited:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_bbr_app_limited(self._c_socket)
property bbr_round_start:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_bbr_round_start(self._c_socket)
def recv(self):
......
......@@ -97,7 +97,7 @@ int main(int argc, char **argv) {
}
#endif
s = PrrtSocket_create(false, HALF_TIMESTAMP-1);
s = PrrtSocket_create(HALF_TIMESTAMP-1);
check(s != NULL, "Could not create socket.");
if(strcmp(arguments.hardwarestamping_interface, "-") != 0) {
......
......@@ -101,7 +101,7 @@ int main(int argc, char **argv) {
#endif
PrrtSocket *s = PrrtSocket_create(true, 10 * 1000 * 1000);
PrrtSocket *s = PrrtSocket_create(10 * 1000 * 1000);
check(s != NULL, "Socket create failed.");
if(strcmp(arguments.hardwarestamping_interface, "-") != 0) {
......
......@@ -16,7 +16,8 @@
#define DEBUG_SENDER 0
#define DEBUG_SOCKET 0
#define DEBUG_DATARECEIVER 0
#define DEBUG_DATATRANSMITTER 1
#define DEBUG_CLEANUP 1
#define DEBUG_DATATRANSMITTER 0
#define DEBUG_HARDSTAMPING 0
#define DEBUG_FEEDBACK 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment