Commit 9f53b016 authored by Maria Ruiz's avatar Maria Ruiz
Browse files

last commit before report

parent b37750bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@
import logging, os, json

# Default logging level
#DEFAULT_LOGGING_LEVEL = logging.INFO
DEFAULT_LOGGING_LEVEL = logging.DEBUG #MR
DEFAULT_LOGGING_LEVEL = logging.INFO
#DEFAULT_LOGGING_LEVEL = logging.DEBUG #MR

# Default port for NSC deployment
NSC_PORT = 8081
+16 −6
Original line number Diff line number Diff line
@@ -1419,17 +1419,25 @@ class NSController:
                .get("slo-sle-templates", {}).get("slo-sle-template", [{}])[0]
                .get("id"),

            "bandwidth": bandwidth,
            "bandwidth": bandwidth/1000,
            "latency": latency,
            "tolerance": tolerance,
            "CIR": cir
            "modulation": "16APSK",
            "coding-rate": "8/9",
            "roll-off-factor": "0.2",
            "symbol-rate": 52000000,
            "cir": cir

        }
        intent_sat = {
            "bandwidth": bandwidth,
            "bandwidth": bandwidth/1000,
            "latency": latency,
            "tolerance": tolerance,

            "tx-frequency": 1400000000,
            "rx-frequency": 1200000000,
            "modulation": "16APSK",
            "coding-rate": "8/9",
            "roll-off-factor": "0.2",
            "symbol-rate": 52000000,
            "polarization": "horizontal"
        }

        logging.info(f"SATELLITE Intent realized\n")
@@ -1485,6 +1493,8 @@ class NSController:
                "tx-rate": bandwidth,
                "tx-power": -300,
                "tx-frequency": 1202000000,
                "tx-rate": 2000000,
                "tx-modulation": "3"
            } 
        } 

+5 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ class SATPlanner:

        type = intent.get("ietf-network-slice-service:network-slice-services", {}).get("slo-sle-templates", {}).get("slo-sle-template", [])[0].get("id")
        bandwidth = intent.get("ietf-network-slice-service:network-slice-services", {}).get("slo-sle-templates", {}).get("slo-sle-template", [])[0].get("slo-policy", {}).get("metric-bound",[])[0].get("bound")
       
        bandwidth = bandwidth / 1000  # convertimos a Mbps
        #primero comprobamos los recursos disponibles 
        with open(os.path.join(SRC_PATH, "planner/sat_resources_ddbb.json"), "r") as archivo:
            data = json.load(archivo)
@@ -43,8 +43,11 @@ class SATPlanner:
            disponible = 140 - total
            if bandwidth <= disponible:
                viability = "ok"
                print("PLANNER OK")
                return viability
            elif type == "A":
                extra = bandwidth - disponible 
                P4_cir = extra - 5 # CIR que habrá que configurar en el shaper para limitar el trafico de menor prioridad
                #P4_cir = extra - 5 # CIR que habrá que configurar en el shaper para limitar el trafico de menor prioridad
                P4_cir = total-extra-10
                print("PLANNER SHAPER")
                return P4_cir
+7 −17
Original line number Diff line number Diff line
@@ -9,32 +9,22 @@
            "links": {
                "link": [
                    {
                        "link-id": "1",
                        "id": "1",
                        "vlan-id": "106",
                        "slo-profile": "B",
                        "type": "GEO",
                        "bandwidth-Mbps": 60,
                        "latency": 10,
                        "bandwidth-Mbps": 100.0,
                        "latency": 250,
                        "FRW_frequency": 1200000,
                        "RTN_frequency": 1338000
                    },
                    {
                        "id": "2",
                        "vlan-id": "107",
                        "slo-profile": "B",
                        "type": "LEO",
                        "bandwidth-Mbps": 50,
                        "latency": 20,
                        "FRW_frequency": 1200000,
                        "RTN_frequency": 1338000
                    },
                    {
                        "id": "3",
                        "vlan-id": "106",
                        "vlan-id": "104",
                        "slo-profile": "A",
                        "type": "LEO",
                        "bandwidth-Mbps": 100,
                        "latency": 20,
                        "type": "GEO",
                        "bandwidth-Mbps": 80.0,
                        "latency": 250,
                        "FRW_frequency": 1200000,
                        "RTN_frequency": 1338000
                    }
+7 −4
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class SAT_NMS:
        vlan_id = json_data.get("vlan_id", None)
        QoS_profile = json_data.get("QoS_profile", None)
        bandwidth = json_data.get("bandwidth", None)
        shaper = json_data.get("CIR", None)
        shaper = json_data.get("cir", None)
        
        bandwidth = None
        validation = None
@@ -59,14 +59,14 @@ class SAT_NMS:
            if validation == "error":
                return
            else:
                print(f'\n\n')
                print(f'\n')
                #print(f'\n\n{add_route_controller}\n')

            add_route_station, validation = self.add_routes_station(self.satnms_ip, num_service, vlan_id, qos_mapped)
            if validation == "error":
                return
            else:
                print(f'\n\n')
                print(f'\n')
                #print(f'\n\n{add_route_station}\n')

            #cambio del bandwidth en función del symbol rate. Aquí ojoporque lo que soporta el NMS es limitado. Mejor para las pruebas a none y reefinar si queda tiempo 
@@ -81,6 +81,7 @@ class SAT_NMS:
            if shaper is not None:
                shaper_applied, validation = self.shaper(self.satnms_ip, shaper)
                if validation == "error":
                    print("Unable to apply shaper")
                    return  
                else:
                    print(f'\n\n{shaper_applied}\n')
@@ -276,6 +277,8 @@ class SAT_NMS:

       #primero hay que modificar el valor del max_cir en el shaper y luego asignarlo al el perfil de QoS

        shaper = shaper*10000  #convertimos a Kbps

        url = "http://"+ip+":8000/api/object/write/shaper=0"
        body_dict = {
            "max_cir": shaper
@@ -299,7 +302,7 @@ class SAT_NMS:
        else:
            print(f"Error al aplicar el shaper; error code:"+str(response.json().get("error_code",None))+ "; error log: "+str(response.json().get("error_log",None)))
            validation = "error"
            return validation
            return response.json(), validation
        
    def get_controller_data(self,ip):
        
Loading