-
July 9th, 2012, 01:20 AM
#1
creating multiple ports at server and client
Hi... i am new to the network programming.
i want solution for creating multiple ports at both server and client sides using c/c++.
My main idea is to send requests from different clients to server(ex:to port1) and receive data from server( from another port 2) and at the receiver side again i want new port to receive data from server to each client.
Is it possible to do like that???
please give suggestions
-
July 9th, 2012, 12:59 PM
#2
Re: creating multiple ports at server and client
Sounds like all you need is a basic socket server and client. Here is
the code you request, along with some more goodies.
http://cs.ecs.baylor.edu/~donahoo/pr...ets/practical/
Look at TCPEchoServer.cpp and TCPEchoClient.cpp, plain Vanilla Sockets is probably the way to go.
HTH,
ahoodin
To keep the plot moving, that's why.
-
July 10th, 2012, 01:30 AM
#3
Re: creating multiple ports at server and client
thank you very much for your reply.
my main idea is described in the following image.
please suggest code for this in c language.
-
July 10th, 2012, 04:57 AM
#4
Re: creating multiple ports at server and client
Why do you think you need such a design. Normally, one socket connection per client would be enough.
-
July 10th, 2012, 10:12 PM
#5
Re: creating multiple ports at server and client
Originally Posted by Richard.J
Why do you think you need such a design. Normally, one socket connection per client would be enough.
Actually i want send jumbo frames [5000bytes] from each client to sever.
My idea is, if we send both request messages from different clients to a particular port on server and send data to same port on the server will decrease the throughput. so i want to send data from clients to different port on the server side.
Is this idea is correct ???
-
July 11th, 2012, 01:12 AM
#6
Re: creating multiple ports at server and client
Originally Posted by bhanubtech35
Is this idea is correct ???
I don't think so. You must think in terms of connections, not ports. A connection consists of the tuple (local IP address, local port, remote IP address, remote port, protocol). So if each client establishes 1 connection to the server, everything can be sent via this connection. A separate data connection would not necessarily increase the overall throughput, IMO.
-
July 10th, 2012, 05:04 AM
#7
Re: creating multiple ports at server and client
It seems like you need something similar to passive FTP http://slacksite.com/other/ftp.html
-
July 10th, 2012, 08:33 AM
#8
Re: creating multiple ports at server and client
Looks like the diagram for old BOOTP.
Any similarities?
ahoodin
To keep the plot moving, that's why.
-
July 10th, 2012, 09:55 AM
#9
Re: creating multiple ports at server and client
Well, this FTP feature came to my mind right after my previous post...
-
July 12th, 2012, 03:55 AM
#10
Re: creating multiple ports at server and client
can you explain any solution for this problem.
(Here we are using UDP for sending packets.)
-
July 12th, 2012, 01:28 PM
#11
Re: creating multiple ports at server and client
Originally Posted by bhanubtech35
Actually i want send jumbo frames [5000bytes] from each client to sever.
Originally Posted by bhanubtech35
(Here we are using UDP for sending packets.)
For all I know, this seems to be not the best approach. Since UDP packets can not be split, huge packets might be dropped on their way. All applications I know of use UDP for rather small packets (as a rule of thumb I have in mind having read 1500 bytes max.).
However, you are asking for a solution. Are you still in favor of the 2 port solution?
-
July 13th, 2012, 09:49 AM
#12
Re: creating multiple ports at server and client
Actually we want to send data through 10Gbps line(i.e. using optical fiber). So, to achieve higher data rates we have to send jumbo packets.Using single port we didn't get good throughput so we want go for 2 ports. Is there any solution for this ? ,otherwise please suggest a procedure to achieve good throughput.
-
July 16th, 2012, 08:21 PM
#13
Re: creating multiple ports at server and client
Originally Posted by bhanubtech35
Actually we want to send data through 10Gbps line(i.e. using optical fiber). So, to achieve higher data rates we have to send jumbo packets.Using single port we didn't get good throughput so we want go for 2 ports. Is there any solution for this ? ,otherwise please suggest a procedure to achieve good throughput.
If you are using UDP and Windows, your poor throughput with jumbo packets might be because of a known issue regarding the registry entries respectively called FastSendDatagramThreshold and FastCopyReceiveThreshold. The issue affects only Windows machines (naturally, since it's a registry entry) and not Linux etc. See, for example, these two links:
"Server Does Not Use All Bandwidth Available When Streaming Files with Bit Rates over 100 Kbps" at http://support.microsoft.com/kb/235257
"Microsoft Windows 2000 TCP/IP Implementation Details" at http://technet.microsoft.com/en-us/l.../bb726981.aspx (it's a long page, seach towards the end where you will find an explanation of the FastSendDatagramThreshold parameter)
Try re-running your tests with different sizes for your message. Instead of 5000 bytes, try to re-run at the following message sizes:
1023
1024
1025
1026
If you see a large slowdown in throughput as you change the message size from 1024 to 1025, then you are dealing with this known issue of registry entries.
If so, then there is no need for multiple ports. Just change the registry entries.
Mike
-
July 17th, 2012, 12:02 AM
#14
Re: creating multiple ports at server and client
we are using LINUX network programming
-
August 1st, 2012, 02:13 AM
#15
Re: creating multiple ports at server and client
Cycling is the most fashionable among all sports, not only because of its beautiful curve while riding across the road but also because of the diversified bicycle suits with which riders match their style at their will.You will find many excellent cycling jerseys from this site.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|