1 / 26

Network Simulation and Testing

Network Simulation and Testing. Polly Huang EE NTU http://cc.ee.ntu.edu.tw/~phuang phuang@cc.ee.ntu.edu.tw. Testing on Real Systems. dummynet. 4 Weeks. Week 1 Introduction, basic features Week 2 Setup and bandwidth management Week 3 Advanced features Week 4

nibal
Download Presentation

Network Simulation and Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Simulation and Testing Polly Huang EE NTU http://cc.ee.ntu.edu.tw/~phuang phuang@cc.ee.ntu.edu.tw

  2. Testing on Real Systems dummynet

  3. 4 Weeks • Week 1 • Introduction, basic features • Week 2 • Setup and bandwidth management • Week 3 • Advanced features • Week 4 • Testing over a simple network

  4. Today • Advanced features • Largely based on Luigi’s slides

  5. Quick Review of Basic Features • Two major components • The pipe • The packet filter • Simple examples • Configuration • System setting

  6. A Simple Example out IP layer 1 2 in Link layer ipfw add pipe 1 ip from any to any in ipfw add pipe 2 ip from any to any out

  7. The Detailed System View Higher-level processes in-pipe ipfw else drop true true out-pipe ipfw else drop in-traffic out-traffic

  8. Advanced Features • Multipath • For packet re-ordering emulation • Dynamic pipes • For automatic per-flow piping • Dynamic queues • For automatic per-flow queuing • Extensions • Bursty loss and delay jitter

  9. Multipath • For emulation of packet re-ordering • The usage • Create multiple paths • Filter packets to these paths based on certain criteria • Currently, the criteria is probabilistic

  10. Multipath Example ipfw pipe 1 config bw 2Mbits/s delay 80ms ipfw pipe 2 config bw 3Mbits/s delay 30ms ipfw pipe 3 config bw 1Mbits/s delay 100ms ipfw add prob 0.33 pipe 1 tcp from me to any ipfw add prob 0.5 pipe 2 tcp from me to any ipfw add prob 1 pipe 3 tcp from me to any

  11. The Rules of Multipath Filtering • For each packet arriving at the dummynet • Match the 1st filter • For each packet arriving at the filter • Take a random number • Check if it falls within the filter probability • If yes, pass packets through the rule pipe • If not, pass packets to the next filter • Recursive use of the ‘packet arriving at the filter’ algorithm

  12. Illustration of the Multi-Filtering Higher-level processes 0.67 Filter 1 0.33 Filter 2 0.5 0.5 Filter 2 0 1 else drop Pipe 1 Pipe 2 Pipe 3 out-traffic

  13. Dynamic Pipes • For per-flow piping and monitoring • The usage • Adding a mask to the source or destination IP • Representing the level of flow classification

  14. Dynamic Pipe Example ipfw pipe 1 config bw 2Mbits/s delay 80ms mask src-ip 0x000000ff

  15. The Rules of Per-Flow Piping mask src-ip 0x000000ff • Packet src/dst addresses are ANDed with the mask • Src/dst addresses masking to the same number belong to the same flow • 256 flows in this example • The number is the flow ID • A pipe of the same configuration is created per flow

  16. WFQ • Weighted Fair Queuing • For sharing of bandwidth • Statistical limitation • One pipe for all flows • A flow-based queue to determine which flow gets how much bandwidth share

  17. WFQ Example ipfw pipe 10 config bw 2Mbits/s ipfw queue 1 config pipe 10 weight 50 ipfw queue 2 config pipe 10 weight 20 ipfw queue 3 config pipe 10 weight 1 ipfw add queue 1 tcp from me to any ssh ipfw add queue 1 udp from me to any 53 ipfw add queue 2 tcp from me to any 25 ipfw add queue 3 IP from me to any

  18. Calculating the Share • Sum all the weights • The flow gets the fraction of bandwidth proportional to • The ratio of its weight to the sum

  19. Statistical Sharing • Note the distinction of statistical bandwidth limitation to deterministic • One flow can get the whole bandwidth if no one else is in queue

  20. Dynamic Queuing • The idea is similar to dynamic piping ipfw queue 1 config pipe 10 weight 50 mask src-ip 000000ff

  21. Extension • What if we want to emulate • Bursty losses • Delay jitter

  22. Using Existing Mechanism • Bursty losses • Add bursty traffic to compete with the traffic of observation • So that the bursty traffic cause bursty drops to the traffic of observation • Delay jitter • Add varying traffic to cause varying queue size • So that the delay variance is of the traffic of observation goes up

  23. Adding to dummynet • Modify • ip_fw.c • ip_dymmynet.c • The BSD kernel is • Very modular • Extensively commented

  24. Performance • Packet forwarding rate with pipe is a few % lower than without pipe • Packet copying is constant • Queue and pipe schedule is O(logN) • N: number of queues or pipes • Pipe/queue state fetching could be time consuming

  25. Conclusion • Quite easy to use • If installing BSD isn’t a problem • If loading the dummynet kernel isn’t a problem • Quite a bit of applications with the simple functions • Need to be careful about how data flow • Complicated applications might be achievable with a bit of creativity • Usually the hardest part is knowing what to test

  26. Next Week • Laptops • Running FreeBSD • With access to FreeBSD • FreeBSD • The kernel with proper options

More Related