So guys, now let us discuss how we will going to deploy our project.
That is how we will going to execute our project.
So we will going to simulate six node topology by running same process multiple times in different terminals
of the same machine that you have, right?
So you can see that we have our ring topology in which we have six machines.
Now, since this is a socket based programming project, it means that different physical machines needs
to communicate with each other, right?
And these physical machines are connected by the wire.
But we do not have this luxury of having six different physical machines.
So what we will going to do that whatever project that we will going to write, we will going to execute
that project multiple times in different terminals of the same laptop or same machine that you are using.
So this will be equivalent as if you have deployed your project on six different physical machines which
forms a ring topology.
So each process will going to listen to only one IP address and that IP address is 127 .0.0.1.
Now this is the IP address of your local machine, right?
Any packet which is assigned to this IP address will going to be received by our own machine itself.
But each process will going to bind to a different UDP and TCP port numbers as per this table, right?
So you can see that you have a node zero that is, you have a node zero here and this node zero will
going to use an IP address.
127 .0.0.1 and its own TCP port number will be 2000 and UDP port number will be 2001.
Right.
And the same goes with the rest of the machines.
So you can see that TCP and UDP port numbers should be unique.
And since we are going to deploy our project on your same physical machine but in different terminals,
it means that the IP address of all the nodes will going to be same, which is 127 .0.0.1.
Right.
So for example, suppose Node N wants to send UDP data to the Node three.
Right.
So to send UDP data to some distant node node N one needs node three IP address and UDP port number.
Now node three IP address will be same.
That is 127.0.0.1 and UDP port number that machine and one will use in order to send data to node and
three will be 2007.
Right?
So you can see that any machine can send data to any other machine using UDP or TCP port number, but
using the same IP address which is 127 .0.0.1.
So going forward, you will going to write a project and you will execute that project in six different
terminals of the same machine.
Right.
So it means that every process which is running in a different terminal will use the same IP address,
which is 127.0.0.1.
And every process running in a terminal represent a node of the ring topology.
Every node knows its own TCP and UDP port number, right?
So every node is aware of its own TCP port number and UDP port number.
Now there is another constraint in this project.
Node I knows the node JS IP address and UDP port number where J is equal to I plus one.
It simply means that Node three knows node four's IP address and UDP port number.
Node four knows node five IP address and UDP port number and so on.
So it means that Node three can send UDP data only to node four and Node three cannot send data to any
other node in the ring topology because Node three knows only node four UDP port number.
So we have to follow this constraint in order to implement this project.
Every node in the ring, topology is allowed to send UDP data only to its successor node in the ring
topology.
For example, Node N1 can only send UDP data to node N2 because Node N1 knows UDP port number of node
n2 Node n1 do not know UDP port number of any other node in this ring topology except the node which
is its successor.
So our project represents one node of the ring topology.
We have to execute our project multiple times in six different terminals in order to simulate six nodes
of this ring topology.
So, for example, suppose you want to run your project with simulate Node N1, right?
So you will going to write some node dot C file which represents our project and you compile this file
to node dot out, right?
And if you run this file you can pass the runtime arguments.
The first argument is the IP address of this node.
And as I have already stated, IP address of each node has to be same.
The second argument is the self or own UDP port number, right?
So it is own UDP port number.
The second argument is the successors node UDP port number.
And the third argument is own TCP port number.
So you can see that you can run your project in order to simulate any node of the ring topology by providing
these four runtime arguments.
Now let us discuss what exactly problem we are looking to solve.
So we will discuss the problem statement in the next lecture video.