| 318 | |
| 319 | # A thread designed for initializing bird routing. |
| 320 | class sn_Routing_Init_Thread(threading.Thread): |
| 321 | |
| 322 | def __init__(self, remote_ssh, remote_ftp, orbit_num, sat_num, |
| 323 | constellation_size, fac_num, file_path, sat_bandwidth, |
| 324 | sat_ground_bandwidth, sat_loss, sat_ground_loss): |
| 325 | threading.Thread.__init__(self) |
| 326 | self.remote_ssh = remote_ssh |
| 327 | self.constellation_size = constellation_size |
| 328 | self.fac_num = fac_num |
| 329 | self.orbit_num = orbit_num |
| 330 | self.sat_num = sat_num |
| 331 | self.file_path = file_path |
| 332 | self.sat_bandwidth = sat_bandwidth |
| 333 | self.sat_ground_bandwidth = sat_ground_bandwidth |
| 334 | self.sat_loss = sat_loss |
| 335 | self.sat_ground_loss = sat_ground_loss |
| 336 | self.remote_ftp = remote_ftp |
| 337 | |
| 338 | def run(self): |
| 339 | print( |
| 340 | "Copy bird configuration file to each container and run routing process." |
| 341 | ) |
| 342 | self.remote_ftp.put( |
| 343 | os.path.join(os.getcwd(), "starrynet/sn_orchestrater.py"), |
| 344 | self.file_path + "/sn_orchestrater.py") |
| 345 | print('Initializing routing ...') |
| 346 | sn_remote_cmd( |
| 347 | self.remote_ssh, "python3 " + self.file_path + |
| 348 | "/sn_orchestrater.py" + " " + str(self.constellation_size) + " " + |
| 349 | str(self.fac_num) + " " + self.file_path) |
| 350 | print("Routing initialized!") |
| 351 | |
| 352 | |
| 353 | # A thread designed for emulation. |