Simulating Network Latency and Bandwidth
Hi,
I am developing a multiplayer games on a 100Mbps LAN environment. But my game is targeted for a 56kbps MODEM. Is there anyway I can simulate high network latency and low network bandwidth on my LAN? I need to constantly test and tune my network implementation for the target network.
Thanks!
[edited by - thomascheah on March 2, 2004 6:24:59 AM]
Thomas CheahTechnical DirectorBad Nose Entertainment - Where games are forged from the flames of talent and passion.http://www.badnose.com/
the only way i can think of to do this is to write the code to use the comport instead of sockets until you're happy with the performance.
I'm not sure how you could cripple a network down to 56k6 performance.
[edited by - soddit on March 2, 2004 7:03:05 AM]
I'm not sure how you could cripple a network down to 56k6 performance.
[edited by - soddit on March 2, 2004 7:03:05 AM]
i is 1337
The built-in firewall in FreeBSD have a traffic shaper you can use to simulate things like this. You can limit bandwidth, set delays and packets loss rates, and stuff like that to simulate "bad" network conditions. I haven''t used it personally, so I can''t say whether it''s good or not.
Look up ipfw (the firewal) and dummynet (the traffic shaper).
Look up ipfw (the firewal) and dummynet (the traffic shaper).
void SendToNetworkSynchronously(const void *data){ Sleep((int)(rand() * 5000.0 / MAX_RAND)); real_SendToNetworkSynchronously(data);}
![](smile.gif)
[edited by - fractoid on March 2, 2004 8:06:37 AM]
There is a network simulation tool as a gem of "game programming gems III". But I haven''t had a chance to try it.
@paladinzzz
What is program that you mentioned in that book? Is it written by one of the author in the book? Or is it a program that I can find elsewhere?
@fractoid
I doubt that will work. That might impose some overall delay to the game, thus reducing the framerate. I would say if I am able to sleep ASYNCHRONOUSLY, then it might work. Latency is delay in the network as the message is sent, but it reaches the destination in a slightly delayed time. Thus, the SendMessage function (or whatever function you called it) will be return immediately, but doesn''t mean that the message you sent had reached the destination at this point.
What is program that you mentioned in that book? Is it written by one of the author in the book? Or is it a program that I can find elsewhere?
@fractoid
I doubt that will work. That might impose some overall delay to the game, thus reducing the framerate. I would say if I am able to sleep ASYNCHRONOUSLY, then it might work. Latency is delay in the network as the message is sent, but it reaches the destination in a slightly delayed time. Thus, the SendMessage function (or whatever function you called it) will be return immediately, but doesn''t mean that the message you sent had reached the destination at this point.
Thomas CheahTechnical DirectorBad Nose Entertainment - Where games are forged from the flames of talent and passion.http://www.badnose.com/
I have writen a tool ,it hooks all winsock function to simulate network latency and bandwidth. maybe you can do it by this way too. ^_^
hello..
March 03, 2004 12:40 AM
Check out NISTNet. It is a linux kernel module that runs inside the protocol stack for doing all sorts of network simulation.
Pretty rad stuff. It is a little more to the metal than the Game Gems 3 tool.
http://snad.ncsl.nist.gov/nistnet/
Pretty rad stuff. It is a little more to the metal than the Game Gems 3 tool.
http://snad.ncsl.nist.gov/nistnet/
@tj963:
Thanks! I guess you are talking about DP8Sim, right? I think that is something that I am looking for. Since I am using DirectPlay for my games. I am wondering will it work on older version of DirectPlay? Cause I am using the DirectPlay interfaces that came with DirectX 7.0. Will it work?
Thanks! I guess you are talking about DP8Sim, right? I think that is something that I am looking for. Since I am using DirectPlay for my games. I am wondering will it work on older version of DirectPlay? Cause I am using the DirectPlay interfaces that came with DirectX 7.0. Will it work?
Thomas CheahTechnical DirectorBad Nose Entertainment - Where games are forged from the flames of talent and passion.http://www.badnose.com/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement