[P4-dev] Assigning an IP address for mininet/P4Switch() class
vladimir.gurevich at barefootnetworks.com
Thu Aug 10 16:18:02 EDT 2017
I think that the Thrift server in simple_switch binds to all addresses on a
given host. I assumed that when you were asking your plan was to run
separate simple_switch instances in different (virtual) hosts and then
simply control them from a single place (using separate instances of
If you want to run multiple instances of simple_switch on the same host,
then you can use different port numbers for Thrift.
On Thu, Aug 10, 2017 at 11:12 AM, Aldo Febro <af12abw at gmail.com> wrote:
> 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)
> 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 to
> 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@
> 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,
>> 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
>>> 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!
>>> P4-dev mailing list
>>> P4-dev at lists.p4.org
>> *Vladimir Gurevich*
>> *Barefoot Networks*
>> *Technical Lead, Customer Engineering*
>> Email: vag at barefootnetworks.com
>> Phone: (408) 833-4505
*Technical Lead, Customer Engineering*
Email: vag at barefootnetworks.com
Phone: (408) 833-4505
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev