private SubnetworkPoint GenerateSnp(Link link, int demandedCapacity)
 {
     while (true)
     {
         SubnetworkPoint snp = SubnetworkPoint.GenerateRandom(demandedCapacity);
         OnUpdateState($"[GENERATED_SNP] {link}\n" +
                       $"                                                {snp}");
         if (!_usedSubnetworkPoints[link].Contains(snp))
         {
             _usedSubnetworkPoints[link].Add(snp);
             link.ReserveCapacity(demandedCapacity);
             OnUpdateState($"[MODIFIED_LINK] {link}");
             if (!link.IsClientLink)
             {
                 SendLocalTopology(link);
             }
             return(snp);
         }
     }
 }
Example #2
0
        private void SendConnectionRequestResponse(SignallingMessage message, SubnetworkPoint snp)
        {
            var connectionRequest = message;

            connectionRequest.Payload   = snp;
            connectionRequest.Operation = OperationType.ConnectionRequest;

            if (LocalAddress.IsDomain)
            {
                connectionRequest.DestinationAddress             = LocalAddress;
                connectionRequest.DestinationControlPlaneElement = ControlPlaneElementType.NCC;
            }
            else
            {
                connectionRequest.DestinationAddress             = LocalAddress.GetParentsAddress();
                connectionRequest.DestinationControlPlaneElement = ControlPlaneElementType.CC;
            }

            SendMessage(message);
        }
Example #3
0
 protected bool Equals(SubnetworkPoint other)
 {
     return(Vpi == other.Vpi && Vci == other.Vci);
 }
 public SubnetworkPointPortPair(SubnetworkPoint subnetworkPoint, int port)
 {
     SubnetworkPoint = subnetworkPoint;
     Port            = port;
 }