The short PLCP header is transmitted using the 2 Mbps
in 802.11b .
But we can not transmit it on NS2.27 because we have
not PLCPHeaderRate in its Implementation.
Short Preamble:
Mac/802_11 set PreambleLength_ 72
Mac/802_11 set PLCPHeaderLength 48
Mac/802_11 set PLCPDataRate 1e6
I found below coding for short preamble Rate.
Is it have bug ?
diff -urP mac/mac-802_11.cc mac/mac-802_11.cc~
--- mac/mac-802_11.cc 2006-04-09 00:00:00.0
+0200
+++ mac/mac-802_11.cc~ 2006-04-09 00:01:00.0
+0200
-166,7 +166,9
parent->bind("SIFS_", &SIFSTime);
parent->bind("PreambleLength_", &PreambleLength);
parent->bind("PLCPHeaderLength_", &PLCPHeaderLength);
- parent->bind_bw("PLCPDataRate_", &PLCPDataRate);
+ parent->bind_bw("PLCPhdrRate_", &PLCPhdrRate);
+ parent->bind_bw("PLCPpreambleRate_",
&PLCPpreambleRate);
+ parent->bind("basicRate_", &basicRate_);
}
MAC_MIB::MAC_MIB(Mac802_11 *parent)
-1397,10 +1399,12
double
Mac802_11::txtime(double psz, double drt)
{
- double dsz = psz - phymib_.getPLCPhdrLen();
- int plcp_hdr = phymib_.getPLCPhdrLen() << 3;
+ double dsz = psz - phymib_.getPLCPhdrLen() -
phymib_.getPLCPpreambleLen();
+ int plcp_preamble = phymib_.getPLCPpreambleLen() <<
3;
+ int plcp_hdr = phymib_.getPLCPhdrLen() << 3;
int datalen = (int)dsz << 3;
- double t =
(((double)plcp_hdr)/phymib_.getPLCPDataRate())
+ double t =
(((double)plcp_hdr)/phymib_.getPLCPhdrRate())
+ +
(((double)plcp_preamble)/phymib_.getPLCPpreambleRate())
+ (((double)datalen)/drt);
return(t);
}
diff -urP mac/mac-802_11.h mac/mac-802_11.h~
--- mac/mac-802_11.h 2006-04-09 00:00:00.0
+0200
+++ mac/mac-802_11.h~ 2006-04-09 01:00:00.0
+0200
-143,30 +143,38
inline double getEIFS() {
// see (802.11-1999, 9.2.10)
return(SIFSTime + getDIFS()
- + (8 * getACKlen())/PLCPDataRate);
+ + (8.0 * ((double) ((getACKlen() << 3) -
getPreambleLength() - getHdrLength())) / basicRate_)
+ + ((8.0 + 1.0) * (((double)
getPreambleLength())/getPLCPpreambleRate()))
+ + ((8.0 + 1.0) * (((double)
getHdrLength())/getPLCPhdrRate(;
}
inline u_int32_t getPreambleLength() {
return(PreambleLength); }
- inline double getPLCPDataRate() {
return(PLCPDataRate); }
+ inline u_int32_t getHdrLength() {
return(PLCPHeaderLength); }
+ inline double getPLCPpreambleRate() { return
(PLCPpreambleRate); }
+ inline double getPLCPhdrRate() {
return(PLCPhdrRate); }
- inline u_int32_t getPLCPhdrLen() {
- return((PreambleLength + PLCPHeaderLength) >> 3);
+ inline u_int32_t getPLCPpreambleLen() {
+ return(PreambleLength >> 3);
}
+ inline u_int32_t getPLCPhdrLen() {
+ return(PLCPHeaderLength >> 3);
+ }
+
inline u_int32_t getHdrLen11() {
- return(getPLCPhdrLen() + sizeof(struct
hdr_mac802_11)
+ return(getPLCPpreambleLen() + getPLCPhdrLen() +
sizeof(struct hdr_mac802_11)
+ ETHER_FCS_LEN);
}
inline u_int32_t getRTSlen() {
- return(getPLCPhdrLen() + sizeof(struct rts_frame));
+ return(getPLCPpreambleLen() + getPLCPhdrLen() +
sizeof(struct rts_frame));
}
inline u_int32_t getCTSlen() {
- return(getPLCPhdrLen() + sizeof(struct cts_frame));
+ return(getPLCPpreambleLen() + getPLCPhdrLen() +
sizeof(struct cts_frame));
}
inline u_int32_t getACKlen() {
- return(getPLCPhdrLen() + sizeof(struct ack_frame));
+ return(getPLCPpreambleLen() + getPLCPhdrLen() +
sizeof(struct ack_frame));
}
private:
-180,7 +188,9
double SIFSTime;
u_int32_t PreambleLength;
u_int32_t PLCPHeaderLength;
- double PLCPDataRate;
+ double PLCPhdrRate;
+ double PLCPpreambleRate;
+ double basicRate_;
};
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com