[P4-dev] simple router example - adding entries to the source_mac_rewrite table

Antonin Bas antonin at barefootnetworks.com
Mon Apr 27 17:30:07 EDT 2015


Hi Salvatore,

You are correct. The second command should be:
python ../../cli/pd_cli.py -p simple_router -i pd_thrift.simple_router -s
$PWD/of-tests:$PWD/../../submodules/oft-infra -m "add_entry send_frame *2*
rewrite_mac 00:aa:bb:00:00:01" -c localhost:22222

This means that the source mac address is wrong on some of the packets
forwarded by the router. This does not prevent the demo from working, even
though some packets are not correct. I expect the end host (h2) doesn't
really care about this wrong address. Note that the simple router does not
support ARP packets and that the switch mac addresses are added to the
hosts' ARP cache by the mininet script.

Do you want me to fix the bug you found, or do you want to submit a pull
request on p4lang?

Thanks,

Antonin

On Mon, Apr 27, 2015 at 2:07 PM, Salvatore Signorello <
salvatore.signorello at uni.lu> wrote:

>  Hi all,
>
> I've run smoothly the Mininet integration demo for the target "simple
> router" provided with the p4factory software-bundle, but I need some help
> to understand the run_add_demo_entries.sh script's content. Especially I
> care about the first two lines used to fill the "send_frame" table:
>
> python ../../cli/pd_cli.py -p simple_router -i pd_thrift.simple_router -s
> $PWD/of-tests:$PWD/../../submodules/oft-infra -m "add_entry send_frame *1*
> rewrite_mac 00:aa:bb:00:00:00" -c localhost:22222
> python ../../cli/pd_cli.py -p simple_router -i pd_thrift.simple_router -s
> $PWD/of-tests:$PWD/../../submodules/oft-infra -m "add_entry send_frame *1*
> rewrite_mac 00:aa:bb:00:00:01" -c localhost:22222
>
> where the add_entry command seems to fill twice the same entry but with
> two different MAC addresses. As regards the "add_entry", I'm referring to
> the syntax found into the p4factory/cli/pd_cli.py that follows:
>
> <<
> def do_add_entry(self, line):
>     """
>     add_entry TABLE_NAME MATCH_FIELDS... ACTION_NAME ACTION_PARAMETERS...
>     Adds an entry with the specified MATCH_FIELDS, ACTION_NAME and
>     ACTION_PARAMETERS to TABLE_NAME. Prints the entry handle of the newly
> added
>     entry.
>     """
> >>
>
> Should not the egress port be different for those entries? How does it
> work the rewriting using the so-defined entries?
>
> Thank you in advance for any hint,
> Best,
> Salvatore
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at p4.org
> http://p4.org/mailman/listinfo/p4-dev_p4.org
>
>


-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20150427/e03d9183/attachment-0001.html>


More information about the P4-dev mailing list