コード例 #1
0
    pfifo0 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo1 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo2 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo3 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo4 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo5 = prioSched.addQueue(PfifoQueue(limit=100))

    qdiscConfig.add_queue(pfifo0)
    qdiscConfig.add_queue(pfifo1)
    qdiscConfig.add_queue(pfifo2)
    qdiscConfig.add_queue(pfifo3)
    qdiscConfig.add_queue(pfifo4)
    qdiscConfig.add_queue(pfifo5)

    filter0 = Filter(name="Mesh_Control_Traffic")
    filter0.setFiveTuple(src=None, prot='udp', srcPort='698', dstPort='698')
    filter0.setTarget(pfifo0)
    filter0.setTos(Filter.VO)
    prioSched.addFilter(filter0)

    filter1 = Filter(name="Testbed_Management_Traffic")
    filter1.setFiveTuple(src='10.0.0.1', dst=None, prot='tcp', srcPort=None, dstPort='1234')
    filter1.setTarget(pfifo1)
    filter1.setTos(Filter.VI)
    prioSched.addFilter(filter1)

    filter2 = Filter(name="BN_Wireless_Control_Traffic")
    filter2.setFiveTuple(src='192.168.0.1', dst=None, prot='tcp', srcPort=None, dstPort='9980')
    filter2.setTarget(pfifo2)
    filter2.setTos(Filter.VI)
    prioSched.addFilter(filter2)
コード例 #2
0
ファイル: tc-test.py プロジェクト: wishful-project/python-tc
    if len(sys.argv) > 1:
        operation = str(sys.argv[1])

    tcMgr = TrafficControl()
    wlan0 = tcMgr.getInterface('wlan0')

    if operation == "add":
        prioSched = PrioScheduler(bandNum=4)

        pfifo1 = prioSched.addQueue(PfifoQueue(limit=50))
        bfifo2 = prioSched.addQueue(BfifoQueue(limit=20000))
        pfifo3 = prioSched.addQueue(SfqQueue(perturb=11))
        tbf4   = prioSched.addQueue(TbfQueue(rate=1000*1024, burst=1600, limit=10*1024))

        filter1 = Filter(name="BnControlTraffic");
        filter1.setFiveTuple(src=None, dst='192.168.1.178', prot='udp', srcPort=None, dstPort='5001')
        filter1.setTarget(pfifo1)
        filter1.setFilterPriority(1)
        filter1.setFlowId(5)
        filter1.setTos(Filter.VI)
        prioSched.addFilter(filter1)

        filter4 = Filter(name="Background");
        filter4.setFiveTuple(src='10.0.0.2', dst=None, prot='tcp', srcPort='21', dstPort=None)
        filter4.setTarget(tbf4)
        filter4.setFilterPriority(100)
        filter4.setFlowId(128)
        filter4.setTos(Filter.BE)
        prioSched.addFilter(filter4)

        wlan0.setEgressScheduler(prioSched)
コード例 #3
0
    if len(sys.argv) > 1:
        operation = str(sys.argv[1])

    tcMgr = TrafficControl()
    wlan0 = tcMgr.getInterface('wlan0')

    if operation == "add":
        prioSched = PrioScheduler(bandNum=4)

        pfifo1 = prioSched.addQueue(PfifoQueue(limit=50))
        bfifo2 = prioSched.addQueue(BfifoQueue(limit=20000))
        pfifo3 = prioSched.addQueue(SfqQueue(perturb=11))
        tbf4   = prioSched.addQueue(TbfQueue(rate=1000*1024, burst=1600, limit=10*1024))

        filter1 = Filter(name="BnControlTraffic");
        filter1.setFiveTuple(src=None, dst='192.168.1.178', prot='udp', srcPort=None, dstPort='5001')
        filter1.setTarget(pfifo1)
        filter1.setFilterPriority(1)
        filter1.setFlowId(5)
        filter1.setTos(Filter.VI)
        prioSched.addFilter(filter1)

        filter4 = Filter(name="Background");
        filter4.setFiveTuple(src='10.0.0.2', dst=None, prot='tcp', srcPort='21', dstPort=None)
        filter4.setTarget(tbf4)
        filter4.setFilterPriority(100)
        filter4.setFlowId(128)
        filter4.setTos(Filter.BE)
        prioSched.addFilter(filter4)

        wlan0.setEgressScheduler(prioSched)
コード例 #4
0
    pfifo0 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo1 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo2 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo3 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo4 = prioSched.addQueue(PfifoQueue(limit=100))
    pfifo5 = prioSched.addQueue(PfifoQueue(limit=100))

    qdiscConfig.add_queue(pfifo0)
    qdiscConfig.add_queue(pfifo1)
    qdiscConfig.add_queue(pfifo2)
    qdiscConfig.add_queue(pfifo3)
    qdiscConfig.add_queue(pfifo4)
    qdiscConfig.add_queue(pfifo5)

    filter0 = Filter(name="Mesh_Control_Traffic")
    filter0.setFiveTuple(src=None, prot="udp", srcPort="698", dstPort="698")
    filter0.setTarget(pfifo0)
    filter0.setTos(Filter.VO)
    prioSched.addFilter(filter0)

    filter1 = Filter(name="Testbed_Management_Traffic")
    filter1.setFiveTuple(src="10.0.0.1", dst=None, prot="tcp", srcPort=None, dstPort="1234")
    filter1.setTarget(pfifo1)
    filter1.setTos(Filter.VI)
    prioSched.addFilter(filter1)

    filter2 = Filter(name="BN_Wireless_Control_Traffic")
    filter2.setFiveTuple(src="192.168.0.1", dst=None, prot="tcp", srcPort=None, dstPort="9980")
    filter2.setTarget(pfifo2)
    filter2.setTos(Filter.VI)
    prioSched.addFilter(filter2)
コード例 #5
0
    if len(sys.argv) > 1:
        operation = str(sys.argv[1])

    tcMgr = TrafficControl()
    wlan0 = tcMgr.getInterface("wlan0")

    if operation == "add":
        prioSched = PrioScheduler(bandNum=4)

        pfifo1 = prioSched.addQueue(PfifoQueue(limit=50))
        bfifo2 = prioSched.addQueue(BfifoQueue(limit=20000))
        pfifo3 = prioSched.addQueue(SfqQueue(perturb=11))
        tbf4 = prioSched.addQueue(TbfQueue(rate=1000 * 1024, burst=1600, limit=10 * 1024))

        filter1 = Filter(name="BnControlTraffic")
        filter1.setFiveTuple(src=None, dst="192.168.1.178", prot="udp", srcPort=None, dstPort="5001")
        filter1.setTarget(pfifo1)
        filter1.setFilterPriority(1)
        filter1.setFlowId(5)
        filter1.setTos(Filter.VI)
        prioSched.addFilter(filter1)

        filter4 = Filter(name="Background")
        filter4.setFiveTuple(src="10.0.0.2", dst=None, prot="tcp", srcPort="21", dstPort=None)
        filter4.setTarget(tbf4)
        filter4.setFilterPriority(100)
        filter4.setFlowId(128)
        filter4.setTos(Filter.BE)
        prioSched.addFilter(filter4)

        wlan0.setEgressScheduler(prioSched)