Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this lab, students are required to make Java programs using sockets to suppor

ID: 3863965 • Letter: I

Question

In this lab, students are required to make Java programs using sockets to support the communications between multiple computers on the network. The following gives the details: The intended local area network consists of at least three (3) computers, which can be simulated by three or more Java programs on the same computer or different computers. The local area network is controlled by using the HDLC (refer to textbook). The Normal Response Mode (NRM) is used. The 8-bit control field format is used. In the network, there is one and only one computer that is the primary station (e g., A in the figure above), and all others are secondary stations (e.g., B, C and others in the figure above). The identification (address) and the role (primary or secondary) for the computers are known when a computer starts up. The communications can be made between these secondary computers. When B sends a message to C, C should print the message on its screen. On the screen of A, a communication log can be displayed. Sliding window is used. The maximum length of the information field is 64 bytes. Necessary assumptions can be made. The TA will give a tutorial (TUT6) on this lab. A lab report is required for each group to detail the design of the medium access control, all assumptions made, algorithms (flowcharts) for the primary and secondary stations and all other

Explanation / Answer

The sensor nodes are deployed randomly in the environment to be monitored.
The sensor nodes distributed in ad hoc structure.
In WSN there is no base station and not all nodes hear each other.
The WSN is a multi-hop network.

Basic part of my code is to randomly place the sensor nodes in the given space then connecting each two nodes if the distance between them less than or equal to the communication radius. Please check Matlab code below.

clear;
noOfNodes = 50;
rand('state', 0);
figure(1);
clf;
hold on;
L = 1000;
R = 200; % maximum range;
netXloc = rand(1,noOfNodes)*L;
netYloc = rand(1,noOfNodes)*L;
for i = 1:noOfNodes
plot(netXloc(i), netYloc(i), '.');
text(netXloc(i), netYloc(i), num2str(i));
for j = 1:noOfNodes
distance = sqrt((netXloc(i) - netXloc(j))^2 + (netYloc(i) - netYloc(j))^2);
if distance <= R
matrix(i, j) = 1; % there is a link;
line([netXloc(i) netXloc(j)], [netYloc(i) netYloc(j)], 'LineStyle', ':');
else
matrix(i, j) = inf;
end;
end;
end;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote