0Pricing
Real-Time Streaming Systems (WebRTC + Live Data) · 강의

SDP: 세션 설명 프로토콜

연결을 협상하기 위해 피어 간에 교환되는 미디어 형식, 코덱, 네트워크 정보를 SDP가 설명하는 방식을 학습합니다.

SDP: 세션 설명 프로토콜은(는) CoddyKit의 무료 Real-Time Streaming Systems (WebRTC + Live Data) 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Real-Time Streaming Systems (WebRTC + Live Data) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Real-Time Streaming Systems (WebRTC + Live Data) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

What is SDP?

SDP stands for Session Description Protocol. It's a text-based format used in WebRTC to describe the capabilities and parameters of a media session.

Think of it as a blueprint for what kind of audio, video, and data a peer wants to send or receive, and how it can be reached.

SDP's Role in WebRTC

Before two WebRTC peers can send data directly, they need to agree on many things:

  • What media types (audio, video, data) they support.
  • Which codecs to use (e.g., Opus for audio, VP8 for video).
  • Their network addresses and connection methods.

SDP is the standard way to exchange this crucial information.

SDP in Offer/Answer

WebRTC uses an "Offer/Answer" model for negotiation. One peer creates an SDP Offer, describing its capabilities. The other peer receives it and creates an SDP Answer, indicating its own capabilities and agreement.

This exchange happens via a signaling server, which we discussed in the previous lesson.

SDP Message Structure

An SDP message is a collection of lines, each starting with a single lowercase letter followed by an equals sign (=). These lines are grouped into a session description and one or more media descriptions.

Common lines include: v=, o=, s=, t=, c=, m=, and a=.

SDP: Version & Origin

Every SDP message begins with a version line and an origin line:

  • v=0: Specifies the SDP protocol version. Always 0 for WebRTC.
  • o= IN IP4
    : Describes the session's originator and identifier.

The <sess-id> and <sess-version> are unique numbers, and <address> is typically 127.0.0.1 for local generation.

SDP: Session Name & Time

Next, we find the session name and time description:

  • s=-: The session name. Often just a hyphen for WebRTC.
  • t=0 0: The session's active time. 0 0 means permanent/always active for WebRTC.

These lines provide basic context for the overall session.

SDP: Connection Data

The c= line provides connection data, specifically the IP address for the session. In WebRTC, this is often set to 0.0.0.0 or 127.0.0.1 as the actual peer-to-peer connection addresses are negotiated later via ICE candidates.

Example: c=IN IP4 0.0.0.0

SDP: Media Descriptions (`m=`)

The m= line is critical! It describes a specific media stream (audio, video, or data channel). An SDP can have multiple m= lines.

Format: m=

  • <media>: audio, video, or application (for data channels).
  • <port>: The port number (often 9 for WebRTC, actual port from ICE).
  • <protocol>: E.g., UDP/TLS/RTP/SAVPF.
  • <fmt list>: A list of supported payload types/codecs.

SDP: Attributes (`a=`)

a= lines provide additional attributes for the session or a specific media stream. They are highly flexible and carry a lot of WebRTC-specific information.

  • a=rtpmap: /: Maps payload types to codecs.
  • a=fingerprint:...: TLS certificate fingerprint.
  • a=sendrecv, a=sendonly, a=recvonly: Directionality of media.
  • a=ice-ufrag, a=ice-pwd: Used for ICE connectivity checks.

See a Simplified SDP

Here's a simplified example of what an SDP offer might look like. Notice the different lines and their roles in describing the session and media capabilities.

Try running it to see the raw SDP text!

function main() {
  const sdpExample = `v=0
o=- 3749449080 3749449080 IN IP4 127.0.0.1
s=-
t=0 0
c=IN IP4 0.0.0.0
m=audio 9 UDP/TLS/RTP/SAVPF 111
a=rtpmap:111 opus/48000/2
a=mid:audio
a=sendrecv
a=ice-ufrag:abcdefg
a=ice-pwd:hijklmn
a=fingerprint:sha-256 A1:B2:C3:D4:E5:F6:A7:B8:C9:D0:E1:F2:A3:B4:C5:D6:E7:F8:A9:B0:C1:D2:E3:F4:A5:B6:C7:D8
`;
  console.log("Simplified SDP Offer:");
  console.log(sdpExample);
}

main();

Quick Check on SDP

Which SDP line primarily describes the type of media (audio, video, or data), its associated port, transport protocol, and supported formats?

Recap: SDP Essentials

Great job! You've learned about SDP, the Session Description Protocol, which is fundamental to WebRTC.

  • SDP is a text format for describing media and network capabilities.
  • It's used in the Offer/Answer model to negotiate connections.
  • Key lines include v=, o=, s=, t=, c=, m=, and a=.
  • The m= line describes media, and a= lines provide rich attributes.

Next, we'll dive into ICE candidates, which help peers find the best network path!

자주 묻는 질문

“SDP: 세션 설명 프로토콜” 강의는 무료인가요?

네 — “SDP: 세션 설명 프로토콜” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Real-Time Streaming Systems (WebRTC + Live Data) 강의 전체를 잠금 해제할 수 있습니다. Real-Time Streaming Systems (WebRTC + Live Data) 강의에는 총 4개의 강의가 포함되어 있습니다.

“SDP: 세션 설명 프로토콜”에서 뭘 배우나요?

연결을 협상하기 위해 피어 간에 교환되는 미디어 형식, 코덱, 네트워크 정보를 SDP가 설명하는 방식을 학습합니다. 브라우저에서 직접 실행하는 실습 코드로 Real-Time Streaming Systems (WebRTC + Live Data)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Real-Time Streaming Systems (WebRTC + Live Data)을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Real-Time Streaming Systems (WebRTC + Live Data)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“SDP: 세션 설명 프로토콜” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Real-Time Streaming Systems (WebRTC + Live Data) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Real-Time Streaming Systems (WebRTC + Live Data) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 시그널링 서버의 역할
  2. SDP: 세션 설명 프로토콜
  3. ICE 후보와 연결성
  4. 재협상과 연결 상태
← Real-Time Streaming Systems (WebRTC + Live Data)(으)로 돌아가기