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

Salvatore Signorello salvatore.signorello at uni.lu
Tue Apr 28 03:03:19 EDT 2015


Hi Antonin,

thanks for the prompt feedback, my answers in line

Best,
Salvatore
On Mon, 2015-04-27 at 14:30 -0700, Antonin Bas wrote:
> 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.
Yeap, I'd already checked ARP caches on both node and they were ok, but
because, as you said, those are statically filled by the 1sw_demo.py
> 
> 
> Do you want me to fix the bug you found, or do you want to submit a
> pull request on p4lang?
Please go ahead and fix it, I think this is more a typo than a bug ;)
> 
> 
> 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
> 






More information about the P4-dev mailing list