Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to minimize packet loss in UDP transmission  RSS feed

 
Ajay Xavier
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Currently i am using UDP protocol for network transmission. i experience some packet loss.

Is it advisable to switch over TCP for this problem?
or
Can we minimize packet loss in UDP transmission?

Thanks in advance.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ajax"

Welcome to JavaRanch!

Please revise your display name to meet the JavaRanch Naming Policy. To maintain the friendly atmosphere here at the ranch, we like folks to use real (or at least real-looking) names, with a first and a last name.

You can edit your name here.

Thank you for your prompt attention, and enjoy the ranch!

Layne
 
Mat Cauthon
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ajax:
hi,

Currently i am using UDP protocol for network transmission. i experience some packet loss.

Is it advisable to switch over TCP for this problem?
or
Can we minimize packet loss in UDP transmission?

Thanks in advance.


Switch to TCP IMO. I believe UDP is useful only when losing the occasional packetis tolerable.

Of course, you can verify packet loss at the application layer and deal with it then, but why bother when TCP takes care of it for ya.
 
Mahadevan Gorti SS
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajay,

Would you please give more details like(or check for your self) :
* What is the packet rate your are sending and receving
* What is the max/min/avg size of packets(UDP)?
* At what rate you started loosing packets
* What is system load
* What is Network interfaces capacity (in Mbytes/sec) for server/client machines
* What OS. Is server/client are in WAN type of setup
* Would it be possible to give breif snippet of your receiver's code.
* What is load of OS when you are running this programme
* What is the Logger you are using -- if load is causing problems
* What is the value for DatagramSocket: getReceiveBufferSize()
* What is the Thread priority for receiving the UDP packets
* Are the receiving packets recieved as fragmented(check via ethereal)


BTW, I was able to recieve UDP packets of sizes upto 1500(MTU of network interface) till 1500 packets/sec without loosing in java(that too 1.3.1) in java(with out use of JDK NIO) on PIII with 533 MHz and 256 MB RAM. I have not tried for packet-rates above 1500
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!