梅林固件设置虚拟内存
让梅林R6400支持sftp协议

p2p内网穿透技术-udp打洞

妙音 posted @ 2018年11月25日 16:47 in network with tags p2p udp vps , 4535 阅读
 
 
在公司如何访问家里的电脑?实现方法有很多,其它p2p传输文件最快,能否实现?
 

udp打洞原理

 
假设有两台分别处于各自的私有网络中的主机:A和B;N1和N2是两个网络的NAT设备,分别拥有IP地址P1和P2;S是一个使用了一个众所周知的、从全球任何地方都能访问得到的IP地址的公共服务器

步骤一:A和B分别和S建立UDP连接;NAT设备N1和N2创建UDP转换状态并分配临时的外部端口号

步骤二:S检查UDP包,看A和B的端口是否是正在被使用的(否则的话N1和N2应该是应用了端口随机分配,这会让路由验证变得更麻烦)

步骤三:如果端口不是随机化的,那么A和B各自选择端口X和Y,并告知S。S会让A发送UDP包到P2:Y,让B发送UDP包到P1:X

步骤四:A和B通过转换好的IP地址和端口直接联系到对方的NAT设备;
 
 
 

udp打洞成功前提条件--非对称NAT

 
完全圆锥型NAT: 无条件转发
 
受限圆锥型NAT:  忽略掉其它主机的数据包(要求来源ip一直)
 
端口受限圆锥型NAT: 更进一步地要求源端口(上例中是 2727)必须跟之前发出的数据包的目的端口一致(要求来源ip和端口)
 
对称NAT: 丢弃报文,拒绝转发(每次连接端口会变)
 
对称NAT理论上可以使用端口预测,但是基本上用不了。现在国内几个宽带运行商都是使用对称NAT,所以udp打洞不可行。
 
记得之前上学的时候p2p共享软件很多,后来都销声匿迹,应该是被管控了。
 

socat测试udp打洞

 
下面是socat打洞的例子,试过在公司与家里之间打洞,用不了被现实了
 
https://blog.lilydjwg.me/2012/8/28/udp-hole-punching-experiment.35350.html
 

frp测试udp打洞

 
frp采用xtcp协议,试过同样用不了。stcp可以用,但是不是p2p,要经过中间转发。
 

检查nat类型?

 
#python直接用pynat包
pip install pynat
 

pynat

 
C:\Users\wyq>pynat
Network type: Symmetric NAT   #对称nat
Internal address: 192.168.50.169:54320
External address: xxx.xxx.xxx.xxx:61195
 

 内网穿透可行方法

方法   描述  实现条件 实际是否可行
p2p      udp打洞 非对称nat 不可行。宽带基本都是对称nat。除非在自己公网ip上提供p2p穿透
ddns 路由器使用有公网ip 宽带提供了公网ip 不可行。路由器基本没有公网ip
端口转发 将端口映射到公网ip 需要公网ip 可行
vpn      要求有公网ip节点,运行vpn服务端 需要公网ip 可行

 

参考来源

 

 

Avatar_small
charliewhite 说:
2020年10月20日 16:44

Essay typist at dzone - Looking for Assignment Writing Services UK? Here We at TreatAssignmentHelp offering a wide range of Academic Writing Services & Assignment Help with Essay Writing Services UK, Assignment Writing Help Services, Assignment Help Wales UK for students. High qualified writers, 24/ 7 support, and complete privacy guarantee. Call or WhatsApp on +44 7520644027 to hire the best suitable academic writer for your subject. We promise to deliver projects before the deadline and without plagiarism. For More Services: Ella Phillips on threadless

Avatar_small
helphub 说:
2020年11月19日 01:14

Whether it is popular games like Baccarat, Slots, Blackjack, Roulette and Dragon Tiger etc. สล็อต

Avatar_small
buy soma 500 说:
2020年11月19日 16:53

I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight. 먹튀검증

Avatar_small
sagame66 说:
2020年11月21日 14:59

I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. sagame66

Avatar_small
buy soma 500 说:
2020年11月23日 20:06

I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information. okdermo

Avatar_small
더킹카지노 추천 说:
2020年12月08日 16:48

Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. 더킹카지노 추천

Avatar_small
no excuses runner 说:
2020年12月08日 21:06

This is my first time i visit here. I found such a substantial number of interesting stuff in your blog especially its examination. Really its inconceivable article. Keep it up. find here

Avatar_small
안전놀이터 说:
2020年12月09日 16:17

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. 안전놀이터

Avatar_small
pretty gaming 说:
2020年12月14日 19:14

This article was written by a real thinking writer. I agree many of the with the solid points made by the writer. I’ll be back. pretty gaming

Avatar_small
vape pen dry herb va 说:
2020年12月16日 16:13

Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. vape pen dry herb vaporizer

Avatar_small
no excuses runner 说:
2021年1月03日 18:39

Incredible articles and awesome design. Your blog entry merits the greater part of the positive input it"s been getting. custom patches

Avatar_small
no excuses runner 说:
2021年1月04日 20:30

I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight. see it here

Avatar_small
weight gainer 说:
2021年2月09日 17:51

On that website page, you'll see your description, why not read through this.

Avatar_small
Textile mask with fi 说:
2021年2月11日 14:14

Welcome to the party of my life here you will learn everything about me.

Avatar_small
esa letter 说:
2021年7月01日 20:41

I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. esa letter

Avatar_small
ดาวน์โหลดslotxo 说:
2021年7月07日 20:45

You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!. ดาวน์โหลดslotxo

Avatar_small
สมัครsuperslot 说:
2021年7月11日 20:49

I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. สมัครsuperslot

Avatar_small
메이저사이트 说:
2021年7月11日 23:36

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... 메이저사이트

Avatar_small
k9win 说:
2021年7月14日 23:20

This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post. k9win

Avatar_small
Youtube pva accounts 说:
2021年8月22日 11:39

Hi! Thanks for the great information you have provided! You have touched on crucuial points!

Avatar_small
. 카지노사이트 说:
2021年9月01日 00:15

Great survey, I'm sure you're getting a great response. veip

Avatar_small
virus 说:
2021年12月09日 15:56

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. coktoto

Avatar_small
. 카지노사이트 说:
2021年12月10日 04:56

I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... 안전놀이터

Avatar_small
virus 说:
2021年12月11日 21:40

When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your. 音響店

Avatar_small
. 카지노사이트 说:
2021年12月13日 01:38

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. 오피아트

Avatar_small
virus 说:
2021年12月13日 22:01

I was reading your article and wondered if you had considered creating an ebook on this subject. Your writing would sell it fast. You have a lot of writing talent. Buy Weed online California

Avatar_small
virus 说:
2021年12月16日 20:34

Excellent post. I was reviewing this blog continuously, and I am impressed! Extremely helpful information especially this page. Thank you and good luck. World new updates

Avatar_small
. 카지노사이트 说:
2021年12月17日 04:32

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. Instagram pva accounts

Avatar_small
. 카지노사이트 说:
2021年12月19日 03:39

Your content is nothing short of brilliant in many ways. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers. 토토사이트

Avatar_small
virus 说:
2021年12月23日 19:27

I would like to say that this blog really convinced me to do it! Thanks, very good post. ancient rome ideas

Avatar_small
. 카지노사이트 说:
2021年12月26日 01:56

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! http://69.195.78.97/login/

Avatar_small
virus 说:
2021年12月28日 15:05

Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. these details

Avatar_small
. 카지노사이트 说:
2022年1月01日 01:21

You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. Top Pentobarbital Nembutal supplier in Europe

Avatar_small
. 카지노사이트 说:
2022年1月03日 02:39

Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. เว็บบอลดีที่สุด

Avatar_small
. 카지노사이트 说:
2022年1月05日 01:10

You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this... Birthday wishes for everyone

Avatar_small
. 카지노사이트 说:
2022年1月07日 19:24

This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… cbd thc gummies

Avatar_small
. 카지노사이트 说:
2022年1月09日 01:34

Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post. 토토사이트

Avatar_small
. 카지노사이트 说:
2022年1月13日 01:49

We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. laser schools

Avatar_small
SMART 说:
2022年5月08日 02:43

Hi there, I discovered your blog per Google bit searching for such kinda educational advise moreover your inform beholds very remarkable for me. <a href="토토사이트">https://tojaba.com/</a>

Avatar_small
virus 说:
2022年5月21日 14:08

I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.. unicc real domain

Avatar_small
NCERT 8th Exemplar P 说:
2022年7月02日 21:40

NCERT Exemplar is very Important Resource for Students Preparing for 10th Class Maths Examination 2023, Here we have Provided NCERT Class 10 Maths Exemplar Problems Solutions 2023 , Sometimes, people confuse NCERT Exemplar Problems – Solutions with CBSE Solutions, NCERT 8th Exemplar Problams 2023 for Maths There are Some Solutions which NCERT itself Prescribes, You can check those NCERT Maths Exemplar Problems 2023 here,This Page also Provide NCERT 8th Exemplar 2023, NCERT Students you can Subject Wise Pdf Download at Official Website at, Here you will get the NCERT Class 8 Maths Exemplar Problems and Solutions 2023 for All Pdf Chapters

Avatar_small
dark web/deep web/d 说:
2022年8月09日 15:08

Pay per click advertising is one of the easiest ways to make money on the Internet. By purchasing targeted ad space, you can place targeted links on other sites and make money.  dark web links

Avatar_small
dark web/deep web/d 说:
2022年8月09日 15:45

Link farms mainly gather links from web directories which are not related to the content of the website. This is a common problem on most farms.  deep web

Avatar_small
dark web/deep web/d 说:
2022年8月09日 16:55

There are several ways to use these dark web websites to check out anyone using credit cards. The first way is to look up the social networking accounts of the person.  dark web sites

Avatar_small
dark web/deep web/d 说:
2022年8月09日 19:27

You might have heard about the dark web. The internet that is hidden from plain sight.  dark web links

Avatar_small
dark web/deep web/d 说:
2022年8月09日 22:33

The first thing you should do is research the internet about the company to see what other users have said about their experience using their services.  dark web

Avatar_small
dark web/deep web/d 说:
2022年8月09日 23:19

They would like to be able to go to their favorite search engine and find an affiliate-marketing site and click on it to get all their traffic and make some money.  work from home jobs

Avatar_small
dark web/deep web/d 说:
2022年8月09日 23:44

You then put a link back to your ClickBank website. People will click on this link because it is free and because it looks cool. affiliate marketing success


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter