/* $Id: mcl_rlc.h,v 1.2 2003/10/27 09:55:48 roca Exp $ */ /* * Copyright (c) 1999-2003 INRIA - Universite Paris 6 - All rights reserved * (main authors: Julien Laboure - julien.laboure@inrialpes.fr * 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 the headers for RLC congestion control module. */ #ifndef MCL_RLC_H /* { */ #define MCL_RLC_H #ifdef RLC /* { */ /*--- rlc_hdr_t Type ---*/ /* The RLC congestion control header block (32bits -> ALC compliant) */ typedef struct { #ifdef _BIT_FIELDS_LTOH u_char rlc_reserved:7, /* Unused, must be 0x55 (1010101) */ rlc_sp:1; /* Is this packet a Synchronisation Point (SP) ? */ #else u_char rlc_sp:1, /* Is this packet a Synchronisation Point (SP) ? */ rlc_reserved:7; /* Unused, must be 0x55 (1010101) */ #endif u_int8_t rlc_layer; /* packet's layer (indice) */ u_int16_t rlc_seqid; /* packet's Sequence number (per layer sequence) */ } rlc_hdr_t; typedef struct late_list { struct late_list *next; /* next late */ u_int16_t seq_num;/* RLC Sequence Number */ int ttw; /* Time To Wait before considering lost */ } late_list_t; typedef struct lost_list { struct lost_list *next; /* next missing */ int pkt_remaining; /* Number of packets to receive before we forget this one */ } lost_list_t; typedef struct rlccb { int rlc_sp_cycle; /* Interval between 2 SPs at layer 0 (in µsec)*/ int rlc_pkt_timeout; /* Default Time To Wait for a late packet before assuming it's lost */ int rlc_deaf_period; /* Time for Deaf period after a dropped layer (in µsec) */ int rlc_late_accepted; /* if the amount of late packets between 2 SPs at top layer is <= rlc_late_accepted then a layer can be added */ int rlc_loss_accepted; /* if the amount of lost packets between 2 SPs at top layer is <= rlc_loss_accepted then a layer could be added */ int rlc_loss_limit; /* rlc_loss_limit / rlc_loss_timeout is the max loss rate for packet. */ int rlc_loss_timeout; /* if this rate is reached then we should drop the highest layer. */ int rlc_lan_cc; /* aggressive congestion ctrl setup for LAN tx*/ /* For each layer, value of current sequence number */ u_int16_t tx_layers_seq[MAX_TX_LEVEL]; /* For each layer, date for the next SP */ u_int tx_next_sp[MAX_TX_LEVEL]; /* For each layer, =1 if we are waiting for the first packet */ char rx_first_pkt[MAX_TX_LEVEL]; /* For each layer, =1 if we are waiting for the first SP after deaf */ char rx_first_sp[MAX_TX_LEVEL]; /* For each layer, seq number of the next packet to receive */ u_int16_t rx_wait_for[MAX_TX_LEVEL]; /* For each layer, list of missing seq number */ late_list_t rx_missing[MAX_TX_LEVEL]; /* amount late packets since the last SP */ u_int16_t rx_nblate_since_sp; /* amount of recent late packets */ u_int16_t rx_nblate; /* amount lost packets since the last SP */ u_int16_t rx_nblost_since_sp; /* amount of recent lost packets */ u_int16_t rx_nblost; /* Current list of lost packets */ lost_list_t rx_lost; /* when in deaf period, specify the number of calls to rlc_rx_timer remaining before end of deaf */ mcl_itime_t rx_deaf_wait; /* remaining time_count till next call to rlc_rx_timer function */ mcl_itime_t rlc_rx_timer_count; } rlccb_t; /* For infos about all these CONSTANTS */ /* Refer to the descriptions of the */ /* corresponding rlccb member variables */ /* * Internet version */ #define RLC_SP_CYCLE 250000 /* 0.25s, for fast layer addition */ #define RLC_DEAF_PERIOD 10000000 /* 10s, due to IGMP leave latency */ #define RLC_LATE_ACCEPTED 0 #define RLC_LOSS_ACCEPTED 0 #define RLC_PKT_TIMEOUT 500000 #define RLC_LOSS_LIMIT 1 #define RLC_LOSS_TIMEOUT 20 #define RLC_MAX_LATES 100 /* * Aggressive version * * This profile is more robust to packet losses and can be used * in situations where packet losses may be caused by something * else than congestion, or with multicast routing protocols that * can lead to an instable initial situation (e.g. with PIM-SM * while moving from the shared tree to the source specific tree). * Use with care... * * This mode can be set by changing the "rlc_aggr_cc" field in * file mcl_tx_prof.c. */ #define RLC_LAN_DEAF_PERIOD 1000000 /* small (1s) as a LAN reacts quickly */ #define RLC_LAN_LATE_ACCEPTED 1 #define RLC_LAN_LOSS_ACCEPTED 1 //#define RLC_LAN_LOSS_LIMIT 10 /* higher loss limit */ #define RLC_LAN_LOSS_LIMIT 2 /* higher loss limit */ #endif /* } RLC */ #endif /* } MCL_RLC_H */