Font Size: a A A

Research And Implementation Of NAT Traversal Method Based On STUN And MDNS Protocol

Posted on:2022-02-18Degree:MasterType:Thesis
Country:ChinaCandidate:X L WuFull Text:PDF
GTID:2518306557461764Subject:Electronics and Communications Engineering
Abstract/Summary:
In actual project development,sometimes there is a need for direct connection and communication between devices,which requires both parties to communicate without using an intermediate server for message forwarding.This communication method is called p2 p communication.However,due to the shortage of IPv4 addresses,the proposed NAT technology hinders the development of p2 p communication technology.The communication parties are separated by NAT devices.Therefore,the devices must traverse the NAT device to establish a p2 p connection,which makes p2 p communication difficult.In order to solve the above problems,this thesis designs a NAT traversal method combining STUN protocol and m DNS protocol.This method solves the shortcomings of traditional NAT traversal methods such as low success rate and long traversal time.The main tasks completed in this thesis has the following points:1.Analyze the decentralized communication method based on IP multicast in the same subnet.In view of the shortcomings of traditional multicast communication that cannot accurately receive messages from specific hosts,the m DNS protocol is introduced,and its header is improved,so that both hosts can avoid communication.Interference from multicast datagrams from other source hosts.2.Aiming at the shortcoming that m DNS can only communicate in the same subnet,a method of combining STUN protocol and m DNS protocol is designed.The client can judge whether it is in the same subnet as the other party based on the information in the combined STUN datagram.This method allows hosts in the same subnet to avoid using NAT traversal communication,but communicate directly based on m DNS,thus reducing the time to establish a connection.3.Re-divide NAT types,and design detection and traversal methods for different NAT types of equipment.By improving the STUN protocol,the time and steps for the client to detect the NAT type and traverse the NAT can be reduced.A new port prediction method is designed for port-related NAT,which improves the success rate of traversal.Finally,based on the improved STUN protocol and traversal method,this thesis implements the communication client and STUN control service module.In the actual network environment,the traditional NAT traversal method is compared and tested in different NAT environments.It has been verified that the improved NAT traversal method has a higher success rate,and the detection and traversal time can be significantly reduced,which can be used in actual production environments.
Keywords/Search Tags:STUN, mDNS, NAT traversal, port prediction
Related items