mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vadim Lebedev <vadim@mbdsys.com>
To: linux-kernel@vger.kernel.org
Subject: Questions about Optimizing network I/O
Date: Tue, 1 Jul 2014 15:19:35 +0000 (UTC)	[thread overview]
Message-ID: <loom.20140701T161608-685@post.gmane.org> (raw)

Hello,

I'm looking for advice on optimizing a SOCKS proxy software which i modified
to support TCP <=> UDP tunnelling.
The modification of standard SOCKS protocol is pretty straightforward, i've 
added a command that tells to socks server that destination socket is a UDP 
socket so the server expects the tcp packets  for this destination to be 
prefixed with 4 byte length. The server reads the length prefix the reads the 
'length' bytes for the tcp stream and send the data (without the length 
prefix) to the destination address as UDP datagram.
The return path (from UDP to TCP) is even simpler: The server read  UDP
datagram into a buffer whre 4 bytes are reserved for length prefix,  fill 
this prefix with the length of just read packet and send the buffer to the 
tcp socket.

When testing my SOCKS server i see that the TCP -> UDP processing generates a 
lot o CPU load while UDP -> TCP or normal SOCKS TCP <=> TCP processing 
generates relatively light cpu load.

So i'm looking for the way to optimize TCP -> UDP path.
My idea is to write a kernel module which will define an ioctl with 2 params
TCP_fd and UDP_fd and will do TCP to UDP processing completely in kernel mode
without copying data frmo/to skbufs....


Any ideas about this approach?

Thanks
Vadim


                 reply	other threads:[~2014-07-01 15:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20140701T161608-685@post.gmane.org \
    --to=vadim@mbdsys.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®