Skip to content

QEMU serial output is not reliable, may affect SLIP and thus network testing #8187

@pfalcon

Description

@pfalcon

This ticket provides a (partial) answer of why the issue described in #7831 (comment) happens, specifically:

  1. when running samples/net/socket/dumb_http_server sample app on qemu_cortex_m3,
  2. running ab -n1000 http://192.0.2.1:8080/,
  3. processing of requests gets stuck after just few dozens of requests, ab eventually times out
  4. (ab can be restarted and number of requests can be processed still, i.e. the app keeps running, but requests get stuck soon)

So, it's more or less know issue, but it's not always kept in mind: UART emulation in QEMU is sub-ideal, and there can be problems with serial communication, which is used by SLIP and loop-slip-tap.sh. This is what happens here.

For example, SLIP driver logging:

[slip] [INF] slip_send: sent: pkt 0x20001ec4 llr: 14, len: 54
[slip] [INF] slip_send: sent: pkt 0x20001ec4 llr: 14, len: 1506
[slip] [INF] slip_send: sent: pkt 0x20001e78 llr: 14, len: 783
[slip] [INF] slip_send: sent: pkt 0x20001e2c llr: 14, len: 54
Connection from 192.0.2.2 closed
[slip] [INF] slip_send: sent: pkt 0x20001e78 llr: 14, len: 783

What we can see here is that pkt 0x20001e78 was transmitted twice. But here's what Wireshark sees:

screenshot from 2018-06-05 23-50-25

As can be seen, instead of first 783 bytes packet it receives broken 275 bytes packet, which gets ignored by host. That's what causes retransmission, and next time the packet gets thru.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: Networkingarea: QEMUQEMU EmulationbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions