PCDN Worker Installation Tutorial
About PCDN Worker
A Peer-to-Peer Content Delivery Network (P2P CDN or PCDN) is a decentralized content delivery system that uses the collective bandwidth and storage of user devices to distribute content, unlike traditional CDNs that rely on centralized servers.
By enabling peers to act as both clients and servers, PCDNs distribute the content delivery load across a network of users, which can improve efficiency and scalability, especially for bandwidth-intensive applications like live streaming and software updates.
The PCDN Worker
is an Edge Cloud Worker deployed on ARO Network's open application infrastructure for Edge Services (supports third-party application). The PCDN Worker
enables ARO Client with high-performance PCDN Edge Service capabilities.
Follow this tutorial to intall PCDN Worker software image on your ARO Client.
Note: Please complete
Debian
installation and ARO Client installation before you proceed with this tutorial.
1. Pre-Installation Preparation
1.1 Prepare a Physical Machine with ARO Client Installed, Monitor, and Keyboard
You need a physical machine with ARO Client already installed (refer to the ARO Client Installation Tutorial). Ensure the machine is connected to the internet via an Ethernet cable.
1.2 Obtain the LAN IP Address of ARO Client
Find your LAN IP Address of ARO Client.
For example, get the LAN IP Address from the Debian
system:
ip addr
2. PCDN Worker Installation
2.1 Log in to the Web Interface
On another machine within the same LAN, open a browser and navigate to https://Your LAN IP:9090
, replacing Your LAN IP
with your actual IP address.
Select “Advanced”.
Enter the login interface with the username: client
and password: 123456
.
Enter the password to switch to administrative privileges.
2.2 Configure Bridge
Select Networking -> Add bridge.
Add a bridge. If there are multiple physical network interfaces, you can select multiple ones.
After adding, verify the bridge configuration.
2.3 Configure Storage Pool
When creating a storage pool, ensure you select the /data
directory.
Activate the storage pool.
Select aro-pcdn-pools -> Storage volumes, then click Create volume.
For multi-disk systems, set the volume size to 80% of the /data
directory capacity. For single-disk systems, set it to (disk capacity - 100GB) * 80%.
Verify the created volume.
2.4 Download the PCDN Worker Software Image
After downloading the file, execute the following commands in the terminal:
wget https://download.aro.network/files/images/aro-pcdn-client-latest.iso
sudo mv /home/client/aro-pcdn-client-latest.iso /var/lib/libvirt/images/
sudo chown libvirt-qemu:libvirt-qemu /var/lib/libvirt/images/aro-pcdn-client-latest.iso
3. PCDN Worker Configuration
3.1 Configure Basic Information
Fill in the virtual machine information with the following key details:
- Name: Must be
aro-pcdn-client-1
- Installation type: Local Install media
- Installation source:
/var/lib/libvirt/images/aro-pcdn-client-latest.iso
. - Storage: Select the pool created in the previous step.
- Volume: Select the volume created in the previous step within the pool.
- Memory: Set to 80% of the available memory capacity.
After filling in the details, select Create and edit to enter the detailed configuration page.
Enable Autostart and edit the vCPUs.
Set the vCPUs to 80% of the available CPU cores.
3.2 Configure Network Interface
3.2.1 Choose Your Network Interface Type
Click on edit
button for the Network interfaces
settings:
Choose the right Interface Type
that fits into your network setup and follow steps accordingly.
Bridge to LAN
:- Choose this type if you have PPPoE dial-up on the ONT and physical machine directly connected to the ONT.
- Follow 3.2.2 steps for further configurations (and skip 3.2.3).
Virtual Network
:- Choose this type if you have PPPoE dial-up on the physical machine (that runs ARO Client) and ONT set to Bridge Mode.
- Follow 3.2.3 steps for further configurations (and skip 3.2.2).
3.2.2 If You Choose Bridge to LAN
:
Follow steps below if you choose Bridge to LAN
type:
Step 1. Select Bridge to LAN
in the Interface Type
field
Step 2. Select the Bridge that you have set up in the Step #2.2
Step 3. Save and return
3.2.3 If You Choose Virtual Network
:
Follow steps below if you choose Virtual Network
type:
Step 1. Select Virtual Network
in the Interface Type
field
Step 2. Select default
in the source
field
Step 3. Save and return
Step 4. Configure iptables.rules
on the host machine (Follow detailed steps 4.a~4.c below)
4.a Back up iptables.rules
iptables-save > ~/iptables.rules
In case something is wrong, you can restore the iptables.rules
with the following commands. (Skip this process if you have successfully set up the iptable.rules
)
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
iptables-restore < ~/iptables.rules
4.b Set iptables.rules
:
- Replace the VM_IP with the actual local IP of your PCDN Worker client on VM.
- Confirm that the network card for dial-up is
ppp0
. If not, change to the name of the actual one.
Execute:
#!/bin/bash
set -e
VM_IP="192.168.122.164"
WAN_IF="ppp0"
LAN_IF="virbr0"
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -F
iptables -F FORWARD
iptables -t nat -A POSTROUTING -s $VM_IP -o $WAN_IF -j MASQUERADE
# 4. TCP DNAT:80,443,9500-9700
iptables -t nat -A PREROUTING -i $WAN_IF -p tcp -m multiport --dports 80,443,9500:9700 -j DNAT --to-destination $VM_IP
iptables -t nat -A PREROUTING -i $WAN_IF -p udp -j DNAT --to-destination $VM_IP
iptables -I FORWARD 1 -i $WAN_IF -o $LAN_IF -d $VM_IP -p tcp -m multiport --dports 80,443,9500:9700 -j ACCEPT
iptables -I FORWARD 1 -i $WAN_IF -o $LAN_IF -d $VM_IP -p udp -j ACCEPT
iptables -I FORWARD 1 -o $WAN_IF -i $LAN_IF -s $VM_IP -p tcp -m multiport --sports 80,443,9500:9700 -j ACCEPT
iptables -I FORWARD 1 -o $WAN_IF -i $LAN_IF -s $VM_IP -p udp -j ACCEPT
4.c Test if the settings come into effect:
Use another device and try visiting links below with a browser (Replace Your IP with the actual IP of your PCDN Worker client after successful dial-up):
http://Your IP:40001
https://Your IP:9090
3.3 Complete Image Installation
The system enters the installation phase.
Select the system disk.
In the screenshot, the console prompts the user to select the system disk. Button on the left side: Comfirm. Buttom on the right side: Cancel.
After installation completes, enter the console and press Enter.
Once the installation is complete, shut down the PCDN Worker
client and eject the CDROM.
After shutting down the PCDN Worker client, eject and delete the CDROM.
Start the PCDN Worker client.
At this point, the PCDN Client installation is complete.