1 / 128

snom VoIP Primer Christian Stredicke

snom VoIP Primer Christian Stredicke. June 2003. 1. Introduction to VoIP. 2. H.323. 3. SIP. 4. snom technology suite. 5. Installation of snom 4S. 6. Conclusion. 7. Test. The Internet evolved from a research network into a real-time communications network. PPPoE. PPTP. PPP. TLS.

xiang
Download Presentation

snom VoIP Primer Christian Stredicke

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. snom VoIP PrimerChristian Stredicke June 2003

  2. 1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

  3. The Internet evolved from a research network into a real-time communications network PPPoE PPTP PPP TLS DiffSrv SOAP IM RSVP SIP HTTP Presence IPv6 WAP PBX SMTP (Email) SNMP ftp POP3 AAAA DNS IPv4 DHCP NAT SRV TCP ENUM UDP RIP NAPTR

  4. The Internet Protocol (IP) is based on sending packets Example anatomy of an audio packet Ethernet Header IP UDP RTP G.711 Ethernet Checksum • Preamble • 6 Byte Src • 6 Byte Dst • 2 Byte Type • Version • Length • DiffSrv • ID • Flags • Fragment • Time to live • Protocol • Checksum • Source • Destination • 20 Bytes • Source Port • Dest Port • Length • Checksum • 8 bytes • Version • Padding • Extension • Source IDs • Marker • Payload Type • Sequence Number • Timestamp • Sync ID • RTP = “Real-time transport protocol” • 54 Bytes header for every audio packet = 21.6 kBit @ 20 ms! • Packets can easily be viewed with Ethereal (www.ethereal.com)

  5. Sending voice packets is like sending freight with forwarders* Arrive with jitter, out of order Receiver in India  May get lost during transportation  Local Forwarder  LH901    LH710    Local Forwarder  May take different routes  Packet are sent with Priority tag Sender in Germany * Just faster!

  6. Computer networks are designed for high bandwidth, but no delivery guarantee • ISDN BRI = 128 kBit/s • Ethernet 10 BT = 78 BRI • Ethernet 100 BT = 781 BRI • At 39 € for a PC card! • Ethernet 1000 BT = 7812 BRI • WLAN 802.11 • 11 MBit/s = 85 BRI • 54 MBit/s = 421 BRI • 802.16

  7. RTP sometimes has to pass bottlenecks, especially on the network “edges” TCP (http) may block B‘s RTP traffic Customer can control outgoing traffic Bandwidth Other Phone TCP RTP Router Router Distance RTP Other DSL Line Backbone

  8. Amongst the attempts to get telephony working on a IP-based network SIP seems to be the best MGCP H.323 MEGACO H.323v2 SIP (RFC2543) H.450 H.323v4 SIP (RFC3261 ff.) (Avaya etc.) (Skinny) ISDN over IP

  9. H.323 and SIP fight for customer acceptance H.323 SIP • „Official“ standard • Some devices in the market already („legacy devices“) • Most devices do not support supplementary services (H.450) • Similar to HTTP • Less requirement on program space than H.323 • Suitable for large operators • Cisco and Microsoft support SIP • Darling of the Internet society • Almost everybody jumping on the train

  10. Microsoft XP is going for the VoIP industry • Getting Microsoft Windows XP means getting a SIP client • 70 ms latency end to end, kernel support • Acoustic echo cancellation („hands free speaking“) • Presence list • Stability is ok • Microsoft-like nice user interface • Windows XP embedded and Windows Pocket PC • Includes SIP stack as well as other features • Many gateways and stand alone equipment will this stuff

  11. 1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

  12. Basic elements of an H.323 system • Terminals • Telephones • Videophones • IVR devices • Voicemail systems • Softphones • Gateways • Gatekeepers • Multipoint Control Units (MCUs)

  13. Gateways • Gateways interface an H.323 network to other networks (ISDN,PSTN etc). • Composed of Media Gateway Controller (MGC) and Media Gateway (MG). • MGC handles all the call signaling functions. • MG handles the media related functions.

  14. Gatekeepers • Optional Component of an H.323 system. • Responsible for Registration, Address translation, Admission control, Bandwidth control and Zone management functions (RAS). • Logical component of an H.323 system but Can be co-located within a gateway. • Can perform direct or routed call signaling.

  15. Media Control Units (MCUs) • Responsible for managing multipoint conferences (two or more endpoint engaged in a conference). • The MCU contains a Multipoint Controller (MC) that manages the call signaling and may optionally have Multipoint Processors (MPs) to handle media mixing, switching, or other media processing.

  16. A typical H.323 network

  17. A simple H.323 call

  18. The big problem: H.323 is not really interoperable • Most vendors are stuck in interoperability problems • ASN.1 reduces productivity • Most „implementers“ used openh323 • The star is falling • Software concept works for stand alone PC, but can not be used on embedded systems Private Small Business Professional H.323 SIP Proprietary ROSE Effort ASN.1 openh323 Features

  19. 1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

  20. 3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

  21. The URL is the unique description of a telephony contact • New URL types: • „Christian Stredicke“ <sip:cs@snom.de> • „Christian Stredicke“ <tel:03039907830@telekom.de> • Entering URL in hard phones is not so much fun • Some tricks to ease the pain • Automatic appending of domain • Address book, redial • Using TAPI for dialing from PC • Clever number setup („cs“, „np“, „tb“, ...) • URL must always start with the “sip” scheme • May contain a large range of characters like +, -, %, . • Display names are encoded using UTF-8 (Unicode)

  22. SIP proxies search for the right person • Registration includes information about probability of presence • Moving the mouse changes the probability to 1.0 • Leaving the mouse untouched lowers continuously the probability • Mailbox has low probability (but above 0.0) • Sequential forking: • Ringing one potential endpoint after another • Parallel forking • Calling several parties at the same time • The first one picking up the call gets the call • Phones can register for several accounts with different probabilities

  23. 3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

  24. „Internet“ „Intranet“ „VPN“ The SIP architecture looks like a mixture of HTTP and Email Proxy 2 Gateway 2 Proxy 1 UA Registrar 1 UA Gateway 1 Registrar 2 UA UA UA UA

  25. The SIP proxy can be compared to a HTTP proxy: Taking complexity away from the client • Finding a destination • Comparable to HTTP proxy • But real-time • Requests may be redirected to other proxies • Stateless proxies • Just forwarding packets • Stateful proxies • Taking care of a call • Other functions • Billing • Maintenance • “Outbound proxy” handles all traffic of a dumb phone

  26. A stateless proxy just forwards packets to the right destination Proxy (1) INVITE (2) INVITE (3) 100 Trying (4) 100 Trying (5) 180 Ringing (6) 180 Ringing (7) 200 Ok (8) 200 Ok (9) ACK (10) ACK

  27. A stateful proxy may fork a call to multiple destinations Proxy (1) INVITE (2) 100 Trying (3a) INVITE (3b) INVITE (4a) 100 Trying (4b) 180 Ringing (5) 180 Ringing (6a) 100 Trying (6b) 180 Ringing (7) 200 Ok (8) 200 Ok (9) ACK (10) ACK

  28. Registrars remember where users can be found • Close relationship with proxies • Usually registrar and proxy are the same program • Registrars keep a list of registrations • One user can be found in different locations • Comparable to gatekeeper registration

  29. User agents (UA) are the endpoints of a SIP call • Usually a hard or soft phone • Gateways are user agents as well • UA client (UAC) initiates something • UA server (UAS) answers something • UAS and UAC may change during a call • From and To-Fields are exchanges in this case

  30. SIP URLs provide a powerful way to describe a contact and its parameters • Like HTTP URL • Examples: • sip:cs@snom.de: Simple URL • <sip:cs@snom.de:5061>: Adding port number • “Fred F. Feuerstein” <sip:fff@snom.de>: Real name • <sip:fff@snom.de>;q=1.0: Probability of presence • <sip:fff@snom.de:5061;transport=tls>: Transport layer • <sip:fff@snom.de>;q=1.0;expires=360: Several parameters • sip:j.doe@big.com?subject=project%20x&priority=urgent • Details in RFC 3261

  31. printf() instead of ASN.1-Compiler Line termination with \r\n (tribute to MS-DOS) Double line termination means end of message body Attachments may follow of Content-Length indicates so Line continuation if new line starts with space See Email and HTTP. Example: REGISTER sip:cs@snom.de SIP/2.0 From: „Christian Stredicke“ <sip:cs@snom.de> ;q=1.0 To: „Christian Stredicke“ <sip:cs@snom.de>;q=1.0 Cseq: 1 REGISTER Content-Language: en User-Agent: snom V1.8b Content-Type: image/jpeg Content-Length: 376 Jg45tzw49tz59p q3tz erihgisrgz dfkjh skdfgh hfg sdlfjgh sdfgjh sldfghsfghsdfhg lsfhg lskfgh sfkgh sfkgh slkfdg Messages are encoding using ASCII characters (bit hackers go home!)

  32. Principle of communication between entities • Requests • Initiate something • Have something like „REQUEST sip:address SIP/2.0“ in the first line of the message • Response • Responds to a request • Look like „SIP/2.0 486 Busy Here“ in the first line • Codes < 200 are intermediate responses • Codes >= 200 and < 300 are success responses • Codes >= 300 are failure responses • Acknowledge • Stands a little bit out in the communication • Terminates an INVITE transaction

  33. „Via“ headers trace the path of a request and allow a respond to travel that path back • Every instance tags the path of a request taken so far by adding a via field • Replies must be send back popping Via fields off the message • Forking proxies add branch parameters to the via fields to tag different branches Via: host3;branch=123.2 Via: host2 Via: host1 Via: host3;branch=123.1 Via: host2 Via: host1 Via: host2 Via: host1 Via: host1

  34. „Record-Route“ fields are used to ensure that some proxies are part of subsequent requests • SIP does not mandate that requests between two UA take the same path • Actually, SIP encourages taking a direct path even for ACK • That causes problems with stateful proxies and billing systems • Record-Route ensures that proxies that add themselves to the route are in the message chain in future requests 1st request Subsequent requests 5 Record-Route: h2, h4 Contact: h1 4 Record-Route: h2 Contact: h1 3 Record-Route: h2 Contact: h1 Route: h4 2 Contact: h1 Route: h2, h4 1

  35. Every message has a sequence number • CSeq field • CSeq: 1 REGISTER • CSeq: 1 INVITE • Sequence numbers are kept within: • A call • A registration • A notify, subscribe, ... • UAC and UAS keep their own sequence numbers for requests • If a client receives a message with an CSeq number less or equal to the one received, it is takes an message repetition • Relevant for UDP

  36. SIP can be transported over UDP, TCP and TLS • UDP • Messages may get lost • Mandatory • Repetition of messages: • Requests until a response arrives (same CSeq) • Responses if a request repetition arrives • ACK if a response arrives twice • TCP • Like HTTP • Content-Length becomes very important • TLS • Is a SSL (Secure Socket Layer) version • Keeps SIP traffic secure • Like TCP • Different port to avoid misunderstandings (e.g. 5061)

  37. To save some space, short names of header fields are available • Saving space makes up 0.000143 % of an average call • In other words, does not make sense • May help to keep the UDP message size boundary (but not really) • However, feature is mandatory • From = f • To = t • Content-Length: l • Call-ID: I • See draft

  38. 3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

  39. Registration is a simple mechanism to give the UA an identity • UA sends REGISTER request to registrar (or outbound proxy) • Registrar answer with response • 200 Ok: Registration is ok • 404 Not Found: User may not register here • 403 Not Found: User is not known • 100 Trying: Intermediate response • 401 Authentication Required: UA has to provide a password • Any Response!

  40. Phone wants to register as “1” at registrar “62.254.248.7” Address does not need to be a dots-and-number address Registrar returns all registrations for this number Expiry time indicates how long the registration will last and is determined by the registrar Example taken from Cisco proxy registration REGISTER sip:62.254.248.7 SIP/2.0 From: <sip:1@62.254.248.7> To: <sip:1@62.254.248.7> Call-ID: 200108161729222931115@62.254.248.56 Date: Thu, 16 Aug 2001 17:29:22 GMT CSeq: 1 REGISTER Contact: <sip:1@62.254.248.56:5060;transport=udp> Via: SIP/2.0/UDP 62.254.248.56:5060 Expires: 3600 Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010816172922294833@62.254.248.56 From: <sip:1@62.254.248.7> To: <sip:1@62.254.248.7> CSeq: 1 REGISTER Contact: <sip:1@62.254.248.56:5060;transport=udp>;expires="Thu, 16 Aug 2001 15:31:14 GMT" Contact: <sip:1@62.254.248.213;method=INVITE>;description="OPEN";expires="Thu, 16 Aug 2001 21:57:01 GMT" Expires: 3600 Content-Length: 0 Example 1: Successful registration

  41. Phone wants to register as “1” at registrar “a1.sipbakeoff.org” Registrar responds with intermediate message 100 Trying 400 Code indicates that something went wrong 403 means that there was no account set up at the registrar REGISTER sip:a1.sipbakeoff.org SIP/2.0 From: <sip:1@a1.sipbakeoff.org> To: <sip:1@a1.sipbakeoff.org> Call-ID: 200108161729012822929@62.254.248.56 Date: Thu, 16 Aug 2001 17:29:01 GMT CSeq: 1 REGISTER Contact: <sip:1@62.254.248.56:5060;transport=udp> Via: SIP/2.0/UDP 62.254.248.56:5060 Expires: 3600 Content-Length: 0 SIP/2.0 100 Trying Via: SIP/2.0/UDP 62.254.248.56:5060 From: sip:1@a1.sipbakeoff.org To: sip:1@a1.sipbakeoff.org Call-ID: 200108161729012916541@62.254.248.56 CSeq: 1 REGISTER Content-Length: 0 SIP/2.0 403 - Forbidden Via: SIP/2.0/UDP 62.254.248.56:5060 From: sip:1@a1.sipbakeoff.org To: sip:1@a1.sipbakeoff.org Call-ID: 200108161729012822929@62.254.248.56 CSeq: 1 REGISTER Content-Length: 0 Example 2: Failed registration

  42. Registrar denies registration with 401 Authentication Required 401 contains challenge that must be answered by UAC UAC tries again with Authentication-Field Seconds register is new request, therefore CSeq is increased In general, every request can be challenged Multiple times, multiple lines Digest mandatory, Basic discouraged REGISTER sip:a1.sipbakeoff.org SIP/2.0 From: <sip:1@a1.sipbakeoff.org> ... Cseq: 1 REGISTER Content-Length: 0 SIP/2.0 401 Authentication Required WWW-Authenticate: Digest realm="a.com",domain="sip:snom1@a1.sipbakeoff.org:7072;maddr=62.254.248.14",nonce="aWGQ03+9PIZNYfTthPUSlA==",algorithm=MD5 Cseq: 1 REGISTER Content-Length: 0 REGISTER sip:a1.sipbakeoff.org SIP/2.0 From: <sip:1@a1.sipbakeoff.org> ... Authorization: Digest username="01",realm="a.com",nonce="9wTTyVG1WlOwkdpHBEmioQ==",response="d39db66212c999fbb0f1c767364479eb",uri="sip:62.254.248.14:5070" Cseq: 2 REGISTER Content-Length: 0 SIP/2.0 200 Ok ... Cseq: 2 REGISTER Content-Length: 0 Example 3: Authentication challenges the UAC with a 401/407 response

  43. Router needs information where to send packets in private network Map port to private address and port By default packets will be rejected or sent to DMZ Router needs hint for security checking Accept packets from any destination Accept packets only from associated host Accept packets only from associated host and port Which information does a client has to set up for port forwarding in NAT equipment? 123.123.123.123 192.168.0.1 Client Client Router

  44. STUN uses the digging hole trick to set up port associations • Initialization procedure checks environment • Goal: Check if STUN is needed • Type of NAT does actually not really matter because user is not interested in failure reason • SIP port kept alive by sending packets every 15-60 s • RTP ports are allocated dynamically when starting a call • Otherwise keep-alive traffic would be double • RTCP port can not be allocated because next port allocation is unlikely • Long ringing and putting caller on hold is problematic (no port refresh during this time)

  45. How does port forwarding in UPnP work? • Find the Internet access device • Broadcast messages (no user setup required) • Download the description of the UPnP device via http • Retrieve the public IP address from the router • Set up port mapping explicitly • http requests using XML (SOAP) attachments • Other commands also available • UPnP is much more than setting up port forwarding on routers

  46. Registering Procedure of the snom phones • Send a REGISTER message with the IP unchanged identity (coming from DHCP or static setup) • Includes a rport parameter in the top via • This parameter get completed if the proxy receives the packet from a IP address that is different from the unchanged identity • The proxy sends the packet to the port indicated by rport (that’s how the packet makes it back to the phone) • If the phone does not receive the changed rport back, the registration is done (public IP address, ALG, inside private network registration) • If there is a rport parameter returned, the phone will try to do UPnP or STUN • Default policy is to try UPnP first, then STUN • Can be changed in the settings • If the public IP address has been determined, the phone will register with this • Then there is no more checking NAT method

  47. 3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

  48. UAC sends INVITE UAS may respond with 100 Trying If expected answer takes a while UAS may respond with a 180 Ringing Indicates that the UAS is ringing the user UAS sends 200 Ok if the connection is set up UAC sends ACK to confirm that session has been set up INVITE is used to establish a call (1) INVITE (2) 100 Trying (3) 180 Ringing (4) 200 Ok (5) ACK

  49. First line contains destination May contain tags UAC tags from-field that contains the origin however this address is not used for reaching the originator Call-ID should be unique in universe Contact field indicates where requests may be sent SDP attachment describes where audio may be sent INVITE sip:abc@62.254.248.105 SIP/2.0 From: <sip:snom1@a1.sb.org:7071>;tag=hsuiykhtpf To: sip:abc@62.254.248.105 Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113026866334@62.254.248.56 CSeq: 1 INVITE Contact: <sip:snom1@62.254.248.56:5060;transport=udp> User-Agent: snom Accept-Language: en Accept: application/sdp Supported: sip-cc, sip-cc-01, timer Session-Expires: 120 Content-Type: application/sdp Content-Length: 236 v=0 o=root 26500 26500 IN IP4 62.254.248.56 s=Call from 62.254.248.56 c=IN IP4 62.254.248.56 t=0 0 m=audio 5000 RTP/AVP 0 3 8 101 a=rtpmap:0 pcmu/8000 a=rtpmap:3 gsm/8000 a=rtpmap:8 pcma/8000 a=rtpmap:101 telephone-event/8000 Example 4: Successful INVITE: Sending out the INVITE

  50. 100 Trying Probably came from proxy Stops repeating UDP messages To field still untagged in this case It may be tagged and then we have a call leg If tagged the call splits into main call (untagged) and legs 180 Ringing UA may play ring back now Provisional responses may be acknowledged by PRACK Capability to receive PRACK has to be indicated in Allow header SIP/2.0 100 Trying To: sip:abc@62.254.248.105 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 1 INVITE Content-Length: 0 SIP/2.0 180 Ringing To: sip:abc@62.254.248.105 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 1 INVITE Content-Length: 0 Example 4: Successful INVITE: Receiving provisional responses

More Related