doc_ice.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. /**
  19. @defgroup PJNATH_ICE ICE: Interactive Connectivity Establishment
  20. @brief Interactive Connectivity Establishment (ICE)
  21. @ingroup PJNATH
  22. */
  23. /**
  24. @defgroup PJNATH_ICE_STREAM_TRANSPORT ICE stream transport
  25. @brief Transport for media streams using ICE
  26. @ingroup PJNATH_ICE
  27. */
  28. /**
  29. @defgroup PJNATH_ICE_SESSION ICE Session
  30. @brief Transport Independent ICE Session
  31. @ingroup PJNATH_ICE
  32. */
  33. /**
  34. @addtogroup PJNATH_ICE
  35. \section org Library organizations
  36. See <b>Table of Contents</b> below.
  37. \section ice_intro_sec Introduction to ICE
  38. Interactive Connectivity Establishment (ICE) is the ultimate
  39. weapon a client can have in its NAT traversal solution arsenals,
  40. as it promises that if there is indeed one path for two clients
  41. to communicate, then ICE will find this path. And if there are
  42. more than one paths which the clients can communicate, ICE will
  43. use the best/most efficient one.
  44. ICE works by combining several protocols (such as STUN and TURN)
  45. altogether and offering several candidate paths for the communication,
  46. thereby maximising the chance of success, but at the same time also
  47. has the capability to prioritize the candidates, so that the more
  48. expensive alternative (namely relay) will only be used as the last
  49. resort when else fails. ICE negotiation process involves several
  50. stages:
  51. - candidate gathering, where the client finds out all the possible
  52. addresses that it can use for the communication. It may find
  53. three types of candidates: host candidate to represent its
  54. physical NICs, server reflexive candidate for the address that
  55. has been resolved from STUN, and relay candidate for the address
  56. that the client has allocated from a TURN relay.
  57. - prioritizing these candidates. Typically the relay candidate will
  58. have the lowest priority to use since it's the most expensive.
  59. - encoding these candidates, sending it to remote peer, and
  60. negotiating it with offer-answer.
  61. - pairing the candidates, where it pairs every local candidates
  62. with every remote candidates that it receives from the remote peer.
  63. - checking the connectivity for each candidate pairs.
  64. - concluding the result. Since every possible path combinations are
  65. checked, if there is a path to communicate ICE will find it.
  66. \section icestrans_sec Using ICE transport
  67. The \ref PJNATH_ICE_STREAM_TRANSPORT is a ready to use object which
  68. performs the above ICE operations as well as provides application with
  69. interface to send and receive data using the negotiated path.
  70. Please see \ref PJNATH_ICE_STREAM_TRANSPORT on how to use this object.
  71. \section ice_owntransport_sec Creating custom ICE transport
  72. If the \ref PJNATH_ICE_STREAM_TRANSPORT is not suitable for use
  73. for some reason, you will need to implement your own ICE transport,
  74. by combining the \ref PJNATH_ICE_SESSION with your own means to
  75. send and receive packets. The \ref PJNATH_ICE_STREAM_TRANSPORT
  76. provides the best example on how to do this.
  77. \section ice_samples_sec Samples
  78. The ICE demo sample \src{pjsip-apps/src/samples/icedemo.c} demonstrates how to use
  79. \ref PJNATH_ICE_STREAM_TRANSPORT <b>without</b> using signaling
  80. protocol such as <b>SIP</b>. It provides interactive user interface
  81. to create and manage the ICE sessions as well as to exchange SDP
  82. with another ice_demo instance.
  83. Also see <b>\ref samples_page</b> for other samples.
  84. */