예제 #1
0
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

##configuration parameters
router_queue_size = 0  #0 means unlimited
simulation_time = 45  #give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [
    ]  #keeps track of objects, so we can kill their threads at the end

    #create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)

    #create routers and routing tables for connected clients (subnets)
    encap_tbl_D = {
        "H1": {"RA"},
        "H2": {"RA"}
    }  # table used to encapsulate network packets into MPLS frames
    frwd_tbl_D = {
        "1": {
            "dest": "H3",
            "intf": 2,
예제 #2
0
from network_3 import Router, Host
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

##configuration parameters
router_queue_size = 0 #0 means unlimited
simulation_time = 10 #give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [] #keeps track of objects, so we can kill their threads at the end
    
    #create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)
    
    #create routers and routing tables for connected clients (subnets)
    #encap_tbl_D = {'H1': '1','H2': '2','H3': '3'}    # table used to encapsulate network packets into MPLS frames
    encap_tbl_D = {'H1': '1','H2': '2','H3': {'2': '4', '3': '3'}} 
    #Still need to be able to have source, to send to new route
    frwd_tbl_D = {'1': ['99', 'H1', 3], '2':['98','H2',2], '3':['4','RB',0], '4':['5','RC',1]}     # table used to forward MPLS frames
    decap_tbl_D = {'99':'H1','98':'H2'}    # table used to decapsulate network packets from MPLS frames
    router_a = Router(name='RA', 
                              intf_capacity_L=[500,500, 500, 500],
                              encap_tbl_D = encap_tbl_D,
예제 #3
0
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

## configuration parameters
router_queue_size = 0  # 0 means unlimited
simulation_time = 15  # give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [
    ]  # keeps track of objects, so we can kill their threads at the end

    # create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)

    # create routers and routing tables for connected clients (subnets)
    encap_tbl_D = {
        0: {
            'H3': 0
        },
        2: {
            'H3': 1
        }
    }  # table used to encapsulate network packets into MPLS frames
예제 #4
0
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

##configuration parameters
router_queue_size = 0  #0 means unlimited
simulation_time = 10  #give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [
    ]  #keeps track of objects, so we can kill their threads at the end

    #create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)

    #create routers and routing tables for connected clients (subnets)
    # {incoming interface : dst}
    encap_tbl_D = {
        0: "H3",
        1: "H3"
    }  # table used to encapsulate network packets into MPLS frames
    #{(inlabel, in-interface) : (outlabel, out-interface)}
    frwd_tbl_D = {
        ("H3", 0): ("H3", 2),
예제 #5
0
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

##configuration parameters
router_queue_size = 0  #0 means unlimited
simulation_time = 60  #give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [
    ]  #keeps track of objects, so we can kill their threads at the end

    #create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)

    #create routers and routing tables for connected clients (subnets)

    #determine where encapsulation and decapsulation are needed
    encap_tbl_D = {"LP": {"RA"}, "HP": {"RA"}}
    decap_tbl_D = {"RD": {"H3"}}

    # inlabel outlabel, dest, outinterface
    frwd_tbl_D = {"LP": ("1", "H3", 2), "HP": ("2", "H3", 3)}
예제 #6
0
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

##configuration parameters
router_queue_size = 0  # 0 means unlimited
simulation_time = 30  # give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [
    ]  # keeps track of objects, so we can kill their threads at the end

    # create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)

    # create routers and routing tables for connected clients (subnets)
    #Label frame based on the dst, Assigns 11 to ip packets
    encap_tbl_D = {
        'H3': '11'
    }  # table used to encapsulate network packets into MPLS frames
    # table used to forward MPLS frames, {in_label{in_intf:(outlabel, out_inft}}
    frwd_tbl_D = {
        '11': {
            #From H1 out interface 2 to router B
예제 #7
0
from link_3 import Link, LinkLayer
import threading
from time import sleep
import sys
from copy import deepcopy

##configuration parameters
router_queue_size = 0  #0 means unlimited
simulation_time = 20  #give the network sufficient time to execute transfers

if __name__ == '__main__':
    object_L = [
    ]  #keeps track of objects, so we can kill their threads at the end

    #create network hosts
    host_1 = Host('H1')
    object_L.append(host_1)
    host_2 = Host('H2')
    object_L.append(host_2)
    host_3 = Host('H3')
    object_L.append(host_3)

    #create routers and routing tables for connected clients (subnets)
    encap_tbl_D = {
        0: 'B',
        1: 'C'
    }  # table used to encapsulate network packets into MPLS frames
    frwd_tbl_D = {0: 2, 1: 3}  # table used to forward MPLS frames
    decap_tbl_D = {
    }  # table used to decapsulate network packets from MPLS frames
    router_a = Router(name='RA',