From gorhas at raditex.nu Tue Feb 2 21:32:33 2021 From: gorhas at raditex.nu (G Hasse) Date: Tue, 2 Feb 2021 21:32:33 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu Message-ID: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> Hi! I don't know if this is a BUS question - but if not - forgive me! I am trying to write an openssl server, and have som problem. A client is sending binary packets with SSL_write, and a server is reveiving with SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the server just stops... Is there any ideas how to investigate this? // GH -- Göran Hasse Raditex Control AB Boo 229, 715 91 ODENSBACKEN tel: 070 5530148 mail: gorhas at raditex.nu From a43astra at gmail.com Wed Feb 3 08:19:34 2021 From: a43astra at gmail.com (Astrid) Date: Wed, 3 Feb 2021 08:19:34 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> Message-ID: 1) Why do you want to write a server of your own? 2) strace? on both ends? Sincerely, Astrid Den tis 2 feb. 2021 kl 21:41 skrev G Hasse via BUS : > Hi! > > I don't know if this is a BUS question - but if not - forgive me! > > I am trying to write an openssl server, and have som problem. > > A client is sending binary packets with SSL_write, and a server is > reveiving with > SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the > server > just stops... > > Is there any ideas how to investigate this? > > // GH > > -- > Göran Hasse > Raditex Control AB > Boo 229, 715 91 ODENSBACKEN > tel: 070 5530148 > mail: gorhas at raditex.nu > _________________________________________________ > BSD Users Sweden -- BUS at stacken.kth.se > https://lists.stacken.kth.se/mailman/listinfo/bus > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \/\/ a43astra at gmail.com \/ Astrid L. Raidl \/\/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *Nej, jag har inga som helst planer på att skaffa någon elektronisk fotboja (aka smartfån) som skickar data om varje steg du tar, varje sms du skickar, varje bild du tar och varje webbsida som du besöker till servrar i USA - där data handlas hej vilt. * *Jag jobbade redan för många år sedan med nätverksövervakning och säkerhetsanalyser i realtid och sedan dess har jag ingen smartfån! * *BankID funkar bara på det inlåsta proprietära datasnokaroperativsystemet Windows eller det ännu mer inlåsta proprietära operativsystemet MacOS - jag själv använder uteslutande fria källkodsöppna operativsystem såsom Linux - men där finns inget BankID. Men å andra sidan kan jag alltid gå och läsa själv i källkoden om något ser konstigt ut. * -------------- next part -------------- An HTML attachment was scrubbed... URL: From a43astra at gmail.com Wed Feb 3 08:20:44 2021 From: a43astra at gmail.com (Astrid) Date: Wed, 3 Feb 2021 08:20:44 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> Message-ID: or rather truss if you cannot get strace to run? Den ons 3 feb. 2021 kl 08:19 skrev Astrid : > 1) Why do you want to write a server of your own? > 2) strace? on both ends? > > Sincerely, > > Astrid > > > Den tis 2 feb. 2021 kl 21:41 skrev G Hasse via BUS : > >> Hi! >> >> I don't know if this is a BUS question - but if not - forgive me! >> >> I am trying to write an openssl server, and have som problem. >> >> A client is sending binary packets with SSL_write, and a server is >> reveiving with >> SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the >> server >> just stops... >> >> Is there any ideas how to investigate this? >> >> // GH >> >> -- >> Göran Hasse >> Raditex Control AB >> Boo 229, 715 91 ODENSBACKEN >> tel: 070 5530148 >> mail: gorhas at raditex.nu >> _________________________________________________ >> BSD Users Sweden -- BUS at stacken.kth.se >> https://lists.stacken.kth.se/mailman/listinfo/bus >> > > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > \/\/ a43astra at gmail.com \/ Astrid L. Raidl \/\/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > *Nej, jag har inga som helst planer på att skaffa någon elektronisk > fotboja (aka smartfån) som skickar data om varje steg du tar, varje sms du > skickar, varje bild du tar och varje webbsida som du besöker till servrar i > USA - där data handlas hej vilt. * > > *Jag jobbade redan för många år sedan med nätverksövervakning och > säkerhetsanalyser i realtid och sedan dess har jag ingen smartfån! * > > *BankID funkar bara på det inlåsta proprietära datasnokaroperativsystemet > Windows eller det ännu mer inlåsta proprietära operativsystemet MacOS - jag > själv använder uteslutande fria källkodsöppna operativsystem såsom Linux - > men där finns inget BankID. Men å andra sidan kan jag alltid gå och läsa > själv i källkoden om något ser konstigt ut. * > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \/\/ a43astra at gmail.com \/ Astrid L. Raidl \/\/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *Nej, jag har inga som helst planer på att skaffa någon elektronisk fotboja (aka smartfån) som skickar data om varje steg du tar, varje sms du skickar, varje bild du tar och varje webbsida som du besöker till servrar i USA - där data handlas hej vilt. * *Jag jobbade redan för många år sedan med nätverksövervakning och säkerhetsanalyser i realtid och sedan dess har jag ingen smartfån! * *BankID funkar bara på det inlåsta proprietära datasnokaroperativsystemet Windows eller det ännu mer inlåsta proprietära operativsystemet MacOS - jag själv använder uteslutande fria källkodsöppna operativsystem såsom Linux - men där finns inget BankID. Men å andra sidan kan jag alltid gå och läsa själv i källkoden om något ser konstigt ut. * -------------- next part -------------- An HTML attachment was scrubbed... URL: From niklas at appli.se Wed Feb 3 11:35:09 2021 From: niklas at appli.se (Niklas Hallqvist) Date: Wed, 3 Feb 2021 11:35:09 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> Message-ID: It's a rather open question you are posing, your problem could be almost anything. Please provide more input. Does this happen even in the simplest localhost scenario? When you say thee server "stops", what does that a mean? Does it crash, spin, block on network input, Block on anything else (like on getting some resource it needs to deal with the client provided data, like an output pipe)? You just have to give a lot more information. Otherwise tcpdump, various system call tracers (like Astrid hinted about), potential libcall tracers (like ltrace) and Since you are writing your own server, a debugger like gdb, are your friend. /Niklas > On 2 Feb 2021, at 21:32, G Hasse via BUS wrote: > > Hi! > > I don't know if this is a BUS question - but if not - forgive me! > > I am trying to write an openssl server, and have som problem. > > A client is sending binary packets with SSL_write, and a server is reveiving with > SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the server > just stops... > > Is there any ideas how to investigate this? > > // GH > > -- > Göran Hasse > Raditex Control AB > Boo 229, 715 91 ODENSBACKEN > tel: 070 5530148 > mail: gorhas at raditex.nu > _________________________________________________ > BSD Users Sweden -- BUS at stacken.kth.se > https://lists.stacken.kth.se/mailman/listinfo/bus > From gorhas at raditex.nu Wed Feb 3 20:14:25 2021 From: gorhas at raditex.nu (gorhas) Date: Wed, 3 Feb 2021 20:14:25 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> Message-ID: Yes... I am a little bit vague - since I don't fully understand what is going on. I have a OpenSSL-server and a OpenSSL-client. The client are sending "binary" data to the server with SSL_write and the server is receiving with SSL_read. I am using a function call like no_bytes = SSL_read(ssl, ssl_buffer, SSL_BUFFER_SIZE); This works suprisingly good. I always get a full buffer. If I run the application on the local network between two machines, i get exteemly good performance. If I run from our IoT devicd I get not so good performance. This is expected since this is connected by a BG95 (mobile module). But the problem is that sometimes the packet rate slows down and sometimes it comes to a halt. Since I am using high level calls like SSL_read/write I have not mutch use of tools like tcpdump, strace et.al. since I can't influence the packet flow from the high level api:s. Since the data I am transfereing is about 5MB (a sound file) I belive that the network provider (Telenor) have som kind of "trafic shaping" in action. And I don't understand how I can investigate this. This is a rather important application for me (commercial) and if some  wants to cut in and investigate the problem please let me know. // GH Den 2021-02-03 kl. 11:35, skrev Niklas Hallqvist via BUS: > It's a rather open question you are posing, your problem could be almost anything. > Please provide more input. Does this happen even in the simplest localhost scenario? > When you say thee server "stops", what does that a mean? Does it crash, spin, block on network input, > Block on anything else (like on getting some resource it needs to deal with the client provided data, like an output pipe)? > > You just have to give a lot more information. > t > Otherwise tcpdump, various system call tracers (like Astrid hinted about), potential libcall tracers (like ltrace) and > Since you are writing your own server, a debugger like gdb, are your friend. > > /Niklas > > >> On 2 Feb 2021, at 21:32, G Hasse via BUS wrote: >> >> Hi! >> >> I don't know if this is a BUS question - but if not - forgive me! >> >> I am trying to write an openssl server, and have som problem. >> >> A client is sending binary packets with SSL_write, and a server is reveiving with >> SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the server >> just stops... >> >> Is there any ideas how to investigate this? >> >> // GH >> >> -- >> Göran Hasse >> Raditex Control AB >> Boo 229, 715 91 ODENSBACKEN >> tel: 070 5530148 >> mail: gorhas at raditex.nu >> _________________________________________________ >> BSD Users Sweden -- BUS at stacken.kth.se >> https://lists.stacken.kth.se/mailman/listinfo/bus >> > _________________________________________________ > BSD Users Sweden -- BUS at stacken.kth.se > https://lists.stacken.kth.se/mailman/listinfo/bus -- Göran Hasse Raditex Control AB, Boo 229, 715 91 ODENSBACKEN email: gorhas at raditex.nu mobile: +46 70 5530148 From niklas at appli.se Thu Feb 4 08:47:12 2021 From: niklas at appli.se (Niklas Hallqvist) Date: Thu, 4 Feb 2021 08:47:12 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> Message-ID: <85A5A440-1C86-4C16-9C86-1BF189F22CE1@appli.se> Well, even when you are debugging "high-level" applications, low-level tools can help you tremendously. For example tcpdump can tell you which party, the client or the server, is the one who is causing the slowdown/halt. If you have the capability of running it at both ends you can also come to terms with if you should blame the network and any external providers/services, by matching the packet streams. Just ruling out one side of the setup, and the intermediary network you will have come a lot closer to the culprit. Anyway, I might have time to help you commercially. Send me a private email, if you get desperate. /Niklas > On 3 Feb 2021, at 20:14, gorhas via BUS wrote: > > Yes... I am a little bit vague - since I don't fully understand what is going on. > > I have a OpenSSL-server and a OpenSSL-client. The client are sending "binary" data to the server with SSL_write and the server is receiving with SSL_read. I am using a function call like > > no_bytes = SSL_read(ssl, ssl_buffer, SSL_BUFFER_SIZE); > > This works suprisingly good. I always get a full buffer. If I run the application on the local network between two machines, i get exteemly good performance. If I run from our IoT devicd I get not so good performance. This is expected since this is connected by a BG95 (mobile module). But the problem is that sometimes the packet rate slows down and sometimes it comes to a halt. > > Since I am using high level calls like SSL_read/write I have not mutch use of tools like tcpdump, strace et.al. since I can't influence the packet flow from the high level api:s. > > Since the data I am transfereing is about 5MB (a sound file) I belive that the network provider (Telenor) have som kind of "trafic shaping" in action. And I don't understand how I can investigate this. > > This is a rather important application for me (commercial) and if some wants to cut in and investigate the problem please let me know. > > // GH > > Den 2021-02-03 kl. 11:35, skrev Niklas Hallqvist via BUS: >> It's a rather open question you are posing, your problem could be almost anything. >> Please provide more input. Does this happen even in the simplest localhost scenario? >> When you say thee server "stops", what does that a mean? Does it crash, spin, block on network input, >> Block on anything else (like on getting some resource it needs to deal with the client provided data, like an output pipe)? >> >> You just have to give a lot more information. >> t >> Otherwise tcpdump, various system call tracers (like Astrid hinted about), potential libcall tracers (like ltrace) and >> Since you are writing your own server, a debugger like gdb, are your friend. >> >> /Niklas >> >> >>> On 2 Feb 2021, at 21:32, G Hasse via BUS wrote: >>> >>> Hi! >>> >>> I don't know if this is a BUS question - but if not - forgive me! >>> >>> I am trying to write an openssl server, and have som problem. >>> >>> A client is sending binary packets with SSL_write, and a server is reveiving with >>> SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the server >>> just stops... >>> >>> Is there any ideas how to investigate this? >>> >>> // GH >>> >>> -- >>> Göran Hasse >>> Raditex Control AB >>> Boo 229, 715 91 ODENSBACKEN >>> tel: 070 5530148 >>> mail: gorhas at raditex.nu >>> _________________________________________________ >>> BSD Users Sweden -- BUS at stacken.kth.se >>> https://lists.stacken.kth.se/mailman/listinfo/bus >>> >> _________________________________________________ >> BSD Users Sweden -- BUS at stacken.kth.se >> https://lists.stacken.kth.se/mailman/listinfo/bus > > -- > Göran Hasse > Raditex Control AB, Boo 229, 715 91 ODENSBACKEN > email: gorhas at raditex.nu mobile: +46 70 5530148 > > _________________________________________________ > BSD Users Sweden -- BUS at stacken.kth.se > https://lists.stacken.kth.se/mailman/listinfo/bus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gorhas at raditex.nu Thu Feb 4 17:25:16 2021 From: gorhas at raditex.nu (G Hasse) Date: Thu, 4 Feb 2021 17:25:16 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: <85A5A440-1C86-4C16-9C86-1BF189F22CE1@appli.se> References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> <85A5A440-1C86-4C16-9C86-1BF189F22CE1@appli.se> Message-ID: So... The problem was solved. The high latancy was because an antenna with bad "quality". We changed antenna and now we have the performance as should be expected. Hm... // GH Den 2021-02-04 kl. 08:47, skrev Niklas Hallqvist via BUS: > Well, even when you are debugging "high-level" applications, low-level tools can help you > tremendously.  For example tcpdump can tell you which party, the client or the server, is the > one who is causing the slowdown/halt.  If you have the capability of running it at both ends > you can also come to terms with if you should blame the network and any external providers/services, > by matching the packet streams.  Just ruling out one side of the setup, and the intermediary network > you will have come a lot closer to the culprit. > > Anyway, I might have time to help you commercially. Send me a private email, if you get desperate. > > /Niklas > >> On 3 Feb 2021, at 20:14, gorhas via BUS > wrote: >> >> Yes... I am a little bit vague - since I don't fully understand what is going on. >> >> I have a OpenSSL-server and a OpenSSL-client. The client are sending "binary" data to the server with SSL_write and the server is receiving with SSL_read. I am using a function call like >> >> no_bytes = SSL_read(ssl, ssl_buffer, SSL_BUFFER_SIZE); >> >> This works suprisingly good. I always get a full buffer. If I run the application on the local network between two machines, i get exteemly good performance. If I run from our IoT devicd I get not so good performance. This is expected since this is connected by a BG95 (mobile module). But the problem is that sometimes the packet rate slows down and sometimes it comes to a halt. >> >> Since I am using high level calls like SSL_read/write I have not mutch use of tools like tcpdump, strace et.al. since I can't influence the packet flow from the high level api:s. >> >> Since the data I am transfereing is about 5MB (a sound file) I belive that the network provider (Telenor) have som kind of "trafic shaping" in action. And I don't understand how I can investigate this. >> >> This is a rather important application for me (commercial) and if some  wants to cut in and investigate the problem please let me know. >> >> // GH >> >> Den 2021-02-03 kl. 11:35, skrev Niklas Hallqvist via BUS: >>> It's a rather open question you are posing, your problem could be almost anything. >>> Please provide more input.  Does this happen even in the simplest localhost scenario? >>> When you say thee server "stops", what does that a mean?  Does it crash, spin, block on network input, >>> Block on anything else (like on getting some resource it needs to deal with the client provided data, like an output pipe)? >>> >>> You just have to give a lot more information. >>> t >>> Otherwise tcpdump, various system call tracers (like Astrid hinted about), potential libcall tracers (like ltrace) and >>> Since you are writing your own server, a debugger like gdb, are your friend. >>> >>> /Niklas >>> >>> >>>> On 2 Feb 2021, at 21:32, G Hasse via BUS > wrote: >>>> >>>> Hi! >>>> >>>> I don't know if this is a BUS question - but if not - forgive me! >>>> >>>> I am trying to write an openssl server, and have som problem. >>>> >>>> A client is sending binary packets with SSL_write, and a server is reveiving with >>>> SSL_read. Everyting is OK until about 1500000 bytes are sent. Then the server >>>> just stops... >>>> >>>> Is there any ideas how to investigate this? >>>> >>>> // GH >>>> >>>> -- >>>> Göran Hasse >>>> Raditex Control AB >>>> Boo 229, 715 91 ODENSBACKEN >>>> tel: 070 5530148 >>>> mail: gorhas at raditex.nu >>>> _________________________________________________ >>>> BSD Users Sweden -- BUS at stacken.kth.se >>>> https://lists.stacken.kth.se/mailman/listinfo/bus >>>> >>> _________________________________________________ >>> BSD Users Sweden -- BUS at stacken.kth.se >>> https://lists.stacken.kth.se/mailman/listinfo/bus >> >> -- >> Göran Hasse >> Raditex Control AB, Boo 229, 715 91  ODENSBACKEN >> email:gorhas at raditex.nu  mobile: +46 70 5530148 >> >> _________________________________________________ >> BSD Users Sweden --BUS at stacken.kth.se >> https://lists.stacken.kth.se/mailman/listinfo/bus > > > _________________________________________________ > BSD Users Sweden -- BUS at stacken.kth.se > https://lists.stacken.kth.se/mailman/listinfo/bus > -- Göran Hasse Raditex Control AB Boo 229, 715 91 ODENSBACKEN tel: 070 5530148 mail: gorhas at raditex.nu From daniel at lublin.se Fri Feb 5 08:28:02 2021 From: daniel at lublin.se (Daniel Lublin) Date: Fri, 5 Feb 2021 08:28:02 +0100 Subject: OpenSSL server - FreeBSD/Ubuntu In-Reply-To: References: <3257a893-be74-3da6-8987-cc1c741e7c4c@raditex.nu> <85A5A440-1C86-4C16-9C86-1BF189F22CE1@appli.se> Message-ID: Wow, so much for not knowing anything about how much influence you have at the *lower* layers. Did you try mounting the "faulty" antenna again to try and reproduce the problem? :-) -- Daniel