[ovs-discuss] OVS custom action

2020-04-24 Thread Luca Mancini
Hi, I am trying to implement a new openflow action on an openvswitch, that upon request by the controller buffers a given packet. So assume a topology like H1—s1--s2—H2 where h1 sends packets to h2, the controller would specify a BUFFER action to all packets going from h1 to h2 Making the s1 sw

Re: [ovs-discuss] OVS custom action

2020-04-25 Thread Luca Mancini
erstand the ovs codebase and learn how to implement a new action such as this one? Thanks again! L From: Ben Pfaff<mailto:b...@ovn.org> Sent: Friday, April 24, 2020 18:50 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@open

Re: [ovs-discuss] OVS custom action

2020-04-26 Thread Luca Mancini
, so something like (action=BUFFER:Packet) or can I access it from somewhere else in the code? The latter seams more feasible, but I don’t quite understand how I can make the action send the packets to the userspace for processing. Thanks, L From: Luca Mancini<mailto:luca.manc...@outlook.

Re: [ovs-discuss] OVS custom action

2020-04-29 Thread Luca Mancini
: Ben Pfaff<mailto:b...@ovn.org> Sent: Tuesday, April 28, 2020 20:59 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] OVS custom action On Sat, Apr 25, 2020 at 08:29:24AM +, Luca M

Re: [ovs-discuss] OVS custom action, DEBUGGING

2020-05-04 Thread Luca Mancini
ns the string: "go through this 10 times...” twice. I don’t understand where the other packets go, are they sent to kernel space? I’m trying to only work on userspace as I was suggested to do but I can’t seem to get around this issue. From: Luca Mancini<mailto:luca.manc...@outloo

[ovs-discuss] concurrency issue with userspace action

2020-05-15 Thread Luca Mancini
send packets to switches in a slower manner. Is there any way to avoid the packets from overlapping, some sort of lock thing I can use? I’m working in the ofproto-dpif-xlate.c file. Thanks Luca Mancini ___ discuss mailing list disc

[ovs-discuss] setting a flow to slow

2020-05-16 Thread Luca Mancini
Hello, Does anyone know how to set the flow flag to slow so that my action can only be implemented in userspace? I’ve seen a couple of actions use “ctx.xout->slow |= SLOW_ACTION;” however if I add this line to my compose_foo() function in ofproto-dpif-xlate.c I get a SIGABRT call which stops mi

[ovs-discuss] ctx->xin-packet overlap

2020-05-18 Thread Luca Mancini
Hi, In userspace I’m storing the packets received in an array of struct dp_packets, however if I try to print these packets I notice that as packets come in, they overlap as if for every packet received the previous ctx->xin->packet is overwritten. My code looks something like: Dp_packet_buff

Re: [ovs-discuss] setting a flow to slow

2020-05-18 Thread Luca Mancini
Never mind found the change flag code ctx->xout->slow |= SLOW_ACTION L From: Luca Mancini<mailto:luca.manc...@outlook.com> Sent: Saturday, May 16, 2020 18:59 To: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: [ovs-discuss] setting a flow to slow

Re: [ovs-discuss] ctx->xin-packet overlap

2020-05-18 Thread Luca Mancini
nday, May 18, 2020 15:22 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] ctx->xin-packet overlap On Mon, May 18, 2020 at 6:10 AM Luca Mancini wrote: > > Hi, > > In user

Re: [ovs-discuss] ctx->xin-packet overlap

2020-05-20 Thread Luca Mancini
<mailto:u9012...@gmail.com> Sent: Tuesday, May 19, 2020 17:41 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] ctx->xin-packet overlap On Mon, May 18, 2020 at 7:10 AM Luca Mancini wrot

Re: [ovs-discuss] ctx->xin-packet overlap

2020-05-20 Thread Luca Mancini
idea how to do this? L From: Luca Mancini<mailto:luca.manc...@outlook.com> Sent: Wednesday, May 20, 2020 17:15 To: William Tu<mailto:u9012...@gmail.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] ctx->xin-packet overlap

[ovs-discuss] OVERLAPPING DP_PACKETS ctx->xin->payload

2020-05-21 Thread Luca Mancini
Hi, I found out while debugging my new action that ovs overlaps incoming packet payloads and I haven’t found a fix for this. I can’t tell if it’s an OVS bug or if I’m doing something wrong. Basically once do_xlate_actions is called and my action is “hit” I attempt to print the packet to gdb usi

Re: [ovs-discuss] OVERLAPPING DP_PACKETS ctx->xin->payload

2020-05-21 Thread Luca Mancini
. To continue developing my buffering action I need the full correct packet, do you see any other solution? Best, L From: Ben Pfaff<mailto:b...@ovn.org> Sent: Thursday, May 21, 2020 21:14 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mai

Re: [ovs-discuss] OVERLAPPING DP_PACKETS ctx->xin->payload [SOLVED]

2020-05-22 Thread Luca Mancini
("%.*s", sizeofpayload, (char *) dp_packet_get_udp_payload(ctx->xin->packet) ); L From: Ben Pfaff<mailto:b...@ovn.org> Sent: Thursday, May 21, 2020 22:24 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discu

[ovs-discuss] creation of custom UDP packet

2020-06-01 Thread Luca Mancini
Hello, Does anyone know the way to properly create a UDP dp_packet so that I can “manually” place a payload to it? Haven’t found anything in the code base nor in the mailing list. Thanks! L ___ discuss mailing list disc...@openvswitch.org https://mail

[ovs-discuss] DP_Packet Payload Modification

2020-06-04 Thread Luca Mancini
do something along the lines of dp_packet_clone(), dp_packet_l4() to get the pointer to the UDP header and then overwrite it with memcpy? Any help is really appreciated, Thanks! Luca Mancini ___ discuss mailing list disc...@openvswitch.org https

Re: [ovs-discuss] DP_Packet Payload Modification

2020-06-05 Thread Luca Mancini
e new packet. Any help is very appreciated! Cheers, L From: Gregory Rose<mailto:gvrose8...@gmail.com> Sent: Friday, June 5, 2020 18:58 To: Luca Mancini<mailto:luca.manc...@outlook.com>; ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss]

Re: [ovs-discuss] DP_Packet Payload Modification

2020-06-05 Thread Luca Mancini
e new packet. Any help is very appreciated! Cheers, L From: Gregory Rose<mailto:gvrose8...@gmail.com> Sent: Friday, June 5, 2020 18:58 To: Luca Mancini<mailto:luca.manc...@outlook.com>; ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss]

Re: [ovs-discuss] DP_Packet Payload Modification

2020-06-05 Thread Luca Mancini
OVS? Cheers, Luca From: Ben Pfaff<mailto:b...@ovn.org> Sent: Friday, June 5, 2020 21:32 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: Gregory Rose<mailto:gvrose8...@gmail.com>; ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-di

Re: [ovs-discuss] DP_Packet Payload Modification

2020-06-05 Thread luca . mancini
ts.  The number of bytes to send is an operand of the action that sends a packet to the controller. Of course it's doable in OVS--but it's going to be more work and you'll have to understand OVS internals instead of OpenFlow. On Fri, Jun 05, 2020 at 07:47:56PM +, Luc

Re: [ovs-discuss] DP_Packet Payload Modification

2020-06-06 Thread Luca Mancini
for(int j=0; jmailto:gvrose8...@gmail.com> Sent: Friday, June 5, 2020 23:05 To: Luca Mancini<mailto:luca.manc...@outlook.com>; ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] DP_Packet Payload Modification On 6/5/2020 11:00 AM, Luca

Re: [ovs-discuss] DP_Packet Payload Modification

2020-06-06 Thread Luca Mancini
from nw_src everything is zeroed out, so it makes me think it’s getting overwritten, but the payload is extracted correctly with dp_packet_get_udp_paylaod meaning the payload is most likely aligned correctly. Any thoughts of what is happening? Luca From: Luca Mancini<mailto:luca.m

Re: [ovs-discuss] DP_Packet Payload Modification [Solved I think]

2020-06-06 Thread Luca Mancini
) + UDP_HEADER_LEN, dp_packet_buff1, sizeof(dp_packet_buff1)); packet is now complete and extraction of payload works, now I’ll start working on the sending part which is probably not as easy as I think. Thanks for the help! Luca From: Luca Mancini<mailto:luca.manc...@outlook.com> Sent: Sa

[ovs-discuss] strange behavior when i send DP_PACKET from userspace

2020-06-09 Thread Luca Mancini
Hello, I’m having problems with sending custom packets using the ofproto_dpif_send_packet(). As said in the previoius thread https://mail.openvswitch.org/pipermail/ovs-discuss/2020-June/050204.html I thought to have correctly created a custom udp packet that contains as a payload a buffer of d

Re: [ovs-discuss] strange behavior when i send DP_PACKET from userspace

2020-06-09 Thread Luca Mancini
I believe it might be fixed by adding payload parameters to flow_compose() instead of setting it to null like I did From: Luca Mancini<mailto:luca.manc...@outlook.com> Sent: Tuesday, June 9, 2020 11:39 To: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subj

[ovs-discuss] sending dp_packet to OFPP_NORMAL

2020-06-12 Thread Luca Mancini
I’m trying to send a dp_packet from userspace to OFPP_NORMAL, however the ofproto_dpif_send_packet() function won’t do it. For now I’m using this approach: const struct ofproto_dpif *ofproto = ctx->xin->ofproto; const struct ofport_dpif *portExit; ofp_port_t out_port = 2; portExit = ofp_port_to_

[ovs-discuss] problems sending to OFPP_NORMAL

2020-06-15 Thread Luca Mancini
Does anyone know of a way to send dp_packets throught the OFPP_NORMAL port? I do not have the corresponding struct xlate_ctx pointer because to my knowledge there is no way of storing it for use later on, so I can’t use the compose_output_action() function. I tried using ofproto_dpif_send_packet

[ovs-discuss] Storing xlate_ctx CTX

2020-06-17 Thread Luca Mancini
Hello, Are there ways in OVS store a struct xlate_ctx *ctx so that I can use it even after another packet is received by the switch? ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Re: [ovs-discuss] Storing xlate_ctx CTX

2020-06-17 Thread Luca Mancini
tions that do these things necess struct xlate_ctx. Thanks! From: Ben Pfaff<mailto:b...@ovn.org> Sent: Wednesday, June 17, 2020 21:50 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] St

Re: [ovs-discuss] Storing xlate_ctx CTX

2020-06-17 Thread Luca Mancini
ctx pointer. The only temporary solution I have in place is iterating through the switch’s available ports and flooding the single packets, but this is very ugly let alone inefficient in bigger topologies. From: Ben Pfaff<mailto:b...@ovn.org> Sent: Wednesday, June 17, 2020 22:45 To: Luca M

Re: [ovs-discuss] Storing xlate_ctx CTX

2020-06-17 Thread Luca Mancini
Sorry, what do you mean exactly by “translate the packets using the xlate_ctx struct”? Do you mean passing "normal” to the set of actions before buffering the packet? From: Ben Pfaff<mailto:b...@ovn.org> Sent: Wednesday, June 17, 2020 23:17 To: Luca Mancini<mailto:luca.manc...@o

Re: [ovs-discuss] Storing xlate_ctx CTX

2020-06-17 Thread Luca Mancini
Pfaff<mailto:b...@ovn.org> Sent: Wednesday, June 17, 2020 23:54 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] Storing xlate_ctx CTX When you need to send the buffered packet,

Re: [ovs-discuss] Storing xlate_ctx CTX

2020-06-17 Thread Luca Mancini
Me too haha, I won’t lose hope though and I can’t really. Thanks for the suggestions, I’ll keep working on it and update if I manage to come up with something From: Ben Pfaff<mailto:b...@ovn.org> Sent: Thursday, June 18, 2020 00:29 To: Luca Mancini<mailto:luca.manc...@outlook.com

Re: [ovs-discuss] Storing xlate_ctx CTX [solved]

2020-06-19 Thread Luca Mancini
this makes a little sense, but when I’ll be done with this whole project I’ll make a blog and explain it all more thoroughly. Thanks for the help! Luca From: Luca Mancini<mailto:luca.manc...@outlook.com> Sent: Thursday, June 18, 2020 00:39 To: ovs-discuss@openvswitch.org<mailto:ov

[ovs-discuss] Multiple instances of the same action

2020-07-02 Thread Luca Mancini
Hello, I was wondering if there is a way to have multiple instances of the same action. For example I implemented a Buffering action as detailed previously in https://mail.openvswitch.org/pipermail/ovs-discuss/2020-June/050197.html so my question is, is there a way to install two different flows

[ovs-discuss] different flow actions overlap

2020-07-06 Thread Luca Mancini
Hello, I have two different flows on the same switch: ovs-ofctl add-flow s1 in_port=1,dl_type=2048,nw_proto=17,nw_dst=10.0.0.4,action=buffer:3 ovs-ofctl add-flow s1 in_port=1,dl_type=2048,nw_proto=17,nw_dst=10.0.0.2,action=buffer:2 these flows are supposed to buffer packets meant for the desti

Re: [ovs-discuss] different flow actions overlap

2020-07-06 Thread Luca Mancini
ering action (in two separate flows) add the packets to the same buffer. From: Ben Pfaff<mailto:b...@ovn.org> Sent: Monday, July 6, 2020 18:33 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-d

Re: [ovs-discuss] different flow actions overlap

2020-07-06 Thread Luca Mancini
this behavior to be honest. Is having multiple ovs-vswitchd processes a valid solution instead of hard coding my way though this? From: Ben Pfaff<mailto:b...@ovn.org> Sent: Monday, July 6, 2020 20:44 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org&l

Re: [ovs-discuss] different flow actions overlap

2020-07-06 Thread Luca Mancini
; Sent: Monday, July 6, 2020 21:37 To: Luca Mancini<mailto:luca.manc...@outlook.com> Cc: ovs-discuss@openvswitch.org<mailto:ovs-discuss@openvswitch.org> Subject: Re: [ovs-discuss] different flow actions overlap I don't recommend multiple ovs-vswitchd processes. It sounds lik

[ovs-discuss] adding a second parameter to a CUSTOM action

2020-07-09 Thread Luca Mancini
Hello, I’m adding a second parameter to an action I implemented, I had it working with one parameter but if I decide to add a second one I can’t seem to modify the parsing and formatting functions in ofp-actions.c correctly. Is there any documentation that explains how encoding, decoding and par

[ovs-discuss] adding support for new action on any controller

2020-07-14 Thread Luca Mancini
Hello, I’m trying to add support for new actions I implemented in OVS, on the RYU controller. Does anyone have any experience in this with RYU or any other controller? I know this question isn’t very OVS-specific but since this might be useful information for ovs developers and rookies, and sinc

[ovs-discuss] buffering TCP packets

2020-07-23 Thread Luca Mancini
Hi, I implemented an action to buffer TCP packets, similarly to what I had done with UDP packets. For udp packets everything works perfectly, however for tcp it keeps buffering the first packet I send multiple times instead of all the packets I try to send using netcat. Is this related to how

[ovs-discuss] ovs_16aligned_be32 type

2020-07-23 Thread Luca Mancini
Can some please tell me how to print the value, ovs_16aligned_be32 tcp_seq These types confuse me ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Re: [ovs-discuss] ovs_16aligned_be32 type

2020-07-24 Thread Luca Mancini
and then set tcpheader->tcp_seq = tcp_seq_to_print //obviously a type error here Thanks! From: Luca Mancini<mailto:luca.manc...@outlook.com> Sent: Friday, July 24, 2020 10:32 To: discuss<mailto:ovs-discuss-boun...@openvswitch.org>; Numan Siddique<mailto:num...@ovn

[ovs-discuss] connecting Mininet Topology to Internet

2020-08-01 Thread Luca Mancini
Hello, I’m trying to connect a mininet topology to the internet so that I can test out some actions I created. I created a simple topology: H1,h2,h3,h4 ---s1s2---Internet I did this by adding a bridge with the ovs-vsctl add-port command to s2 (eth1 which is what the VM uses to

[ovs-discuss] reassembling packet splits

2020-08-29 Thread Luca Mancini
I’m having a weird issue with this code: static char * reassemble_tcp_message(struct my_tcp_split_packet *msp1) { VLOG_ERR("tot splits: %d, sizepayload %u", msp1[0].tot_splits, msp1[0].sizeofpayload); char *temp_payload_reass = malloc((char *) * msp1[0].sizeofpayload + 1); temp_payloa

[ovs-discuss] guide for adding custom openflow actions

2020-10-28 Thread Luca Mancini
So a while back I started a project that required the implementation of new actions in ovs. Since there is no clear guide on how to do this I leave to all future developers a link to the project. There’s a guide and commented code just to serve as a way for new developers to create cool new thin