I suggest that you use your SSH tunnel manually: send clear packets with some 
ID in them (packet
number, whatever you prefer)
and make sure that you get them all on the other end of the tunnel, without 
major delay. Normally
this should work,
but if it does not, and if you're able to create a working prototype that shows 
the bug, I can take
a look at libretroshare to find the problem for you.

Otherwise, because problems occur mainly when X is used, it might be that X 
expects some particular
params of the SSH connection (which you get probably when doing "ssh -X or ssh 
-Y" but not using
your own tunnel system). It's probably worth looking into this.

On 28/07/2016 10:04, jeetu.gol...@gmail.com wrote:
> Hello Cyril,
>
> To report back, I tried out the latest RS master codebase from github
> with my plugin as per your suggestion. Unfortunately the issue is
> still the same.
>
> While I said earlier most of the times (say 90%) the failure occurs
> when there are many small bytes of approx 172 bytes following by
> something like 7556 bytes or some such number (usually above 3000
> bytes).
>
> However, there are instances when the freeze-up occurs with a
> relatively short number of bytes....maybe as low as 60 or 70 bytes. So
> when I tried running gedit, during startup itself, the ssh client end
> froze. While most of the time I will get the main interface window to
> the X client and it freezes somewhere along the line, there are also
> moments such as these when it just hands early on itself.
>
> I also tried to log in to just a SSH console session via the RS tunnel
> plugin and did a "du" on my root directory just to generate a lot of
> text traffic in the form of file names scrolling as du goes through my
> directory. This worked fine and didn't baulk. However this situation
> is a little different from a SSH X forward since here there is only
> unidrectional traffic (from ssh server to ssh client). Whereas with a
> SSH forward there is a lot of bi-directional traffic. Dunno if that
> helps, just trying to get as many clues as possible,
>
> I am also not using any message queue or buffer within my own code, so
> as information comes in from ssh client or server I push it down the
> pipe via sendItem. Not sure if somehow the information coming in from
> these ends is going out of sync and causing a freeze-up.
>
> Your suggestion of this being related to the bug you had closed
> wherein the SSL stream would lock up on occasion waiting for another
> packed, definitely seemed to fit the profile of the above behaviour.
>
> Is there some other way we can capture additional data from within RS
> that would help you confirm or rule out if this problem still persists
> or that would help us concretely ascertain if my code is messing up
> things or not?
>
> Since the SSH traffic is all encrypted, I am unable to verify if the
> data itself gets corrupted somewhere along the line. Though if that
> were to happen the SSH client / server should cut off connection with
> a bad MAC / bad HMAC / Bad Packet Length or some such message if I
> understand it correctly. Though to rule this out I am considering
> building a python client and server that will try to push through
> controlled data to and fro this pipe, and try to replicate this
> freeze....hopefully something there will then be able to clarify if
> data corruption is occurring and is the problem.
>
> As you can say I am fast approaching a state where I am desperate for
> ideas ;).....any help or suggestion would help my sanity to a great
> deal :)
>
> Thank you so much for your time and help :)
>
> Bye for now.
>
>
>
> On Mon, Jul 25, 2016 at 11:46 PM, jeetu.gol...@gmail.com
> <jeetu.gol...@gmail.com> wrote:
>> Hi Cyril,
>>
>> Thank you so much for taking the time to reply :)
>>
>>> This does not seem like a crazy amount of traffic either. I'm not sure 
>>> which >version of RS you're
>> I've been working with RS v0.6.0
>>
>>> using, but a few weeks ago, I fixed a bug that would cause SSL packets to 
>>> >hang in the pipeline until
>>> a new packet arrives. This could be the reason as your X server is maybe 
>>> >waiting for the stream to
>>> reach a given point before continuing.
>> Oh wow :) so there is hope :).....I shall download the latest master
>> of RS and try again with that....will keep you posted on the progress
>> I make :)
>>
>>> As I understand, you developed a RS service that streams SSL connection 
>>> >binary items through RS
>>> friend connections?
>>> You're most probably using RsItem objects then. Their size is limited to 
>>> >262144 bytes. Any packet
>>> larger gets dropped.
>> Yes I have been using RsItem objects...and this explains so much
>> :).....is there some other class object I should use wherein this
>> limit is not there / or more relaxed? Though at this moment this isn't
>> a problem for me since I chunk the data and then send it. However it
>> would be good to know what my options here are :)
>>
>>
>> This definitely has given me quite a bit of clarity and hope.....I
>> shall try with the latest code and well fingers crossed :)....will
>> report back asap.
>>
>> Thank you.
>>
>> Bye for now
>>
>>
>> On Mon, Jul 25, 2016 at 7:51 PM, Cyril Soler
>> <cso...@users.sourceforge.net> wrote:
>>> Hi!
>>>
>>> Congrats for your project!
>>> It's nice to see that you managed to develop a plugin! See below some 
>>> possible answers to your problem:
>>>
>>> On 25/07/2016 08:09, jeetu.gol...@gmail.com wrote:
>>>> Hi everyone,
>>>>
>>>> First, let me thank all of you for giving us Retroshare. Works
>>>> beautifully :) Thanks.
>>>>
>>>> I am one of the developers of the open source project eBrainPool
>>>> (http://ebrain.in) and for this project I have been toying with a RS
>>>> plugin that will allow me to tunnel SSH traffic between RS users. The
>>>> idea is to SSH forward X clients tunneled via RS.
>>>>
>>>> I have extended the EmtyPluginRS and taken inspiration from the VOIP
>>>> plugin to extend Retroshare 0.6.0.
>>>>
>>>> I have managed to successfully create a tunnel between two end points
>>>> - it's a very dirty hack - but I can essentially do a ssh login and
>>>> work within a console session without any problem. SSH forwarding of
>>>> simpler X clients such as xclock, xcalc,etc work without any issues
>>>> either.
>>>>
>>>> With more sophisticated X clients such as gnome-calculator, gedit,etc
>>>> somewhere along as I use it, my ssh client with the entire X
>>>> environment freezes up. This usually happens when huge amounts of data
>>>> need to be sent together by the SSH client. For e.g. if a button is
>>>> pressed in gnome-calculator then at times it is liable to freeze up.
>>>>
>>>> On further investigation I have realized that the button press
>>>> translates to a huge number of messages coming in from the SSH client
>>>> of 170 bytes or so and a final message of approx 3556 bytes or so
>>>> before things freeze up. I then have to kill my ssh client in console
>>>> to regain access to my X environment.
>>> This does not seem like a crazy amount of traffic either. I'm not sure 
>>> which version of RS you're
>>> using, but a few weeks ago, I fixed a bug that would cause SSL packets to 
>>> hang in the pipeline until
>>> a new packet arrives. This could be the reason as your X server is maybe 
>>> waiting for the stream to
>>> reach a given point before continuing.
>>>> I have tried both approaches in my plugin - with a separate thread to
>>>> accept input to / from the client, and also without a separate thread.
>>>> The issue and point of failure is the same.
>>>>
>>>> Granted I definitely do not understand the RS architecture well enough
>>>> and I fear that it is this lack of understanding that is causing this
>>>> problem.
>>>>
>>>> I am not using any sort of message queue and as data is being received
>>>> from the client or server I am simply pushing it down the pipe (via
>>>> sendItem).
>>>>
>>>> I have noticed that extremely large blocks of data (say 100k or such)
>>>> simply disappear and are not received at the other end. Therefore I
>>>> chunk data from ssh server or client into blocks of 16384. I have
>>>> tried different block sizes but it doesn't help the bug I have above.
>>> As I understand, you developed a RS service that streams SSL connection 
>>> binary items through RS
>>> friend connections?
>>> You're most probably using RsItem objects then. Their size is limited to 
>>> 262144 bytes. Any packet
>>> larger gets dropped.
>>> I don't know about the released version, but the current trunk displays 
>>> some information about that
>>> when it happens.
>>>
>>>


------------------------------------------------------------------------------
_______________________________________________
Retroshare-devel mailing list
Retroshare-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/retroshare-devel

Reply via email to