Calculating Real Network Round-trip [closed] - networking

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I would like to understand network latency a bit better.
Lets say there's one Client and two Servers. Client sends 1000 bytes to each of the Servers, each Server responds instantly with 1000 bytes.
Ping round trip times from Client:
To Server 1 - 2ms
To Server 2 - 20ms
Assume both Client and Servers are connected to quality 1 Gbps pipe (but not via dedicated line between them).
Question: how to calculate real time from when Client starts sending its 1000 bytes to when it fully receives the last byte of the response data. Will it be something close to 2ms for Server 1 and 20ms for Server 2?

Yes, that's exactly right!
The ping round-trip delay measures how long it takes a small packet of data to travel from one host on the network to another, and back to the original host.
You should keep in mind that the numbers you get fluctuate a bit based on network conditions and load on the processors of the hosts. You should average the round-trip delay over a few samples but be prepared that any other packet may experience an unusual delay for a variety of reasons.

Related

Can I have 3 GBit/s between computers through a cheap router? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I made tests with iperf, iperf3, ssh + pv + /dev/zero, copying files, and netcat (nc).
Most of the tests are showing 940 Mbit/s, like expected, including netcat.
But when I saw that actually for some of these tools, the cpu was a bottleneck, I moved to exposing multiple ports for netcat, and using up to 8 parallel connections. This increased the speed from 800 Mbit/s to over 3 Gbit/s.
My router is a cheap one, Hub 3 from Virgin Media. The ethernet cables are of quality.
Could this be real? Or could netcat be compressing by default?
Thanks,
Nicu
Actually indeed it is not real. I make the test again now and it is a bit under 1Gbit/s aggregated across connections, on average, as expected. Previously probably the time was not enough to show enough degradation of the speeds of previous connections as i was opening more and i incorrectly assumed that the connections will quickly stabilize to equal throughputs, which is not real either.
I did get 3 Gbit/s via a thunderbolt direct connection between computers. However it was 3 Gbit in one direction and 500 Mbit in the other.

Peer to Peer Networking [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
In a peer-to-peer network, is every node connected to the network a client or do they act as both a server and a client? And how can you make the peer-to-peer network robust enough to support an unlimited number of nodes connected at one time?
Well, as it already states, its P2P. So, you could basically call them both client and server,
it doesnt matter in this case (its doing the job of a server and client). When a peer in this kind of network needs to update something, it has to send the data once to EVERY peer it is connected. And meanwhile, this peer waits for any incoming data sent from the peers its connected to, and updates it accordingly.
As for your second question - i wouldnt recommend using a P2P pattern for a unlimited amount of peers. for a higher number of peers, the network usage would grow even larger - because every single peer needs to be connected to every other peer and send data to all of them. not to mention that this could get the data desynchronised very easily. P2P is good for a smaller networks with a smaller number of peers. in that case, the raw sending speed will be higher than that of a server-client model, because there is no breakpoint in the connection(in a s-c model,this is the server). For a higher number of total Connections, i would stick to a Client-Server model.

Why are ping times so long? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Assuming the speed of light ~ 186000 mi/sec, and the farthest from anywhere on earth you can be without leaving earth ~ 16,000 mi, that means the time it takes for light to reach any point on earth and come back <= ~172 msec. So why can ping times exceed this?
A few reasons
Your assumption about speed is wrong, electronic communications through a wire travel is about 2/3 the speed of light.
You are not traveling a strait line from Point A to Point B, so it could be longer.
Your assumption about leaving earth is wrong, satellite links can often be used for intercontinental network links
(the biggest culprit) You need to pass through many computers (run the program tracert and you can see), the computer does not instantainouly forward the packet on from the time it received to to the time it sends it to the next person. If the computer doing the forwarding is under a very heavy load it could take a while for the packet to be forwarded on while it sits in a queue waiting to be processed.
That is a completely wrong comparison. for some reasons:
Electrons are involved in the pinging not light. So you can't compare light to electrons. Thats wrong.
Servers that your ping request hops on them are not processing them in zero sec. It actually takes time to process the ping packet and send it where it's supposed to go.
Your link to the internet is not a direct link. You have to pass through a DNS server (If you ran ping with a hostname not an IP), many routers and different types of links(satellite, wired, fiber optic). So it's not like emitting from this side of planet to the another side

Choosing a Server For my game [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm about to release a MMORPG. In my game, every 1 second, each player sends 30 TCP messages and gets back from the server 30. Every message is not really long. Like 20~ chars.
the point is that I never got my hands with multiplayer games. I have programmed all the server and client, but I don't know what server I'm gonna need. I mean, RAM, CPU, etc... I still don't know what to be ready for, but let's say for 15K same-time clients. As said, every 1 second every client need to get and send 30 TCP messages, and in the most cases I need also to update my non-SQL DB with the data.
Update: It's a multiplayer game, I must have 30 msgs/sec. Most of the msgs are for the current position of the player. Also I'm using C++.
It depends on what your (already implemented) server requires. You'll never know until you try some particular hardware. Rent a powerful dedicated server for a month and profile your game server. At least just check CPU usage. You'll need multithreaded asynchronous networking.
Details you provided help only to calculate how much bandwidth you need:
~94 bytes (TCP + IP + Ethernet headers) + ~20 bytes (your data) = 114 bytes every packet * 30 per second * 15000 users = ~50MBps * 8 bits = ~400Mbps of both incoming and outgoing traffic. Seems you're in troubles here. Consider something wiser than sending your every packet in separate TCP frame. E.g., implement buffer that collects data ready to be sent and is filled by your game logic threads and separate thread that sends this data to network. In this case your several soft packets can be combined into one TCP packet greatly reducing your bandwidth requirements.
But even after this you're still in troubles. I'd recommend to wait for users first before investing into complicated solution. When you'll have them you'll need to implement some kind of clustering. It's separate story, much more complicated than simple networking.
Try to handle at least 1K users by single server. This can bring you some money to hire somebody experienced in game networking/clustering.
If you know you sending 30 messages every second, why not bundle them into 1 request, every second? Makes a lot of difference in terms in server resources...
And in which language are you going to run your server? I hope you write something dedicated to process/manage these connections? If so: do some profiling and just measure what you need...
And what is your processor doing every second, to process those 30*15K messages?
There is no generic answer to your question. It all depends on your software.

What is the average capacity of a postfix mail server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I appreciate there is no 'set' answer to this question. I am trying to assess the performance of our dedicated mail server for sending out emails. The server is of the spec below:
2G RAM
CPU Xeon 2.80GHz (x2)
Currently we're only managing to send out approximately 21,000 emails per hour from this. Which I suspect is massively under-performing.
Are there any guidelines as to what capacity can be expected?
Actually it also depends on the configuration. For exxample, if you use amavis, spamassassin or clam or another content filter it will directy affect the performance.
If you do no use any contentfilter, you should have capacity limit higher then 21,000 emails/hour.
Another point is queue size. If you have a growing queue you have a problem. If the queue is steady, no need to worry. Check queue size with "mailq | tail -1"
Check some params:
default_destination_concurrency_limit = 40
initial_destination_concurrency = 5
lmtp_destination_concurrency_limit = $default_destination_concurrency_limit
local_destination_concurrency_limit = 10
relay_destination_concurrency_limit = $default_destination_concurrency_limit
smtp_destination_concurrency_limit = $default_destination_concurrency_limit
virtual_destination_concurrency_limit = 35
Check master.cf
smtp inet n - n - 300 smtpd
smtp unix - - n - - smtp
smtpd is for incoming limit
smtp is for outgoing. If 7th field has a value this will limit concurrent server processes.
You can check google for further analysis.
http://www.google.com.tr/search?q=postfix+performance&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:tr:official&client=firefox-a
Use current network bandwidth and CPU usage to determine the capacity. If you are using 25% percent of the bandwidth and CPU then you should be able to get at least 42 000 emails per hour. (I just doubled to be on the safe side)

Resources