From: Andre Noll Date: Fri, 18 Jun 2010 08:40:06 +0000 (+0200) Subject: dccp_send: Add command line options for FEC parameters. X-Git-Tag: v0.4.3~13^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=04cc3ada65d336e2b50eea2f942d585198f63f23 dccp_send: Add command line options for FEC parameters. ATM, these are hardcoded as MPS/3/4. This patch allows to impose an upper bound on the slice size and to change the number of (data) slices of a FEC group. --- diff --git a/dccp_send.c b/dccp_send.c index 9a2f6caf..6cfdfbbe 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -97,6 +97,8 @@ static int dccp_init_fec(struct sender_client *sc) } PARA_INFO_LOG("current MPS = %d bytes\n", mps); assert(mps > 0); + if (conf.dccp_max_slice_size_arg > 0) + mps = PARA_MIN(mps, conf.dccp_max_slice_size_arg); return mps; } @@ -139,8 +141,8 @@ static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds) } dfc = para_calloc(sizeof(*dfc)); sc->private_data = dfc; - dfc->fcp.slices_per_group = 4; - dfc->fcp.data_slices_per_group = 3; + dfc->fcp.data_slices_per_group = conf.dccp_data_slices_per_group_arg; + dfc->fcp.slices_per_group = conf.dccp_slices_per_group_arg; dfc->fcp.init_fec = dccp_init_fec; dfc->fcp.send_fec = dccp_send_fec; dfc->fc = vss_add_fec_client(sc, &dfc->fcp); @@ -210,7 +212,7 @@ static char *dccp_info(void) */ void dccp_send_init(struct sender *s) { - int ret; + int ret, k, n; s->info = dccp_info; s->send = NULL; @@ -225,6 +227,15 @@ void dccp_send_init(struct sender *s) s->client_cmds[SENDER_ADD] = NULL; s->client_cmds[SENDER_DELETE] = NULL; + k = conf.dccp_data_slices_per_group_arg; + n = conf.dccp_slices_per_group_arg; + + if (k <= 0 || n <= 0 || k >= n) { + PARA_WARNING_LOG("invalid FEC parameters, using defaults\n"); + conf.dccp_data_slices_per_group_arg = 3; + conf.dccp_slices_per_group_arg = 4; + } + init_sender_status(dss, conf.dccp_access_arg, conf.dccp_access_given, conf.dccp_port_arg, conf.dccp_max_clients_arg, conf.dccp_default_deny_given); diff --git a/ggo/server.m4 b/ggo/server.m4 index 4be4e2c9..af5d8f63 100644 --- a/ggo/server.m4 +++ b/ggo/server.m4 @@ -238,6 +238,53 @@ details=" See http_max_clients for details. " +option "dccp_max_slice_size" - +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"Upper bound for the FEC slice size" +int typestr = "size" +default = "0" +details = " + If this value is non-positive (the default) the dccp sender + uses the maximum packet size (MPS) of the connection as the + slice size. The MPS is a network parameter and depends on + the path maximum transmission unit (path MTU) of an incoming + connection, i.e. on the largest packet size that can be + transmitted without causing fragmentation. + + This option allows to use a value less than the MPS in order + to fine-tune application performance. Values greater than + the MPS of an incoming connection can not be set. +" + +option "dccp_data_slices_per_group" - +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"The number of non-redundant slices per FEC group" +int typestr = "num" +default = "3" +details = " + This determines the number of slices in each FEC group that are + necessary to decode the group. The given number must be smaller + than the value of the dccp_slices_per_group option below. + + Note that the duration of a FEC group is proportional to the + product dccp_max_slice_size * dccp_data_slices_per_group. +" + +option "dccp_slices_per_group" - +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"The total number of slices per FEC group" +int typestr = "num" +default = "4" +details = " + This value must be larger than the value given for above + dccp_data_slices_per_group above. The difference being the + number of redundant slices per group, i.e. the number of + data packets that may be lost without causing interruptions + of the resulting audio stream. + + Increase this value if for lossy networks. +" + #################### section "udp sender" ####################