Python-ostinato script - automation

506 views
Skip to first unread message

Shruthi Reddy

unread,
May 26, 2017, 4:11:43 PM5/26/17
to osti...@googlegroups.com
Hi,

I downloaded, python-ostinato from this link: https://gumroad.com/l/ostpy08
Next i opened the Ostinato GUI, by typing in this command on my terminal : sudo /Applications/Ostinato.app/Contents/MacOS/Ostinato
Ostinato GUI opened up 
I created a stream - with four devices that im sending packets for.
I saved the stream as a python script

Next I ran the script from the python-ostinato folder that i had downloaded.

Problems im facing:

In the GUI of ostinato : I dont see any packet transfer happening. I have attached my code, screenshot of the ostinato GUI, also the terminal stats .

Pls kindly , help me in figuring out this, thanks.


example.py
Terminal Saved Output
Screen Shot 2017-05-26 at 1.05.54 PM.png

Srivats P

unread,
May 27, 2017, 3:36:40 AM5/27/17
to Shruthi Reddy, ostinato
Shruthi,

I see that the packet rate set is 0.0167 pps which translates to 1
packet per minute. Is that what you want? If so, are you waiting that
long to check the stats in the GUI? Can you run wireshark and capture
packets to double check if packets are indeed being sent out or not?

My advice is to first test what you want with the GUI - including
increment of stats etc. Only once you have that working as you want,
then export to Python script and try that.

Also please avoid posting the same email multiple times. I got 3
copies of your email - two on the mailing list and one addressed just
to me. It is always good form to post to the mailing list instead of
directly so that others may contribute to the discussion and the
information exchanged gets archived and searchable by google by others
having a similar problem.

Thanks,
Srivats

Srivats


Srivats
> --
> Get Ostinato News and Updates on Twitter - Follow @ostinato
> (http://twitter.com/ostinato)
> ---
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ostinato+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://ostinato.org/
@ostinato

Srivats P

unread,
May 28, 2017, 1:43:51 AM5/28/17
to Shruthi Reddy, ostinato
What does the "Transmit State" in the stats window show - "On" or "Off"?

Save your streams and attach it here so that I can take a look why the
"go to first" is not working.

Srivats



On Sat, May 27, 2017 at 2:04 PM, Shruthi Reddy <shruth...@google.com> wrote:
> Yes the packet rate is 0.0167 packets per sec. This happens in a loop where
> it goes to the next devices in a min. When it reaches the last device and
> has completely transferred each packet to the device , then it will go back
> to the first device and continue. I don't see this happening.
--
http://ostinato.org/
@ostinato

Shruthi Reddy

unread,
Jun 1, 2017, 8:00:24 PM6/1/17
to ostinato, shruth...@google.com
Hi,

I have attached my stream below for you , as well as the python script.Transmit state says on now. And i see packets transmitting but they are not waking up the devices that they are sending the packets to. 
automation_shruthi.py
MYSTREAM.ostm

Shruthi Reddy

unread,
Jun 1, 2017, 8:01:29 PM6/1/17
to ostinato, shruth...@google.com
Some times the transmit state is ON sometimes its OFF.

Srivats P

unread,
Jun 2, 2017, 11:31:26 AM6/2/17
to Shruthi Reddy, ostinato
Shruthi,

Let's focus on the GUI first. I opened your streams file (MYSTREAM.ostm) and ran it on my machine and I see 4 packets (one for each stream) sent every 1 min - this is exactly as configured and as expected. 

I see that you have configured TCP in all the streams. Please note that Ostinato is stateless, so it cannot establish a TCP "connection" with the end device(s). Also, I see that the source and destination IP are in different subnets, so maybe some devices between Ostinato and the destination devices are dropping the packets. These are some possible reasons why they not be "waking up the devices".

Regarding the Transmit being ON or OFF - this should match when you start or stop transmit. Since your configured packet rate is very low, I suggest you increase that to 1 or 10 pps and try again.

HTH,
Srivats

To unsubscribe from this group and stop receiving emails from it, send an email to ostinato+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Srivats P

unread,
Jun 3, 2017, 6:37:47 AM6/3/17
to Shruthi Reddy, ostinato
Are the Ostinato generated packets reaching the device(s)? How are you checking whether these are reaching or not?

What are these devices? Linux hosts? Switches? Routers?

And what do you mean by "waking up the device"? Why should the generated packet wake up the device?

You will need to provide more info for us to be able to help you.

Srivats



On Fri, Jun 2, 2017 at 11:47 PM, Shruthi Reddy <shruth...@google.com> wrote:
Hi ,

I just made sure the devices and the ostinato running machine are both on the same network as well . But still I don't see them waking up the device . 

Shruthi Reddy

unread,
Jun 7, 2017, 1:06:09 PM6/7/17
to ostinato, shruth...@google.com
Hey, I have created the streams and saved them as python script, now i started the drone, ostinato GUI opens up, next i run the script that i have saved in another terminal, should i load the streams before i run the script ? Also it asking me the Tx port number and Rx port number when i start the script, is that the port number that i configure , which is under TCP as "Override source and destination ports " -(source port - 9543 , destination port -1234) ?

Pls let me know if i have to just run the script or even load the streams as well before running the script.

Srivats P

unread,
Jun 7, 2017, 1:12:41 PM6/7/17
to Shruthi Reddy, ostinato
Shruthi,

Have you ever started reading a novel and midway through it suddenly discover that a few pages are missing and you find it difficult to connect the story from the section post the missing pages?

That's how I'm feeling right now :-)

You did not reply to the questions in my previous email. Are you able to generate all the desired packets using the GUI? Only when you are able to do that, should you proceed with the Python API - otherwise you will confuse yourself and confuse me as well.

Srivats

To unsubscribe from this group and stop receiving emails from it, send an email to ostinato+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Srivats P

unread,
Jun 7, 2017, 1:28:13 PM6/7/17
to Shruthi Reddy, ostinato
On Wed, Jun 7, 2017 at 10:48 PM, Shruthi Reddy <shruth...@google.com> wrote:
Im so sorry i guess i would have skipped your msg. yes i am able to generate all the packets using the GUI. I have tried that that works good only then i tried to save it as a python script, and then the problem arises.

Thank you for the confirmation.

On Wed, Jun 7, 2017 at 10:36 PM, 'Shruthi Reddy' via ostinato <osti...@googlegroups.com> wrote:
Hey, I have created the streams and saved them as python script, now i started the drone, ostinato GUI opens up, next i run the script that i have saved in another terminal, should i load the streams before i run the script ?

After you have saved the python script, close the GUI. You don't need it any longer. Run drone in one terminal. From another terminal run the python script. Again - don't run the GUI when running the Python script.
 
Also it asking me the Tx port number and Rx port number when i start the script, is that the port number that i configure , which is under TCP as "Override source and destination ports " -(source port - 9543 , destination port -1234) ?

It will ask for Drone's hostname/IP and Tx Port Number. Not the Rx Port number. The Tx port number here is the port number or interface from which you want to send the packets. i.e. it is the same number that you selected in the GUI when configuring the streams.

At the top of the generated script you'll find these lines -
# initialize the below variables appropriately to avoid manual input
host_name = ''
tx_port_number = -1

If you modify these lines to set the host_name and tx_port_number, it will not prompt you for the same.
 

Pls let me know if i have to just run the script or even load the streams as well before running the script.

No, you don't need to load the streams - as I said above you don't need the GUI anymore after saving the python script.

Srivats 

Shruthi Reddy

unread,
Jun 7, 2017, 2:34:38 PM6/7/17
to ostinato, shruth...@google.com
Hi,

Awesome it worked. But im facing another problem:

 I have 5 streams configured. I had made sure when it reaches the last stream , i have enabled " GO TO First " when i saved the stream in the GUI, but still its not going to the first device nor its waking the last device. Do u mind taking a look at it pls. I have attached the python script that i saved from the Ostinato stream configured.

Thanks
example.py

Srivats P

unread,
Jun 8, 2017, 11:31:20 AM6/8/17
to Shruthi Reddy, ostinato
I don't see any problem with the script, so I tried it on my machine and it is working correctly. It sends 5 packets then waits for 1min and then resends the same 5 packets in a loop waiting for 1 min between each loop iteration.

Are you not waiting long enough to see the repeat? 

Srivats

--
Get Ostinato News and Updates on Twitter - Follow @ostinato (http://twitter.com/ostinato)
---
You received this message because you are subscribed to the Google Groups "ostinato" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ostinato+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages