Directions for project JTRN3 TCP Timeout revised 25 Nov 2011 with simplifying edits 1 May 2012 Project JTRN3 combines JNW with the transport protocol from the older C++ Network Workbench. The project is very close to the one described in chapter 10 of Understanding Internet Protocols. The requirement is to complete case 3 (segment timeout handling) under method send_rtl_segments(). You will need to run JNWS as loaded for JDLC3, with your code solutions to JDLC3 and JWAN2: ModelDataLink/HDLC.java ModelEvents/RoutePacketAtNodeOrProcessAtDestination.java ModelNetwork.Routing.java Then study the whole module TCPConnection.java to understand how the NW TCP-like reliable transport protocol works in the context of JNW. Some of the variables and methods used are described in TCPState.java and TCPUtilities.java. Note that the NW protocol does not perform congestion control by varying its send window as TCP does, nor does it support multiple data flows simultaneously. You also will need to use the file BookRouterNetworkHDLC.txt for this assignment. After you get the "email" to transfer, switch to file BookRouterNetworkHDLC-errors.txt for final submission. To test your code: 1. Run JNWS by selecting StartJNW under Run in the NetBeans Properties tab. 2. Use the T button to load a topology - use BookRouterNetworkHDLC.txt 3. Use the folder button to load an email file - use file EMAIL_TCP_1.txt. (There is a file EMAIL_TCP_1short.txt with a shorter email that may be easier to work with) 4. To see the email input, click on the second function button from the left edge and select "Print Email Inputs". 5. Click on the locomotive icon button to run the simulation. 6. When your program works, the selected email will print out as "E-Mail TCP Message RECEIVED" at end of run. 7. For a final test, use network BookRouterNetworkHDLC-errors.txt and email file EMAIL_TCP_2.txt. 8. Submit TCPConnection.java and a file containing the text output from (7) for grading, via Moodle. Here are some methods that could prove useful: JNWBitSet.convertJNWBitSetToString(); produces ASCII equivalent string JNWBitSet.toString(); produces a string of ones a zeros with separator blanks Try printing the output of this method at the beginning of the receiving case of rtrans_receive. (HINT: the ACK/SYN/FIN bits are in the second octet of the third word of the TCP header). GetTCPACKBitFromTCPSegment(JNWBitSet segment); GetTCPSYNBitFromTCPSegment(JNWBitSet segment); GetTCPFINBitFromTCPSegment(JNWBitSet segment); GetSequenceNumberFromTCPSegment(JNWBitSet segment); getTCPSegmentPayloadLength(JNWBitSet segment);// length in bits ModelDES.DiscreteEventSimulator.getSimulationTime(); // the simulation "clock" (note that JNW has a variable ModelData.GlobalVariables.simulationTime which plays a different role and should not be used as the current value of simulation time) sendNewFrame(int interfaceNumber, JNWBitSet packetBuffer); (hint: use hostNode.MessageBuffer[segmtno] for the packetBuffer) various data in ModelData.GlobalVariables NOTE: do not use .length to determine the number of bits in an instance of JNWBitSet. Instead use getJNWLength(). QUESTIONS TO BE ANSWERED AS PART OF JTRN3 SUBMISSION Include your answers at the end of output.txt. - What would you expect to happen if the JNWS TCP receiver were to reply with an ACK where the value of acknowledgementNumber is always zero? - Suppose we were going to add a congestion window to JNWS TCP. What variable in the current code could be used to impose a congestion window in TCPConnection.java? - If we had slow-start congestion avoidance in JNWS TCP, what should be the window size at startup? - When the checksum contents of the TCP packet is being calculated, what value is used for the checksum itself?