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

Salvatore Signorello salvatore.signorello at uni.lu
Mon Apr 27 17:07:50 EDT 2015


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20150427/9313212e/attachment-0001.html>


More information about the P4-dev mailing list