[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip Tcp.java,1.38,1.39
Status: Beta
Brought to you by:
darkkey
From: gift <gi...@us...> - 2006-02-24 11:29:15
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10305/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: ... Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Tcp.java 24 Feb 2006 10:55:31 -0000 1.38 --- Tcp.java 24 Feb 2006 11:29:06 -0000 1.39 *************** *** 1243,1258 **** } else TCPsetTimer(Elm); Elm.received_duplicates++; ! Elm.sent_ACK++; ! //Elm.sent_segments++; ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! //System.out.println("%%% - in here"); ! TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); ! Simulation.addLayerInfo(TCP_Info); ! //now we have to resend our ACK again ! mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); } catch(NullPointerException e){ --- 1243,1261 ---- } else TCPsetTimer(Elm); Elm.received_duplicates++; ! if (!inPacket.get_ACK_flag()) ! { ! Elm.sent_ACK++; ! //Elm.sent_segments++; ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! //System.out.println("%%% - in here"); ! TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); ! Simulation.addLayerInfo(TCP_Info); ! //now we have to resend our ACK again ! mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); ! } } catch(NullPointerException e){ *************** *** 1397,1414 **** } else TCPsetTimer(Elm); Elm.received_duplicates++; ! Elm.sent_ACK++; ! //Elm.sent_segments++; ! //System.out.println("t+++++++++t"); ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! //System.out.println("%%% - in here - !!!"); ! TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); ! Simulation.addLayerInfo(TCP_Info); ! //now we have to resend our ACK again ! mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); ! } catch(NullPointerException e){ System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 1368 " + e.toString()); --- 1400,1419 ---- } else TCPsetTimer(Elm); Elm.received_duplicates++; ! if (!inPacket.get_ACK_flag()) ! { ! Elm.sent_ACK++; ! //Elm.sent_segments++; ! //System.out.println("t+++++++++t"); ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! //System.out.println("%%% - in here - !!!"); ! TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); ! Simulation.addLayerInfo(TCP_Info); ! //now we have to resend our ACK again ! mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); ! } } catch(NullPointerException e){ System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 1368 " + e.toString()); *************** *** 1523,1527 **** } else { //we have already received this segment ! try{ if (Elm.isServer) { --- 1528,1532 ---- } else { //we have already received this segment ! if (Elm.isServer) { *************** *** 1529,1558 **** TCPsetServerTimer(Elm,inPacket.get_destPort()); } else TCPsetTimer(Elm); ! Elm.received_duplicates++; ! Elm.sent_ACK++; ! }catch(NullPointerException e){ ! System.out.println("TCP.java: case 2 - 11 " + e.toString()); ! } ! ! //Elm.sent_segments++; ! //System.out.println("t------t"); ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! TCP_Info.setLayer("Transport"); ! //System.out.println("%%% - in here ^^^"); ! TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); ! Simulation.addLayerInfo(TCP_Info); ! //now we have to resend our ACK again ! Integer ik = (Integer)inPacket.get_sequence_number(); ! ! TCP_packet Tpl = (TCP_packet) Elm.SentACKs.get(ik); ! ! System.out.println(mParentStack.getHostName() + ":" + "I=" + ik); ! if (Tpl==null) {System.out.println(mParentStack.getHostName() + ":" + "Error: PACKET = null when I=" + ik); } ! ! mParentStack.sendPacket(Tpl); /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PARASITE PLACE*/ } } --- 1534,1562 ---- TCPsetServerTimer(Elm,inPacket.get_destPort()); } else TCPsetTimer(Elm); ! Elm.received_duplicates++; ! if (!inPacket.get_ACK_flag()) ! { ! Elm.sent_ACK++; ! //Elm.sent_segments++; ! //System.out.println("t------t"); ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! TCP_Info.setLayer("Transport"); ! //System.out.println("%%% - in here ^^^"); ! TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); ! Simulation.addLayerInfo(TCP_Info); ! //now we have to resend our ACK again ! Integer ik = (Integer)inPacket.get_sequence_number(); ! ! TCP_packet Tpl = (TCP_packet) Elm.SentACKs.get(ik); ! ! System.out.println(mParentStack.getHostName() + ":" + "I=" + ik); ! if (Tpl==null) {System.out.println(mParentStack.getHostName() + ":" + "Error: PACKET = null when I=" + ik); } ! ! mParentStack.sendPacket(Tpl); /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PARASITE PLACE*/ ! } } } |