Hi,
I recently switched from Omnetpp to NS3. I did the Tutorial and tried the " find . -name '*.cc' | xargs grep -i XY" now im horrible stuck using ECN.
I am currently working on a new Queuedisc.
Im trying to give certain packages an ECN-Marking, to enforce fairness. But my simulation results look like i am operating without any algorithm. If i drop the packages everything works perfectly.
My Approach:I mark packets using this class: I assume there is an easier way marking packets, but i have not found it jet.
Ptr<QueueDiscItem> NewQueueDisc::mark(Ptr<QueueDiscItem> item) {
Ptr<const Ipv4QueueDiscItem> ipv4Item =
DynamicCast<const Ipv4QueueDiscItem>(item);
Ipv4Header ipHeader = ipv4Item->GetHeader();
ipHeader.SetEcn(Ipv4Header::ECN_CE);
Ptr<Ipv4QueueDiscItem> newPacket = Create<Ipv4QueueDiscItem>(
ipv4Item->GetPacket(), ipv4Item->GetAddress(),
ipv4Item->GetProtocol(), ipHeader);
return newPacket;
}
This is used in the "DoEnqueue(Ptr<QueueDiscItem> item)" method like:
item = mark(item);
bool intEnqueue = GetInternalQueue(0)->Enqueue(item);
To
test this i use in the "DoDequeue" method:
ipv4Item->GetHeader().GetEcn()
which results in many 3s. Thus i guess i make everything correct. Also source / dest addresses seem to be fine. But my results are horrible.
Im using TCP-New Reno
Config::SetDefault("ns3::TcpL4Protocol::SocketType",
StringValue("ns3::TcpNewReno"));
My Sink uses:
PacketSinkHelper sink("ns3::TcpSocketFactory",
InetSocketAddress(Ipv4Address::GetAny(), port));
And my channels are a P2P channel.
My guess:My packet receiving node sends no ECN-Feedback, thus the sendubg nodes never reduce their congestion window.
My Question:1. Is there a better / shorter / easier way to give QueueDiscItems/Ipv4QueueDiscItems ECN-Markings?
2. Do I have to change anything in my topology? I do not enable ECN anywhere?
System:
I tried it using ns3-3.26 and ns3-dev-dce. My OS is Ubuntu.
Attached File:
The queuediscs goal is it to enforce fairness (force every user to forward the
same amount of bytes over a bottleneck). The attached file shows my result. The line
looking like a "U" shows that my queuedisc is able to enforce fairness (for some configuration), if the Queuedisc drops packets. The line which is constant on 10.3 is
the result if i do not drop packets but give them ECN-Markings. Since the queuedisc
works, if i drop packets, i assume my implementation is correct and i am using ECN the wrong way.
Using Omnetpp i got my desired fairness using ECN-Markings and Drops, thus its not typical ECN behavior and my current result is wrong.
In my despair i even tried to mark EVERY package, resulting in the same result I attached.
with kind regards
Kurt