1 Porting VoIP Applications to DCCP Speaker: Jia-Yu Wang Adviser: Quincy Wu School: National Chi Nan...

Post on 03-Jan-2016

235 views 8 download

Tags:

Transcript of 1 Porting VoIP Applications to DCCP Speaker: Jia-Yu Wang Adviser: Quincy Wu School: National Chi Nan...

1

Porting VoIP Applications to DCCP

Speaker: Jia-Yu Wang

Adviser: Quincy Wu

School: National Chi Nan University

2

Outline

Introduction Linphone

The architecture of Linphone Linphone original Function call Porting Linphone to DCCP Implementing DCCP Function call

Implementation Conclusion Reference

3

Introduction

Datagram Congestion Control Protocol (RFC 4340)

TCP UDP DCCP

Reliable Yes No No

Connection-Oriented Yes No Yes

Congestion Control Yes No Yes

Sequence Number Yes No Yes

4

Introduction (Cont.)

Unreliable No re-transmissions

Reliable handshakes for connection setup and teardown

Modular congestion control Can detect congestion and take avoiding action Different algorithms can be selected – CCID

TCP-like (CCID2) TCP Friendly Rate Control (CCID3)

Packet sequence numbers

5

Introduction (Cont.)

DCCP Applications Video streaming Audio streaming IP Telephony

6

SIP (Session Initiation Protocol)

INVITE

180 Ringing

200 OK

ACK

BYE

200 OK

Media Session (RTP)

Client Server

7

RTP (Real-time Transport Protocol) over DCCP

RTP

UDP

IP

Data link layerPhysical layer

DCCP

Network layer

Transport layer

Application layer

8

DCCP Connection

Client Server

(1) Initiation

1.DCCP-Request

2.DCCP-Response

3.DCCP-Ack

(2) Data transfer

4.DCCP-Data, DCCP-Ack, DCCP-DataAck

5.DCCP-Data, DCCP-Ack, DCCP-DataAck

6.DCCP-CloseReq

(3) Termination

7.DCCP-Close

8.DCCP-Reset

9

Linphone

Linphone is an internet phone

Linphone complies to the SIP protocol

Linphone is free-software (or open-source), you can download and redistribute it freely

10

The architecture of Linphone

Linphone

console

coreapi

eXosip2 mediastreamer2

osip2 oRTP

gnome

11

coreapi/linphonecore.clinphone_core_init_media_streams()

mediastreamer2/src/audiostream.caudio_stream_new()

mediastreamer2/src/audiostream.ccreate_duplex_rtpsession()

oRTP/src/rtpsession_inet.crtp_session_set_local_addr()

oRTP/src/rtpsession_inet.ccreate_and_bind()

coreapi/linphonecore.clinphone_core_start_media_streams()

mediastreamer2/src/audiostream.caudio_stream_start_now()

mediastreamer2/src/msrtp.creceiver_process()

mediastreamer2/src/msrtp.csender_process()

oRTP/src/rtpsession.crtp_session_recvm_with_ts()

oRTP/src/rtpsession.crtp_session_sendm_with_ts()

oRTP/src/rtpsession_inet.crtp_session_rtp_recv()

oRTP/src/rtpsession_inet.crtp_session_rtp_send()

mediastreamer2/src/audiostream.caudio_stream_start_full()

oRTP/src/rtpsession_inet.crtp_session_set_remote_addr()

mediastreamer2/src/msrtp.creceiver_preprocess()

Linphone original Function call

1.Create socket and RTP session

2.Set RTP session

3.Receive and Send RTP packets

12

Porting Linphone to DCCP

Create 2 RTP Session DCCP connection is uni-directional

Connection-Oriented Receiver socket need to use Blocking for accept Receiver socket need to accept the establishment

of waiting for sender socket connect Set socket parameters

Socket parameters need to use DCCP protocol

13

Implementing DCCP Function call

coreapi/linphonecore.clinphone_core_init_media_streams()

mediastreamer2/src/audiostream.caudio_stream_new()

oRTP/src/rtpsession_inet.crtp_session_set_local_addr()

coreapi/linphonecore.clinphone_core_start_media_streams()

mediastreamer2/src/audiostream.ccreate_duplex_rtpsession_recv()

mediastreamer2/src/audiostream.ccreate_duplex_rtpsession_send()

oRTP/src/rtpsession_inet.ccreate_and_bind_recv()

oRTP/rtpsession_inet.ccreate_and_bind_recv()

SOCK_DCCP=6;SOL_DCCP=269;DCCP_SOCKOPT_PACKET_SIZE=1;DCCP_SOCKOPT_SERVICE=2;IPPROTO_DCCP=33;

socket(ai_family, SOCK_DCCP, IPPROTO_DCCP);setsockopt(sock,SOL_DCCP,DCCP_SOCKOPT_PACKET_SIZE, (char*)&pkt_size,sizeof(pkt_size));setsockopt(sock,SOL_DCCP,DCCP_SOCKOPT_SERVICE,(char*)&pkt_size,sizeof(pkt_size));

14

Implementing DCCP Function call (Cont.)

coreapi/linphonecore.clinphone_core_start_media_streams()

Accept & connect

mediastreamer2/src/audiostream.caudio_stream_start_now()

oRTP/src/rtpsession_inet.ccreate_and_bind_random()

mediastreamer2/src/msrtp.csender_preprocess()connect()

oRTP/src/rtpsession_inet.crtp_session_rtp_recv_accept()

oRTP/src/rtpsession_inet.crtp_session_set_remote_addr()

oRTP/src/rtpsession_inet.crtp_session_set_local_addr()

mediastreamer2/src/msrtp.creceiver_preprocess()

oRTP/src/rtpsession_inet.ccreate_and_bind()

mediastreamer2/src/audiostream.ccreate_duplex_rtpsession2()

mediastreamer2/src/audiostream.caudio_stream_start_full_recv()

mediastreamer2/src/audiostream.caudio_stream_start_full_send()

oRTP/src/rtpsession_inet.ccreate_and_bind_send()

15

Implementing DCCP Function call (Cont.)

mediastreamer2/src/msrtp.creceiver_process()

mediastreamer2/src/msrtp.csender_process()

oRTP/src/rtpsession.crtp_session_recvm_with_ts()

oRTP/src/rtpsession.crtp_session_sendm_with_ts()

oRTP/src/rtpsession_inet.crtp_session_rtp_recv()

oRTP/src/rtpsession_inet.crtp_session_rtp_send()

Accept & connect

16

Implementation

17

Experimental Result

IPERF to generate the TCP flow oRTP to generate DCCP (CCID2) flow and UDP flow Bandwidth : 10Mb/s , Total Time : 30 seconds. Repeating test : 100

TCP 7.74 Mbit/s

DCCP 2.02 Mbit/s

TCP 0.10 Mbit/s

UDP 9.66 Mbit/s

18

Conclusion

Implementing RTP over DCCP

Porting Linphone to DCCP

19

Reference

Datagram Congestion Control Protocol (RFC 4340) CCID2-TCP-like Congestion Control (RFC 4341) CCID3-TCP-Friendly Rate Control (TFRC) (RFC4342) RTP and the Datagram Congestion Control Protocol (DCCP)

draft-ietf-dccp-rtp-07.txt Linphone

http://www.linphone.org/index.php/eng