[Twisted-Python] ugh open-ssl and twisted python

Hello, This problem has been driving me crazy for a couple of days. I'm hoping someone can shed some light on this. I have a twisted server its using open-ssl (using certificates) and runs on linux and communicates great with a windows client thats send messages every second. However when I send data back to the client "sometimes" it doesnt receive the packet and there is no indication of failure at the client whats more I dont see any failure on the twisted server end. Is there any way I can tell what could cause this failure? It just look like the transport.write(data) fails just dont know why it would when receiving works like a charm. Any help on this would relieve the pain I'm feeling right now. Much Appreciated, Gazza

Hi Gary, On Sat, Jul 27, 2013 at 6:08 PM, gary clark <burslem2001@yahoo.com> wrote:
When you say "packet", does that mean "actual IP packet that you observed leaving the server", or do you mean "the thing I passed to transport.write"?
So, it fails silently? Keep in mind that transport.write working doesn't necessarily mean that anything on the other end has successfully read it: that's why good RPC mechanisms like AMP have positive acknowedgement :)
Any help on this would relieve the pain I'm feeling right now.
How are these two servers connected? Can you reliably reproduce the problem? Does it persist with other transports? Could you shed some more light on what you mean by "sometimes"? cheers lvh

Guys, Its the MTU size. Anything bigger than 1500 bytes is getting fragmented. Using wireshark I'm seeing TCP Previous segment lost anything bigger than 1500. However once that happens things go south and remain there. Oh boy one day I will learn but not today. Cheers, Gazza From: "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:27 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python On 04:08 pm, burslem2001@yahoo.com wrote:
Please see http://sscce.org/ Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Ok split my data up into smaller fragments. It still look like its reassembing the whole payload before sending it to the client. I'm calling transport.write(partdata) multiple times with a 0.5 second delay running in a twisted thread. How can I force the write to happen straight away in twisted. Sorry for all the questions. Thanks, Gazza From: gary clark <burslem2001@yahoo.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:36 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python Guys, Its the MTU size. Anything bigger than 1500 bytes is getting fragmented. Using wireshark I'm seeing TCP Previous segment lost anything bigger than 1500. However once that happens things go south and remain there. Oh boy one day I will learn but not today. Cheers, Gazza From: "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:27 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python On 04:08 pm, burslem2001@yahoo.com wrote:
Please see http://sscce.org/ Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Ok finally fixed the damn thing. I made the packets smaller and created a task in the .tac file to call a routine that send the message parts piece by piece. Thanks, Gazza From: gary clark <burslem2001@yahoo.com> To: gary clark <burslem2001@yahoo.com>; Twisted general discussion <twisted-python@twistedmatrix.com>; Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 2:38 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python Ok split my data up into smaller fragments. It still look like its reassembing the whole payload before sending it to the client. I'm calling transport.write(partdata) multiple times with a 0.5 second delay running in a twisted thread. How can I force the write to happen straight away in twisted. Sorry for all the questions. Thanks, Gazza From: gary clark <burslem2001@yahoo.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:36 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python Guys, Its the MTU size. Anything bigger than 1500 bytes is getting fragmented. Using wireshark I'm seeing TCP Previous segment lost anything bigger than 1500. However once that happens things go south and remain there. Oh boy one day I will learn but not today. Cheers, Gazza From: "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:27 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python On 04:08 pm, burslem2001@yahoo.com wrote:
Please see http://sscce.org/ Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

On Jul 27, 2013, at 3:12 PM, gary clark <burslem2001@yahoo.com> wrote:
That's the wrong way to implement that. You can't rely on any particular MTU over the internet, or even over one particular stream; it can change over time. TCP connections are streams of bytes. Please see the following FAQ: <http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#Whyisprotocol.da...> -glyph

Hi Gary, On Sat, Jul 27, 2013 at 6:08 PM, gary clark <burslem2001@yahoo.com> wrote:
When you say "packet", does that mean "actual IP packet that you observed leaving the server", or do you mean "the thing I passed to transport.write"?
So, it fails silently? Keep in mind that transport.write working doesn't necessarily mean that anything on the other end has successfully read it: that's why good RPC mechanisms like AMP have positive acknowedgement :)
Any help on this would relieve the pain I'm feeling right now.
How are these two servers connected? Can you reliably reproduce the problem? Does it persist with other transports? Could you shed some more light on what you mean by "sometimes"? cheers lvh

Guys, Its the MTU size. Anything bigger than 1500 bytes is getting fragmented. Using wireshark I'm seeing TCP Previous segment lost anything bigger than 1500. However once that happens things go south and remain there. Oh boy one day I will learn but not today. Cheers, Gazza From: "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:27 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python On 04:08 pm, burslem2001@yahoo.com wrote:
Please see http://sscce.org/ Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Ok split my data up into smaller fragments. It still look like its reassembing the whole payload before sending it to the client. I'm calling transport.write(partdata) multiple times with a 0.5 second delay running in a twisted thread. How can I force the write to happen straight away in twisted. Sorry for all the questions. Thanks, Gazza From: gary clark <burslem2001@yahoo.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:36 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python Guys, Its the MTU size. Anything bigger than 1500 bytes is getting fragmented. Using wireshark I'm seeing TCP Previous segment lost anything bigger than 1500. However once that happens things go south and remain there. Oh boy one day I will learn but not today. Cheers, Gazza From: "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:27 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python On 04:08 pm, burslem2001@yahoo.com wrote:
Please see http://sscce.org/ Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Ok finally fixed the damn thing. I made the packets smaller and created a task in the .tac file to call a routine that send the message parts piece by piece. Thanks, Gazza From: gary clark <burslem2001@yahoo.com> To: gary clark <burslem2001@yahoo.com>; Twisted general discussion <twisted-python@twistedmatrix.com>; Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 2:38 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python Ok split my data up into smaller fragments. It still look like its reassembing the whole payload before sending it to the client. I'm calling transport.write(partdata) multiple times with a 0.5 second delay running in a twisted thread. How can I force the write to happen straight away in twisted. Sorry for all the questions. Thanks, Gazza From: gary clark <burslem2001@yahoo.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:36 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python Guys, Its the MTU size. Anything bigger than 1500 bytes is getting fragmented. Using wireshark I'm seeing TCP Previous segment lost anything bigger than 1500. However once that happens things go south and remain there. Oh boy one day I will learn but not today. Cheers, Gazza From: "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Saturday, July 27, 2013 12:27 PM Subject: Re: [Twisted-Python] ugh open-ssl and twisted python On 04:08 pm, burslem2001@yahoo.com wrote:
Please see http://sscce.org/ Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

On Jul 27, 2013, at 3:12 PM, gary clark <burslem2001@yahoo.com> wrote:
That's the wrong way to implement that. You can't rely on any particular MTU over the internet, or even over one particular stream; it can change over time. TCP connections are streams of bytes. Please see the following FAQ: <http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#Whyisprotocol.da...> -glyph
participants (4)
-
exarkun@twistedmatrix.com
-
gary clark
-
Glyph
-
Laurens Van Houtven