All of lore.kernel.org
 help / color / mirror / Atom feed
* About RTNet setup
@ 2020-05-15 13:15 Marco Tessore
  2020-05-18  8:56 ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Tessore @ 2020-05-15 13:15 UTC (permalink / raw)
  To: Xenomai

Good morning,
I'm working in a project where I need send and receive RAW ethernet packet in realtime.
I'm using a Xenomai 3.1 porting on an Ubuntu machine.
RTNet is enabled in the kernel as modules.

The problem is that I don't really know how to setup the network in userspace.

If this mailing list is not appropriate for the issue please tell me where I can write.

The results of  rtifconfig is:
rteth0    Medium: Ethernet  Hardware address: 6C:B3:11:52:4C:E9
          IP address: 192.168.178.142  Broadcast address: 192.168.178.255
          UP BROADCAST RUNNING  MTU: 1500
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

rtlo      Medium: Local Loopback
          IP address: 127.0.0.1
          UP LOOPBACK RUNNING  MTU: 1500

So I tried rtping to ping another machine, in my network: that machine is not a realtime one, and rtping response is that there's no route to host.
The first question is: does the other machine need to run rtnet as well to respond to the rtping protocol, or it's simply a realtime implementation of the standard ping?

The second question is: to send and receive custom ethernet frames from a userspace process,
What is the best configuration of rtnet.conf ? I don't really need rt-tcpip and I don't know how TDMA works.

Third question is about the API to use: I'm trying to see the examples, but I'have some troubles to actually implement this.

I'll appreciate any help
Kind Regards
Marco Tessore



Marco Tessore

AXEL S.r.l.
Via del Cannino, 3
21020 Crosio della Valle (VA) - ITALY
Tel: +39 0332 949600
Fax: +39 0332 969315
E-mail: marco.tessore@axelsw.it<mailto:marco.tessore@axelsw.it>
Web site: www.axelsoftware.it<http://www.axelsoftware.it>

Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
(Regolamento Europeo Protezione dei Dati n. 2016/679 ("GDPR")/D. Lgs 30.6.2003 n. 196)

The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
(Decree 196/2003 and Regulation (EU) 2016/679)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About RTNet setup
  2020-05-15 13:15 About RTNet setup Marco Tessore
@ 2020-05-18  8:56 ` Jan Kiszka
  2020-05-18  9:12   ` R: " Marco Tessore
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2020-05-18  8:56 UTC (permalink / raw)
  To: Marco Tessore, Xenomai

On 15.05.20 15:15, Marco Tessore via Xenomai wrote:
> Good morning,
> I'm working in a project where I need send and receive RAW ethernet packet in realtime.
> I'm using a Xenomai 3.1 porting on an Ubuntu machine.
> RTNet is enabled in the kernel as modules.
> 
> The problem is that I don't really know how to setup the network in userspace.
> 
> If this mailing list is not appropriate for the issue please tell me where I can write.
> 
> The results of  rtifconfig is:
> rteth0    Medium: Ethernet  Hardware address: 6C:B3:11:52:4C:E9
>            IP address: 192.168.178.142  Broadcast address: 192.168.178.255
>            UP BROADCAST RUNNING  MTU: 1500
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0
>            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> rtlo      Medium: Local Loopback
>            IP address: 127.0.0.1
>            UP LOOPBACK RUNNING  MTU: 1500
> 
> So I tried rtping to ping another machine, in my network: that machine is not a realtime one, and rtping response is that there's no route to host.
> The first question is: does the other machine need to run rtnet as well to respond to the rtping protocol, or it's simply a realtime implementation of the standard ping?

No, but ARP resolution of RTnet nodes work only on explicit request. You 
need to run "rtroute solicit <ip>" for that, or the other side needs to 
ping you.

> 
> The second question is: to send and receive custom ethernet frames from a userspace process,
> What is the best configuration of rtnet.conf ? I don't really need rt-tcpip and I don't know how TDMA works.
> 

You don't rtnet.conf and the setup tool then. Just load the rtnet, 
rt_packet, and rt-<driver> modules (provided you unbound the target 
interface from the Linux driver already), run rtifconfig on the rteth0 
interface, and then you can use AF_PACKET sockets from your RT applications.

> Third question is about the API to use: I'm trying to see the examples, but I'have some troubles to actually implement this.

See demo/posix/cobalt/eth_p_all.c or 
testsuite/smokey/net_packet_raw/packet_raw.c (not self-standing, though) 
for examples. Study "man 7 packet" for the raw interface (RTnet is 
widely compatible).

HTH,
Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

* R: About RTNet setup
  2020-05-18  8:56 ` Jan Kiszka
@ 2020-05-18  9:12   ` Marco Tessore
  2020-05-18 10:19     ` Marco Tessore
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Tessore @ 2020-05-18  9:12 UTC (permalink / raw)
  To: Jan Kiszka, Xenomai

Thank you Jan


Marco Tessore

AXEL S.r.l.
Via del Cannino, 3
21020 Crosio della Valle (VA) - ITALY
Tel: +39 0332 949600
Fax: +39 0332 969315
E-mail: marco.tessore@axelsw.it
Web site: www.axelsoftware.it

Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
(Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 30.6.2003 n. 196)

The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
(Decree 196/2003 and Regulation (EU) 2016/679)


-----Messaggio originale-----
Da: Jan Kiszka <jan.kiszka@siemens.com> 
Inviato: lunedì 18 maggio 2020 10:57
A: Marco Tessore <marco.tessore@axelsw.it>; Xenomai@xenomai.org
Oggetto: Re: About RTNet setup

On 15.05.20 15:15, Marco Tessore via Xenomai wrote:
> Good morning,
> I'm working in a project where I need send and receive RAW ethernet packet in realtime.
> I'm using a Xenomai 3.1 porting on an Ubuntu machine.
> RTNet is enabled in the kernel as modules.
> 
> The problem is that I don't really know how to setup the network in userspace.
> 
> If this mailing list is not appropriate for the issue please tell me where I can write.
> 
> The results of  rtifconfig is:
> rteth0    Medium: Ethernet  Hardware address: 6C:B3:11:52:4C:E9
>            IP address: 192.168.178.142  Broadcast address: 192.168.178.255
>            UP BROADCAST RUNNING  MTU: 1500
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0
>            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> rtlo      Medium: Local Loopback
>            IP address: 127.0.0.1
>            UP LOOPBACK RUNNING  MTU: 1500
> 
> So I tried rtping to ping another machine, in my network: that machine is not a realtime one, and rtping response is that there's no route to host.
> The first question is: does the other machine need to run rtnet as well to respond to the rtping protocol, or it's simply a realtime implementation of the standard ping?

No, but ARP resolution of RTnet nodes work only on explicit request. You need to run "rtroute solicit <ip>" for that, or the other side needs to ping you.

> 
> The second question is: to send and receive custom ethernet frames 
> from a userspace process, What is the best configuration of rtnet.conf ? I don't really need rt-tcpip and I don't know how TDMA works.
> 

You don't rtnet.conf and the setup tool then. Just load the rtnet, rt_packet, and rt-<driver> modules (provided you unbound the target interface from the Linux driver already), run rtifconfig on the rteth0 interface, and then you can use AF_PACKET sockets from your RT applications.

> Third question is about the API to use: I'm trying to see the examples, but I'have some troubles to actually implement this.

See demo/posix/cobalt/eth_p_all.c or
testsuite/smokey/net_packet_raw/packet_raw.c (not self-standing, though) for examples. Study "man 7 packet" for the raw interface (RTnet is widely compatible).

HTH,
Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 6+ messages in thread

* R: About RTNet setup
  2020-05-18  9:12   ` R: " Marco Tessore
@ 2020-05-18 10:19     ` Marco Tessore
  2020-05-18 10:43       ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Tessore @ 2020-05-18 10:19 UTC (permalink / raw)
  To: Jan Kiszka, Xenomai

Sorry Jan, just one more question:
I've implemented a simple task that send a packet,
and then receive a response.
I know the response come back, on the network, in couple of useconds.
But, from the send to the receive I measure 100 ms.
You know why this delay:
Is the send or the receive slow?
You know there's some parameter to adjust?

Thank you
Marco


Marco Tessore

AXEL S.r.l.
Via del Cannino, 3
21020 Crosio della Valle (VA) - ITALY
Tel: +39 0332 949600
Fax: +39 0332 969315
E-mail: marco.tessore@axelsw.it
Web site: www.axelsoftware.it

Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
(Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 30.6.2003 n. 196)

The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
(Decree 196/2003 and Regulation (EU) 2016/679)


-----Messaggio originale-----
Da: Marco Tessore 
Inviato: lunedì 18 maggio 2020 11:13
A: 'Jan Kiszka' <jan.kiszka@siemens.com>; Xenomai@xenomai.org
Oggetto: R: About RTNet setup

Thank you Jan


Marco Tessore

AXEL S.r.l.
Via del Cannino, 3
21020 Crosio della Valle (VA) - ITALY
Tel: +39 0332 949600
Fax: +39 0332 969315
E-mail: marco.tessore@axelsw.it
Web site: www.axelsoftware.it

Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
(Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 30.6.2003 n. 196)

The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
(Decree 196/2003 and Regulation (EU) 2016/679)


-----Messaggio originale-----
Da: Jan Kiszka <jan.kiszka@siemens.com>
Inviato: lunedì 18 maggio 2020 10:57
A: Marco Tessore <marco.tessore@axelsw.it>; Xenomai@xenomai.org
Oggetto: Re: About RTNet setup

On 15.05.20 15:15, Marco Tessore via Xenomai wrote:
> Good morning,
> I'm working in a project where I need send and receive RAW ethernet packet in realtime.
> I'm using a Xenomai 3.1 porting on an Ubuntu machine.
> RTNet is enabled in the kernel as modules.
> 
> The problem is that I don't really know how to setup the network in userspace.
> 
> If this mailing list is not appropriate for the issue please tell me where I can write.
> 
> The results of  rtifconfig is:
> rteth0    Medium: Ethernet  Hardware address: 6C:B3:11:52:4C:E9
>            IP address: 192.168.178.142  Broadcast address: 192.168.178.255
>            UP BROADCAST RUNNING  MTU: 1500
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0
>            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> rtlo      Medium: Local Loopback
>            IP address: 127.0.0.1
>            UP LOOPBACK RUNNING  MTU: 1500
> 
> So I tried rtping to ping another machine, in my network: that machine is not a realtime one, and rtping response is that there's no route to host.
> The first question is: does the other machine need to run rtnet as well to respond to the rtping protocol, or it's simply a realtime implementation of the standard ping?

No, but ARP resolution of RTnet nodes work only on explicit request. You need to run "rtroute solicit <ip>" for that, or the other side needs to ping you.

> 
> The second question is: to send and receive custom ethernet frames 
> from a userspace process, What is the best configuration of rtnet.conf ? I don't really need rt-tcpip and I don't know how TDMA works.
> 

You don't rtnet.conf and the setup tool then. Just load the rtnet, rt_packet, and rt-<driver> modules (provided you unbound the target interface from the Linux driver already), run rtifconfig on the rteth0 interface, and then you can use AF_PACKET sockets from your RT applications.

> Third question is about the API to use: I'm trying to see the examples, but I'have some troubles to actually implement this.

See demo/posix/cobalt/eth_p_all.c or
testsuite/smokey/net_packet_raw/packet_raw.c (not self-standing, though) for examples. Study "man 7 packet" for the raw interface (RTnet is widely compatible).

HTH,
Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: R: About RTNet setup
  2020-05-18 10:19     ` Marco Tessore
@ 2020-05-18 10:43       ` Jan Kiszka
  2020-05-18 13:11         ` R: " Marco Tessore
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2020-05-18 10:43 UTC (permalink / raw)
  To: Marco Tessore, Xenomai

On 18.05.20 12:19, Marco Tessore wrote:
> Sorry Jan, just one more question:
> I've implemented a simple task that send a packet,
> and then receive a response.
> I know the response come back, on the network, in couple of useconds.
> But, from the send to the receive I measure 100 ms.
> You know why this delay:
> Is the send or the receive slow?
> You know there's some parameter to adjust?

Check if RX interrupts are coming for the NIC. After that RX IRQ, the 
RTnet stack manager is running. That's an in-kernel Xenomai thread. It 
will wake up your application blocking on a receive. You can follow that 
likely via an ftrace (e.g. kernelshark) recording of "cobalt" events.

Jan

> 
> Thank you
> Marco
> 
> 
> Marco Tessore
> 
> AXEL S.r.l.
> Via del Cannino, 3
> 21020 Crosio della Valle (VA) - ITALY
> Tel: +39 0332 949600
> Fax: +39 0332 969315
> E-mail: marco.tessore@axelsw.it
> Web site: www.axelsoftware.it
> 
> Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
> (Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 30.6.2003 n. 196)
> 
> The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
> (Decree 196/2003 and Regulation (EU) 2016/679)
> 
> 
> -----Messaggio originale-----
> Da: Marco Tessore
> Inviato: lunedì 18 maggio 2020 11:13
> A: 'Jan Kiszka' <jan.kiszka@siemens.com>; Xenomai@xenomai.org
> Oggetto: R: About RTNet setup
> 
> Thank you Jan
> 
> 
> Marco Tessore
> 
> AXEL S.r.l.
> Via del Cannino, 3
> 21020 Crosio della Valle (VA) - ITALY
> Tel: +39 0332 949600
> Fax: +39 0332 969315
> E-mail: marco.tessore@axelsw.it
> Web site: www.axelsoftware.it
> 
> Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
> (Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 30.6.2003 n. 196)
> 
> The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
> (Decree 196/2003 and Regulation (EU) 2016/679)
> 
> 
> -----Messaggio originale-----
> Da: Jan Kiszka <jan.kiszka@siemens.com>
> Inviato: lunedì 18 maggio 2020 10:57
> A: Marco Tessore <marco.tessore@axelsw.it>; Xenomai@xenomai.org
> Oggetto: Re: About RTNet setup
> 
> On 15.05.20 15:15, Marco Tessore via Xenomai wrote:
>> Good morning,
>> I'm working in a project where I need send and receive RAW ethernet packet in realtime.
>> I'm using a Xenomai 3.1 porting on an Ubuntu machine.
>> RTNet is enabled in the kernel as modules.
>>
>> The problem is that I don't really know how to setup the network in userspace.
>>
>> If this mailing list is not appropriate for the issue please tell me where I can write.
>>
>> The results of  rtifconfig is:
>> rteth0    Medium: Ethernet  Hardware address: 6C:B3:11:52:4C:E9
>>             IP address: 192.168.178.142  Broadcast address: 192.168.178.255
>>             UP BROADCAST RUNNING  MTU: 1500
>>             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>             collisions:0
>>             RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
>>
>> rtlo      Medium: Local Loopback
>>             IP address: 127.0.0.1
>>             UP LOOPBACK RUNNING  MTU: 1500
>>
>> So I tried rtping to ping another machine, in my network: that machine is not a realtime one, and rtping response is that there's no route to host.
>> The first question is: does the other machine need to run rtnet as well to respond to the rtping protocol, or it's simply a realtime implementation of the standard ping?
> 
> No, but ARP resolution of RTnet nodes work only on explicit request. You need to run "rtroute solicit <ip>" for that, or the other side needs to ping you.
> 
>>
>> The second question is: to send and receive custom ethernet frames
>> from a userspace process, What is the best configuration of rtnet.conf ? I don't really need rt-tcpip and I don't know how TDMA works.
>>
> 
> You don't rtnet.conf and the setup tool then. Just load the rtnet, rt_packet, and rt-<driver> modules (provided you unbound the target interface from the Linux driver already), run rtifconfig on the rteth0 interface, and then you can use AF_PACKET sockets from your RT applications.
> 
>> Third question is about the API to use: I'm trying to see the examples, but I'have some troubles to actually implement this.
> 
> See demo/posix/cobalt/eth_p_all.c or
> testsuite/smokey/net_packet_raw/packet_raw.c (not self-standing, though) for examples. Study "man 7 packet" for the raw interface (RTnet is widely compatible).
> 
> HTH,
> Jan
> 
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
> 


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

* R: R: About RTNet setup
  2020-05-18 10:43       ` Jan Kiszka
@ 2020-05-18 13:11         ` Marco Tessore
  0 siblings, 0 replies; 6+ messages in thread
From: Marco Tessore @ 2020-05-18 13:11 UTC (permalink / raw)
  To: Jan Kiszka, Xenomai

Thank you Jan,
I found it,
my mistake.

Regards
Marco


Marco Tessore

AXEL S.r.l.
Via del Cannino, 3
21020 Crosio della Valle (VA) - ITALY
Tel: +39 0332 949600
Fax: +39 0332 969315
E-mail: marco.tessore@axelsw.it
Web site: www.axelsoftware.it

Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
(Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 30.6.2003 n. 196)

The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
(Decree 196/2003 and Regulation (EU) 2016/679)


-----Messaggio originale-----
Da: Jan Kiszka <jan.kiszka@siemens.com> 
Inviato: lunedì 18 maggio 2020 12:44
A: Marco Tessore <marco.tessore@axelsw.it>; Xenomai@xenomai.org
Oggetto: Re: R: About RTNet setup

On 18.05.20 12:19, Marco Tessore wrote:
> Sorry Jan, just one more question:
> I've implemented a simple task that send a packet, and then receive a 
> response.
> I know the response come back, on the network, in couple of useconds.
> But, from the send to the receive I measure 100 ms.
> You know why this delay:
> Is the send or the receive slow?
> You know there's some parameter to adjust?

Check if RX interrupts are coming for the NIC. After that RX IRQ, the RTnet stack manager is running. That's an in-kernel Xenomai thread. It will wake up your application blocking on a receive. You can follow that likely via an ftrace (e.g. kernelshark) recording of "cobalt" events.

Jan

> 
> Thank you
> Marco
> 
> 
> Marco Tessore
> 
> AXEL S.r.l.
> Via del Cannino, 3
> 21020 Crosio della Valle (VA) - ITALY
> Tel: +39 0332 949600
> Fax: +39 0332 969315
> E-mail: marco.tessore@axelsw.it
> Web site: www.axelsoftware.it
> 
> Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
> (Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 
> 30.6.2003 n. 196)
> 
> The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
> (Decree 196/2003 and Regulation (EU) 2016/679)
> 
> 
> -----Messaggio originale-----
> Da: Marco Tessore
> Inviato: lunedì 18 maggio 2020 11:13
> A: 'Jan Kiszka' <jan.kiszka@siemens.com>; Xenomai@xenomai.org
> Oggetto: R: About RTNet setup
> 
> Thank you Jan
> 
> 
> Marco Tessore
> 
> AXEL S.r.l.
> Via del Cannino, 3
> 21020 Crosio della Valle (VA) - ITALY
> Tel: +39 0332 949600
> Fax: +39 0332 969315
> E-mail: marco.tessore@axelsw.it
> Web site: www.axelsoftware.it
> 
> Le informazioni contenute in questo messaggio e negli eventuali allegati sono riservate e ad uso esclusivo del destinatario. Qualora abbiate ricevuto questo messaggio per errore, siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.
> (Regolamento Europeo Protezione dei Dati n. 2016/679 (“GDPR”)/D. Lgs 
> 30.6.2003 n. 196)
> 
> The information contained in this e-mail and any attachments are confidential and are intended for the use of the individual or entity to which they are addressed. If you are not among the named recipients, please notify the sender immediately by reply e-mail and then delete this message from your system. Thank you.
> (Decree 196/2003 and Regulation (EU) 2016/679)
> 
> 
> -----Messaggio originale-----
> Da: Jan Kiszka <jan.kiszka@siemens.com>
> Inviato: lunedì 18 maggio 2020 10:57
> A: Marco Tessore <marco.tessore@axelsw.it>; Xenomai@xenomai.org
> Oggetto: Re: About RTNet setup
> 
> On 15.05.20 15:15, Marco Tessore via Xenomai wrote:
>> Good morning,
>> I'm working in a project where I need send and receive RAW ethernet packet in realtime.
>> I'm using a Xenomai 3.1 porting on an Ubuntu machine.
>> RTNet is enabled in the kernel as modules.
>>
>> The problem is that I don't really know how to setup the network in userspace.
>>
>> If this mailing list is not appropriate for the issue please tell me where I can write.
>>
>> The results of  rtifconfig is:
>> rteth0    Medium: Ethernet  Hardware address: 6C:B3:11:52:4C:E9
>>             IP address: 192.168.178.142  Broadcast address: 192.168.178.255
>>             UP BROADCAST RUNNING  MTU: 1500
>>             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>             collisions:0
>>             RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
>>
>> rtlo      Medium: Local Loopback
>>             IP address: 127.0.0.1
>>             UP LOOPBACK RUNNING  MTU: 1500
>>
>> So I tried rtping to ping another machine, in my network: that machine is not a realtime one, and rtping response is that there's no route to host.
>> The first question is: does the other machine need to run rtnet as well to respond to the rtping protocol, or it's simply a realtime implementation of the standard ping?
> 
> No, but ARP resolution of RTnet nodes work only on explicit request. You need to run "rtroute solicit <ip>" for that, or the other side needs to ping you.
> 
>>
>> The second question is: to send and receive custom ethernet frames 
>> from a userspace process, What is the best configuration of rtnet.conf ? I don't really need rt-tcpip and I don't know how TDMA works.
>>
> 
> You don't rtnet.conf and the setup tool then. Just load the rtnet, rt_packet, and rt-<driver> modules (provided you unbound the target interface from the Linux driver already), run rtifconfig on the rteth0 interface, and then you can use AF_PACKET sockets from your RT applications.
> 
>> Third question is about the API to use: I'm trying to see the examples, but I'have some troubles to actually implement this.
> 
> See demo/posix/cobalt/eth_p_all.c or
> testsuite/smokey/net_packet_raw/packet_raw.c (not self-standing, though) for examples. Study "man 7 packet" for the raw interface (RTnet is widely compatible).
> 
> HTH,
> Jan
> 
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate 
> Competence Center Embedded Linux
> 


--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-18 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 13:15 About RTNet setup Marco Tessore
2020-05-18  8:56 ` Jan Kiszka
2020-05-18  9:12   ` R: " Marco Tessore
2020-05-18 10:19     ` Marco Tessore
2020-05-18 10:43       ` Jan Kiszka
2020-05-18 13:11         ` R: " Marco Tessore

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.