Preferential detour of unimportant data stream in software defined networks for improving video transmission quality

 

[Topology]

每條link都是bw=1Mbps, delay='1ms', max_queue_size=20 packet, loss rate=0

H6---H8: video

H7---H9: background traffic : 600kbps

 

H6:video傳送端, H8video接收端 (傳送影片是foreman cif格式352x288, 300個畫面,傳送速度是每秒30 frames,所以傳送時間為10秒鐘)

H7background traffic傳送端, H9background traffic接收端. (background traffic: 600kbps)

 

方法一:background traffic開始傳送,controller偵測到video path中的link的可用頻寬已經小於100kbps,則把此link weight變大,使得controller重新幫videodijkstra去找新的路徑

original path for video traffic: 1->2->3

new path for video traffic: 1->4>5->3

實驗的結果是Average PSNR:31.7 db

 

方法二:background traffic開始傳送,controller偵測到video path中的link的可用頻寬已經小於100kbps,則去找尋這條link中比較重要的flow,也就是h7-h9traffic flow,然後把整個網路拓普,移除將發生congestionlink,在使用dijkstra去幫h7-h9找尋新的路徑,若是找到新的路徑,則把h7-h9traffic flow移動到新路徑,原本video還是走原本的傳輸路徑

original path for background traffic:  2->3

new path for background traffic: 2->4>5->3

實驗的結果是:Average PSNR: 33db

 

mininet script:test_svc3.sh

#!/usr/bin/python

 

"""

Script created by VND - Visual Network Description (SDN version)

"""

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, UserSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import Link, TCLink

import time

 

def topology():

    "Create a network."

    net = Mininet( controller=RemoteController, link=TCLink, switch=OVSKernelSwitch )

 

    print "*** Creating nodes"

    s1 = net.addSwitch( 's1', listenPort=6673, mac='00:00:00:00:00:01' )

    s2 = net.addSwitch( 's2', listenPort=6674, mac='00:00:00:00:00:02' )

    s3 = net.addSwitch( 's3', listenPort=6675, mac='00:00:00:00:00:03' )

    s4 = net.addSwitch( 's4', listenPort=6676, mac='00:00:00:00:00:04' )

    s5 = net.addSwitch( 's5', listenPort=6677, mac='00:00:00:00:00:05' )

    h6 = net.addHost( 'h6', mac='00:00:00:00:00:06', ip='10.0.0.6/8' )

    h7 = net.addHost( 'h7', mac='00:00:00:00:00:07', ip='10.0.0.7/8' )

    h8 = net.addHost( 'h8', mac='00:00:00:00:00:08', ip='10.0.0.8/8' )

    h9 = net.addHost( 'h9', mac='00:00:00:00:00:09', ip='10.0.0.9/8' )

    c10 = net.addController( 'c10', controller=RemoteController, ip='127.0.0.1', port=6633 )

    c11 = net.addController( 'c11', controller=RemoteController, ip='127.0.0.1', port=5566 )

 

    print "*** Creating links"

    net.addLink(s3, h9, 4, 0, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s3, h8, 3, 0, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s5, s3, 2, 2, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s4, s5, 2, 1, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s2, s3, 3, 1, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(h7, s2, 0, 2, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s1, s4, 3, 1, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s1, s2, 2, 1, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(h6, s1, 0, 1, bw=1, delay='1ms', max_queue_size=20, loss=0)

    net.addLink(s2, s4, 4, 3, bw=1, delay='1ms', max_queue_size=20, loss=0)

 

    print "*** Starting network"

    net.build()

    c10.start()

    s3.start( [c10,c11] )

    s5.start( [c10,c11] )

    s4.start( [c10,c11] )

    s2.start( [c10,c11] )

    s1.start( [c10,c11] )

    h6.cmd('arp -s 10.0.0.8 00:00:00:00:00:08')

    h7.cmd('arp -s 10.0.0.9 00:00:00:00:00:09')

    h8.cmd('arp -s 10.0.0.6 00:00:00:00:00:06')

    h9.cmd('arp -s 10.0.0.7 00:00:00:00:00:07')

    #wait for pyretic to learn the topology

    time.sleep(3)

    h6.cmdPrint("ping -c 3 10.0.0.8")

    print "\nstart=",time.time()

    h8.cmd('./myrtg_svc -u > myrd &')

    h6.cmd('./mystg_svc -trace st 10.0.0.8 &')

    h9.cmd('iperf -s -u &')

    time.sleep(3)

    h7.cmd('iperf -c 10.0.0.9 -u -b 600000 -t 10')

    print "end=",time.time() 

    h8.cmd(" kill -9 $(ps aux | grep myrtg_svc | awk '{print $2}') ")

   

    #print "*** Running CLI"

    #CLI( net )

    h8.cmdPrint(" kill -9 $(ps aux | grep pox.py | awk '{print $2}') ")

    h8.cmdPrint(" kill -9 $(ps aux | grep pyretic | awk '{print $2}') ")

   

    print "*** Stopping network"

    net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()

 

pox controller module: with_pyretic2.py (monitor)

from pox.core import core

import pox.openflow.libopenflow_01 as of

from pox.lib.util import dpidToStr

from pox.lib.addresses import IPAddr, EthAddr

from pox.lib.revent import *

from collections import defaultdict

from pox.openflow.discovery import Discovery

from pox.lib.util import dpidToStr

 

# include as part of the betta branch

from pox.openflow.of_json import *

from pox.lib.recoco import Timer

import time

import socket

import threading

 

log = core.getLogger()

 

#adjacency map [sw1][sw2]->port from sw1 to sw2

adjacency=defaultdict(lambda:defaultdict(lambda:None))

 

switches = []

 

#link bandwidth consumption [sw1][sw2]->bandwidth consumed

link_bw=defaultdict(lambda:defaultdict(lambda:None))

byte=defaultdict(lambda:defaultdict(lambda:None))

clock=defaultdict(lambda:defaultdict(lambda:None))

 

def _timer_func ():

  for connection in core.openflow._connections.values():

    connection.send(of.ofp_stats_request(body=of.ofp_port_stats_request()))

 

def _handle_portstats_received (event):

  print "switch=", dpidToStr(event.connection.dpid)

  for f in event.stats:

    if int(f.port_no)<65534:

      for p in switches:

        if adjacency[event.connection.dpid][p]!=None and adjacency[event.connection.dpid][p]==f.port_no:

          #print "   PortNo:", f.port_no, " Fwd's Pkts:", f.tx_packets, " Fwd's Bytes:", f.tx_bytes

          if byte[event.connection.dpid][p]>0:  

              link_bw[event.connection.dpid][p]=(f.tx_bytes - byte[event.connection.dpid][p]) * 8.0 / (time.time()-clock[event.connection.dpid][p])

              print "link[",event.connection.dpid,"][",p,"]=",link_bw[event.connection.dpid][p], "bps"

          byte[event.connection.dpid][p]=f.tx_bytes

          clock[event.connection.dpid][p]=time.time()

  print "============================================================================"

   

def _handle_ConnectionUp (event):

  switches.append(event.connection.dpid)

  #print "dpid=", dpidToStr(event.connection.dpid)

 

class l2_multi (EventMixin):

  def __init__ (self):

    # Listen to dependencies

    def startup ():

      core.openflow.addListeners(self, priority=0)

      core.openflow_discovery.addListeners(self)

    core.call_when_ready(startup, ('openflow','openflow_discovery'))

 

  def _handle_LinkEvent (self, event):

    def flip (link):

      return Discovery.Link(link[2],link[3], link[0],link[1])

 

    l = event.link

    sw1 = l.dpid1

    sw2 = l.dpid2

 

    if adjacency[sw1][sw2] is None:

     if flip(l) in core.openflow_discovery.adjacency:

       adjacency[sw1][sw2] = l.port1

       adjacency[sw2][sw1] = l.port2

 

def send_results():

  UDP_IP = "127.0.0.1"  # The address of the receiver

  UDP_PORT = 5678      # The port the receiver will be listening to.

  my_skt = socket.socket(type=socket.SOCK_DGRAM)

 

  for p in switches:

   for q in switches:

    if adjacency[p][q]!=None and link_bw[p][q] > 0.0:

      msg = str(p) + " " + str(q) + " " + str(link_bw[p][q])

      my_skt.sendto(msg, (UDP_IP, UDP_PORT))

  mythread = threading.Timer(1.0, send_results)

  mythread.start()

 

 

def launch ():

  core.registerNew(l2_multi)

  core.openflow.addListenerByName("ConnectionUp", _handle_ConnectionUp)

  core.openflow.addListenerByName("PortStatsReceived", _handle_portstats_received)

  Timer(1, _timer_func, recurring=True)

  mythread = threading.Timer(1.0, send_results)

  mythread.start()

 

pyretic controller:dijkstra_arp2.py (path change: video)

from pyretic.lib.corelib import*

from pyretic.lib.std import *

from multiprocessing import Lock

from pyretic.lib.query import *

from collections import defaultdict

import socket

import threading

 

ip6 = IPAddr('10.0.0.6')

ip7 = IPAddr('10.0.0.7')

ip8 = IPAddr('10.0.0.8')

ip9 = IPAddr('10.0.0.9')

mac6 = MAC("00:00:00:00:00:06")

mac7 = MAC("00:00:00:00:00:07")

mac8 = MAC("00:00:00:00:00:08")

mac9 = MAC("00:00:00:00:00:09")

video_path = []

bg_path = []

 

#switches

switches = []

 

#myhost[srcmac]->(switch, port)

myhost={}

 

#adjacency map [sw1][sw2]->port from sw1 to sw2

adjacency=defaultdict(lambda:defaultdict(lambda:None))

weight=defaultdict(lambda:defaultdict(lambda:None))

 

#link bandwidth consumption [sw1][sw2]->bandwidth consumed

link_bw=defaultdict(lambda:defaultdict(lambda:None))

 

c = 0

 

def minimum_distance(distance, Q):

  min = float('Inf')

  node = 0

  for v in Q:

    if distance[v] < min:

      min = distance[v]

      node = v

  return node

 

def get_path (src,dst,first_port,final_port, myweight=0):

  #Dijkstra's algorithm

  print "src=",src," dst=",dst, " first_port=", first_port, " final_port=", final_port

  distance = {}

  previous = {}

 

  #if myweight==1:

  # print "weight=",weight

 

  for dpid in switches:

    distance[dpid] = float('Inf')

    previous[dpid] = None

 

  distance[src]=0

  Q=set(switches)

   

  while len(Q)>0:

    u = minimum_distance(distance, Q)

    Q.remove(u)

   

    for p in switches:

      if adjacency[u][p]!=None:

        if myweight==0:

          w = 1

        else:

          w = weight[str(u)][str(p)]

        if distance[u] + w < distance[p]:

          distance[p] = distance[u] + w

          previous[p] = u

 

  r=[]

  p=dst

  r.append(p)

  q=previous[p]

  while q is not None:

    if q == src:

      r.append(q)

      break

    p=q

    r.append(p)

    q=previous[p]

 

  r.reverse()

  if src==dst:

    path=[src]

  else:

    path=r

  return r

 

def add_ports(path,src,dst,first_port,final_port):

  # Now add the ports

  r = []

  in_port = first_port

  for s1,s2 in zip(path[:-1],path[1:]):

    out_port = adjacency[s1][s2]

    r.append((s1,in_port,out_port))

    in_port = adjacency[s2][s1]

  r.append((dst,in_port,final_port))

  return r

 

class find_route(DynamicPolicy):

  def __init__(self):

    super(find_route,self).__init__()

    self.flood = flood()

    self.set_initial_state()

    self.thread = threading.Timer(1.0, self.handle_function)

    self.thread.start()

 

  def handle_function(self):

    global c

    #print time.time(), " handle_function is called"

    if c == 0 :

      self.thread = threading.Timer(1.0, self.handle_function)

      self.thread.start()

    else:

      p1 = get_path(myhost[mac6][0], myhost[mac8][0],myhost[mac6][1], myhost[mac8][1], myweight=1)

      print "New Path:", p1

       

      path_with_ports=add_ports(p1,myhost[mac6][0], myhost[mac8][0],myhost[mac6][1], myhost[mac8][1])

      #print path_with_ports

       

      new_r = parallel([(match(switch=a,srcip=ip6,dstip=ip8) >> fwd(c)) for a,b,c in path_with_ports])

      self.forward = if_(match(dstip=ip8,srcip=ip6),new_r,self.forward)

      self.update_policy()

    

  def set_initial_state(self):

    self.query = packets(1,['srcmac','dstmac', 'srcip', 'dstip'])

    self.query.register_callback(self.myroute)

    self.forward = self.flood

    self.update_policy()

 

  def set_network(self,network):

    self.set_initial_state()

 

  def update_policy(self):

    self.policy = self.forward + self.query

 

  def myroute(self,pkt):

    #print pkt['srcmac'], pkt['dstmac'], pkt['srcip'], pkt['dstip']

    if (pkt['srcmac'] not in myhost.keys()) or (pkt['dstmac'] not in myhost.keys()):

      return

    #print myhost[pkt['srcmac']][0], myhost[pkt['dstmac']][0]

    #if match(ethtype=IP_TYPE):

    #  print "ipv4 packet"

    p1 = get_path(myhost[pkt['srcmac']][0], myhost[pkt['dstmac']][0],myhost[pkt['srcmac']][1], myhost[pkt['dstmac']][1])

    print p1

 

    path_with_ports=add_ports(p1,myhost[pkt['srcmac']][0], myhost[pkt['dstmac']][0],myhost[pkt['srcmac']][1], myhost[pkt['dstmac']][1])

    #print path_with_ports

 

    if pkt['srcip']==ip6 and pkt['dstip']==ip8:

      for i in range(len(p1)-1):

        video_path.append((p1[i], p1[i+1])) 

      #print "video_path=", video_path

    if pkt['srcip']==ip7 and pkt['dstip']==ip9:

      for i in range(len(p1)-1):

        bg_path.append((p1[i], p1[i+1])) 

      #print "background traffic path=", bg_path

 

    r1 = parallel([(match(switch=a,srcip=pkt['srcip'],dstip=pkt['dstip']) >> fwd(c)) for a,b,c in path_with_ports])

    #print r1

   

    self.forward = if_(match(dstip=pkt['dstip'],srcip=pkt['srcip']),r1,self.forward)

    self.update_policy()

  

class find_switch(DynamicPolicy):

    def __init__(self):

        self.last_topology = None

        self.lock = Lock()

        super(find_switch,self).__init__()

 

    def set_network(self, network):

        with self.lock:

            for x in network.switch_list():

              switches.append(x)

            for (s1,s2,data) in network.topology.edges(data=True):

              adjacency[s1][s2]=data[s1]

              adjacency[s2][s1]=data[s2]

            self.last_topology = network.topology

          

def arp_and_ip():

  myhost[MAC("00:00:00:00:00:06")]=(1,1)

  myhost[MAC("00:00:00:00:00:07")]=(2,2)

  myhost[MAC("00:00:00:00:00:08")]=(3,3)

  myhost[MAC("00:00:00:00:00:09")]=(3,4)

  return if_(match(ethtype=ARP_TYPE), drop, find_route())

  #return if_(match(ethtype=ARP_TYPE), flood(), find_route())

 

def get_results():

  global c

  UDP_IP = "127.0.0.1"  # This is the address where the receiver is running

  UDP_PORT = 5678      # This needs to match the port the sender is sending to.

  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP

  sock.bind((UDP_IP, UDP_PORT))

  while True:

    data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes

    #print "Now:", time.time(), " received message:", data

    a=data.split(' ')

    link_bw[str(a[0])][str(a[1])]=float(a[2])

    abw=1024000 - float(a[2])

    #print "abw[", str(a[0]), "][", str(a[1]), "]=", abw

    weight[str(a[0])][str(a[1])] = 1

    if abw < 100000:

      print "link[", str(a[0]), "][", str(a[1]), "] is conested"

      weight[str(a[0])][str(a[1])] = float('Inf')

      for b in video_path:

        #print "b=", b, b[0], b[1], str(a[0]), str(a[1])

        if int(a[0]) == int(b[0]) and int(a[1]) == int(b[1]):

          c = 9999

        else:

          c = 1

      if c == 9999:

        break  

  print "get_results() is done"

        

def main():

  mythread = threading.Thread(target=get_results)

  mythread.start()

  return ( find_switch() + arp_and_ip())

 

pyretic controller:dijkstra_arp3.py (path change: background traffic)

from pyretic.lib.corelib import*

from pyretic.lib.std import *

from multiprocessing import Lock

from pyretic.lib.query import *

from collections import defaultdict

import socket

import threading

 

ip6 = IPAddr('10.0.0.6')

ip7 = IPAddr('10.0.0.7')

ip8 = IPAddr('10.0.0.8')

ip9 = IPAddr('10.0.0.9')

mac6 = MAC("00:00:00:00:00:06")

mac7 = MAC("00:00:00:00:00:07")

mac8 = MAC("00:00:00:00:00:08")

mac9 = MAC("00:00:00:00:00:09")

video_path = []

bg_path = []

 

#switches

switches = []

 

#myhost[srcmac]->(switch, port)

myhost={}

 

#adjacency map [sw1][sw2]->port from sw1 to sw2

adjacency=defaultdict(lambda:defaultdict(lambda:None))

weight=defaultdict(lambda:defaultdict(lambda:None))

 

#link bandwidth consumption [sw1][sw2]->bandwidth consumed

link_bw=defaultdict(lambda:defaultdict(lambda:None))

 

c = 0

 

def minimum_distance(distance, Q):

  min = float('Inf')

  node = 0

  for v in Q:

    if distance[v] < min:

      min = distance[v]

      node = v

  return node

 

def get_path (src,dst,first_port,final_port, myweight=0):

  #Dijkstra's algorithm

  print "src=",src," dst=",dst, " first_port=", first_port, " final_port=", final_port

  distance = {}

  previous = {}

 

  #if myweight==1:

  # print "weight=",weight

 

  for dpid in switches:

    distance[dpid] = float('Inf')

    previous[dpid] = None

 

  distance[src]=0

  Q=set(switches)

   

  while len(Q)>0:

    u = minimum_distance(distance, Q)

    Q.remove(u)

   

    for p in switches:

      if adjacency[u][p]!=None:

        if myweight==0:

          w = 1

        else:

          w = weight[str(u)][str(p)]

        if distance[u] + w < distance[p]:

          distance[p] = distance[u] + w

          previous[p] = u

 

  r=[]

  p=dst

  r.append(p)

  q=previous[p]

  while q is not None:

    if q == src:

      r.append(q)

      break

    p=q

    r.append(p)

    q=previous[p]

 

  r.reverse()

  if src==dst:

    path=[src]

  else:

    path=r

  return r

 

def add_ports(path,src,dst,first_port,final_port):

  # Now add the ports

  r = []

  in_port = first_port

  for s1,s2 in zip(path[:-1],path[1:]):

    out_port = adjacency[s1][s2]

    r.append((s1,in_port,out_port))

    in_port = adjacency[s2][s1]

  r.append((dst,in_port,final_port))

  return r

 

class find_route(DynamicPolicy):

  def __init__(self):

    super(find_route,self).__init__()

    self.flood = flood()

    self.set_initial_state()

    self.thread = threading.Timer(1.0, self.handle_function)

    self.thread.start()

 

  def handle_function(self):

    global c

    #print time.time(), " handle_function is called"

    if c == 0 :

      self.thread = threading.Timer(1.0, self.handle_function)

      self.thread.start()

    else:

      p1 = get_path(myhost[mac7][0], myhost[mac9][0],myhost[mac7][1], myhost[mac9][1], myweight=1)

      print "New Path:", p1

       

      path_with_ports=add_ports(p1,myhost[mac7][0], myhost[mac9][0],myhost[mac7][1], myhost[mac9][1])

      #print path_with_ports

       

      new_r = parallel([(match(switch=a,srcip=ip7,dstip=ip9) >> fwd(c)) for a,b,c in path_with_ports])

      self.forward = if_(match(dstip=ip9,srcip=ip7),new_r,self.forward)

      self.update_policy()

    

  def set_initial_state(self):

    self.query = packets(1,['srcmac','dstmac', 'srcip', 'dstip'])

    self.query.register_callback(self.myroute)

    self.forward = self.flood

    self.update_policy()

 

  def set_network(self,network):

    self.set_initial_state()

 

  def update_policy(self):

    self.policy = self.forward + self.query

 

  def myroute(self,pkt):

    #print pkt['srcmac'], pkt['dstmac'], pkt['srcip'], pkt['dstip']

    if (pkt['srcmac'] not in myhost.keys()) or (pkt['dstmac'] not in myhost.keys()):

      return

    #print myhost[pkt['srcmac']][0], myhost[pkt['dstmac']][0]

    #if match(ethtype=IP_TYPE):

    #  print "ipv4 packet"

    p1 = get_path(myhost[pkt['srcmac']][0], myhost[pkt['dstmac']][0],myhost[pkt['srcmac']][1], myhost[pkt['dstmac']][1])

    print p1

 

    path_with_ports=add_ports(p1,myhost[pkt['srcmac']][0], myhost[pkt['dstmac']][0],myhost[pkt['srcmac']][1], myhost[pkt['dstmac']][1])

    #print path_with_ports

 

    if pkt['srcip']==ip6 and pkt['dstip']==ip8:

      for i in range(len(p1)-1):

        video_path.append((p1[i], p1[i+1])) 

      #print "video_path=", video_path

    if pkt['srcip']==ip7 and pkt['dstip']==ip9:

      for i in range(len(p1)-1):

        bg_path.append((p1[i], p1[i+1])) 

      #print "background traffic path=", bg_path

 

    r1 = parallel([(match(switch=a,srcip=pkt['srcip'],dstip=pkt['dstip']) >> fwd(c)) for a,b,c in path_with_ports])

    #print r1

   

    self.forward = if_(match(dstip=pkt['dstip'],srcip=pkt['srcip']),r1,self.forward)

    self.update_policy()

  

class find_switch(DynamicPolicy):

    def __init__(self):

        self.last_topology = None

        self.lock = Lock()

        super(find_switch,self).__init__()

 

    def set_network(self, network):

        with self.lock:

            for x in network.switch_list():

              switches.append(x)

            for (s1,s2,data) in network.topology.edges(data=True):

              adjacency[s1][s2]=data[s1]

              adjacency[s2][s1]=data[s2]

            self.last_topology = network.topology

          

def arp_and_ip():

  myhost[MAC("00:00:00:00:00:06")]=(1,1)

  myhost[MAC("00:00:00:00:00:07")]=(2,2)

  myhost[MAC("00:00:00:00:00:08")]=(3,3)

  myhost[MAC("00:00:00:00:00:09")]=(3,4)

  return if_(match(ethtype=ARP_TYPE), drop, find_route())

  #return if_(match(ethtype=ARP_TYPE), flood(), find_route())

 

def get_results():

  global c

  UDP_IP = "127.0.0.1"  # This is the address where the receiver is running

  UDP_PORT = 5678      # This needs to match the port the sender is sending to.

  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP

  sock.bind((UDP_IP, UDP_PORT))

  while True:

    data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes

    #print "Now:", time.time(), " received message:", data

    a=data.split(' ')

    link_bw[str(a[0])][str(a[1])]=float(a[2])

    abw=1024000 - float(a[2])

    #print "abw[", str(a[0]), "][", str(a[1]), "]=", abw

    weight[str(a[0])][str(a[1])] = 1

    if abw < 100000:

      print "link[", str(a[0]), "][", str(a[1]), "] is conested"

      weight[str(a[0])][str(a[1])] = float('Inf')

      for b in video_path:

        #print "b=", b, b[0], b[1], str(a[0]), str(a[1])

        if int(a[0]) == int(b[0]) and int(a[1]) == int(b[1]):

          c = 9999

        else:

          c = 1

      if c == 9999:

        break  

  print "get_results() is done"

        

def main():

  mythread = threading.Thread(target=get_results)

  mythread.start()

  return ( find_switch() + arp_and_ip())

 

execution

1. path change: video (background traffic使用原路徑, video切換路徑)

 

original path for video traffic: 1->2->3

new path for video traffic: 1->4>5->3

 

video quality evaluation

 

 

Average PSNR:31.7 db

 

 

2 1. path change: background traffic (video使用原路徑,background traffic切換路徑)

 

original path for background traffic:  2->3

new path for background traffic: 2->4>5->3

 

video quality evaluation

 

Average PSNR: 33db

 

Dr. Chih-Heng Ke

Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan

Email: smallko@gmail.com