Commits

Anonymous committed 45019b1

everything still fuckedup

  • Participants
  • Parent commits 6e928d6

Comments (0)

Files changed (38)

File _scripts/python/generate_rt.py

         }
         configurator: UnimplementedModule;\n"""
 
-CONN_MAP = {
-    'h1': {'l1': 'ppp[0]'},
-    'h2': {'l1': 'ppp[0]'},
-    'h3': {'l5': 'ppp[0]'},
-    'h4': {'l5': 'ppp[0]'},
-    'h5': {'l1': 'ppp[0]'},
-    'l1': {
-        'l2': 'ppp[0]',
-        'l3': 'ppp[1]',
-        'h2': 'ppp[2]',
-        'h1': 'ppp[3]',
-        'h5': 'ppp[4]'
-    },
-    'l2': {   
-        'l1': 'ppp[0]',
-        'l4': 'ppp[1]',
-        'l6': 'ppp[2]',
-    },
-    'l3': {   
-        'l1': 'ppp[0]',
-        'l4': 'ppp[1]',
-        'l7': 'ppp[2]',
-    },
-    'l4': {   
-        'l2': 'ppp[0]',
-        'l5': 'ppp[1]',
-        'l3': 'ppp[2]',
-    },
-    'l5': {
-        'l4': 'ppp[0]',
-        'h3': 'ppp[1]',
-        'h4': 'ppp[2]',
-        'l6': 'ppp[3]',
-        'l7': 'ppp[4]'
-    },
-    'l6': {   
-        'l2': 'ppp[0]',
-        'l5': 'ppp[1]',
-    },
-    'l7': {   
-        'l3': 'ppp[0]',
-        'l5': 'ppp[1]',
-    },
-    
-}
-
 ADJ_MAP_BIG_NETWORK = {
     'h1': ['l1'],
     'h2': ['l2'],
     ('h9', {'h8': 1.11}),
     ]
 
+states_string = """
+
+"""
+
 def generate_udp_apps(demands_map):
     import math
     filename = "omnetpp.ini"

File examples/mpls/big_network/_states.xml

+<?xml version="1.0"?>
+<states>
+        <eas>
+                <id>1</id>
+                <power>1</power>
+                <datarate>2000000</datarate>
+        </eas>
+        <eas>
+                <id>2</id>
+                <power>2</power>
+                <datarate>4000000</datarate>
+        </eas>  
+        <eas>
+                <id>3</id>
+                <power>3</power>
+                <datarate>6000000</datarate>
+        </eas>
+        <eas>
+                <id>4</id>
+                <power>4</power>
+                <datarate>8000000</datarate>
+        </eas>
+        <eas>
+                <id>5</id>
+                <power>5</power>
+                <datarate>10000000</datarate>
+        </eas>      
+        <eas>
+                <id>0</id>
+                <power>0.1</power>
+                <datarate>200000</datarate>
+        </eas>    
+</states>

File examples/mpls/big_network/big_network.ned

 import inet.networklayer.extras.FailureManager;
 import inet.nodes.inet.StandardHost;
 import inet.nodes.mpls.RSVP_LSR;
+import inet.world.galstates.GalStates;
 import inet.world.scenario.ScenarioManager;
-network BIG 
+network BIG
 {
     submodules:
-        host1: StandardHost {}
-        host2: StandardHost {}
-        host3: StandardHost {}
-        host4: StandardHost {}
-        host5: StandardHost {}
-        host6: StandardHost {}
-        host7: StandardHost {}
-        host8: StandardHost {}
-        host9: StandardHost {}
+        host1: StandardHost;
+        host2: StandardHost;
+        host3: StandardHost;
+        host4: StandardHost;
+        host5: StandardHost;
+        host6: StandardHost;
+        host7: StandardHost;
+        host8: StandardHost;
+        host9: StandardHost;
         LSR1: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp2 ppp3 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp2 ppp3 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR10: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ";
-                gates:
-                    pppg[3];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ";
+            gates:
+                pppg[3];
         }
         LSR11: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[4];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[4];
         }
         LSR12: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[4];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[4];
         }
         LSR13: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ";
-                gates:
-                    pppg[3];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ";
+            gates:
+                pppg[3];
         }
         LSR14: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ";
-                gates:
-                    pppg[3];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ";
+            gates:
+                pppg[3];
         }
         LSR15: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ";
-                gates:
-                    pppg[3];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ";
+            gates:
+                pppg[3];
         }
         LSR16: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR17: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR18: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[4];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[4];
         }
         LSR19: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[4];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[4];
         }
         LSR2: RSVP_LSR {
-                parameters:
-                    peers = "ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[4];
+            parameters:
+                peers = "ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[4];
         }
         LSR20: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ";
-                gates:
-                    pppg[3];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ";
+            gates:
+                pppg[3];
         }
         LSR21: RSVP_LSR {
-                parameters:
-                    peers = "ppp1 ppp2 ppp3 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp1 ppp2 ppp3 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR3: RSVP_LSR {
-                parameters:
-                    peers = "ppp1 ppp2 ppp3 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp1 ppp2 ppp3 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR4: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[5];
         }
         LSR5: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp3 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp3 ";
+            gates:
+                pppg[5];
         }
         LSR6: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR7: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ppp4 ";
-                gates:
-                    pppg[5];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ppp4 ";
+            gates:
+                pppg[5];
         }
         LSR8: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp2 ppp3 ";
-                gates:
-                    pppg[4];
+            parameters:
+                peers = "ppp0 ppp2 ppp3 ";
+            gates:
+                pppg[4];
         }
         LSR9: RSVP_LSR {
-                parameters:
-                    peers = "ppp0 ppp1 ppp2 ";
-                gates:
-                    pppg[3];
+            parameters:
+                peers = "ppp0 ppp1 ppp2 ";
+            gates:
+                pppg[3];
         }
         scenarioManager: ScenarioManager {
             parameters:
                 @display("p=500,50");
         }
         configurator: UnimplementedModule;
+        galStates: GalStates {
+            @display("p=621,407");
+        }
     connections:
         host8.pppg++ <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR8.pppg[1];
         host9.pppg++ <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR21.pppg[0];
         LSR2.pppg[2] <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR3.pppg[2];
         LSR1.pppg[3] <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR8.pppg[2];
         LSR1.pppg[4] <--> {  delay = 5ms; datarate = 10Mbps; } <--> LSR9.pppg[2];
-}
+}

File examples/mpls/big_network/omnetpp.ini

 total-stack = 256MiB
 tkenv-plugin-path = ../../../etc/plugins
 
-#**.host{1..2,5}.numUdpApps = 1
-#**.host{1..2,5}.udpApp[*].typename = "UDPBasicApp"
-#**.host{1..2,5}.udpApp[0].localPort = 100
-#**.host{1..2,5}.udpApp[0].destPort = 100
-#**.host{1..2,5}.udpApp[0].messageLength = 128 bytes
-#**.host{1..2,5}.udpApp[0].sendInterval = 0.01s
-#**.host{1..2,5}.udpApp[0].destAddresses = "host3"
+#**.host1.numUdpApps = 1
+#**.host1.udpApp[*].typename = "UDPBasicApp"
+#**.host1.udpApp[0].localPort = 100
+#**.host1.udpApp[0].destPort = 100
+#**.host1.udpApp[0].messageLength = 2621 bytes # 1 Mbps
+#**.host1.udpApp[0].sendInterval = 20ms
+#**.host1.udpApp[0].destAddresses = "host9"
+#
+#**.host2.numUdpApps = 1
+#**.host2.udpApp[*].typename = "UDPBasicApp"
+#**.host2.udpApp[0].localPort = 100
+#**.host2.udpApp[0].destPort = 100
+#**.host2.udpApp[0].messageLength = 2621 bytes # 1 Mbps
+#**.host2.udpApp[0].sendInterval = 20ms
+#**.host2.udpApp[0].destAddresses = "host9"
 #
 #**.host3.numUdpApps = 1
-#**.host3.udpApp[*].typename = "UDPSink"
+#**.host3.udpApp[*].typename = "UDPBasicApp"
 #**.host3.udpApp[0].localPort = 100
-
-
-#**.host1.numTcpApps = 1
-#**.host1.tcpApp[*].typename = "TCPSessionApp"
-#**.host1.tcpApp[0].connectAddress = "host9"
-#**.host1.tcpApp[0].connectPort = 1000
-#**.host1.tcpApp[0].tClose = -1s
-#**.host1.tcpApp[0].sendBytes = 3.2MiB
+#**.host3.udpApp[0].destPort = 100
+#**.host3.udpApp[0].messageLength = 2621 bytes # 1 Mbps
+#**.host3.udpApp[0].sendInterval = 20ms
+#**.host3.udpApp[0].destAddresses = "host9"
 #
-#**.host2.numTcpApps = 1
-#**.host2.tcpApp[*].typename = "TCPSessionApp"
-#**.host2.tcpApp[0].connectAddress = "host9"
-#**.host2.tcpApp[0].connectPort = 1001
-#**.host2.tcpApp[0].tClose = -1s
-#**.host2.tcpApp[0].sendBytes = 3.2MiB
-#
-#
-#**.host3.numTcpApps = 1
-#**.host3.tcpApp[*].typename = "TCPSessionApp"
-#**.host3.tcpApp[0].connectAddress = "host9"
-#**.host3.tcpApp[0].connectPort = 1002
-#**.host3.tcpApp[0].tClose = -1s
-#**.host3.tcpApp[0].sendBytes = 3.2MiB
-#
-#
-#**.host9.numTcpApps = 3
-#**.host9.tcpApp[*].typename = "TCPSessionApp"
-#**.host9.tcpApp[*].active = false
-#**.host9.tcpApp[*].connectAddress = ""
-#**.host9.tcpApp[0].localPort = 1000
-#**.host9.tcpApp[1].localPort = 1001
-#**.host9.tcpApp[2].localPort = 1002
-
-**.host1.numUdpApps = 1
-**.host1.udpApp[*].typename = "UDPBasicApp"
-**.host1.udpApp[0].localPort = 100
-**.host1.udpApp[0].destPort = 100
-**.host1.udpApp[0].messageLength = 2621 bytes # 1 Mbps
-**.host1.udpApp[0].sendInterval = 20ms
-**.host1.udpApp[0].destAddresses = "host9"
-
-**.host2.numUdpApps = 1
-**.host2.udpApp[*].typename = "UDPBasicApp"
-**.host2.udpApp[0].localPort = 100
-**.host2.udpApp[0].destPort = 100
-**.host2.udpApp[0].messageLength = 2621 bytes # 1 Mbps
-**.host2.udpApp[0].sendInterval = 20ms
-**.host2.udpApp[0].destAddresses = "host9"
-
-**.host3.numUdpApps = 1
-**.host3.udpApp[*].typename = "UDPBasicApp"
-**.host3.udpApp[0].localPort = 100
-**.host3.udpApp[0].destPort = 100
-**.host3.udpApp[0].messageLength = 2621 bytes # 1 Mbps
-**.host3.udpApp[0].sendInterval = 20ms
-**.host3.udpApp[0].destAddresses = "host9"
-
-**.host9.numUdpApps = 1
-**.host9.udpApp[*].typename = "UDPSink"
-**.host9.udpApp[0].localPort = 100
+#**.host9.numUdpApps = 1
+#**.host9.udpApp[*].typename = "UDPSink"
+#**.host9.udpApp[0].localPort = 100
 
 
 
 
 # NIC configuration
 **.ppp[*].queueType = "DropTailQueue" # in routers
-**.ppp[*].queue.frameCapacity = 10  # in routers
+**.ppp[*].queue.frameCapacity = 200  # in routers
 
 # scenario
 **.scenarioManager.script = xml("<scenario/>")

File out/gcc-debug/src/base/PassiveQueueBase.o

Binary file modified.

File out/gcc-debug/src/libinet.dll

Binary file removed.

File out/gcc-debug/src/linklayer/ethernet/EtherBus.o

Binary file modified.

File out/gcc-debug/src/linklayer/ethernet/EtherHub.o

Binary file modified.

File out/gcc-debug/src/linklayer/ethernet/EtherMAC.o

Binary file modified.

File out/gcc-debug/src/linklayer/ethernet/EtherMACBase.o

Binary file modified.

File out/gcc-debug/src/linklayer/ethernet/EtherMACFullDuplex.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtAP.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtAPBase.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtAPSimplified.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtAdhoc.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtAdhocWithEtx.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtBase.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtSTA.o

Binary file modified.

File out/gcc-debug/src/linklayer/ieee80211/mgmt/Ieee80211MgmtSTASimplified.o

Binary file modified.

File out/gcc-debug/src/linklayer/ppp/PPP.o

Binary file modified.

File out/gcc-debug/src/linklayer/queue/DropTailQueue.o

Binary file modified.

File out/gcc-debug/src/linklayer/queue/FIFOQueue.o

Binary file modified.

File out/gcc-debug/src/networklayer/autorouting/ipv4/IPv4NetworkConfigurator.o

Binary file modified.

File out/gcc-debug/src/networklayer/extras/FailureManager.o

Binary file modified.

File out/gcc-debug/src/networklayer/internetcloud/InternetCloudTaggerChannel.o

Binary file modified.

File out/gcc-debug/src/networklayer/manetrouting/base/ManetRoutingBase.o

Binary file modified.

File out/gcc-debug/src/networklayer/ted/TED.o

Binary file modified.

File out/gcc-debug/src/util/MessageChecker.o

Binary file modified.

File out/gcc-debug/src/util/NetAnimTrace.o

Binary file modified.

File out/gcc-debug/src/util/ThruputMeteringChannel.o

Binary file modified.

File out/gcc-debug/src/world/galstates/GalStates.o

Binary file added.

File src/Makefile

 	base/ModuleAccess.h \
 	base/NotificationBoard.h \
 	base/NotifierConsts.h \
+	base/PassiveQueueBase.h \
 	linklayer/contract/MACAddress.h \
 	linklayer/contract/TxNotifDetails.h \
 	linklayer/ppp/PPP.h \
 	linklayer/ppp/PPPFrame_m.h \
+	linklayer/queue/DropTailQueue.h \
 	networklayer/common/IInterfaceTable.h \
 	networklayer/common/InterfaceEntry.h \
 	networklayer/common/InterfaceTableAccess.h \
 	networklayer/common/InterfaceToken.h \
-	util/opp_utils.h
+	networklayer/contract/IPv4Address.h \
+	util/XMLUtils.h \
+	util/opp_utils.h \
+	world/galstates/GalStates.h
 $O/linklayer/ppp/PPPFrame_m.o: linklayer/ppp/PPPFrame_m.cc \
 	base/INETDefs.h \
 	linklayer/ppp/PPPFrame_m.h

File src/base/IPassiveQueue.h

   public:
     virtual ~IPassiveQueue() {}
 
-    virtual void getNumQueueDropped() = 0;
-
     /**
      * The queue should send a packet whenever this method is invoked.
      * If the queue is currently empty, it should send a packet when

File src/base/PassiveQueueBase.cc

 simsignal_t PassiveQueueBase::dropPkByQueueSignal = SIMSIGNAL_NULL;
 simsignal_t PassiveQueueBase::queueingTimeSignal = SIMSIGNAL_NULL;
 
-int PassiveQueueBase::getNumQueueDropped() {
-	return numQueueDropped;
-}
+//int PassiveQueueBase::getNumQueueDropped() {
+//	return numQueueDropped;
+//}
 
 void PassiveQueueBase::initialize()
 {

File src/base/PassiveQueueBase.h

  */
 class INET_API PassiveQueueBase : public cSimpleModule, public IPassiveQueue
 {
+  public:
+    int numQueueDropped;
+
   protected:
     typedef std::map<long, simtime_t> MsgId2TimeMap;
     MsgId2TimeMap msgId2TimeMap;
 
     // statistics
     int numQueueReceived;
-    int numQueueDropped;
 
     /** Signal with packet when received it */
     static simsignal_t rcvdPkSignal;
     virtual void sendOut(cMessage *msg) = 0;
 
    public:
-    int getNumQueueDropped();
     /**
      * The queue should send a packet whenever this method is invoked.
      * If the queue is currently empty, it should send a packet when

File src/linklayer/ppp/PPP.cc

 #include "IInterfaceTable.h"
 #include "InterfaceTableAccess.h"
 #include "IPassiveQueue.h"
+#include "DropTailQueue.h"
 #include "NotificationBoard.h"
 #include "NotifierConsts.h"
 
     	EAS = par("EAS");
     	lowEASBound = par("lowEASBound");
     	highEASBound = par("highEASBound");
-    	*GAL = simulation.getModuleByPath("GalStates");
+    	GAL = check_and_cast<GalStates*>(simulation.getModuleByPath("galStates"));
     	// alter the channel
     	changeChannelDatarate();
 
 
 void PPP::performLCS() {
 	// check if dropped packets
-	int dropped = queueModule->getNumQueueDropped() - numLastDroppedPckts;
+	DropTailQueue* pq = static_cast<DropTailQueue*>(queueModule);
+	int dropped = pq->numQueueDropped - numLastDroppedPckts;
 	numLastDroppedPckts = dropped;
 
 	if(dropped) {
 	}
 	else {
 		// make EAS one lower
-		EAS = max(EAS - 1, lowEASBound);
+		if (EAS-1 <= lowEASBound)
+			EAS = lowEASBound;
+		else
+			EAS = EAS - 1;
 		changeChannelDatarate();
 	}
 

File src/linklayer/ppp/PPP.h

 
 #include "INETDefs.h"
 
+#include "GalStates.h"
 #include "PPPFrame_m.h"
 #include "TxNotifDetails.h"
 #include "INotifiable.h"
+#include <algorithm>
 
 class InterfaceEntry;
 class IPassiveQueue;

File src/world/galstates/GalStates.ned

 //
 simple GalStates
 {
+     parameters:    
+     	xml states = default(xmldoc("_states.xml"));
 }