TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi...

19
TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole

Transcript of TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi...

Page 1: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

TCPivoA High-Performance Packet

Replay Engine

Wu-chang Feng Ashvin Goel Abdelmajid BezzazWu-chi Feng Jonathan Walpole

Page 2: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

MotivationMany methods for evaluating network devices

SimulationDevice simulated, traffic simulatedns-2, IXP network processor simulator

Model-based emulationActual device, traffic synthetically generated from modelsIXIA traffic generator

Trace-driven emulationActual device, actual traffic traceParticularly good for evaluating functions that rely on actual address mixes and packet interarrival/size distributions

Page 3: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Goal of workPacket replay tool for trace-driven evaluation

AccurateHigh-performanceLow-cost

Commodity hardwareOpen-source software

Solution: TCPivoAccurate replay above OC-3 rates

Pentium 4 Xeon 1.8GHzCustom Linux 2.4.20 kernel with ext3Intel 82544 1000Mbs~$2,000

Page 4: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

ChallengesTrace management

Getting packets from disk

Timer mangement Time-triggering packet transmission

Scheduling and pre-emptionGetting control of the OS

Efficient sending loopSending the packet

Page 5: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Trace management problemGetting packets from disk

Requires intelligent pre-fetchingMost OSes support transparent pre-fetch via fread()

Default Linux fread()latency reading trace

Page 6: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Trace management in TCPivoDouble-buffered pre-fetchingmmap()/madvise()with sequential access hint

Page 7: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Timer management problemMust accurately interrupt OS to send packetsApproaches

Polling loopSpin calling gettimeofday()until time to sendHigh overhead, accurate

usleep()Register timer interruptLow overhead, potentially inaccurate

Examine each approach using fixed workloads1 million packet traceConstant-interarrival times sec, sec

Page 8: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Timer management problemPolling loop

sec78% User-space CPU utilization

sec99% User-space CPU utilization

Page 9: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Timer management problemusleep()

sec40% User-space CPU utilization

sec4% User-space CPU utilization

Page 10: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Timer management in TCPivo“Firm timers”

Combination of periodic and one-shot timers in x86PIT (programmable interval timer)APIC (advanced programmable interrupt controller)Use PIT to get close, use APIC to get the rest of the way

Timer reprogramming and interrupt overhead reduced via soft timers approachTransparently used via changes to usleep()

Page 11: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Timer management in TCPivoFirm timers

sec19% User-space CPU utilization

sec1% User-space CPU utilization

Page 12: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Scheduling and pre-emption problemGetting control of the OS when necessaryLow-latency, pre-emptive kernel patches

Reduce length of critical sections

Examine performance under stressI/O workload

File system stress testContinuously open/read/write/close an 8MB file

Memory workload (see paper)

Page 13: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Scheduling and pre-emption problemFirm timer kernel without low-latency and pre-emptive patchesI/O Workload, sec

Page 14: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Scheduling and pre-emption in TCPivoFirm timer kernel with low-latency and pre-emptive patchesI/O Workload, sec

Page 15: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Efficient sending loop in TCPivoZeroed payloadOptional pre-calculation of packet checksums

Task Average time spent

Trace read 1.30 µsec

Data padding 1.45 µsec

Checksum calculation 1.27 µsec

sendto() 5.16 µsec

Main loop 9.38 µsec

Page 16: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Putting it all togetherOn the wire accuracy

sec workload at the senderPoint-to-point Gigabit Ethernet linkMeasured inter-arrival times of packets at receiver

Page 17: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Software availabilityTCPivo

http://www.cse.ogi.edu/sysl/projects/tcpivoFormerly known as NetVCR before an existing product of the same name forced a change to a less catchier name.

Linux 2.4Firm timers

http://www.cse.ogi.edu/sysl/projects/TSLAndrew Morton's low-latency patch

http://www.zip.com.au/~akpm/linux/schedlat.htmlRobert Love's pre-emptive patch

http://kpreempt.sourceforge.net

Linux 2.5Low-latency, pre-emptive patches includedHigh-resolution timers via 1ms PIT (No firm timer support)

Page 18: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Open issuesMulti-gigabit replay

Zero-copyTOESMP

Accurate, but not realistic for evaluating everythingOpen-loop (not good for AQM)Netbed/PlanetLab?

Requires on-the-fly address rewriting

Page 19: TCPivo A High-Performance Packet Replay Engine Wu-chang Feng Ashvin Goel Abdelmajid Bezzaz Wu-chi Feng Jonathan Walpole.

Questions?