Protocolos de transporte: UDP frente a TCP para streaming
Comprenda por qué el streaming en tiempo real favorece UDP frente a TCP, cómo la latencia, el jitter y la pérdida de paquetes afectan a los medios en directo y cómo WebRTC añade fiabilidad sobre UDP.
Protocolos de transporte: UDP frente a TCP para streaming es una lección gratuita de Real-Time Streaming Systems (WebRTC + Live Data) en CoddyKit. Esta es la lección 4 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Real-Time Streaming Systems (WebRTC + Live Data), y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Real-Time Streaming Systems (WebRTC + Live Data) incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
Why Transport Matters
Before media can flow, it crosses the network - and the transport protocol shapes latency and quality. The two choices are TCP and UDP.
TCP in a Nutshell
TCP guarantees ordered, reliable delivery: a lost packet is resent before later data arrives. Great for files and pages, where correctness beats speed.
The Head-of-Line Problem
For live media, TCP's reliability backfires. One lost packet stalls everything behind it during the resend - head-of-line blocking - causing freezes.
UDP in a Nutshell
UDP is connectionless and fire-and-forget: no guaranteed order, no retransmits. Packets arrive fast or not at all - ideal for time-sensitive media.
Stale Data Is Useless
In a live call, a frame from two seconds ago is useless. Better to drop a lost frame and move on than wait for a resend - which is why streaming prefers UDP.
Latency, Jitter, Loss
Three metrics define real-time quality: latency (delay), jitter (arrival-timing variation), and packet loss. Keep all three low for a smooth call.
The Jitter Buffer
Since UDP packets arrive unevenly, the receiver uses a small jitter buffer to briefly hold and reorder them before playback - smoothing timing at the cost of tiny delay.
WebRTC Uses UDP
WebRTC sends media over UDP by default, layering RTP for sequencing and timestamps plus SRTP for encryption. It falls back to TCP only when UDP is blocked.
Coping With Loss
Instead of TCP-style retransmits, WebRTC fights loss smartly: FEC sends redundant data, NACK re-requests only critical packets, and concealment hides gaps.
Adapting to the Network
WebRTC constantly measures bandwidth. If the link degrades, congestion control lowers resolution or bitrate to keep the stream alive instead of stalling.
The Right Tool
Pick the right tool: TCP when every byte must arrive in order (downloads, APIs), UDP when timeliness wins (live audio and video) - just as WebRTC does.
Quick Check
Test your understanding of streaming transport.
Recap
Recap: streaming favors UDP because TCP's reliability causes freezes. WebRTC runs RTP/SRTP over UDP with a jitter buffer, FEC, NACK, and congestion control.
Preguntas frecuentes
¿La lección «Protocolos de transporte: UDP frente a TCP para streaming» es gratis?
Sí — el texto completo de «Protocolos de transporte: UDP frente a TCP para streaming» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Real-Time Streaming Systems (WebRTC + Live Data), actualiza a CoddyKit PRO. El curso de Real-Time Streaming Systems (WebRTC + Live Data) incluye 4 lecciones en total.
¿Qué aprenderé en «Protocolos de transporte: UDP frente a TCP para streaming»?
Comprenda por qué el streaming en tiempo real favorece UDP frente a TCP, cómo la latencia, el jitter y la pérdida de paquetes afectan a los medios en directo y cómo WebRTC añade fiabilidad sobre UDP. Practicas Real-Time Streaming Systems (WebRTC + Live Data) con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar Real-Time Streaming Systems (WebRTC + Live Data)?
No se requiere experiencia previa. Real-Time Streaming Systems (WebRTC + Live Data) en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 4 de 4.
¿Cuánto tiempo toma la lección «Protocolos de transporte: UDP frente a TCP para streaming»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de Real-Time Streaming Systems (WebRTC + Live Data)?
Sí. Cada lección de Real-Time Streaming Systems (WebRTC + Live Data) incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- ¿Qué es la comunicación en tiempo real?
- Descripción general de la tecnología WebRTC
- Explicación de los componentes principales de WebRTC
- Protocolos de transporte: UDP frente a TCP para streaming