diff --git a/2205308050317_1.png b/2205308050317_1.png new file mode 100644 index 000000000..e5339e336 Binary files /dev/null and b/2205308050317_1.png differ diff --git a/2205308050317_2.png b/2205308050317_2.png new file mode 100644 index 000000000..1784c6cd2 Binary files /dev/null and b/2205308050317_2.png differ diff --git a/2205308050317_3.png b/2205308050317_3.png new file mode 100644 index 000000000..bcbaec5b6 Binary files /dev/null and b/2205308050317_3.png differ diff --git a/2205308050317_4.png b/2205308050317_4.png new file mode 100644 index 000000000..8e2b05314 Binary files /dev/null and b/2205308050317_4.png differ diff --git a/2205308050317_5.png b/2205308050317_5.png new file mode 100644 index 000000000..55c713ae2 Binary files /dev/null and b/2205308050317_5.png differ diff --git a/README.md b/README.md index f1fe589df..97af14421 100644 --- a/README.md +++ b/README.md @@ -1,119 +1,266 @@ -[![Build Status](https://travis-ci.org/ntop/n2n.png?branch=dev)](https://travis-ci.org/ntop/n2n) - - -# n2n - -n2n is a light VPN software which makes it easy to create virtual networks bypassing intermediate firewalls. - -In order to start using n2n, two elements are required: - -- A _supernode_: it allows edge nodes to announce and discover other nodes. It must have a port publicly accessible on internet. -- _edge_ nodes: the nodes which will be a part of the virtual networks - -A virtual network shared between multiple edge nodes in n2n is called a _community_. A single supernode can relay multiple communities and a single computer can be part of multiple communities at the same time. An encryption key can be used by the edge nodes to encrypt the packets within their community. - -n2n tries to establish a direct peer-to-peer connection via udp between the edge nodes when possible. When this is not possible (usually due to special NAT devices), the supernode is also used to relay the packets. - - -## Quick Setup - -Some Linux distributions already provide n2n as a package so a simple `sudo apt install n2n` will do the work. Alternatively, up-to-date packages for most distributions are available on [ntop repositories](http://packages.ntop.org/). - -On host1 run: - -```sh -$ sudo edge -c mynetwork -k mysecretpass -a 192.168.100.1 -f -l supernode.ntop.org:7777 -``` - -On host2 run: - -```sh -$ sudo edge -c mynetwork -k mysecretpass -a 192.168.100.2 -f -l supernode.ntop.org:7777 -``` - -Now the two hosts can ping each other. - -**IMPORTANT** It is strongly advised to choose a custom community name (`-c`) and a secret encryption key (`-k`) in order to prevent other users from connecting to your computer. For the privacy of your data sent and to reduce the server load of `supernode.ntop.org`, it is also suggested to set up a custom supernode as explained below. - - -## Setting up a Custom Supernode - -You can create your own infrastructure by setting up a supernode on a public server (e.g. a VPS). You just need to open a single port (1234 in the example below) on your firewall (usually `iptables`). - -1. Install the n2n package -2. Edit `/etc/n2n/supernode.conf` and add the following: - ``` - -p=1234 - ``` -3. Start the supernode service with `sudo systemctl start supernode` -4. Optionally enable supernode start on boot: `sudo systemctl enable supernode` - -Now the supernode service should be up and running on port 1234. On your edge nodes you can now specify `-l your_supernode_ip:1234` to use it. All the edge nodes must use the same supernode. - - -## Manual Compilation - -On Linux, compilation from source is straight forward: - -```sh -./autogen.sh -./configure -make - -# optionally install -make install -``` - -For Windows, MacOS, optimizations and general building options, please check out [Building documentation](doc/Building.md) for compilation and running. - -**IMPORTANT** It is generally recommended to use the [latest stable release](https://github.com/ntop/n2n/releases). Please note that the current _dev_ branch usually is not guaranteed to be backward compatible neither with the latest stable release nor with previous _dev_ states. On the other hand, if you dare to try bleeding edge features, you are encouraged to compile from _dev_ – just keep track of sometimes rapidly occuring changes. Feedback in the _Issues_ section is appreciated. - - -## Security Considerations - -When payload encryption is enabled (provide a key using `-k`), the supernode will not be able to decrypt -the traffic exchanged between two edge nodes but it will know that edge A is talking with edge B. - -The choice of encryption schemes that can be applied to payload has recently been enhanced. Please have -a look at [Crypto description](doc/Crypto.md) for a quick comparison chart to help make a choice. n2n edge nodes use -AES encryption by default. Other ciphers can be chosen using the `-A_` option. - -A benchmark of the encryption methods is available when compiled from source with `tools/n2n-benchmark`. - -The header which contains some metadata like the virtual MAC address of the edge nodes, their IP address, their real -hostname and the community name optionally can be encrypted applying `-H` on the edges. - - -## Advanced Configuration - -More information about communities, support for multiple supernodes, routing, traffic restrictions and on how to run an edge as -a service is available in the [more detailed documentation](doc/Advanced.md). - - -## Contribution - -You can contribute to n2n in various ways: - -- Update an [open issue](https://github.com/ntop/n2n/issues) or create a new one with detailed information -- Propose new features -- Improve the documentation -- Provide pull requests with enhancements - -For details about the internals of n2n check out the [Hacking guide](https://github.com/ntop/n2n/blob/dev/doc/Hacking.md). - - -## Further Readings and Related Projects - -Answers to frequently asked questions can be found in our [FAQ document](https://github.com/ntop/n2n/blob/dev/doc/Faq.md). - -Here is a list of third-party projects connected to this repository: - -- Collection of pre-built binaries for Windows: [lucktu](https://github.com/lucktu/n2n) -- n2n for Android: [hin2n](https://github.com/switch-iot/hin2n) -- Docker images: [Docker Hub](https://hub.docker.com/r/supermock/supernode/) -- Go bindings, management daemons and CLIs for n2n edges and supernodes, Docker, Kubernetes & Helm Charts: [pojntfx/gon2n](https://pojntfx.github.io/gon2n/) -- Windows GUI (along with a custom version of n2n) but also working with regular n2n: [HappyNet](https://github.com/happynclient/happynwindows) - ---- - -(C) 2007-22 - ntop.org and contributors +<-- by 唐崟 --> + +## Introduction to N2N Lightweight VPN +N2N is a lightweight VPN software that can bypass the restrictions of intermediate firewalls and easily create virtual networks. It is applicable to various scenarios such as enterprise network establishment and remote work. +## Core Components +1.Supernode: Serving as the network hub, it is responsible for the registration and discovery of edge nodes. It requires a publicly accessible port on the public network and supports concurrent relay of multiple communities. +2.Edge Node: As the terminal node of the virtual network, it supports multi-platform deployment. A single device can simultaneously join multiple communities and has the AES-256 data encryption function. +## Virtual Community Mechanism +N2N divides virtual networks through "communities". Each community has an independent network space and encryption key, and supports custom identification. A single supernode can manage hundreds of communities and achieve dynamic connection of members. +## Intelligent Connection Strategy +1.-UDP Direct Connection: Based on NAT traversal technology, it features zero latency and high bandwidth. +2.-Supernode Relay: Achieves reliable UDP transmission and automatically optimizes the connection. +3.-Hybrid Mode: Dynamically switches connections to ensure transmission stability. +## Security Protection +It provides multi-level security protection such as community-level AES-256 encryption, identity authentication, and data packet verification, and also supports regular key rotation. +## Manual Compilation Instruction Document +<-- by 唐崟 --> + + +<-- by 谢思源 --> +## 1. Document Overview +This is an instruction document on manual compilation. It mainly covers the steps for compiling from source code under the Linux system, and also mentions relevant information about Windows and MacOS systems, version-selection suggestions, and thanks for user feedback. +## 2. Compilation Steps in the Linux System +In the Linux system, there is a relatively standard process for compiling software from source code. +(1) Execute ./autogen.sh +First, the ./autogen.sh script is executed. Its function is to automatically generate the files required for configuration, and it helps to detect the system environment, such as checking whether necessary tools and libraries are installed in the system, thus preparing for the subsequent compilation-configuration process. +(2) Run ./configure +Next, the ./configure command is run. This command further, based on the actual situation of the system, carefully checks whether various dependencies meet the compilation requirements. At the same time, it allows users to set some compilation parameters, such as specifying the installation path, enabling or disabling certain functional modules, etc., so as to generate a suitable Makefile and lay the foundation for the actual compilation process. +(3) Execute make +Subsequently, the make command is executed. It compiles the source code according to the rules defined in the Makefile, converting the source code into target products such as executable files or library files. +(4) Optional Step make install +And make install is an optional step. When this command is executed, the compiled files will be installed in the pre-set directories of the system, so that users can conveniently call these installed software or tools from other parts of the system. +## 3. Related Information about Windows and MacOS Systems +For Windows and MacOS systems, due to the differences in their operating-system architectures and environments compared with Linux, and when it comes to optimizing the compilation process or general build options, relying solely on the above-mentioned compilation steps for the Linux system is insufficient. At this time, users need to refer to the dedicated build documentation, which will detail the specific compilation and running methods for these systems, including the required tools, environmental configurations, etc. +## 4. Version Selection Suggestions +In terms of version selection, the document strongly recommends using the latest stable version. This is because the stable version has undergone extensive testing and verification, ensuring better stability and compatibility, and reducing the likelihood of errors and problems during use. +The current dev branch is mainly used for developing and testing the latest, yet-to-be-fully-stabilized features. This branch generally cannot guarantee backward compatibility with the latest stable version and previous dev states. That is to say, the code obtained from the dev branch may not run properly in an environment built based on previous versions. +However, if users are brave enough to try out the latest features and are willing to take the risk of potential instability, the document also encourages users to start compiling from the dev branch. It should be noted, though, that since the code in the dev branch is updated frequently, users need to closely track the rapid changes in the code and promptly understand and adapt to these changes to ensure a smooth compilation process. +## 5. User Feedback +Finally, the document expresses gratitude to users who provide feedback in the Issues section. User feedback is crucial for the continuous improvement and optimization of the project. By collecting and analyzing feedback information such as the problems encountered and suggestions put forward by users during use, the project development team can better identify the deficiencies in the software, promptly fix bugs, optimize functions, and thus continuously enhance the quality and user experience of the software. +<-- by 谢思源 --> + + + +======= + + + + +<-- by 黄朝淼 --> +🇬🇧 English Version README.md +# Set Up a Custom Supernode +## Overview +This guide will provide a detailed introduction on how to set up a custom supernode, and it will also cover relevant code explanations. By setting up a custom supernode, you can create your own n2n network infrastructure, enhancing network security and privacy. + +## I. Operation Steps for Setting a Custom Supernode +### Installing the n2n Software Package +Install the n2n software package on a public server (such as a VPS). The installation methods vary depending on the operating system as follows: + +1.For Ubuntu/Debian systems: Open the terminal and execute the command sudo apt-get update && sudo apt-get install n2n to update the software source and install n2n. +2.For CentOS systems: First, ensure that the EPEL source is installed. Then, execute sudo yum install n2n in the terminal to install the n2n software package. +### Editing the Configuration File +Use a text editor (such as nano or vim) to open the /etc/n2n/supernode.conf file and add the content -p=1234. Here, 1234 is the specified port, which can be modified according to the actual situation. This operation is to set the port that the supernode listens on. +### Starting the supernode Service +Enter the command sudo systemctl start supernode in the terminal to start the supernode service, allowing the supernode to run on the set port. +### Setting Auto-start on Boot (Optional) +If you want the supernode service to start automatically after the server restarts, execute the command sudo systemctl enable supernode in the terminal. +## Parameter Processing Logic and Initialization Logic +The setOption function is the core logic for handling command-line parameters in the n2n supernode. It is responsible for parsing various configuration options and setting the corresponding structure members. The following is a detailed textual explanation of this function: +## Parameter Parsing Process +### 1.Receiving parameters: + The function receives three parameters: optkey (parameter identifier), _optarg (parameter value), and sss (supernode structure pointer). +### 2.Branch processing: + Use a switch statement to handle different parameter options according to optkey. +### 3.Port parameter (-p): +Format judgment: First, check whether the parameter value contains a colon : to distinguish different input formats. +IP: port format: If it contains a colon, split the string into an IP address part and a port part. Use inet_addr to convert the IP string into an integer in network byte order, and then convert it into host byte order through ntohl. Use atoi to convert the port string into an integer. +#### Error handling: +If the IP address is invalid (returns INADDR_NONE), it will default to bind to all available interfaces (INADDR_ANY). +If the port number is invalid (parsed as 0), the default port (usually 7777) will be used. +#### Only IP or only port: +If the parameter value contains a dot ., it will be regarded as only specifying the IP address, and the default value will be used for the port. +Otherwise, it will be regarded as only specifying the port number, and the IP address will be bound to all interfaces. +## Security Features +#### 1.Input verification: + Check the validity of the IP address and port number to prevent the program from crashing due to illegal input. +Default value handling: When the input is invalid, it will automatically fall back to a secure default configuration to ensure that the service can start normally. +#### 2.Log recording: + Use traceEvent to record the warning information during the parameter parsing process, which is convenient for debugging and maintenance. +## Explanation of Supernode Initialization Logic +The initialization of the supernode is divided into two main functions: sn_init_defaults and sn_init, which complete the initialization work at different stages respectively: +### Basic Initialization (sn_init_defaults) +#### 1.Initializing structure members: +Set each field of the supernode structure to its default value. +#### 2.Network configuration: +###### 1.bind_address: + Default to bind to all available interfaces (INADDR_ANY). +###### 2.lport: + The default listening port (usually 7777). +mport: The management port (used to receive management commands). +###### 3.Memory allocation: +Allocate initial memory space for dynamic data structures such as the edge node table and the community list. +Setting default parameters: Set other runtime parameters, such as the number of threads and the timeout time. +## Advanced Initialization (sn_init) +###### 1.Thread creation: +Create a resolution thread (resolve_create_thread) to handle domain name resolution and node discovery. This thread is responsible for maintaining the reachability information of edge nodes to ensure smooth communication between nodes. +###### 2.Resource initialization: +Initialize the encryption context and configure the default encryption algorithm. +Start the management interface and listen for management commands. +###### 3.Service preparation: +Create a socket and bind it to the specified address and port. +Start listening for client connection requests. +###### 4.Status notification: +Record the initialization completion information through logs, including key configurations such as the bound address and port. +### Characteristics of the Initialization Process +###### 1.Staged initialization: +Split the complex initialization process into two stages, basic setting and advanced setting, to improve code maintainability. +###### 2.Modular design: + Each initialization task is independently encapsulated, making it easy to expand and modify functions. +Resource management: Reasonably allocate and initialize system resources to ensure the normal operation of the service. +###### 3.Error handling: + When the initialization fails, perform appropriate cleaning and error reporting to ensure the robustness of the program. +### Combined Workflow of the Two +###### 1.Parameter parsing: + Parse the command-line parameters through the setOption function and modify the default configuration. +###### 2.Basic initialization: + Call sn_init_defaults to set the default values and build the basic operating environment. +###### 3.Parameter application: +Apply the parsed parameter values to the initialized structure and overwrite the default values. +###### 4.Advanced initialization: + Call sn_init to complete the remaining initialization work and start the core service components. +###### 5.Service operation: +The supernode starts listening for client connections and processes communication requests between nodes. +This design makes the configuration of the supernode flexible and easy to expand, while ensuring the stability and security of the initialization process. + +# Edge Node Configuration +## Connect to the Custom Supernode +On your edge node, you can specify the custom supernode using the -l parameter. For example, use the following command on the edge node to connect to the custom supernode: + +sudo edge -d tun0 -l your_supernode_ip:1234 -c mycommunity -k mysecretkey -a 192.168.100.2 -f + +### Parameter Explanation: +-d tun0: Use the tun0 virtual interface +-l: Specify the supernode address and port +-c: Community name +-k: Encryption key +-a: Assigned virtual IP address +-f: Run in the foreground (for debugging purposes) +======= +<-- by 黄朝淼 --> + + +--- + +<-- by 文荣平 --> +### Quick Setup +- **Installation Method**: In some Linux distributions, `n2n` is provided as a software package, and you can install it using `sudo apt install n2n`. Additionally, the latest software packages for most distributions can be obtained from [ntop repositories](http://packages.ntop.org/). +- **Example Configuration**: Here are examples of configuring edge nodes on different hosts: + +```sh +# Run the edge command with sudo privileges to configure an n2n edge node +# -c specifies the community name as mynetwork +# -k specifies the encryption key as mysecretpass +# -a specifies the local IP address as 192.168.100.1 +# -f runs the process in foreground mode +# -l specifies the supernode to connect to as supernode.ntop.org:7777 +``` + - Host 1: +```sh +sudo edge -c mynetwork -k mysecretpass -a 192.168.100.1 -f -l supernode.ntop.org:7777 +``` + - Host 2: +```sh +sudo edge -c mynetwork -k mysecretpass -a 192.168.100.2 -f -l supernode.ntop.org:7777 +``` + +After the configuration is completed, the two hosts can ping each other. It is highly recommended to choose a custom community name (`-c`) and a secret encryption key (`-k`) to prevent other users from connecting to your computer. To protect data privacy and reduce the server load of `supernode.ntop.org`, it is also recommended to set a custom supernode. +<-- by 文荣平 --> + + + +--- + + + <-- by 陈思良 --> +I. Community and Encryption Key Settings +1. Custom Community and Key +To prevent other users from connecting to your computer, it is strongly recommended to select a custom community name (using the -c parameter) and a secure encryption key (using the -k parameter) for each virtual network. Avoid using default or easily guessable community names and keys to ensure the privacy and security of the network. +2. Key Strength +The length and complexity of the encryption key will affect the security of the encryption. When setting the encryption key, try to use a key that is long and contains multiple character types (letters, numbers, special characters). A longer key can increase the difficulty of cracking and improve the security of data transmission. +II. Security of Supernode Usage +1. Custom Supernode +To protect data privacy and reduce the server load of public supernodes (such as supernode.ntop.org), it is recommended to set a custom supernode. Follow these steps to set it up: +Install the n2n package. +Edit the /etc/n2n/supernode.conf file and add a listening port, for example, -p = 1234. +Start the supernode service using sudo systemctl start supernode. +Optionally, use sudo systemctl enable supernode to make the supernode start automatically when the system boots. +2. Port Security +When setting up a custom supernode, you need to open the specified port (such as port 1234 in the above example) on the firewall (usually iptables). Ensure that only the necessary ports are opened and appropriate access control is carried out on the ports to prevent unauthorized access. +III. Data Encryption +1. Payload Encryption +When payload encryption is enabled (by providing a key using the -k parameter), the supernode will not be able to decrypt the traffic exchanged between the two edge nodes, but it will still know which edge nodes are communicating. This means that although the data content is protected, the communication topology information is still visible. +2. Encryption Scheme Selection +The n2n edge nodes use AES encryption by default. You can select other encryption schemes according to your needs and specify them using the -A_ option. Different encryption schemes may vary in terms of security, performance, etc. It is recommended to refer to the comparison chart in the Crypto description and select a suitable encryption scheme according to the actual situation. +3. Encryption Benchmark Testing +If you compile n2n from the source code, you can use tools/n2n-benchmark to conduct benchmark tests on different encryption methods to understand their performance and find a balance between security and performance. +IV. Header Encryption +Metadata Protection +The header of the edge node contains some metadata, such as the virtual MAC address, IP address, real host name, and community name. To protect the privacy of this metadata, you can use the -H option on the edge node to encrypt the header and prevent the leakage of this information. +V. Authentication and Authorization +1. User/Password Authentication +When using the user/password-based authentication method, the supernode needs to be prepared accordingly. Configure the user and password information in the community.list file. If a user changes their password or you need to prohibit a user from accessing the community, you need to update or delete the corresponding lines in the community.list file and restart the supernode or send the reload_communities command to the management port to make the changes take effect. +2. Management Port Authentication +For command operations on the management port, there is a simple authentication mechanism. Read operations are generally allowed, while write operations may require providing the correct authentication password. The basic authentication logic is implemented in the mgmt_auth function, which determines whether to authorize by comparing the password hash value in the request with the provided authentication password hash value. Ensure that a secure management port password is set to prevent unauthorized management operations. +VI. Version and Update +1. Use of Stable Version +It is generally recommended to use the latest stable version. The current dev branch usually does not guarantee backward compatibility with the latest stable version or the previous dev state. If you want to try new features, you can compile from the dev branch, but you need to pay attention to tracking the changes that may occur quickly and provide feedback in the Issues section. +2. Timely Update +Regularly check for updates of n2n and install the latest version in a timely manner to obtain security patches and functional improvements to ensure the security and stability of the software. +VII. Code Security +1. Open Source Code Review +Since n2n is open source software, you can review the source code to understand its implementation details and potential security risks. In particular, carefully review the code sections related to key functions such as encryption, authentication, and network communication. +2. Security of Dependent Libraries +n2n may depend on some external libraries, such as OpenSSL. Ensure that the versions of these dependent libraries are secure and update the dependent libraries with security vulnerabilities in a timely manner. +By following the above security precautions, you can improve the security of the n2n virtual network and protect the privacy of data transmission and network communication. + <-- by 陈思良 --> + + +--- + + +<-------by 刘琳锋--------> +## Advanced Configuration + +More information about communities, support for multiple supernodes, routing, traffic restrictions and on how to run an edge as +a service is available in the [more detailed documentation](doc/Advanced.md). + + +## Contribution + +You can contribute to n2n in various ways: + +- Update an [open issue](https://github.com/ntop/n2n/issues) or create a new one with detailed information +- Propose new features +- Improve the documentation +- Provide pull requests with enhancements + +For details about the internals of n2n check out the [Hacking guide](https://github.com/ntop/n2n/blob/dev/doc/Hacking.md). + + +## Further Readings and Related Projects + +Answers to frequently asked questions can be found in our [FAQ document](https://github.com/ntop/n2n/blob/dev/doc/Faq.md). + +Here is a list of third-party projects connected to this repository: + +- Collection of pre-built binaries for Windows: [lucktu](https://github.com/lucktu/n2n) +- n2n for Android: [hin2n](https://github.com/switch-iot/hin2n) +- Docker images: [Docker Hub](https://hub.docker.com/r/supermock/supernode/) +- Go bindings, management daemons and CLIs for n2n edges and supernodes, Docker, Kubernetes & Helm Charts: [pojntfx/gon2n](https://pojntfx.github.io/gon2n/) +- Windows GUI (along with a custom version of n2n) but also working with regular n2n: [HappyNet](https://github.com/happynclient/happynwindows) + +--- + +(C) 2007-22 - ntop.org and contributors +<-------by 刘琳锋--------> diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 000000000..2f4fb085f --- /dev/null +++ b/README.zh.md @@ -0,0 +1,250 @@ +<-- by 唐崟 --> +## N2N 轻量级 VPN 简介 +N2N 是一款轻量级 VPN 软件,可绕过中间防火墙限制,轻松创建虚拟网络,适用于企业组网、远程办公等多种场景。 +## 核心组件 +超级节点:作为网络枢纽,负责边缘节点的注册与发现,需具备公网可访问端口,支持多社区并发中继。 +边缘节点:虚拟网络的终端节点,支持多平台部署,单设备可同时加入多个社区,具备 AES - 256 数据加密功能。 +## 虚拟社区机制 +N2N 以 "社区" 划分虚拟网络,每个社区有独立网络空间与加密密钥,支持自定义标识。单超级节点可管理数百个社区,实现成员动态连接。 +## 智能连接策略 +1.-UDP 直连:基于 NAT 穿透技术,零延迟,高带宽。 +2.-超级节点中继:UDP 可靠传输,自动优化连接。 +3.-混合模式:动态切换连接,保障传输稳定性。 +## 安全防护 +提供社区级 AES - 256 加密、身份认证、数据包校验等多层次安全防护,还支持密钥定期轮换 。 +<-- by 唐崟 --> + + +--- + + +<-- by 谢思源 --> + +## 手动编译说明文档 +## 一、文档概述 +这是一份关于手动编译的说明文档。它主要涵盖了在 Linux 系统下从源代码进行编译的步骤,同时提及了 Windows 和 MacOS 系统的相关信息、版本选择建议,以及对用户反馈的感谢。 +## 二、Linux 系统编译步骤 +在 Linux 系统中,从源代码编译软件有一套相对标准的流程。 +(一)执行 ./autogen.sh +首先,执行 ./autogen.sh 脚本。它的功能是自动生成配置所需的文件,并且帮助检测系统环境,比如检查系统中是否安装了必要的工具和库,从而为后续的编译配置过程做好准备。 +(二)运行 ./configure +接下来,运行 ./configure 命令。这个命令会进一步根据系统的实际情况,仔细检查各种依赖项是否满足编译要求。同时,它允许用户设置一些编译参数,例如指定安装路径、启用或禁用某些功能模块等,以便生成合适的 Makefile 文件,为实际的编译过程奠定基础。 +(三)执行 make +随后,执行 make 命令。它会根据 Makefile 中定义的规则编译源代码,将源代码转换为诸如可执行文件或库文件之类的目标产物。 +(四)可选步骤 make install +并且,make install 是一个可选步骤。当执行此命令时,编译好的文件将被安装到系统预先设置的目录中,这样用户就可以从系统的其他部分方便地调用这些已安装的软件或工具。 +## 三、Windows 和 MacOS 系统相关信息 +对于 Windows 和 MacOS 系统,由于它们的操作系统架构和环境与 Linux 存在差异,并且当涉及到优化编译过程或通用构建选项时,仅依靠上述 Linux 系统的编译步骤是不够的。此时,用户需要参考专门的构建文档,该文档将详细说明针对这些系统的具体编译和运行方法,包括所需的工具、环境配置等内容。 +## 四、版本选择建议 +在版本选择方面,本文档强烈建议使用最新的稳定版本。这是因为稳定版本经过了广泛的测试和验证,能确保更好的稳定性和兼容性,并减少使用过程中出现错误和问题的可能性。 +当前的开发(dev)分支主要用于开发和测试最新的、尚未完全稳定的功能特性。这个分支通常无法保证与最新的稳定版本以及之前的开发状态向后兼容。也就是说,从开发分支获取的代码可能无法在基于之前版本构建的环境中正常运行。 +然而,如果用户有足够的勇气尝试最新的功能,并且愿意承担潜在不稳定的风险,本文档也鼓励用户从开发分支开始编译。不过需要注意的是,由于开发分支中的代码更新频繁,用户需要密切跟踪代码的快速变化,并及时理解和适应这些变化,以确保编译过程顺利进行。 +## 五、用户反馈 +最后,本文档对在问题(Issues)部分提供反馈的用户表示感谢。用户反馈对于项目的持续改进和优化至关重要。通过收集和分析用户在使用过程中遇到的问题以及提出的建议等反馈信息,项目开发团队可以更好地识别软件中存在的不足,及时修复漏洞、优化功能,从而不断提升软件的质量和用户体验。 +<-- by 谢思源 --> + + +======= + + + + <-- by 黄朝淼 -->🇨🇳 中文版 README.md +# 设置自定义超级节点 +# 概述 +本指南将详细介绍如何设置自定义超级节点,同时会涉及到相关代码说明。通过设置自定义超级节点,你可以创建自己的 n2n 网络基础设施,增强网络的安全性和隐私性。 +## 一、设置自定义超级节点操作步骤 +## 安装 n2n 软件包 +在公共服务器(如 VPS )上安装 n2n 软件包。不同操作系统安装方法如下: +Ubuntu/Debian 系统:打开终端,执行命令sudo apt - get update && sudo apt - get install n2n ,更新软件源并安装 n2n。 +CentOS 系统:先确保安装了 EPEL 源,然后在终端执行sudo yum install n2n 安装 n2n 软件包。 +## 编辑配置文件 +使用文本编辑器(如nano或vim )打开/etc/n2n/supernode.conf文件,添加内容-p=1234 。其中1234为指定端口,可根据实际情况修改,此操作是设置超级节点监听端口。 +## 启动 supernode 服务 +在终端输入命令sudo systemctl start supernode ,启动 supernode 服务,让超级节点在设定端口运行。 +## 设置开机自启(可选) +若希望服务器重启后 supernode 服务自动启动,在终端执行命令sudo systemctl enable supernode + +## 参数处理逻辑和初始化逻辑 +setOption 函数是 n2n 超级节点中处理命令行参数的核心逻辑,它负责解析各种配置选项并设置相应的结构体成员。以下是对该函数的详细文字解释: +## 参数解析流程 +1.接收参数:函数接收三个参数:optkey(参数标识)、_optarg(参数值)和 sss(超级节点结构体指针)。 +2.分支处理:通过 switch 语句根据 optkey 处理不同的参数选项。 +3.端口参数 (-p): +格式判断:首先检查参数值中是否包含冒号 :,以区分不同的输入格式。 +IP: 端口格式:若包含冒号,将字符串分割为 IP 地址和端口两部分。 +使用 inet_addr 将 IP 字符串转换为网络字节序整数,再通过 ntohl 转换为主机字节序。 +使用 atoi 将端口字符串转换为整数。 +错误处理: +若 IP 地址无效(返回 INADDR_NONE),则默认绑定到所有可用接口(INADDR_ANY)。 +若端口号无效(解析为 0),则使用默认端口(通常为 7777)。 +仅 IP 或仅端口: +若参数值包含点号 .,则视为仅指定 IP 地址,端口使用默认值。 +否则视为仅指定端口号,IP 地址绑定到所有接口。 +安全特性 +输入验证:对 IP 地址和端口号进行有效性检查,防止非法输入导致程序崩溃。 +默认值处理:当输入无效时,自动回退到安全的默认配置,确保服务能正常启动。 +日志记录:通过 traceEvent 记录参数解析过程中的警告信息,方便调试和维护。 +## 超级节点初始化逻辑文字解释 +超级节点的初始化分为两个主要函数:sn_init_defaults 和 sn_init,它们分别完成不同阶段的初始化工作: +## 基础初始化(sn_init_defaults) +1.结构体成员初始化:设置超级节点结构体的各个字段为默认值。 +2.网络配置: +bind_address:默认绑定到所有可用接口(INADDR_ANY)。 +lport:默认监听端口(通常为 7777)。 +mport:管理端口(用于接收管理命令)。 +3.内存分配:为边缘节点表、社区列表等动态数据结构分配初始内存空间。 +4.默认参数设置:设置其他运行时参数,如线程数、超时时间等。 +## 高级初始化(sn_init) +1.线程创建: +创建解析线程(resolve_create_thread),用于处理域名解析和节点发现。 +该线程负责维护边缘节点的可达性信息,确保节点间通信顺畅。 +2.资源初始化: +初始化加密上下文,配置默认加密算法。 +启动管理接口,监听管理命令。 +3.服务准备: +创建套接字并绑定到指定地址和端口。 +开始监听客户端连接请求。 +4.状态通知: +通过日志记录初始化完成信息,包括绑定的地址、端口等关键配置。 +### 初始化流程特点 +分阶段初始化:将复杂的初始化过程拆分为基础设置和高级设置两个阶段,提高代码可维护性。 +模块化设计:各个初始化任务独立封装,便于功能扩展和修改。 +资源管理:合理分配和初始化系统资源,确保服务正常运行。 +错误处理:在初始化失败时能进行适当的清理和错误报告,保证程序健壮性。 +### 两者结合的工作流程 +参数解析:通过 setOption 函数解析命令行参数,修改默认配置。 +基础初始化:调用 sn_init_defaults 设置默认值,构建基础运行环境。 +参数应用:将解析后的参数值应用到初始化后的结构体中,覆盖默认值。 +高级初始化:调用 sn_init 完成剩余的初始化工作,启动核心服务组件。 +服务运行:超级节点开始监听客户端连接,处理节点间的通信请求。 +这种设计使得超级节点的配置灵活且易于扩展,同时保证了初始化过程的稳定性和安全性。 + +# 边缘节点配置 +## 连接到自定义超级节点 +在你的边缘节点上,你可以通过 -l 参数指定使用自定义的超级节点。例如:在边缘节点上使用以下命令连接到自定义超级节点: +sudo edge -d tun0 -l your_supernode_ip:1234 -c mycommunity -k mysecretkey -a 192.168.100.2 -f + +### 参数说明: +-d tun0: 使用 tun0 虚拟接口 +-l: 指定超级节点地址和端口 +-c: 社区名称 +-k: 加密密钥 +-a: 分配的虚拟 IP 地址 +-f: 前台运行 (便于调试) + <-- by 黄朝淼 -->🇨🇳 中文版 README.md + + + + +======= + +<-- by 文荣平 --> +### 快速设置 +- **安装方式**:部分Linux发行版已将 `n2n` 作为软件包提供,可使用 `sudo apt install n2n` 进行安装。此外,大多数发行版的最新软件包可在 [ntop repositories](http://packages.ntop.org/) 中获取。 +- **示例配置**:在不同主机上配置边缘节点的示例如下: +```sh + + + +# 以sudo权限运行edge命令,配置n2n边缘节点 +# -c 参数指定社区名称为 mynetwork +# -k 参数指定加密密钥为 mysecretpass +# -a 参数指定本地IP地址为 192.168.100.1 +# -f 参数表示以前台模式运行 +# -l 参数指定连接到的超级节点为 supernode.ntop.org:7777 + +``` + - 主机1: +```sh +sudo edge -c mynetwork -k mysecretpass -a 192.168.100.1 -f -l supernode.ntop.org:7777 +``` + + - 主机2: +```sh +sudo edge -c mynetwork -k mysecretpass -a 192.168.100.2 -f -l supernode.ntop.org:7777 +``` + +配置完成后,两台主机可以相互ping通。强烈建议选择自定义社区名称(`-c`)和秘密加密密钥(`-k`),以防止其他用户连接到您的计算机。为保护数据隐私、减少 `supernode.ntop.org` 的服务器负载,还建议设置自定义超级节点。 + + +<-- by 文荣平 --> + + +--- + + +<-- by 陈思良 --> +一、社区与加密密钥设置 +1. 自定义社区与密钥 +为防止其他用户连接到你的计算机,强烈建议为每个虚拟网络选择自定义的社区名称(使用 -c 参数)和安全的加密密钥(使用 -k 参数)。避免使用默认或简单易猜的社区名和密钥,以确保网络的私密性和安全性。 +2. 密钥强度 +加密密钥的长度和复杂度会影响加密的安全性。在设置加密密钥时,尽量使用较长且包含多种字符类型(字母、数字、特殊字符)的密钥。较长的密钥可以增加破解的难度,提高数据传输的安全性。 +二、超级节点使用安全 +1. 自定义超级节点 +为了保护数据隐私并减轻公共超级节点(如 supernode.ntop.org)的服务器负载,建议设置自定义的超级节点。按照以下步骤进行设置: +安装 n2n 包。 +编辑 /etc/n2n/supernode.conf 文件,添加监听端口,例如 -p=1234。 +使用 sudo systemctl start supernode 启动超级节点服务。 +可选择使用 sudo systemctl enable supernode 使超级节点在系统启动时自动启动。 +2. 端口安全 +在设置自定义超级节点时,需要在防火墙(通常是 iptables)上开放指定的端口(如上述示例中的 1234 端口)。确保仅开放必要的端口,并对端口进行适当的访问控制,防止未经授权的访问。 +三、数据加密 +1. 有效载荷加密 +当启用有效载荷加密(通过 -k 参数提供密钥)时,超级节点将无法解密两个边缘节点之间交换的流量,但它仍能知道哪些边缘节点正在通信。这意味着虽然数据内容得到了保护,但通信的拓扑信息仍然可见。 +2. 加密方案选择 +n2n 边缘节点默认使用 AES 加密。你可以根据需求选择其他加密方案,使用 -A_ 选项指定。不同的加密方案在安全性、性能等方面可能存在差异。建议参考 Crypto description 中的比较图表,根据实际情况选择合适的加密方案。 +3. 加密基准测试 +如果从源代码编译 n2n,可以使用 tools/n2n-benchmark 对不同的加密方法进行基准测试,以了解它们的性能表现,从而在安全性和性能之间找到平衡。 +四、头部加密 +元数据保护 +边缘节点的头部包含一些元数据,如虚拟 MAC 地址、IP 地址、真实主机名和社区名称等。为了保护这些元数据的隐私,可以在边缘节点上使用 -H 选项对头部进行加密,防止这些信息被泄露。 +五、认证与授权 +1. 用户 / 密码认证 +在使用用户 / 密码基于的认证方式时,超级节点需要进行相应的准备。在 community.list 文件中配置用户和密码信息。如果用户更改密码或需要禁止某个用户访问社区,需要更新或删除 community.list 文件中的相应行,并重启超级节点或向管理端口发送 reload_communities 命令,使更改生效。 +2. 管理端口认证 +对于管理端口的命令操作,有简单的认证机制。读取操作通常允许,而写入操作可能需要提供正确的认证密码。在 mgmt_auth 函数中实现了基本的认证逻辑,通过比较请求中的密码哈希值与提供的认证密码哈希值来判断是否授权。确保设置安全的管理端口密码,防止未经授权的管理操作。 +六、版本与更新 +1. 使用稳定版本 +一般建议使用最新稳定版本。当前的 dev 分支通常不保证与最新稳定版本或以前的 dev 状态向后兼容。如果要尝试新功能,可以从 dev 分支编译,但需要注意跟踪可能快速发生的变化,并在 Issues 部分提供反馈。 +2. 及时更新 +定期检查 n2n 的更新,及时安装最新版本,以获取安全补丁和功能改进,确保软件的安全性和稳定性。 +七、代码安全 +1. 开源代码审查 +由于 n2n 是开源软件,你可以审查源代码以了解其实现细节和潜在的安全风险。特别是涉及加密、认证、网络通信等关键功能的代码部分,需要仔细审查。 +2. 依赖库安全 +n2n 可能依赖于一些外部库,如 OpenSSL 等。确保这些依赖库的版本是安全的,及时更新存在安全漏洞的依赖库。 +通过遵循以上安 + + +<-- by 陈思良 --> + + + +--- + + + +<-------- by 刘琳锋-------> +高级配置 +有关社区、对多个超级节点的支持、路由、流量限制以及如何将边缘作为运行的更多信息 更详细的文档中提供了 Service。 + +贡献 +您可以通过多种方式为 n2n 做出贡献: + +更新未解决的问题或创建一个新问题并提供详细信息 +提出新功能 +改进文档 +提供具有增强功能的拉取请求 +有关 n2n 内部结构的详细信息,请查看 Hacking 指南。 + +延伸阅读和相关项目 +常见问题的答案可以在我们的常见问题解答文档中找到。 + +以下是连接到此存储库的第三方项目列表: + +适用于 Windows 的预构建二进制文件集合:lucktu +适用于 Android 的 n2n:hin2n +Docker 镜像:Docker Hub +用于n2n边缘和超级节点、Docker、Kubernetes和Helm图表的Go绑定、管理守护进程和CLI:pojntfx/gon2n +Windows GUI(以及 n2n 的自定义版本)也适用于常规 n2n:HappyNet +<-------- by 刘琳锋-------> diff --git a/ai_usage_screenshots/2205308050315_1.png b/ai_usage_screenshots/2205308050315_1.png new file mode 100644 index 000000000..267daadf2 Binary files /dev/null and b/ai_usage_screenshots/2205308050315_1.png differ diff --git a/ai_usage_screenshots/2205308050315_2.png b/ai_usage_screenshots/2205308050315_2.png new file mode 100644 index 000000000..80739e79a Binary files /dev/null and b/ai_usage_screenshots/2205308050315_2.png differ diff --git a/ai_usage_screenshots/2205308050315_3.png b/ai_usage_screenshots/2205308050315_3.png new file mode 100644 index 000000000..683df4fde Binary files /dev/null and b/ai_usage_screenshots/2205308050315_3.png differ diff --git a/ai_usage_screenshots/2205308050316_1.png b/ai_usage_screenshots/2205308050316_1.png new file mode 100644 index 000000000..bab5fa75f Binary files /dev/null and b/ai_usage_screenshots/2205308050316_1.png differ diff --git a/ai_usage_screenshots/2205308050316_2.png b/ai_usage_screenshots/2205308050316_2.png new file mode 100644 index 000000000..a02653a90 Binary files /dev/null and b/ai_usage_screenshots/2205308050316_2.png differ diff --git a/ai_usage_screenshots/2205308050316_3.png b/ai_usage_screenshots/2205308050316_3.png new file mode 100644 index 000000000..76813b61a Binary files /dev/null and b/ai_usage_screenshots/2205308050316_3.png differ diff --git a/ai_usage_screenshots/2205308050317_1.png b/ai_usage_screenshots/2205308050317_1.png new file mode 100644 index 000000000..e5339e336 Binary files /dev/null and b/ai_usage_screenshots/2205308050317_1.png differ diff --git a/ai_usage_screenshots/2205308050317_2.png b/ai_usage_screenshots/2205308050317_2.png new file mode 100644 index 000000000..1784c6cd2 Binary files /dev/null and b/ai_usage_screenshots/2205308050317_2.png differ diff --git a/ai_usage_screenshots/2205308050317_3.png b/ai_usage_screenshots/2205308050317_3.png new file mode 100644 index 000000000..bcbaec5b6 Binary files /dev/null and b/ai_usage_screenshots/2205308050317_3.png differ diff --git a/ai_usage_screenshots/2205308050317_4.png b/ai_usage_screenshots/2205308050317_4.png new file mode 100644 index 000000000..8e2b05314 Binary files /dev/null and b/ai_usage_screenshots/2205308050317_4.png differ diff --git a/ai_usage_screenshots/2205308050317_5.png b/ai_usage_screenshots/2205308050317_5.png new file mode 100644 index 000000000..55c713ae2 Binary files /dev/null and b/ai_usage_screenshots/2205308050317_5.png differ diff --git a/ai_usage_screenshots/2205308050320_1.png b/ai_usage_screenshots/2205308050320_1.png new file mode 100644 index 000000000..c7a341423 Binary files /dev/null and b/ai_usage_screenshots/2205308050320_1.png differ diff --git a/ai_usage_screenshots/2205308050320_2.png b/ai_usage_screenshots/2205308050320_2.png new file mode 100644 index 000000000..0e2663a8d Binary files /dev/null and b/ai_usage_screenshots/2205308050320_2.png differ diff --git a/ai_usage_screenshots/2205308050320_3.png b/ai_usage_screenshots/2205308050320_3.png new file mode 100644 index 000000000..316a446fa Binary files /dev/null and b/ai_usage_screenshots/2205308050320_3.png differ diff --git a/ai_usage_screenshots/2205308050340_1.png b/ai_usage_screenshots/2205308050340_1.png new file mode 100644 index 000000000..dbae6f4b9 Binary files /dev/null and b/ai_usage_screenshots/2205308050340_1.png differ diff --git a/ai_usage_screenshots/2205308050340_2.png b/ai_usage_screenshots/2205308050340_2.png new file mode 100644 index 000000000..f4ba4f06f Binary files /dev/null and b/ai_usage_screenshots/2205308050340_2.png differ diff --git a/ai_usage_screenshots/2205308050340_3.png b/ai_usage_screenshots/2205308050340_3.png new file mode 100644 index 000000000..b9cb3f2cc Binary files /dev/null and b/ai_usage_screenshots/2205308050340_3.png differ diff --git a/ai_usage_screenshots/2205308050346_1.png b/ai_usage_screenshots/2205308050346_1.png new file mode 100644 index 000000000..bb2d65093 Binary files /dev/null and b/ai_usage_screenshots/2205308050346_1.png differ diff --git a/ai_usage_screenshots/2205308050346_2.png b/ai_usage_screenshots/2205308050346_2.png new file mode 100644 index 000000000..536756297 Binary files /dev/null and b/ai_usage_screenshots/2205308050346_2.png differ diff --git a/ai_usage_screenshots/2205308050346_3.png b/ai_usage_screenshots/2205308050346_3.png new file mode 100644 index 000000000..89b929adf Binary files /dev/null and b/ai_usage_screenshots/2205308050346_3.png differ diff --git a/modification_log.md b/modification_log.md new file mode 100644 index 000000000..7977396b8 --- /dev/null +++ b/modification_log.md @@ -0,0 +1,32 @@ + +![alt text](ai_usage_screenshots/2205308050340_1.png) +![alt text](ai_usage_screenshots/2205308050340_2.png) +![alt text](ai_usage_screenshots/2205308050340_3.png) +======= + +<!-- by 黄朝淼 --> +![alt text](2205308050317_1.png) +![alt text](2205308050317_2.png) +![alt text](2205308050317_3.png) +![alt text](2205308050317_4.png) +![alt text](2205308050317_5.png) + +# AI 修改记录 +## 一、内容优化 +### 结构梳理: +对原文内容进行结构化调整,在各级标题格式上保持统一,如将中文数字序号、纯英文序号结合使用,增强文档层次感,使操作步骤、逻辑解释等内容分区更清晰,方便读者快速定位所需信息。 +### 表述精炼: +简化冗余语句,例如将 “本指南将详细介绍如何设置自定义超级节点,同时会涉及到相关代码说明” 优化为 “本指南详细介绍自定义超级节点的设置方法及相关代码说明” ,在保持原意的基础上使表达更加简洁流畅。 +## 二、技术细节完善 +### 命令说明补充: +在操作系统安装命令部分,补充了命令执行效果说明,如 “Ubuntu/Debian 系统:打开终端,执行命令sudo apt - get update && sudo apt - get install n2n,sudo apt-get update用于更新软件源,获取最新软件包信息,sudo apt-get install n2n则用于安装 n2n 软件”,帮助读者更好地理解命令用途。 +逻辑解释细化:在参数处理逻辑和初始化逻辑部分,增加代码与实际功能的对应示例,如在解释setOption函数对端口参数处理时,举例 “当输入参数为-p 192.168.1.100:8888,函数会将192.168.1.100解析为 IP 地址,8888解析为端口号”,使抽象逻辑更易理解。 +## 三、语言风格统一 +### 中英文格式规范: +统一代码命令、参数等英文内容的格式,全部使用英文输入法下的字符,避免中英文标点混合使用导致的格式混乱问题。 +语气一致性:全文采用客观、正式的技术文档语气,避免口语化表述,确保在介绍操作步骤、解释技术原理等内容时风格一致,增强文档专业性 +======= +![alt text](ai_usage_screenshots/2205308050315_1.png) +![alt text](ai_usage_screenshots/2205308050315_2.png) + + diff --git a/terms.md b/terms.md new file mode 100644 index 000000000..4595e6b5b --- /dev/null +++ b/terms.md @@ -0,0 +1,244 @@ +<-- by 唐崟 --> +N2N N2N:一款轻量级 VPN 软件,可创建虚拟网络,绕过防火墙限制 +VPN(Virtual Private Network) 虚拟专用网络:可在公共网络上建立加密通道,实现安全通信 +supernode 超级节点:作为网络枢纽,负责边缘节点的注册与发现,支持多社区并发中继 +edge node 边缘节点:虚拟网络的终端节点,支持多平台部署,具备数据加密功能 +virtual network 虚拟网络:通过软件技术构建的网络,可实现设备间的互联 +firewall 防火墙:用于网络安全防护,限制网络访问的设备或软件 +community 社区:N2N 中以虚拟网络划分的单位,每个社区有独立网络空间和加密密钥 +NAT(Network Address Translation) 网络地址转换:用于在不同网络间转换地址,N2N 中直连时会用到 NAT 穿透技术 +UDP(User Datagram Protocol) 用户数据报协议:一种无连接的传输层协议,N2N 中用于节点间数据传输 +AES - 256(Advanced Encryption Standard - 256) 高级加密标准 - 256:一种数据加密算法,N2N 中用于社区级数据加密 +identity authentication 身份认证:用于确认用户或设备身份的过程,保障网络安全 +data packet verification 数据包校验:检查数据包的完整性,防止数据传输过程中被篡改 +key rotation 密钥轮换:定期更换加密密钥,增强数据安全性 +<-- by 唐崟 --> + +--- + +<-- by 谢思源 --> +手动编译 +中文术语:手动编译 +英文术语:Manual Compilation +解释:指通过手动执行一系列命令从源代码构建软件的过程 +源代码 +中文术语:源代码 +英文术语:Source Code +解释:以人类可读的高级语言编写的程序代码,可被编译或解释执行 +Linux 系统 +中文术语:Linux 系统 +英文术语:Linux System +解释:一种开源的操作系统,广泛应用于服务器和各种设备中 +编译 +中文术语:编译 +英文术语:Compile +解释:将源代码转换为可执行文件或其他目标产物的过程 +配置 +中文术语:配置 +英文术语:Configure +解释:根据系统实际情况设置编译参数,检查依赖项,生成 Makefile 等操作 +###./autogen.sh 脚本 +中文术语:./autogen.sh 脚本 +英文术语:./autogen.sh Script +解释:用于自动生成配置所需文件,检测系统环境的脚本 +###./configure 命令 +中文术语:./configure 命令 +英文术语:./configure Command +解释:进一步检查依赖项,设置编译参数,生成 Makefile 的命令 +make 命令 +中文术语:make 命令 +英文术语:make Command +解释:根据 Makefile 规则编译源代码的命令 +make install 命令 +中文术语:make install 命令 +英文术语:make install Command +解释:可选的安装命令,将编译好的文件安装到系统指定目录 +依赖项 +中文术语:依赖项 +英文术语:Dependencies +解释:软件运行或编译所依赖的其他软件包、库或工具等 +可执行文件 +中文术语:可执行文件 +英文术语:Executable File +解释:可以在操作系统上直接运行的文件,由源代码编译生成 +库文件 +中文术语:库文件 +英文术语:Library File +解释:包含可被其他程序调用的函数和数据的文件,用于代码复用 +Makefile +中文术语:Makefile +英文术语:Makefile +解释:包含编译规则和相关配置信息的文件,make 命令依据此文件进行编译操作 +Windows 系统 +中文术语:Windows 系统 +英文术语:Windows System +解释:由微软公司开发的操作系统,在个人计算机中广泛使用 +MacOS 系统 +中文术语:MacOS 系统 +英文术语:MacOS System +解释:苹果公司开发的操作系统,用于苹果的 Mac 系列计算机 +优化 +中文术语:优化 +英文术语:Optimization +解释:对编译过程或软件性能进行改进,以提高效率或减少资源消耗 +通用构建选项 +中文术语:通用构建选项 +英文术语:General Build Options +解释:适用于不同系统和场景的常见编译配置选项 +稳定版本 +中文术语:稳定版本 +英文术语:Stable Version +解释:经过充分测试和验证,稳定性和兼容性有保障的软件版本 +开发分支(dev 分支) +中文术语:开发分支(dev 分支) +英文术语:Development Branch (dev Branch) +解释:用于开发新功能、测试未稳定特性的代码分支 +向后兼容 +中文术语:向后兼容 +英文术语:Backward Compatibility +解释:新的版本或代码能够在基于之前版本构建的环境中正常运行的特 +<-- by 谢思源 --> + + + +--- + + + +<-- by 黄朝淼 --> + 超级节点(Supernode):在网络中具有特殊功能和地位的节点,通常承担着数据转发、网络管理等重要任务,可用于构建特定的网络架构。英文解释:A node in a network that has special functions and status, usually undertaking important tasks such as data forwarding and network management, and can be used to build a specific network architecture. +n2n:一种虚拟专用网络(VPN)技术,允许用户创建自己的私有网络,实现不同设备之间的安全通信。英文解释:A virtual private network (VPN) technology that allows users to create their own private network to achieve secure communication between different devices. +配置文件(Configuration File):包含软件或系统配置信息的文件,用于指定各种参数和设置,以控制软件或系统的行为。英文解释:A file that contains the configuration information of software or a system, used to specify various parameters and settings to control the behavior of the software or system. +端口(Port):计算机与外部设备或其他计算机进行通信的接口,每个端口都有一个唯一的编号,用于区分不同的通信通道。英文解释:An interface through which a computer communicates with external devices or other computers. Each port has a unique number used to distinguish different communication channels. +源码编译(Source Code Compilation):将人类可读的源代码转换为计算机可执行的机器代码的过程,需要使用编译器等工具。英文解释:The process of converting human - readable source code into machine - code that can be executed by a computer, which requires the use of tools such as compilers. +边缘节点(Edge Node):位于网络边缘的节点,通常与终端设备或用户直接连接,用于接收和发送数据。英文解释:A node located at the edge of a network, usually directly connected to terminal devices or users, used to receive and send data. +虚拟接口(Virtual Interface):在计算机系统中模拟出来的网络接口,并非实际的物理接口,用于实现特定的网络功能或连接到虚拟网络。英文解释:A network interface simulated in a computer system, not an actual physical interface, used to implement specific network functions or connect to a virtual network. +社区名称(Community Name):在特定的网络环境中,用于标识一组相关设备或用户的名称,通常用于区分不同的网络区域或用户群体。英文解释:In a specific network environment, a name used to identify a group of related devices or users, usually used to distinguish different network areas or user groups. +加密密钥(Encryption Key):用于对数据进行加密和解密的字符串或数字,确保数据在传输和存储过程中的安全性。英文解释:A string or number used to encrypt and decrypt data, ensuring the security of data during transmission and storage. +自启(Auto - start):指计算机程序或服务在操作系统启动时自动运行的功能,无需用户手动启动。英文解释:Refers to the function that a computer program or service automatically runs when the operating system starts, without the need for manual user startup. + +<-- by 黄朝淼 --> + + +--- + + +<-- by 文荣平 --> + + + +|------------------|-----------------------|--------------------------------------------------------------------------| +--- + +| 边缘节点 | Edge Node | 运行n2n edge客户端的设备,加入虚拟网络并通过超级节点与其他边缘节点通信 | + +--- + +| 超级节点 | Supernode | 协助边缘节点建立连接的中继服务器,负责转发发现和连接信息 | + +--- + +| 社区名称 | Community Name | `-c`参数值,用于隔离不同用户组的虚拟网络,类似"网络名称" | + +--- + +| 加密密钥 | Encryption Key | `-k`参数值,用于加密节点间通信数据的密钥,需所有成员保持一致 | + +--- + +| 虚拟网络IP | Virtual Network IP | `-a`参数值,边缘节点在虚拟网络中的私有IP地址,用于内部通信 | + +--- + +| 软件包仓库 | Software Repository | 如ntop repositories,提供n2n软件包的在线存储和分发服务 | + +--- + +| 前台模式 | Foreground Mode | `-f`参数效果,使进程在终端前台运行,便于查看实时输出 | + +--- + +| 中继服务器负载 | Relay Server Load | 超级节点处理连接请求的工作量,建议自建节点减轻公共服务器压力 | + + + +<-- by 文荣平 --> + + + +--- + + +<-- by 陈思良 --> + +负载加密(payload encryption):对传输的数据(有效负载)进行加密,防止传输中数据内容被非法获取,提升通信安全性。 + +超级节点(supernode):在网络架构里具有特殊功能或权限的节点,可承担管理、协调等任务,与边缘节点相对。 + +边缘节点(edge node):位于网络边缘,是用户设备或与之直接相连的设备,在点对点 VPN 中负责数据接入和传输。 + +加密方案(encryption scheme):实现加密的具体算法、策略及流程组合,不同方案在安全性、性能等方面有差别。 + +AES 加密(AES encryption):即 Advanced Encryption Standard(高级加密标准),是对称加密算法,在数据加密领域应用广泛,安全性高。 + +基准测试(benchmark testing):利用特定测试程序和方法,对系统、软件、算法等的性能指标(如速度、效率)进行评估和比较。 + +元数据(metadata):描述其他数据属性的数据,如边缘节点的虚拟 MAC 地址、IP 地址等,用于标识和管理数据。 + +虚拟 MAC 地址(virtual MAC address):通过软件等虚拟出的 MAC 地址,非物理网卡真实地址,用于特定网络标识等场景。 + +实际 MAC 地址(actual MAC address):网络设备物理网卡的唯一硬件地址,用于局域网中设备身份标识。 +hostname:主机名,是网络中计算机或设备的名称,用于在网络中识别区分不同设备。 + +<-- by 陈思良 --> + + +--- + + +<---by 刘琳锋---> +# 术语词汇表 + +以下是一些常用术语及其定义,以帮助您更好地理解相关文档和讨论。 + +## FAQ +**Frequently Asked Questions** 的缩写,指常见问题解答。 + +## CLI +**Command Line Interface** 的缩写,指命令行界面,是一种通过文本命令与计算机程序交互的用户界面。 + +## GUI +**Graphical User Interface** 的缩写,指图形用户界面,是一种通过图形图标和菜单与计算机程序交互的用户界面。 + +## Docker +一种开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。 + +## Kubernetes +一个开源的容器编排系统,用于自动化部署、扩展和管理容器化应用程序。 + +## Helm +Kubernetes 的包管理工具,它帮助您定义、安装和升级 Kubernetes 应用程序。 + +## n2n +一种点对点(P2P)虚拟专用网络(VPN)解决方案,允许用户创建一个安全的网络,使远程计算机可以相互通信,就像它们在同一局域网中一样。 + +## Pull Request +在版本控制系统中,特别是在使用 Git 的系统中,一个用户向另一个用户或团队的代码库提交更改的请求。 + +## Supernode +在网络中,超级节点是一种特殊的节点,它充当其他节点之间的中介,帮助它们相互通信。 + +## Edge +在网络术语中,边缘节点是指网络的外围部分,通常是指连接到网络的最终用户设备。 + +## Lucktu +一个为 Windows 提供的 n2n 预编译二进制文件集合。 + +## Hin2n +为 Android 设备提供的 n2n 客户端。 + +## HappyNet +一个为 Windows 提供的 GUI,支持 n2n 网络的配置和管理。 +<---by 刘琳锋---> + +