public static void Main(string[] args)
        {
            Config(args[0], args[1]);
            //Config("..\\..\\..\\..\\Configs\\NetworkConfig1.txt");

            NetClient nc = new NetClient(HandleMessage, Name);

            Task.Run(() => nc.ListenForMessages());

            if (Inner_Name.Equals(" ") && !Name.Equals("NC2"))
            {
                Disp.ViewOnScreen("INNER SUBNETWORK " + Name);
                NetworkMessage msg = new NetworkMessage(Name, Upper_Name, IPAddress.Parse("1.0.0.1"), IPAddress.Parse("2.0.0.1"), 1, "INNER_NC_AVAILABLE");
                nc.Send(msg.ToBytes());
            }

            Disp.ViewOnScreen("Starting subnetwork!");

            //RoutingProtocol rc = new RoutingProtocol("..\\..\\..\\..\\Configs\\RCConfigNode1.txt", "..\\..\\..\\..\\Configs\\RCConfigLink1.txt");
            RoutingProtocol rc  = new RoutingProtocol(args[2], args[3], nc, Name);
            LRM             lrm = new LRM(nc, rc, Name, Links);
            CC cc = new CC(nc, rc, lrm, Name);

            _cc     = cc;
            _rc     = rc;
            _lrm    = lrm;
            _lrm.cc = cc;
            while (true)
            {
                Console.ReadLine();
            }
        }
 public CC(NetClient nc, RoutingProtocol rc, LRM lrm, string name)
 {
     this.nc  = nc;
     this.rc  = rc;
     this.lrm = lrm;
     Name     = name;
     Disp.ViewOnScreen("Starting CC!");
 }
Exemple #3
0
        private void InitializeSignallingModules()
        {
            DeviceClass.MakeLog("|SIGNALLING| NodeDevise is waking up...");
            DeviceClass.MakeConsoleLog("|SIGNALLING| NodeDevise is waking up...");

            _cc  = new CC(_configurationFolderPath + "/CC_config.xml");
            _rc  = new RC(_configurationFolderPath + "/RC_config.xml");
            _lrm = new LRM(_configurationFolderPath + "/LRM_config.xml");

            _pc          = new PC(_configurationFolderPath + "/PC_config.xml", _cc, _rc, _lrm);
            _cc.LocalPC  = _pc;
            _rc.LocalPC  = _pc;
            _lrm.LocalPC = _pc;


            StartWorking();
        }
Exemple #4
0
 public LSR(string id)
 {
     try
     {
         if (!loadLSRConfiguration(id))
         {
             throw new Exception();
         }
     }
     catch (Exception)
     {
         Console.WriteLine("Error loading configuration. LSR constructor");
     }
     nodeID   = int.Parse(id);
     CF       = new CommutationField(this);
     lrm      = new LRM(nodeID);
     LSR_FIFO = new Queue <CsharpMPLS.Packet>();
     //neighbours = new List<string>();
     //nodesToPorts = new Dictionary<string, int>();
     communicationModule = new Communication(portNumber, this);
     Console.WriteLine("/////////////// LSR NODE NUMBER: " + nodeID + "///////////////");
 }