javanetsim-cvs Mailing List for javaNetSim (Page 24)
Status: Beta
Brought to you by:
darkkey
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(120) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
(69) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(76) |
Oct
(28) |
Nov
(77) |
Dec
(186) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(36) |
Oct
(61) |
Nov
(23) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(17) |
Oct
(105) |
Nov
(5) |
Dec
(1) |
2009 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(9) |
Nov
|
Dec
|
From: Alexander B. <da...@us...> - 2006-09-07 17:20:32
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3841/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.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Tcp.java 7 Sep 2006 16:55:47 -0000 1.79 --- Tcp.java 7 Sep 2006 17:20:29 -0000 1.80 *************** *** 1,9 **** /* ! Java Firewall Simulator (jFirewallSim) ! ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. --- 1,9 ---- /* ! Java Network Simulator (javaNetSim) ! ! Copyright (c) 2006, 2005, Ice Team; All rights reserved. ! Copyright (c) 2004, jFirewallSim development team; All rights reserved. *************** *** 161,169 **** } ! class Point{ public int i; Point(){ i = 0; } ! } /** --- 161,169 ---- } ! /*class Point{ public int i; Point(){ i = 0; } ! }*/ /** *************** *** 192,196 **** Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); ! System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ^^^^^^^^^^^^ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { --- 192,196 ---- Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); ! System.out.println("##################################### ^^^^^^^^^^^^ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { |
From: Alexander B. <da...@us...> - 2006-09-07 17:20:32
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3841/core Modified Files: FalseRandom.java Log Message: Index: FalseRandom.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/FalseRandom.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FalseRandom.java 7 Sep 2006 15:20:44 -0000 1.13 --- FalseRandom.java 7 Sep 2006 17:20:29 -0000 1.14 *************** *** 11,15 **** int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1}; --- 11,15 ---- int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; //int sequence[] = {1}; |
From: Alexander B. <da...@us...> - 2006-09-07 16:55:51
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26309/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.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Tcp.java 7 Sep 2006 16:34:16 -0000 1.78 --- Tcp.java 7 Sep 2006 16:55:47 -0000 1.79 *************** *** 176,185 **** public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.busy) return; ! System.out.println("TCPSETTIMER: " + Elm.timer); try{ Elm.busy = true; if(Elm.timer==null) { ! Point p = new Point(); p = null; --- 176,185 ---- public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.busy) return; ! //System.out.println("TCPSETTIMER: " + Elm.timer); try{ Elm.busy = true; if(Elm.timer==null) { ! /*Point p = new Point(); p = null; *************** *** 188,196 **** }catch(Exception e){ Error.Report(e); ! } Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); ! System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { --- 188,196 ---- }catch(Exception e){ Error.Report(e); ! }*/ Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); ! System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ^^^^^^^^^^^^ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { *************** *** 204,208 **** System.out.println(Elm.timer); } ! Elm.busy = false; }catch(Exception e){ Elm.busy = false; --- 204,208 ---- System.out.println(Elm.timer); } ! Elm.busy = false; }catch(Exception e){ Elm.busy = false; |
From: Alexander B. <da...@us...> - 2006-09-07 16:34:19
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17390/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.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Tcp.java 7 Sep 2006 16:13:15 -0000 1.77 --- Tcp.java 7 Sep 2006 16:34:16 -0000 1.78 *************** *** 175,179 **** --- 175,182 ---- */ public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { + if(Elm.busy) return; + System.out.println("TCPSETTIMER: " + Elm.timer); try{ + Elm.busy = true; if(Elm.timer==null) { *************** *** 191,206 **** System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); System.out.println(Elm.timer); - Elm.busy = true; Elm.timer.cancel(); Elm.timer=null; Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, ++timerid), TCP_SENDER_TIME, TCP_SENDER_TIME); - Elm.busy = false; System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); System.out.println(Elm.timer); } }catch(Exception e){ Error.Report(e); } --- 194,210 ---- System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { + System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); System.out.println(Elm.timer); Elm.timer.cancel(); Elm.timer=null; Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, ++timerid), TCP_SENDER_TIME, TCP_SENDER_TIME); System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); System.out.println(Elm.timer); } + Elm.busy = false; }catch(Exception e){ + Elm.busy = false; Error.Report(e); } *************** *** 763,769 **** public TCP_packet getTCPPacket_tosend(String inDestIPAddress,String inSourceIPAddress, int indestPort, int insrcPort, String inMessage, boolean flags[], int acknow_num) throws TransportLayerException, LowLinkException { //check if window is available TCP_HashTableElement Elm; Elm = (TCP_HashTableElement) PortTable.get(insrcPort); - while(Elm.busy){} System.out.println(inSourceIPAddress + ": ************************ " + Elm + " ************************** " + Elm.timer); Integer gg = new Integer(0); --- 767,773 ---- public TCP_packet getTCPPacket_tosend(String inDestIPAddress,String inSourceIPAddress, int indestPort, int insrcPort, String inMessage, boolean flags[], int acknow_num) throws TransportLayerException, LowLinkException { //check if window is available + TCP_HashTableElement Elm; Elm = (TCP_HashTableElement) PortTable.get(insrcPort); System.out.println(inSourceIPAddress + ": ************************ " + Elm + " ************************** " + Elm.timer); Integer gg = new Integer(0); |
From: Alexander B. <da...@us...> - 2006-09-07 16:13:19
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9275/core/protocolsuite/tcp_ip Modified Files: TCP_HashTableElement.java Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Tcp.java 7 Sep 2006 15:38:16 -0000 1.76 --- Tcp.java 7 Sep 2006 16:13:15 -0000 1.77 *************** *** 191,200 **** System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { ! System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + ""); Elm.timer.cancel(); Elm.timer=null; Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, ++timerid), TCP_SENDER_TIME, TCP_SENDER_TIME); System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } }catch(Exception e){ --- 191,204 ---- System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { ! System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); ! System.out.println(Elm.timer); ! Elm.busy = true; Elm.timer.cancel(); Elm.timer=null; Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, ++timerid), TCP_SENDER_TIME, TCP_SENDER_TIME); + Elm.busy = false; System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); + System.out.println(Elm.timer); } }catch(Exception e){ *************** *** 761,764 **** --- 765,770 ---- TCP_HashTableElement Elm; Elm = (TCP_HashTableElement) PortTable.get(insrcPort); + while(Elm.busy){} + System.out.println(inSourceIPAddress + ": ************************ " + Elm + " ************************** " + Elm.timer); Integer gg = new Integer(0); Index: TCP_HashTableElement.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/TCP_HashTableElement.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TCP_HashTableElement.java 7 Sep 2006 14:54:34 -0000 1.3 --- TCP_HashTableElement.java 7 Sep 2006 16:13:15 -0000 1.4 *************** *** 48,51 **** --- 48,53 ---- /*database*/ + public boolean busy = false; + /** * Contains received segments ONLY sequence_number for each segment is stored |
From: Alexander B. <da...@us...> - 2006-09-07 15:38:19
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27740/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.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Tcp.java 7 Sep 2006 15:20:44 -0000 1.75 --- Tcp.java 7 Sep 2006 15:38:16 -0000 1.76 *************** *** 161,164 **** --- 161,170 ---- } + class Point{ + public int i; + + Point(){ i = 0; } + } + /** * This method defines TCP timer *************** *** 170,177 **** public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { try{ ! if(Elm.timer==null) { ! System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + ""); --- 176,193 ---- public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { try{ ! if(Elm.timer==null) { ! ! Point p = new Point(); ! p = null; ! ! try{ ! p.i = 1; ! }catch(Exception e){ ! Error.Report(e); ! } ! Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); + System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } else { System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + ""); *************** *** 289,293 **** public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort, int inREP) { if(Elm.Servertimer==null) { ! System.out.println("Server Timer init!"); Elm.Servertimer=new Timer(); Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_CONNECT_SERVER_TIME,this, inREP),TCP_CONNECT_SERVER_TIME,TCP_CONNECT_SERVER_TIME); --- 305,309 ---- public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort, int inREP) { if(Elm.Servertimer==null) { ! System.out.println("Server Timer init == " + inlocalPort); Elm.Servertimer=new Timer(); Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_CONNECT_SERVER_TIME,this, inREP),TCP_CONNECT_SERVER_TIME,TCP_CONNECT_SERVER_TIME); |
From: Alexander B. <da...@us...> - 2006-09-07 15:20:58
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20604/core Modified Files: FalseRandom.java Log Message: Index: FalseRandom.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/FalseRandom.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FalseRandom.java 7 Sep 2006 15:13:55 -0000 1.12 --- FalseRandom.java 7 Sep 2006 15:20:44 -0000 1.13 *************** *** 10,16 **** //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1}; if(count >= sequence.length) count = 0; --- 10,16 ---- //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1}; if(count >= sequence.length) count = 0; |
From: Alexander B. <da...@us...> - 2006-09-07 15:20:50
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20604/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.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Tcp.java 7 Sep 2006 15:13:55 -0000 1.74 --- Tcp.java 7 Sep 2006 15:20:44 -0000 1.75 *************** *** 169,185 **** */ public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, timerid++),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { ! System.out.println("Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID()); Elm.timer.cancel(); Elm.timer=null; Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, timerid++), TCP_SENDER_TIME, TCP_SENDER_TIME); System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } ! } --- 169,188 ---- */ public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { + try{ if(Elm.timer==null) { System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, ++timerid),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { ! System.out.println("##################################### ############ Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID() + " && OLDID = " + timerid + ""); Elm.timer.cancel(); Elm.timer=null; Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, ++timerid), TCP_SENDER_TIME, TCP_SENDER_TIME); System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } ! }catch(Exception e){ ! Error.Report(e); ! } } |
From: Alexander B. <da...@us...> - 2006-09-07 15:14:09
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17660/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.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** Tcp.java 7 Sep 2006 15:01:01 -0000 1.73 --- Tcp.java 7 Sep 2006 15:13:55 -0000 1.74 *************** *** 142,146 **** private static final long TCP_CONNECT_TIME = 200; //msec time to resend all segments in SegmentsToresend queue when connecting ! private static int timerid = 0; /** --- 142,146 ---- private static final long TCP_CONNECT_TIME = 200; //msec time to resend all segments in SegmentsToresend queue when connecting ! private int timerid = 0; /** |
From: Alexander B. <da...@us...> - 2006-09-07 15:14:00
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17660/core Modified Files: FalseRandom.java Log Message: Index: FalseRandom.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/FalseRandom.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FalseRandom.java 7 Sep 2006 14:02:09 -0000 1.11 --- FalseRandom.java 7 Sep 2006 15:13:55 -0000 1.12 *************** *** 10,16 **** //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1}; if(count >= sequence.length) count = 0; --- 10,16 ---- //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1}; if(count >= sequence.length) count = 0; |
From: Alexander B. <da...@us...> - 2006-09-07 15:01:09
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12359/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.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Tcp.java 7 Sep 2006 14:54:34 -0000 1.72 --- Tcp.java 7 Sep 2006 15:01:01 -0000 1.73 *************** *** 170,174 **** public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { ! System.out.println("Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, timerid++),TCP_CONNECT_TIME,TCP_CONNECT_TIME); --- 170,174 ---- public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { ! System.out.println("##################################### ############ Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, timerid++),TCP_CONNECT_TIME,TCP_CONNECT_TIME); *************** *** 179,183 **** Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, timerid++), TCP_SENDER_TIME, TCP_SENDER_TIME); ! System.out.println(" Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } --- 179,183 ---- Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, timerid++), TCP_SENDER_TIME, TCP_SENDER_TIME); ! System.out.println("##################################### ############ Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } *************** *** 208,212 **** public void run() { try{ ! System.out.println("Timer start! ID: " + id); if(!Elm.SegmentsToResend.isEmpty() && numRepeat>0) { // this.cancel(); --- 208,212 ---- public void run() { try{ ! System.out.println("##################################### ############ In Timer.run()! ID: " + id); if(!Elm.SegmentsToResend.isEmpty() && numRepeat>0) { // this.cancel(); *************** *** 807,811 **** if (flags[5]) Elm.isFIN_sent=true; ! TCPsetTimer(Elm,reps); Elm=null; --- 807,811 ---- if (flags[5]) Elm.isFIN_sent=true; ! TCPsetTimer(Elm,reps); ///!!!!!!!!!!!!! Elm=null; |
From: Alexander B. <da...@us...> - 2006-09-07 14:54:37
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9926/core/protocolsuite/tcp_ip Modified Files: TCP_HashTableElement.java Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Tcp.java 7 Sep 2006 14:08:54 -0000 1.71 --- Tcp.java 7 Sep 2006 14:54:34 -0000 1.72 *************** *** 142,145 **** --- 142,147 ---- private static final long TCP_CONNECT_TIME = 200; //msec time to resend all segments in SegmentsToresend queue when connecting + private static int timerid = 0; + /** * This method assigns the ParentStack *************** *** 168,174 **** public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { ! System.out.println("Sender timer init! Elm id = " + Elm.returnID()); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { System.out.println("Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID()); --- 170,176 ---- public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { ! System.out.println("Sender timer init! Elm id = " + Elm.returnID() + " ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP, timerid++),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { System.out.println("Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID()); *************** *** 176,181 **** Elm.timer=null; Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP), TCP_SENDER_TIME, TCP_SENDER_TIME); ! System.out.println(" Sender Timer REinit DONE!"); } --- 178,183 ---- Elm.timer=null; Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this, inREP, timerid++), TCP_SENDER_TIME, TCP_SENDER_TIME); ! System.out.println(" Sender Timer REinit DONE! ID = " + timerid + " Elm connected to port:" + Elm.connectedtoPort); } *************** *** 188,197 **** private long repTime; private Tcp TCPptr; ! public TCPTask(TCP_HashTableElement inElm, long time, Tcp inTCP, int inREP) { this.Elm=inElm; this.repTime=time; this.TCPptr=inTCP; this.numRepeat=inREP; } --- 190,201 ---- private long repTime; private Tcp TCPptr; + private int id; ! public TCPTask(TCP_HashTableElement inElm, long time, Tcp inTCP, int inREP, int id) { this.Elm=inElm; this.repTime=time; this.TCPptr=inTCP; this.numRepeat=inREP; + this.id = id; } *************** *** 204,208 **** public void run() { try{ ! // System.out.println("Timer start!"); if(!Elm.SegmentsToResend.isEmpty() && numRepeat>0) { // this.cancel(); --- 208,212 ---- public void run() { try{ ! System.out.println("Timer start! ID: " + id); if(!Elm.SegmentsToResend.isEmpty() && numRepeat>0) { // this.cancel(); *************** *** 245,256 **** Simulation.addLayerInfo(TCP_Info); Elm.addstats(TCPptr); ! ((Application)Elm.application).DisconnectEvent(); Elm.reset(); } else { //nothing to resend, but numRepeat>0 ! System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat + " Elm id = " + Elm.returnID()); try{ numRepeat = 0; if(Elm.timer!=null){ ! Elm.timer.cancel(); this.cancel(); // ??? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } --- 249,261 ---- Simulation.addLayerInfo(TCP_Info); Elm.addstats(TCPptr); ! if(Elm.application != null) ((Application)Elm.application).DisconnectEvent(); Elm.reset(); } else { //nothing to resend, but numRepeat>0 ! System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat + " Elm id = " + Elm.returnID() + " Elm connected to port:" + Elm.connectedtoPort); try{ numRepeat = 0; + System.out.println(">>>>>>>>>>>>>>>>>>>> " + Elm.timer); if(Elm.timer!=null){ ! Elm.timer.cancel(); this.cancel(); // ??? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } Index: TCP_HashTableElement.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/TCP_HashTableElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TCP_HashTableElement.java 7 Sep 2006 14:08:54 -0000 1.2 --- TCP_HashTableElement.java 7 Sep 2006 14:54:34 -0000 1.3 *************** *** 143,147 **** } System.out.println("Elm.reset: Timer cancel - part 2! Elm id = " + this.returnID()); ! this.timer = null; } --- 143,147 ---- } System.out.println("Elm.reset: Timer cancel - part 2! Elm id = " + this.returnID()); ! this.timer = null; } |
From: Alexander B. <da...@us...> - 2006-09-07 14:08:58
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23705/core/protocolsuite/tcp_ip Modified Files: TCP_HashTableElement.java Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Tcp.java 7 Sep 2006 14:02:09 -0000 1.70 --- Tcp.java 7 Sep 2006 14:08:54 -0000 1.71 *************** *** 168,176 **** public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { ! System.out.println("Sender timer init!"); Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { ! System.out.println("Sender Timer REinit due to new packet arrival!"); Elm.timer.cancel(); Elm.timer=null; --- 168,176 ---- public void TCPsetTimer(TCP_HashTableElement Elm, int inREP) { if(Elm.timer==null) { ! System.out.println("Sender timer init! Elm id = " + Elm.returnID()); Elm.timer=new Timer(); Elm.timer.schedule(new TCPTask(Elm,TCP_CONNECT_TIME,this, inREP),TCP_CONNECT_TIME,TCP_CONNECT_TIME); } else { ! System.out.println("Sender Timer REinit due to new packet arrival! Elm id = " + Elm.returnID()); Elm.timer.cancel(); Elm.timer=null; *************** *** 248,252 **** Elm.reset(); } else { //nothing to resend, but numRepeat>0 ! System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat); try{ numRepeat = 0; --- 248,252 ---- Elm.reset(); } else { //nothing to resend, but numRepeat>0 ! System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat + " Elm id = " + Elm.returnID()); try{ numRepeat = 0; *************** *** 260,264 **** Error.Report(e); } ! System.out.println("Timer cancel - part2!"); } } --- 260,264 ---- Error.Report(e); } ! System.out.println("Timer cancel - part2! Elm id = " + Elm.returnID()); } } Index: TCP_HashTableElement.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/TCP_HashTableElement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TCP_HashTableElement.java 7 Sep 2006 14:02:09 -0000 1.1 --- TCP_HashTableElement.java 7 Sep 2006 14:08:54 -0000 1.2 *************** *** 109,112 **** --- 109,121 ---- * @version v0.20 */ + + public TCP_HashTableElement(){ + Element_id++; + } + + public int returnID(){ + return Element_id; + } + public void addstats(Tcp TCPStack) { TCPStack.IncReceivedDuplicatesNumber(this.received_duplicates); *************** *** 126,130 **** public void reset() { if (timer!=null){ ! System.out.println("Elm.reset: Timer cancel - part 1!"); try{ this.timer.cancel(); --- 135,139 ---- public void reset() { if (timer!=null){ ! System.out.println("Elm.reset: Timer cancel - part 1! Elm id = " + this.returnID()); try{ this.timer.cancel(); *************** *** 133,142 **** Error.Report(e); } ! System.out.println("Elm.reset: Timer cancel - part 2!"); this.timer = null; } if (Servertimer!=null){ ! System.out.println("Elm.reset: Servertimer cancel - part 1!"); try{ this.Servertimer.cancel(); --- 142,151 ---- Error.Report(e); } ! System.out.println("Elm.reset: Timer cancel - part 2! Elm id = " + this.returnID()); this.timer = null; } if (Servertimer!=null){ ! System.out.println("Elm.reset: Servertimer cancel - part 1! Elm id = " + this.returnID()); try{ this.Servertimer.cancel(); *************** *** 145,149 **** Error.Report(e); } ! System.out.println("Elm.reset: Servertimer cancel - part 2!"); this.Servertimer = null; } --- 154,158 ---- Error.Report(e); } ! System.out.println("Elm.reset: Servertimer cancel - part 2! Elm id = " + this.returnID()); this.Servertimer = null; } |
From: Alexander B. <da...@us...> - 2006-09-07 14:02:15
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20875/core Modified Files: FalseRandom.java Log Message: Index: FalseRandom.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/FalseRandom.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FalseRandom.java 3 Sep 2006 14:32:08 -0000 1.10 --- FalseRandom.java 7 Sep 2006 14:02:09 -0000 1.11 *************** *** 10,14 **** //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; //int sequence[] = {1}; --- 10,14 ---- //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; //int sequence[] = {1}; |
From: Alexander B. <da...@us...> - 2006-09-07 14:02:15
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20875/core/protocolsuite/tcp_ip Modified Files: Tcp.java Added Files: TCP_HashTableElement.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Tcp.java 5 Sep 2006 14:59:52 -0000 1.69 --- Tcp.java 7 Sep 2006 14:02:09 -0000 1.70 *************** *** 112,325 **** */ ! /** ! * @author gift (sourceforge.net user) ! * @version v0.10, 25 Nov 2005 ! */ ! public class TCP_HashTableElement { ! public byte PortStatus=0; // 0 - free port; 1 - port is being listened to; 2 - busy. ! public Object application=null; //points to application that listens to this port | provided PortStatus==1 ! public String connectedtoIP=""; //contains IP of the other connected computer | provided PortStatus==2 ! public int connectedtoPort=0; //contains port number of the other connected computer | provided PortStatus==2 ! /*statistic block*/ ! public int received_segments=0; //counter inc when a segment is received ! public int sent_segments=0; //counter inc when a segment is sent ! public int sent_ACK=0; //counter inc when an ACK is sent ! public int received_duplicates=0;//counter inc when a duplicate of a received segment is received again ! public int sent_duplicates=0; //counter inc when a duplicate of a segment is resent ! /*end of statistic block*/ ! public int seq_number=0; ! public int last_passed=-1; //last sequence number value of the segment that has been passed upstairs ! /*database*/ ! ! /** ! * Contains received segments ONLY sequence_number for each segment is stored ! * Integer type is used NOTE: Do remember about special "Integer" use by "Vector" ! */ ! public Vector ReceivedSegments = new Vector(); ! ! /** ! * Here we store sent acknowledgements. ! * <p>Key: Sequence number of the segment that we have received and acknowledged</p> ! * <p>Object: Our ACK segment that we have received/<p> ! * <p>Aim of this hashtable: if we receive a duplicate of the segment that we have received, we get this duplicate sequenece number ! * then we get from this hashtable a copy of ACK segment we have sent and send it again.</p> ! */ ! public Hashtable SentACKs = new Hashtable(); ! ! /** ! * Contains received acknowledgments from destination computer ONLY sequence_number for each ACK segment is stored ! * Integer type is used NOTE: Do remember about special "Integer" use by "Vector" ! */ ! public Vector ReceivedACKs = new Vector(); ! ! /** ! * Contains segments that will be resent in case no ACK for them will be received ! * <p>Key: Sequence number of the segment that we are sending</p> ! * <p>Object: The copy of the segment we have sent</p> ! * <p>Aim of this hashtable: necessarily to have</p> ! */ ! public Hashtable SegmentsToResend = new Hashtable(); ! ! /** ! * Contains segments that have come in non consequential order ! * maximun 200 segments can be stored ! * <p>Key: Sequence number of the segment</p> ! * <p>Object: The copy of the segment we have received</p> ! * <p>Aim of this hashtable: necessarily to have, to pass segments upstairs in proper order</p> ! */ ! public Hashtable OutputBuffer = new Hashtable(200); ! /*end of database*/ ! ! public boolean isFIN_sent=false; ! public boolean isFIN_confirmed=false; ! public boolean isPassive=false; ! // public boolean isConnected=false; ! /** ! * 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error ! */ ! public byte ApplicationStatus=0; ! ! public boolean isServer=false; ! ! public Timer timer=null; //our timer for this connection ! ! public Timer Servertimer=null; ! ! /* ! * This method adds statistics to the TCP stack ! * @author gift (sourceforge.net user) ! * @param TCPStack Tcp stack to add statistics ! * @return Nothing. ! * @version v0.20 ! */ ! public void addstats(Tcp TCPStack) { ! TCPStack.IncReceivedDuplicatesNumber(this.received_duplicates); ! TCPStack.IncReceivedSegmentsNumber(this.received_segments); ! TCPStack.IncSentACKSegmentsNumber(this.sent_ACK); ! TCPStack.IncSentDuplicatesNumber(this.sent_duplicates); ! TCPStack.IncSentSegmentsNumber(this.sent_segments); ! } ! ! /* ! * This method resets element by setting default valuse ! * @author gift (sourceforge.net user) ! * @param Unused. ! * @return Nothing. ! * @version v0.20 ! */ ! public void reset() { ! if (timer!=null){ ! System.out.println("Elm.reset: Timer cancel - part 1!"); ! try{ ! this.timer.cancel(); ! }catch(Exception e){ ! System.out.println("Elm.reset: Timer cancel error."); ! Error.Report(e); ! } ! System.out.println("Elm.reset: Timer cancel - part 2!"); ! this.timer = null; ! } ! ! if (Servertimer!=null){ ! System.out.println("Elm.reset: Servertimer cancel - part 1!"); ! try{ ! this.Servertimer.cancel(); ! }catch(Exception e){ ! System.out.println("Elm.reset: Server timer cancel error."); ! Error.Report(e); ! } ! System.out.println("Elm.reset: Servertimer cancel - part 2!"); ! this.Servertimer = null; ! } ! ! this.PortStatus=0; ! this.application=null; ! this.connectedtoIP=""; ! this.connectedtoPort=0; ! this.received_segments=0; ! this.sent_segments=0; ! this.sent_ACK=0; ! this.received_duplicates=0; ! this.sent_duplicates=0; ! this.seq_number=0; ! this.last_passed=-1; ! ! if (!this.ReceivedSegments.isEmpty()) this.ReceivedSegments.removeAllElements(); ! if (!this.ReceivedACKs.isEmpty()) this.ReceivedACKs.removeAllElements(); ! ! try { ! if (!this.SentACKs.isEmpty()) { ! /* Set set = this.SentACKs.keySet(); ! Iterator itr = set.iterator(); ! while (itr.hasNext()) ! { ! this.SentACKs.remove(itr.next()); ! }*/ ! Enumeration HTkeys; ! Integer curkey; ! HTkeys = SentACKs.keys(); ! while (HTkeys.hasMoreElements()) { ! curkey= (Integer) HTkeys.nextElement(); ! this.SentACKs.remove(curkey); ! } ! } ! } catch(Exception e) { ! System.out.println("TCP Element.SentACKs reset error: " + e.toString()); ! Error.Report(e); ! } ! ! ! try { ! if (!this.SegmentsToResend.isEmpty()) { ! /*Set set = this.SegmentsToResend.keySet(); ! Iterator itr = set.iterator(); ! while (itr.hasNext()) ! { ! this.SegmentsToResend.remove(itr.next()); ! }*/ ! Enumeration HTkeys; ! Integer curkey; ! HTkeys = SegmentsToResend.keys(); ! while (HTkeys.hasMoreElements()) { ! curkey= (Integer) HTkeys.nextElement(); ! this.SegmentsToResend.remove(curkey); ! } ! } ! ! } catch(Exception e) { ! System.out.println("TCP Element.SegmentsToResend reset error: " + e.toString()); ! Error.Report(e); ! } ! ! try { ! if (!this.OutputBuffer.isEmpty()) { ! /*Set set = this.OutputBuffer.keySet(); ! Iterator itr = set.iterator(); ! while (itr.hasNext()) ! { ! this.OutputBuffer.remove(itr.next()); ! }*/ ! Enumeration HTkeys; ! Integer curkey; ! HTkeys = OutputBuffer.keys(); ! while (HTkeys.hasMoreElements()) { ! curkey= (Integer) HTkeys.nextElement(); ! this.OutputBuffer.remove(curkey); ! } ! } ! ! } catch(Exception e) { ! System.out.println("TCP Element.OutputBuffer reset error: " + e.toString()); ! } ! ! this.isFIN_sent=false; ! this.isFIN_confirmed=false; ! this.isPassive=false; ! //this.isConnected=false; ! this.ApplicationStatus=0; //no status ! this.isServer=false; ! ! } ! } private Hashtable PortTable = new Hashtable(); --- 112,116 ---- */ ! private Hashtable PortTable = new Hashtable(); *************** *** 459,465 **** System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat); try{ ! if(Elm.timer!=null){ Elm.timer.cancel(); ! this.cancel(); // ??? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } Elm.timer = null; --- 250,257 ---- System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat); try{ ! numRepeat = 0; ! if(Elm.timer!=null){ Elm.timer.cancel(); ! this.cancel(); // ??? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } Elm.timer = null; --- NEW FILE: TCP_HashTableElement.java --- package core.protocolsuite.tcp_ip; import java.io.Serializable; import java.util.*; import core.CommunicationException; import core.LowLinkException; import core.LayerInfo; import core.Error; import core.Simulation; import core.TransportLayerException; import core.TransportLayerPortException; import core.InvalidNetworkLayerDeviceException; import core.protocolsuite.tcp_ip.ProtocolStack; import java.util.Timer; import java.util.TimerTask; /** * @author gift (sourceforge.net user) * @version v0.10, 25 Nov 2005 */ public class TCP_HashTableElement { public byte PortStatus=0; // 0 - free port; 1 - port is being listened to; 2 - busy. public Object application=null; //points to application that listens to this port | provided PortStatus==1 public String connectedtoIP=""; //contains IP of the other connected computer | provided PortStatus==2 public int connectedtoPort=0; //contains port number of the other connected computer | provided PortStatus==2 /*statistic block*/ public int received_segments=0; //counter inc when a segment is received public int sent_segments=0; //counter inc when a segment is sent public int sent_ACK=0; //counter inc when an ACK is sent public int received_duplicates=0;//counter inc when a duplicate of a received segment is received again public int sent_duplicates=0; //counter inc when a duplicate of a segment is resent /*end of statistic block*/ public int seq_number=0; public int last_passed=-1; //last sequence number value of the segment that has been passed upstairs public static int Element_id = 0; /*database*/ /** * Contains received segments ONLY sequence_number for each segment is stored * Integer type is used NOTE: Do remember about special "Integer" use by "Vector" */ public Vector ReceivedSegments = new Vector(); /** * Here we store sent acknowledgements. * <p>Key: Sequence number of the segment that we have received and acknowledged</p> * <p>Object: Our ACK segment that we have received/<p> * <p>Aim of this hashtable: if we receive a duplicate of the segment that we have received, we get this duplicate sequenece number * then we get from this hashtable a copy of ACK segment we have sent and send it again.</p> */ public Hashtable SentACKs = new Hashtable(); /** * Contains received acknowledgments from destination computer ONLY sequence_number for each ACK segment is stored * Integer type is used NOTE: Do remember about special "Integer" use by "Vector" */ public Vector ReceivedACKs = new Vector(); /** * Contains segments that will be resent in case no ACK for them will be received * <p>Key: Sequence number of the segment that we are sending</p> * <p>Object: The copy of the segment we have sent</p> * <p>Aim of this hashtable: necessarily to have</p> */ public Hashtable SegmentsToResend = new Hashtable(); /** * Contains segments that have come in non consequential order * maximun 200 segments can be stored * <p>Key: Sequence number of the segment</p> * <p>Object: The copy of the segment we have received</p> * <p>Aim of this hashtable: necessarily to have, to pass segments upstairs in proper order</p> */ public Hashtable OutputBuffer = new Hashtable(200); /*end of database*/ public boolean isFIN_sent=false; public boolean isFIN_confirmed=false; public boolean isPassive=false; // public boolean isConnected=false; /** * 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error */ public byte ApplicationStatus=0; public boolean isServer=false; public Timer timer=null; //our timer for this connection public Timer Servertimer=null; /* * This method adds statistics to the TCP stack * @author gift (sourceforge.net user) * @param TCPStack Tcp stack to add statistics * @return Nothing. * @version v0.20 */ public void addstats(Tcp TCPStack) { TCPStack.IncReceivedDuplicatesNumber(this.received_duplicates); TCPStack.IncReceivedSegmentsNumber(this.received_segments); TCPStack.IncSentACKSegmentsNumber(this.sent_ACK); TCPStack.IncSentDuplicatesNumber(this.sent_duplicates); TCPStack.IncSentSegmentsNumber(this.sent_segments); } /* * This method resets element by setting default valuse * @author gift (sourceforge.net user) * @param Unused. * @return Nothing. * @version v0.20 */ public void reset() { if (timer!=null){ System.out.println("Elm.reset: Timer cancel - part 1!"); try{ this.timer.cancel(); }catch(Exception e){ System.out.println("Elm.reset: Timer cancel error."); Error.Report(e); } System.out.println("Elm.reset: Timer cancel - part 2!"); this.timer = null; } if (Servertimer!=null){ System.out.println("Elm.reset: Servertimer cancel - part 1!"); try{ this.Servertimer.cancel(); }catch(Exception e){ System.out.println("Elm.reset: Server timer cancel error."); Error.Report(e); } System.out.println("Elm.reset: Servertimer cancel - part 2!"); this.Servertimer = null; } this.PortStatus=0; this.application=null; this.connectedtoIP=""; this.connectedtoPort=0; this.received_segments=0; this.sent_segments=0; this.sent_ACK=0; this.received_duplicates=0; this.sent_duplicates=0; this.seq_number=0; this.last_passed=-1; if (!this.ReceivedSegments.isEmpty()) this.ReceivedSegments.removeAllElements(); if (!this.ReceivedACKs.isEmpty()) this.ReceivedACKs.removeAllElements(); try { if (!this.SentACKs.isEmpty()) { /* Set set = this.SentACKs.keySet(); Iterator itr = set.iterator(); while (itr.hasNext()) { this.SentACKs.remove(itr.next()); }*/ Enumeration HTkeys; Integer curkey; HTkeys = SentACKs.keys(); while (HTkeys.hasMoreElements()) { curkey= (Integer) HTkeys.nextElement(); this.SentACKs.remove(curkey); } } } catch(Exception e) { System.out.println("TCP Element.SentACKs reset error: " + e.toString()); Error.Report(e); } try { if (!this.SegmentsToResend.isEmpty()) { /*Set set = this.SegmentsToResend.keySet(); Iterator itr = set.iterator(); while (itr.hasNext()) { this.SegmentsToResend.remove(itr.next()); }*/ Enumeration HTkeys; Integer curkey; HTkeys = SegmentsToResend.keys(); while (HTkeys.hasMoreElements()) { curkey= (Integer) HTkeys.nextElement(); this.SegmentsToResend.remove(curkey); } } } catch(Exception e) { System.out.println("TCP Element.SegmentsToResend reset error: " + e.toString()); Error.Report(e); } try { if (!this.OutputBuffer.isEmpty()) { /*Set set = this.OutputBuffer.keySet(); Iterator itr = set.iterator(); while (itr.hasNext()) { this.OutputBuffer.remove(itr.next()); }*/ Enumeration HTkeys; Integer curkey; HTkeys = OutputBuffer.keys(); while (HTkeys.hasMoreElements()) { curkey= (Integer) HTkeys.nextElement(); this.OutputBuffer.remove(curkey); } } } catch(Exception e) { System.out.println("TCP Element.OutputBuffer reset error: " + e.toString()); } this.isFIN_sent=false; this.isFIN_confirmed=false; this.isPassive=false; //this.isConnected=false; this.ApplicationStatus=0; //no status this.isServer=false; } } |
From: Alexander B. <da...@us...> - 2006-09-07 14:02:14
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20875 Modified Files: licence.txt Log Message: Index: licence.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/licence.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** licence.txt 8 Nov 2005 04:04:21 -0000 1.1.1.1 --- licence.txt 7 Sep 2006 14:02:09 -0000 1.2 *************** *** 1,5 **** Java Network Simulator (javaNetSim) ! Copyright (c) 2005, Ice Team; All rights reserved. Copyright (c) 2004, jFirewallSim development team; All rights reserved. --- 1,5 ---- Java Network Simulator (javaNetSim) ! Copyright (c) 2006, 2005, Ice Team; All rights reserved. Copyright (c) 2004, jFirewallSim development team; All rights reserved. |
From: QweR <qw...@us...> - 2006-09-05 21:04:48
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21634/core/protocolsuite/tcp_ip Modified Files: Telnet_client.java Telnet_server.java Log Message: Index: Telnet_client.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_client.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Telnet_client.java 5 Sep 2006 14:59:52 -0000 1.8 --- Telnet_client.java 5 Sep 2006 21:04:36 -0000 1.9 *************** *** 1,4 **** /* ! * Echo.java * * Created on 19 Nov 2005 Ç., 14:09 --- 1,4 ---- /* ! * Telnet_client.java * * Created on 19 Nov 2005 Ç., 14:09 *************** *** 7,27 **** package core.protocolsuite.tcp_ip; - import core.TransportLayerException; - import core.InvalidNetworkLayerDeviceException; - import core.CommunicationException; - import core.LowLinkException; - import core.LayerInfo; - import core.Packet; - import core.Simulation; - import guiUI.TelnetEmulator; import core.ApplicationLayerDevice; /** --- 7,20 ---- package core.protocolsuite.tcp_ip; import core.TransportLayerException; import core.InvalidNetworkLayerDeviceException; import core.CommunicationException; import core.LowLinkException; import core.LayerInfo; import core.Packet; import core.Simulation; import guiUI.TelnetEmulator; import core.ApplicationLayerDevice; + import core.Error; /** *************** *** 36,39 **** --- 29,33 ---- private TelnetEmulator terminal; private int counts; + private boolean already_closed = false; private boolean connected; *************** *** 63,68 **** */ public void Close() throws TransportLayerException ! { ! mParentStack.FreeTCPApplication(this); } --- 57,65 ---- */ public void Close() throws TransportLayerException ! { ! if(!already_closed){ ! mParentStack.FreeTCPApplication(this); ! already_closed = true; ! } } *************** *** 111,127 **** public void DisconnectEvent(){ ! try{ ! connected = false; ! Disconnect(); ! } ! catch(TransportLayerException e) { ! printInfo("Client: can not disconnected: transport problem"); ! } ! catch(LowLinkException e) { ! printInfo("Client: can not disconnected: low link problem"); ! } ! printInfo("\nClient: receive disconnect event\n"); terminal.recvData("\nServer closed connection.\n"); ! terminal.recvData("\nQUIT"); } --- 108,131 ---- public void DisconnectEvent(){ ! connected = false; ! printInfo("Client: receive disconnect event"); terminal.recvData("\nServer closed connection.\n"); ! terminal.recvData("\nQUIT"); ! // try{ ! // printInfo("Client: receive disconnect event"); ! // Disconnect(); ! // } ! // catch(TransportLayerException e) { ! // printInfo("Client: can not disconnected: transport problem"); ! // } ! // catch(LowLinkException e) { ! // printInfo("Client: can not disconnected: low link problem"); ! // } ! // try{ ! // mParentStack.CloseTCP(this); ! // } ! // catch(TransportLayerException e){ ! // printInfo("Client: can not close port"); ! // } } *************** *** 133,152 **** public void Disconnect() throws TransportLayerException, LowLinkException{ ! if(connected){ ! try { ! mParentStack.FinalizeTCP(this); //will close client connection ! }catch(Exception e){ ! ///*TODO*: here to catch ! } ! ! if(appType==0){ printInfo("Client: closing connection."); ! }else{ ! printInfo("Client: closing connection. Now listening on " + listenPort + "."); ! } ! mParentStack.CloseTCP(this); ! //mParentStack.freeTCPPort(this); ! } ! } --- 137,153 ---- public void Disconnect() throws TransportLayerException, LowLinkException{ ! if(connected){ ! try{ ! mParentStack.FinalizeTCP(this); //will close client connection ! } ! catch(CommunicationException e){ ! printInfo("Client: can not disconnected: communication problem"); ! } printInfo("Client: closing connection."); ! mParentStack.CloseTCP(this); ! //mParentStack.freeTCPPort(this); ! connected = false; ! } ! } *************** *** 177,199 **** public void RecvData(String Data) throws LowLinkException, TransportLayerException { //processing the protocol doings. ! if(appType == 0){ //client processing recieve // printing some ... ! printInfo("Recieving echo message '" + Data + "' from server."); ! /* ! LayerInfo protInfo = new LayerInfo(getClass().getName()); ! protInfo.setObjectName(mParentStack.getParentNodeName()); ! protInfo.setDataType("Echo Protocol Data"); ! protInfo.setLayer("Application "); ! protInfo.setDescription("Recieving echo message '" + Data + "' from server."); ! Simulation.addLayerInfo(protInfo);*/ if(Data.compareTo("\nQUIT")==0) { ! connected = false; ! Disconnect(); // terminal.recvData("Client: closing connection\n"); } terminal.recvData(Data); ! } } --- 178,194 ---- public void RecvData(String Data) throws LowLinkException, TransportLayerException { //processing the protocol doings. ! // if(appType == 0){ //client processing recieve // printing some ... ! printInfo("Client: Recieving message '" + Data + "' from server."); if(Data.compareTo("\nQUIT")==0) { ! System.out.println("\n\n\n-----------------------\nTelnet: RecvData: QUIT\n-------------------------------\n\n\n"); ! // connected = false; ! // Disconnect(); // terminal.recvData("Client: closing connection\n"); } terminal.recvData(Data); ! // } } *************** *** 203,207 **** /** ! * This method processes a echo sending by client * @param data to send * @param server host --- 198,202 ---- /** ! * This method processes a telnet sending by client * @param data to send * @param server host *************** *** 257,261 **** } ! private void printInfo(String s) { LayerInfo protInfo2 = new LayerInfo(getClass().getName()); protInfo2.setObjectName(mParentStack.getParentNodeName()); --- 252,256 ---- } ! public void printInfo(String s) { LayerInfo protInfo2 = new LayerInfo(getClass().getName()); protInfo2.setObjectName(mParentStack.getParentNodeName()); Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Telnet_server.java 28 Feb 2006 16:55:35 -0000 1.9 --- Telnet_server.java 5 Sep 2006 21:04:36 -0000 1.10 *************** *** 1,4 **** /* ! * Echo.java * * Created on 19 Nov 2005, 14:09 --- 1,4 ---- /* ! * Telnet_server.java * * Created on 19 Nov 2005, 14:09 *************** *** 22,25 **** --- 22,26 ---- import core.Simulation; import java.util.regex.*; + import core.Error; /** *************** *** 42,45 **** --- 43,47 ---- private String login = "root"; private String temp = ""; + private boolean connected; /** Creates a new instance of Telnet Server */ *************** *** 48,51 **** --- 50,54 ---- mDevice = dev; counts = 0; + connected = false; } *************** *** 57,66 **** public void Listen() throws TransportLayerException{ //throw new TransportLayerException("Cannot bind port " + listenPort + "."); ! try{ ! if(appType != 0) mParentStack.ListenTCP(this, listenPort); ! } catch (TransportLayerException e) ! { ! ! } isenter = true; } --- 60,64 ---- public void Listen() throws TransportLayerException{ //throw new TransportLayerException("Cannot bind port " + listenPort + "."); ! mParentStack.ListenTCP(this, listenPort); isenter = true; } *************** *** 84,88 **** /** ! * This method should be called from UDP when client connects to server * @author key * @version v0.01 --- 82,86 ---- /** ! * This method should be called from TCP when client connects to server * @author key * @version v0.01 *************** *** 91,94 **** --- 89,93 ---- sdHost = Host; sdPort = port; + connected = true; } *************** *** 100,118 **** public void DisconnectEvent(){ printInfo("Server: client closed connection"); ! try{ ! Close(); ! printInfo("Server: closing connection"); ! try{ ! Listen(); ! printInfo("Server: listening on port " + listenPort); ! } ! catch(TransportLayerException e){ ! printInfo("Server: can not listen on port " + listenPort); ! } ! } ! catch(TransportLayerException e){ ! printInfo("Server: can not close connection"); ! } } --- 99,118 ---- public void DisconnectEvent(){ + connected = false; printInfo("Server: client closed connection"); ! // try{ ! // printInfo("Server: closing connection"); ! // Close(); ! // try{ ! // Listen(); ! // printInfo("Server: listening on port " + listenPort); ! // } ! // catch(TransportLayerException e){ ! // printInfo("Server: can not listen on port " + listenPort); ! // } ! // } ! // catch(TransportLayerException e){ ! // printInfo("Server: can not close connection"); ! // } } *************** *** 124,141 **** public void Disconnect() throws TransportLayerException, LowLinkException{ try { ! mParentStack.FinalizeTCP(this); //will close client connection ! }catch(Exception e){ ! ///*TODO*: here to catch } ! if(appType==0){ ! printInfo("Server: closing connection."); }else{ ! printInfo("Server: closing connection. Now listening on port" + listenPort + "."); } ! ! mParentStack.CloseTCP(this); ! //mParentStack.freeTCPPort(this); } --- 124,142 ---- public void Disconnect() throws TransportLayerException, LowLinkException{ + connected = false; try { ! mParentStack.FinalizeTCP(this); //will close client connection ! }catch(CommunicationException e){ ! printInfo("Server: can not finalize TCP connection"); } ! Close(); ! Listen(); if(appType==0){ ! printInfo("Server: closing connection."); }else{ ! printInfo("Server: closing connection. Now listening on port " + listenPort + "."); } ! // mParentStack.CloseTCP(this); ! // mParentStack.freeTCPPort(this); } *************** *** 169,173 **** //server processing recieve ! printInfo("Server: recieving echo message '" + Data + "' from client."); while(Data.length()>0) { --- 170,174 ---- //server processing recieve ! printInfo("Server: recieving message '" + Data + "' from client."); while(Data.length()>0) { *************** *** 211,215 **** } catch(Exception e) { ! //************* } } --- 212,216 ---- } catch(Exception e) { ! Error.Report(e); } } *************** *** 255,271 **** } } ! try { printInfo("Server: sending message '" + outData + "' to client."); ! SendData(outData); ! if(outData.compareTo("\nQUIT")==0) { ! Close(); ! Listen(); ! printInfo("Server: closing connection"); ! printInfo("Server: listening on port " + listenPort); ! isenter = true; } - } - catch(Exception e){ - ///*TODO*: here to catch } Data = Data.substring(1); --- 256,285 ---- } } ! if(outData.compareTo("\nQUIT")==0) { ! Disconnect(); ! // try{ ! // Close(); ! // } ! // catch(TransportLayerException e){ ! // printInfo("Server: can not close application port"); ! // } ! // printInfo("Server: closed connection"); ! // try{ ! // Listen(); ! // } ! // catch(TransportLayerException e){ ! // printInfo("Server: can not listen on application port"); ! // } ! // printInfo("Server: listening on port " + listenPort); ! isenter = true; ! } ! else{ printInfo("Server: sending message '" + outData + "' to client."); ! try{ ! SendData(outData); ! } ! catch(CommunicationException e){ ! printInfo("Server: can not send data packet: communication error"); } } Data = Data.substring(1); |
From: QweR <qw...@us...> - 2006-09-05 21:04:45
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21634/guiUI Modified Files: TelnetEmulator.java Log Message: Index: TelnetEmulator.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/TelnetEmulator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TelnetEmulator.java 27 Feb 2006 00:49:10 -0000 1.7 --- TelnetEmulator.java 5 Sep 2006 21:04:36 -0000 1.8 *************** *** 205,212 **** } catch(TransportLayerException e) { ! } catch(LowLinkException e) { ! } } --- 205,212 ---- } catch(TransportLayerException e) { ! telnet.printInfo("Client: can not disconnected: transport problem"); } catch(LowLinkException e) { ! telnet.printInfo("Client: can not disconnected: low link problem"); } } |
From: Alexander B. <da...@us...> - 2006-09-05 14:59:57
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31605/core/protocolsuite/tcp_ip Modified Files: Tcp.java Telnet_client.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Tcp.java 4 Sep 2006 19:19:03 -0000 1.68 --- Tcp.java 5 Sep 2006 14:59:52 -0000 1.69 *************** *** 325,329 **** private Hashtable PortTable = new Hashtable(); private ProtocolStack mParentStack; ! private int window_size=25; // private int total_received=0; --- 325,329 ---- private Hashtable PortTable = new Hashtable(); private ProtocolStack mParentStack; ! private int window_size=2000; //25 // private int total_received=0; *************** *** 1834,1837 **** --- 1834,1838 ---- System.out.println(" [*** TCP ***] Pass upstairs call."); System.out.println(" [*** TCP ***] Last passed: " + Elm.last_passed + ", going to pass: " + kkey + "."); + System.out.println(" [*** TCP ***] Buffer isEmpty: " + Elm.OutputBuffer.isEmpty() + "."); System.out.println(" [*** TCP ***] While condition: " + Elm.OutputBuffer.containsKey(kkey) + "."); Index: Telnet_client.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_client.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Telnet_client.java 27 Feb 2006 00:49:09 -0000 1.7 --- Telnet_client.java 5 Sep 2006 14:59:52 -0000 1.8 *************** *** 36,39 **** --- 36,40 ---- private TelnetEmulator terminal; private int counts; + private boolean connected; /** Creates a new instance of Telnet Server */ *************** *** 42,45 **** --- 43,47 ---- mDevice = dev; counts = 0; + connected = false; } *************** *** 88,92 **** while (ConnectionAttempts>0 && clientPort==-1); ! if (clientPort>-1) return true; else return false; } --- 90,94 ---- while (ConnectionAttempts>0 && clientPort==-1); ! if (clientPort>-1){ connected = true; return true; }else{ connected = false; return false; } } *************** *** 110,113 **** --- 112,116 ---- public void DisconnectEvent(){ try{ + connected = false; Disconnect(); } *************** *** 120,124 **** printInfo("\nClient: receive disconnect event\n"); terminal.recvData("\nServer closed connection.\n"); ! terminal.recvData("\nQUIT"); } --- 123,127 ---- printInfo("\nClient: receive disconnect event\n"); terminal.recvData("\nServer closed connection.\n"); ! terminal.recvData("\nQUIT"); } *************** *** 130,133 **** --- 133,137 ---- public void Disconnect() throws TransportLayerException, LowLinkException{ + if(connected){ try { mParentStack.FinalizeTCP(this); //will close client connection *************** *** 143,146 **** --- 147,151 ---- mParentStack.CloseTCP(this); //mParentStack.freeTCPPort(this); + } } *************** *** 185,188 **** --- 190,194 ---- if(Data.compareTo("\nQUIT")==0) { + connected = false; Disconnect(); // terminal.recvData("Client: closing connection\n"); |
From: gift <gi...@us...> - 2006-09-04 19:19:10
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16534/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.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Tcp.java 4 Sep 2006 18:43:27 -0000 1.67 --- Tcp.java 4 Sep 2006 19:19:03 -0000 1.68 *************** *** 1431,1435 **** } - } else { // no FIN flag, no SYN flag --- 1431,1434 ---- *************** *** 1485,1491 **** //we do not have to send ACK for ACK-segment //deleting from SegmentsToResend the segmet with the acknowledgment number we have received NOTE: dec by 1 is used see RFC Elm.SegmentsToResend.remove((Integer)our_ack-1); ! // if (Elm.SegmentsToResend.remove((Integer)our_ack-1)==null) {System.out.println("Error here");} } else { --- 1484,1493 ---- //we do not have to send ACK for ACK-segment + System.out.println("[*** TCP ***] ACK received, port status: 2."); + PassUpstairs( (Application) Elm.application, Elm); + //deleting from SegmentsToResend the segmet with the acknowledgment number we have received NOTE: dec by 1 is used see RFC Elm.SegmentsToResend.remove((Integer)our_ack-1); ! // if (Elm.SegmentsToResend.remove((Integer)our_ack-1)==null) {System.out.println("Error here");} } else { *************** *** 1538,1541 **** --- 1540,1544 ---- // if (Elm.received_segments>2) // listener.RecvData(inPacket.getTCP_message()); + System.out.println("[*** TCP ***] Data received, port status: 2."); PassUpstairs(listener, Elm); System.out.println("5"); *************** *** 1545,1550 **** ! } else { //we have already received this segment ! if (Elm.isServer) { //init ServerTask --- 1548,1552 ---- ! } else { //we have already received this segment if (Elm.isServer) { //init ServerTask *************** *** 1832,1835 **** --- 1834,1839 ---- System.out.println(" [*** TCP ***] Pass upstairs call."); System.out.println(" [*** TCP ***] Last passed: " + Elm.last_passed + ", going to pass: " + kkey + "."); + System.out.println(" [*** TCP ***] Buffer isEmpty: " + Elm.OutputBuffer.isEmpty() + "."); + System.out.println(" [*** TCP ***] While condition: " + Elm.OutputBuffer.containsKey(kkey) + "."); while(Elm.OutputBuffer.containsKey(kkey)) { |
From: gift <gi...@us...> - 2006-09-04 18:43:33
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2950/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.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Tcp.java 3 Sep 2006 19:34:31 -0000 1.66 --- Tcp.java 4 Sep 2006 18:43:27 -0000 1.67 *************** *** 1828,1832 **** */ private void PassUpstairs(Application listener, TCP_HashTableElement Elm) throws LowLinkException, TransportLayerException { ! Integer kkey=Elm.last_passed+1;//=new Integer(Elm.last_passed+1); while(Elm.OutputBuffer.containsKey(kkey)) { --- 1828,1835 ---- */ private void PassUpstairs(Application listener, TCP_HashTableElement Elm) throws LowLinkException, TransportLayerException { ! Integer kkey=Elm.last_passed+1;//=new Integer(Elm.last_passed+1); ! ! System.out.println(" [*** TCP ***] Pass upstairs call."); ! System.out.println(" [*** TCP ***] Last passed: " + Elm.last_passed + ", going to pass: " + kkey + "."); while(Elm.OutputBuffer.containsKey(kkey)) { *************** *** 1835,1844 **** kkey++; ! if((!Packet.get_ACK_flag()) && (!Packet.get_SYN_flag())) //if(!Packet.get_ACK_flag()) listener.RecvData(Packet.getTCP_message()); } ! } --- 1838,1853 ---- kkey++; ! if((!Packet.get_ACK_flag()) && (!Packet.get_SYN_flag()) && (!Packet.get_FIN_flag())) ! { //if(!Packet.get_ACK_flag()) listener.RecvData(Packet.getTCP_message()); + System.out.println(" [*** TCP ***] [*P*] Passed packet SEQ: " + Packet.get_sequence_number() + ", packet destination: " + Packet.getDestIPAddress() + "."); + } else + { + System.out.println(" [*** TCP ***] [S] Skipped packet SEQ: " + Packet.get_sequence_number() + ", packet destination: " + Packet.getDestIPAddress() + "."); + } } ! System.out.println(" [*** TCP ***] Pass upstairs end of call."); } *************** *** 1854,1858 **** */ private void AddOutputBuffer(TCP_HashTableElement Elm, TCP_packet Packet) throws TransportLayerException { ! if (Elm.OutputBuffer.size()==200) { throw new TransportLayerException("TCP Error: maximum buffer size reached! Can not keep on receiving TCP segments. Bad connection to: " + Elm.connectedtoIP + ":" + Elm.connectedtoPort + "."); } else { --- 1863,1867 ---- */ private void AddOutputBuffer(TCP_HashTableElement Elm, TCP_packet Packet) throws TransportLayerException { ! if (Elm.OutputBuffer.size()==2000) { throw new TransportLayerException("TCP Error: maximum buffer size reached! Can not keep on receiving TCP segments. Bad connection to: " + Elm.connectedtoIP + ":" + Elm.connectedtoPort + "."); } else { |
From: Alexander B. <da...@us...> - 2006-09-03 19:34:36
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29501/core/protocolsuite/tcp_ip Modified Files: ProtocolStack.java Tcp.java Log Message: Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** ProtocolStack.java 3 Sep 2006 10:38:20 -0000 1.47 --- ProtocolStack.java 3 Sep 2006 19:34:31 -0000 1.48 *************** *** 1899,1903 **** System.out.println("catch..."); //try { ! System.out.println("never be here..."); LayerInfo TCP_Info = new LayerInfo(getClass().getName()); TCP_Info.setObjectName(getParentNodeName()); --- 1899,1903 ---- System.out.println("catch..."); //try { ! System.out.println("should never be here..."); LayerInfo TCP_Info = new LayerInfo(getClass().getName()); TCP_Info.setObjectName(getParentNodeName()); Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Tcp.java 3 Sep 2006 14:32:08 -0000 1.65 --- Tcp.java 3 Sep 2006 19:34:31 -0000 1.66 *************** *** 325,329 **** private Hashtable PortTable = new Hashtable(); private ProtocolStack mParentStack; ! private int window_size=25; // private int total_received=0; --- 325,329 ---- private Hashtable PortTable = new Hashtable(); private ProtocolStack mParentStack; ! private int window_size=25; // private int total_received=0; *************** *** 537,541 **** ListenPort(application,localPort); } catch (Exception e) { ! } --- 537,541 ---- ListenPort(application,localPort); } catch (Exception e) { ! Error.Report(e); } *************** *** 1189,1192 **** --- 1189,1193 ---- } else TCPsetTimer(Elm, 5); }catch(NullPointerException e){ + Error.Report(e); //System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 1162 " + e.toString()); } *************** *** 1219,1222 **** --- 1220,1224 ---- }catch(NullPointerException e){ System.out.println("TCP.java: case 2 - 1191 " + e.toString()); + Error.Report(e); } *************** *** 1244,1247 **** --- 1246,1250 ---- }catch(NullPointerException e){ System.out.println("TCP.java: case 2 - 1208 " + e.toString()); + Error.Report(e); } //listener.RecvData(inPacket.getTCP_message()); we do not receive segment because this is a SYN-packet *************** *** 1270,1277 **** } } catch(NullPointerException e){ ! System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 1235 " + e.toString()); } } }catch(NullPointerException e){ System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 6 " + e.toString()); } --- 1273,1281 ---- } } catch(NullPointerException e){ ! System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 1275 " + e.toString()); } } }catch(NullPointerException e){ + Error.Report(e); System.out.println(mParentStack.getHostName() + ":" + "TCP.java: case 2 - 6 " + e.toString()); } *************** *** 1307,1311 **** //init ServerTask TCPsetServerTimer(Elm,inPacket.get_destPort(), 60); ! } else TCPsetTimer(Elm, 50); Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received --- 1311,1315 ---- //init ServerTask TCPsetServerTimer(Elm,inPacket.get_destPort(), 60); ! } else TCPsetTimer(Elm, 50); //??? Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received *************** *** 1443,1447 **** Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received ! AddOutputBuffer(Elm, inPacket); if (inPacket.get_ACK_flag()) { --- 1447,1452 ---- Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received ! AddOutputBuffer(Elm, inPacket); //??????? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !!!!!! ! //F#CKING SH*T!!! It ^ may be not DATA packet. (move to else{} block) if (inPacket.get_ACK_flag()) { *************** *** 1561,1567 **** 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); --- 1566,1573 ---- 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); //wrong sequence???????????? ! //F#CKING SH*T: is it right sequence??? System.out.println(mParentStack.getHostName() + ":" + "I=" + ik); |
From: Alexander B. <da...@us...> - 2006-09-03 14:32:12
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2822/core/protocolsuite/tcp_ip Modified Files: Echo_tcp.java Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Tcp.java 3 Sep 2006 13:49:15 -0000 1.64 --- Tcp.java 3 Sep 2006 14:32:08 -0000 1.65 *************** *** 1518,1530 **** TCP_Info.setDescription(s); ! Simulation.addLayerInfo(TCP_Info); if (!(mParentStack.sendTCPSegment(listener,msg,flags,ack_num))) { Elm.SentACKs.remove(inPacket.get_sequence_number()); ! } ! // if (Elm.received_segments>2) // listener.RecvData(inPacket.getTCP_message()); PassUpstairs(listener, Elm); } --- 1518,1539 ---- TCP_Info.setDescription(s); ! Simulation.addLayerInfo(TCP_Info); ! ! System.out.println("1"); ! Simulation.addLayerInfo(new LayerInfo(getClass().getName(), mParentStack.getParentNodeName(), "TCP Protocol", "Transport", "1")); if (!(mParentStack.sendTCPSegment(listener,msg,flags,ack_num))) { + Simulation.addLayerInfo(new LayerInfo(getClass().getName(), mParentStack.getParentNodeName(), "TCP Protocol", "Transport", "2")); Elm.SentACKs.remove(inPacket.get_sequence_number()); ! Simulation.addLayerInfo(new LayerInfo(getClass().getName(), mParentStack.getParentNodeName(), "TCP Protocol", "Transport", "3")); ! } ! ! System.out.println("4"); ! Simulation.addLayerInfo(new LayerInfo(getClass().getName(), mParentStack.getParentNodeName(), "TCP Protocol", "Transport", "4")); // if (Elm.received_segments>2) // listener.RecvData(inPacket.getTCP_message()); PassUpstairs(listener, Elm); + System.out.println("5"); + Simulation.addLayerInfo(new LayerInfo(getClass().getName(), mParentStack.getParentNodeName(), "TCP Protocol", "Transport", "5")); } Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Echo_tcp.java 3 Sep 2006 14:00:58 -0000 1.27 --- Echo_tcp.java 3 Sep 2006 14:32:08 -0000 1.28 *************** *** 183,188 **** protInfo.setDescription("Recieving echo message '" + Data + "' from server."); Simulation.addLayerInfo(protInfo); ! crecv++; ! System.out.println("***************************************************" + Data + ":" + crecv); /* LayerInfo protInfo = new LayerInfo(getClass().getName()); --- 183,188 ---- protInfo.setDescription("Recieving echo message '" + Data + "' from server."); Simulation.addLayerInfo(protInfo); ! protInfo = null; ! /* LayerInfo protInfo = new LayerInfo(getClass().getName()); *************** *** 210,214 **** protInfo3.setLayer("Application "); protInfo3.setDescription("Sending echo message '" + Data + "' to server..."); ! Simulation.addLayerInfo(protInfo); SendData(Data); --- 210,214 ---- protInfo3.setLayer("Application "); protInfo3.setDescription("Sending echo message '" + Data + "' to server..."); ! Simulation.addLayerInfo(protInfo3); SendData(Data); *************** *** 258,263 **** mParentStack.FreeTCPApplication(this); ! crecv = 0; ! this.counts = counts; --- 258,262 ---- mParentStack.FreeTCPApplication(this); ! this.counts = counts; |
From: Alexander B. <da...@us...> - 2006-09-03 14:32:12
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2822/core Modified Files: Error.java FalseRandom.java LayerInfo.java Log Message: Index: FalseRandom.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/FalseRandom.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FalseRandom.java 3 Sep 2006 13:56:54 -0000 1.9 --- FalseRandom.java 3 Sep 2006 14:32:08 -0000 1.10 *************** *** 10,16 **** //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1}; if(count >= sequence.length) count = 0; --- 10,16 ---- //int sequence[] = {1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! int sequence[] = {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; ! //int sequence[] = {1}; if(count >= sequence.length) count = 0; Index: LayerInfo.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/LayerInfo.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LayerInfo.java 20 Nov 2005 20:30:53 -0000 1.2 --- LayerInfo.java 3 Sep 2006 14:32:08 -0000 1.3 *************** *** 92,95 **** --- 92,103 ---- } + public LayerInfo(String objectType, String objectName, String dataType, String layer, String description) { + this.objectType = objectType; + this.objectName = objectName; + this.layer = layer; + this.description = description; + this.dataType = dataType; + } + /** * Sets the objectType attribute of the LayerInfo Index: Error.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Error.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Error.java 2 Sep 2006 09:13:49 -0000 1.1 --- Error.java 3 Sep 2006 14:32:08 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- import java.io.*; + public class Error{ public static void Report(Exception e){ |
From: Alexander B. <da...@us...> - 2006-09-03 14:01:01
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22792/core/protocolsuite/tcp_ip Modified Files: Echo_tcp.java Log Message: Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Echo_tcp.java 3 Sep 2006 13:56:54 -0000 1.26 --- Echo_tcp.java 3 Sep 2006 14:00:58 -0000 1.27 *************** *** 173,178 **** */ public void RecvData(String Data) throws LowLinkException, TransportLayerException { - crecv++; - System.out.println(Data + ":" + crecv); //processing the protocol doings. if(appType == 0){ --- 173,176 ---- *************** *** 185,188 **** --- 183,188 ---- protInfo.setDescription("Recieving echo message '" + Data + "' from server."); Simulation.addLayerInfo(protInfo); + crecv++; + System.out.println("***************************************************" + Data + ":" + crecv); /* LayerInfo protInfo = new LayerInfo(getClass().getName()); |