tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Port Mirroring Exercise

Open khooi8913 opened this issue 5 years ago • 8 comments

I would like to propose an exercise to introduce the port mirroring features of P4 that involves the clone function/ extern, which many would probably find useful for many cases.

khooi8913 avatar Mar 12 '20 09:03 khooi8913

This is super cool! Can I ask if you are an existing P4 member or ONF contributor?

jnfoster avatar Mar 13 '20 04:03 jnfoster

Hi Nate, nope, I'm not. :)

khooi8913 avatar Mar 13 '20 04:03 khooi8913

Can you send me a note at [email protected]? I'll get you set up.

jnfoster avatar Mar 13 '20 04:03 jnfoster

Sure thing! I've just dropped you an email.

khooi8913 avatar Mar 13 '20 04:03 khooi8913

hello, now I want to use resubmit and clone to make a packet send to the same detination after egress edit several times, can you tell me how to set clone session to make clone function effective? if you can send me you code at [email protected] ,thank you!

huhub avatar Mar 16 '20 05:03 huhub

Hi @huhub In short, (1) you simply need to define a session X (that can be any number), when specifying your clone action along with the CloneType. Then, (2) you will need to assign the corresponding outports to session X, that where you would like to send the cloned packets to using the control plan/ CLI.

You may refer to my commit for further details. I have included a sample solution as well. I hope it helps! 😄

khooi8913 avatar Mar 17 '20 02:03 khooi8913

thank you a lot! now I know how to use CLI, and I have already made it, that's very cool.

---Original--- From: "Xin Zhe Khooi"<[email protected]> Date: 2020/3/17 10:24:45 To: "p4lang/tutorials"<[email protected]>; Cc: "Mention"<[email protected]>;"huhub"<[email protected]>; Subject: Re: [p4lang/tutorials] Port Mirroring Exercise (#335)

Hi @huhub In short, (1) you simply need to define a session X (that can be any number), when specifying your clone action along with the CloneType. Then, (2) you will need to assign the corresponding outports to session X, that where you would like to send the cloned packets to using the control plan/ CLI.

You may refer to my commit for further details. I have included a sample solution as well. I hope it helps! 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

huhub avatar Mar 17 '20 05:03 huhub

Hi @jnfoster , can you review my proposed exercise (I have made some slight changes since the PR was opened) and possibly merge it? Thanks!

khooi8913 avatar May 05 '20 02:05 khooi8913