javanetsim-cvs Mailing List for javaNetSim (Page 30)
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...> - 2005-12-08 19:04:33
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30654 Modified Files: README.txt Log Message: Transport counters + minor ARP counters fix. Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 8 Nov 2005 20:58:14 -0000 1.2 --- README.txt 8 Dec 2005 19:04:23 -0000 1.3 *************** *** 16,22 **** 1. If you do not have the Java Runtime Environment (JRE) installed on your Operating System, the program will not be ! able to run. You must install the Java Runtime Environment 1.4.2 or later. This can be downloaded from www.java.com ! If you are installing this from a CD-ROM a copy, the Java Runtime Environment for Windows is included. ! --- 16,21 ---- 1. If you do not have the Java Runtime Environment (JRE) installed on your Operating System, the program will not be ! able to run. You must install the Java Runtime Environment 1.5.0_04 or later. This can be downloaded from www.java.com ! *************** *** 67,71 **** ***** Release Version V 0.22 5th November 2005 ***** ! Project got new maintainer and new name! The fork calls jNetSim (Java Network Simulator). Fixed --- 66,70 ---- ***** Release Version V 0.22 5th November 2005 ***** ! Project got new maintainer and new name! The fork calls javaNetSim (Java Network Simulator). Fixed |
From: Alexander B. <da...@us...> - 2005-12-08 19:04:32
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30654/guiUI Modified Files: MainScreen.java Log Message: Transport counters + minor ARP counters fix. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MainScreen.java 8 Dec 2005 18:44:59 -0000 1.23 --- MainScreen.java 8 Dec 2005 19:04:24 -0000 1.24 *************** *** 3145,3149 **** String msg = "Counters: \n\n Recieved IP Packets: " + Integer.valueOf(inIPCount).toString() + "\n Sent IP Packets: " + Integer.valueOf(outIPCount).toString() + ! "\n ARP Packets: " + Integer.valueOf(ARPCount).toString(); JOptionPane.showMessageDialog(this,msg,inNodeName + ": packet counters.",JOptionPane.INFORMATION_MESSAGE); --- 3145,3153 ---- String msg = "Counters: \n\n Recieved IP Packets: " + Integer.valueOf(inIPCount).toString() + "\n Sent IP Packets: " + Integer.valueOf(outIPCount).toString() + ! "\n ARP Packets: " + Integer.valueOf(ARPCount).toString() + ! "\n Recieved TCP segments: " + Integer.valueOf(PS.getTCPinputCount()).toString() + ! "\n Sent TCP segments: " + Integer.valueOf(PS.getTCPoutputCount()).toString() + ! "\n Recieved UDP segments: " + Integer.valueOf(PS.getUDPinputCount()).toString() + ! "\n Sent UDP segments: " + Integer.valueOf(PS.getUDPoutputCount()).toString(); JOptionPane.showMessageDialog(this,msg,inNodeName + ": packet counters.",JOptionPane.INFORMATION_MESSAGE); |
From: Alexander B. <da...@us...> - 2005-12-08 18:45:07
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26437 Modified Files: windows.bat Log Message: minor bug fixed Index: windows.bat =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/windows.bat,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** windows.bat 8 Nov 2005 04:04:22 -0000 1.1.1.1 --- windows.bat 8 Dec 2005 18:44:58 -0000 1.2 *************** *** 1 **** --- 1,2 ---- + rem Java > 1.5 java -jar jNetSim.jar |
From: Alexander B. <da...@us...> - 2005-12-08 18:45:07
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26437/guiUI Modified Files: MainScreen.java Log Message: minor bug fixed Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MainScreen.java 8 Dec 2005 18:07:39 -0000 1.22 --- MainScreen.java 8 Dec 2005 18:44:59 -0000 1.23 *************** *** 2106,2110 **** } ! /* try{ Route_entry r; --- 2106,2110 ---- } ! try{ Route_entry r; *************** *** 2118,2127 **** r = new Route_entry(rts[0], rts[1], rts[2], rts[4], Integer.valueOf(rts[3]).intValue()); ! System.out.println(rts[4]); Sim.addRoute(strNodeName, r); } }catch(Exception e){ ! }*/ } --- 2118,2127 ---- r = new Route_entry(rts[0], rts[1], rts[2], rts[4], Integer.valueOf(rts[3]).intValue()); ! //System.out.println(rts[4]); Sim.addRoute(strNodeName, r); } }catch(Exception e){ ! } } |
From: Alexander B. <da...@us...> - 2005-12-08 18:07:50
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13963/core Modified Files: EthernetLink.java Hub.java Simulation.java Log Message: Hub bug FIX, new save file format, route tables s/l and more... Index: EthernetLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetLink.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EthernetLink.java 20 Nov 2005 20:30:53 -0000 1.3 --- EthernetLink.java 8 Dec 2005 18:07:39 -0000 1.4 *************** *** 59,62 **** --- 59,71 ---- inSecondNodeInterface.setConnectedLink(this); } + + public EthernetLink(String inName, NetworkInterface inFirstNodeInterface, NetworkInterface inSecondNodeInterface, double sieveCoeff)throws InvalidLinkConnectionException { + super(inName); + NetworkInterfaces.add(inFirstNodeInterface); + NetworkInterfaces.add(inSecondNodeInterface); + inFirstNodeInterface.setConnectedLink(this); + inSecondNodeInterface.setConnectedLink(this); + this.setSC(sieveCoeff); + } /** Index: Hub.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Hub.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Hub.java 20 Nov 2005 20:30:53 -0000 1.2 --- Hub.java 8 Dec 2005 18:07:39 -0000 1.3 *************** *** 100,109 **** } ! }catch(Throwable th) ! { sz=1; throw new LowLinkException("Hub buffer overflow (packet loop flood?)."); ! } ! } } } --- 100,114 ---- } ! ! }catch(Throwable th) ! { ! if(th.toString().contains("Packet lost due to physical link problems!")){ ! throw new LowLinkException(th.toString()); ! }else{ sz=1; throw new LowLinkException("Hub buffer overflow (packet loop flood?)."); ! } ! } ! } } } Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Simulation.java 8 Dec 2005 16:45:08 -0000 1.7 --- Simulation.java 8 Dec 2005 18:07:39 -0000 1.8 *************** *** 607,611 **** * @version v0.20 **/ ! public void addEthernetLink(String inLinkName,String inFirstNodeName,String inFirstNodeInterface,String inSecondNodeName,String inSecondNodeInterface) throws InvalidLinkNameException, InvalidLinkConnectionException, InvalidNetworkInterfaceNameException, InvalidNodeNameException { --- 607,611 ---- * @version v0.20 **/ ! public void addEthernetLink(String inLinkName,String inFirstNodeName,String inFirstNodeInterface,String inSecondNodeName,String inSecondNodeInterface, String sieveCoeff) throws InvalidLinkNameException, InvalidLinkConnectionException, InvalidNetworkInterfaceNameException, InvalidNodeNameException { *************** *** 622,626 **** //Create link and add it to hashtable ! linkTable.put(inLinkName,new EthernetLink(inLinkName, interface1, interface2)); }else{ throw new InvalidNodeNameException("Invalid node name"); --- 622,626 ---- //Create link and add it to hashtable ! linkTable.put(inLinkName,new EthernetLink(inLinkName, interface1, interface2, Double.valueOf(sieveCoeff).doubleValue())); }else{ throw new InvalidNodeNameException("Invalid node name"); *************** *** 630,633 **** --- 630,656 ---- } + public void addEthernetLink(String inLinkName,String inFirstNodeName,String inFirstNodeInterface,String inSecondNodeName,String inSecondNodeInterface) + throws InvalidLinkNameException, InvalidLinkConnectionException, InvalidNetworkInterfaceNameException, InvalidNodeNameException { + + if (!linkTable.containsKey(inLinkName)) { + + //test if node's exist within hashtable + if(nodeTable.containsKey(inFirstNodeName) && nodeTable.containsKey(inSecondNodeName)){ + Node tempNode1 = (Node) nodeTable.get(inFirstNodeName); + Node tempNode2 = (Node) nodeTable.get(inSecondNodeName); + + //Return NetworkInterface from Node objects + NetworkInterface interface1 = tempNode1.getNetworkInterface(inFirstNodeInterface); + NetworkInterface interface2 = tempNode2.getNetworkInterface(inSecondNodeInterface); + + //Create link and add it to hashtable + linkTable.put(inLinkName,new EthernetLink(inLinkName, interface1, interface2)); + }else{ + throw new InvalidNodeNameException("Invalid node name"); + } + } else + throw new InvalidLinkNameException("Link already exists with same name."); + } + /** * This method checks to see if the hash Table (nodeTable) is empty. If not |
From: Alexander B. <da...@us...> - 2005-12-08 18:07:50
|
Update of /cvsroot/javanetsim/javaNetSim/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13963/tests Modified Files: lab1_v1.jfst lab1_v1_ready.jfst rtest.jfst tes10.jfst test1.jfst test2.jfst test3.jfst test4.jfst test5.jfst test6.jfst test7.jfst test8.jfst Log Message: Hub bug FIX, new save file format, route tables s/l and more... Index: lab1_v1.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/lab1_v1.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lab1_v1.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- lab1_v1.jfst 8 Dec 2005 18:07:39 -0000 1.2 *************** *** 8,29 **** eth3|null||| eth4|null||| r3 GuiRouter 430,212 2 ! eth0|Hub1-TO-r3|129.64.128.3|255.255.128.0|null ! eth1|r3-TO-pc4|null|0.0.0.0|null R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2 ! eth1|R2-TO-PC2|129.64.127.253|255.255.0.0|192.168.100.2 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|129.64.128.7|255.255.0.0|192.168.100.1 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1 Hub1 GuiHub --- 8,35 ---- eth3|null||| eth4|null||| + 0 r3 GuiRouter 430,212 2 ! eth0|Hub1-TO-r3|129.64.128.3|255.255.128.0|null|18:41:30:AA:22:22|100.0 ! eth1|r3-TO-pc4|null|0.0.0.0|null|5F:C0:1F:3A:3B:5A|100.0 ! 0 R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2|46:44:79:9E:56:A7|100.0 ! eth1|R2-TO-PC2|129.64.127.253|255.255.0.0|192.168.100.2|84:B2:83:5D:B8:76|100.0 ! 1 ! default|192.168.100.2|255.255.255.0|0|eth0 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|129.64.128.7|255.255.0.0|192.168.100.1|80:77:28:96:83:96|100.0 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1|39:12:B9:93:44:35|100.0 ! 1 ! default|192.168.100.1|255.255.255.0|0|eth0 Hub1 GuiHub *************** *** 35,58 **** eth3|Hub1-TO-hub3||| eth4|Hub1-TO-r3||| pc4 GuiPC 612,213 1 ! eth0|r3-TO-pc4|null|0.0.0.0|null PC3 GuiPC 385,355 1 ! eth0|hub3-TO-PC3|129.64.128.2|255.255.0.0|null PC2 GuiPC 628,31 1 ! eth0|R2-TO-PC2|128.64.127.254|255.255.0.0|10.0.0.1 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|129.64.128.1|255.255.0.0|129.64.128.7 hub3 GuiHub --- 41,71 ---- eth3|Hub1-TO-hub3||| eth4|Hub1-TO-r3||| + 0 pc4 GuiPC 612,213 1 ! eth0|r3-TO-pc4|null|0.0.0.0|null|9F:AB:BF:15:26:45|100.0 ! 0 PC3 GuiPC 385,355 1 ! eth0|hub3-TO-PC3|129.64.128.2|255.255.0.0|null|B2:9B:26:29:15:88|100.0 ! 0 PC2 GuiPC 628,31 1 ! eth0|R2-TO-PC2|128.64.127.254|255.255.0.0|10.0.0.1|3B:B5:19:3F:40:35|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|129.64.128.1|255.255.0.0|129.64.128.7|1D:AF:88:57:B4:54|100.0 ! 1 ! default|129.64.128.7|255.255.0.0|0|eth0 hub3 GuiHub *************** *** 64,65 **** --- 77,79 ---- eth3|null||| eth4|null||| + 0 Index: test8.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test8.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test8.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test8.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 3,52 **** 351,154 2 ! eth0|Hub1-TO-Router1|192.168.0.1|255.255.255.0|192.168.0.1 ! eth1|Router1-TO-Hub2|10.0.0.1|255.0.0.0|192.168.0.1 Hub2 GuiHub 450,200 ! 4 eth0|Router1-TO-Hub2||| eth1|Hub2-TO-PC4||| eth2|Hub2-TO-PC5||| eth3|Hub2-TO-PC6||| Hub1 GuiHub 250,200 ! 4 eth0|PC1-TO-Hub1||| eth1|PC2-TO-Hub1||| eth2|PC3-TO-Hub1||| eth3|Hub1-TO-Router1||| PC6 GuiPC 600,300 1 ! eth0|Hub2-TO-PC6|10.0.0.4|255.0.0.0|10.0.0.1 PC5 GuiPC 600,200 1 ! eth0|Hub2-TO-PC5|10.0.0.3|255.0.0.0|10.0.0.1 PC4 GuiPC 444,47 1 ! eth0|Hub2-TO-PC4|10.0.0.2|255.0.0.0|10.0.0.1 PC3 GuiPC 100,300 1 ! eth0|PC3-TO-Hub1|192.168.0.4|255.255.255.0|192.168.0.1 PC2 GuiPC 100,200 1 ! eth0|PC2-TO-Hub1|192.168.0.3|255.255.255.0|192.168.0.1 PC1 GuiPC 100,100 1 ! eth0|PC1-TO-Hub1|192.168.0.2|255.255.255.0|192.168.0.1 --- 3,70 ---- 351,154 2 ! eth0|Hub1-TO-Router1|192.168.0.1|255.255.255.0|192.168.0.1|5E:9D:95:13:7D:AD|100.0 ! eth1|Router1-TO-Hub2|10.0.0.1|255.0.0.0|192.168.0.1|C0:1C:94:1E:B0:2B|100.0 ! 1 ! default|192.168.0.1|255.255.255.0|0|eth0 Hub2 GuiHub 450,200 ! 5 eth0|Router1-TO-Hub2||| eth1|Hub2-TO-PC4||| eth2|Hub2-TO-PC5||| eth3|Hub2-TO-PC6||| + eth4|null||| + 0 Hub1 GuiHub 250,200 ! 5 eth0|PC1-TO-Hub1||| eth1|PC2-TO-Hub1||| eth2|PC3-TO-Hub1||| eth3|Hub1-TO-Router1||| + eth4|null||| + 0 PC6 GuiPC 600,300 1 ! eth0|Hub2-TO-PC6|10.0.0.4|255.0.0.0|10.0.0.1|5C:6B:42:4C:8C:3F|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC5 GuiPC 600,200 1 ! eth0|Hub2-TO-PC5|10.0.0.3|255.0.0.0|10.0.0.1|B7:7C:B0:63:78:26|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC4 GuiPC 444,47 1 ! eth0|Hub2-TO-PC4|10.0.0.2|255.0.0.0|10.0.0.1|41:29:54:5A:4B:48|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC3 GuiPC 100,300 1 ! eth0|PC3-TO-Hub1|192.168.0.4|255.255.255.0|192.168.0.1|90:57:89:19:46:55|100.0 ! 1 ! default|192.168.0.1|255.255.255.0|0|eth0 PC2 GuiPC 100,200 1 ! eth0|PC2-TO-Hub1|192.168.0.3|255.255.255.0|192.168.0.1|4F:91:9B:36:9C:B1|100.0 ! 1 ! default|192.168.0.1|255.255.255.0|0|eth0 PC1 GuiPC 100,100 1 ! eth0|PC1-TO-Hub1|192.168.0.2|255.255.255.0|192.168.0.1|18:30:53:48:1A:7B|100.0 ! 1 ! default|192.168.0.1|255.255.255.0|0|eth0 Index: test2.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test2.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test2.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test2.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 1,30 **** - Hub1 - GuiHub - 228,191 - 4 - eth0|PC1-TO-Hub1||| - eth1|Hub1-TO-R1||| - eth2|null||| - eth3|null||| R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2 ! eth1|R2-TO-PC2|10.0.0.1|255.0.0.0|192.168.100.2 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|172.168.0.1|255.254.0.0|192.168.100.1 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1 PC2 GuiPC 623,198 1 ! eth0|R2-TO-PC2|10.0.0.2|255.0.0.0|10.0.0.1 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|172.168.0.2|255.254.0.0|172.168.0.1 --- 1,40 ---- R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2|61:3A:34:AA:25:16|100.0 ! eth1|R2-TO-PC2|10.0.0.1|255.0.0.0|192.168.100.2|A2:2A:55:20:75:42|100.0 ! 1 ! default|192.168.100.2|255.255.255.0|0|eth0 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|172.168.0.1|255.254.0.0|192.168.100.1|21:B6:1B:AF:27:8E|100.0 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1|AD:7A:C6:B1:57:C6|100.0 ! 1 ! default|192.168.100.1|255.255.255.0|0|eth0 ! Hub1 ! GuiHub ! 228,191 ! 5 ! eth0|PC1-TO-Hub1||| ! eth1|Hub1-TO-R1||| ! eth2|null||| ! eth3|null||| ! eth4|null||| ! 0 PC2 GuiPC 623,198 1 ! eth0|R2-TO-PC2|10.0.0.2|255.0.0.0|10.0.0.1|14:6A:68:89:3F:A8|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|172.168.0.2|255.254.0.0|172.168.0.1|A9:22:B4:C6:BA:51|100.0 ! 1 ! default|172.168.0.1|255.255.0.0|0|eth0 Index: test5.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test5.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test5.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test5.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 3,8 **** 357,330 2 ! eth0|Hub1-TO-r3|172.168.0.10|255.255.0.0|172.168.0.10 ! eth1|r3-TO-pc3|192.168.6.1|255.255.255.0|172.168.0.10 Hub1 GuiHub --- 3,10 ---- 357,330 2 ! eth0|Hub1-TO-r3|172.168.0.10|255.255.0.0|172.168.0.10|11:B1:58:38:39:4A|100.0 ! eth1|r3-TO-pc3|192.168.6.1|255.255.255.0|172.168.0.10|95:96:77:9F:5C:2C|100.0 ! 1 ! default|172.168.0.10|255.255.0.0|0|eth0 Hub1 GuiHub *************** *** 14,42 **** eth3|null||| eth4|null||| R2 GuiRouter 544,78 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2 ! eth1|R2-TO-PC2|10.0.0.1|255.0.0.0|192.168.100.2 R1 GuiRouter 362,79 2 ! eth0|Hub1-TO-R1|172.168.0.1|255.254.0.0|192.168.100.1 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1 PC2 GuiPC 623,198 1 ! eth0|R2-TO-PC2|10.0.0.2|255.0.0.0|10.0.0.1 ! pc3 ! GuiPC ! 545,360 1 ! eth0|r3-TO-pc3|192.168.6.2|255.255.255.0|192.168.6.1 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|172.168.0.2|255.254.0.0|172.168.0.1 --- 16,55 ---- eth3|null||| eth4|null||| + 0 R2 GuiRouter 544,78 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2|11:6E:14:1F:41:A1|100.0 ! eth1|R2-TO-PC2|10.0.0.1|255.0.0.0|192.168.100.2|AC:9C:BB:4B:C1:93|100.0 ! 1 ! default|192.168.100.2|255.255.255.0|0|eth0 R1 GuiRouter 362,79 2 ! eth0|Hub1-TO-R1|172.168.0.1|255.254.0.0|192.168.100.1|4B:BC:8E:1E:1B:C6|100.0 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1|52:54:2F:4B:2F:1E|100.0 ! 1 ! default|192.168.100.1|255.255.255.0|0|eth0 PC2 GuiPC 623,198 1 ! eth0|R2-TO-PC2|10.0.0.2|255.0.0.0|10.0.0.1|A4:BF:81:4A:46:7F|100.0 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|172.168.0.2|255.254.0.0|172.168.0.1|40:69:1F:6B:75:66|100.0 ! 1 ! default|172.168.0.1|255.255.0.0|0|eth0 ! pc3 ! GuiPC ! 545,360 ! 1 ! eth0|r3-TO-pc3|192.168.6.2|255.255.255.0|192.168.6.1|82:1A:74:17:89:C5|100.0 ! 1 ! default|192.168.6.1|255.255.255.0|0|eth0 Index: rtest.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/rtest.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rtest.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- rtest.jfst 8 Dec 2005 18:07:39 -0000 1.2 *************** *** 1,2 **** --- 1,26 ---- + R3 + GuiRouter + 392,219 + 2 + eth0|Hub1-TO-R3|172.168.0.3|255.254.0.0|10.0.0.3|A9:19:67:54:91:43|100.0 + eth1|R3-TO-Hub2|10.0.0.3|255.0.0.0|10.0.0.3|BD:51:73:39:6A:79|100.0 + 1 + default|10.0.0.3|255.0.0.0|0|eth0 + R2 + GuiRouter + 512,92 + 2 + eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2|2E:93:BE:26:AF:61|100.0 + eth1|R2-TO-Hub2|10.0.0.1|255.0.0.0|192.168.100.2|76:4E:1B:85:11:2B|100.0 + 1 + default|192.168.100.2|255.255.255.0|0|eth0 + R1 + GuiRouter + 363,69 + 2 + eth0|Hub1-TO-R1|172.168.0.1|255.254.0.0|192.168.100.1|16:94:5A:59:24:6C|100.0 + eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1|7C:6C:62:7E:1F:1E|100.0 + 1 + default|192.168.100.1|255.255.255.0|0|eth0 Hub2 GuiHub *************** *** 8,11 **** --- 32,36 ---- eth3|null||| eth4|null||| + 0 Hub1 GuiHub *************** *** 17,46 **** eth3|null||| eth4|null||| ! R3 ! GuiRouter ! 392,219 ! 2 ! eth0|Hub1-TO-R3|172.168.0.3|255.254.0.0|10.0.0.3 ! eth1|R3-TO-Hub2|10.0.0.3|255.0.0.0|10.0.0.3 ! R2 ! GuiRouter ! 512,92 ! 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2 ! eth1|R2-TO-Hub2|10.0.0.1|255.0.0.0|192.168.100.2 ! R1 ! GuiRouter ! 363,69 ! 2 ! eth0|Hub1-TO-R1|172.168.0.1|255.254.0.0|192.168.100.1 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1 PC2 GuiPC 657,157 1 ! eth0|PC2-TO-Hub2|10.0.0.2|255.0.0.0|10.0.0.1 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|172.168.0.2|255.254.0.0|172.168.0.1 --- 42,58 ---- eth3|null||| eth4|null||| ! 0 PC2 GuiPC 657,157 1 ! eth0|PC2-TO-Hub2|10.0.0.2|255.0.0.0|10.0.0.1|69:43:55:B8:77:9F|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|172.168.0.2|255.254.0.0|172.168.0.1|7D:3A:8D:2E:11:3F|100.0 ! 1 ! default|172.168.0.1|255.255.0.0|0|eth0 Index: tes10.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/tes10.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tes10.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- tes10.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 1,17 **** MyPC GuiPC 120,95 1 ! eth0|MyPC-TO-D-Link|10.0.0.12|255.255.255.240|10.0.0.1 ! MyPcNb ! GuiPC ! 117,285 1 ! eth0|MyPcNb-TO-D-Link|10.0.0.10|255.255.255.240|null Server GuiPC 546,125 1 ! eth0|D-Link-TO-Server|10.0.0.1|255.255.255.240|null D-Link GuiHub --- 1,21 ---- + MyPcNb + GuiPC + 117,285 + 1 + eth0|MyPcNb-TO-D-Link|10.0.0.10|255.255.255.240|null|B2:96:9E:24:16:49|100.0 + 0 MyPC GuiPC 120,95 1 ! eth0|MyPC-TO-D-Link|10.0.0.12|255.255.255.240|10.0.0.1|4B:32:7F:A1:31:90|100.0 1 ! default|10.0.0.1|255.0.0.0|0|eth0 Server GuiPC 546,125 1 ! eth0|D-Link-TO-Server|10.0.0.1|255.255.255.240|null|8C:46:3C:9B:3C:31|100.0 ! 0 D-Link GuiHub *************** *** 23,24 **** --- 27,29 ---- eth3|null||| eth4|null||| + 0 Index: test1.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test1.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test1.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test1.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 3,10 **** 447,157 1 ! eth0|pc1-TO-pc2|192.168.0.2|255.255.255.0|null pc1 GuiPC 156,126 1 ! eth0|pc1-TO-pc2|192.168.0.1|255.255.255.0|null --- 3,12 ---- 447,157 1 ! eth0|pc1-TO-pc2|192.168.0.2|255.255.255.0|null|3E:82:32:A8:19:6B|100.0 ! 0 pc1 GuiPC 156,126 1 ! eth0|pc1-TO-pc2|192.168.0.1|255.255.255.0|null|5B:B3:8F:55:27:34|100.0 ! 0 Index: lab1_v1_ready.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/lab1_v1_ready.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lab1_v1_ready.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- lab1_v1_ready.jfst 8 Dec 2005 18:07:39 -0000 1.2 *************** *** 3,20 **** 430,212 2 ! eth0|Hub1-TO-r3|129.64.128.3|255.255.128.0|null ! eth1|r3-TO-pc4|null|0.0.0.0|null R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2 ! eth1|R2-TO-PC2|129.64.127.253|255.255.128.0|192.168.100.2 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|129.64.128.7|255.255.128.0|192.168.100.1 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1 Hub1 GuiHub --- 3,25 ---- 430,212 2 ! eth0|Hub1-TO-r3|129.64.128.3|255.255.128.0|null|44:43:A8:64:53:30|100.0 ! eth1|r3-TO-pc4|null|0.0.0.0|null|8E:8C:24:C4:29:47|100.0 ! 0 R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2|B0:3B:82:82:28:89|100.0 ! eth1|R2-TO-PC2|129.64.127.253|255.255.128.0|192.168.100.2|8C:60:7F:83:A2:26|100.0 ! 1 ! default|192.168.100.2|255.255.255.0|0|eth0 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|129.64.128.7|255.255.128.0|192.168.100.1|BB:20:14:3F:AF:33|100.0 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1|63:91:64:3A:AC:15|100.0 ! 1 ! default|192.168.100.1|255.255.255.0|0|eth0 Hub1 GuiHub *************** *** 26,49 **** eth3|Hub1-TO-hub3||| eth4|Hub1-TO-r3||| pc4 GuiPC 612,213 1 ! eth0|r3-TO-pc4|null|0.0.0.0|null PC3 GuiPC 385,355 1 ! eth0|hub3-TO-PC3|129.64.128.2|255.255.128.0|null PC2 GuiPC 628,31 1 ! eth0|R2-TO-PC2|129.64.127.254|255.255.128.0|129.64.127.253 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|129.64.128.1|255.255.128.0|129.64.128.7 hub3 GuiHub --- 31,61 ---- eth3|Hub1-TO-hub3||| eth4|Hub1-TO-r3||| + 0 pc4 GuiPC 612,213 1 ! eth0|r3-TO-pc4|null|0.0.0.0|null|C6:BA:C7:3D:45:32|100.0 ! 0 PC3 GuiPC 385,355 1 ! eth0|hub3-TO-PC3|129.64.128.2|255.255.128.0|null|2F:79:94:70:C1:6E|100.0 ! 0 PC2 GuiPC 628,31 1 ! eth0|R2-TO-PC2|129.64.127.254|255.255.128.0|129.64.127.253|44:2D:8D:93:2A:5D|100.0 ! 1 ! default|129.64.127.253|255.255.0.0|0|eth0 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|129.64.128.1|255.255.128.0|129.64.128.7|7D:6F:17:A3:25:2A|100.0 ! 1 ! default|129.64.128.7|255.255.0.0|0|eth0 hub3 GuiHub *************** *** 55,56 **** --- 67,69 ---- eth3|null||| eth4|null||| + 0 Index: test6.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test6.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test6.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test6.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 3,5 **** 117,101 1 ! eth0|null|null|0.0.0.0|0.0.0.0 --- 3,7 ---- 117,101 1 ! eth0|null|null|0.0.0.0|0.0.0.0|31:C1:86:9A:38:7D|100.00 ! 1 ! default|0.0.0.0|null|0|eth0 Index: test7.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test7.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test7.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test7.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 8,29 **** eth3|null||| eth4|null||| r3 GuiRouter 430,212 2 ! eth0|Hub1-TO-r3|129.64.128.3|255.255.128.0|null ! eth1|r3-TO-pc4|null|0.0.0.0|null R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2 ! eth1|R2-TO-PC2|10.0.0.1|255.0.0.0|192.168.100.2 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|129.64.128.7|255.255.0.0|192.168.100.1 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1 Hub1 GuiHub --- 8,35 ---- eth3|null||| eth4|null||| + 0 r3 GuiRouter 430,212 2 ! eth0|Hub1-TO-r3|129.64.128.3|255.255.128.0|null|AD:57:87:8A:A5:82|100.0 ! eth1|r3-TO-pc4|null|0.0.0.0|null|B6:26:47:12:18:7E|100.0 ! 0 R2 GuiRouter 512,92 2 ! eth0|R1-TO-R2|192.168.100.1|255.255.255.0|192.168.100.2|B0:9C:68:42:3D:C4|100.0 ! eth1|R2-TO-PC2|10.0.0.1|255.0.0.0|192.168.100.2|70:2F:90:24:86:78|100.0 ! 1 ! default|192.168.100.2|255.255.255.0|0|eth0 R1 GuiRouter 363,69 2 ! eth0|Hub1-TO-R1|129.64.128.7|255.255.0.0|192.168.100.1|A1:58:35:7C:1D:BB|100.0 ! eth1|R1-TO-R2|192.168.100.2|255.255.255.0|192.168.100.1|68:85:80:68:82:32|100.0 ! 1 ! default|192.168.100.1|255.255.255.0|0|eth0 Hub1 GuiHub *************** *** 35,58 **** eth3|Hub1-TO-hub3||| eth4|Hub1-TO-r3||| pc4 GuiPC 612,213 1 ! eth0|r3-TO-pc4|null|0.0.0.0|null PC3 GuiPC 385,355 1 ! eth0|hub3-TO-PC3|129.64.128.2|255.255.128.0|null PC2 GuiPC 628,31 1 ! eth0|R2-TO-PC2|10.0.0.2|255.0.0.0|10.0.0.1 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|129.64.128.1|255.255.128.0|129.64.128.7 hub3 GuiHub --- 41,71 ---- eth3|Hub1-TO-hub3||| eth4|Hub1-TO-r3||| + 0 pc4 GuiPC 612,213 1 ! eth0|r3-TO-pc4|null|0.0.0.0|null|5F:41:3A:56:C5:8C|100.0 ! 0 PC3 GuiPC 385,355 1 ! eth0|hub3-TO-PC3|129.64.128.2|255.255.128.0|null|49:BD:9B:21:8E:30|100.0 ! 0 PC2 GuiPC 628,31 1 ! eth0|R2-TO-PC2|10.0.0.2|255.0.0.0|10.0.0.1|B9:20:7C:4A:C7:65|100.0 ! 1 ! default|10.0.0.1|255.0.0.0|0|eth0 PC1 GuiPC 97,178 1 ! eth0|PC1-TO-Hub1|129.64.128.1|255.255.128.0|129.64.128.7|4B:4D:5B:30:B2:35|100.0 ! 1 ! default|129.64.128.7|255.255.0.0|0|eth0 hub3 GuiHub *************** *** 64,65 **** --- 77,79 ---- eth3|null||| eth4|null||| + 0 Index: test3.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test3.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test3.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test3.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 1,2 **** --- 1,18 ---- + R2 + GuiRouter + 472,264 + 2 + eth0|Hub1-TO-R2|10.0.0.2|255.0.0.0|192.168.1.2|3A:5D:74:AB:5A:74|100.0 + eth1|R2-TO-Hub2|192.168.1.2|255.255.255.0|192.168.1.2|69:41:99:5E:BC:A5|100.0 + 1 + default|192.168.1.2|255.255.255.0|0|eth0 + R1 + GuiRouter + 464,80 + 2 + eth0|Hub1-TO-R1|10.0.0.1|255.0.0.0|192.168.1.1|B9:7C:93:2B:7D:42|100.0 + eth1|R1-TO-Hub2|192.168.1.1|255.255.255.0|192.168.1.1|BE:83:7E:A1:37:48|100.0 + 1 + default|192.168.1.1|255.255.255.0|0|eth0 Hub2 GuiHub *************** *** 8,11 **** --- 24,28 ---- eth3|null||| eth4|null||| + 0 Hub1 GuiHub *************** *** 17,40 **** eth3|null||| eth4|null||| ! R2 ! GuiRouter ! 472,264 ! 2 ! eth0|Hub1-TO-R2|10.0.0.2|255.0.0.0|192.168.1.2 ! eth1|R2-TO-Hub2|192.168.1.2|255.255.255.0|192.168.1.2 ! R1 ! GuiRouter ! 464,80 ! 2 ! eth0|Hub1-TO-R1|10.0.0.1|255.0.0.0|192.168.1.1 ! eth1|R1-TO-Hub2|192.168.1.1|255.255.255.0|192.168.1.1 PC1 GuiPC 151,212 1 ! eth0|PC1-TO-Hub1|10.0.0.3|255.0.0.0|10.0.0.1 ! pc2 ! GuiPC ! 793,190 1 ! eth0|Hub2-TO-pc2|192.168.1.3|255.255.255.0|192.168.1.2 --- 34,50 ---- eth3|null||| eth4|null||| ! 0 ! pc2 ! GuiPC ! 793,190 ! 1 ! eth0|Hub2-TO-pc2|192.168.1.3|255.255.255.0|192.168.1.2|49:57:52:AC:45:5C|100.0 ! 1 ! default|192.168.1.2|255.255.255.0|0|eth0 PC1 GuiPC 151,212 1 ! eth0|PC1-TO-Hub1|10.0.0.3|255.0.0.0|10.0.0.1|13:AE:8F:A3:BF:2E|100.0 1 ! default|10.0.0.1|255.0.0.0|0|eth0 Index: test4.jfst =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/tests/test4.jfst,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test4.jfst 1 Dec 2005 14:59:10 -0000 1.1 --- test4.jfst 8 Dec 2005 18:07:40 -0000 1.2 *************** *** 3,16 **** 457,179 2 ! eth0|pc1-TO-r1|129.64.127.254|255.255.128.0|129.64.128.1 ! eth1|r1-TO-pc2|129.64.128.1|255.255.128.0|129.64.128.1 pc2 GuiPC 309,23 1 ! eth0|r1-TO-pc2|129.64.128.2|255.255.128.0|129.64.128.1 pc1 GuiPC 192,197 1 ! eth0|pc1-TO-r1|129.64.127.253|255.255.128.0|129.64.127.254 --- 3,22 ---- 457,179 2 ! eth0|pc1-TO-r1|129.64.127.254|255.255.128.0|129.64.128.1|2C:5D:4E:5B:4A:42|100.0 ! eth1|r1-TO-pc2|129.64.128.1|255.255.128.0|129.64.128.1|24:69:23:3C:16:5F|100.0 ! 1 ! default|129.64.128.1|255.255.0.0|0|eth0 pc2 GuiPC 309,23 1 ! eth0|r1-TO-pc2|129.64.128.2|255.255.128.0|129.64.128.1|29:62:24:66:A9:4D|100.0 ! 1 ! default|129.64.128.1|255.255.0.0|0|eth0 pc1 GuiPC 192,197 1 ! eth0|pc1-TO-r1|129.64.127.253|255.255.128.0|129.64.127.254|7A:5E:A5:C2:A6:3C|100.0 ! 1 ! default|129.64.127.254|255.255.0.0|0|eth0 |
From: Alexander B. <da...@us...> - 2005-12-08 18:07:48
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13963/guiUI Modified Files: MainScreen.java Log Message: Hub bug FIX, new save file format, route tables s/l and more... Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MainScreen.java 8 Dec 2005 16:45:10 -0000 1.21 --- MainScreen.java 8 Dec 2005 18:07:39 -0000 1.22 *************** *** 827,833 **** String strSecondNodeInterface = dlgLink.getSecondSelectedInterface(); ! Sim.addEthernetLink(strLinkName,inNode1, strFirstNodeInterface, ! ! inNode2, strSecondNodeInterface); GuiNode tempFirstNode = (GuiNode)GUInodeTable.get(inNode1); --- 827,831 ---- String strSecondNodeInterface = dlgLink.getSecondSelectedInterface(); ! Sim.addEthernetLink(strLinkName,inNode1, strFirstNodeInterface, inNode2, strSecondNodeInterface); GuiNode tempFirstNode = (GuiNode)GUInodeTable.get(inNode1); *************** *** 1699,1703 **** GuiNode tempNode = (GuiNode)GUInodeTable.get(key); ! try{ --- 1697,1701 ---- GuiNode tempNode = (GuiNode)GUInodeTable.get(key); ! String lnk; try{ *************** *** 1739,1747 **** if(tempNode instanceof NetworkLayerDevice){ strSave = strSave + "|" + Sim.getIpAddressForInterface(key,nics[i].toString()) ! + "|" + Sim.getSubnetMask(key,nics[i].toString()) ! + "|" + Sim.getDefaultGateway(key) + "|" + Sim.getMacAddressForInterface(key, nics[i].toString()); }else{ --- 1737,1755 ---- if(tempNode instanceof NetworkLayerDevice){ + String lP = "100.00"; + + try{ + lnk = Sim.getLinkName(key, nics[i].toString()); + lP = Double.valueOf(Sim.GetLinkProb(lnk)).toString(); + }catch(Exception e){} + + strSave = strSave + "|" + Sim.getIpAddressForInterface(key,nics[i].toString()) ! + "|" + Sim.getSubnetMask(key,nics[i].toString()) ! + "|" + Sim.getDefaultGateway(key) + "|" + Sim.getMacAddressForInterface(key, nics[i].toString()) ! ! + "|" + lP; }else{ *************** *** 1756,1759 **** --- 1764,1786 ---- } + + + try{ + String routes[] = Sim.getRouteTableEntries(key); + strSave = strSave + (routes.length-1) + "\n"; + + Route_entry r; + + for(int i=0; i<routes.length-1; i++){ + + r = Sim.getRouteEntry(key, routes[i]); + + strSave = strSave + routes[i] + "|" + r.gateway + "|" + r.genMask + "|" + r.Type + "|" + r.iFace + "\n"; + + } + + }catch(Exception e){ + strSave = strSave + "0\n"; + } } catch (Exception e) { //This should never happen *************** *** 2019,2023 **** } ! for(j = 1; j<=intCount; j++){ --- 2046,2051 ---- } ! ! String sieve = "100.00"; for(j = 1; j<=intCount; j++){ *************** *** 2039,2044 **** --- 2067,2077 ---- } + + try{ Sim.setMACAddress(strNodeName,iface[0], iface[5]); + + sieve = iface[6]; + }catch(Exception e){ } *************** *** 2055,2059 **** if(((String)links.get(strLinkName)) == null){ ! links.put(strLinkName, strNodeName + "|" + iface[0]); --- 2088,2092 ---- if(((String)links.get(strLinkName)) == null){ ! links.put(strLinkName, strNodeName + "|" + iface[0] + "|" + sieve); *************** *** 2063,2067 **** String ln[] = ((String) links.get(strLinkName)).split("\\|"); ! Sim.addEthernetLink(strLinkName, ln[0], ln[1], strNodeName, iface[0]); this.createLink(strLinkName, ln[0], strNodeName); --- 2096,2100 ---- String ln[] = ((String) links.get(strLinkName)).split("\\|"); ! Sim.addEthernetLink(strLinkName, ln[0], ln[1], strNodeName, iface[0], ln[2]); this.createLink(strLinkName, ln[0], strNodeName); *************** *** 2073,2077 **** } ! } --- 2106,2127 ---- } ! /* ! try{ ! Route_entry r; ! ! line = input.readLine(); ! ! ! for(int i=0; i<Integer.valueOf(line).intValue(); i++){ ! String rs = input.readLine(); ! String rts[] = rs.split("\\|"); ! ! r = new Route_entry(rts[0], rts[1], rts[2], rts[4], Integer.valueOf(rts[3]).intValue()); ! System.out.println(rts[4]); ! Sim.addRoute(strNodeName, r); ! } ! }catch(Exception e){ ! ! }*/ } |
From: Alexander B. <da...@us...> - 2005-12-08 18:07:46
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13963 Modified Files: TODO.txt Log Message: Hub bug FIX, new save file format, route tables s/l and more... Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TODO.txt 8 Dec 2005 16:45:07 -0000 1.18 --- TODO.txt 8 Dec 2005 18:07:38 -0000 1.19 *************** *** 15,23 **** 2. Create _normal_ route table edit form (instead of route command). Use as template EditRoutesDialog.java. Note, that "route" command is only for ugly testing purposes! ! 3. Routing tables save/load. ! 4. Dirty Lines SAVE/LOAD!!!!! ! 5. App setting SAVE/LOAD!!!! 6. App level in S/L. ! 7. Fix LinkProperties Dialog: safe using (check for correct input values). *** Simulation Related --- 15,21 ---- 2. Create _normal_ route table edit form (instead of route command). Use as template EditRoutesDialog.java. Note, that "route" command is only for ugly testing purposes! ! 5. App setting SAVE/LOAD! 6. App level in S/L. ! 7. Fix LinkProperties Dialog: safe using (check for correct input values) (!!!, Gift!). *** Simulation Related *************** *** 27,35 **** Packet from the upper layer (UDP). The Routing table needs to be checked and a decision made as to which interface to send the data to. - 10. The deleteNode() and deleteLink() methods need to be tested. The deleteNode() definitely needs changing, see - the Simulation.java source file for more details. 12. 2Fedor: OSPF. - 13. FDDI (Key && Gift(?)) (??) - 14. Switches (?) 15. UDP (Gift) pretty done --- 25,29 ---- *************** *** 38,42 **** 17. SNMP (QweR, Key, Gift) 18. Telnet (QweR) ! *** Command Line Interface (CLI) Related --- 32,36 ---- 17. SNMP (QweR, Key, Gift) 18. Telnet (QweR) ! 19. Echo Protocol Editing. *** Command Line Interface (CLI) Related |
From: Alexander B. <da...@us...> - 2005-12-08 16:45:48
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24020 Modified Files: TODO.txt Log Message: MAC Addr. S/L Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TODO.txt 4 Dec 2005 22:15:34 -0000 1.17 --- TODO.txt 8 Dec 2005 16:45:07 -0000 1.18 *************** *** 13,17 **** *** GUI Related - 1. Need to save MACs. 2. Create _normal_ route table edit form (instead of route command). Use as template EditRoutesDialog.java. Note, that "route" command is only for ugly testing purposes! --- 13,16 ---- |
From: Alexander B. <da...@us...> - 2005-12-08 16:45:24
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24020/core/protocolsuite/tcp_ip Modified Files: ProtocolStack.java SNMP.java Log Message: MAC Addr. S/L Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ProtocolStack.java 4 Dec 2005 22:14:21 -0000 1.32 --- ProtocolStack.java 8 Dec 2005 16:45:10 -0000 1.33 *************** *** 1689,1692 **** --- 1689,1693 ---- return -1; } else + return rval; Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SNMP.java 4 Dec 2005 23:10:54 -0000 1.4 --- SNMP.java 8 Dec 2005 16:45:10 -0000 1.5 *************** *** 214,220 **** * @version v0.01 */ ! protected static String CreateSNMPVars(Vector<String> r) { ! } /** --- 214,220 ---- * @version v0.01 */ ! //protected static String CreateSNMPVars(Vector<String> r) { ! //} /** *************** *** 224,230 **** * @version v0.01 */ ! protected static String CreateSNMPVarsValue(Vector<String> r,Vector<String> v) { ! } /** --- 224,230 ---- * @version v0.01 */ ! //protected static String CreateSNMPVarsValue(Vector<String> r,Vector<String> v) { ! //} /** |
From: Alexander B. <da...@us...> - 2005-12-08 16:45:24
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24020/guiUI Modified Files: MainScreen.java Log Message: MAC Addr. S/L Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MainScreen.java 4 Dec 2005 20:37:18 -0000 1.20 --- MainScreen.java 8 Dec 2005 16:45:10 -0000 1.21 *************** *** 1743,1747 **** + "|" + Sim.getSubnetMask(key,nics[i].toString()) ! + "|" + Sim.getDefaultGateway(key); }else{ --- 1743,1747 ---- + "|" + Sim.getSubnetMask(key,nics[i].toString()) ! + "|" + Sim.getDefaultGateway(key) + "|" + Sim.getMacAddressForInterface(key, nics[i].toString()); }else{ *************** *** 2039,2042 **** --- 2039,2046 ---- } + try{ + Sim.setMACAddress(strNodeName,iface[0], iface[5]); + }catch(Exception e){ } + if(!iface[4].contains("null")) Sim.setDefaultGateway(strNodeName, iface[4]); |
From: Alexander B. <da...@us...> - 2005-12-08 16:45:24
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24020/core Modified Files: EthernetNetworkInterface.java NetworkLayerDevice.java Simulation.java Log Message: MAC Addr. S/L Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkLayerDevice.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NetworkLayerDevice.java 20 Nov 2005 20:30:53 -0000 1.5 --- NetworkLayerDevice.java 8 Dec 2005 16:45:08 -0000 1.6 *************** *** 220,223 **** --- 220,242 ---- } + /** + * This method will set the mac address for a network interface. + * @param inInterface - The Interface name eg: eth0 + * @param macAddress - The MAC address on the Interface card was set. + * @throws InvalidNetworkInterfaceNameException + */ + + protected void setMACAddress(String inInterface, String inMACAddress) throws InvalidNetworkInterfaceNameException { + if (NetworkInterfacetable.containsKey(inInterface)) { + EthernetNetworkInterface tempNic = + (EthernetNetworkInterface) NetworkInterfacetable.get( + inInterface); + tempNic.setMacAddress(inMACAddress); + + } else { + throw new InvalidNetworkInterfaceNameException("Interface does not exist"); + } + } + /** * This method will call the protocol stacks' add to ARP method Index: EthernetNetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetNetworkInterface.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EthernetNetworkInterface.java 20 Nov 2005 20:30:53 -0000 1.4 --- EthernetNetworkInterface.java 8 Dec 2005 16:45:08 -0000 1.5 *************** *** 197,200 **** --- 197,206 ---- } + protected final void setMacAddress(String macAddress){ + this.MACAddress = macAddress; + } + + + /** * This method displays details about the current interface card Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Simulation.java 3 Dec 2005 12:20:52 -0000 1.6 --- Simulation.java 8 Dec 2005 16:45:08 -0000 1.7 *************** *** 202,205 **** --- 202,228 ---- } + /** + * This method is called from the GUI. Checks to see if inNodeName is an instance of networkLayerDevice, + * if so, move up to the NetworkLayerDevice and then returns the mac address of the interface passed in. Else it will throw exceptions. + * @author key + * @param inNodeName - The Name of the Node eg: pc1 + * @param inInterface - The Interface Name eg: eth0 + * @return MAC ADDRESS + * @throws InvalidNetworkLayerDeviceException + * @throws InvalidNodeNameException + * @version v0.20 + **/ + public String getMacAddressForInterface(String inNodeName, String inInterface) throws InvalidNetworkInterfaceNameException, InvalidNodeNameException, InvalidNetworkLayerDeviceException { + if(nodeTable.containsKey(inNodeName)){ + Node temp = (Node)nodeTable.get(inNodeName); + if (temp instanceof NetworkLayerDevice){ + NetworkLayerDevice tempNode = (NetworkLayerDevice)nodeTable.get(inNodeName); + return tempNode.getMACAddress(inInterface); + } + throw new InvalidNetworkLayerDeviceException("This node is not a network layered device."); + } + throw new InvalidNodeNameException("Node does not exist."); + } + /** * This method is called from TEXTUI or GUI. If inNodeName is an instance of node pass it up to the *************** *** 417,420 **** --- 440,475 ---- } } + + /** + * This method will set the MAC Address of a Node interface. + * This method needs to test if the inNodeName is valid. + * Please note that static can still be implemented but we are currently using + * Dynamic ARP. + * @author luke_hamilton + * @author bevan_calliess + * @param inNodeName - The Name of the Node eg: pc1 + * @param inNodeInterface - The Interface name eg: eth0 + * @param inMACAddress - The MAC address + * @throws InvalidNetworkLayerDeviceException + * @throws InvalidNodeNameException + * @version v0.20 + **/ + public void setMACAddress(String inNodeName, String inNodeInterface, String inMACAddress) throws InvalidNodeNameException, InvalidNetworkInterfaceNameException, InvalidNetworkLayerDeviceException{ + + if(nodeTable.containsKey(inNodeName)){ + Node temp = (Node)nodeTable.get(inNodeName); + if (temp instanceof NetworkLayerDevice){ //test if device is a network layer device + NetworkLayerDevice t = (NetworkLayerDevice)temp; + t.setMACAddress(inNodeInterface,inMACAddress); + //updateARP(inIPAddress, macAddress, inNodeName); + //t.addToARP(inIPAddress, macAddress); + }else{ + throw new InvalidNetworkLayerDeviceException("This device is not a network layered device"); + } + }else{ + throw new InvalidNodeNameException("Node does not exist"); + } + } + /** * This method will loop through the node hash table, checking whether its |
From: gift <gi...@us...> - 2005-12-07 13:25:01
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24529/core/protocolsuite/tcp_ip Modified Files: Tcp.java Udp.java Log Message: Counters implementation Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Tcp.java 5 Dec 2005 15:56:20 -0000 1.26 --- Tcp.java 7 Dec 2005 13:24:51 -0000 1.27 *************** *** 117,132 **** public class TCP_HashTableElement { ! public byte PortStatus; // 0 - free port; 1 - port is being listened to; 2 - busy. ! public Object application; //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; //contains port number of the other connected computer | provided PortStatus==2 /*statistic block*/ ! public int received_segments; //counter inc when a segment is received ! public int sent_segments; //counter inc when a segment is sent ! public int sent_ACK; //counter inc when an ACK is sent ! public int received_duplicates;//counter inc when a duplicate of a received segment is received again ! public int sent_duplicates; //counter inc when a duplicate of a segment is resent /*end of statistic block*/ ! public int seq_number; /*database*/ --- 117,132 ---- 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; /*database*/ *************** *** 161,173 **** /*end of database*/ ! public boolean isFIN_sent; ! public boolean isFIN_confirmed; ! public boolean isPassive; /** * 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error */ ! public byte ApplicationStatus; ! public boolean isServer; public Timer timer=null; //our timer for this connection --- 161,173 ---- /*end of database*/ ! public boolean isFIN_sent=false; ! public boolean isFIN_confirmed=false; ! public boolean isPassive=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 *************** *** 175,178 **** --- 175,201 ---- 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() { *************** *** 198,202 **** this.Servertimer = null; } ! this.PortStatus=0; this.application=null; --- 221,225 ---- this.Servertimer = null; } ! this.PortStatus=0; this.application=null; *************** *** 273,278 **** private ProtocolStack mParentStack; private int window_size=10; ! private int total_received=0; ! private int total_sent=0; private static final int PORT_QUANT=100; private static final int PORT_START_NUMBER=3000; --- 296,310 ---- private ProtocolStack mParentStack; private int window_size=10; ! // private int total_received=0; ! // private int total_sent=0; ! ! /*statistic block*/ ! private int received_segments=0; //counter inc when a segment is received ! private int sent_segments=0; //counter inc when a segment is sent ! private int sent_ACK=0; //counter inc when an ACK is sent ! private int received_duplicates=0;//counter inc when a duplicate of a received segment is received again ! private int sent_duplicates=0; //counter inc when a duplicate of a segment is resent ! /*end of statistic block*/ ! private static final int PORT_QUANT=100; private static final int PORT_START_NUMBER=3000; *************** *** 311,321 **** */ public void TCPsetTimer(TCP_HashTableElement Elm) ! { ! ! if(Elm.timer==null){ System.out.println("Timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME),50,TCP_TIME); } --- 343,351 ---- */ public void TCPsetTimer(TCP_HashTableElement Elm) ! { if(Elm.timer==null){ System.out.println("Timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME,this),50,TCP_TIME); } *************** *** 328,336 **** private TCP_HashTableElement Elm; private long repTime; ! public TCPTask (TCP_HashTableElement inElm, long time) { this.Elm=inElm; this.repTime=time; } --- 358,368 ---- private TCP_HashTableElement Elm; private long repTime; + private Tcp TCPptr; ! public TCPTask (TCP_HashTableElement inElm, long time, Tcp inTCP) { this.Elm=inElm; this.repTime=time; + this.TCPptr=inTCP; } *************** *** 381,385 **** TCP_Info.setDescription("Connection timeout! Closing connection to host: "+ Elm.connectedtoIP + ":" + Elm.connectedtoPort+"."); Simulation.addLayerInfo(TCP_Info); ! Elm.reset(); } --- 413,417 ---- TCP_Info.setDescription("Connection timeout! Closing connection to host: "+ Elm.connectedtoIP + ":" + Elm.connectedtoPort+"."); Simulation.addLayerInfo(TCP_Info); ! Elm.addstats(TCPptr); Elm.reset(); } *************** *** 410,414 **** */ public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort) ! { System.out.println("Server Timer IN!"); if(Elm.Servertimer==null) --- 442,446 ---- */ public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort) ! { System.out.println("Server Timer IN!"); if(Elm.Servertimer==null) *************** *** 416,420 **** System.out.println("Server Timer init!"); Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME),50,TCP_TIME); } --- 448,452 ---- System.out.println("Server Timer init!"); Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME,this),50,TCP_TIME); } *************** *** 429,434 **** private long repTime; private Object application; ! public TCPServerTask (TCP_HashTableElement inElm, int inlocalPort, long time) { this.Elm=inElm; --- 461,467 ---- private long repTime; private Object application; + private Tcp TCPptr; ! public TCPServerTask (TCP_HashTableElement inElm, int inlocalPort, long time, Tcp inTCP) { this.Elm=inElm; *************** *** 436,439 **** --- 469,473 ---- this.repTime=time; this.application=inElm.application; + this.TCPptr=inTCP; } *************** *** 450,453 **** --- 484,488 ---- { System.out.println("SERVER TIMEtoLIVE - OUT - awaiting connection timeout!"); + Elm.addstats(TCPptr); Elm.reset(); try{ *************** *** 625,628 **** --- 660,664 ---- { System.out.println("!!!"); + Elm.addstats(this); Elm.reset(); } else throw new TransportLayerException("TCP Error: port "+ PortToClose +" is not being LISTENED to by the application: \"" + application.toString() + "\"."); *************** *** 646,649 **** --- 682,686 ---- Elm=(TCP_HashTableElement) PortTable.get((Integer)PortToFree); System.out.println("###"); + Elm.addstats(this); Elm.reset(); System.out.println("111"); *************** *** 909,913 **** Elm.seq_number++; //inc for next segment if (!(flags[4] && a_num==0)) Elm.sent_ACK++; //inc in case this is an ACK-segment (each segment except for 1-st SYN is ACK-segment) ! this.total_sent++; //overall stats //pushing a copy into Hashtable --- 946,950 ---- Elm.seq_number++; //inc for next segment if (!(flags[4] && a_num==0)) Elm.sent_ACK++; //inc in case this is an ACK-segment (each segment except for 1-st SYN is ACK-segment) ! //this.total_sent++; //overall stats //pushing a copy into Hashtable *************** *** 977,981 **** // test if this packet is for a local Address. if(mParentStack.isInternalIP(inPacket.getDestIPAddress())){ ! this.total_received++; //overall stats // test if destination TCP port exists on this NeworkLayerDevice --- 1014,1018 ---- // test if this packet is for a local Address. if(mParentStack.isInternalIP(inPacket.getDestIPAddress())){ ! // this.total_received++; //overall stats // test if destination TCP port exists on this NeworkLayerDevice *************** *** 1348,1352 **** default: //TCP Error: unknown port status :( ! //have to disconnect listener from port throw new TransportLayerPortException("TCP Error: unknown port status! Port "+inPacket.get_destPort() +" on host \""+ mParentStack.getParentNodeName()+"\"."); } --- 1385,1389 ---- default: //TCP Error: unknown port status :( ! //have to disconnect listener from port throw new TransportLayerPortException("TCP Error: unknown port status! Port "+inPacket.get_destPort() +" on host \""+ mParentStack.getParentNodeName()+"\"."); } *************** *** 1410,1415 **** --- 1447,1624 ---- } + /*STATISTIC PART */ + + /** + * This method increments received segments counter + * @author gift (sourceforge.net user) + * @param numb the number to add + * @return Nothing + * @version v0.20 + */ + public void IncReceivedSegmentsNumber(int numb) + { + + received_segments+=numb; + } + + + /** + * This method increments sent segments counter + * @author gift (sourceforge.net user) + * @param numb the number to add + * @return Nothing + * @version v0.20 + */ + public void IncSentSegmentsNumber(int numb) + { + sent_segments+=numb; + } + + /** + * This method returns the number of received segments + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of received segments + * @version v0.20 + */ + public int GetReceivedSegmentsNumber() + { + return received_segments; + } + + /** + * This method returns the number of sent segments + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of sent segments + * @version v0.20 + */ + public int GetSentSegmentsNumber() + { + return sent_segments; + } + + + /** + * This method increments sent ACK segments counter + * @author gift (sourceforge.net user) + * @param numb the number to add + * @return Nothing + * @version v0.20 + */ + public void IncSentACKSegmentsNumber(int numb) + { + sent_ACK+=numb; + } + + + /** + * This method returns the number of sent ACK segments + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of sent ACK segments + * @version v0.20 + */ + public int GetSentACKSegmentsNumber() + { + return sent_ACK; + } + + /** + * This method increments received duplicates counter + * @author gift (sourceforge.net user) + * @param numb the number to add + * @return Nothing + * @version v0.20 + */ + public void IncReceivedDuplicatesNumber(int numb) + { + received_duplicates+=numb; + } + + + /** + * This method returns the number of received duplicates + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of received duplicates + * @version v0.20 + */ + public int GetReceivedDuplicatesNumber() + { + return received_duplicates; + } + + + /** + * This method increments sent duplicates counter + * @author gift (sourceforge.net user) + * @param numb the number to add + * @return Nothing + * @version v0.20 + */ + public void IncSentDuplicatesNumber(int numb) + { + sent_duplicates+=numb; + } + + + /** + * This method returns the number of sent duplicates + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of sent duplicates + * @version v0.20 + */ + public int GetSentDuplicatesNumber() + { + return sent_duplicates; + } + + + /** + * This method resets TCP "receipt" counters + * @author gift (sourceforge.net user) + * @param Unused. + * @return Nothing. + * @version v0.20 + */ + public void ResetReceiptCounters() + { + received_duplicates=0; + received_segments=0; + } + + + /** + * This method resets TCP "" counters + * @author gift (sourceforge.net user) + * @param Unused. + * @return Nothing. + * @version v0.20 + */ + public void ResetSendingCounters() + { + sent_duplicates=0; + sent_ACK=0; + sent_segments=0; + } + + /** + * This method resets TCP counters + * @author gift (sourceforge.net user) + * @param Unused. + * @return Nothing. + * @version v0.20 + */ + public void ResetCounters() + { + ResetSendingCounters(); + ResetReceiptCounters(); + } + + } //EOF Index: Udp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Udp.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Udp.java 26 Nov 2005 18:20:57 -0000 1.30 --- Udp.java 7 Dec 2005 13:24:51 -0000 1.31 *************** *** 127,138 **** public class UDP_HashTableElement { ! public byte PortStatus; // 0 - free port; 1 - port is being listened to; 2 - busy. ! public Object application; //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; //contains port number of the other connected computer | provided PortStatus==2 } private Hashtable PortTable = new Hashtable(); ! private ProtocolStack mParentStack; private static final int PORT_QUANT=100; private static final int PORT_START_NUMBER=3000; --- 127,144 ---- public class UDP_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 } private Hashtable PortTable = new Hashtable(); ! private ProtocolStack mParentStack; ! ! /*statistic block*/ ! private int received_datagramms=0; //counter inc when a datagramm is received ! private int sent_datagramm=0; //counter inc when a datagramm is sent ! /*end of statistic block*/ ! private static final int PORT_QUANT=100; private static final int PORT_START_NUMBER=3000; *************** *** 208,213 **** Elm.connectedtoIP=inPacket.getSourceIPAddress(); Elm.connectedtoPort=inPacket.get_srcPort(); //Create Layer info - LayerInfo UDP_Info = new LayerInfo(getClass().getName()); --- 214,221 ---- Elm.connectedtoIP=inPacket.getSourceIPAddress(); Elm.connectedtoPort=inPacket.get_srcPort(); + + IncReceivedDatagrammsNumber(); + //Create Layer info LayerInfo UDP_Info = new LayerInfo(getClass().getName()); *************** *** 297,301 **** UDP_Info.setDescription("Created UDP packet for " + inDestIPAddress + ":" + indestPort +"."); Simulation.addLayerInfo(UDP_Info); ! return tosend; --- 305,310 ---- UDP_Info.setDescription("Created UDP packet for " + inDestIPAddress + ":" + indestPort +"."); Simulation.addLayerInfo(UDP_Info); ! ! IncSentDatagrammsNumber(); return tosend; *************** *** 673,677 **** --- 682,750 ---- return (number); //do not change here! if you want to change here scan again the code } + + /*STATISTIC PART */ + + /** + * This method increments received datagramms counter + * @author gift (sourceforge.net user) + * @param Unused + * @return Nothing + * @version v0.20 + */ + + public void IncReceivedDatagrammsNumber() + { + received_datagramms++; + } + + + /** + * This method increments sent datagramms counter + * @author gift (sourceforge.net user) + * @param Unused + * @return Nothing + * @version v0.20 + */ + public void IncSentDatagrammsNumber() + { + sent_datagramm++; + } + + /** + * This method returns the number of received datagramms + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of received datagramms + * @version v0.20 + */ + public int GetReceivedDatagrammsNumber() + { + return received_datagramms; + } + + /** + * This method returns the number of sent datagramms + * @author gift (sourceforge.net user) + * @param Unused. + * @return int the number of sent datagramms + * @version v0.20 + */ + public int GetSentDatagrammsNumber() + { + return sent_datagramm; + } + /** + * This method resets UDP counters + * @author gift (sourceforge.net user) + * @param Unused. + * @return Nothing. + * @version v0.20 + */ + public void ResetCounters() + { + sent_datagramm=0; + received_datagramms=0; + } } //EOF |
From: gift <gi...@us...> - 2005-12-05 15:56:28
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5317/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Please love and grant... TCP v0.9 !!! Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Tcp.java 4 Dec 2005 22:14:21 -0000 1.25 --- Tcp.java 5 Dec 2005 15:56:20 -0000 1.26 *************** *** 95,99 **** * @author gift (sourceforge.net user) * @since 25 Nov 2005 ! * @version v0.10 */ --- 95,99 ---- * @author gift (sourceforge.net user) * @since 25 Nov 2005 ! * @version v0.9 released 05 Dec 2005 */ *************** *** 163,167 **** public boolean isFIN_sent; public boolean isFIN_confirmed; ! public boolean isPassive; /** * 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error --- 163,167 ---- public boolean isFIN_sent; public boolean isFIN_confirmed; ! public boolean isPassive; /** * 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error *************** *** 169,174 **** --- 169,178 ---- public byte ApplicationStatus; + public boolean isServer; + public Timer timer=null; //our timer for this connection + public Timer Servertimer=null; + public void reset() { *************** *** 184,187 **** --- 188,202 ---- } + if (Servertimer!=null){ + System.out.println("Elm.reset: Servertimer cancel - part 1!"); + try{ + this.Servertimer.cancel(); + }catch(Exception e){ + System.out.println("Elm.reset: Servertimer cancel error."); + } + System.out.println("Elm.reset: Servertimer cancel - part 2!"); + this.Servertimer = null; + } + this.PortStatus=0; this.application=null; *************** *** 250,253 **** --- 265,269 ---- this.isPassive=false; this.ApplicationStatus=0; //no status + this.isServer=false; } *************** *** 383,386 **** --- 399,473 ---- } } + + + + /** + * This method defines TCP Server timer + * @author gift (sourceforge.net user) + * @param Elm TCP_HashTableElement + * @param inlocalPort int local port number + * @version v0.10 + */ + public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort) + { + System.out.println("Server Timer IN!"); + if(Elm.Servertimer==null) + { + System.out.println("Server Timer init!"); + Elm.Servertimer=new Timer(); + Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME),50,TCP_TIME); + } + + } + + + public class TCPServerTask extends TimerTask + { + private int numRepeat=8; + private int localPort; + private TCP_HashTableElement Elm; + private long repTime; + private Object application; + + public TCPServerTask (TCP_HashTableElement inElm, int inlocalPort, long time) + { + this.Elm=inElm; + this.localPort=inlocalPort; + this.repTime=time; + this.application=inElm.application; + } + + + /** + * This methos implements TCP server timer algorithm + * @author gift (sourceforge.net user) + * @version v0.10 + */ + public void run() + { + numRepeat--; + if (numRepeat==0) + { + System.out.println("SERVER TIMEtoLIVE - OUT - awaiting connection timeout!"); + Elm.reset(); + try{ + ListenPort(application,localPort); + } catch (Exception e) + { + + } + + //Create Layer info + LayerInfo TCP_Info = new LayerInfo(getClass().getName()); + TCP_Info.setObjectName(mParentStack.getParentNodeName()); + TCP_Info.setDataType("TCP Protocol"); + TCP_Info.setLayer("Transport"); + TCP_Info.setDescription("Server awaiting connection timeout! Now server is listening to port: " + localPort + "."); + Simulation.addLayerInfo(TCP_Info); + + System.out.println("SERVER reorganized!"); + } + } + } /** *************** *** 620,623 **** --- 707,711 ---- //0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error Elm.ApplicationStatus=1; //not used over here + Elm.isServer=true; break; case 1: // port is being listened to by whom? *************** *** 641,653 **** { //create such a record in hashtable ! TCP_HashTableElement newElm = new TCP_HashTableElement(); ! newElm.PortStatus=1; ! newElm.application=application; ! newElm.connectedtoIP=""; ! newElm.connectedtoPort=0; ! ! PortTable.put(new Integer (inPort),newElm); //hash table update } ! } else // { throw new TransportLayerException("error: can not listen to port "+ inPort +"! Use port range from 0 to 10000 to listen to."); --- 729,741 ---- { //create such a record in hashtable ! TCP_HashTableElement newElm = new TCP_HashTableElement(); ! newElm.PortStatus=1; ! newElm.application=application; ! newElm.connectedtoIP=""; ! newElm.connectedtoPort=0; ! newElm.isServer=true; ! PortTable.put(new Integer (inPort),newElm); //hash table update } ! } else { throw new TransportLayerException("error: can not listen to port "+ inPort +"! Use port range from 0 to 10000 to listen to."); *************** *** 966,970 **** if (inPacket.get_SYN_flag()) { ! //we have received an answer for our SYN-segment //a little test if (!(inPacket.get_ACK_flag())) throw new TransportLayerPortException("TCP Error: No ACK flag in answer for SYN packet is set in the segment!"); --- 1054,1065 ---- if (inPacket.get_SYN_flag()) { ! ! if (Elm.isServer) ! { ! //init ServerTask ! TCPsetServerTimer(Elm,inPacket.get_destPort()); ! } ! ! //we have received an answer for our SYN-segment //a little test if (!(inPacket.get_ACK_flag())) throw new TransportLayerPortException("TCP Error: No ACK flag in answer for SYN packet is set in the segment!"); |
From: QweR <qw...@us...> - 2005-12-04 23:11:03
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5085/core/protocolsuite/tcp_ip Modified Files: SNMP.java Log Message: Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SNMP.java 4 Dec 2005 00:47:55 -0000 1.3 --- SNMP.java 4 Dec 2005 23:10:54 -0000 1.4 *************** *** 48,55 **** public class SNMP extends Application{ ! protected static int SNMPID = 0; public SNMP(ProtocolStack inParentStack, int listenPort, int appType, int UID) { super(inParentStack, listenPort, appType, UID); } /** --- 48,66 ---- public class SNMP extends Application{ ! private static int SNMPID = 0; ! private static Vector<SNMPInstance> SNMPgroups; public SNMP(ProtocolStack inParentStack, int listenPort, int appType, int UID) { super(inParentStack, listenPort, appType, UID); + //groups and instance required placed in lexicographical order :(MIB) + int i; + SNMPgroups.add(new SNMPInstance("SNMP")); + i=SNMPgroups.size()-1; + SNMPgroups.get(i).add("revision","0"); + SNMPgroups.get(i).add("version","2"); + SNMPgroups.add(new SNMPInstance("test")); + i=SNMPgroups.size()-1; + SNMPgroups.get(i).add("test_1","A"); + SNMPgroups.get(i).add("test_2","1"); } /** *************** *** 121,166 **** } public void GetRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(0,"public",0,getNextID(),0,0,r); SendData(pack); } public void GetNextRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(1,"public",0,getNextID(),0,0,r); SendData(pack); } ! public void SetRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(2,"public",0,getNextID(),0,0,r); SendData(pack); } ! public void GetResponse(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(3,"public",0,getNextID(),0,0,r); SendData(pack); } ! public void Trap(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { } ! protected static String CreateSNMPMessage(int ver,String pass,int type,int id,int er,int erindex,Vector<String> r) { ! String s; ! char c; ! char[] ac=new char[2]; ! int sizepack=0,sizedata=0; ! ac[0]=0xA5; ac[1]=0x82; ! s=String.copyValueOf(ac); - return s; } protected static boolean ParseSNMPMessage(int ver,String pass,int type,int id,int er,int erindex,Vector<String> r) { ! String s; ! s = String.valueOf(ver)+pass+String.valueOf(type)+String.valueOf(id)+String.valueOf(er)+String.valueOf(erindex); return true; } protected static int getNextID() { if(SNMPID>=65535) SNMPID=0; --- 132,248 ---- } + /** + * This method realize Get-request function of SNMPv2. + * @param r vector of String. String as 'group.instance' + * @author QweR + * @version v0.01 + */ public void GetRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPHeader(getNextID(),0); SendData(pack); } + /** + * This method realize Get-next-request function of SNMPv2. + * @param r vector of String. String as 'group.instance' + * @author QweR + * @version v0.01 + */ public void GetNextRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPHeader(getNextID(),1); SendData(pack); } ! /** ! * This method realize Set-request function of SNMPv2. ! * @param r vector of String. String as 'group.instance' ! * @param v vector of String. String as 'value' ! * @author QweR ! * @version v0.01 ! */ ! public void SetRequest(Vector<String> r,Vector<String> v) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPHeader(getNextID(),2); SendData(pack); } ! /** ! * This method realize Get-response function of SNMPv2. ! * @param r vector of String. String as 'group.instance' ! * @param v vector of String. String as 'value' ! * @author QweR ! * @version v0.01 ! */ ! public void GetResponse(Vector<String> r,Vector<String> v) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPHeader(getNextID(),3); SendData(pack); } ! /** ! * This method realize TRAP function of SNMPv2. ! * @param r vector of String. String as 'group.instance' ! * @param v vector of String. String as 'value' ! * @author QweR ! * @version v0.01 ! */ ! public void Trap(Vector<String> r,Vector<String> v) throws LowLinkException, TransportLayerException, CommunicationException { } ! /** ! * This method create a SNMP header for all type packets. ! * @param Data to recv ! * @author QweR ! * @version v0.01 ! */ ! protected static String CreateSNMPHeader(int id,int type) { ! char[] c = new char[8]; ! c[0]=c[1]=0; ! c[2]=2; ! c[3]=2; ! c[4]=0; ! c[5]=(char)(id/256); ! c[6]=(char)(id%256); ! c[7]=(char)type; ! return (String.copyValueOf(c)); ! } ! ! /** ! * This method recieves data from the other side. ! * @param Data to recv ! * @author QweR ! * @version v0.01 ! */ ! protected static String CreateSNMPVars(Vector<String> r) { ! ! } ! ! /** ! * This method recieves data from the other side. ! * @param Data to recv ! * @author QweR ! * @version v0.01 ! */ ! protected static String CreateSNMPVarsValue(Vector<String> r,Vector<String> v) { } + /** + * This method parse incomimg packet and return readable data. + * @param Data to recv + * @author QweR + * @version v0.01 + */ protected static boolean ParseSNMPMessage(int ver,String pass,int type,int id,int er,int erindex,Vector<String> r) { ! return true; } + /** + * This method gets next value of SNMPID modulo 2^16. + * @param Data to recv + * @author QweR + * @version v0.01 + */ protected static int getNextID() { if(SNMPID>=65535) SNMPID=0; *************** *** 168,170 **** --- 250,287 ---- return SNMPID; } + + public static int getGroupID(String n) { + int i; + + for(i=0;i<SNMPgroups.size();i++) { + if(SNMPgroups.get(i).name.compareTo(n)==0) break; + } + if(i>=SNMPgroups.size()) return (-1); + return i; + } + + public class SNMPInstance { + public String name; + public Vector<String> instance = new Vector<String>(0); + public Vector<String> value = new Vector<String>(0); + + public SNMPInstance(String n) { + name=n; + } + + public int getInstanceID(String n) { + int i; + + for(i=0;i<instance.size();i++) { + if(instance.get(i).compareTo(n)==0) break; + } + if(i>=instance.size()) return (-1); + return i; + } + + public void add(String i,String v) { + instance.add(i); + value.add(v); + } + } } |
From: gift <gi...@us...> - 2005-12-04 22:15:47
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26255 Modified Files: TODO.txt Log Message: TODO Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TODO.txt 1 Dec 2005 19:51:53 -0000 1.16 --- TODO.txt 4 Dec 2005 22:15:34 -0000 1.17 *************** *** 36,40 **** pretty done 16. TCP(Gift && Key) ! TCP timer implementation 17. SNMP (QweR, Key, Gift) 18. Telnet (QweR) --- 36,40 ---- pretty done 16. TCP(Gift && Key) ! TCP Server disconnect after timeout 17. SNMP (QweR, Key, Gift) 18. Telnet (QweR) |
From: gift <gi...@us...> - 2005-12-04 22:14:32
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25978/core/protocolsuite/tcp_ip Modified Files: Echo_tcp.java ProtocolStack.java Tcp.java Log Message: TCP server timeout needs correction ;) Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ProtocolStack.java 4 Dec 2005 12:19:30 -0000 1.31 --- ProtocolStack.java 4 Dec 2005 22:14:21 -0000 1.32 *************** *** 73,76 **** --- 73,80 ---- import core.*; + import java.util.Timer; + + import java.util.TimerTask; + *************** *** 1672,1684 **** boolean flags[]={false,false,false,false,true,false}; /* URG, ACK, PSH, RST, !SYN!, FIN */ rval=mTCPprotocol.ReservePort(application, inDestIPAddress, indestPort); ! if (sendTCPSegment(application, msg, flags,ack_num)) { return rval; ! }else{ mTCPprotocol.FreeApplication(application); return -1; } ! } ! /** --- 1676,1699 ---- boolean flags[]={false,false,false,false,true,false}; /* URG, ACK, PSH, RST, !SYN!, FIN */ rval=mTCPprotocol.ReservePort(application, inDestIPAddress, indestPort); + byte code=0; //no status ! if (sendTCPSegment(application, msg, flags,ack_num)) ! { ! do ! { code = mTCPprotocol.getStatus(rval); } ! while (code==1); ! ! if(code==0 || code==3) //0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error ! { ! mTCPprotocol.FreeApplication(application); ! return -1; ! } else return rval; ! ! }else{ mTCPprotocol.FreeApplication(application); return -1; } ! } /** Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Tcp.java 4 Dec 2005 20:37:17 -0000 1.24 --- Tcp.java 4 Dec 2005 22:14:21 -0000 1.25 *************** *** 163,167 **** public boolean isFIN_sent; public boolean isFIN_confirmed; ! public boolean isPassive; public Timer timer=null; //our timer for this connection --- 163,171 ---- public boolean isFIN_sent; public boolean isFIN_confirmed; ! public boolean isPassive; ! /** ! * 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error ! */ ! public byte ApplicationStatus; public Timer timer=null; //our timer for this connection *************** *** 245,248 **** --- 249,253 ---- this.isFIN_confirmed=false; this.isPassive=false; + this.ApplicationStatus=0; //no status } *************** *** 262,266 **** * Used in timer */ ! private static final long TCP_TIME = 100; //msec /** --- 267,271 ---- * Used in timer */ ! private static final long TCP_TIME = 400; //msec /** *************** *** 316,322 **** /** ! * This methos implements TCP timer ! * @author gift (sourceforge.net user) ! * @param Elm TCP_HashTableElement * @version v0.10 */ --- 321,326 ---- /** ! * This methos implements TCP timer algorithm ! * @author gift (sourceforge.net user) * @version v0.10 */ *************** *** 494,497 **** --- 498,522 ---- } + + /** + * This method finds status for an application. + * @author gift (sourceforge.net user) + * @param inSrcPort port number that has been reserved for the applicaion + * @return byte application status 0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error + * @exception TransportLayerException + * @version v0.20 + * @see TransportLayerException + */ + public byte getStatus(int inSrcPort) throws TransportLayerException + { + byte status=0; + TCP_HashTableElement Elm = null; + + Elm=(TCP_HashTableElement)PortTable.get((Integer)inSrcPort); + status=Elm.ApplicationStatus; + + return status; + } + /** * This method closes the TCP port for an application *************** *** 593,596 **** --- 618,623 ---- Elm.connectedtoIP=""; Elm.connectedtoPort=0; + //0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error + Elm.ApplicationStatus=1; //not used over here break; case 1: // port is being listened to by whom? *************** *** 652,656 **** return dIP; ! } --- 679,683 ---- return dIP; ! } *************** *** 803,807 **** Elm.PortStatus=2; Elm.connectedtoIP=inDestIPAddress; ! Elm.connectedtoPort=indestPort; } --- 830,835 ---- Elm.PortStatus=2; Elm.connectedtoIP=inDestIPAddress; ! Elm.connectedtoPort=indestPort; ! Elm.ApplicationStatus=1; //is being connected } *************** *** 875,879 **** case 0: //port is free => Error: no application to receive TCP //have to disconnect listener from port ! throw new TransportLayerPortException("TCP Error: no server application listening to port "+inPacket.get_destPort() +" on host \""+ mParentStack.getParentNodeName()+"\"!"); //no break needed ;) case 1: // port is being listened to by a new application. --- 903,907 ---- case 0: //port is free => Error: no application to receive TCP //have to disconnect listener from port ! throw new TransportLayerPortException("TCP Error: no application listening to port "+inPacket.get_destPort() +" on host \""+ mParentStack.getParentNodeName()+"\"!"); //no break needed ;) case 1: // port is being listened to by a new application. *************** *** 890,894 **** Elm.PortStatus=2; //port will be busy from now Elm.connectedtoIP=inPacket.getSourceIPAddress(); ! Elm.connectedtoPort=inPacket.get_srcPort(); Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received --- 918,925 ---- Elm.PortStatus=2; //port will be busy from now Elm.connectedtoIP=inPacket.getSourceIPAddress(); ! Elm.connectedtoPort=inPacket.get_srcPort(); ! //0 - no status; 1 - is being connected; 2 - is connected; 3 - connection error ! Elm.ApplicationStatus=2; ! Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received *************** *** 949,952 **** --- 980,985 ---- // everything is OK now we decompose TCP datagram + Elm.ApplicationStatus=2; + //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); *************** *** 981,985 **** } else { //we have already received this segment ! Elm.received_duplicates++; //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); --- 1014,1019 ---- } else { //we have already received this segment ! System.out.println("tttttttt"); ! Elm.received_duplicates++; //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); *************** *** 1091,1095 **** } else { //we have already received this segment ! Elm.received_duplicates++; //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); --- 1125,1130 ---- } else { //we have already received this segment ! Elm.received_duplicates++; ! System.out.println("t+++++++++t"); //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); *************** *** 1136,1142 **** String s; if (Elm.received_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() + ". Connection confirmed!"; ! if (our_ack==1 && (Integer)inPacket.get_sequence_number()==1) s=s + " New TCP connection established!"; TCP_Info.setDescription(s); --- 1171,1185 ---- String s; if (Elm.received_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() + ". Connection confirmed!"; ! Elm.ApplicationStatus=2; ! } ! if (our_ack==1 && (Integer)inPacket.get_sequence_number()==1) ! { ! s=s + " New TCP connection established!"; ! Elm.ApplicationStatus=2; ! } TCP_Info.setDescription(s); *************** *** 1186,1190 **** } else { //we have already received this segment ! Elm.received_duplicates++; //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); --- 1229,1234 ---- } else { //we have already received this segment ! Elm.received_duplicates++; ! System.out.println("t------t"); //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Echo_tcp.java 4 Dec 2005 12:19:30 -0000 1.14 --- Echo_tcp.java 4 Dec 2005 22:14:21 -0000 1.15 *************** *** 72,79 **** */ ! public boolean ClientConnect(String Host, int port) throws TransportLayerException, InvalidNetworkLayerDeviceException, CommunicationException, LowLinkException { sdHost = Host; sdPort = port; do { --- 72,87 ---- */ ! public boolean ClientConnect(String Host, int port) throws TransportLayerException, InvalidNetworkLayerDeviceException, CommunicationException, LowLinkException ! { sdHost = Host; sdPort = port; + LayerInfo protInfo2 = new LayerInfo(getClass().getName()); + protInfo2.setObjectName(mParentStack.getParentNodeName()); + protInfo2.setDataType("Echo Protocol Data"); + protInfo2.setLayer("Application "); + protInfo2.setDescription("Connecting to host " + Host + ":"+ port +". Please wait..."); + Simulation.addLayerInfo(protInfo2); + do { |
From: Alexander B. <da...@us...> - 2005-12-04 20:37:30
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6336/guiUI Modified Files: MainScreen.java Log Message: Normal TCP PrintLayerInfo. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** MainScreen.java 4 Dec 2005 16:26:30 -0000 1.19 --- MainScreen.java 4 Dec 2005 20:37:18 -0000 1.20 *************** *** 1023,1027 **** } ! printLayerInfo(); // Ok button was pressed. --- 1023,1027 ---- } ! printLayerInfo(true); // Ok button was pressed. *************** *** 1051,1055 **** ! public void printLayerInfo(){ pnlConsole.append("\n"); --- 1051,1055 ---- ! public void printLayerInfo(boolean header){ pnlConsole.append("\n"); *************** *** 1063,1066 **** --- 1063,1067 ---- }else{ + if(header){ pnlConsole.append("**************************************************************************************************************** \n"); *************** *** 1068,1071 **** --- 1069,1073 ---- pnlConsole.append("**************************************************************************************************************** \n"); + } Iterator it = vecRecordedInfo.iterator(); *************** *** 1082,1087 **** } ! ! pnlConsole.append("****************************************************************************************************************\n"); Sim.clearLayerInfo(); --- 1084,1091 ---- } ! ! if(header){ ! pnlConsole.append("****************************************************************************************************************\n"); ! } Sim.clearLayerInfo(); *************** *** 1091,1096 **** --- 1095,1110 ---- } + public void addFooter(){ + pnlConsole.append("****************************************************************************************************************\n"); + } + + public void addHeader(){ + pnlConsole.append("**************************************************************************************************************** \n"); + pnlConsole.append("The following is a record of the last Transactions movements. \n"); + + pnlConsole.append("**************************************************************************************************************** \n"); + } /** *************** *** 2893,2897 **** echo1.Listen(); ! printLayerInfo(); }catch(Exception e){ --- 2907,2911 ---- echo1.Listen(); ! printLayerInfo(true); }catch(Exception e){ *************** *** 2921,2925 **** echo1.Listen(); ! printLayerInfo(); }catch(Exception e){ --- 2935,2939 ---- echo1.Listen(); ! printLayerInfo(true); }catch(Exception e){ *************** *** 2969,2974 **** } ! ! printLayerInfo(); } --- 2983,2988 ---- } ! ! printLayerInfo(true); } *************** *** 2991,2995 **** public void run() { ! ms.printLayerInfo(); this.cancel(); } --- 3005,3010 ---- public void run() { ! ms.printLayerInfo(false); ! ms.addFooter(); this.cancel(); } *************** *** 3035,3040 **** } ! ! printLayerInfo(); } --- 3050,3055 ---- } ! addHeader(); ! printLayerInfo(false); } |
From: Alexander B. <da...@us...> - 2005-12-04 20:37:30
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6336/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Normal TCP PrintLayerInfo. Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Tcp.java 4 Dec 2005 16:47:26 -0000 1.23 --- Tcp.java 4 Dec 2005 20:37:17 -0000 1.24 *************** *** 986,989 **** --- 986,990 ---- 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 + "."); *************** *** 1095,1098 **** --- 1096,1100 ---- 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 + "."); *************** *** 1189,1193 **** TCP_Info.setObjectName(mParentStack.getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); ! TCP_Info.setLayer("Transport"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); Simulation.addLayerInfo(TCP_Info); --- 1191,1196 ---- 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); |
From: gift <gi...@us...> - 2005-12-04 16:47:34
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23437/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: more and more Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Tcp.java 4 Dec 2005 16:26:30 -0000 1.22 --- Tcp.java 4 Dec 2005 16:47:26 -0000 1.23 *************** *** 262,266 **** * Used in timer */ ! private static final long TCP_TIME = 400; //msec /** --- 262,266 ---- * Used in timer */ ! private static final long TCP_TIME = 100; //msec /** *************** *** 296,300 **** System.out.println("Timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME),TCP_TIME,TCP_TIME); } --- 296,300 ---- System.out.println("Timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME),50,TCP_TIME); } |
From: gift <gi...@us...> - 2005-12-04 16:47:34
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23437/guiUI Modified Files: LinkProperties.java Log Message: more and more Index: LinkProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkProperties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LinkProperties.java 19 Nov 2005 16:55:37 -0000 1.2 --- LinkProperties.java 4 Dec 2005 16:47:26 -0000 1.3 *************** *** 1,361 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. [...1054 lines suppressed...] ! */ ! ! private void selectInterface(){ ! ! Interface = (String)cmbInterface.getSelectedItem(); ! ! try{ ! ! String lnk = Sim.getLinkName(NodeName, Interface); ! ! if(lnk!=null) txtProp.setText(Double.valueOf(Sim.GetLinkProb(lnk)).toString()); ! ! }catch(Exception e){ System.out.println(e.toString()); } ! ! } ! ! ! ! } ! |
From: Alexander B. <da...@us...> - 2005-12-04 16:26:41
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19425/guiUI Modified Files: MainScreen.java Log Message: Timer printLayerInfo(). Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MainScreen.java 3 Dec 2005 19:23:19 -0000 1.18 --- MainScreen.java 4 Dec 2005 16:26:30 -0000 1.19 *************** *** 115,119 **** --- 115,121 ---- import core.protocolsuite.tcp_ip.Route_entry; + import java.util.Timer; + import java.util.TimerTask; import core.protocolsuite.tcp_ip.Echo; *************** *** 1057,1061 **** if(vecRecordedInfo.size()==0){ ! pnlConsole.append("No entries to display. \n"); }else{ --- 1059,1063 ---- if(vecRecordedInfo.size()==0){ ! //pnlConsole.append("No entries to display. \n"); }else{ *************** *** 2973,2976 **** --- 2975,2998 ---- } + + + + public class TTask extends TimerTask + { + private MainScreen ms; + + public TTask (MainScreen ms) + { + this.ms=ms; + + } + + + public void run() + { + ms.printLayerInfo(); + this.cancel(); + } + } /** *************** *** 2999,3002 **** --- 3021,3028 ---- printNetworkStart(); + + Timer timer = null; + timer=new Timer(); + timer.schedule(new TTask(this),4000,4000); ((Echo_tcp)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30017)).SendEcho(msg, ip, Integer.valueOf(port).intValue()); |
From: Alexander B. <da...@us...> - 2005-12-04 16:26:39
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19425/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Timer printLayerInfo(). Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Tcp.java 4 Dec 2005 12:19:30 -0000 1.21 --- Tcp.java 4 Dec 2005 16:26:30 -0000 1.22 *************** *** 344,347 **** --- 344,348 ---- Simulation.addLayerInfo(TCP_Info); + mParentStack.sendPacket((TCP_packet)Elm.SegmentsToResend.get(curkey)); } catch (Exception e) {} |
From: gift <gi...@us...> - 2005-12-04 12:19:41
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5657/core/protocolsuite/tcp_ip Modified Files: Echo_tcp.java ProtocolStack.java Tcp.java Log Message: TCpppppppppppppppppppppppppppizzzzzz(d)aaaa Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ProtocolStack.java 3 Dec 2005 19:23:19 -0000 1.30 --- ProtocolStack.java 4 Dec 2005 12:19:30 -0000 1.31 *************** *** 1672,1675 **** --- 1672,1676 ---- boolean flags[]={false,false,false,false,true,false}; /* URG, ACK, PSH, RST, !SYN!, FIN */ rval=mTCPprotocol.ReservePort(application, inDestIPAddress, indestPort); + if (sendTCPSegment(application, msg, flags,ack_num)) { return rval; Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Tcp.java 3 Dec 2005 19:23:19 -0000 1.20 --- Tcp.java 4 Dec 2005 12:19:30 -0000 1.21 *************** *** 170,180 **** { if (timer!=null){ ! System.out.println("Timer cancel - part1!"); try{ this.timer.cancel(); }catch(Exception e){ ! System.out.println("Timer cancel error."); } ! System.out.println("Timer cancel -part 2!"); this.timer = null; } --- 170,180 ---- { 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."); } ! System.out.println("Elm.reset: Timer cancel - part 2!"); this.timer = null; } *************** *** 259,264 **** private static final int TOTAL_TIME = 10; //seconds to send all data private static final int ACCELER_KOEFF=2; //coeff depends on line quality, in practise >=2 ! private static final double TCP_TIME= 0.1; //sec ! /** * This method assigns the ParentStack --- 259,267 ---- private static final int TOTAL_TIME = 10; //seconds to send all data private static final int ACCELER_KOEFF=2; //coeff depends on line quality, in practise >=2 ! /** ! * Used in timer ! */ ! private static final long TCP_TIME = 400; //msec ! /** * This method assigns the ParentStack *************** *** 289,297 **** { ! if(Elm.timer==null){ System.out.println("Timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm),0,500); } --- 292,300 ---- { ! if(Elm.timer==null){ System.out.println("Timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME),TCP_TIME,TCP_TIME); } *************** *** 301,309 **** public class TCPTask extends TimerTask { private TCP_HashTableElement Elm; ! public TCPTask (TCP_HashTableElement inElm) { this.Elm=inElm; } --- 304,315 ---- public class TCPTask extends TimerTask { + private int numRepeat=8; private TCP_HashTableElement Elm; + private long repTime; ! public TCPTask (TCP_HashTableElement inElm, long time) { this.Elm=inElm; + this.repTime=time; } *************** *** 318,326 **** { // System.out.println("Timer start!"); ! if(!Elm.SegmentsToResend.isEmpty()) { // this.cancel(); // Elm.timer.cancel(); ! Enumeration HTkeys; Integer curkey; HTkeys = Elm.SegmentsToResend.keys(); --- 324,333 ---- { // System.out.println("Timer start!"); ! if(!Elm.SegmentsToResend.isEmpty() && numRepeat>0) { // this.cancel(); // Elm.timer.cancel(); ! numRepeat--; ! Enumeration HTkeys; Integer curkey; HTkeys = Elm.SegmentsToResend.keys(); *************** *** 329,332 **** --- 336,347 ---- curkey= (Integer) HTkeys.nextElement(); try{ + //Create Layer info + LayerInfo TCP_Info = new LayerInfo(getClass().getName()); + TCP_Info.setObjectName(mParentStack.getParentNodeName()); + TCP_Info.setDataType("TCP Protocol"); + TCP_Info.setLayer("Transport"); + TCP_Info.setDescription("Resending packet due to timer out: " + repTime + " msec has passed."); + Simulation.addLayerInfo(TCP_Info); + mParentStack.sendPacket((TCP_packet)Elm.SegmentsToResend.get(curkey)); } catch (Exception e) {} *************** *** 334,346 **** } else { ! System.out.println("Timer cancel - part1!"); ! try{ ! Elm.timer.cancel(); ! this.cancel(); ! Elm.timer = null; ! }catch(Exception e){ ! System.out.println("Timer cancel error."); } - System.out.println("Timer cancel - part2!"); } } --- 349,378 ---- } else { ! if (numRepeat==0) ! { ! System.out.println("TIMEtoLIVE - OUT - connection timeout!"); ! ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("Connection timeout! Closing connection to host: "+ Elm.connectedtoIP + ":" + Elm.connectedtoPort+"."); ! Simulation.addLayerInfo(TCP_Info); ! ! Elm.reset(); ! } ! else ! { ! System.out.println("Timer cancel - part1!"); ! try{ ! Elm.timer.cancel(); ! this.cancel(); ! Elm.timer = null; ! }catch(Exception e){ ! System.out.println("Timer cancel error."); ! } ! System.out.println("Timer cancel - part2!"); } } } *************** *** 948,954 **** } else { //we have already received this segment ! Elm.received_duplicates++; ! //now we have to resend our ACK again ! mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); } --- 980,993 ---- } else { //we have already received this segment ! Elm.received_duplicates++; ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! 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())); } *************** *** 1050,1054 **** } else { //we have already received this segment ! Elm.received_duplicates++; //now we have to resend our ACK again mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); --- 1089,1100 ---- } else { //we have already received this segment ! Elm.received_duplicates++; ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! 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())); *************** *** 1137,1142 **** } else { //we have already received this segment ! Elm.received_duplicates++; ! //now we have to resend our ACK again mParentStack.sendPacket((TCP_packet) Elm.SentACKs.get((Integer)inPacket.get_sequence_number())); } --- 1183,1195 ---- } else { //we have already received this segment ! Elm.received_duplicates++; ! //Create Layer info ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(mParentStack.getParentNodeName()); ! TCP_Info.setDataType("TCP Protocol"); ! 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())); } Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Echo_tcp.java 3 Dec 2005 19:23:19 -0000 1.13 --- Echo_tcp.java 4 Dec 2005 12:19:30 -0000 1.14 *************** *** 29,32 **** --- 29,34 ---- public class Echo_tcp extends Application{ + private byte ConnectionAttempts=5; + /** Creates a new instance of Echo */ public Echo_tcp(ProtocolStack inParentStack, int listenPort, int appType, int UID) { *************** *** 64,76 **** * This method connects to server on the other side (imaginations from the other side.... :+) * @author key * @param Host - hostname or ip of server. * @param port - server's port ! * @version v0.01 */ public boolean ClientConnect(String Host, int port) throws TransportLayerException, InvalidNetworkLayerDeviceException, CommunicationException, LowLinkException { sdHost = Host; ! sdPort = port; ! clientPort = mParentStack.ConnectTCP(this, sdHost, sdPort); if (clientPort>-1) return true; else return false; } --- 66,86 ---- * This method connects to server on the other side (imaginations from the other side.... :+) * @author key + * @author gift (sourceforge.net user) * @param Host - hostname or ip of server. * @param port - server's port ! * @version v0.03 */ public boolean ClientConnect(String Host, int port) throws TransportLayerException, InvalidNetworkLayerDeviceException, CommunicationException, LowLinkException { sdHost = Host; ! sdPort = port; ! ! do ! { ! ConnectionAttempts--; ! clientPort = mParentStack.ConnectTCP(this, sdHost, sdPort); ! } ! while (ConnectionAttempts>0 && clientPort==-1); ! if (clientPort>-1) return true; else return false; } *************** *** 120,124 **** * @param data to recv * @author key ! * @version v0.01 */ public void RecvData(String Data) throws LowLinkException, TransportLayerException { --- 130,135 ---- * @param data to recv * @author key ! * @author gift (sourceforge.net user) ! * @version v0.02 */ public void RecvData(String Data) throws LowLinkException, TransportLayerException { *************** *** 185,189 **** * @param server port * @author key ! * @version v0.01 */ public void SendEcho(String Data, String Host, int port) throws CommunicationException, LowLinkException, InvalidNetworkLayerDeviceException, TransportLayerException{ --- 196,201 ---- * @param server port * @author key ! * @author gift (sourceforge.net user) ! * @version v0.02 */ public void SendEcho(String Data, String Host, int port) throws CommunicationException, LowLinkException, InvalidNetworkLayerDeviceException, TransportLayerException{ |
From: QweR <qw...@us...> - 2005-12-04 00:48:03
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6413/core/protocolsuite/tcp_ip Modified Files: SNMP.java Log Message: Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SNMP.java 20 Nov 2005 20:30:53 -0000 1.2 --- SNMP.java 4 Dec 2005 00:47:55 -0000 1.3 *************** *** 30,43 **** package core.protocolsuite.tcp_ip; ! import java.io.Serializable; /** ! * This is for design and future implementation of SNMP ! * @author luke_hamilton * @since Sep 17, 2004 ! * @version v0.20 */ ! public class SNMP implements Serializable{ } --- 30,170 ---- 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 java.util.Vector; /** ! * @author QweR * @since Sep 17, 2004 ! * @version v0.01 */ ! public class SNMP extends Application{ ! ! protected static int SNMPID = 0; ! ! public SNMP(ProtocolStack inParentStack, int listenPort, int appType, int UID) { ! super(inParentStack, listenPort, appType, UID); ! } ! /** ! * This method start to listen on application port ! * @author QweR ! * @return Nothing. ! * @version v0.01 ! */ ! public void Listen() throws TransportLayerException { ! try{ ! mParentStack.ListenUDP(this, listenPort); ! } ! catch (TransportLayerException e) { ! ! } ! } ! ! /** ! * This method stop listening on application port ! * @author QweR ! * @return Nothing. ! * @version v0.01 ! */ ! public void Close() throws TransportLayerException { ! mParentStack.CloseUDP(this); ! } ! ! /** ! * This method connects to server on the other side (imaginations from the other side.... :+) ! * @author QweR ! * @param Host - hostname or ip of server. ! * @param port - server's port ! * @version v0.01 ! */ ! public boolean ClientConnect(String Host, int port) throws TransportLayerException, InvalidNetworkLayerDeviceException, CommunicationException, LowLinkException { ! sdHost = Host; ! sdPort = port; ! clientPort = mParentStack.reserveUDPPort(this, sdHost, sdPort); ! if (clientPort>0) return true; else return false; ! } ! ! /** ! * This method disconnects from server. ! * @author QweR ! * @version v0.01 ! */ ! public void Disconnect()throws TransportLayerException { ! mParentStack.freeUDPPort(this); ! } ! ! /** ! * This method sends data to the other side. ! * @param Data to send ! * @author QweR ! * @version v0.01 ! */ ! public void SendData(String Data) throws LowLinkException, TransportLayerException, CommunicationException { ! mParentStack.sendUDP(this, Data); ! } ! ! /** ! * This method recieves data from the other side. ! * @param Data to recv ! * @author QweR ! * @version v0.01 ! */ ! public void RecvData(String Data) throws LowLinkException, TransportLayerException { ! ! } ! ! public void GetRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(0,"public",0,getNextID(),0,0,r); ! SendData(pack); ! } ! ! public void GetNextRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(1,"public",0,getNextID(),0,0,r); ! SendData(pack); ! } ! ! public void SetRequest(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(2,"public",0,getNextID(),0,0,r); ! SendData(pack); ! } ! ! public void GetResponse(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! String pack = CreateSNMPMessage(3,"public",0,getNextID(),0,0,r); ! SendData(pack); ! } ! ! public void Trap(Vector<String> r) throws LowLinkException, TransportLayerException, CommunicationException { ! ! } ! ! protected static String CreateSNMPMessage(int ver,String pass,int type,int id,int er,int erindex,Vector<String> r) { ! String s; ! char c; ! char[] ac=new char[2]; ! int sizepack=0,sizedata=0; ! ! ac[0]=0xA5; ac[1]=0x82; ! s=String.copyValueOf(ac); ! ! return s; ! } ! ! protected static boolean ParseSNMPMessage(int ver,String pass,int type,int id,int er,int erindex,Vector<String> r) { ! String s; ! s = String.valueOf(ver)+pass+String.valueOf(type)+String.valueOf(id)+String.valueOf(er)+String.valueOf(erindex); ! return true; ! } ! ! protected static int getNextID() { ! if(SNMPID>=65535) SNMPID=0; ! else SNMPID++; ! return SNMPID; ! } } |