Hello Ryu experts!,
I am trying to create a simple PacketOut for a TCP packet and I had
followed the example code provided for the ICMP. I modified the
sample_switch_13 application . Please find the code below. I am not sure
why the flow table is not created and my traffic is passed. I am fairly new
to the controller and therefore requesting some help. I have an raspberry
pi running OVS and it has 2 ports. One input ( eth0 -port1 and one output
eth1-port2). Both are defined as part of the br-int bridge.
My topology has a edge device ( PC) connected to the OVS ( rasberry pi).
The other end of the Raspberry pi is connected to the server. I am running
a simple client ( PC) to the server ( Linux) via the Raspberry pi ( OVS).
Client is connected to eth0 ( port 1) and server is connected to eth1 (
port 2).
My controller is also running the edge device (PC). what am I doing wrong
?.
Also, do I need to create 2 separate flow entries - one for client to
server and other for server to client or it is created as part of the
PacketOut ( once the below code is fixed ).
Your help will be greatly appreciated here!
def _handle_tcp(self, datapath,ipv4_pkt,eth_pkt,tcp_pkt, in_port):
pkt=packet.Packet()
pkt.add_protocol(ethernet.ethernet(ethertype=eth_pkt.ethertype,
src=eth_pkt.src,
dst=eth_pkt.dst))
pkt.add_protocol(ipv4.ipv4(src=ipv4_pkt.src,dst=ipv4_pkt.dst,
proto=ipv4_pkt.proto))
pkt.add_protocol(tcp.tcp(dst_port=tcp_pkt.dst_port,
src_port=tcp_pkt.src_port))
# learn a mac address to avoid FLOOD next time.
self.mac_to_port[datapath.id][eth_pkt.src] = in_port
# if the destination mac address is already learned,
# decide which port to output the packet, otherwise FLOOD.
if eth_pkt.dst in self.mac_to_port[datapath.id]:
out_port = self.mac_to_port[datapath.id][eth_pkt.dst]
else:
out_port = datapath.ofproto.OFPP_FLOOD
self._send_packet(datapath, in_port
,pkt,out_port)
def _send_packet(self,datapath, port, pkt,out_port):
print( "PRINTING INPORT AND OUTPORT......:",port,out_port)
ofproto=datapath.ofproto
parser=datapath.ofproto_parser
pkt.serialize()
data=pkt.data
action=[parser.OFPActionOutput(port=port)]
out=parser.OFPPacketOut(datapath=datapath,
buffer_id=ofproto.OFP_NO_BUFFER,
in_port=ofproto.OFPP_CONTROLLER,actions=action,
data=data)
datapath.send_msg(out)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel