forked from cstrahan/aduni
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem_Set_03.tex
More file actions
221 lines (179 loc) · 9.13 KB
/
Problem_Set_03.tex
File metadata and controls
221 lines (179 loc) · 9.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
\documentclass{article}
\setlength{\textwidth}{6.0in}
\setlength{\textheight}{9.0in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\parskip}{1.5ex plus 0.5ex minus 0.5ex}
\setlength{\topmargin}{0.5in}
\setlength{\topskip}{0.0in}
\setlength{\evensidemargin}{0.5in}
\setlength{\oddsidemargin}{0.5in}
\newcounter{exercise}
\newcounter{problem}
\newcounter{step}[problem]
\newcounter{subproblem}[problem]
\newcommand {\exercise}[1]{\bigskip\noindent{\large\bf Exercise \stepcounter{exercise} \arabic{exercise}: {#1}}}
\newcommand {\problem}[1]{\bigskip\noindent{\large\bf Problem \stepcounter{problem} \arabic{problem}: {#1}}}
\newcommand {\step}{\par\noindent{\bf Step \stepcounter{step} \arabic{step}: }}
\newcommand {\heading}[1]{\bigskip\par\noindent{\bf #1 }\par}
\usepackage[dvips]{graphics,color}
\begin{document}
\begin{center}
\LARGE
Object-Oriented Programming in Java
\end{center}
\bigskip
{\noindent\Large\bf Problem Set 3 \hfill Due: Jan 17, 2001}
\hrule
\bigskip
\noindent{\Large\bf Group Project: Gnutella}
\bigskip
Gnutella is a peer-to-peer networked file sharing program.
Its functionality is
similar to that of Napster from the user's point of view, except that it
is not specific to audio files, and the index and search capabilities
are not centralized as in Napster, but distributed among all the Gnutella
nodes.
Each Gnutella program is both a client that can initiate searches and download
files, and a server that can upload local files and perform searches
on behalf of clients. The term {\it servent} is often used to
describe this sort of client-server combination (Note
that this is different from {\tt servant} in both spelling and connotation).
Each Gnutella servent running on an individual machine is connected via
the network to some small set of other servents (also called nodes to
emphasize their being part of a network graph). This interconnected
set of servents is the Gnutella network. The nodes of the network work
together to operate as one large search engine.
The properties that make Gnutella an suitable project for this class are:
\begin{itemize}
\setlength{\parskip}{0pt}
\item Functional requirements that demand network, stream IO, GUI,
and multi-threaded programming techniques,
\item Sufficient complexity for a challenging short-term group project,
without being overwhelming,
\item An operational network architecture,
\item A published and well-defined protocol specification to implement,
\item A collection of reference clients to test against,
\item A number of Web sites devoted to it provided documentation and
reference implementations, and
\item An active network to connect to once the project is complete.
\end{itemize}
\heading{Gnutella Servent Operation}
When the Gnutella servent is started, it is configured with a directory
on the users machine containing files to share, a directory
to store downloaded files, and the IP address
of a Gnutella node to initially connect to.
Once the servent program is connected, the
user can initiate keyword-based searches. The servent forwards
search requests onto the network and displays results as they filter back.
Unlike a centralized search engine like Google, a Gnutella node checks an
incoming query against the files it is sharing and then forwards the
query to the other nodes it is directly connected to.
Also unlike Google, search is based only on file name, not content.
When a search is successful, the user
can request to download any of the files matching the search. This causes
the Gnutella servent to directly connect to the node sharing that
file and request a download. If the request is successful, it downloads the
file, displaying the progress of the download as it proceeds.
While it is operating, the Gnutella servent is also functioning as a server:
matching query requests against the files it is sharing, uploading requested
files to remote nodes, and forwarding search requests through the network.
\heading{The Gnutella Network}
The nodes in the Gnutella network communicate via the Gnutella protocol,
which defines the behavior of a Gnutella servent.
Because the Gnutella servents are connected via this protocol, the individual
servent programs do not have to be the same. Any program that implements
the Gnutella protocol can be a legitimate node in the Gnutella network.
In fact there are several servents that are available on the Internet,
including several for Windows and two written in Java.
The Gnutella network is actively used on the Internet and there are several
thousand nodes active at any given time. The distributed nature of the
Gnutella network and its search algorithms make it an interesting
study in network architecture. It has shown some interesting effects
as the network has scaled in size. The architectural issues,
however interesting, are beyond the scope of this class
(there are several papers on the Web discussing these issues
if you are interested).
\heading{Resources}
A copy of the Gnutella protocol specification is available on our
Web site. (Note: This PDF is apparently only viewable from acroread.)
The master site for information on Gnutella is
{\tt http://gnutella.wego.com/}. This site lists pointers to other sites
with additional information and/or clients. A Web search on "Gnutella"
will turn up more information. Use the Web and the attached protocol
document as your main sources of information for this project.
The staff will set up a number of Gnutella servents downloaded from the
Web on the TA machines. These servents can be used to test against as well
as for UI inspiration.
\heading{Servent Functionality}
The functionality we expect you to support includes:
\begin{itemize}
\setlength{\parskip}{0pt}
\item Full implementation of the network protocol as both a client and server,
sufficient to be a functioning node in the Gnutella network.
\item Maintenance of user configuration information, such as node to connect
to on startup, directory to share for upload and share, directory in which
to download files. This configuration should be kept in a file and be
persistent between program executions.
\item The ability to connect to a set of nodes on startup.
\item A GUI that allows the user to change the configuration info, connect to
a node, initiate
a search, display the results of a search (a list of files with associated
node data), download a file from a search result, and monitor who is uploading
what from this node.
\item A certain amount of security on the file sharing. In particular, that
the servent does not permit access to files outside of the upload directory.
(Be careful of paths such as {\tt ../../yourfile} which will allow
outside access if you are not careful).
\end{itemize}
\heading{Plan}
This is a major implementation effort involving several people. It is
an exercise is group organization and project management (without an actual
manager!) as well as a programming challenge. We highly recommend following
these steps.
\step
Take a deep breath, stop, and think.
\step
Read the protocol spec thoroughly. Read any documentation available on the
Internet, and check out the reference clients.
\step
In your groups, develop your design from the top down. Decide first on
what the major modules or sub-systems are and how they communicate. Define
the interfaces between them and what data is shared. Document these decisions.
\step
Decide how the project is to be divided among the group members. It could be
one sub-system per person, or multiple people working together on a single
piece (the proponents of Extreme Programming believe in pair programming; two
people working together on the same code, one typing and one watching,
to check each other's errors and design decisions).
\step
Decide on how the group is going to coordinate and share files, data,
and testing.
\step
Come up with a plan for testing each sub-system independently and a plan for
testing the entire program.
\step
Each sub-group should then design their sub-system, again top down.
Following the steps from PS2, define the major classes and interfaces,
and the methods by which they interact. The design the data representations
and any utility classes and methods. Document these decisions. You should have
substantial Javadoc written and working before actually implementing
any methods.
\step
Finally, start implementing bottom-up, testing each new set of methods
and each new functionality as it get developed.
Consider an implementation strategy that would allow partial sub-system
testing and early testing of the integration of these into the
overall program in order to validate your design.
\step
Complete sub-system testing and combine into the complete program.
\step
Test the program. Connect with other nodes in ADU and search for interesting
files to download. Host some files on your machine (keep it legal, please)
for others to upload.
\step
Once you have verified your program against the reference client (and those
of other groups), try to connect to the Gnutella network outside of ADU.
\bigskip
Good Luck
\end{document}