Multithreaded app and TCP/IP stack - TCP-IP

This is a discussion on Multithreaded app and TCP/IP stack - TCP-IP ; Hi, We'd like to optimize the throughput of a multithreaded app running on Linux which sends UDP packets (multicast) using several network cards. Is it possible that each thread opens a socket bound to a different network interface? How the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Multithreaded app and TCP/IP stack

  1. Multithreaded app and TCP/IP stack

    Hi,
    We'd like to optimize the throughput of a multithreaded app running on
    Linux which sends UDP packets (multicast) using several network
    cards.
    Is it possible that each thread opens a socket bound to a different
    network interface?
    How the current linux kernel can handle this? I mean, is there any
    kind of serialization at kernel level which might make the multi-
    threaded model unuseful?
    Thanks


  2. Re: Multithreaded app and TCP/IP stack

    Frederic Mayot did eloquently scribble:
    > Hi,
    > We'd like to optimize the throughput of a multithreaded app running on
    > Linux which sends UDP packets (multicast) using several network
    > cards.
    > Is it possible that each thread opens a socket bound to a different
    > network interface?
    > How the current linux kernel can handle this? I mean, is there any
    > kind of serialization at kernel level which might make the multi-
    > threaded model unuseful?


    The kernel does have network "bonding", meaning that the network cards can
    be "bound together" so they share the same device, so if you have 2 nics you
    can double your output, no multithreading required in that method.

    Of course, using this means the network cards are on the same subnet, if you
    want to output to 2 different subnets, then threading would be the way to
    go.In which case I can't see a problem binding one thread to eth0, one to
    eth1, etc...
    --
    __________________________________________________ ____________________________
    | spike1@freenet.co.uk | |
    |Andrew Halliwell BSc(hons)| "The day Microsoft makes something that doesn't |
    | in | suck is probably the day they start making |
    | Computer science | vacuum cleaners" - Ernst Jan Plugge |
    ------------------------------------------------------------------------------

+ Reply to Thread