ns3 openflow model cannot config permanent table rules?!

19 views
Skip to first unread message

qingyuShi

unread,
Nov 25, 2015, 8:37:40 PM11/25/15
to ns-3-users
I made the test below:
node1------------switch--------------switch--------node4
                        |                       |
                        |                       |
                     node2               node3


I sent 2 same packet from node2 to node1,the LearningController attached in the both switches,like this"echoClient.SetAttribute ("MaxPackets", UintegerValue (2));"

I added some print message in the LearningController mode,like below:

if (!dst_addr.IsBroadcast ())
        {
          LearnState_t::iterator st = m_learnState.find (dst_addr);
          if (st != m_learnState.end ())
            {
              out_port = st->second.port;
              //NS_LOG_ERROR("switchindex:  "<<swtch->GetNode()->GetId()<<"  inport:  "<<in_port<<" nw_src: "<<key.flow.nw_src);
              //NS_LOG_ERROR("switchindex:  "<<swtch->GetNode()->GetId()<<"  outport:  "<<out_port<<" nw_dst: "<<key.flow.nw_dst);
              NS_LOG_ERROR("switchindex:  "<<swtch->GetNode()->GetId()<<"  inport:  "<<in_port<<" dl_src: "<<src_addr);
              NS_LOG_ERROR("switchindex:  "<<swtch->GetNode()->GetId()<<"  outport:  "<<out_port<<" dl_dst: "<<dst_addr);
              NS_LOG_ERROR("config switch "<<swtch->GetNode()->GetId()<<";buffer id "<<opi->buffer_id);
            }

I think ,when the node1 and node2 communicate,and the packet is the same ,the same table rule should be added only once.

However,the print message is below:

switchindex:  4  inport:  1 dl_src: 00:00:00:00:00:03
switchindex:  4  outport:  2 dl_dst: 00:00:00:00:00:05
config switch 4;buffer id 50397184
switchindex:  4  inport:  2 dl_src: 00:00:00:00:00:05
switchindex:  4  outport:  1 dl_dst: 00:00:00:00:00:03
config switch 4;buffer id 67174400
switchindex:  4  inport:  2 dl_src: 00:00:00:00:00:05
switchindex:  4  outport:  1 dl_dst: 00:00:00:00:00:03
config switch 4;buffer id 117506048
switchindex:  4  inport:  1 dl_src: 00:00:00:00:00:03
switchindex:  4  outport:  2 dl_dst: 00:00:00:00:00:05
config switch 4;buffer id 134283264

You can see, the communicate pattern is "node2->node1","node1->node2","node2->node1","node1->node2".The IP and Ports information are not printed,but they are the same in the two communication.

May you help me .

Sorry for my poor English:)
Reply all
Reply to author
Forward
0 new messages