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

Vladimir Gurevich vladimir.gurevich at barefootnetworks.com
Thu Aug 10 16:18:02 EDT 2017


Hello Aldo,

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
sswitch_CLI).

If you want to run multiple instances of simple_switch on the same host,
then you can use different port numbers for Thrift.

Thanks,
Vladimir

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?
>
> Thanks!
> Aldo
>
>
> Below is what I got:
>
> #./simple_switch --version
> 1.8.0-3bc9a4bc
>
> #./simple_switch --json-version
> 2.12
>
> # ./simple_switch --thrift-ip
> Error while parsing command line arguments
>
>
> Usage: SWITCH_NAME [options] <path to JSON config file>
> Options:
>   -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
> X_out.pcap).
>                            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
> server
>   --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
> (default:
>                            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
> is
>                            'trace'
>   --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
> notifications
>                            (e.g. learning, ageing, ...); default is
>                            ipc:///tmp/bmv2-<device-id>-notifications.ipc
>   --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
>                            ipc:///tmp/bmv2-<device-id>-debug.ipc
>   --restore-state arg      Restore state from file
>   --dump-packet-data arg   Specify how many bytes of packet data to dump
> upon
>                            receiving & sending a packet. We use the logger
> to
>                            dump the packet data, with log level 'info', so
> make
>                            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
> with
>                            the same <major> version number are also
> supported.
>   --no-p4                  Enable the switch to start without an inout
>                            configuration
> 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,
>> 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:
>>> 10.10.10.1:9090
>>> 10.10.20.1:9090
>>> 10.10.30.1:9090
>>>
>>> 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
>>
>>
>


-- 
*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/d7138eb2/attachment-0002.html>


More information about the P4-dev mailing list