2025-09-11 12:15:06 +03:00
|
|
|
import numpy as np
|
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
|
|
# Range of N values
|
|
|
|
|
N = np.linspace(1e4, 1e5, 500)
|
|
|
|
|
|
2025-09-22 14:34:59 +03:00
|
|
|
# Maintenance bandwidth formula (converted to KB/sec)
|
|
|
|
|
bandwidth_maint = (6.67 + 48.2 * np.log2(N)) / 1024
|
2025-09-11 12:15:06 +03:00
|
|
|
|
|
|
|
|
# Plot
|
|
|
|
|
plt.figure(figsize=(8,5))
|
|
|
|
|
plt.plot(N, bandwidth_maint, label=r'Maintenance Bandwidth')
|
|
|
|
|
plt.xlabel('N (number of DHT nodes)')
|
2025-09-22 14:34:59 +03:00
|
|
|
plt.ylabel('Maintenance Bandwidth (KB/sec)')
|
2025-09-11 12:15:06 +03:00
|
|
|
plt.title('Maintenance Cost For Varying Number of Nodes')
|
|
|
|
|
plt.grid(True, linestyle="--", alpha=0.6)
|
|
|
|
|
plt.legend()
|
|
|
|
|
plt.show()
|