[P4-dev] Assigning an IP address for mininet/P4Switch() class

Aldo Febro af12abw at gmail.com
Thu Aug 10 14:12:31 EDT 2017

Thanks Vladimir for your reply.

When I tried to launch simple_switch, it does not accept --thrift-ip as
parameter (however it can accept --thrift-port parameter). Are you using
simple_switch version that can handle --thrift-ip as a parameter?


Below is what I got:

#./simple_switch --version

#./simple_switch --json-version

# ./simple_switch --thrift-ip
Error while parsing command line arguments

Usage: SWITCH_NAME [options] <path to JSON config file>
  -h [ --help ]            Display this help message
  -i [ --interface ] arg   <port-num>@<interface-name>: Attach network
                           interface <interface-name> as port <port-num> at
                           startup. Can appear multiple times
  --pcap                   Generate pcap files for interfaces
  --use-files arg          Read/write packets from files (interface X
                           corresponds to two files X_in.pcap and
                           Argument is the time to wait (in seconds) before
                           starting to process the packet files.
  --packet-in arg          Enable receiving packet on this (nanomsg) socket.
                           The --interface options will be ignored.
  --thrift-port arg        TCP port on which to run the Thrift runtime
  --device-id arg          Device ID, used to identify the device in IPC
                           messages (default 0)
  --nanolog arg            IPC socket to use for nanomsg pub/sub logs
                           no nanomsg logging
  --log-console            Enable logging on stdout
  --log-file arg           Enable logging to given file
  -L [ --log-level ] arg   Set log level, supported values are 'trace',
                           'debug', 'info', 'warn', 'error', off'; default
  --log-flush              If used with '--log-file', the logger will flush
                           disk after every log message
  --notifications-addr arg Specify the nanomsg address to use for
                           (e.g. learning, ageing, ...); default is
  --debugger               Activate debugger
  --debugger-addr arg      Specify the nanomsg address to use for debugger
                           communication; there is no need to use
--debugger in
                           addition to this option; default is
  --restore-state arg      Restore state from file
  --dump-packet-data arg   Specify how many bytes of packet data to dump
                           receiving & sending a packet. We use the logger
                           dump the packet data, with log level 'info', so
                           sure the log level you have set does not exclude
                           'info' messages; default is 0, which means that
                           nothing is logged.
  -v [ --version ]         Display version information
  --json-version           Display max bmv2 JSON version supported in the
                           format <major>.<minor>; all bmv2 JSON versions
                           the same <major> version number are also
  --no-p4                  Enable the switch to start without an inout
Your target comes with its own command line parser, make sure you separate
general bmv2 options from, target specific options with '--'

On Wed, Aug 9, 2017 at 7:52 PM, Vladimir Gurevich <
vladimir.gurevich at barefootnetworks.com> wrote:

> Hello Aldo,
> runtime_CLI.py (actually you should probably use sswitch_CLI.py if you use
> simple_switch) accepts --thrift-ip and --thrift-port parameters that allow
> you to specify the IP address and TCP port number correspondingly.
> Please, note that you will need to start 3 separate instances of
> sswitch_CLI.py, since one instance can control a single device only.
> Happy hacking,
> Vladimir
> On Wed, Aug 9, 2017 at 7:42 PM, Aldo Febro <af12abw at gmail.com> wrote:
>> Hi all,
>> From runtime_CLI.py, I'd like to connect to a P4Switch with
>> IP_address:port (instead of localhost:port) to simulate a control-plane
>> session to multiple remote P4 switches.
>> For example, instead of connecting to
>> localhost:9090
>> localhost:9091
>> localhost:9092
>> I'd like to connect to:
>> Can I assign an IP address to a P4Switch() class when I
>> instantiate/launch simple_switch?
>> Has anyone tried this? Any help would be appreciated. Thanks!
>> Aldo
>> _______________________________________________
>> P4-dev mailing list
>> P4-dev at lists.p4.org
>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
> --
> *Vladimir Gurevich*
> *Barefoot Networks*
> *Technical Lead, Customer Engineering*
> Email: vag at barefootnetworks.com
> Phone: (408) 833-4505
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170810/22029e96/attachment-0002.html>

More information about the P4-dev mailing list