示例#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))