Loading README.md +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ * Clock synchronization between sending stack and receiving stack * Applications can specify packet-level expiration times * Different receive modes for ASAP and time-synchronized operation * Passive measurement of propagation delay, bottleneck data rate and packet loss rate * Packet-level timing analysis using [X-Lap](http://xlap.larn.systems) * [Hardware timestamping support](https://git.nt.uni-saarland.de/LARN/PRRT/wikis/hardware-timestamping) Loading @@ -25,7 +26,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() Loading @@ -44,7 +45,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): Loading examples/receiver.py +4 −3 Original line number Diff line number Diff line Loading @@ -3,11 +3,12 @@ import prrt port = int(sys.argv[1]) s = prrt.PrrtSocket(port=port, isSender=False) s = prrt.PrrtSocket(("127.0.0.1", port)) while True: d = s.recv() d, addr = s.recv() d = d.decode("utf8") if d != "Close": print d print(d, addr) else: break examples/sender.py +5 −4 Original line number Diff line number Diff line Loading @@ -3,10 +3,11 @@ import prrt host = sys.argv[1] port = int(sys.argv[2]) localport = int(sys.argv[3]) s = prrt.PrrtSocket(port=port, isSender=True) s.connect(host, port) s = prrt.PrrtSocket(("127.0.1.1", localport), mtu=150) s.connect((host, port)) for i in range(10): s.send("Packet {}".format(i)) s.send("Close") s.send("Packet {}".format(i).encode("utf8")) s.send("Close".encode("utf8")) prrt/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ add_subdirectory(proto) add_subdirectory(util) add_executable(sender sender.c) add_executable(receiver receiver.c) add_executable(receiver receiver.c ../tests/common.h) target_link_libraries(sender LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(receiver LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT}) prrt/cprrt.pxd +30 −23 Original line number Diff line number Diff line include "posix/time.pxd" include "sockets.pxd" from libc.stdint cimport uint32_t, uint16_t, uint8_t, int32_t from libc.string cimport const_char cdef extern from "pthread.h" nogil: ctypedef struct pthread_t: pass Loading @@ -26,18 +28,17 @@ cdef extern from "proto/channelStateInformation.h": ctypedef prrtChannelStateInformation PrrtChannelStateInformation cdef extern from "proto/codingParams.h": ctypedef struct prrtCodingParams: ctypedef struct prrtCodingConfiguration: uint8_t k uint8_t r uint8_t n uint8_t c uint8_t *n_cycle ctypedef prrtCodingParams PrrtCodingParams PrrtCodingParams *PrrtCodingParams_create() PrrtCodingParams *PrrtCodingParams_copy(PrrtCodingParams *cpar) bint PrrtCodingParams_update(PrrtCodingParams *cpar, uint8_t k, uint8_t n, uint8_t c, uint8_t *n_cycle) bint PrrtCodingParams_destroy(PrrtCodingParams *cpar) ctypedef prrtCodingConfiguration PrrtCodingConfiguration PrrtCodingConfiguration *PrrtCodingConfiguration_create() PrrtCodingConfiguration *PrrtCodingConfiguration_copy(PrrtCodingConfiguration *cpar) bint PrrtCodingConfiguration_destroy(PrrtCodingConfiguration *cpar) cdef extern from "util/list.h": cdef struct list: Loading @@ -62,7 +63,7 @@ cdef extern from "proto/block.h": cdef struct prrtBlock: uint32_t data_count uint32_t redundancy_count PrrtCodingParams coding_params PrrtCodingConfiguration coding_params uint32_t largest_data_length uint16_t baseSequenceNumber List* data_blocks Loading Loading @@ -94,9 +95,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 Loading @@ -120,34 +119,41 @@ 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 mtu, 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) int PrrtSocket_send(PrrtSocket *sock_ptr, const uint8_t *data, const size_t data_len) int32_t PrrtSocket_recv(PrrtSocket *sock_ptr, void *buf_ptr) nogil int32_t PrrtSocket_receive_asap(PrrtSocket *s, void *buf_ptr) nogil int32_t PrrtSocket_receive_asap_wait(PrrtSocket *s, void *buf_ptr) nogil int32_t PrrtSocket_receive_asap_timedwait(PrrtSocket *s, void *buf_ptr, timespec* deadline) nogil int32_t PrrtSocket_recv(PrrtSocket *sock_ptr, void *buf_ptr, sockaddr* addr) nogil int32_t PrrtSocket_receive_asap(PrrtSocket *s, void *buf_ptr, sockaddr* addr) nogil int32_t PrrtSocket_receive_asap_wait(PrrtSocket *s, void *buf_ptr, sockaddr* addr) nogil int32_t PrrtSocket_receive_asap_timedwait(PrrtSocket *s, void *buf_ptr, sockaddr* addr, timespec* deadline) nogil int32_t PrrtSocket_receive_ordered(PrrtSocket *s, void *buf_ptr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_wait(PrrtSocket *s, void *buf_ptr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_timedwait(PrrtSocket *s, void *buf_ptr, prrtTimedelta_t time_window_us, timespec* deadline) nogil int32_t PrrtSocket_receive_ordered(PrrtSocket *s, void *buf_ptr, sockaddr* addr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_wait(PrrtSocket *s, void *buf_ptr, sockaddr* addr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_timedwait(PrrtSocket *s, void *buf_ptr, sockaddr* addr, prrtTimedelta_t time_window_us, timespec* deadline) nogil bint PrrtSocket_set_sock_opt(PrrtSocket *sock_ptr, const_char *name, const uint32_t value) uint32_t PrrtSocket_get_sock_opt(PrrtSocket *sock_ptr, const_char *name) bint PrrtSocket_set_coding_parameters(PrrtSocket *s, uint8_t k, uint8_t n, uint8_t c, uint8_t *n_cycle) PrrtCodingParams *PrrtSocket_get_coding_parameters(PrrtSocket *s) 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_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); bint PrrtSocket_get_app_limited(PrrtSocket *socket) bint PrrtSocket_enable_thread_pinning(PrrtSocket *socket) char *PrrtSocket_inet_ntoa(in_addr*) uint16_t PrrtSocket_ntohs(uint16_t v) cdef extern from "proto/stores/packetDeliveryStore.h": ctypedef struct PrrtPacketDeliveryStore: pass Loading @@ -170,3 +176,4 @@ cdef extern from "util/pipe.h": cdef extern from "util/mpsc_queue.h": ctypedef struct MPSCQueue: pass Loading
README.md +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ * Clock synchronization between sending stack and receiving stack * Applications can specify packet-level expiration times * Different receive modes for ASAP and time-synchronized operation * Passive measurement of propagation delay, bottleneck data rate and packet loss rate * Packet-level timing analysis using [X-Lap](http://xlap.larn.systems) * [Hardware timestamping support](https://git.nt.uni-saarland.de/LARN/PRRT/wikis/hardware-timestamping) Loading @@ -25,7 +26,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() Loading @@ -44,7 +45,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): Loading
examples/receiver.py +4 −3 Original line number Diff line number Diff line Loading @@ -3,11 +3,12 @@ import prrt port = int(sys.argv[1]) s = prrt.PrrtSocket(port=port, isSender=False) s = prrt.PrrtSocket(("127.0.0.1", port)) while True: d = s.recv() d, addr = s.recv() d = d.decode("utf8") if d != "Close": print d print(d, addr) else: break
examples/sender.py +5 −4 Original line number Diff line number Diff line Loading @@ -3,10 +3,11 @@ import prrt host = sys.argv[1] port = int(sys.argv[2]) localport = int(sys.argv[3]) s = prrt.PrrtSocket(port=port, isSender=True) s.connect(host, port) s = prrt.PrrtSocket(("127.0.1.1", localport), mtu=150) s.connect((host, port)) for i in range(10): s.send("Packet {}".format(i)) s.send("Close") s.send("Packet {}".format(i).encode("utf8")) s.send("Close".encode("utf8"))
prrt/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ add_subdirectory(proto) add_subdirectory(util) add_executable(sender sender.c) add_executable(receiver receiver.c) add_executable(receiver receiver.c ../tests/common.h) target_link_libraries(sender LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(receiver LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT})
prrt/cprrt.pxd +30 −23 Original line number Diff line number Diff line include "posix/time.pxd" include "sockets.pxd" from libc.stdint cimport uint32_t, uint16_t, uint8_t, int32_t from libc.string cimport const_char cdef extern from "pthread.h" nogil: ctypedef struct pthread_t: pass Loading @@ -26,18 +28,17 @@ cdef extern from "proto/channelStateInformation.h": ctypedef prrtChannelStateInformation PrrtChannelStateInformation cdef extern from "proto/codingParams.h": ctypedef struct prrtCodingParams: ctypedef struct prrtCodingConfiguration: uint8_t k uint8_t r uint8_t n uint8_t c uint8_t *n_cycle ctypedef prrtCodingParams PrrtCodingParams PrrtCodingParams *PrrtCodingParams_create() PrrtCodingParams *PrrtCodingParams_copy(PrrtCodingParams *cpar) bint PrrtCodingParams_update(PrrtCodingParams *cpar, uint8_t k, uint8_t n, uint8_t c, uint8_t *n_cycle) bint PrrtCodingParams_destroy(PrrtCodingParams *cpar) ctypedef prrtCodingConfiguration PrrtCodingConfiguration PrrtCodingConfiguration *PrrtCodingConfiguration_create() PrrtCodingConfiguration *PrrtCodingConfiguration_copy(PrrtCodingConfiguration *cpar) bint PrrtCodingConfiguration_destroy(PrrtCodingConfiguration *cpar) cdef extern from "util/list.h": cdef struct list: Loading @@ -62,7 +63,7 @@ cdef extern from "proto/block.h": cdef struct prrtBlock: uint32_t data_count uint32_t redundancy_count PrrtCodingParams coding_params PrrtCodingConfiguration coding_params uint32_t largest_data_length uint16_t baseSequenceNumber List* data_blocks Loading Loading @@ -94,9 +95,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 Loading @@ -120,34 +119,41 @@ 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 mtu, 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) int PrrtSocket_send(PrrtSocket *sock_ptr, const uint8_t *data, const size_t data_len) int32_t PrrtSocket_recv(PrrtSocket *sock_ptr, void *buf_ptr) nogil int32_t PrrtSocket_receive_asap(PrrtSocket *s, void *buf_ptr) nogil int32_t PrrtSocket_receive_asap_wait(PrrtSocket *s, void *buf_ptr) nogil int32_t PrrtSocket_receive_asap_timedwait(PrrtSocket *s, void *buf_ptr, timespec* deadline) nogil int32_t PrrtSocket_recv(PrrtSocket *sock_ptr, void *buf_ptr, sockaddr* addr) nogil int32_t PrrtSocket_receive_asap(PrrtSocket *s, void *buf_ptr, sockaddr* addr) nogil int32_t PrrtSocket_receive_asap_wait(PrrtSocket *s, void *buf_ptr, sockaddr* addr) nogil int32_t PrrtSocket_receive_asap_timedwait(PrrtSocket *s, void *buf_ptr, sockaddr* addr, timespec* deadline) nogil int32_t PrrtSocket_receive_ordered(PrrtSocket *s, void *buf_ptr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_wait(PrrtSocket *s, void *buf_ptr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_timedwait(PrrtSocket *s, void *buf_ptr, prrtTimedelta_t time_window_us, timespec* deadline) nogil int32_t PrrtSocket_receive_ordered(PrrtSocket *s, void *buf_ptr, sockaddr* addr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_wait(PrrtSocket *s, void *buf_ptr, sockaddr* addr, prrtTimedelta_t time_window_us) nogil int32_t PrrtSocket_receive_ordered_timedwait(PrrtSocket *s, void *buf_ptr, sockaddr* addr, prrtTimedelta_t time_window_us, timespec* deadline) nogil bint PrrtSocket_set_sock_opt(PrrtSocket *sock_ptr, const_char *name, const uint32_t value) uint32_t PrrtSocket_get_sock_opt(PrrtSocket *sock_ptr, const_char *name) bint PrrtSocket_set_coding_parameters(PrrtSocket *s, uint8_t k, uint8_t n, uint8_t c, uint8_t *n_cycle) PrrtCodingParams *PrrtSocket_get_coding_parameters(PrrtSocket *s) 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_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); bint PrrtSocket_get_app_limited(PrrtSocket *socket) bint PrrtSocket_enable_thread_pinning(PrrtSocket *socket) char *PrrtSocket_inet_ntoa(in_addr*) uint16_t PrrtSocket_ntohs(uint16_t v) cdef extern from "proto/stores/packetDeliveryStore.h": ctypedef struct PrrtPacketDeliveryStore: pass Loading @@ -170,3 +176,4 @@ cdef extern from "util/pipe.h": cdef extern from "util/mpsc_queue.h": ctypedef struct MPSCQueue: pass