ns3-rdma icon indicating copy to clipboard operation
ns3-rdma copied to clipboard

Run time error "cannot add the same kind of tag twice"

Open princhenee opened this issue 6 years ago • 0 comments

Hi Yibo,

have you ever met this error "cannot add the same kind of tag twice"? I got this error whenever a CNP is passing two switch nodes.

This error is thrown here: "src/point-to-point/model/qbb-net-device.cc:459-461 "

if (ipv4h.GetProtocol() != 0xFE) //not PFC
{
        packet->AddPacketTag(FlowIdTag(m_ifIndex));
......

Here, It seems that when a CNP(ipv4h.GetProtocol=0xFF) arrives at a switch node, the packet tag will be added.

But the tag is not removed when leaving switch, specified in this scope: "src/point-to-point/model/qbb-net-device.cc:349 "

if (m_queue->GetLastQueue() == qCnt - 1)//this is a pause or cnp, send it immediately!

I traced back and found when the CNP arrives at the next switch node, the error occurs.

Then I added a code snippet to remove the tag within the 'if' scope in "src/point-to-point/model/qbb-net-device.cc:349"

if (m_queue->GetLastQueue() == qCnt - 1)//this is a pause or cnp, send it immediately!
  {
+      if (h.GetProtocol() != 0xFE) //not PFC , here h refers to ipv4header
+        {
+            p->RemovePacketTag(t);
+        }
	TransmitStart(p);
  }

The error does not occur now.

I wonder if this is a bug or due to I have missed something in configuration. I met this in an Incast test scenario.

Thanks, Ge

princhenee avatar Jan 05 '19 07:01 princhenee