BL40A2010 Introduction to IoT-Based Systems¶

Assignment 3, 19.09.2022¶

Author: Trieu Huynh Ba Nguyen¶

(1) Compute the following for a ring topology of $N\geq3$ nodes considering that the network in unweighted and the links are directed. The result will give these number as a function of $N$.

Answer:

(a) Degree of nodes: $2$

(b) Adjacent matrix: $$ A = \begin{pmatrix} 0 & 1 & 0 & 0 & ... & 0 & 0 & 1 \\ 1 & 0 & 1 & 0 & ... & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & ... & 0 & 0 & 0 \\ ... & ... & ... & ... & ... & ... & ... & ... \\ 0 & 0 & 0 & 0 & ... & 1 & 0 & 1 \\ 1 & 0 & 0 & 0 & ... & 0 & 1 & 0 \end{pmatrix} $$ (c) Diameter: $N/2$

(d) Clustering coefficient of the nodes: $C = 0$

(2) Use NetworkX to draw and analyze a ring topology with 5 nodes. Verify if the results previously obtained are valid.

In [1]:
import networkx as nx #https://networkx.github.io/
import matplotlib.pyplot as plt #https://matplotlib.org/
import scipy as sp
import numpy as np

G = nx.Graph()
G.add_nodes_from([1, 2, 3, 4, 5])
G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)])
nx.draw_networkx(G, node_color='black', font_color='white', edge_color='black', font_weight='bold',  node_size=700)
plt.axis('off')
plt.show()

(3) Analyze the ring topology with size 20 ($N=20$) as a communication network (i.e. how data travel to a point to another in the network) based on the node degree, the network diamenter and the cluster coefficient.

Answer: A ring topology with size 20 ($N = 20$) is a communication network in which every node has $2$ neighbors (node degree is $2$) and forms a ring. The diameter of this topology is $N / 20 = 10$. The clustering coefficient is $0$. Data travelling to non-adjacent nodes requires multiple-hops. This topology allows fast data transfer, reduces data collisions, and is able to handle a high amount of traffic.

(4) Consider the ring network from the previous question. The network performance depends on its diameter. As a designer, you can add one new node in the network (and an unlimited number of links that this node is part) . Justify your decision and evaluate how much better the network is. Generalize this finding as a function of $N$.

Hint: Follow Exercise 1 approach to generalize the finding.

Answer: In a ring topology, each node links to 2 other nodes and forms a ring. This means that wherever we put the new node, it still needs to connect to 2 adjacent nodes. The diameter of the network will always stay the same: $N/2$. The number of nodes just changes to $N = 21$.