예제 #1
0
def set_hop_penalty(penalty="10"):
    for node in nodes:
        host = "{}:{}".format(node.forward_ip, node.port)
        s = cmd.connect(host)
        if node.endnode:
            cmd.write_cmd(s, cmd.hop_path, penalty)
        else:
            cmd.write_cmd(s, cmd.hop_path, "0")
예제 #2
0
파일: slave.py 프로젝트: jledet/catbench
def set_hop_penalty(penalty="10"):
    for node in nodes:
        host = "{}:{}".format(node.forward_ip, node.port)
        s = cmd.connect(host)
        if node.endnode:
            cmd.write_cmd(s, cmd.hop_path, penalty)
        else:
            cmd.write_cmd(s, cmd.hop_path, "0")
예제 #3
0
def set_coding_nodes(coding=True, toggle_tq=False):
    c = "1" if coding else "0"
    try:
        for node in nodes:
            host = "{}:{}".format(node.forward_ip, node.port)
            if toggle_tq:
                s = cmd.connect(host)
                cmd.write_cmd(s, cmd.tq_path, c)
                s = cmd.connect(host)
                cmd.write_cmd(s, cmd.catw_path, "1")
            else:
                s = cmd.connect(host)
                cmd.write_cmd(s, cmd.catw_path, c)
    except Exception:
        return False
    else:
        return True
예제 #4
0
파일: slave.py 프로젝트: jledet/catbench
def set_coding_nodes(coding=True, toggle_tq=False):
    c = "1" if coding else "0"
    try:
        for node in nodes:
            host = "{}:{}".format(node.forward_ip, node.port)
            if toggle_tq:
                s = cmd.connect(host)
                cmd.write_cmd(s, cmd.tq_path, c)
                s = cmd.connect(host)
                cmd.write_cmd(s, cmd.catw_path, "1")
            else:
                s = cmd.connect(host)
                cmd.write_cmd(s, cmd.catw_path, c)
    except Exception:
        return False
    else:
        return True
예제 #5
0
파일: catcp.py 프로젝트: jledet/catbench
def set_tq(node, tq=True):
    print("Random tq: {}".format(tq))
    t = "1" if tq else "0"
    s = cmd.connect(node)
    cmd.write_cmd(s, cmd.tq_path, t)
예제 #6
0
파일: catcp.py 프로젝트: jledet/catbench
def set_coding(node, coding=True):
    print("Network Coding: {}".format(coding))
    c = "1" if coding else "0"
    s = cmd.connect(node)
    cmd.write_cmd(s, cmd.catw_path, c)
예제 #7
0
def set_tq(node, tq=True):
    print("Random tq: {}".format(tq))
    t = "1" if tq else "0"
    s = cmd.connect(node)
    cmd.write_cmd(s, cmd.tq_path, t)
예제 #8
0
def set_coding(node, coding=True):
    print("Network Coding: {}".format(coding))
    c = "1" if coding else "0"
    s = cmd.connect(node)
    cmd.write_cmd(s, cmd.catw_path, c)
예제 #9
0
def set_hold_nodes(hold="30"):
    for node in nodes:
        host = "{}:{}".format(node.forward_ip, node.port)
        s = cmd.connect(host)
        cmd.write_cmd(s, cmd.hold_path, int(hold))
예제 #10
0
파일: slave.py 프로젝트: jledet/catbench
def set_hold_nodes(hold="30"):
    for node in nodes:
        host = "{}:{}".format(node.forward_ip, node.port)
        s = cmd.connect(host)
        cmd.write_cmd(s, cmd.hold_path, int(hold))