[14] UDP は、インターネットで使われるトランスポート層プロトコルの1つです。 TCP と並び非常によく使われています。
[18] UDP は信頼性を持ちません。再送制御やフロー制御、 輻輳制御は行いません。ただし検査和を含めることはできます。
[17] UDP では通信に用いるデータの単位をデータグラムと呼んでいます。
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
送信元ポート (0〜15 ビット) | 宛先ポート (16〜31 ビット) | ||||||||||||||||||||||||||||||
長さ (32〜47 ビット) | 検査和 (48〜63 ビット) | ||||||||||||||||||||||||||||||
データ (64 ビット〜) | |||||||||||||||||||||||||||||||
[2] 送信元ポート:
[3] 宛先ポート:
[4] 長さ:
[13] 16ビット整数ですから、最大値は 216-1 = 65535 です。ヘッダー分を除外すると payload の最大長は 65527 バイトです。
[5] 検査和:
[15] UDP は、 IP の上位層のプロトコルとして使います。
[8] IP 界面: UDPモジュールはIP頭部から送信元と宛先のIP番地とプロトコル欄を決定できなければなりません。
UDP/IP界面の受信操作に対する応答としてIP頭部も含めた全体を返すのもありです。 また、UDP側がIP頭部も埋めて渡すのもありです。 IP側では欄の整合性を検証してIP頭部の検査和を計算することになります。
[9] UDP を下位層として使ったプロトコルとしては、次のアプリケーション層プロトコルがあります。
[20] UDP から派生した次のプロトコルが存在しています。
[22] UDP を使ったアクセスを表すために udp:
URL scheme が使われることがあります。
[23] UDP はトランスポート層プロトコルであり、その上位のアプリケーション層プロトコルなしに
「UDP」を使うとだけ言っても意味がありません。 udp:
URL scheme の URL が何を表しているのかは、それ自体では自明ではありません。
[21] udp://:1234/{e06d8023-db46-11cf-b4d1-00805f6cbbea}
Media Player Classic
Prior to the extensions defined in this document, UDP tracker URLs that contained PATH and QUERY components were completely valid, but those components were invisible to the tracker. For example, from the tracker's perspective, the URL:
udp://tracker.example.com:80/dir?a=b&c=d
and the URL:
udp://tracker.example.com:80
were completely indistinguishable. This differs from the HTTP-based Tracker Protocol, and places restrictions on how a UDP tracker URLs may be used in practice.
Our primary motivation was to develop an extension to the UDP protocol to allow the PATH and QUERY components to be sent to UDP trackers. Rather than implementing a protocol change that only addressed this one issue, we chose to define an extension mechanism to allow future extensions to be easily added without risk of breaking the existing protocol.
User Datagram Protocol.
The required syntax for an UDP URL is:
udp://hostname:port[?options]
options contains a list of &-separated options of the form key=val.
Use ffmpeg to stream over UDP to a remote endpoint:
ffmpeg -i input -f format udp://hostname:port
Use ffmpeg to stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
Use ffmpeg to receive over UDP from a remote endpoint:
ffmpeg -i udp://[multicast-address]:port ...
[29] www.twitch.tvの名前が引けない、もしくはチェックサムが0x0000のUDPパケットの件のまとめ - (ひ)メモ () <http://d.hatena.ne.jp/hirose31/20160127/1453870603>
udp://[[<source address>]@[<bind address>][:<bind port>]]
UDP stream sent by a streaming server