• Home
  • About
    • Studying Programming photo

      Studying Programming

      This page stands for organizing my programming study.

    • Learn More
    • Email
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

webRTC

24 Nov 2020

Reading time ~1 minute

#webRTC란? webRTC (Web Real-Time Communcication)W3C에서 제시한 음성 통화, 영상 통화, P2P 파일 공유를 위한 API로 간단히 브라우저에서 별도의 플러그인 없이 동작없이 real-time으로 communication할 수 있는 API이다.

장점

  1. 별도의 telecommuncation 지식 없이 간단하게 real-time communication을 구현할 수 있다.
  2. 대부분의 브라우저들이 지원하므로 플러그인이 따로 필요없고 때문에 client 프로그램을 배포할 필요도 없다.
  3. 서버없이 클라이언트와 클라이언트 간의 p2p connection을 지원하므로 서버 부하가 적다. 물론 데이터는 암호화되어 있다

WebRTC Steps

  1. Signaling
  2. Connecting
  3. Securing
  4. Communicating

How Does WebRTC Work?

두명이 public IP를 서로 알면 통신이 가능 => Signaling 서버를 통해 public IP를 교환

STUN

근데 private IP는??? 내 public IP를 알려면 외부에서 확인해야됨 => 이걸 해주는 것이 STUN Server TURN Server => backup server : p2p connection을 이룰 수 없을 때 사용 => 전통적인 방식으로 P2P connection이 아님

webrtcforthecurious.com ##SDP :Session Description Protocol P2P 연결에서 사용자 간의 미디어 타입과 포맷에 대해 협상하기 위해 개발된 프로토콜

JSON syntax

{ key : value }

SDP syntax

key=value

WebRTC에서 쓰이는 SDP 키 값

  • v : Version
  • o : Origin, contains a unique ID userful for renegotiations
  • s : Session Name
  • t : Timing
  • m : Media Description
  • a : Attribute
  • c : Connection Data

##ICE : Interactive Connectivity Establishment 피어 간 연결을 책임지는 framework

##RTP : Real-time Transport Protocol && RTCP : Real-time Transport Control Protocol RTP는 멀티미디어 데이터 전송을 위한 프로토콜 RTCP는 RTP에 대한 컨트롤을 맡고 있는 프로토콜로써 데이터 전송 통계나 packet loss등 다양한 통계정보를 제공하기도 한다. RTP연결 하나당 RTCP연결하나가 필요하다

##SCTP : Stream Control Transimssion Protocol RTP와 역할은 비슷하지만 멀티미디어 데이터를 않는다는 것에서 다르다 ex.) Real-time network games, Game player action events, Asset exchange, Text chat

##DTLS : Datagram Transport Layer Security && SRTP : Secure Real-time Transport Protocol Security를 담당

##NAT Traversal A New Method for Symmetric NAT Traversal in UDP and TCP https://alnova2.tistory.com/1110

mungesdp (webRTC protocol을 써볼 수 있다)

quic-1rtt



webmultimedia Share Tweet +1