![]() |
Dublin Institute of Technology,
School of Computing |
|
| Home -> Teaching -> DT249-4 Distributed Systems -> Notes -> Weeks 02 and 03 | ||
|
DT249-4 Distributed Systems
Weeks 02 and 03 Upon completion of this class, you should be able to:
Writing to Character Files DS_02_01_Writer.java prompts the user for input, and then writes the inputted data to a file. DS_02_01_Reader.java reads the contents of the file, and displays them. 2. Internet Addresses Download DS_02_02a.java. Compile and run as follows: :/> javac DS_02_02a.java :/> java -classpath . DS_02_02a This program performs a DNS lookup to establish the Internet address of the localhost. Download, compile and run DS_02_02b.java. This program prompts the user for a hostname, for which it will then perform a DNS lookup. 3. UDP Download and compile DS_02_03_UDPClient.java and DS_02_03_UDPServer.java. Run the server in one DOS window, and the client in a separate one, as follows: :/> java -classpath . DS_02_03_UDPServer :/> java -classpath . DS_02_03_UDPClient "This is the message to send" localhost The client constructs a UDP datagram containing the data supplied as a command line argument which it sends to the server. The server then responds by echoing the data back to the client. 4. TCP Download and compile DS_02_04_TCPClient.java and DS_02_04_TCPServer.java. Run the server in one DOS window, and the client in a separate one, as follows: :/> java -classpath . DS_02_02_TCPServer :/> java -classpath . DS_02_02_TCPClient "This is the message to send" localhost The client opens a TCP stream to the server. It then writes the data supplied as a command line argument to the server. The server implements multiple threads, so that each connection is managed separately by an individual thread. This allows for multiple concurrent connections. 5.IP Multicast Download and compile DS_02_05_MulticastPeer.java. Run the program in three separate windows using the command shown below: :/> java -classpath . DS_02_05_MulticastPeer "This is a message" 228.5.6.7 Each of the three processes join a group identified by the class D IP address supplied as a command line argument. The messages provided as command line arguments are multicast to all members of the group. Note that if you cannot get the above to work, because you cannot get an IP address, you should install IPv6 by executing: :/> ipv6 install Then you can use an IPv6 Multicast address such as FF02::2, as shown below: :/> java -classpath . DS_02_05_MulticastPeer "This is a message" FF02::2 6. Try to implement a simple chat application in Java, using your choice of protocol. Chapters 2, 3 and 4 of Coulouris, Dollimore and Kindberg book Jerome H. Saltzer, David P. Reed, and David D. Clark, End-to-End Arguments in System Design, ACM Transactions in Computer Systems 2, 4, November 1984 Roy Thomas Fielding, Architectural Styles and the Design of Network-based Software Architectures, PhD Thesis, University of California, Irvine. Chapter 3 is the most relevant for this week's class, but if you had the time the remainder of the thesis is a compelling story of the technical evolution of the World-Wide-Web protocols. Java Tutorial sections onJava API Documentation on |
||
|
|
[Home][School
of Computing][Dublin Institute of
Technology] |
|