如何对 UDP 协议进行拥塞控制? [英] How can I do congestion control for a UDP protocol?

查看:54
本文介绍了如何对 UDP 协议进行拥塞控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have a custom UDP protocol with multiple senders/receivers designed to send large files around as fast as possible. It is client/server based.

How can I detect congestion on the LAN to slow the rate of UDP packets being sent?

EDIT: please, no comments on the use of UDP whether it's suitable or not. This protocol uses UDP but reassembles packets into whole files when they arrive.

To rephrase the question: How do congestion control algorithms work and how is congestion detected?

解决方案

This is assuming you have to use UDP (TCP would be preferred).

From within the application, the only indication of network congestion is the loss of IP packets. Depending on how you have your protocol, you may want to do something like number each datagram going out, and if a receiver sees that it is missing some (or getting them out of order), send a message (or multiple) to the sender to indicate that there was loss of IP packets and to slow down.

There is a protocol called RTP (Real-time Transport Protocol) that is used in real time streaming applications.

RTP runs over UDP and RTCP(Real-time Transport Control Protocol) working with RTP provides measures for QoS(Quality of Service) like packet loss, delay, jitter, etc to report back to the sender so it knows when to slow down or change codecs.

Not saying you can use RTP, but it may be helpful to look at to see how it works.

这篇关于如何对 UDP 协议进行拥塞控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆