Provide a methodology, design, Java Implementation and results for this assignme
ID: 3670142 • Letter: P
Question
Provide a methodology, design, Java Implementation and results for this assignment.
Project: TCP/IP Simulation and wireshark tracing.
A) This project is an implementation of a TCP/IP communication, in order to properly test this simulation you need to create an client/server connection on local host, Code will be posted if you need additional help in this area. Some basic rules of client server are as follows:
1) The server can go down, the client will wait, when reconnected, all messages in progress will continue, as if they were not interrupted,
2) A client can be shut down, once restored, will continue with the interaction to the server.
3) There will be no data lost during the execution of the simulation, in either TCP or UDP.
The message that is sent by the server to each client, you may create your own message, but make sure it spans more than one packet
Both the Server and the Client will maintain a log of transactions.
Here are some responsibilities of TCP 1) Operation without no loss 2) Lost ACK 3) Lost Packet 4) Premature timeout 5) Stop and wait 6) Pipelined operations 7) Go-Back-N 8) Selective Repeat
B) WireShark - Traces
After you completed your project, Trace and record, using Wire Shark, a transmission of your application showing and decoding TCP, IP , Link Layer
Deliverables
The finished project will include the following
1) A single file containing a methodology section and a detailed design for this problem.
2) The Java Source code.
3)The executables.
4)Any other source files necessary to build your system.
5)A detailed README file describing the use of the system for part 1.
6)The Wireshark traces, with a description of the fields
Explanation / Answer
import java.lang.*;
import java.io.*;
import java.net.*;
class Server {
public static void main(String args[]) {
String data = "Toobie ornaught toobie";
try {
ServerSocket srvr = new ServerSocket(1234);
Socket skt = srvr.accept();
System.out.print("Server has connected! ");
PrintWriter out = new PrintWriter(skt.getOutputStream(), true);
System.out.print("Sending string: '" + data + "' ");
out.print(data);
out.close();
skt.close();
srvr.close();
}
catch(Exception e) {
System.out.print("Whoops! It didn't work! ");
}
}
}
(Client.java):
import java.lang.*;
import java.io.*;
import java.net.*;
class Client {
public static void main(String args[]) {
try {
Socket skt = new Socket("localhost", 1234);
BufferedReader in = new BufferedReader(new
InputStreamReader(skt.getInputStream()));
System.out.print("Received string: '");
while (!in.ready()) {}
System.out.println(in.readLine()); // Read one line and output it
System.out.print("' ");
in.close();
}
catch(Exception e) {
System.out.print("Whoops! It didn't work! ");
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.