123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <!--Converted with LaTeX2HTML 2002-2 (1.70)
- original version by: Nikos Drakos, CBLU, University of Leeds
- * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
- * with significant contributions from:
- Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
- <HTML>
- <HEAD>
- <TITLE>3 Design Thoughts</TITLE>
- <META NAME="description" CONTENT="3 Design Thoughts">
- <META NAME="keywords" CONTENT="flowreplay">
- <META NAME="resource-type" CONTENT="document">
- <META NAME="distribution" CONTENT="global">
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2">
- <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
- <LINK REL="STYLESHEET" HREF="flowreplay.css">
- <LINK REL="next" HREF="node4.html">
- <LINK REL="previous" HREF="node2.html">
- <LINK REL="up" HREF="flowreplay.html">
- <LINK REL="next" HREF="node4.html">
- </HEAD>
- <BODY >
- <DIV CLASS="navigation"><!--Navigation Panel-->
- <A NAME="tex2html58"
- HREF="node4.html">
- <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
- <A NAME="tex2html56"
- HREF="flowreplay.html">
- <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
- <A NAME="tex2html50"
- HREF="node2.html">
- <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
- <BR>
- <B> Next:</B> <A NAME="tex2html59"
- HREF="node4.html">4 Multiple Independent Flows</A>
- <B> Up:</B> <A NAME="tex2html57"
- HREF="flowreplay.html">Flowreplay Design Notes</A>
- <B> Previous:</B> <A NAME="tex2html51"
- HREF="node2.html">2 Features</A>
- <BR>
- <BR></DIV>
- <!--End of Navigation Panel-->
- <!--Table of Child-Links-->
- <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
- <UL CLASS="ChildLinks">
- <LI><A NAME="tex2html60"
- HREF="node3.html#SECTION00031000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> <SPAN ID="hue96">Sending and Receiving traffic</SPAN></A>
- <LI><A NAME="tex2html61"
- HREF="node3.html#SECTION00032000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN> <SPAN ID="hue120">Handling Multiple Connections</SPAN></A>
- <LI><A NAME="tex2html62"
- HREF="node3.html#SECTION00033000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN> <SPAN ID="hue129">Data Synchronization</SPAN></A>
- <LI><A NAME="tex2html63"
- HREF="node3.html#SECTION00034000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> <SPAN ID="hue134">TCP/IP</SPAN></A>
- </UL>
- <!--End of Table of Child-Links-->
- <HR>
- <H1><A NAME="SECTION00030000000000000000">
- <SPAN CLASS="arabic">3</SPAN> <SPAN ID="hue94">Design Thoughts</SPAN></A>
- </H1>
- <P>
- <H2><A NAME="SECTION00031000000000000000">
- <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> <SPAN ID="hue96">Sending and Receiving traffic</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue98">Flowreplay must be able to process multiple connections
- to one or more devices. There are two options:</SPAN>
- <P>
- <OL>
- <LI><SPAN ID="hue101">Use sockets</SPAN><A NAME="tex2html2"
- HREF="#foot371"><SUP><SPAN CLASS="arabic">2</SPAN></SUP></A> <SPAN ID="hue105">to send and receive data</SPAN>
- </LI>
- <LI><SPAN ID="hue107">Use libpcap</SPAN><A NAME="tex2html3"
- HREF="#foot372"><SUP><SPAN CLASS="arabic">3</SPAN></SUP></A> <SPAN ID="hue111">to receive packets and libnet</SPAN><A NAME="tex2html4"
- HREF="#foot373"><SUP><SPAN CLASS="arabic">4</SPAN></SUP></A> <SPAN ID="hue115">to send packets</SPAN>
- </LI>
- </OL>
- <SPAN ID="hue118">Although using libpcap/libnet would allow more simultaneous
- connections and greater flexibility, there would be a very high complexity
- cost associated with it. With that in mind, I've decided to use sockets
- to send and receive data.</SPAN>
- <P>
- <H2><A NAME="SECTION00032000000000000000">
- <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN> <SPAN ID="hue120">Handling Multiple Connections</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue122">Because a pcap file can contain multiple simultaneous
- flows, we need to be able to support that too. The biggest problem
- with this is reading packet data in a different order then stored
- in the pcap file. </SPAN>
- <P>
- <SPAN ID="hue124">Reading and writing to multiple sockets is easy
- with select() or poll(), however a pcap file has it's data stored
- serially, but we need to access it randomly. There are a number of
- possible solutions for this such as caching packets in RAM where they
- can be accessed more randomly, creating an index of the packets in
- the pcap file, or converting the pcap file to another format altogether.
- Alternatively, I've started looking at libpcapnav</SPAN><A NAME="tex2html5"
- HREF="#foot125"><SUP><SPAN CLASS="arabic">5</SPAN></SUP></A> <SPAN ID="hue127">as an alternate means to navigate a pcap file and
- process packets out of order.</SPAN>
- <P>
- <H2><A NAME="SECTION00033000000000000000">
- <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN> <SPAN ID="hue129">Data Synchronization</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue376">Knowing when to start sending client traffic in
- response to the server will be "tricky". Without
- understanding the actual protocol involved, probably the best general
- solution is waiting for a given period of time after no more data
- from the server has been received. Not sure what to do if the client
- traffic doesn't elicit a response from the server (implement some
- kind of timeout?). This will be the basis for the default plug-in.</SPAN>
- <P>
- <H2><A NAME="SECTION00034000000000000000">
- <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> <SPAN ID="hue134">TCP/IP</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue136">Dealing with IP fragmentation and TCP stream reassembly
- will be another really complex problem. We're basically talking about
- implementing a significant portion of a TCP/IP stack. One thought
- is to use libnids</SPAN><A NAME="tex2html6"
- HREF="#foot404"><SUP><SPAN CLASS="arabic">6</SPAN></SUP></A> <SPAN ID="hue140">which basically implements a Linux 2.0.37 TCP/IP
- stack in user-space. Other solutions include porting a TCP/IP stack
- from Open/Net/FreeBSD or writing our own custom stack from scratch.</SPAN>
- <P>
- <BR><HR><H4>Footnotes</H4>
- <DL>
- <DT><A NAME="foot371">... </A><A
- HREF="node3.html#tex2html2"><SUP><SPAN CLASS="arabic">2</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue103">socket(2)</SPAN>
- </DD>
- <DT><A NAME="foot372">... </A><A
- HREF="node3.html#tex2html3"><SUP><SPAN CLASS="arabic">3</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue109">http://www.tcpdump.org/</SPAN>
- </DD>
- <DT><A NAME="foot373">... </A><A
- HREF="node3.html#tex2html4"><SUP><SPAN CLASS="arabic">4</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue113">http://www.packetfactory.net/projects/libnet/</SPAN>
- </DD>
- <DT><A NAME="foot125">... </A><A
- HREF="node3.html#tex2html5"><SUP><SPAN CLASS="arabic">5</SPAN></SUP></A></DT>
- <DD>http://netdude.sourceforge.net/
- </DD>
- <DT><A NAME="foot404">... </A><A
- HREF="node3.html#tex2html6"><SUP><SPAN CLASS="arabic">6</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue378">http://www.avet.com.pl/~nergal/libnids/</SPAN>
- </DD>
- </DL>
- <DIV CLASS="navigation"><HR>
- <!--Navigation Panel-->
- <A NAME="tex2html58"
- HREF="node4.html">
- <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
- <A NAME="tex2html56"
- HREF="flowreplay.html">
- <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
- <A NAME="tex2html50"
- HREF="node2.html">
- <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
- <BR>
- <B> Next:</B> <A NAME="tex2html59"
- HREF="node4.html">4 Multiple Independent Flows</A>
- <B> Up:</B> <A NAME="tex2html57"
- HREF="flowreplay.html">Flowreplay Design Notes</A>
- <B> Previous:</B> <A NAME="tex2html51"
- HREF="node2.html">2 Features</A></DIV>
- <!--End of Navigation Panel-->
- <ADDRESS>
- Aaron Turner
- 2006-08-07
- </ADDRESS>
- </BODY>
- </HTML>
|