Giter Club home page Giter Club logo

callsignip's Introduction

CallsignIP

呼号IP地址化方法

此方法可实现呼号与IP地址的唯一对应,其过程可逆,用于业余无线电TCP/IP通信,地址与互联网TCP/IP不兼容。

1.按照下表对每位呼号进行十进制化 #代表空

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# 0 1 2 3 4 5 6 7 8 9 A B C D E
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
F G H I J K L M N O P Q R S T U
32 33 34 35 36
V W X Y Z

例:

BA1HAM

12 11 2 18 11 23

BA1AA# BA1AA

12 11 2 11 11 0

B#1A## B1A

12 0 2 11 0 0

2.按照37进制计算出呼号所对应的十进制序号

N=F*37^5+E*37^4+D*37^3+C*37^2+B*37^1+A*37^0

A~F分别代表从LSB到MSB的位值

例:

BA1HAM

12*37^5+11*37^4+2*37^3+18*37^2+11*37^1+23*37^0=852869633

B1A

12*37^5+0*37^4+2*37^3+11*37^2+0*37^1+0*37^0=832243849

理论最大为ZZZZZZ=2565726408

3.保留IP地址

保留 0.0.0.0/8 1.0.0.0/8 10.0.0.0/8 100.64.0.0/10

127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.0.0.0/8

198.18.0.0/15 198.51.100.0/24 203.0.113.0/24 224.0.0.0/4

240.0.0.0/4 255.255.255.255/32

具体做法如下:

N=N+33554432

IF N >= 167772160 THEN N=N+16777216

IF N >= 1681915904 THEN N=N+4194304

IF N >= 2130706432 THEN N=N+16777216

IF N >= 2851995648 THEN N=N+65536

IF N >= 2886729728 THEN N=N+1048576

IF N >= 3221225472 THEN N=N+16777216

IF N >= 3323068416 THEN N=N+131072

IF N >= 3325256704 THEN N=N+256

IF N >= 3405803776 THEN N=N+256

IF N >= 3758096384 THEN N=N+268435456

IF N >= 4026531840 THEN N=N+268435456

例:

BA1HAM N=852869633+33554432=886424065>167772160,N=886424065+16777216=903201281

理论最大为

ZZZZZZ=2565726408+33554432=2599280840>167772160,

N=2599280840+16777216=2616058056>1681915904,

N=2616058056+4194304=2620252360>2130706432,

N=2620252360+16777216=2637029576

4.将十进制转化为四位256进制

A = N mod 256

B = (N//256) mod 256

C = (N//256^2) mod 256

D = (N//256^3) mod 256

例:

BA1HAM

A=1 B=194 C=213 D=53

即53.213.194.1

理论最大为ZZZZZZ A=200 B=224 C=45 D=157

即157.45.224.200

呼号正常的前后缀不计入IP中,同一呼号不同设备和应用场景之间应依靠不同端口号区分。

1.特殊呼号IP化方法

特殊呼号包含超过六位的呼号、特殊前后缀的呼号、特设台呼号等无法使用六位呼号表述的一些呼号,应当为其特别分配IP地址,在

158.0.0.1~169.253.255.255 172.32.0.0~191.255.255.255

193.0.0.0~197.255.255.255 201.0.0.0~203.0.112.255

203.0.114.0~223.255.255.254

五个地址段中选择IP进行分配,158.0.0.0为特殊呼号网段地址,223.255.255.255为特殊呼号广播地址。

2.预留的DNS地址

200.0.0.0/8地址段为DNS地址段。

3.预留的证书CA中心地址

199.0.0.0/8地址段为CA中心地址段。

4.特殊呼号IP、DNS地址、CA中心地址均需要在此Github存储库公开发布,一切未在此存储库备案的上述三种IP地址均无效。

callsignip's People

Contributors

bi4pym avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.