mad_rlc.c File Reference

Receiver-driven layered congestion control

Portions of code derived from MCL library by Vincent Roca et al. (http://www.inrialpes.fr/planete/people/roca/mcl/)

Copyright (c) 1999-2004 INRIA - Universite Paris 6 - All rights reserved
main authors: Julien Laboure - julien.laboure@inrialpes.fr and Vincent Roca - vincent.roca@inrialpes.fr. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "mad_rlc.h"
#include "alc_channel.h"

Include dependency graph for mad_rlc.c:

Go to the source code of this file.

Functions

int mad_rlc_process_rx_sp (alc_session_t *s)
void mad_rlc_free_lists (alc_session_t *s)
int mad_rlc_add_late (alc_session_t *s, int layer, int nseq)
int mad_rlc_remove_late (alc_session_t *s, int layer, int nseq)
int mad_rlc_add_lost (alc_session_t *s)
int mad_rlc_update_late_list (alc_session_t *s)
int mad_rlc_update_loss_list (alc_session_t *s)
int mad_rlc_check_sequence (alc_session_t *s, int layer, int seqid)
int init_mad_rlc (alc_session_t *s)
void close_mad_rlc (alc_session_t *s)
double mad_rlc_next_sp (alc_session_t *s, int layer)
void mad_rlc_reset_tx_sp (alc_session_t *s)
int mad_rlc_fill_header (alc_session_t *s, rlc_hdr_t *rlc_hdr, int layer)
int mad_rlc_analyze_cci (alc_session_t *s, rlc_hdr_t *rlc_hdr)


Detailed Description

Receiver-driven layered congestion control

Portions of code derived from MCL library by Vincent Roca et al. (http://www.inrialpes.fr/planete/people/roca/mcl/)

Copyright (c) 1999-2004 INRIA - Universite Paris 6 - All rights reserved
main authors: Julien Laboure - julien.laboure@inrialpes.fr and Vincent Roca - vincent.roca@inrialpes.fr.

Author
peltotal
Date
2007/02/28 08:58:00
Revision
1.24

MAD-ALCLIB: Implementation of ALC/LCT protocols, Compact No-Code FEC, Simple XOR FEC, Reed-Solomon FEC, and RLC Congestion Control protocol. Copyright (c) 2003-2007 TUT - Tampere University of Technology main authors/contacts: jani.peltotalo@tut.fi and sami.peltotalo@tut.fi

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

In addition, as a special exception, TUT - Tampere University of Technology gives permission to link the code of this program with the OpenSSL library (or with modified versions of OpenSSL that use the same license as OpenSSL), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than OpenSSL. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

Definition in file mad_rlc.c.


Function Documentation

void close_mad_rlc ( alc_session_t s  ) 

This function closes MAD RLC Congestion Control.

Parameters:
s pointer to the session

Definition at line 495 of file mad_rlc.c.

References mad_rlc_free_lists(), alc_session::mode, RECEIVER, and alc_session::rlc.

Here is the call graph for this function:

int init_mad_rlc ( alc_session_t s  ) 

This function initializes MAD RLC Congestion Control.

Parameters:
s pointer to the session
Returns:
0 in success, -1 otherwise

Definition at line 465 of file mad_rlc.c.

References mad_rlc::deaf_period, mad_rlc::drop_highest_layer, FALSE, mad_rlc::late_accepted, mad_rlc::loss_accepted, mad_rlc::loss_limit, mad_rlc::loss_timeout, MAX_CHANNELS_IN_SESSION, alc_session::mode, mad_rlc::pkt_timeout, RECEIVER, alc_session::rlc, RLC_DEAF_PERIOD, RLC_LATE_ACCEPTED, RLC_LOSS_ACCEPTED, RLC_LOSS_LIMIT, RLC_LOSS_TIMEOUT, RLC_PKT_TIMEOUT, RLC_SP_CYCLE, mad_rlc::rx_deaf_wait, mad_rlc::rx_first_pkt, mad_rlc::rx_first_sp, SENDER, and mad_rlc::sp_cycle.

Referenced by open_alc_session().

Here is the caller graph for this function:

int mad_rlc_add_late ( alc_session_t s,
int  layer,
int  nseq 
)

This is a private function which adds late packet to the session's late list.

Parameters:
s pointer to the session,
layer layer number
nseq packet's sequence number
Returns:
0 in success, -1 otherwise

Definition at line 187 of file mad_rlc.c.

References alc_session::lost_packets, late_list::losttime, alc_session::nb_channel, late_list::next, mad_rlc::pkt_timeout, alc_session::rlc, mad_rlc::rx_missing, mad_rlc::rx_nblate, mad_rlc::rx_nblate_since_sp, sec(), and late_list::seq_num.

Referenced by mad_rlc_check_sequence().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_add_lost ( alc_session_t s  ) 

This is a private function which adds lost packet to session's lost list.

Parameters:
s pointer to the session
Returns:
-1000 when layer should be dropped, 0 when layer should not be dropped, -1 otherwise

Definition at line 269 of file mad_rlc.c.

References alc_channel::ch_id, alc_session::ch_list, mad_rlc::deaf_period, mad_rlc::drop_highest_layer, mad_rlc::loss_limit, mad_rlc::loss_timeout, mad_rlc_free_lists(), alc_session::nb_channel, lost_list::next, lost_list::pkt_remaining, alc_session::rlc, mad_rlc::rx_deaf_wait, mad_rlc::rx_first_pkt, mad_rlc::rx_lost, mad_rlc::rx_nblost, mad_rlc::rx_nblost_since_sp, sec(), and TRUE.

Referenced by mad_rlc_update_late_list().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_analyze_cci ( alc_session_t s,
rlc_hdr_t rlc_hdr 
)

This function analyzes ALC packet's CCI field.

Parameters:
s pointer to the session
rlc_hdr pointer to the RLC header
Returns:
0 in success, -1 otherwise

Definition at line 571 of file mad_rlc.c.

References rlc_hdr::layer, mad_rlc_check_sequence(), mad_rlc_process_rx_sp(), mad_rlc_update_late_list(), mad_rlc_update_loss_list(), alc_session::nb_channel, rlc_hdr::reserved, alc_session::rlc, mad_rlc::rx_deaf_wait, mad_rlc::rx_first_pkt, mad_rlc::rx_first_sp, mad_rlc::rx_wait_for, sec(), rlc_hdr::seqid, and rlc_hdr::sp.

Referenced by analyze_packet().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_check_sequence ( alc_session_t s,
int  layer,
int  seqid 
)

This is a private function which checks packet's RLC sequence number.

Parameters:
s pointer to the session
layer layer number
seqid packet's sequence number
Returns:
0

Definition at line 394 of file mad_rlc.c.

References mad_rlc_add_late(), mad_rlc_remove_late(), alc_session::rlc, RLC_MAX_LATES, and mad_rlc::rx_wait_for.

Referenced by mad_rlc_analyze_cci().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_fill_header ( alc_session_t s,
rlc_hdr_t rlc_hdr,
int  layer 
)

This function fills ALC packet's RLC header.

Parameters:
s pointer to the session
rlc_hdr pointer to the RLC header
layer layer number
Returns:
0 in success, -1 otherwise

Definition at line 524 of file mad_rlc.c.

References alc_session::ch_list, FALSE, rlc_hdr::layer, mad_rlc_next_sp(), MAX_CHANNELS_IN_SESSION, alc_session::nb_channel, alc_session::nb_sending_channel, rlc_hdr::reserved, alc_session::rlc, sec(), rlc_hdr::seqid, rlc_hdr::sp, alc_channel::start_sending, TRUE, mad_rlc::tx_layers_seq, and mad_rlc::tx_next_sp.

Referenced by send_session_close_packet().

Here is the call graph for this function:

Here is the caller graph for this function:

void mad_rlc_free_lists ( alc_session_t s  ) 

This is a private function which free lists.

Parameters:
s pointer to the session

Definition at line 148 of file mad_rlc.c.

References MAX_CHANNELS_IN_SESSION, late_list::next, alc_session::rlc, and mad_rlc::rx_missing.

Referenced by close_mad_rlc(), and mad_rlc_add_lost().

Here is the caller graph for this function:

double mad_rlc_next_sp ( alc_session_t s,
int  layer 
)

This function calculates time for next syncronisation point.

Parameters:
s pointer to the session
layer layer number
Returns:
time for next syncronisation point

Definition at line 503 of file mad_rlc.c.

References min, alc_session::rlc, sec(), and mad_rlc::sp_cycle.

Referenced by mad_rlc_fill_header(), and mad_rlc_reset_tx_sp().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_process_rx_sp ( alc_session_t s  ) 

This is a private function which process RLC SP.

Parameters:
s pointer to the session
Returns:
0 when no new layer is added, 1 when new layeris added, -1 otherwise

Definition at line 64 of file mad_rlc.c.

References add_alc_channel(), alc_channel::addr, alc_session::addr_family, alc_session::addr_type, alc_session::ch_list, increase_ipv6_address(), alc_channel::intface, alc_channel::intface_name, mad_rlc::late_accepted, mad_rlc::loss_accepted, MAX_CHANNELS_IN_SESSION, MAX_PORT_LENGTH, alc_session::nb_channel, alc_channel::port, alc_session::rlc, mad_rlc::rx_nblate_since_sp, mad_rlc::rx_nblost_since_sp, and alc_session::s_id.

Referenced by mad_rlc_analyze_cci().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_remove_late ( alc_session_t s,
int  layer,
int  nseq 
)

This is a private function which removes late packet from session's late list.

Parameters:
s pointer to the session
layer layer number
nseq packet's sequence number
Returns:
0 in success, -1 otherwise

Definition at line 227 of file mad_rlc.c.

References alc_session::lost_packets, alc_session::nb_channel, late_list::next, file::next, prev, alc_session::rlc, mad_rlc::rx_missing, mad_rlc::rx_nblate, mad_rlc::rx_nblate_since_sp, and late_list::seq_num.

Referenced by mad_rlc_check_sequence().

Here is the caller graph for this function:

void mad_rlc_reset_tx_sp ( alc_session_t s  ) 

This function resets syncronisation points in the sender.

Parameters:
s pointer to the session

Definition at line 515 of file mad_rlc.c.

References mad_rlc_next_sp(), MAX_CHANNELS_IN_SESSION, alc_session::rlc, and mad_rlc::tx_next_sp.

Here is the call graph for this function:

int mad_rlc_update_late_list ( alc_session_t s  ) 

This is a private function which updates session's late list.

Parameters:
s pointer to the session
Returns:
0 in success, -1 otherwise

Definition at line 317 of file mad_rlc.c.

References late_list::losttime, mad_rlc_add_lost(), alc_session::nb_channel, late_list::next, file::next, prev, alc_session::rlc, mad_rlc::rx_missing, mad_rlc::rx_nblate, mad_rlc::rx_nblate_since_sp, and sec().

Referenced by mad_rlc_analyze_cci().

Here is the call graph for this function:

Here is the caller graph for this function:

int mad_rlc_update_loss_list ( alc_session_t s  ) 

This is a private function which updates session's lost list.

Parameters:
s pointer to the session
Returns:
0

Definition at line 360 of file mad_rlc.c.

References lost_list::next, file::next, lost_list::pkt_remaining, prev, alc_session::rlc, mad_rlc::rx_lost, and mad_rlc::rx_nblost.

Referenced by mad_rlc_analyze_cci().

Here is the caller graph for this function:


Generated on Fri Mar 9 20:08:55 2007 for MAD-FCL by  doxygen 1.5.0