COMP3331/9331 Computer Networks
2. Goal and learning objectives
For this assignment, you will be asked to implement a part of the peer-to-peer (P2P) protocol Circular DHT which is described in Section 2.6 of the text Computer Networking (6th ed) and would be discussed in the lecture. A primary requirement for a P2P application is that the peers form a connected network at all time. A complication that a P2P network must be able to deal with is that peers can join and leave the network at any time. For example, if a peer leaves the network suddenly (because it has crashed), then the remaining peers must try to keep a connected network without this peer. It is therefore necessary to design P2P networks so that they can deal with these complications. One such method has been described in Section 2.6 of the text, under the heading of Peer Churn for circular DHT. You will also learn how to implement reliable data transmission over UDP.
2.1. Learning Objectives
On completing this assignment, you will gain sufﬁcient expertise in the following
1. Understanding of routing mechanism and connectivity maintenance in peer- to-peer systems, and Circular DHT in particular.
2. Socket programming for both UDP and TCP transport protocols.
3. Protocol and message design for applications.
4. Basic understanding of creating a reliable connection.
The following is extracted from the Peer Churn section of the text:
“In P2P systems, a peer can come or go without warning. Thus, when designing a
DHT, we also must be concerned about maintaining the DHT overlay in the presence of such peer churn. To get a big-picture understanding of how this could be
accomplished, let’s once again consider the DHT in Figure 2.27(a) [Reproduced here
as Figure 1]. To handle peer churn, we will now require each peer to track (that is, know the IP address of) its ﬁrst and second successor; for example, peer 4 now tracks both peer 5 and peer 8. We also require each peer to periodically verify that its two
successors are alive (for example, by periodically sending ping messages to them and asking for responses). Let’s now consider how DHT is maintained when a peer abruptly leaves. For example, suppose peer 5 in Figure 2.27(a)[Figure 1 in this assignment spec] abruptly leaves. In this case, the two peers preceding the departed peer (4 and 3) learn that 5 has departed, since it no longer responds to ping messages.
Peers 4 and 3 thus need to update their successor state information. Let’s consider
how peer 4 updates its state:
1. Peer 4 replaces its ﬁrst successor (peer 5) with its second successor (peer 8).
2. Peer 4 then asks its new ﬁrst successor (peer 8) for the identiﬁer and IP
addresses of its immediate successor (peer 10). Peer 4 then makes peer 10 its second successor.
Having brieﬂy addressed what has to be done when a peer leaves, let’s now consider what happens when a peer wants to join the DHT. Let’s say a peer with identiﬁer 13 wants to join the DHT, and at the time of joining, it only knows about peer 1’s existence in the DHT. Peer 13 would ﬁrst send peer 1 a message, saying ”what will be peer 13’s predecessor and successor?” This message gets forwarded through the DHT until it reaches peer 12, who realises it will be peer 13’s predecessor and its current successor, peer 15, will become its successor. Next, peer 12 sends this predecessor and successor information to peer 13. Peer 13 can now join the DHT by making peer
15 its successor and by notifying peer 12 that it should be its immediate successor to peer 13.
4. Assignment description
For this assignment, you are asked to write a Java, C, or Python program which can handle query/response and peer churn (leaving only) for circular DHT as described in Section 3. However, there are a few important points that you need to note:
1. You will be running each peer in an xterm on one machine. Therefore, tracking a peer no longer means knowing the IP address but in your case, it means knowing the port numbers (we will further elaborate on this point later).
2. You will not be able to use built in ping in OS to determine whether the two successors of a peer are still alive. You will need to implement your own ping mechanism.
Please make sure that your P2P program is working in the CSE laboratory as we will test (and mark) your assignment using CSE machines.
If your program does not work on CSE machine, you will get ‘0’ mark for
assignment as we cannot accept running the code on your own machine.
In the following description, we will continue to use the example in Figure 1, but a very important point that you need to note is that: you should not make any assumption regarding the number of peers and their identities in your program. The number of peers and their identities to be used for the evaluation can change from student to student. You should therefore make sure that you test that your program can deal with the general situation. You can assume that there would be no more than 10 peers and the peer identities is within the range of 0-255.
There are a number of mandatory requirements:
1. You must name your program cdht.c, cdht.java, or cdht.py.
2. This program uses 5 input arguments. The first three input arguments are all integers in the range of [0,255]. The fourth input is an integer value. And the final input is a value in the range of [0,1]. They are used to initialise the network as discussed in section 4.1 (initialization step).
3. For python programs, please indicate the version of python you used clearly in the first lines of your report.
4. For c programs, please include makefile with your submission and explain the process for making the file in your report. You must also show this on your demo.
Holding a PhD degree in Finance, Dr. John Adams is experienced in assisting students who are in dire need...
55 - Completed Orders
Canada, Toronto I have acquired my degree from Campion College at the University of Regina Occuption/Desi...
52 - Completed Orders
Even since I was a student in Italy I had a passion for languages, in fact I love teaching Italian, and I...
102 - Completed Orders
To work with an organization where I can optimally utilize my knowledge and skills for meeting challenges...
109 - Completed Orders
JOB OBJECTIVE Seeking entry level assignments in Marketing & Business Development with an organization...
202 - Completed Orders
Current work profile Project manager- The Researchers Hub (2nd Jan 2016 to presently working) Researc...
20 - Completed Orders
Sales Assistant, Mito Marina Assigned to the Stationery dept – assisted in merchandising, stock taking...
100 - Completed Orders
Personal Profile Dedicated and highly experienced private chauffeur. High energy, hardworking, punctua...
200 - Completed Orders
I'm Lizzy, full time education specialist in English, Essay Writing, Economics and Maths. Having Assi...
109 - Completed Orders