On Sun, Mar 29, 2015 at 7:52 PM, Magnus Therning <[email protected]>
wrote:

> On Sun, Mar 29, 2015 at 05:36:33PM +0100, David Scott wrote:
> > On Sun, Mar 29, 2015 at 5:02 PM, Magnus Therning <[email protected]>
> > wrote:
> [..]
> > So it looks like you're receiving truncated IP frames. It would be
> helpful
> > to know what the frames actually are-- could you do something like:
> >
> > git clone git://github.com/mirage/mirage-tcpip
> > cd mirage-tcpip
> > git checkout v2.3.0
> >
> > perhaps change the assert into something like
> >
> > if Cstruct.len data <> payload_len then begin
> >   printf "argh, it's all broken! len = %d payload_len = %d\n"
> (Cstruct.len
> > data) payload_len;
> >   Cstruct.hexdump buf;
> > end
> >
> > (quoting the Cstruct manual:
> >  " when the going gets tough, the tough hexdump their cstructs
> >     and peer at it until the bug disappears.  This will directly
> >     prettyprint the contents of the cstruct to the standard output. ")
> >
> > opam pin add tcpip .
> >
> > .. and then rebuild your app with the new code.
>
> After doing that, rebuilding and starting the VM again I get this on
> the console
>
>     ...
>     argh, it's all broken! len = 26 payload_len = 20
>
>     45 00 00 28 2b af 40 00 40 06 8d af c0 a8 00 0b
>     c0 a8 00 16 ea 30 00 50 d0 90 08 dc 1a fe 26 b0
>     50 11 00 e5 27 e1 00 00 00 00 00 00 00 00
>     argh, it's all broken! len = 26 payload_len = 20
>

(peering at the hex dump, with wikipedia in another window)

IP version = 4
Protocol = 6 = TCP
IHL = 5 words (ie no options)
Total length = 0x28

payload_len = 0x28 - 5 * 4 = 20 (looks ok)

It looks like the mirage-net-xen driver is supplying an extra 6 bytes for
some reason.


>
>     45 00 00 28 2b b0 40 00 40 06 8d ae c0 a8 00 0b
>     c0 a8 00 16 ea 30 00 50 d0 90 08 dc 1a fe 26 b0
>     50 11 00 e5 27 e1 00 00 00 00 00 00 00 00
>     argh, it's all broken! len = 26 payload_len = 20
>
>     45 00 00 28 2b b1 40 00 40 06 8d ad c0 a8 00 0b
>     c0 a8 00 16 ea 30 00 50 d0 90 08 dc 1a fe 26 b0
>     50 11 00 e5 27 e1 00 00 00 00 00 00 00 00
>     argh, it's all broken! len = 26 payload_len = 20
>
>     45 00 00 28 2b b2 40 00 40 06 8d ac c0 a8 00 0b
>     c0 a8 00 16 ea 30 00 50 d0 90 08 dc 1a fe 26 b0
>     50 11 00 e5 27 e1 00 00 00 00 00 00 00 00
>     argh, it's all broken! len = 26 payload_len = 20
>
>     45 00 00 28 2b b3 40 00 40 06 8d ab c0 a8 00 0b
>     c0 a8 00 16 ea 30 00 50 d0 90 08 dc 1a fe 26 b0
>     50 11 00 e5 27 e1 00 00 00 00 00 00 00 00
>     argh, it's all broken! len = 26 payload_len = 20
>
>     45 00 00 28 2b b4 40 00 40 06 8d aa c0 a8 00 0b
>     c0 a8 00 16 ea 30 00 50 d0 90 08 dc 1a fe 26 b0
>     50 11 00 e5 27 e1 00 00 00 00 00 00 00 00
>     ARP responding to: who-has 192.168.0.22?
>     argh, it's all broken! len = 26 payload_len = 8
>
>     45 00 00 1c 00 00 00 00 01 02 19 36 c0 a8 00 01
>     e0 00 00 01 11 0a ee f5 00 00 00 00 00 00 00 00
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00
>     argh, it's all broken! len = 26 payload_len = 12
>

Even though this packet has a shorter total length (0x1c), the frame has
the same length as the previous ones.

    45 00 00 20 00 00 00 00 01 02 19 32 c0 a8 00 01
>     e0 00 00 01 11 0a ec 78 00 00 00 00 02 7d 00 00
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00

    ...
>
> This time around I don't get anything in reply to my requests though.
>

This is probably because my debug suggestion removed the assert and
probably confused the higher layers.

Unless I'm misreading this, I think it must be a bug in mirage-net-xen (the
ethernet driver) misreading the ethernet frames somehow? Or perhaps the
peer host is sending extra junk on the end of its IP packets but within the
ethernet frames?

What kind of network are you using?

I've filed this issue for now:

https://github.com/mirage/mirage-net-xen/issues/24


Cheers,
Dave

>
> /M
>
> --
> Magnus Therning                      OpenPGP: 0xAB4DFBA4
> email: [email protected]   jabber: [email protected]
> twitter: magthe               http://therning.org/magnus
>
> As long as there are ill-defined goals, bizarre bugs, and unrealistic
> schedules, there will be Real Programmers willing to jump in and Solve The
> Problem, saving the documentation for later.  Long live Fortran!
>      -- Ed Post
>



-- 
Dave Scott
_______________________________________________
MirageOS-devel mailing list
[email protected]
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Reply via email to