23
P2P VoIP Speaker : Ching Chen Chang Date: 2007/09/27

P2P VoIP Speaker : Ching Chen Chang Date: 2007/09/27

Embed Size (px)

Citation preview

P2P VoIP

Speaker : Ching Chen Chang

Date: 2007/09/27

2

Outline

Motivation Related Work

P2P Enum GSM 6.10

P2P VoIP beta 1.1 Description Protocol Scenario Update Packages

Conclusion Reference

3

Motivation

SIP Proxy Server

SIP SIP

UA1 UA2

If we use SIP, we usually need a SIP server to handle the signaling.

RTP

4

Motivation(2/2)CalleeCaller

INVITE

180 Ringing

SIP Server

ACK

INVITE

180 Ringing

200 OK200 OK

ACK

RTP

BYEBYE

200 OK

200 OK

5

Related Work

P2P Point To Point.

Enum Enumeration, a user-defined type of C/C++.

GSM 6.10 An audio codec is usually used by the cell phone.

6

P2P

P2P(Point To Point). A link commonly used to establish a direct connection be

tween two nodes.

www.tcgs.tc.edu.tw/~sagit/info/p4.htm

7

Enum

An enumeration is a user-defined type consisting of a set of named constants called enumerators.

#define SPRING 0 #define SUMMER 1 #define FALL 2#define WINTER 3

enum { SPRING, SUMMER, FALL, WINTER };

8

GSM 6.10(1/2)

GSM(Global System for Mobile Communications) 

A lossy CBR(Constant Bit Rate) audio compression codec.  

GSM is also a popular global mobile phone standard.

9

GSM 6.10(2/2)

Format PCM GSM 6.10

Samples per second 8000 HZ 8000 HZ

Bit Rate (bits/second)

128kbs 13kbs

Channel mono mono

Bits per sample 16 1.625

10

Description(1/2)

P2P Internet Phone. Open Source code.

http://phonesnd.com/p2pv11.zip Only work in a local network. It works without SIP and RTP. It defines its own communication protocol. Simultaneous work with maximal 5 clients

11

Connect

Record Receive

Send Play

Call out

Encode Decode

End call

The voice packages are transmitted in a format GSM6.10.

Voice packages and service information use one and the same UDP port: 4444.

Description(2/2)

12

Protocol(1/2)

enum _PROTOCOL{_NULL_ = 0,_PROGRAMM_ABORT,_CONTACT_REFRESH,_CONTACT_ERASE,_CONTACT_ADD,_CONTACT_PING,_CONTACT_PING_IN,_CONTACT_PING_OUT,_CONTACT_PONG,_CONTACT_PONG_IN,_CONTACT_PONG_OUT, _CONTACT_OFFLINE,_CONTACT_OFFLINE_IN,_CONTACT_OFFLINE_OUT,_CLIENT_SHEET_SHOW,_CLIENT_SHEET_HIDE,_CLIENT_SHEET_NAME,_CLIENT_SHEET_IMAGEINDEX,_CLIENT_CONNECT_DURATION,_CLIENT_PROTOCOL,_TIME_OUT, CALL_IN_,CALL_OUT_,_I_,_I_180_,_I_200_, _I_480_,_A_,_G_,_G_200_,_G_486_,_C_,_C_200_,_C_480_,_LA_,_LG_,_ERROR_PLAY,};

13

Protocol(2/2)

_CONTACT_PING 510 516

_CONTACT_PONG 810 816

_CONTACT_OFFLINE 1110 b16

_I_ 2310 1716

_I_180_ 2410 1816

_I_200_ 2510 1916

_A_ 2710 1b16

_C_ 3110 1f16

_C_200_ 3210 2016

_LA_ 3410 2216

14

Ping(1/2)

User onlineUser online

_CONTACT_PONG

_CONTACT_PING_CONTACT_PING_IN

_CONTACT_PONG_OUT

_CONTACT_PING_OUT

_CONTACT_PONG_IN

Ping all contacts on the contact list per minute. 

  

……

15

Ping(2/2)User offlineUser online

_CONTACT_PING_CONTACT_PING_OUT

_CONTACT_PING

_CONTACT_PING Resend two

times if the contact doesn’t respond.

……

_CONTACT_PING

_CONTACT_PING

_CONTACT_PING

……

1 minutes

1 minutes

16

Call

_I_

_I_180_

_I_200_

  CalleeCaller

_C_200_

   _C_

 _A_

 _I_180_ _I_180_

_I_200_ _A_

 _A_

_I_

  Voice transmission

   _C_

_C_200__C_200_

state == CALL OUTstate == CALL IN

17

Cancel

_I_

_I_180_

  CalleeCaller

_C_200_

   _C_

 _I_180_ _I_180_

_I_

   _C_

_C_200__C_200_

state == CALL OUT

state == CALL IN

18

No answer

_I_

_I_180_

  CalleeCaller

 _I_180_ _I_180_

_I_

 _LA_

If state == CALL IN && receive _LA_

state == CALL OUT

state == CALL IN

If state == CALL OUT && 6 seconds

_LA_

 _LA_

_LA_

…….…

… …

If state == CALL OUT && 6 seconds

If state == CALL IN && receive _LA_

19

Log out

User 2 would modify the information of User 1. If two users are on the phone, User 2 would pretend to

receive an _C_ protocol to terminate the call.        

_CONTACT_OFFLINE_IN

User 2User 1

_CONTACT_OFFLINE

20

Packages

Signaling – 4 bytes of the data contains the protocol.

Voice packages – 33 bytes data. The first message of the call has the data

including the 4-byte protocol and the caller’s account.

21

Update

2 Timers Timer1 (Interval 100ms)

Contacts List Clients List Speaker & Microphone Volume

Timer2 (Interval 500ms) Ring Start Voice

22

Conclusion

SIP server can provide more service. P2P would produce less delay.

23

Reference

Phonesnd - Network&Sound Software

http://phonesnd.com/ Audio Compression Manager --

Wave File Compression Codecs Compared

http://www.nch.com.au/acm/index.html