/* $Id: mcl_profile.h,v 1.11 2003/11/26 12:09:08 roca Exp $ */ /* * Copyright (c) 1999-2003 INRIA - Universite Paris 6 - All rights reserved * (main author: Vincent Roca - vincent.roca@inrialpes.fr) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* * This file contains all the parameters/constants/preprocessing flags * controlling the profile of the MCL library. Edit as appropriate... * Most of the values given here can be further modified using mcl_ctl(). * * Of course this file must be the first one included!!! */ #ifndef MCL_PROFILE_H /* { */ #define MCL_PROFILE_H /****** main constants ********************************************************/ /* * Do you want to enable the use of Virtual Transmission Memory service? * Really really recommanded if you deal with very large files. */ /* NB: mode set by default in each new session if you define VIRTUAL_TX_MEM */ //#define VIRTUAL_TX_MEM #ifdef VIRTUAL_TX_MEM /* * what is the maximum size of the physical memory area before storing data * on disk? Adjust according to your desires/available physical memory... */ //#define VIRTUAL_TX_MAX_PHY_MEM_SIZE 40*1024*1024 #define VIRTUAL_TX_MAX_PHY_MEM_SIZE 100*1024*1024 #endif /* * Do you want to enable the use of Virtual Reception Memory service? * Really really recommanded if you deal with very large files. */ /* NB: mode set by default in each new session if you define VIRTUAL_RX_MEM */ //#define VIRTUAL_RX_MEM #ifdef VIRTUAL_RX_MEM /* * what is the maximum size of the physical memory area before storing data * on disk? Adjust according to your desires/available physical memory... */ //#define VIRTUAL_RX_MAX_PHY_MEM_SIZE 40*1024*1024 #define VIRTUAL_RX_MAX_PHY_MEM_SIZE 100*1024*1024 #endif /* * What scheduling algorithm(s) do you need (there can be more than 1) ? */ /* * LCT_SCHED1 * transmit all the original+FEC DUs on each layer in a random order */ /* #define LCT_SCHED1 */ #define LCT_SCHED1 /* * LCT_SCHED2 * transmit original DUs on layer 0, FEC DUs of order 1 on layer 1, * FEC DUs of order 2 on layer 2, etc. * Requires the use of Reed-Solomon FEC code and a small block size * to enable the creation of a high number of FEC DUs. */ /* #define LCT_SCHED2 */ /* NO LONGER SUPPORTED */ #ifdef VIRTUAL_TX_MEM /* { */ /* * LCT_SCHED3 * Disk-aware scheduler; required for very large object transmissions, * i.e. when the total object size is an order of magnitude larger * than the physical memory (RAM) size. * This is basically the same scheduling as LCT_SCHED2, except that * it uses ranges of sequential DUs (when stored on the disk). * * This is the default scheduler (at MCL level). * FCAST and other applications can override this default. * Using this scheduler assumes that VIRTUAL_TX_MEM is used. */ /*#define LCT_SCHED3*/ /* NO LONGER SUPPORTED */ #ifdef LCT_SCHED3 #define DEFAULT_DU_IN_SEQ_IN_TXTAB 4 #endif #endif /* } VIRTUAL_TX_MEM */ /* * Do you want to use congestion control (derived from RLC, * Receiver Driver Layered Congestion Control Scheme) or not ? * Assume YES, unless you know what you're doing... */ #define RLC /* * Do you want to use FLID Static Layer congestion control module or not ? * IF ENABLED, RLC SHOULD BE TURNED OFF */ /*#define FLIDS*/ /* * Do you want to use Reed-Solomon Forward Error Correction (FEC) ? */ #define RSE_FEC /* * Do you want to use LDPC large block Forward Error Correction (FEC) ? */ //#define LDPC_FEC #if defined(RSE_FEC) || defined(LDPC_FEC) #define FEC #endif /* * Do you want to use mcl_select (the MCL version of the select * syscall) or not ? */ /* #define MCL_SELECT */ #define MCL_SELECT /* * by default, do you want to postpone FEC decoding at a receiver or not? * it is recommended to postpone with very high speed reception rates and/or * slow CPUs. * * WARNING: do not use if you have many independant tx to do as the receiver * will be blocked, waiting for the end of all the tx. */ /*#define POSTPONE_FEC_DECODING*/ /* * an optimization for transmissions in PUSH mode. * highly recommended! */ #define ANTICIPATED_TX_FOR_PUSH #ifdef ANTICIPATED_TX_FOR_PUSH /* * select an aggressiveness. * depends on the receivers capabilities, and the desire to favor some * of them (low-end receivers versus high-end receivers) */ //#define ANTICIPATED_TX_FOR_PUSH_AGGRESSIVENESS 3 /* favors low-end rx */ //#define ANTICIPATED_TX_FOR_PUSH_AGGRESSIVENESS 4 /* default */ #define ANTICIPATED_TX_FOR_PUSH_AGGRESSIVENESS 5 /* favors high-end rx */ #endif /* ANTICIPATED_TX_FOR_PUSH */ /****** other parameters ******************************************************/ /* * max number of sessions per instance of the MCL library. * large numbers are possible if you have enough memory, disk space and CPU * power ;-) * note that some systems (e.g. Solaris) are more strict on the maximum * number of sockets in use. */ #define MCLCB_MAX_ID 64 #ifdef FEC /* * parameters associated to the use of FEC: * - FEC redundancy, or n/k ratio; e.g. 1.5 for 50% of FEC, 2.0 for 100% * - maximum value of k for (k,n) FEC codecs; this is also the DU# per block */ #define MAX_FEC_RATIO 4.0 /* ratio of fec pkts generated */ #ifdef RSE_FEC #define RSE_MAX_K 65 /* at most max_k DUs per source block */ #define RSE_MAX_N GF_SIZE /* at most max_n DUs after encoding */ #endif #ifdef LDPC_FEC #define LDPC_MAX_K 20*1000 /* at most 20*10^3 packets */ #define LDPC_MAX_N 40*1000 /* at most 40*10^3 packets */ #endif #endif /* FEC */ /* * default transmission profile * choose one (can be overided with mcl_ctl anyway) * * WARNING1: using a DFLT_TX_PROFILE overrides the actual max_tx_level, * datagram_size, and tx_rate... (see mcl_tx_prof.c) * WARNING2: a change of the default datagram size must be done both at * source and receivers. */ /*#define DFLT_TX_PROFILE MCL_TX_PROFILE_LOW_RATE_INTERNET*/ #define DFLT_TX_PROFILE MCL_TX_PROFILE_MID_RATE_INTERNET /*#define DFLT_TX_PROFILE MCL_TX_PROFILE_HIGH_SPEED_LAN*/ /* * max number of transmission layers * max number of multicast groups */ #define MAX_TX_LEVEL 10 /* max nb of layers */ #define MAX_MC_GROUP MAX_TX_LEVEL /* * mtu max tx unit as defined by the physical layer (it does not * consider IP and above headers) * payload data payload of an ALC packet (if any) * header ALC/LCT header only * datagram includes payload plus ALC/LCT header. * This is the Protocol Data Unit given to UDP * ip_datagram includes datagram plus UDP/IP headers * * WARNING: changes of these sizes must be done both at source and receivers... */ //const INT32 DFLT_MTU = 576; const INT32 DFLT_MTU = 1500; const INT32 UDP_IPv4_HEADER_SIZE = (8 + 20); // in case of IPv4 // ALC/LCT headers cannot be smaller in any case const INT32 MIN_ALC_HEADER_SIZE = 8; // ALC/LCT headers cannot be larger // 4(fixed hdr) + 4(CCI) + 4(TSI) + 4(TOI) + 20(our FTI) + 8(No NEW ADU) // + 8(FPI) // This maximum header size is really MCL specific, since it takes into // account features not supported by MCL (e.g. CCI of more than 32bits), // and additional fields required by MCL (modified FTI, No NEW ADU). const INT32 MAX_ALC_HEADER_SIZE = 52; const INT32 MAX_DATAGRAM_SIZE = (DFLT_MTU - UDP_IPv4_HEADER_SIZE); const INT32 DFLT_DATAGRAM_SIZE = MAX_DATAGRAM_SIZE; const INT32 MAX_PAYLOAD_SIZE = (MAX_DATAGRAM_SIZE - MAX_ALC_HEADER_SIZE); const INT32 DFLT_PAYLOAD_SIZE = MAX_PAYLOAD_SIZE; /* * max and default size of reception socket * must be large enough to absort packet bursts on each layer! */ #define MAX_RX_SOCK_SIZE (64*1024) #define MCL_RX_SOCK_SIZE MAX_RX_SOCK_SIZE /* * period of the main timer; used to trigger all the periodic processings * (congestion control timers, data transmissions, etc.) */ /* * this value (in microseconds) determines the internal MCL clock granularity. * It is the sleep duration between two consecutive virtual time ticks. * All other timers (see below) are multiples of this period! * (eg. MCL_TX_PERIOD can be set to 2*MCL_TIMER_PERIOD for half the frequency) */ #define MCL_TIMER_PERIOD 10000 /* 10 ms => 100 Hz */ /*#define MCL_TIMER_PERIOD 20000*/ /* 20 ms => 50 Hz */ #ifdef RLC /* * period in microseconds between two calls to the RLC timer func (receiver). * NB: must be a multiple of MCL_TIMER_PERIOD! */ #define MCL_RLC_RX_PERIOD (10 * MCL_TIMER_PERIOD) /* * time in ticks to wait after a SP sent on layer i-1 before starting * transmissions on layer i. */ #define MCL_WAIT_AFTER_SP_COUNT 4 /* in MCL_TX_PERIOD "ticks" */ #endif /* RLC */ #ifdef FLIDS /* * time in ticks to wait after a SP sent on layer i-1 before starting * transmissions on layer i. */ #define MCL_WAIT_AFTER_SP_COUNT 4 /* in MCL_TX_PERIOD "ticks" */ #endif /* FLIDS */ /* * default polling period... * This is a compromize, not too high to limit resource consumption, * not too low to have a good reactivity. * (using MCL_TIMER_PERIOD is nice as it defines the max rate at which new * packets are sent and thus events can take place) */ #define DFLT_POLLING_PERIOD ((unsigned long)4 * MCL_TIMER_PERIOD) /* * Do you want to simulate random bursty packet losses? * (i.e. the source will randomly forget to send some bursts of packets) * Usually NO... */ /* #define SIMUL_LOSSES */ #ifdef SIMUL_LOSSES /* * Should losses be independant of layer number (ie be constant) or not ? */ //#define CONSTANT_LOSS_RATIO /* * number of (simulated) losses in % when the previous packet was OK */ #define P_LOSS_WHEN_OK 0.1 //#define P_LOSS_WHEN_OK 0.5 //#define P_LOSS_WHEN_OK 1 /* * number of (simulated) losses in % when the previous packet was LOST */ #define P_LOSS_WHEN_LOSSES 10 //#define P_LOSS_WHEN_LOSSES 75 #endif /* SIMUL_LOSSES */ #ifdef SOLARIS /* * Do you want to collect system information? * IMPORTANT: Requires to edit mcl_stats.c!!! Change the login name and * tool name (in the grep) * Ok, that's a bit ugly but it is so simple... * NB: Only works on solaris today! */ /*#define GET_SYSINFO*/ #ifdef GET_SYSINFO #define MCL_SYSINFO_PERIOD (3 * MCL_TIMER_PERIOD) #endif /* GET_SYSINFO */ #endif /* SOLARIS */ /* * default ttl used for multicast tx */ #define TTL 1 /* * create temporary file in this dir * (e.g. used by the vtmem service) */ #define MCL_DEFAULT_TMP_DIR_NAME "/tmp/" /* * do you want that all traces (out and error) are sent to a dedicated * file in the temporary directory defined above or to the stdout and * stderr standard output? */ /*#define STDOUT_TO_FILE*/ /* * define only if you want to avoid the use of pthread_mutex_lock * (nb: it was required with old LINUX distributions where the pthread lib * was broken) */ /* #define NO_PTHREAD_LOCK */ #endif /* } MCL_PROFILE_H */