123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <!--Converted with LaTeX2HTML 2002-2-1 (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-1">
- <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="hue95">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="hue119">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="hue128">Data Synchronization</SPAN></A>
- <LI><A NAME="tex2html63"
- HREF="node3.html#SECTION00034000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> <SPAN ID="hue133">TCP/IP</SPAN></A>
- </UL>
- <!--End of Table of Child-Links-->
- <HR>
- <H1><A NAME="SECTION00030000000000000000">
- <SPAN CLASS="arabic">3</SPAN> <SPAN ID="hue93">Design Thoughts</SPAN></A>
- </H1>
- <P>
- <H2><A NAME="SECTION00031000000000000000">
- <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> <SPAN ID="hue95">Sending and Receiving traffic</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue97">Flowreplay must be able to process multiple connections
- to one or more devices. There are two options:</SPAN>
- <P>
- <OL>
- <LI><SPAN ID="hue100">Use sockets</SPAN><A NAME="tex2html2"
- HREF="#foot370"><SUP><SPAN CLASS="arabic">2</SPAN></SUP></A> <SPAN ID="hue104">to send and receive data</SPAN>
- </LI>
- <LI><SPAN ID="hue106">Use libpcap</SPAN><A NAME="tex2html3"
- HREF="#foot371"><SUP><SPAN CLASS="arabic">3</SPAN></SUP></A> <SPAN ID="hue110">to receive packets and libnet</SPAN><A NAME="tex2html4"
- HREF="#foot372"><SUP><SPAN CLASS="arabic">4</SPAN></SUP></A> <SPAN ID="hue114">to send packets</SPAN>
- </LI>
- </OL>
- <SPAN ID="hue117">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="hue119">Handling Multiple Connections</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue121">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="hue123">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="#foot124"><SUP><SPAN CLASS="arabic">5</SPAN></SUP></A> <SPAN ID="hue126">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="hue128">Data Synchronization</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue375">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="hue133">TCP/IP</SPAN></A>
- </H2>
- <P>
- <SPAN ID="hue135">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="#foot403"><SUP><SPAN CLASS="arabic">6</SPAN></SUP></A> <SPAN ID="hue139">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="foot370">... </A><A
- HREF="node3.html#tex2html2"><SUP><SPAN CLASS="arabic">2</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue102">socket(2)</SPAN>
- </DD>
- <DT><A NAME="foot371">... </A><A
- HREF="node3.html#tex2html3"><SUP><SPAN CLASS="arabic">3</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue108">http://www.tcpdump.org/</SPAN>
- </DD>
- <DT><A NAME="foot372">... </A><A
- HREF="node3.html#tex2html4"><SUP><SPAN CLASS="arabic">4</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue112">http://www.packetfactory.net/projects/libnet/</SPAN>
- </DD>
- <DT><A NAME="foot124">... </A><A
- HREF="node3.html#tex2html5"><SUP><SPAN CLASS="arabic">5</SPAN></SUP></A></DT>
- <DD>http://netdude.sourceforge.net/
- </DD>
- <DT><A NAME="foot403">... </A><A
- HREF="node3.html#tex2html6"><SUP><SPAN CLASS="arabic">6</SPAN></SUP></A></DT>
- <DD><SPAN ID="hue377">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
- 2005-06-28
- </ADDRESS>
- </BODY>
- </HTML>
|