- Python 3.10+
- FFmpeg ( used for TS to MP4 conversion)
Tested on:
- Windows 11
- Python 3.10
This document explains exactly how to run the project from scratch on another computer.
Follow the steps in order.
The project was developed and tested using:
Python 3.10+
Check if Python is installed:
python --version
If Python is not installed, download it from:
https://www.python.org/downloads/
During installation make sure to enable:
Add Python to PATH
Open a terminal inside the project folder and run:
pip install -r requirements.txt
If the file requirements.txt does not exist, install manually:
FFmpeg is used to convert downloaded video from .ts to .mp4 format.
Check if FFmpeg is installed:
ffmpeg -version
If it is not installed, download it from:
https://ffmpeg.org/download.html
Add FFmpeg to the system PATH.
If FFmpeg is not installed the program will still work, but the video will remain in .ts format instead of .mp4.
Most video players such as VLC can still play .ts files.
Clone the repository:
git clone https://github.com/Amitaibou/NetworkFinalProject.git
Then enter the project directory:
cd finalProject
If the project was downloaded as a ZIP file, simply extract it and open a terminal in the project root folder.
The system streams segmented videos.
Source videos must be placed in the following directory:
video_sources/
Example structure:
video_sources/ video1.mp4 video2.mp4
After placing the videos, run the preparation script:
python prepare_video.py
This script will automatically generate segmented videos in multiple quality levels.
The script creates the following structure:
assets/videos/video1/
- low/
- mid/
- high/
assets/videos/video2/
- low/
- mid/
- high/
Each folder contains multiple video segments.
This step only needs to be performed once.
If the assets/videos folder is empty, run:
python prepare_video.py
before starting the servers.
All servers must run in separate terminals.
Do not close the servers while the client is downloading video.
End of instructions.
This project presents a simplified network-based video delivery system implemented in Python.
It combines several networking components into one integrated application, including:
- DHCP client/server for dynamic IP assignment
- DNS client/server for domain name resolution
- Application server for segmented video delivery
- TCP and custom Reliable UDP (RUDP) transport
- Manual and adaptive quality selection
The purpose of the project is to demonstrate how a client can obtain an IP address, resolve a service name, connect to a video server, and download segmented video while comparing different transport mechanisms.
- Dynamic IP assignment using DHCP
- Domain name resolution using DNS
- Video delivery over TCP
- Video delivery over custom Reliable UDP (RUDP)
- Support for:
- Stop & Wait
- Go-Back-N
- Selective Repeat
- Manual quality selection:
lowmidhigh
- Adaptive quality selection based on measured bandwidth
- Packet loss simulation for RUDP testing
- Logging, runtime metrics, and summary statistics
- Automatic TS to MP4 conversion after download
flowchart LR
C[Client] -->|DHCP Discover / Request| D[DHCP Server]
C -->|DNS Query| N[DNS Server]
C -->|TCP or RUDP Video Requests| A[Application Server]
D -->|Assigned IP Lease| C
N -->|Resolved IP Address| C
A -->|Manifest + Video Segments| C
flowchart TD
S[Start Client] --> H[Request IP from DHCP]
H --> I[Receive Lease]
I --> J[Query DNS]
J --> K{Resolved domain is video server?}
K -- No --> L[Show resolved IP only]
K -- Yes --> M[Fetch manifest]
M --> N[Select video]
N --> O[Select transport]
O --> P{RUDP selected?}
P -- Yes --> Q[Choose RUDP mode]
P -- No --> R[Continue]
Q --> R
R --> T[Choose Auto or Manual quality]
T --> U[Download all segments]
U --> V[Merge output]
V --> W[Convert TS to MP4]
W --> X[Open result]
finalProject/
βββ assets/
β βββ videos/
β βββ video1/
β β βββ low/
β β βββ mid/
β β βββ high/
β βββ video2/
β βββ low/
β βββ mid/
β βββ high/
β
βββ client/
β βββ app_client.py
β βββ dhcp_client.py
β βββ dns_client.py
β
βββ protocol/
β βββ config.py
β βββ logger.py
β βββ rudp.py
β
βββ servers/
β βββ app_server.py
β βββ dhcp_server.py
β βββ dns_server.py
β
βββ video_sources/
β βββ video1.mp4
β βββ video2.mp4
β
βββ prepare_video.py
βββ README.md
Open four separate terminals from the project root.
python servers/dhcp_server.pypython servers/dns_server.pypython servers/app_server.pypython client/app_client.pyPlace source video files inside:
video_sources/Then run:
python prepare_video.pyThis script generates segmented videos in multiple quality levels under:
assets/videos/assets/videos/barcelona/
βββ low/
βββ mid/
βββ high/- Transport Mode Description
- TCP Built-in Reliable transport using standard TCP
- RUDP Stop & Wait Sends one packet at a time, simple but slower
- RUDP Go-Back-N Uses a sending window, retransmits a range on loss
- RUDP Selective Repeat Retransmits only missing packets, usually most efficient
Mode Behavior Manual User selects a fixed quality for all segments Auto Client estimates bandwidth and adjusts the next segment quality
- DHCP lease allocation
- DNS name resolution
- TCP vs UDP behavior
- Reliability over UDP
- Packet loss and retransmissions
- Window-based transmission
- Adaptive video streaming
- Client-server architecture
- Logging and runtime analysis
- The client requests an IP address from the DHCP server.
- The client queries the DNS server for a domain name.
- If the domain points to the video application server, the client continues.
- The client downloads the video manifest.
- video
- transport protocol
- an RUDP mode (if needed)
- manual or adaptive quality mode
- The client downloads all video segments.
- The output is saved locally and reconstructed into an MP4 file.
- TCP usually provides very fast and stable transfer on localhost.
- RUDP makes packet loss, acknowledgments, and retransmissions more visible.
- Under packet loss:
- Go-Back-N may reduce effective throughput more aggressively
- Selective Repeat usually performs better than Go-Back-N
- In Auto mode, lower measured bandwidth may cause the next segment quality to drop to mid or low
Amitai Buzaglo Β· Ofri Ben Shabo Β· Daniel Kfir
Department: Computer Science
Institution: Ariel University
Academic Level: Second-year undergraduate students