Sunteți pe pagina 1din 5

10/31/12

STUN - Wikipedia, the free encyclopedia

STUN
FromWikipedia,thefreeencyclopedia

"stun"redirectshere.Forothertopicsincludingthisterm,seestun(disambiguation). STUNisastandardizedsetofmethods,includinganetworkprotocol,usedinNATtraversalforapplicationsofrealtimevoice,video, messaging,andotherinteractiveIPcommunications.STUNisanacronymforSessionTraversalUtilitiesforNAT,andisdocumentedin RFC5389.[1]RFC5389obsoletesthepreviousspecification,entitledSimpleTraversalofUserDatagramProtocol(UDP)through NetworkAddressTranslators(NATs),documentedinRFC3489.[2]TheobsoleteversionofSTUN,sometimesreferredtoasClassic STUN,wasintendedasacompletesolutionforNATtraversal,andfeaturedanalgorithmtoallowendpointstodetermineNATbehaviour.The currentversionofSTUNispresentedasatooltobeusedbyotherprotocols,suchasICE.STUNremovestheNATclassificationalgorithm anddefinesanextensiblepacketformat. TheSTUNprotocolallowsapplicationsoperatingbehindanetworkaddresstranslator(NAT)todiscoverthepresenceofthenetworkaddress translatorandtoobtainthemapped(public)IPaddress(NATaddress)andportnumberthattheNAThasallocatedfortheapplication'sUser DatagramProtocol(UDP)connectionstoremotehosts.Theprotocolrequiresassistancefromathirdpartynetworkserver(STUNserver) locatedontheopposing(public)sideoftheNAT,usuallythepublicInternet.Theoriginalversionoftheprotocolalsospecifiedmethodsto ascertainthespecifictypeofNAT,butthosemethodshavebeendeprecatedinthenewerspecification,becauseoftheplethoraofspecificNAT implementationbehaviorinvariousnetworkingequipmentandtheresultingintractabilityoftheproblemandthedeficienciesofthemethod used.

Contents
1NATtraversalsolutions 2Protocoloverview 3ClassicSTUNNATcharacterizationalgorithm 4Seealso 5References 6Externallinks

NATtraversalsolutions
en.wikipedia.org/wiki/STUN 1/5

10/31/12

STUN - Wikipedia, the free encyclopedia

Networkaddresstranslationisimplementedviaanumberofdifferentaddressandportmappingschemes,noneofwhicharestandardized. STUNisnotaselfcontainedNATtraversalsolutionapplicableinallNATdeploymentscenariosanddoesnotworkcorrectlywithallofthem. ItisatoolamongothermethodsanditisatoolforotherprotocolsindealingwithNATtraversal,mostnotablyTraversalUsingRelayNAT (TURN)andInteractiveConnectivityEstablishment(ICE).[1] STUNdoesworkwithprimarilythreetypes:fullconeNAT,restrictedconeNAT,andportrestrictedconeNAT.Inthecasesofrestrictedcone orportrestrictedconeNATs,theclientmustsendoutapackettotheendpointbeforetheNATwillallowpacketsfromtheendpointthroughto theclient.STUNdoesnotworkwithsymmetricNAT(alsoknownasbidirectionalNAT)whichisoftenfoundinthenetworksoflarge companies.SincetheIPaddressoftheSTUNserverisdifferentfromthatoftheendpoint,inthesymmetricNATcase,theNATmappingwill bedifferentfortheSTUNserverthanforanendpoint.TURNoffersbetterresultswithsymmetricNAT.

Protocoloverview
STUNisalightweightclientserverprotocolrequiringonlysimplequeryandresponse.Theclientsideisimplementedintheuser's communicationsapplication,suchasavoiceoverInternetProtocol(VoIP)phoneorinstantmessagingclient. Thebaseprotocoloperatesessentiallyasfollows.Theclient,oftenoperatinginsideaprivatenetwork,sendsabindingrequesttoaSTUN serveronthepublicInternet.TheSTUNserversendsasuccessresponsethatcontainstheIPaddressandportasobservedfromitsperspective. TheresultisusuallyXORmappedtoavoidtranslationofpacketcontents. STUNusuallyoperatesonaUserDatagramProtocol(UDP)messagingtransport.SinceUDPdoesnotprovidereliabletransportguarantees, reliabilityisachievedbyapplicationcontrolledretransmissionsoftheSTUNrequests.STUNserversdonotimplementanyreliability mechanismfortheirresponses.[1]Whenreliabilityismandatory,theTransmissionControlProtocol(TCP)maybeused,butinducesextra networkingoverhead.Insecuritysensitiveapplications,STUNmaybetransportedandencryptedbyTransportLayerSecurity(TLS). AnapplicationmayautomaticallydetermineasuitableSTUNserverforcommunicationswithaparticularpeerbyqueryingtheDomainName System(DNS)forthes u (forUDP)ors u s tn t n (forTCP/TLS)serverrecord(SRV)resourcerecord,e.g.,_stun._udp.example.com.The standardlisteningportnumberforaSTUNserveris3478forUDPandTCP,and5349forTLS.Alternatively,TLSmayalsoberunonthe TCPportiftheserverimplementationcandemultiplexTLSandSTUNpackets.IncasenoSTUNserverisfoundusingDNSlookups,the standardrecommendsthatthedestinationdomainnameshouldbequeriedforaddressrecords(AorAAAA)whichwouldbeusedwiththe defaultportnumbers. InadditiontousingprotocolencryptionviaTLS,STUNalsohasbuiltinauthenticationandmessageintegritymechanismsviaspecialized STUNpackettypes.
en.wikipedia.org/wiki/STUN 2/5

10/31/12

STUN - Wikipedia, the free encyclopedia

Whenaclienthasdiscovereditsexternaladdress,itcanusethisasacandidateforcommunicatingwithpeersbysharingtheexternalNAT addressratherthantheprivateaddress(whichis,bydefinition,notreachablefrompeersonthepublicnetwork). IfbothpeersarelocatedindifferentprivatenetworksbehindaNAT,thepeersmustcoordinatetodeterminethebestcommunicationpath betweenthem.SomeNATbehaviormayrestrictpeerconnectivityevenwhenthepublicbindingisknown.TheInteractiveConnectivity Establishment(ICE)protocolprovidesastructuredmechanismtodeterminetheoptimalcommunicationpathbetweentwopeers.Session InitiationProtocol(SIP)extensionsaredefinedtoenabletheuseofICEwhensettingupacallbetweentwohosts.

ClassicSTUNNATcharacterizationalgorithm
ClassicSTUNspecifiedanalgorithmtocharacterizeNATbehavioraccordingtotheaddressandportmappingbehavior.Thisalgorithmisnot reliablysuccessfulandonlyapplicabletoasubsetofNATdevicesdeployed. Thealgorithmconsistsofaseriesofteststobeperformedbyanapplication.Whenthepaththroughthediagramendsinaredbox,UDP communicationisnotpossibleandwhenthepathendsinayelloworgreenbox,communicationispossible.

en.wikipedia.org/wiki/STUN

3/5

10/31/12

STUN - Wikipedia, the free encyclopedia

en.wikipedia.org/wiki/STUN

4/5

10/31/12

STUN - Wikipedia, the free encyclopedia

Seealso
UDPholepunching

References
1. ^abcRFC5389,SessionTraversalUtilitiesforNAT(STUN),J.Rosenberg,R.Mahy,P.Matthews,D.Wing,TheInternetSociety(October2008) 2. ^RFC3489,STUNSimpleTraversalofUserDatagramProtocol(UDP)ThroughNetworkAddressTranslators(NATs),J.Rosenberg,J. Weinberger,C.Huitema,R.Mahy,TheInternetSociety(March2003)

Externallinks
STUNTMANOpensourceSTUNservercodeforRFC5389andRFC3489(http://www.stunprotocol.org) STUNT(http://nutss.gforge.cis.cornell.edu/stunt.php)"STUNandTCPtoo",whichextendsSTUNtoincludeTCPfunctionality Yahoo!DirectorofEngineeringexplainingSTUNandTURN(Video)(http://www.youtube.com/watch? v=9MWYw0fltr0&eurl=http%3A%2F%2Fwww%2Evoip%2Dnews%2Ecom%2Ffeature%2Ftop%2Dvoip%2Dvideos%2D051707%2F ) STUNClientandServerlibrary(http://sourceforge.net/projects/stun/) JSTUNAJavaSTUNimplementation(http://jstun.javawi.de/) ICE4JAJavaICE,STUNandTURNlibrary(http://code.google.com/p/ice4j/) Retrievedfrom"http://en.wikipedia.org/w/index.php?title=STUN&oldid=519662183" Categories: Applicationlayerprotocols Networkaddresstranslation VoIPterminology&concepts Thispagewaslastmodifiedon24October2012at23:38. TextisavailableundertheCreativeCommonsAttributionShareAlikeLicenseadditionaltermsmayapply.SeeTermsofUsefordetails. WikipediaisaregisteredtrademarkoftheWikimediaFoundation,Inc.,anonprofitorganization.

en.wikipedia.org/wiki/STUN

5/5

S-ar putea să vă placă și