What is JSEP?

JavaScript Session Establishment Protocol (JSEP) defines how WebRTC applications use the Session Description Protocol (SDP) to negotiate media sessions between peers. It provides the signaling framework for WebRTC peer connections.

Key Concepts

Offer/Answer Model

Structured negotiation where one peer creates an offer and the other responds with an answer.

SDP Munging

Application-level modification of SDP for custom requirements.

ICE Candidates

Network connectivity information exchange for NAT traversal.

Media Negotiation

Codec selection, bandwidth limits, and media format agreement.

SDP Usage in WebRTC

Session Description

Media types, codecs, transport addresses, and session metadata.

Bundle Policy

Multiplexing multiple media streams over a single transport.

RTCP Feedback

Real-time control protocol extensions for WebRTC optimization.

JSEP Workflow

  1. Create Offer: Calling peer generates SDP offer with media capabilities
  2. Set Local Description: Offer is set as local description
  3. Send Offer: SDP offer is transmitted via signaling channel
  4. Receive Offer: Called peer receives and processes the offer
  5. Create Answer: Called peer generates SDP answer
  6. Set Remote Description: Answer is set as remote description
  7. ICE Gathering: Both peers exchange ICE candidates
  8. Media Flow: Direct peer-to-peer media communication begins

Additional Resources