Vous êtes sur la page 1sur 2

Lab 03: Action at Network Layer

May 7
, 2014 : 9 to 12.45
(I yo! are "one with thi# $ab beore 12.45%&, %$ea#e %rocee" with Lab04.'
1. Understand the operation of various mechanisms/protocols that operate at network layer: IP
fragmentation, D!P, I!"P.
+enera$ in#tr!ction#:
1. This lab is to be done in groups of two.
2. There is a .tgz file corresponding to this lab (lab03-files.tgz). Download it and untar it using the
command tar -zxvf lab03-files.tgz.
3. In some of the exercises, I will specify a goal. You job is to design an experiment that meets the goal,
conduct it and answer the questions asked.
4. Create a directory called <remote_center_id1>_<remote_center_id2>_lab03. Open a file lab03.txt
inside the directory using a text editor. As you proceed with the lab instructions below, for each
exercise, note down the answers to the exercise along with any interesting observations in the file.
Take care to ensure that the content in the file is neatly organized.
5. At the end of the lab hours, pair up with another group and exchange your directories. A file with
correct answers will be provided on bodhitree.cse.iitb.ac.in (same place as where you downloaded
the assignment). Please check each others answers against the file and discuss the same for better
6. You may want to zip up your directory and email/save it for later reference.

1. "an pages of the commands.
#. $ideo/slides of %IP packet format%, %&'taining IP (ddresses% and %)upporting Protocols%, all under
%*etwork +ayer%.

Lab In#tr!ction#:
!ol. Proto,oa has read up on network layer protocols. e wants to relate theory to practice. e has many
-uestions, help him design the right e.periments that will answer his -uestions. /he colonel has little
patience with irrelevant details, so ensure in each e.periment that you capture the right set of packets.
-.erci#e 1: I/ 0ra1&entation
/he !olonel saw the IP packet format and is particularly fascinated 'y the fragmentation fields and wants to
see it in action. Design an e.periment where 10 *o fragmentation occurs and #0 1ragmentation occurs.
1. 3ou are yet to cover socket programming. 4sendUDP.c5 is a simple socket program 6provided in the
directory0 that generates a single IP packet of a given si,e and sends it to the specified destination IP
address. !ompile the program and design your e.periment around it.
#. 7hich destination IP address should you use8 /ry 'oth an e.isting host and non9e.istant host within
su'net and see what happens.
(nswer the following -uestions in your report.
1. )pecify the e.act commands used to conduct the e.periment.
#. 1or the case when no fragmentation happened, note down the values corresponding to the following
fields: /otal length, Identifier, flags and fragment offset. 7hy is the total length field so8
;. 1or the case when fragmentation happened, for each fragment, note down the values corresponding
to the following fields: /otal length, Identifier, flags and fragment offset. Do the values make sense
'ased on what was covered in theory8
-.erci#e 2: 2yna&ic 3o#t 4oni1!ration /rotoco$ (234/'
/he !olonel is e-ually fascinated 'y how hosts o'tain IP address and wants to look at the message e.change
of this process. &ne of his staff already procured such a trace, help him interpret the trace.
1. !onfiguring IP addresses re-uires root permission. )ince you do not have these privileges, for this
e.ercise you will have to make do with a generated trace file 4dhcp.out5. /his trace file was
generated using tcpdump and running 4dhclient eth<5 on a terminal with root permissions. =.plore it
via wireshark.
(nswer the following -uestions
1. 7hat is the IP address of the D!P server and on what port is it listening on8
#. 7as any D!P relay involved in forwarding the D!P packets8 ow did you determine the answer.
;. 7hen the D!P server replied, which IP address did it reply to8 (nd why8
>. 7hat is the offered IP address to the client and for how long is this address valid8
?. (part from the IP address, what additional information has the client received from the dhcp server8
-.erci#e 3: Internet 4ontro$ Me##a1e /rotoco$ (I4M/'
/he !olonel read a'out the different types of I!"P messages and wants to look at them in a packet trace. e
wants to look at the following ; types.
/ype <, code <
/ype ;, code ;
/ype @, code <
Design e.periments that will produce I!"P messages of the a'ove type in a packet trace.
:uestion: 7hich commands did you use to generate the a'ove I!"P message types.
-.erci#e 4: More Internet 4ontro$ Me##a1e /rotoco$ (I4M/'
/he !olonel%s collegue 6who in far away as an undercover agent0 often complains that he doesn%t get time9
critical messages on time. /he colonel who now knows enough theory wants to de'ug this. e feels its
likely due to too many routers in 'etween and feels %tracepath% is the right command to use. elp him
interpret the output of the command and the trace collected.
1. /raceroute is not availa'le on the &)+ machines 6permission issues0. )o for this, use tracepath which
is very similar to traceroute.
#. 7hen tracing the path to a host, select a host that is not on the same physical network as your
machine 6e.g. www.ee.iit'.ac.in, www.math.iit'.ac.in, www.iit'.ac.in0. &therwise, its too trivial with
a hop count of 1.
1. )pecify the command used and cut/paste the output you saw.
#. 7hat I!"P message type/code is involved in the process8
;. =.plain how this command works 'y looking at the trace file and the output produced 'y running the
>. 7hat is the IP address of your machine%s default router8