[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip Echo_tcp.java,1.2,1.3 Tcp.java,1.10,1.11
Status: Beta
Brought to you by:
darkkey
From: gift <gi...@us...> - 2005-11-26 21:42:09
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31979/core/protocolsuite/tcp_ip Modified Files: Echo_tcp.java Tcp.java Log Message: TCP v0.3!!! We are working. Have to clarify TCP application structure! Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Tcp.java 26 Nov 2005 20:32:25 -0000 1.10 --- Tcp.java 26 Nov 2005 21:42:00 -0000 1.11 *************** *** 637,641 **** Elm=null; ! //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); --- 637,641 ---- Elm=null; ! /* URG, ACK, PSH, RST, SYN, FIN */ //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); *************** *** 643,647 **** TCP_Info.setDataType("TCP Protocol"); TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("Created TCP packet for " + inDestIPAddress + ":" + indestPort +"."); Simulation.addLayerInfo(TCP_Info); --- 643,652 ---- TCP_Info.setDataType("TCP Protocol"); TCP_Info.setLayer("Transport"); ! String s=new String(); ! ! if (flags[4]) s="Created TCP SYN-packet for " + inDestIPAddress + ":" + indestPort +"."; ! if (flags[5]) s="Created TCP FIN-packet for " + inDestIPAddress + ":" + indestPort +"."; ! if (! (flags[4] || flags[5]) ) s="Created TCP packet for " + inDestIPAddress + ":" + indestPort +"."; ! TCP_Info.setDescription(s); Simulation.addLayerInfo(TCP_Info); *************** *** 875,880 **** TCP_Info.setLayer("Transport"); ! String s; ! if (our_ack!=2 || Elm.sent_segments !=2) s="TCP packet with data ACK received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + "."; else s="TCP packet with establishing connection ACK received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + "."; //deleting from SegmentsToResend the segmet with the acknowledgment number we have received NOTE: dec by 1 is used see RFC --- 880,886 ---- TCP_Info.setLayer("Transport"); ! String s; ! int rs = Elm.received_segments; ! if (rs>2) s="TCP packet with data ACK received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + "."; else s="TCP packet with establishing connection ACK received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + ". Connection confirmed!"; //deleting from SegmentsToResend the segmet with the acknowledgment number we have received NOTE: dec by 1 is used see RFC *************** *** 892,898 **** Application listener; listener = (Application)Elm.application; ! if (our_ack>2) listener.RecvData(inPacket.getTCP_message()); ! // boolean bo=Elm.SegmentsToResend.isEmpty(); if (!bo) ! if (our_ack!=2 || Elm.sent_segments!=2) mParentStack.sendTCPSegment(listener,msg,flags); //our_ack==2 when connection is established //we have sent last ACK and we can close TCP port now --- 898,905 ---- Application listener; listener = (Application)Elm.application; ! ! if (rs>2) listener.RecvData(inPacket.getTCP_message()); ! ! if (our_ack!=2 || Elm.sent_segments!=2) mParentStack.sendTCPSegment(listener,msg,flags); //our_ack==2 when connection is established //we have sent last ACK and we can close TCP port now Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Echo_tcp.java 26 Nov 2005 18:20:57 -0000 1.2 --- Echo_tcp.java 26 Nov 2005 21:42:00 -0000 1.3 *************** *** 137,141 **** protInfo.setDescription("Recieving echo message '" + Data + "' from server."); Simulation.addLayerInfo(protInfo);*/ ! Disconnect(); }else{ //server processing recieve --- 137,141 ---- protInfo.setDescription("Recieving echo message '" + Data + "' from server."); Simulation.addLayerInfo(protInfo);*/ ! Disconnect(); //if FIN message in TCP then no call to Disconnect(); }else{ //server processing recieve |