ioppytest-agent


Nameioppytest-agent JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://gitlab.f-interop.eu/f-interop-contributors/agent
SummaryComponent for setting up user's environment for the tests
upload_time2018-04-16 13:26:00
maintainer
docs_urlNone
authorFederico Sismondi
requires_python
licenseGPLv3+
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Agent for the f-interop platform (ioppytest-agent)
--------------------------------------------------

About
-----
Agent (~VPN client) is a component which connects the environment where
the IUT runs to testing tool using the AMQP bus.
This component is part of the ioppytest framework ecosystem.
This components needs to run in the user's host and must share some
kind on interface with the implementation under test (IUT), it will
enable the creation of a private network between all devices in the
session.


Installation
------------

create virtual env for not messing up your current environment
```
pip install virtualenv
virtualenv -p /usr/bin/python2.7 my_venv
source my_venv/bin/activate
```

install ioppytest-agent using pip
```
pip install ioppytest-agent
```

Design
------
An agent is made of different processes that connect to AMQP message
broker and exchange messages (in and out) with other components using
the same AMQP broker.

Note well
----
Agent is only supported by python2 -> tun librarires py2 only

Core
----
When started, the agent starts up the core module. This component is in
charge of launching all the other components.
If new components needs to be added they just need to be launched
from this component.

Error handling
--------------
When there is a user interrupt signal (Ctrl-C) the agent should kill
all other components and disconnect as gracefully as possible.


Serial mode (with 802.15.4 probe)
---------------------------------
The following diagram describes how the agent the interfaces and
interactions using serial mode (--serial option)

TODO:
add link to source code for probe

**IMPORTANT**:
This mode of functioning assumes the following IEEE802.15.4 settings:

1. Channel, modulation, data-rate (Channels 11-26 at 2.4 GHz).
2. MAC mode is beaconless.
3. Security is off


# Agent combined with active-probe
----------------------------------
This mode can be used for connecting two remote (geographically distant)
802.15.4 based devices.

Active mode probe automatically ACKs messages received by the user
device, the 802.15.4 are not forwarded to the AMQP connection.

## Running the agent
export AMQP connection variables, and USB params for the serial connection

env vars:
`
export AMQP_EXCHANGE='amq.topic'
export AMQP_URL="amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX"
`

check usb port, with for example with `ls /dev/tty*`

`
export FINTEROP_CONNECTOR_SERIAL_PORT=/dev/tty.XXX
export FINTEROP_CONNECTOR_BAUDRATE=115200
`

then execute (e.g. for a coap_server running under the agent):
`
python -m agent connect  --url $AMQP_URL --name coap_server --serial
`

```

                           +----------------+
                           |                |
                           |   AMQP broker  |
                           |                |
                           |                |
                           +----------------+


                                 ^     +
                                 |     |
data.serial.fromAgent.agent_name |     | data.serial.toAgent.agent_name
                                 |     |
                                 +     v

                           +----------------+
                           |                |
                           |                |
                           |     Agent      |
                           | (serial mode)  |
                           |                |
                           |                |
                           +-------+--------+
                                   | USB interface
                                   | (SLIP protocol)
                           +-------+--------+                        +---------------+
                           |                |     802.15.4 frame     |               |
                           |                |  <-----------------+   |   802.15.4    |
                           |    probe mote  |                        |     user      |
                           |  (active mode) |  +----------------->   |    device     |
                           |                |                        |               |
                           |                |                        |               |
                           +----------------+                        +---------------+
```



# Agent combined with passive-probe
-----------------------------------
This mode can be used for forwarding all sniffed packet in a 802.15.4 network to AMQP broker
and eventually other tools listening to the correct routing keys/topics.

## Running the agent
**TBD**

```

                        +----------------+
                        |                |
                        |   AMQP broker  |
                        |                |
                        |                |
                        +----------------+

                                 ^
                                 |
data.serial.fromAgent.agent_name |
                                 |
                                 +

                         +----------------+
                         |                |
                         |                |
                         |     Agent      |
                         | (serial mode)  |
                         |                |
                         |                |
                         +-------+--------+
                                 | USB interface
                                 | (SLIP protocol)
                         +-------+--------+
                         |                |
                         |                |
                         |    probe mote  |
                         |  (passive mode)|
                         |                |
                         |                |
                         +-------+--------+
                                 |
                                 |
                                 |
                                 |
+---------------+                |              +---------------+
|               |                |              |               |
|   802.15.4    |       <--------+--------+     |   802.15.4    |
|     user      |         802.15.4 frames       |     user      |
|    device     |       +----------------->     |    device     |
|               |                               |               |
|               |                               |               |
+---------------+                               +---------------+

```



IP tunneling mode (active-probe)
--------------------------------
This mode can be used for communicating two IPv6-based implementations
tunneling all traffic through AMQP messages.

## Running the agent
For running the agent you will need privileges on the machine, basically
cause we need to open a virtual interface to tunnel the packets.

The command for executing it will be provided to you by the
GUI or AMQP broker sys admin, it should look something like this:

```
sudo python -m agent connect  --url amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX --name coap_client
```

for more info
```
python agent.py --help
python agent.py connect --help
```



```
                          +----------------+
                          |                |
                          |   AMQP broker  |
                          |                |
                          |                |
                          +----------------+


                                ^     +
                                |     |
data.tun.fromAgent.agent_name   |     |  data.tun.toAgent.agent_name
                                |     |
                                +     v

                 +---------------------------------+
                 |                                 |
                 |               Agent             |
                 |                                 |
                 |             (tun mode)          |
                 |                                 |
                 |                                 |
                 |   +------tun interface--------+ |
                 |                                 |
                 |  +----------------------------+ |
                 |  |         IPv6-based         | |
                 |  |        communicating       | |
                 |  |      piece of software     | |
                 |  |      (e.g. coap client)    | |
                 |  |                            | |
                 |  +----------------------------+ |
                 +---------------------------------+

```
            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "", 
    "upload_time": "2018-04-16 13:26:00", 
    "author": "Federico Sismondi", 
    "home_page": "https://gitlab.f-interop.eu/f-interop-contributors/agent", 
    "download_url": "https://pypi.python.org/packages/8a/cc/1fd85fa30b3dd30eb90c0714b76448c9a20d59bc0b57954e79cd0d0aa9f8/ioppytest-agent-0.1.7.tar.gz", 
    "platform": "", 
    "version": "0.1.7", 
    "cheesecake_documentation_id": null, 
    "description": "Agent for the f-interop platform (ioppytest-agent)\n--------------------------------------------------\n\nAbout\n-----\nAgent (~VPN client) is a component which connects the environment where\nthe IUT runs to testing tool using the AMQP bus.\nThis component is part of the ioppytest framework ecosystem.\nThis components needs to run in the user's host and must share some\nkind on interface with the implementation under test (IUT), it will\nenable the creation of a private network between all devices in the\nsession.\n\n\nInstallation\n------------\n\ncreate virtual env for not messing up your current environment\n```\npip install virtualenv\nvirtualenv -p /usr/bin/python2.7 my_venv\nsource my_venv/bin/activate\n```\n\ninstall ioppytest-agent using pip\n```\npip install ioppytest-agent\n```\n\nDesign\n------\nAn agent is made of different processes that connect to AMQP message\nbroker and exchange messages (in and out) with other components using\nthe same AMQP broker.\n\nNote well\n----\nAgent is only supported by python2 -> tun librarires py2 only\n\nCore\n----\nWhen started, the agent starts up the core module. This component is in\ncharge of launching all the other components.\nIf new components needs to be added they just need to be launched\nfrom this component.\n\nError handling\n--------------\nWhen there is a user interrupt signal (Ctrl-C) the agent should kill\nall other components and disconnect as gracefully as possible.\n\n\nSerial mode (with 802.15.4 probe)\n---------------------------------\nThe following diagram describes how the agent the interfaces and\ninteractions using serial mode (--serial option)\n\nTODO:\nadd link to source code for probe\n\n**IMPORTANT**:\nThis mode of functioning assumes the following IEEE802.15.4 settings:\n\n1. Channel, modulation, data-rate (Channels 11-26 at 2.4 GHz).\n2. MAC mode is beaconless.\n3. Security is off\n\n\n# Agent combined with active-probe\n----------------------------------\nThis mode can be used for connecting two remote (geographically distant)\n802.15.4 based devices.\n\nActive mode probe automatically ACKs messages received by the user\ndevice, the 802.15.4 are not forwarded to the AMQP connection.\n\n## Running the agent\nexport AMQP connection variables, and USB params for the serial connection\n\nenv vars:\n`\nexport AMQP_EXCHANGE='amq.topic'\nexport AMQP_URL=\"amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX\"\n`\n\ncheck usb port, with for example with `ls /dev/tty*`\n\n`\nexport FINTEROP_CONNECTOR_SERIAL_PORT=/dev/tty.XXX\nexport FINTEROP_CONNECTOR_BAUDRATE=115200\n`\n\nthen execute (e.g. for a coap_server running under the agent):\n`\npython -m agent connect  --url $AMQP_URL --name coap_server --serial\n`\n\n```\n\n                           +----------------+\n                           |                |\n                           |   AMQP broker  |\n                           |                |\n                           |                |\n                           +----------------+\n\n\n                                 ^     +\n                                 |     |\ndata.serial.fromAgent.agent_name |     | data.serial.toAgent.agent_name\n                                 |     |\n                                 +     v\n\n                           +----------------+\n                           |                |\n                           |                |\n                           |     Agent      |\n                           | (serial mode)  |\n                           |                |\n                           |                |\n                           +-------+--------+\n                                   | USB interface\n                                   | (SLIP protocol)\n                           +-------+--------+                        +---------------+\n                           |                |     802.15.4 frame     |               |\n                           |                |  <-----------------+   |   802.15.4    |\n                           |    probe mote  |                        |     user      |\n                           |  (active mode) |  +----------------->   |    device     |\n                           |                |                        |               |\n                           |                |                        |               |\n                           +----------------+                        +---------------+\n```\n\n\n\n# Agent combined with passive-probe\n-----------------------------------\nThis mode can be used for forwarding all sniffed packet in a 802.15.4 network to AMQP broker\nand eventually other tools listening to the correct routing keys/topics.\n\n## Running the agent\n**TBD**\n\n```\n\n                        +----------------+\n                        |                |\n                        |   AMQP broker  |\n                        |                |\n                        |                |\n                        +----------------+\n\n                                 ^\n                                 |\ndata.serial.fromAgent.agent_name |\n                                 |\n                                 +\n\n                         +----------------+\n                         |                |\n                         |                |\n                         |     Agent      |\n                         | (serial mode)  |\n                         |                |\n                         |                |\n                         +-------+--------+\n                                 | USB interface\n                                 | (SLIP protocol)\n                         +-------+--------+\n                         |                |\n                         |                |\n                         |    probe mote  |\n                         |  (passive mode)|\n                         |                |\n                         |                |\n                         +-------+--------+\n                                 |\n                                 |\n                                 |\n                                 |\n+---------------+                |              +---------------+\n|               |                |              |               |\n|   802.15.4    |       <--------+--------+     |   802.15.4    |\n|     user      |         802.15.4 frames       |     user      |\n|    device     |       +----------------->     |    device     |\n|               |                               |               |\n|               |                               |               |\n+---------------+                               +---------------+\n\n```\n\n\n\nIP tunneling mode (active-probe)\n--------------------------------\nThis mode can be used for communicating two IPv6-based implementations\ntunneling all traffic through AMQP messages.\n\n## Running the agent\nFor running the agent you will need privileges on the machine, basically\ncause we need to open a virtual interface to tunnel the packets.\n\nThe command for executing it will be provided to you by the\nGUI or AMQP broker sys admin, it should look something like this:\n\n```\nsudo python -m agent connect  --url amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX --name coap_client\n```\n\nfor more info\n```\npython agent.py --help\npython agent.py connect --help\n```\n\n\n\n```\n                          +----------------+\n                          |                |\n                          |   AMQP broker  |\n                          |                |\n                          |                |\n                          +----------------+\n\n\n                                ^     +\n                                |     |\ndata.tun.fromAgent.agent_name   |     |  data.tun.toAgent.agent_name\n                                |     |\n                                +     v\n\n                 +---------------------------------+\n                 |                                 |\n                 |               Agent             |\n                 |                                 |\n                 |             (tun mode)          |\n                 |                                 |\n                 |                                 |\n                 |   +------tun interface--------+ |\n                 |                                 |\n                 |  +----------------------------+ |\n                 |  |         IPv6-based         | |\n                 |  |        communicating       | |\n                 |  |      piece of software     | |\n                 |  |      (e.g. coap client)    | |\n                 |  |                            | |\n                 |  +----------------------------+ |\n                 +---------------------------------+\n\n```", 
    "lcname": "ioppytest-agent", 
    "bugtrack_url": null, 
    "github": false, 
    "name": "ioppytest-agent", 
    "license": "GPLv3+", 
    "summary": "Component for setting up user's environment for the tests", 
    "split_keywords": [], 
    "author_email": "federicosismondi@gmail.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2018-04-16T13:26:00", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/8a/cc/1fd85fa30b3dd30eb90c0714b76448c9a20d59bc0b57954e79cd0d0aa9f8/ioppytest-agent-0.1.7.tar.gz", 
            "md5_digest": "ce9f266cbff25549d34a65c3b37c1a25", 
            "downloads": 0, 
            "filename": "ioppytest-agent-0.1.7.tar.gz", 
            "packagetype": "sdist", 
            "path": "8a/cc/1fd85fa30b3dd30eb90c0714b76448c9a20d59bc0b57954e79cd0d0aa9f8/ioppytest-agent-0.1.7.tar.gz", 
            "digests": {
                "sha256": "34fe8fd0a636f2784639fbe33f7bb796fded2f27b12c8f09091150cf9bd7e4c4", 
                "md5": "ce9f266cbff25549d34a65c3b37c1a25"
            }, 
            "sha256_digest": "34fe8fd0a636f2784639fbe33f7bb796fded2f27b12c8f09091150cf9bd7e4c4", 
            "size": 43162
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}