[pox-dev] h1 ping h3 from mininet via POX controller not working as expected.
Murphy McCauley
murphy.mccauley at gmail.com
Thu May 2 22:31:08 PDT 2013
I'd suggest you look at the packets. There's a packet dump app in POX, or you could use wireshark on the control channel (and/or on one of the host interfaces).
Though you should still see at least two (the ping and the pong).
-- Murphy
On May 2, 2013, at 10:23 PM, Karthik Sharma wrote:
> sorry I had added a -c1 at the end of the command.
>
>> mininet> h1 ping h3
>
>
>
> On 3 May 2013 17:16, Murphy McCauley <murphy.mccauley at gmail.com> wrote:
> Ping sends packets from A to B, and B sends them back to A. Ping does this continually until you stop it unless you specify a limit on the commandline.
>
> Since you're installing flows, you'd actually expect them to start hitting the flow table and stop hitting the switch, but the fewest you could probably expect to see at the controller in that case is still three.
>
> -- Murphy
>
> On May 2, 2013, at 9:48 PM, Karthik Sharma wrote:
>
>> I have mininet configured with a remote POX controller running.The configuration of mininet network is as shown below
>>
>>
>>
>> h1 (eth0) ----------- s2(eth1) s2(eth2) ---------- h3(eth0)
>>
>> where
>> h1: eth0 is ca:bc:2e:0c:5a:52
>> h2: eth0 is 0a:79:40:89:44:cf
>>
>>
>> The packet handling function in the POX network controller that gets called whenever a packet is forwarded to the controller is given below.The basic idea is that I use
>> a database backed controller.If the packet destination address is not present in the database,I flood the packet.else I forward the packet to the appropriate port.
>>
>> def act_like_switch (self, packet, packet_in):
>> """
>> Implement switch-like behavior.
>> """
>> # Learn the port for the source MAC
>> print "RECIEVED FROM PORT ",packet_in.in_port , "SOURCE ",packet.src ,"DEST" , packet.dst
>> self.mac_to_port[packet.src]=packet_in.in_port
>> q_res = session.query(SourcetoPort).filter_by(src_address=str(packet.dst)).first()
>> if q_res is not None:
>> self.send_packet(packet_in.buffer_id, packet_in.data,q_res.port_no, packet_in.in_port)
>> #create a flow modification message
>> msg = of.ofp_flow_mod()
>> #set the fields to match from the incoming packet
>> msg.match = of.ofp_match.from_packet(packet)
>> #send the rule to the switch so that it does not query the controller again.
>> msg.actions.append(of.ofp_action_output(port=q_res.port_no))
>> #push the rule
>> self.connection.send(msg)
>> else:
>> #flood this packet out as we don't know about this node.
>> self.send_packet(packet_in.buffer_id, packet_in.data,of.OFPP_FLOOD, packet_in.in_port)
>> q_res = session.query(SourcetoPort).filter_by(src_address=str(packet.src)).first()
>> if q_res is None:
>> entry = SourcetoPort(src_address=str(packet.src) , port_no=packet_in.in_port)
>> #add the record to the session object
>> session.add(entry)
>> #add the record to the session object
>> session.commit()
>>
>>
>> As mentioned above this function is running on a remote POX controller connected to the described mininet network.Now I do
>>
>> mininet> h1 ping h3
>>
>> The output that I get is as follows.I have put print statements in the beginning of act_like_switch() function.
>>
>> RECIEVED FROM PORT 1 SOURCE ca:bc:2e:0c:5a:52 DEST 0a:79:40:89:44:cf
>> RECIEVED FROM PORT 2 SOURCE 0a:79:40:89:44:cf DEST ca:bc:2e:0c:5a:52
>> RECIEVED FROM PORT 1 SOURCE ca:bc:2e:0c:5a:52 DEST 0a:79:40:89:44:cf
>> RECIEVED FROM PORT 2 SOURCE 0a:79:40:89:44:cf DEST ca:bc:2e:0c:5a:52
>>
>> It seems that there are two ICMP messages from h1 to h2 and two ICMP messages from h2 to h1.
>> I would expect only 1 ICMP message from host h1 to h2.Why are there so many messages.I did think of
>> broadcast but why is the destination address not ff:ff:ff:ff:ff:ff ? The source and destination addresses seems to be swapped?
>>
>> Can anyone explain why this is happening? I am fairly new to POX and mininet
>>
>> Regards,
>> Karthik
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20130502/09b115ef/attachment-0002.htm>
More information about the pox-dev
mailing list