<div dir="ltr">First off, in many cases, it doesn't make much sense to think of the switches as having IP addresses. Hosts have IP addresses. There are exceptions, but... are you sure you're in one of those exceptional cases? If not, this is just going to be confusing.<div><br></div><div>That aside, you mention wanting to get packets from n1 to n3. The entry you've written there won't help because you have the destination set to match 10.0.0.2, but IP packets to n3's IP address will always have a destination of 10.0.0.3. It's also worth noting that you don't need to match on the source in order to match packets going to a destination. Finally, in order to match on IP addresses (at L3), you need to match on the Ethertype (at L2) to ensure that only IP packets match -- this is explained in the OpenFlow 1.0 specification. Off the top of my head, I think a suitable n1 match is...</div><div>fm.match.dl_type = 0x800</div><div>fm.match.nw_dst = IPAddr("10.0.0.3") # It's best to explicitly use POX's IPAddr here</div><div><br></div><div>And, indeed, you should be able to use the exact same entry on n2. For n3, I think you'll want to change the output port from OFPP_FLOOD to OFPP_LOCAL if you really do want to deliver the packet to n3's local IP address.</div><div><br></div><div>Good luck.</div><div><br></div><div>-- Murphy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 15, 2017 at 11:25 AM, S hj <span dir="ltr"><<a href="mailto:segunhz@gmail.com" target="_blank">segunhz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p class="MsoNormal">Hello,<span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">I have the following topology
and want to install rules in nodes (openvswitch nodes) to communicate with each
other.<span></span></p>
<p class="MsoNormal"><a href="https://maps.google.com/?q=N1(10&entry=gmail&source=g">N1(10</a>.0.0.1) ---
N2(10.0.0.2)--- <a href="https://maps.google.com/?q=N3(10&entry=gmail&source=g">N3(10</a>.0.0.3)<span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">each node has another interface to connect to the controller directly. </p><p class="MsoNormal"><br></p><p class="MsoNormal">I want to write flow
rules to help n2 to forward a packet from n1 to n3. </p><p class="MsoNormal"><br></p><p class="MsoNormal">So at first n1 sends a
packetIn message to get the rules to communicate with n2 as following:<span></span></p>
<p class="MsoNormal">(If the source of
packet is n1 and the destination in n2, send the packet to the port)<span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">fm= of.ofp_flow_mod()<span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">fm.match.nw_src = “10.0.0.1”<span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">fm.match.nw_dst = “10.0.0.2”<span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">fm.actions.append(of.ofp_<wbr>action_output(port=
of.OFPP_FLOOD)<span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">event.connection.send(fm)<span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">Then in n2, I want to
write a flow rule that if it receive a packet from n1 , forward that to n3.<span></span></p>
<p class="MsoNormal">Could you let me know how
should I write this rule?<span></span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal">Thank you<span></span></p></div>
</blockquote></div><br></div>