• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to minimize packet loss in UDP transmission

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic