Enabling pcap tracing in examples/wimax/wimax-simlpe.cc

This commit is contained in:
Mohamed Amine Ismail
2010-03-16 14:29:08 +01:00
parent 448f5cf6f0
commit 46f0a8a0b1
7 changed files with 30 additions and 31 deletions

View File

@@ -153,8 +153,10 @@ int main (int argc, char *argv[])
clientApps.Stop (Seconds (duration));
Simulator::Stop (Seconds (duration + 0.1));
wimax.EnablePcap("ss0", ssNodes.Get (0)->GetId (), ss[0]->GetIfIndex ());
wimax.EnablePcap("ss1", ssNodes.Get (0)->GetId (), ss[0]->GetIfIndex ());
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"),

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

@@ -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());
(*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());
(*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)