TFTP Protocol Trace

Burton Rosenberg
15 March 2003
Figures from RFC 1350


TFTP opcode table

Opcode Operation Description
1 RRQ Read Request
2 WRQ Write Request
3 DATA Data
4 ACK Acknowledgement
5 ERROR Error


TFTP packet formats

            2 bytes     string    1 byte     string   1 byte
            ------------------------------------------------
           | Opcode |  Filename  |   0  |    Mode    |   0  |
            ------------------------------------------------

                       Figure 5-1: RRQ/WRQ packet





                   2 bytes     2 bytes      n bytes
                   ----------------------------------
                  | Opcode |   Block #  |   Data     |
                   ----------------------------------

                        Figure 5-2: DATA packet





                         2 bytes     2 bytes
                         ---------------------
                        | Opcode |   Block #  |
                         ---------------------

                         Figure 5-3: ACK packet




               2 bytes     2 bytes      string    1 byte
               -----------------------------------------
              | Opcode |  ErrorCode |   ErrMsg   |   0  |
               -----------------------------------------

                        Figure 5-4: ERROR packet


TFTP network snap

Script started on Fri Mar 14 17:00:06 2003
sherman# tcpdump udp -s 5000 -X udp and not port domain
tcpdump: listening on fxp0
17:00:41.829134 grant.cs.miami.edu.1594 > sherman.cs.miami.edu.tftp:  27 RRQ "small-hands.txt"
0x0000	 4500 0037 2963 0000 4011 f921 ac14 0007	E..7)c..@..!....
0x0010	 ac14 0002 063a 0045 0023 6dee 0001 736d	.....:.E.#m...sm
0x0020	 616c 6c2d 6861 6e64 732e 7478 7400 6e65	all-hands.txt.ne
0x0030	 7461 7363 6969 00                      	tascii.
17:00:41.834977 sherman.cs.miami.edu.4327 > grant.cs.miami.edu.1594:  udp 516
0x0000	 4500 0220 bb3f 0000 4011 655c ac14 0002	E....?..@.e\....
0x0010	 ac14 0007 10e7 063a 020c 3d1e 0003 0001	.......:..=.....
0x0020	 536f 6d65 7768 6572 6520 4920 6861 7665	Somewhere.I.have
0x0030	 206e 6576 6572 2074 7261 7665 6c6c 6564	.never.travelled
0x0040	 2c20 676c 6164 6c79 2062 6579 6f6e 640d	,.gladly.beyond.
0x0050	 0a61 6e79 2065 7870 6572 6965 6e63 652c	.any.experience,
0x0060	 796f 7572 2065 7965 7320 6861 7665 2074	your.eyes.have.t
0x0070	 6865 6972 2073 696c 656e 6365 3a0d 0a69	heir.silence:..i
0x0080	 6e20 796f 7572 206d 6f73 7420 6672 6169	n.your.most.frai
0x0090	 6c20 6765 7374 7572 6520 6172 6520 7468	l.gesture.are.th
0x00a0	 696e 6773 2077 6869 6368 2065 6e63 6c6f	ings.which.enclo
0x00b0	 7365 206d 652c 0d0a 6f72 2077 6869 6368	se.me,..or.which
0x00c0	 2049 2063 616e 6e6f 7420 746f 7563 6820	.I.cannot.touch.
0x00d0	 6265 6361 7573 6520 7468 6579 2061 7265	because.they.are
0x00e0	 2074 6f6f 206e 6561 720d 0a0d 0a79 6f75	.too.near....you
0x00f0	 7220 736c 6967 6874 6573 7420 6c6f 6f6b	r.slightest.look
0x0100	 2065 6173 696c 7920 7769 6c6c 2075 6e63	.easily.will.unc
0x0110	 6c6f 7365 206d 650d 0a74 686f 7567 6820	lose.me..though.
0x0120	 4920 6861 7665 2063 6c6f 7365 6420 6d79	I.have.closed.my
0x0130	 7365 6c66 2061 7320 6669 6e67 6572 732c	self.as.fingers,
0x0140	 0d0a 796f 7520 6f70 656e 2061 6c77 6179	..you.open.alway
0x0150	 7320 7065 7461 6c20 6279 2070 6574 616c	s.petal.by.petal
0x0160	 206d 7973 656c 6620 6173 2053 7072 696e	.myself.as.Sprin
0x0170	 6720 6f70 656e 730d 0a28 746f 7563 6869	g.opens..(touchi
0x0180	 6e67 2073 6b69 6c66 756c 6c79 2c6d 7973	ng.skilfully,mys
0x0190	 7465 7269 6f75 736c 7929 2068 6572 2066	teriously).her.f
0x01a0	 6972 7374 2072 6f73 650d 0a6f 7220 6966	irst.rose..or.if
0x01b0	 2079 6f75 7220 7769 7368 2062 6520 746f	.your.wish.be.to
0x01c0	 2063 6c6f 7365 206d 652c 4920 616e 640d	.close.me,I.and.
0x01d0	 0a6d 7920 6c69 6665 2077 696c 6c20 7368	.my.life.will.sh
0x01e0	 7574 2076 6572 7920 6265 6175 7469 6675	ut.very.beautifu
0x01f0	 6c6c 792c 7375 6464 656e 6c79 2c0d 0a61	lly,suddenly,..a
0x0200	 7320 7768 656e 2074 6865 2068 6561 7274	s.when.the.heart
0x0210	 206f 6620 7468 6973 2066 6c6f 7765 7220	.of.this.flower.
17:00:41.835229 grant.cs.miami.edu.1594 > sherman.cs.miami.edu.4327:  udp 4
0x0000	 4500 0020 2965 0000 4011 f936 ac14 0007	E...)e..@..6....
0x0010	 ac14 0002 063a 10e7 000c 907e 0004 0001	.....:.....~....
0x0020	 0000 0000 0000 0000 0000 0000 0000     	..............
17:00:41.835333 sherman.cs.miami.edu.4327 > grant.cs.miami.edu.1594:  udp 452
0x0000	 4500 01e0 bb40 0000 4011 659b ac14 0002	E....@..@.e.....
0x0010	 ac14 0007 10e7 063a 01cc e22d 0003 0002	.......:...-....
0x0020	 696d 6167 696e 6573 0d0a 7468 6520 736e	imagines..the.sn
0x0030	 6f77 2063 6172 6566 756c 6c79 2065 7665	ow.carefully.eve
0x0040	 7279 7768 6572 6520 6465 7363 656e 6469	rywhere.descendi
0x0050	 6e67 3b0d 0a0d 0a6e 6f74 6869 6e67 2077	ng;....nothing.w
0x0060	 6869 6368 2077 6520 6172 6520 746f 2070	hich.we.are.to.p
0x0070	 6572 6365 6976 6520 696e 2074 6869 7320	erceive.in.this.
0x0080	 776f 726c 6420 6571 7561 6c73 0d0a 7468	world.equals..th
0x0090	 6520 706f 7765 7220 6f66 2079 6f75 7220	e.power.of.your.
0x00a0	 696e 7465 6e73 6520 6672 6167 696c 6974	intense.fragilit
0x00b0	 793a 7768 6f73 6520 7465 7874 7572 650d	y:whose.texture.
0x00c0	 0a63 6f6d 7065 6c73 206d 6520 7769 7468	.compels.me.with
0x00d0	 2074 6865 2063 6f6c 6f75 7220 6f66 2069	.the.colour.of.i
0x00e0	 7473 2063 6f75 6e74 7269 6573 2c0d 0a72	ts.countries,..r
0x00f0	 656e 6465 7269 6e67 2064 6561 7468 2061	endering.death.a
0x0100	 6e64 2066 6f72 6576 6572 2077 6974 6820	nd.forever.with.
0x0110	 6561 6368 2062 7265 6174 6869 6e67 0d0a	each.breathing..
0x0120	 0d0a 2849 2064 6f20 6e6f 7420 6b6e 6f77	..(I.do.not.know
0x0130	 2077 6861 7420 6974 2069 7320 6162 6f75	.what.it.is.abou
0x0140	 7420 796f 7520 7468 6174 2063 6c6f 7365	t.you.that.close
0x0150	 730d 0a61 6e64 206f 7065 6e73 3b6f 6e6c	s..and.opens;onl
0x0160	 7920 736f 6d65 7468 696e 6720 696e 206d	y.something.in.m
0x0170	 6520 756e 6465 7273 7461 6e64 730d 0a74	e.understands..t
0x0180	 6865 2076 6f69 6365 206f 6620 796f 7572	he.voice.of.your
0x0190	 2065 7965 7320 6973 2064 6565 7065 7220	.eyes.is.deeper.
0x01a0	 7468 616e 2061 6c6c 2072 6f73 6573 290d	than.all.roses).
0x01b0	 0a6e 6f62 6f64 792c 6e6f 7420 6576 656e	.nobody,not.even
0x01c0	 2074 6865 2072 6169 6e2c 6861 7320 7375	.the.rain,has.su
0x01d0	 6368 2073 6d61 6c6c 2068 616e 6473 0d0a	ch.small.hands..
17:00:41.835546 grant.cs.miami.edu.1594 > sherman.cs.miami.edu.4327:  udp 4
0x0000	 4500 0020 2966 0000 4011 f935 ac14 0007	E...)f..@..5....
0x0010	 ac14 0002 063a 10e7 000c 907d 0004 0002	.....:.....}....
0x0020	 0000 0000 0000 0000 0000 0000 0000     	..............

159 packets received by filter
0 packets dropped by kernel
sherman# exit

Script done on Fri Mar 14 17:00:50 2003