What are the chances of losing a UDP packet?

前端 未结 2 1503
没有蜡笔的小新
没有蜡笔的小新 2021-02-18 19:32

Okay, so I am programming for my networking course and I have to implement a project in Java using UDP. We are implementing an HTTP server and client along with a \'gremlin\' fu

2条回答
  •  忘掉有多难
    2021-02-18 19:41

    Packet loss happens for multiple reasons. Primarily it is caused by errors on individual links and network congestion.

    Packet loss due to errors on the link is very low, when links are working properly. Less than 0.01% is not unusual.

    Packet loss due to congestion obviously depends on how busy the link is. If there is spare capacity along the entire path, this number will be 0%. But as the network gets busy, this number will increase. When flow control is done properly, this number will not get very high. A couple of lost packets is usually enough that somebody will reduce their transmission speed enough to stop packets getting lost due to congestion.

    If packet loss ever reaches 1% something is wrong. That something could be a bug in how your congestion control algorithm responds to packet loss. If it keeps sending packets at the same rate, when the network is congested and losing packets, the packet loss can be pushed much higher, 99% packet loss is possible if software is misbehaving. But this depends on the types of links involved. Gigabit Ethernet uses backpressure to control the flow, so if the path from source to destination is a single Gigabit Ethernet segment, the sending application may simply be slowed down and never see actual packet loss.

    For testing behaviour of software in case of packet loss, I would suggest two different simulations.

    1. On each packet drop it with a probability of 10% and transmit it with a probability of 90%
    2. Transmit up to 100 packets per second or up to 100KB per second, and drop the rest if the application would send more.

提交回复
热议问题