Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Network Simulation and Testing Polly Huang EE NTU

Similar presentations


Presentation on theme: "1 Network Simulation and Testing Polly Huang EE NTU"— Presentation transcript:

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

2 2 Testing on Real Systems dummynet

3 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 4 Today Advanced features Largely based on Luigi’s slides

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

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

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

8 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 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 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 11 The Rules of Multipath Filtering For each packet arriving at the dummynet –Match the 1 st 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 12 Illustration of the Multi-Filtering Filter 1 0.33 Filter 2 0.67 0.5 Pipe 1Pipe 2Pipe 3 Filter 2 1 0 else drop Higher-level processes out-traffic

13 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 14 Dynamic Pipe Example ipfw pipe 1 config bw 2Mbits/s delay 80ms mask src-ip 0x000000ff

15 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 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 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 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 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 20 Dynamic Queuing The idea is similar to dynamic piping ipfw queue 1 config pipe 10 weight 50 mask src-ip 000000ff

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

22 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 23 Adding to dummynet Modify –ip_fw.c –ip_dymmynet.c The BSD kernel is –Very modular –Extensively commented

24 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 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 26 Next Week Laptops –Running FreeBSD –With access to FreeBSD FreeBSD –The kernel with proper options


Download ppt "1 Network Simulation and Testing Polly Huang EE NTU"

Similar presentations


Ads by Google