teaching)computer)) networking)with)mininet)€¦ · teaching)computer)) networking)with)mininet)...

17
Teaching Computer Networking with Mininet TeYuan (TY) Huang Stanford/Ne>lix Aug. 18 th , 2014 Session 2: Handson Lab BufferBloat

Upload: others

Post on 24-Aug-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Teaching  Computer    Networking  with  Mininet  

Te-­‐Yuan  (TY)  Huang  Stanford/Ne>lix  Aug.  18th,  2014  

Session  2:  Hands-­‐on  Lab  -­‐-­‐  BufferBloat  

Page 2: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Goals  of  the  Assignment  

•  Understand  the  dynamics  between  TCP  CWND  and  router’s  buffer  occupancy  

•  Understand  why  large  router  buffer  can  lead  to  poor  TCP  performance  –  I.e.,  the  buffer  bloat  problem  

2  

Page 3: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Outline  of  the  Session  

•  Why  is  Mininet  helpful?  •  Assignment  Overview  •  Behind  the  scene  –  part  1    – Architecture  

•  Time  to  try  it  out!  •  Behind  the  scene  –  part  2  – The  actual  code  

3  

Page 4: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Why  Mininet  is  Helpful?  

•  Easy  to  setup  the  environment  •  Easy  to  access  the  informa^on  – Use  tcpprobe  to  monitor  TCP  CWND  at  sender  – Use  tc  to:  

•  control  the  buffer  size    •  monitor  the  buffer  occupancy  

TCP  CWND  Buffer  Occupancy    

4  

Page 5: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Assignment  Overview  

•  Part  1:  The  setup  

Server  End  Host  Buffer  Size:  150  kB  

(100  pkt)  

RTT  of  h1  to  h2    20ms    

Bobleneck  Router  

5  

Page 6: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Assignment  Overview  

•  Part  2:  CWND  evolu^on  of  a  short  TCP  flow  – The  TCP  flow  is  created  through  a  web  request    – No  compe^ng  flow  on  the  network  – Observe  the  RTT  and  flow  comple^on  ^me  – Think  about  how  the  CWND  is  evolved  

Web  Page  Download   6  

Page 7: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Assignment  Overview  

•  Part  3:  CWND  evolu^on  of  a  long  TCP  flow  – TCP  flow  is  created  through  iperf  – Observe  the  RTT  and  throughput  – Think  about  how  the  CWND  is  evolved  – Observe  how  the  long  flow  affects  the  short  flow  

iperf    

Web  Page  Download   7  

Page 8: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Assignment  Overview  

•  Part  4:  Verify  the  evolu^on  of  CWND  through  Mininet  

•  Part  5:  Explore  a  solu^on:  smaller  buffer  •  Part  6:  Explore  a  solu^on:  separate  queue  for  each  flows  

8  

Page 9: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Behind  the  Scene  –  Part  1  

Each  runs  in  a  container  

Open  VSwitch  h2   h1   9  

Page 10: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Behind  the  Scene  –  Part  1  

h2   h1  

Use  ‘tc’  to  control  the  delay,  link  rate  and  queue  length  

10  

Page 11: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Time  to  try  it  out!  

11  

Page 12: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Topology  

•  Defined  in  bufferbloat.py  

self.addHost('h1')  self.addHost('h2')  

self.addSwitch('s0')  

h2   h1  

self.addLink('h1','s0')  self.addLink('h2',  's0')  

12  

Page 13: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Link  Speed  •  Defined  in  bufferbloat.py  

h2   h1  s0-­‐eth2   h1-­‐eth0  s0-­‐eth1  h2-­‐eth0  

self.addLink('h1','s0')  self.addLink('h2','s0')   self.addLink('h1','s0',  bw=1000)  

self.addLink('h2','s0',  bw=1000)  

1Gb/s  

1Gb/s  

13  

1Gb/s  

Page 14: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Link  Speed  

•  Add  asymmetry  into  the  picture  •  Command  can  be  found  in  tc_cmd.sh    

h2   h1  s0-­‐eth2  

Bobleneck  link  from  s0  -­‐>  h2  1.5Mb/s,  10ms  

14  

Page 15: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Control  Buffer  Size  

•  Command  can  be  found  in  tc_cmd.sh  

h2   h1  s0-­‐eth2   s0-­‐eth1  

Buffer  size  =  100pkt  

15  

Page 16: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Services  on  Hosts  

•  Command  can  be  found  in  bufferbloat.py  

h1.cmd('python2.7  webserver.py')  

h2   h1  

web  server  iperf  receiver  

h2.cmd('iperf  -­‐s')  

16  

Page 17: Teaching)Computer)) Networking)with)Mininet)€¦ · Teaching)Computer)) Networking)with)Mininet) Te5Yuan)(TY))Huang) Stanford/Ne>lix) Aug.)18th,2014 Session)2:)Hands5on)Lab)55)BufferBloat)

Monitor  

•  Code  can  be  found  in  exp_monitor.py  

cat  /proc/net/tcpprobe  

h2   h1  

TCP  CWND  Buffer  Occupancy  

tc  

17