Running echo_server on qemu_cortex_m3


Goldman, Michael <michael.goldman@...>
 

Hi all,

 

Did anyone try or knows how to configure and run the echo_server sample application on qemu_cortex_m3 ?

I’m following the instructions on: https://wiki.zephyrproject.org/view/Networking-with-Qemu

 

When running on x86 qemu everything works fine and I can ping the target server but when trying to use arm qemu ARP requests are not answered.

I’m running the command: make pristine && make BOARD=qemu_cortex_m3 qemu

 

Is there something I’m missing?

 

This is the configuration I get from the network shell in ARM:

 

net> conn

Context                Local                      Remote                Iface     Flags

0x2000114c         ::             ::             0x200007c0         6DU

0x2000119c         ff84::2   ::             0x200007c0         6DU

0x200011ec         0.0.0.0   0.0.0.0   0x200007c0         4DU

0x2000123c         ::             ::             0x200007c0         6ST

0x2000128c         0.0.0.0   0.0.0.0   0x200007c0         4ST

 

TCP       State    Src port  Dst port  Send-Seq   Send-Ack   MSS

0x200016e0                              4242         03000054321         0 1280

0x2000179c                               4242         04000056020         0 1460

net> iface

Interface 0x200007c0

====================

TX stack size 1200/1296 bytes unused 588 usage 612/1200 (46 %)

Link addr : 10:00:00:00:00:41

MTU       : 1500

IPv6 unicast addresses (max 3):

                fe80::1200:ff:fe00:41 autoconf preferred infinite

                2001:db8::1 manual preferred infinite

IPv6 multicast addresses (max 2):

                ff84::2

IPv6 prefixes (max 2):

                <none>

IPv6 hop limit           : 64

IPv6 base reachable time : 30000

IPv6 reachable time      : 8373

IPv6 retransmit timer    : 0

IPv4 unicast addresses (max 1):

                192.0.2.1 manual preferred infinite

IPv4 multicast addresses (max 1):

                <none>

IPv4 gateway : 0.0.0.0

IPv4 netmask : 0.0.0.0

net> mem       

Fragment length 128 bytes

Network buffer pools:

                TX           1152 bytes, 16 elements

                RX           1152 bytes, 16 elements

                DATA     6080 bytes, 40 elements

net> route

net> stacks

TX [slip] stack size 1200/1296 bytes unused 588 usage 612/1200 (46 %)

RX [rx_stack] stack size 1200/1296 bytes unused 948 usage 252/1200 (14 %)

net> stats

IPv6 recv      0     sent       5              drop      0              forwarded          0

IPv6 ND recv   0 sent       5              drop      0

IPv4 recv      0     sent       0              drop      0              forwarded          0

IP vhlerr      0       hblener                0              lblener  0

IP fragerr     0      chkerr   0              protoer 0

ICMP recv      0   sent       0              drop      0

ICMP typeer    0                chkerr   0

UDP recv       0    sent       0              drop      0

UDP chkerr     0

Processing err 0

 

Thanks,

Michael

 

---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Richard Peters <mail@...>
 

Hi Michael,

Did anyone try or knows how to configure and run the echo_server sample
application on qemu_cortex_m3 ?

I’m following the instructions on:
https://wiki.zephyrproject.org/view/Networking-with-Qemu

When running on x86 qemu everything works fine and I can ping the target
server but when trying to use arm qemu ARP requests are not answered.

I’m running the command: make pristine && make BOARD=qemu_cortex_m3 qemu
qemu_cortex_m3 was fixed recently, so try the newest version from git
(master).
Are you also running the net-tools?

Please see:

https://www.zephyrproject.org/doc/subsystems/networking/qemu_setup.html#networking-with-qemu

Regards,
Richard


Goldman, Michael <michael.goldman@...>
 

Hi,

I took the fix from git and now it works!
I'm using the net-tools as described in the link you sent.

Thanks a lot Richard!

Regards,
Michael

-----Original Message-----
From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Richard Peters
Sent: Monday, February 20, 2017 18:46
To: zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Running echo_server on qemu_cortex_m3

Hi Michael,

Did anyone try or knows how to configure and run the echo_server
sample application on qemu_cortex_m3 ?

I'm following the instructions on:
https://wiki.zephyrproject.org/view/Networking-with-Qemu

When running on x86 qemu everything works fine and I can ping the
target server but when trying to use arm qemu ARP requests are not answered.

I'm running the command: make pristine && make BOARD=qemu_cortex_m3
qemu
qemu_cortex_m3 was fixed recently, so try the newest version from git (master).
Are you also running the net-tools?

Please see:

https://www.zephyrproject.org/doc/subsystems/networking/qemu_setup.html#networking-with-qemu

Regards,
Richard
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Goldman, Michael <michael.goldman@...>
 

Hi all,

BTY, regarding the documentation in: https://www.zephyrproject.org/doc/subsystems/networking/qemu_setup.html#networking-with-qemu

When running "nc" in UDP, nc exits without waiting for reply from the target application (echo_server), unlike the description in the doc.:
Note
You will need to Ctrl+C manually.
$ echo foobar | nc -u 192.0.2.1 4242
foobar

I can see the packet being sent to target and replayed back in Wireshark.
On TCP, nc does wait for response and I can see "foobar" printed and Ctrl+C is needed to close nc.

I searched over the web and read that because UDP is connectionless protocol, nc is not supposed to wait for response.
Did I do something wrong?

Thanks,
Michael

-----Original Message-----
From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Goldman, Michael
Sent: Tuesday, February 21, 2017 08:38
To: Richard Peters <mail@richardpeters.de>; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Running echo_server on qemu_cortex_m3

Hi,

I took the fix from git and now it works!
I'm using the net-tools as described in the link you sent.

Thanks a lot Richard!

Regards,
Michael

-----Original Message-----
From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Richard Peters
Sent: Monday, February 20, 2017 18:46
To: zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Running echo_server on qemu_cortex_m3

Hi Michael,

Did anyone try or knows how to configure and run the echo_server
sample application on qemu_cortex_m3 ?

I'm following the instructions on:
https://wiki.zephyrproject.org/view/Networking-with-Qemu

When running on x86 qemu everything works fine and I can ping the
target server but when trying to use arm qemu ARP requests are not answered.

I'm running the command: make pristine && make BOARD=qemu_cortex_m3
qemu
qemu_cortex_m3 was fixed recently, so try the newest version from git (master).
Are you also running the net-tools?

Please see:

https://www.zephyrproject.org/doc/subsystems/networking/qemu_setup.html#networking-with-qemu

Regards,
Richard
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Jukka Rissanen
 

Hi Michael,

On Tue, 2017-02-21 at 12:33 +0000, Goldman, Michael wrote:
Hi all,

BTY, regarding the documentation in: https://www.zephyrproject.org/do
c/subsystems/networking/qemu_setup.html#networking-with-qemu

When running "nc" in UDP, nc exits without waiting for reply from the
target application (echo_server), unlike the description in the doc.:
Note
You will need to Ctrl+C manually.
$ echo foobar | nc -u 192.0.2.1 4242
foobar

I can see the packet being sent to target and replayed back in
Wireshark.
On TCP, nc does wait for response and I can see "foobar" printed and
Ctrl+C is needed to close nc.
Indeed, the documentation is wrong here. I will send a patch for that
one. Thanks for reporting this.


I searched over the web and read that because UDP is connectionless
protocol, nc is not supposed to wait for response.
Did I do something wrong?
No, you did everything right here :)



Thanks,
Michael

Cheers,
Jukka


Piotr Mienkowski
 

Hi Michael,

When running "nc" in UDP, nc exits without waiting for reply from the target application (echo_server)
You may force nc to wait some time after all data are sent using -q seconds option. As in

$ echo foobar | nc -q 1 -u 192.0.2.1 4242

to wait for 1 second. Unfortunately the -q option may not be present in your specific implementation of nc. It seems there are a few and their names may vary, e.g. ncat, netcat. I haven't been using Zephyr net-tools project so I'm not sure what's the situation there.

For simple testing it's often enough to type

$ nc -u 192.0.2.1 4242

anything you type into the console will be send to the remote side and the response will be displayed. To exit you'll need to Ctrl+C manually.

Cheers,
Piotr


Goldman, Michael <michael.goldman@...>
 

Hi,

 

indeed –q option doesn’t work on my machine.

When running nc with echo and pipe nc doesn’t wait but when starting nc and then typing text it does wait.

But… I would like to send (and then receive) a file. I’ll need to figure it out.

 

Thanks Piotr!

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Piotr Mienkowski
Sent: Wednesday, February 22, 2017 18:13
To: zephyr-devel@...
Subject: Re: [Zephyr-devel] Running echo_server on qemu_cortex_m3

 

Hi Michael,

When running "nc" in UDP, nc exits without waiting for reply from the target application (echo_server)

You may force nc to wait some time after all data are sent using -q seconds option. As in

$ echo foobar | nc -q 1 -u 192.0.2.1 4242

to wait for 1 second. Unfortunately the -q option may not be present in your specific implementation of nc. It seems there are a few and their names may vary, e.g. ncat, netcat. I haven't been using Zephyr net-tools project so I'm not sure what's the situation there.

For simple testing it's often enough to type

$ nc -u 192.0.2.1 4242

anything you type into the console will be send to the remote side and the response will be displayed. To exit you'll need to Ctrl+C manually.

Cheers,
Piotr

---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.