This commit is contained in:
Gustavo J. A. M. Carneiro
2010-03-17 11:20:17 +00:00
14 changed files with 67 additions and 47 deletions

BIN
doc/WimaxArchitecture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -154,6 +154,10 @@ int main (int argc, char *argv[])
Simulator::Stop (Seconds (duration + 0.1));
wimax.EnablePcap ("wimax-simple-ss0", ssNodes.Get (0)->GetId (), ss[0]->GetIfIndex ());
wimax.EnablePcap ("wimax-simple-ss1", ssNodes.Get (1)->GetId (), ss[1]->GetIfIndex ());
wimax.EnablePcap ("wimax-simple-bs0", bsNodes.Get (0)->GetId (), bs->GetIfIndex ());
IpcsClassifierRecord DlClassifierUgs (Ipv4Address ("0.0.0.0"),
Ipv4Mask ("0.0.0.0"),
SSinterfaces.GetAddress (0),

View File

@@ -280,6 +280,11 @@ Buffer::Buffer (uint32_t dataSize, bool initialize)
bool
Buffer::CheckInternalState (void) const
{
#if 0
// If you want to modify any code in this file, enable this checking code.
// Otherwise, there is not much point is enabling it because the
// current implementation has been fairly seriously tested and the cost
// of this constant checking is pretty high, even for a debug build.
bool offsetsOk =
m_start <= m_zeroAreaStart &&
m_zeroAreaStart <= m_zeroAreaEnd &&
@@ -300,6 +305,9 @@ Buffer::CheckInternalState (void) const
", " << (internalSizeOk?"true":"false") << " ");
}
return ok;
#else
return true;
#endif
}
void
@@ -376,13 +384,6 @@ Buffer::~Buffer ()
}
}
uint32_t
Buffer::GetSize (void) const
{
NS_ASSERT (CheckInternalState ());
return m_end - m_start;
}
Buffer::Iterator
Buffer::Begin (void) const
{

View File

@@ -393,7 +393,7 @@ public:
/**
* \return the number of bytes stored in this buffer.
*/
uint32_t GetSize (void) const;
inline uint32_t GetSize (void) const;
/**
* \return a pointer to the start of the internal
@@ -633,6 +633,11 @@ Buffer::Iterator::ReadU8 (void)
}
}
uint32_t
Buffer::GetSize (void) const
{
return m_end - m_start;
}
} // namespace ns3

View File

@@ -225,12 +225,6 @@ Packet::GetNixVector (void) const
return m_nixVector;
}
uint32_t
Packet::GetSize (void) const
{
return m_buffer.GetSize ();
}
void
Packet::AddHeader (const Header &header)
{

View File

@@ -254,7 +254,7 @@ public:
* \returns the size in bytes of the packet (including the zero-filled
* initial payload)
*/
uint32_t GetSize (void) const;
inline uint32_t GetSize (void) const;
/**
* Add header to this packet. This method invokes the
* Header::GetSerializedSize and Header::Serialize
@@ -613,4 +613,14 @@ std::ostream& operator<< (std::ostream& os, const Packet &packet);
} // namespace ns3
namespace ns3 {
uint32_t
Packet::GetSize (void) const
{
return m_buffer.GetSize ();
}
} // namespace ns3
#endif /* PACKET_H */

View File

@@ -594,16 +594,12 @@ BaseStationNetDevice::DoSend (Ptr<Packet> packet,
Ptr<PacketBurst> burst = Create<PacketBurst> ();
ServiceFlow *serviceFlow = 0;
// drop packet if no SS is registered with the BS, the destination SS is not yet registered or if queue is full
NS_LOG_INFO ("BS (" << source << "):");
NS_LOG_INFO ("\tSending packet...");
NS_LOG_INFO ("\t\tDestination: " << dest);
NS_LOG_INFO ("\t\tPaket Size: " << packet->GetSize ());
NS_LOG_INFO ("\t\tProtocol: " << protocolNumber);
NS_LOG_INFO ("TraceDelay: TX (BS), To: " << dest << ", Uid: " << packet->GetUid () << ", time: "
<< (Simulator::Now ()).GetSeconds () << ", Packet Size: " << packet->GetSize ());
if (protocolNumber == 2048)
{

View File

@@ -38,19 +38,22 @@ namespace ns3 {
class ManagementMessageType : public Header
{
public:
/*
* Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43
*/
enum MessageType
{
MESSAGE_TYPE_DL_MAP,
MESSAGE_TYPE_DCD,
MESSAGE_TYPE_UL_MAP,
MESSAGE_TYPE_UCD,
MESSAGE_TYPE_RNG_REQ,
MESSAGE_TYPE_RNG_RSP,
MESSAGE_TYPE_REG_REQ,
MESSAGE_TYPE_REG_RSP,
MESSAGE_TYPE_DSA_REQ,
MESSAGE_TYPE_DSA_RSP,
MESSAGE_TYPE_DSA_ACK
MESSAGE_TYPE_UCD = 0,
MESSAGE_TYPE_DCD = 1,
MESSAGE_TYPE_DL_MAP = 2,
MESSAGE_TYPE_UL_MAP = 3,
MESSAGE_TYPE_RNG_REQ = 4,
MESSAGE_TYPE_RNG_RSP = 5,
MESSAGE_TYPE_REG_REQ = 6,
MESSAGE_TYPE_REG_RSP = 7,
MESSAGE_TYPE_DSA_REQ = 11,
MESSAGE_TYPE_DSA_RSP = 12,
MESSAGE_TYPE_DSA_ACK = 13
};
ManagementMessageType (void);

View File

@@ -241,6 +241,7 @@ SimpleOfdmWimaxPhy::Send (SendParams *params)
Send (o_params->GetBurst (),
(WimaxPhy::ModulationType) o_params->GetModulationType (),
o_params->GetDirection ());
}
WimaxPhy::PhyType
@@ -263,6 +264,7 @@ SimpleOfdmWimaxPhy::Send (Ptr<PacketBurst> burst,
SetBlockParameters (burst->GetSize (), modulationType);
CreateFecBlocks (buffer, modulationType);
StartSendFecBlock (true, modulationType, direction);
m_traceTx (burst);
}
}
@@ -459,8 +461,8 @@ void
SimpleOfdmWimaxPhy::EndReceive (Ptr<const PacketBurst> burst)
{
Ptr<PacketBurst> b = burst->Copy ();
m_traceRx (burst);
GetReceiveCallback () (b);
m_traceRx (burst);
}
bvec

View File

@@ -232,7 +232,7 @@ private:
Time m_blockTime;
TracedCallback<Ptr<const PacketBurst> > m_traceRx;
TracedCallback<Ptr<const PacketBurst>, WimaxPhy::ModulationType, uint16_t, uint16_t> m_traceTx;
TracedCallback<Ptr<const PacketBurst> > m_traceTx;
// data rates for this Phy
uint32_t m_dataRateBpsk12, m_dataRateQpsk12, m_dataRateQpsk34, m_dataRateQam16_12, m_dataRateQam16_34,

View File

@@ -1031,8 +1031,7 @@ SubscriberStationNetDevice::DoReceive (Ptr<Packet> packet)
// This is the first or middle fragment.
// Take the fragment queue, store the fragment into the queue
NS_LOG_INFO ( "\t Received the first or the middle fragment" << std::endl);
GetConnectionManager ()->GetConnection (cid)
->FragmentEnqueue (packet);
GetConnectionManager ()->GetConnection (cid)->FragmentEnqueue (packet);
}
}
}

View File

@@ -74,7 +74,16 @@ WimaxMacToMacHeader::GetSizeOfLen (void) const
uint32_t
WimaxMacToMacHeader::GetSerializedSize (void) const
{
return 20 + GetSizeOfLen () ;
uint8_t sizeOfLen = GetSizeOfLen ();
if (sizeOfLen==1)
{
return 20 ;
}
else
{
return 20 + sizeOfLen -1 ;
}
//return 19+sizeOfLen;
}
void
@@ -112,7 +121,7 @@ WimaxMacToMacHeader::Serialize (Buffer::Iterator i) const
}
else
{
i.WriteU8 ((lenSize - 1) | 0x80);
i.WriteU8 ((lenSize-1) | 0x80);
for (int j = 0; j < lenSize - 1; j++)
{
i.WriteU8 ((uint8_t)(m_len >> ((lenSize - 1 - 1 - j) * 8)));

View File

@@ -121,7 +121,7 @@ Tlv::Serialize (Buffer::Iterator i) const
}
else
{
i.WriteU8 ((lenSize - 1) | WIMAX_TLV_EXTENDED_LENGTH_MASK);
i.WriteU8 ((lenSize-1) | WIMAX_TLV_EXTENDED_LENGTH_MASK);
for (int j = 0; j < lenSize - 1; j++)
{
i.WriteU8 ((uint8_t)(m_length >> ((lenSize - 1 - 1 - j) * 8)));

View File

@@ -534,19 +534,16 @@ WimaxHelper::EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
EnableAsciiForConnection (stream, nodeid, deviceid, (char*) "SubscriberStationNetDevice", (char*) "BasicConnection");
EnableAsciiForConnection (stream, nodeid, deviceid, (char*) "SubscriberStationNetDevice", (char*) "PrimaryConnection");
}
}
static void PcapSniffTxEvent (Ptr<PcapFileWrapper> file,
Ptr<const PacketBurst> burst,
WimaxPhy::ModulationType modulationType,
uint16_t m_nrBlocks,
uint16_t m_blockSize)
Ptr<const PacketBurst> burst)
{
std::list<Ptr<Packet> > packets = burst->GetPackets ();
for (std::list<Ptr<Packet> >::iterator iter = packets.begin (); iter != packets.end (); ++iter)
{
WimaxMacToMacHeader m2m((*iter)->GetSize()+1);
(*iter)->AddHeader(m2m);
WimaxMacToMacHeader m2m ((*iter)->GetSize ());
(*iter)->AddHeader (m2m);
file->Write (Simulator::Now (), (*iter));
}
}
@@ -556,8 +553,8 @@ static void PcapSniffRxEvent (Ptr<PcapFileWrapper> file, Ptr<const PacketBurst>
std::list<Ptr<Packet> > packets = burst->GetPackets ();
for (std::list<Ptr<Packet> >::iterator iter = packets.begin (); iter != packets.end (); ++iter)
{
WimaxMacToMacHeader m2m((*iter)->GetSize()+1);
(*iter)->AddHeader(m2m);
WimaxMacToMacHeader m2m ((*iter)->GetSize ());
(*iter)->AddHeader (m2m);
file->Write (Simulator::Now (), (*iter));
}
}
@@ -568,7 +565,7 @@ WimaxHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool exp
//
// All of the Pcap enable functions vector through here including the ones
// that are wandering through all of devices on perhaps all of the nodes in
// the system. We can only deal with devices of type WifiNetDevice.
// the system. We can only deal with devices of type WimaxNetDevice.
//
Ptr<WimaxNetDevice> device = nd->GetObject<WimaxNetDevice> ();
if (device == 0)