Tech Off Thread

8 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Voip server side question

Back to Forum: Tech Off
  • User profile image
    Shark_M

    Hi guys
    consider the making a server side Voip solution, that is supposed to allow more than 1 conference..... to large number of simultanous conversations.... each conference has 1 speaker at anytime, but each conference has many listeners to that speaker. More than 1 conference can operate at the same time..

    How would this scheme work at the server side? What is the operational definition of a channel? Is it an index of a socket object?
    Index 0 is Conference 1
    Index 1 is conference 2
    ....   .....
    etc...

    And then if this conference is supposed to send voice data to each listener would a loop be an efficent way of doingthat?

    Conference1 has the following

    Speaker at ip ......

    listeners......200 or more

    speaker udp packets are sent to the rest of the listeners in a for loop while speaker is speaking...

    But this means that you have some listeners getting the voice data sooner than others. like listener #1 in conference 1, would get the voice earlier than listener 200 (difference of few seconds).

    Is there a way to multicast or send over tcpip/udp datagrams to all at once?

    would 25 threads that loop through each socket index (a conference) from a Queue work?

    I am trying to understand the underworkings of how a C# voice server would work that is based on central voice/camera server. Any input would be appreciated..

    Thanks

  • User profile image
    Shark_M

    no one has any ideas as to how to implement MultiVoice Server in C#?

    I need to understand the concepts of the case.

    Are there any good books on this? How to implement a VoIP in C# (server side)

  • User profile image
    Minh

    g: Open Source VoIP


    But other thoughts:

    * There is a hardware Multicast standard, although few routers bother to implement

    * So what if the 200 listeners don't hear the exact same thing at the exact same time. If it's off by 5-10 seconds, since it's only a 1-way comm, it's no big deal

    * I'd implemented server socket connection functions by spawning a separate thread and have that thread handle all communications -- in your case, there's no way you'd want 200 threads running at the same time

    * UDP packets aren't guaranteed to arrive in the order you send them -- or even arrive at all, so I'd say implement some sort of extra logic to assemble them yourself

    * Skype works by routing voice packets over other Skype users' machines -- probable because the Skype client knows the connection bandwidth & can offer extra quality of service over the internet blackboxes


  • User profile image
    Shark_M

    Minh wrote:
    g: Open Source VoIP


    But other thoughts:

    * There is a hardware Multicast standard, although few routers bother to implement

    * So what if the 200 listeners don't hear the exact same thing at the exact same time. If it's off by 5-10 seconds, since it's only a 1-way comm, it's no big deal

    * I'd implemented server socket connection functions by spawning a separate thread and have that thread handle all communications -- in your case, there's no way you'd want 200 threads running at the same time

    * UDP packets aren't guaranteed to arrive in the order you send them -- or even arrive at all, so I'd say implement some sort of extra logic to assemble them yourself

    * Skype works by routing voice packets over other Skype users' machines -- probable because the Skype client knows the connection bandwidth & can offer extra quality of service over the internet blackboxes




    Ok, Thanks, But about Skype. How can they use Users Machines, to route Voice Packets? Is it like peer -to- peer? If its so then, most firewalls in user's machines, will block such packets because firewalls block unsolisited packets. In the case of skype you only allow the IP address of thes skype servers. So how would skype overcome this then? Unless the client implements some kind of spoofing on the recived packets from a server or a peer, and make them as comming from the server?

    on UDP packets, can you show me an example of a logic to reorder the udp stream?


    In my scheme, I have about 10-25 (max) threads that handle all connections to the voice server. so in a sence the server speed is 25 threads at any given time, processing each conference. each conference has in it upto 200 user's listening.

    I am doing this as part of a conceptual thing, and a demo for my studies. How much do you think a good server would handle if you run 25 threads in the console application?

    thanks

  • User profile image
    Rossj

    Shark_M wrote:
    How much do you think a good server would handle if you run 25 threads in the console application?


    Too many unanswered questions. We don't know anything about the hardware, the network (size and type of pipe), the code - how efficient it is, the chosen codec, the delivery method etc.. etc..

    Personally I don't like thread-per-connection servers anymore (although I know you are suggesting thread per conference). This might give you some more ideas for highperf servers, as might this.

  • User profile image
    Shark_M

    Rossj wrote:
    Shark_M wrote: How much do you think a good server would handle if you run 25 threads in the console application?


    Too many unanswered questions. We don't know anything about the hardware, the network (size and type of pipe), the code - how efficient it is, the chosen codec, the delivery method etc.. etc..

    Personally I don't like thread-per-connection servers anymore (although I know you are suggesting thread per conference). This might give you some more ideas for highperf servers, as might this.


    Well its a normal server, with oc3 connection.  using Speex codec.

    why you dont like thread per-connection servers?

  • User profile image
    AndyC

    Shark_M wrote:

    why you dont like thread per-connection servers?


    They don't scale well.

  • User profile image
    Shark_M

    AndyC wrote:
    Shark_M wrote:
    why you dont like thread per-connection servers?


    They don't scale well.


    what is the alternative?

    what about 25 thread to handle all client connections? I dont have the Thread per client scheme, i have  25 total threads, for all connecctions that come to the server.

    Another thing, I do not use asynchronus sockets, instead the server checks in a loop for each client, and query for data, and if there is data it processes it. I used this becuase i can detect client disconnection in a better way. And in 100% of the cases, when a client disconnects, i detect it immediately.

    2 ways that were implemented were
    1) Query for data, if get socket error with specific number , then client has disconnected at data gathering phase. so do clean up

    2) send small packet to clients that are connected, in 3 min or so, and the server must get some sort of reply within a timeframe (<1 min), if no reply client disconnected . implement cleanup.

    with async-sockets, (socket.beginaccept...), i cant impelement#1, only #2. So far things are ok , although as time progresses, the server performance degrades (memory leak ???) (ie, its not as performant as when you first start it, and this happens when there are 3 test clients connected).

    but I am investigating things now to see what is causing it.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.