SG
Sahil Gupta
Tue, Jan 5, 2021 7:55 AM
Hi all,
I was trying to clone packets for some experiment.
I used the clone3 feature in ingress block and used the I2E clone type.
When I debugged the s1.log file, I found that packets are not getting
cloned.
I sent ICMP packets for testing.
Some Evidence:
- standard_metadata.instance_type should be of value 5 but instead value
is 0.
There is no instance_type with value 5.
- Wireshark and tcpdump on mininet host network interfaces show no
duplicate packets.
- log_msg function printing content only once in egress block per packet.
Expected behavior is to get content printed twice per packet. First time
for original and next time for the cloned packet.
How can I debug this issue?
Attaching the log file for reference.
Thanks
Sahil Gupta
Hi all,
I was trying to clone packets for some experiment.
I used the clone3 feature in ingress block and used the I2E clone type.
When I debugged the s1.log file, I found that packets are not getting
cloned.
I sent ICMP packets for testing.
*Some Evidence*:
1. standard_metadata.instance_type should be of value 5 but instead value
is 0.
There is no instance_type with value 5.
2. Wireshark and tcpdump on mininet host network interfaces show no
duplicate packets.
3. log_msg function printing content only once in egress block per packet.
Expected behavior is to get content printed twice per packet. First time
for original and next time for the cloned packet.
How can I debug this issue?
Attaching the log file for reference.
Thanks
Sahil Gupta
AF
Andy Fingerhut
Tue, Jan 5, 2021 3:00 PM
It seems possible that you have not configured an egress port for the
clone/mirror session that you are using in the P4 program? When
simple_switch starts, all clone sessions are initialized to a state where
they clone packets to nowhere, so the clones are effectively dropped.
You have a choice in simple_switch of configuring a clone session to send a
packet to a single egress port, or to a multicast group id. If you do so,
then in the log you would see not only the line:
[02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet at
ingress
which is printed from this line of C++ code:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
you would also see either a line like this, if the clone session is
configured for multicast:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
or if the clone session is configured for a single egress port, this line
would be executed:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
How does one configure a clone/mirror session? It depends upon the control
plane API you are using. If you are using simple_switch_CLI to do it
manually, there are commands to do so documented here:
https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
If you are using the P4Runtime API or Thrift API, they have their own
message formats for doing so.
Andy
On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta sg5414@rit.edu wrote:
Hi all,
I was trying to clone packets for some experiment.
I used the clone3 feature in ingress block and used the I2E clone type.
When I debugged the s1.log file, I found that packets are not getting
cloned.
I sent ICMP packets for testing.
Some Evidence:
- standard_metadata.instance_type should be of value 5 but instead value
is 0.
There is no instance_type with value 5.
- Wireshark and tcpdump on mininet host network interfaces show no
duplicate packets.
- log_msg function printing content only once in egress block per packet.
Expected behavior is to get content printed twice per packet. First time
for original and next time for the cloned packet.
How can I debug this issue?
Attaching the log file for reference.
Thanks
Sahil Gupta
P4-dev mailing list
P4-dev@lists.p4.org
http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
It seems possible that you have not configured an egress port for the
clone/mirror session that you are using in the P4 program? When
simple_switch starts, all clone sessions are initialized to a state where
they clone packets to _nowhere_, so the clones are effectively dropped.
You have a choice in simple_switch of configuring a clone session to send a
packet to a single egress port, or to a multicast group id. If you do so,
then in the log you would see not only the line:
[02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet at
ingress
which is printed from this line of C++ code:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
you would also see either a line like this, if the clone session is
configured for multicast:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
or if the clone session is configured for a single egress port, this line
would be executed:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
How does one configure a clone/mirror session? It depends upon the control
plane API you are using. If you are using simple_switch_CLI to do it
manually, there are commands to do so documented here:
https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
If you are using the P4Runtime API or Thrift API, they have their own
message formats for doing so.
Andy
On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta <sg5414@rit.edu> wrote:
> Hi all,
>
> I was trying to clone packets for some experiment.
> I used the clone3 feature in ingress block and used the I2E clone type.
> When I debugged the s1.log file, I found that packets are not getting
> cloned.
> I sent ICMP packets for testing.
>
> *Some Evidence*:
> 1. standard_metadata.instance_type should be of value 5 but instead value
> is 0.
> There is no instance_type with value 5.
> 2. Wireshark and tcpdump on mininet host network interfaces show no
> duplicate packets.
> 3. log_msg function printing content only once in egress block per packet.
> Expected behavior is to get content printed twice per packet. First time
> for original and next time for the cloned packet.
>
> How can I debug this issue?
> Attaching the log file for reference.
>
> Thanks
> Sahil Gupta
>
> _______________________________________________
> P4-dev mailing list
> P4-dev@lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>
SG
Sahil Gupta
Tue, Jan 5, 2021 3:14 PM
Thanks Andy for detailed insight!!
I will check the configuration of the clone session in my experimental
setup.
On Tue, Jan 5, 2021 at 10:01 AM Andy Fingerhut andy.fingerhut@gmail.com
wrote:
It seems possible that you have not configured an egress port for the
clone/mirror session that you are using in the P4 program? When
simple_switch starts, all clone sessions are initialized to a state where
they clone packets to nowhere, so the clones are effectively dropped.
You have a choice in simple_switch of configuring a clone session to send a
packet to a single egress port, or to a multicast group id. If you do so,
then in the log you would see not only the line:
[02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet at
ingress
which is printed from this line of C++ code:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
you would also see either a line like this, if the clone session is
configured for multicast:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
or if the clone session is configured for a single egress port, this line
would be executed:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
How does one configure a clone/mirror session? It depends upon the
control plane API you are using. If you are using simple_switch_CLI to do
it manually, there are commands to do so documented here:
https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
If you are using the P4Runtime API or Thrift API, they have their own
message formats for doing so.
Andy
On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta sg5414@rit.edu wrote:
Hi all,
I was trying to clone packets for some experiment.
I used the clone3 feature in ingress block and used the I2E clone type.
When I debugged the s1.log file, I found that packets are not getting
cloned.
I sent ICMP packets for testing.
Some Evidence:
- standard_metadata.instance_type should be of value 5 but instead value
is 0.
There is no instance_type with value 5.
- Wireshark and tcpdump on mininet host network interfaces show no
duplicate packets.
- log_msg function printing content only once in egress block per packet.
Expected behavior is to get content printed twice per packet. First time
for original and next time for the cloned packet.
How can I debug this issue?
Attaching the log file for reference.
Thanks
Sahil Gupta
P4-dev mailing list
P4-dev@lists.p4.org
http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
Thanks Andy for detailed insight!!
I will check the configuration of the clone session in my experimental
setup.
On Tue, Jan 5, 2021 at 10:01 AM Andy Fingerhut <andy.fingerhut@gmail.com>
wrote:
> It seems possible that you have not configured an egress port for the
> clone/mirror session that you are using in the P4 program? When
> simple_switch starts, all clone sessions are initialized to a state where
> they clone packets to _nowhere_, so the clones are effectively dropped.
> You have a choice in simple_switch of configuring a clone session to send a
> packet to a single egress port, or to a multicast group id. If you do so,
> then in the log you would see not only the line:
>
> [02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet at
> ingress
>
> which is printed from this line of C++ code:
> https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
>
> you would also see either a line like this, if the clone session is
> configured for multicast:
> https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
>
> or if the clone session is configured for a single egress port, this line
> would be executed:
> https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
>
> How does one configure a clone/mirror session? It depends upon the
> control plane API you are using. If you are using simple_switch_CLI to do
> it manually, there are commands to do so documented here:
> https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
>
> If you are using the P4Runtime API or Thrift API, they have their own
> message formats for doing so.
>
> Andy
>
> On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta <sg5414@rit.edu> wrote:
>
>> Hi all,
>>
>> I was trying to clone packets for some experiment.
>> I used the clone3 feature in ingress block and used the I2E clone type.
>> When I debugged the s1.log file, I found that packets are not getting
>> cloned.
>> I sent ICMP packets for testing.
>>
>> *Some Evidence*:
>> 1. standard_metadata.instance_type should be of value 5 but instead value
>> is 0.
>> There is no instance_type with value 5.
>> 2. Wireshark and tcpdump on mininet host network interfaces show no
>> duplicate packets.
>> 3. log_msg function printing content only once in egress block per packet.
>> Expected behavior is to get content printed twice per packet. First time
>> for original and next time for the cloned packet.
>>
>> How can I debug this issue?
>> Attaching the log file for reference.
>>
>> Thanks
>> Sahil Gupta
>>
>> _______________________________________________
>> P4-dev mailing list
>> P4-dev@lists.p4.org
>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>
>
NS
Nik Sultana
Tue, Jan 5, 2021 4:47 PM
Thanks Andy for detailed insight!!
I will check the configuration of the clone session in my experimental
setup.
On Tue, Jan 5, 2021 at 10:01 AM Andy Fingerhut andy.fingerhut@gmail.com
wrote:
It seems possible that you have not configured an egress port for the
clone/mirror session that you are using in the P4 program? When
simple_switch starts, all clone sessions are initialized to a state where
they clone packets to nowhere, so the clones are effectively dropped.
You have a choice in simple_switch of configuring a clone session to send a
packet to a single egress port, or to a multicast group id. If you do so,
then in the log you would see not only the line:
[02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet at
ingress
which is printed from this line of C++ code:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
you would also see either a line like this, if the clone session is
configured for multicast:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
or if the clone session is configured for a single egress port, this line
would be executed:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
How does one configure a clone/mirror session? It depends upon the
control plane API you are using. If you are using simple_switch_CLI to do
it manually, there are commands to do so documented here:
https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
If you are using the P4Runtime API or Thrift API, they have their own
message formats for doing so.
Andy
On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta sg5414@rit.edu wrote:
Hi all,
I was trying to clone packets for some experiment.
I used the clone3 feature in ingress block and used the I2E clone type.
When I debugged the s1.log file, I found that packets are not getting
cloned.
I sent ICMP packets for testing.
Some Evidence:
- standard_metadata.instance_type should be of value 5 but instead value
is 0.
There is no instance_type with value 5.
- Wireshark and tcpdump on mininet host network interfaces show no
duplicate packets.
- log_msg function printing content only once in egress block per packet.
Expected behavior is to get content printed twice per packet. First time
for original and next time for the cloned packet.
How can I debug this issue?
Attaching the log file for reference.
Thanks
Sahil Gupta
Hi Sahil, in case you'd like a BMv2-based example of the feature in use, here's
some code that uses cloning as part of a feedback loop between dataplanes:
https://github.com/eniac/Flightplan/blob/master/Wharf/Sources/FPRuntime.p4#L172
And this is where resources for cloning are set up via the control plane
-- Andy's earlier reply has key background details on this angle:
https://github.com/eniac/Flightplan/blob/b9d558d23359629e87807e4e868ef4673b6937f0/Wharf/fpctl.py#L188
The above code might require some effort at your end to understand or
run it, but we've deployed on several research systems and it works.
Hope that can be helpful to you, alongside the info you've gathered so far.
Nik
--
www.seas.upenn.edu/~nsultana
On Tue, 05 Jan 2021, Sahil Gupta wrote:
> Thanks Andy for detailed insight!!
> I will check the configuration of the clone session in my experimental
> setup.
>
> On Tue, Jan 5, 2021 at 10:01 AM Andy Fingerhut <andy.fingerhut@gmail.com>
> wrote:
>
> > It seems possible that you have not configured an egress port for the
> > clone/mirror session that you are using in the P4 program? When
> > simple_switch starts, all clone sessions are initialized to a state where
> > they clone packets to _nowhere_, so the clones are effectively dropped.
> > You have a choice in simple_switch of configuring a clone session to send a
> > packet to a single egress port, or to a multicast group id. If you do so,
> > then in the log you would see not only the line:
> >
> > [02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet at
> > ingress
> >
> > which is printed from this line of C++ code:
> > https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
> >
> > you would also see either a line like this, if the clone session is
> > configured for multicast:
> > https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
> >
> > or if the clone session is configured for a single egress port, this line
> > would be executed:
> > https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
> >
> > How does one configure a clone/mirror session? It depends upon the
> > control plane API you are using. If you are using simple_switch_CLI to do
> > it manually, there are commands to do so documented here:
> > https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
> >
> > If you are using the P4Runtime API or Thrift API, they have their own
> > message formats for doing so.
> >
> > Andy
> >
> > On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta <sg5414@rit.edu> wrote:
> >
> >> Hi all,
> >>
> >> I was trying to clone packets for some experiment.
> >> I used the clone3 feature in ingress block and used the I2E clone type.
> >> When I debugged the s1.log file, I found that packets are not getting
> >> cloned.
> >> I sent ICMP packets for testing.
> >>
> >> *Some Evidence*:
> >> 1. standard_metadata.instance_type should be of value 5 but instead value
> >> is 0.
> >> There is no instance_type with value 5.
> >> 2. Wireshark and tcpdump on mininet host network interfaces show no
> >> duplicate packets.
> >> 3. log_msg function printing content only once in egress block per packet.
> >> Expected behavior is to get content printed twice per packet. First time
> >> for original and next time for the cloned packet.
> >>
> >> How can I debug this issue?
> >> Attaching the log file for reference.
> >>
> >> Thanks
> >> Sahil Gupta
SG
Sahil Gupta
Tue, Jan 5, 2021 5:01 PM
Thanks Nik.
I will look into this as well.
☺
On Tue, Jan 5, 2021 at 11:47 AM Nik Sultana nsultana@seas.upenn.edu wrote:
Thanks Andy for detailed insight!!
I will check the configuration of the clone session in my experimental
setup.
On Tue, Jan 5, 2021 at 10:01 AM Andy Fingerhut <andy.fingerhut@gmail.com
wrote:
It seems possible that you have not configured an egress port for the
clone/mirror session that you are using in the P4 program? When
simple_switch starts, all clone sessions are initialized to a state
they clone packets to nowhere, so the clones are effectively dropped.
You have a choice in simple_switch of configuring a clone session to
packet to a single egress port, or to a multicast group id. If you do
then in the log you would see not only the line:
[02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet
ingress
which is printed from this line of C++ code:
you would also see either a line like this, if the clone session is
configured for multicast:
or if the clone session is configured for a single egress port, this
How does one configure a clone/mirror session? It depends upon the
control plane API you are using. If you are using simple_switch_CLI
it manually, there are commands to do so documented here:
If you are using the P4Runtime API or Thrift API, they have their own
message formats for doing so.
Andy
On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta sg5414@rit.edu wrote:
Hi all,
I was trying to clone packets for some experiment.
I used the clone3 feature in ingress block and used the I2E clone
When I debugged the s1.log file, I found that packets are not getting
cloned.
I sent ICMP packets for testing.
Some Evidence:
- standard_metadata.instance_type should be of value 5 but instead
is 0.
There is no instance_type with value 5.
2. Wireshark and tcpdump on mininet host network interfaces show no
duplicate packets.
3. log_msg function printing content only once in egress block per
Expected behavior is to get content printed twice per packet. First
for original and next time for the cloned packet.
How can I debug this issue?
Attaching the log file for reference.
Thanks
Sahil Gupta
Thanks Nik.
I will look into this as well.
☺
On Tue, Jan 5, 2021 at 11:47 AM Nik Sultana <nsultana@seas.upenn.edu> wrote:
> Hi Sahil, in case you'd like a BMv2-based example of the feature in use,
> here's
> some code that uses cloning as part of a feedback loop between dataplanes:
>
> https://github.com/eniac/Flightplan/blob/master/Wharf/Sources/FPRuntime.p4#L172
>
> And this is where resources for cloning are set up via the control plane
> -- Andy's earlier reply has key background details on this angle:
>
> https://github.com/eniac/Flightplan/blob/b9d558d23359629e87807e4e868ef4673b6937f0/Wharf/fpctl.py#L188
>
> The above code might require some effort at your end to understand or
> run it, but we've deployed on several research systems and it works.
>
> Hope that can be helpful to you, alongside the info you've gathered so far.
>
> Nik
>
> --
> www.seas.upenn.edu/~nsultana
>
> On Tue, 05 Jan 2021, Sahil Gupta wrote:
>
> > Thanks Andy for detailed insight!!
> > I will check the configuration of the clone session in my experimental
> > setup.
> >
> > On Tue, Jan 5, 2021 at 10:01 AM Andy Fingerhut <andy.fingerhut@gmail.com
> >
> > wrote:
> >
> > > It seems possible that you have not configured an egress port for the
> > > clone/mirror session that you are using in the P4 program? When
> > > simple_switch starts, all clone sessions are initialized to a state
> where
> > > they clone packets to _nowhere_, so the clones are effectively dropped.
> > > You have a choice in simple_switch of configuring a clone session to
> send a
> > > packet to a single egress port, or to a multicast group id. If you do
> so,
> > > then in the log you would see not only the line:
> > >
> > > [02:39:41.189] [bmv2] [D] [thread 12629] [97.0] [cxt 0] Cloning packet
> at
> > > ingress
> > >
> > > which is printed from this line of C++ code:
> > >
> https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L539
> > >
> > > you would also see either a line like this, if the clone session is
> > > configured for multicast:
> > >
> https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L565
> > >
> > > or if the clone session is configured for a single egress port, this
> line
> > > would be executed:
> > >
> https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch/simple_switch.cpp#L569
> > >
> > > How does one configure a clone/mirror session? It depends upon the
> > > control plane API you are using. If you are using simple_switch_CLI
> to do
> > > it manually, there are commands to do so documented here:
> > >
> https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md#mirroring_add-mirroring_add_mc-mirroring_delete-mirroring_get
> > >
> > > If you are using the P4Runtime API or Thrift API, they have their own
> > > message formats for doing so.
> > >
> > > Andy
> > >
> > > On Mon, Jan 4, 2021 at 11:56 PM Sahil Gupta <sg5414@rit.edu> wrote:
> > >
> > >> Hi all,
> > >>
> > >> I was trying to clone packets for some experiment.
> > >> I used the clone3 feature in ingress block and used the I2E clone
> type.
> > >> When I debugged the s1.log file, I found that packets are not getting
> > >> cloned.
> > >> I sent ICMP packets for testing.
> > >>
> > >> *Some Evidence*:
> > >> 1. standard_metadata.instance_type should be of value 5 but instead
> value
> > >> is 0.
> > >> There is no instance_type with value 5.
> > >> 2. Wireshark and tcpdump on mininet host network interfaces show no
> > >> duplicate packets.
> > >> 3. log_msg function printing content only once in egress block per
> packet.
> > >> Expected behavior is to get content printed twice per packet. First
> time
> > >> for original and next time for the cloned packet.
> > >>
> > >> How can I debug this issue?
> > >> Attaching the log file for reference.
> > >>
> > >> Thanks
> > >> Sahil Gupta
>
SG
Sahil Gupta
Thu, Jan 7, 2021 10:44 PM
I built my program on top of the Miss Carolina Fernández program.
It worked!
I will look into the original problem with my code as suggested by Andy
latter and report back to the community if I found something new.
Thanks for the help guys!
😊
Reference:
[1]
https://github.com/CarolinaFernandez/p4-tutorials/tree/master/exercises/clone
I built my program on top of the Miss Carolina Fernández program.
It worked!
I will look into the original problem with my code as suggested by Andy
latter and report back to the community if I found something new.
Thanks for the help guys!
😊
Reference:
[1]
https://github.com/CarolinaFernandez/p4-tutorials/tree/master/exercises/clone