132.65.10.1/0 has the special meaning (for this
exercise only). I want you to look at the type of the IP
address and accept any host from the same network.
If there is "-" before TCP destination port, you should not print
packets belonging to TCP connections, relevant to this port, but have
been initiated before tcpdump utility was started.
dump_info.
dump_info reads tcpdump file from stdin, and for every TCP
connection prints the following information:
- The clients (or the nearest routers) Ethernet address.
- IP address of the peer (not of the w3.cs.huji.ac.il
- TCP port used by the peer.
- The timestamp of the first incoming data packet.
- The timestamp of the last outgoing data packet.
- The number of outgoing data packets.
- The maximal TCP window size of the receiver.
- The ratio of data packets sent by w3.cs.huji.ac.il to number of ACK packets sent by peer.
- The ratio of useful data (without headers) to total amount of bytes sent by w3.cs.huji.ac.il.
An example of the an output
- 00:90:92:F8:90:00 61.24.157.207 5000 343243.24324 343243.56564 3 12000 1.20 0.83
If a parameter is not relevant, please print "X" instead of the
corresponding value.
Tests
Your program will be tested using only the tcpdump.out
file. However I may use any subset of the packets in this file to test your
program. It is strongly recommended to write the generic code. For example, do
not assume that IP header is always of the same size.
Useful Headers
- /usr/include/net/ethernet.h
- /usr/include/netinet/ip.h
- /usr/include/netinet/tcp.h
The Formats
- Time printed in the following format sssssssss.uuuuuu
(seconds and microseconds in host order).
- Ethernet address is printed in the following
form: 00:B0:D0:D4:C0:3C
- IP address is printed in the dotted form:
132.65.200.101
- Ethernet packet type, IP protocol
type and TCP port are printed in decimal format. e.g: 8, 6, 8080 (host order)
- Ratio is to be printed with two signs after the dot.
Tools and Libraries
There are several tools (tcpdump, tcpslice, ...) that could help you
to read and parse the tcpdump file. You are allowed to use those tools
only for verifying your results, while you not allowed to use them as
building blocks. The only exception is pcap library. You are allowed
to use it for both purposes. I am not familiar with this library and I
am not sure that it provides all the functionalities are needed for
the exercise. If you decide to use this library and have a question or
a problem I am afraid I cannot help you!
Design
Please think carefully about the design of your
program. There are many things in common between dump_filter and
dump_info.
Submission
Submit ex3.tar which include sources, Makefile and README.
Please, follow the general instructions in the course guidelines

Go Back to the Computer Communications Course Home Page