ns-allinone-2.35/ns-2.35/mac/mac-802_11Ext.cc
double Mac802_11Ext::txtime(double psz, int mod_scheme) {
	int datalen = (int) psz << 3;
	int DBPS = modulation_table[mod_scheme].NDBPS;

	// 802.11p
	if (phymib_.use_802_11a()) {
		datalen = datalen + 16 + 6; // 16 SYMBOL BITS, 6 TAIL BITS
	}
	int symbols = (int)(ceil((double)datalen/DBPS)); // PADDING BITS, FILL SYMBOl

	double t = phymib_.getHeaderDuration() + (double) symbols
			* phymib_.getSymbolDuration();
	return (t);
}
/*
 * txtime()	- calculate tx time for packet of size "psz" bytes 
 *		  with modulation scheme mod_scheme
 *                this is the function used in reality
 */
txtime()     - calculate tx time for packet of size "psz" bytes
with modulation scheme mod_scheme
this is the function used in reality
txtime () - calculate tx time for packet of size " psz " bytes with modulation scheme mod_scheme this is the function used in reality
double Mac802_11Ext::txtime(double psz, int mod_scheme) {
	int datalen = (int) psz << 3;
	int DBPS = modulation_table[mod_scheme].NDBPS;
	if (phymib_.use_802_11a()) {
		datalen = datalen + 16 + 6; 
	}
	int symbols = (int)(ceil((double)datalen/DBPS)); 
	double t = phymib_.getHeaderDuration() + (double) symbols
			* phymib_.getSymbolDuration();
	return (t);
}
double Mac802_11Ext :: txtime ( double psz , int mod_scheme ) { int datalen = ( int ) psz << 3 ; int DBPS = modulation_table [ mod_scheme ] . NDBPS ; if ( phymib_ . use_802_11a ( ) ) { datalen = datalen + 16 + 6 ; } int symbols = ( int ) ( ceil ( ( double ) datalen / DBPS ) ) ; double t = phymib_ . getHeaderDuration ( ) + ( double ) symbols * phymib_ . getSymbolDuration ( ) ; return ( t ) ; }
txtime()     - calculate tx time for packet of size "psz" bytes
                with modulation scheme mod_scheme
                this is the function used in reality
txtime () - calculate tx time for packet of size " psz " bytes with modulation scheme mod_scheme this is the function used in reality
// 802.11p // 16 SYMBOL BITS, 6 TAIL BITS // PADDING BITS, FILL SYMBOl