TWiki
>
CS450fall09 Web
>
Homework7
(revision 1) (raw view)
Edit
Attach
---+ Homework 7 - parsing packet traces - due 10/26 In this homework, we use libpcap to analyze packet traces captured with tcpdump. You can use "man pcap" to learn about the pcap API. libpcap gives us one packet at a time, in the order that they originally arrived. It is up to us to process the packets, and try to learn something from them. Our interest in this homework is to reconstruct the data flowing between hosts, based on tcpdump traces. We will focus on TCP flows, and a key aspect of the homework is the reassembly of TCP packets into the original data. A correct submission will contain the following * A Makefile that, given simply the command "make", produces an executable called 'hw7'. * The hw7 binary takes two command line arguments: an input file (produced by tcpdump -w), and a directory for output files. * Running hw7 produces a table of flows, per (unidirectional) flow, identified by src ip/port, dst ip/port. For each flow, the number of segments and *data payload* bytes in each direction should be listed. * In the directory indicated, a file for each flow named as follows: SRCIP.SRCPORT-DSTIP.DSTPORT.log * Each of these files should contain all *payload data* (no IP/TCP headers) sent over each flow. Take care to handle packet duplicates and reordering! For example, it may say <verbatim> ~> hw6 thetrace thedirectory SRC IP/PORT DST IP/PORT BYTES PACKETS a.b.c.d/8484 e.f.g.h/80 12205 2115 e.f.g.h/80 a.b.c.d/8484 3555 223 a.b.c.d/22 e.f.g.i/19495 1205 211 e.f.g.i/19495 a.b.c.d/22 335 32 </verbatim> and thedirectory would contain the files <verbatim> ~> ls thedirectory a.b.c.d.8484-e.f.g.h.80 e.f.g.h.80-a.b.c.d.8484 a.b.c.d.22-e.f.g.i/19495 e.f.g.i/19495-a.b.c.d.22 </verbatim> An example tcpdump tracefile is included in the hw7 template directory. However, it would be advisable to record your own traces and try your solution on them as well. When grading, we will use this file as well as another dump containing some tcp flows. ---++ Hints Read the ip and tcp header structure definitions in /usr/include/netinet/ip.h and tcp.h. Use tcpdump / wireshark to verify that your code is parsing the packets correctly. Use lseek/fseek to jump to an arbitrary point in a file, even beyond its current size. inet_ntoa() is a handy function for printing IP addresses. However, beware: it uses a static char array internally, no memory is allocated for the return value! Make sure to store the initial sequence number of each flow when it gets established.
Edit
|
Attach
|
P
rint version
|
H
istory
:
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2009-10-19 - 05:10:55 - Main.jakob
CS450fall09
Syllabus
Lecture Notes
-
References
Homeworks
-
Subversion
-
VMWare
-
schedule
-
hints
list archives
FAQ
ERF2054 map
[edit this
]
Log In
CS450fall09 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
ABOUT US
Our Department
Recent News
Contact Us
ACADEMICS
Prospective Students
Undergraduate
CS Minor
Graduate
Courses
RESEARCH
Overview
By Faculty
Labs
PEOPLE
Faculty
Adjuncts
Staff
Students
Alumni
Copyright 2016 The Board of Trustees
of the University of Illinois.
webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF