* [Xenomai] Pcap replay tool for xenomai @ 2015-11-03 10:49 Umair Ali 2015-11-03 11:47 ` Gilles Chanteperdrix 0 siblings, 1 reply; 6+ messages in thread From: Umair Ali @ 2015-11-03 10:49 UTC (permalink / raw) To: xenomai@xenomai.org Hello, I am working on the project of playing back the pcap files in real time using xenomai patch on vanilla kernel. The main idea is to open the pcap file, read the file packet by packet and then send on the network as raw Ethernet packet. I have read one thread http://sourceforge.net/p/rtnet/mailman/message/24032962/ but it did not help me a lot. I am also new to real time linux kernel. Moreover I tried to install the RTnet over the xenoami but most of the time my pc hangs up and I need to do the brutal restart. Therefore I am not much inclined towards the RTnet. Anyone have any example code or any thing which can help me or atleast provide me the guidance that how I can achieve my goal. My NIC is realtek 8139too. Thanks & Regards Ali ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Pcap replay tool for xenomai 2015-11-03 10:49 [Xenomai] Pcap replay tool for xenomai Umair Ali @ 2015-11-03 11:47 ` Gilles Chanteperdrix [not found] ` <2396B4D2166B62479FBBE370D4A7C1F30A705DA6@mb2010-3.intra.tut.fi> 0 siblings, 1 reply; 6+ messages in thread From: Gilles Chanteperdrix @ 2015-11-03 11:47 UTC (permalink / raw) To: Umair Ali; +Cc: xenomai@xenomai.org On Tue, Nov 03, 2015 at 10:49:14AM +0000, Umair Ali wrote: > Hello, > > I am working on the project of playing back the pcap files in real > time using xenomai patch on vanilla kernel. The main idea is to > open the pcap file, read the file packet by packet and then send > on the network as raw Ethernet packet. To send raw ethernet packets, see "man 7 packet", here for instance: http://man7.org/linux/man-pages/man7/packet.7.html You should call socket(AF_PACKET, SOCK_RAW, 0); Then send packets with sendto, using a sockaddr_ll structure for the destination. The important part of the sockaddr_ll is the ifr_ifindex member, the interface index (at least for RTnet, because this is what allows to find the interface to use to send the packet). The same code should work with RTnet "rtpacket" module. Only the compilation process is different. A rapid google search gives this result: https://gist.github.com/austinmarton/1922600 In your case, of course, you would simply take the data from the pcap file instead of filling the ethernet header and writing 0xdeadbeef as a payload. > (...) > I am also new to real time linux kernel. > Moreover I tried to install the RTnet over the xenoami but most of > the time my pc hangs up and I need to do the brutal restart. > (...) You do not tell us much about your setup, so it is difficult to help you here. Maybe have a look here: http://xenomai.org/troubleshooting-a-dual-kernel-configuration/#Kernel_OOPSes Regards. -- Gilles. https://click-hack.org ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <2396B4D2166B62479FBBE370D4A7C1F30A705DA6@mb2010-3.intra.tut.fi>]
* Re: [Xenomai] Pcap replay tool for xenomai [not found] ` <2396B4D2166B62479FBBE370D4A7C1F30A705DA6@mb2010-3.intra.tut.fi> @ 2015-11-03 14:46 ` Gilles Chanteperdrix 2015-11-05 15:17 ` Umair Ali 0 siblings, 1 reply; 6+ messages in thread From: Gilles Chanteperdrix @ 2015-11-03 14:46 UTC (permalink / raw) To: Umair Ali; +Cc: Xenomai On Tue, Nov 03, 2015 at 02:31:34PM +0000, Umair Ali wrote: > [ 0.489562] Xenomai: real-time nucleus v2.6.0 (Movin' On) > loaded. Xenomai 2.6.0 is seriously outdated (released in 2011). > I have run the latency tests on the xenomai and it works fine. The results of the latency are as follows ----- > RTS| 0.545| 1.328| 12.077| 0| 0| 00:00:06/00:00:06 I hope you have run the test for more than 6 seconds before concluding that xenomai runs fine. > root@cpc:/usr/xenomai/bin# " > > Now i follow the following links to install the RTnet on xenomai: > 1) https://xenomai.org/rtnet-installation/ 2) > http://rtnet.org/doc.html > And used the guide also for the initial > test of the RTnet drivers. When i type the command "sudo ./rtnet > start" my pc froze and i need to do the brutal restart. But some > time it works and i am able to do ping by "sudo ./rtping <loop > back IP>". But after the "sudo ./rtnet stop" it never ping again. > The config.log and rtnet.conf files for the configuration of the > Rtnet are attached with the email. Also I did not observe any > error while installation. Therefore i am not sure if RTnet will > work for me. Please guide me how i can go from here to achieve my > goal. Thanks in advance for your time and advice That version of RTnet is not maintained by the Xenomai project. We merged RTnet in Xenomai 3, but in order to benefit from it, you would have to install Xenomai 3.0.1 (and note that the above installation instructions do not apply, since RTnet is now merged, it means the kernel-space support has to be enabled in the kernel configuration, and the user-space support is compiled unconditionally). Also note that the loopback interface is broken in Xenomai 3.0.1, it will be fixed in 3.0.2, however 8139too should work. Please keep the conversation on the mailing list. -- Gilles. https://click-hack.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Pcap replay tool for xenomai 2015-11-03 14:46 ` Gilles Chanteperdrix @ 2015-11-05 15:17 ` Umair Ali 2015-11-05 21:33 ` Gilles Chanteperdrix 0 siblings, 1 reply; 6+ messages in thread From: Umair Ali @ 2015-11-05 15:17 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Xenomai Hello Gilles, I have managed to install the xenomai on Ubuntu 13.04 (kernel 3.08). The version of the xenomai is 3.0.1 and kernel version is 3.10.32. The following is the output after the reboot "root@cpc:/usr/src/linux-3.10.32# uname -a Linux cpc 3.10.32-xenomai-3.0.1 #2 SMP PREEMPT Thu Nov 5 11:07:39 EET 2015 i686 i686 i686 GNU/Linux root@cpc:/usr/src/linux-3.10.32# dmesg | grep -i xenomai [ 0.000000] Linux version 3.10.32-xenomai-3.0.1 (root@cpc) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #2 SMP PREEMPT Thu Nov 5 11:07:39 EET 2015 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.10.32-xenomai-3.0.1 root=UUID=b1b34a08-de22-4aee-a956-10b378d690b9 ro crashkernel=384M-2G:64M,2G-:128M quiet splash vt.handoff=7 [ 0.743556] [Xenomai] scheduling class idle registered. [ 0.743561] [Xenomai] scheduling class rt registered. [ 0.743608] [Xenomai] SMI-enabled chipset found, but SMI workaround disabled [ 0.743608] (see xenomai.smi parameter). You might encounter [ 0.743753] I-pipe: head domain Xenomai registered. [ 0.744329] [Xenomai] Cobalt v3.0.1 (Exact Zero) [DEBUG] [ 1.300135] usb usb1: Manufacturer: Linux 3.10.32-xenomai-3.0.1 ehci_hcd [ 1.300942] usb usb2: Manufacturer: Linux 3.10.32-xenomai-3.0.1 uhci_hcd [ 1.301539] usb usb3: Manufacturer: Linux 3.10.32-xenomai-3.0.1 uhci_hcd [ 1.302135] usb usb4: Manufacturer: Linux 3.10.32-xenomai-3.0.1 uhci_hcd [ 1.302734] usb usb5: Manufacturer: Linux 3.10.32-xenomai-3.0.1 uhci_hcd root@cpc:/usr/src/linux-3.10.32#"" The latency test of the xenomai is as follows "root@cpc:/usr/xenomai/bin# ./latency == Sampling period: 100 us == Test mode: periodic user-mode task == All results in microseconds warming up... RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| 2.637| 3.474| 20.177| 0| 0| 2.637| 20.177 RTD| 2.424| 3.451| 12.743| 0| 0| 2.424| 20.177 RTD| 2.404| 3.412| 13.037| 0| 0| 2.404| 20.177 RTD| 2.584| 3.447| 25.031| 0| 0| 2.404| 25.031 RTD| 2.079| 3.435| 12.987| 0| 0| 2.079| 25.031 RTD| 2.348| 3.444| 12.823| 0| 0| 2.079| 25.031 RTD| 2.564| 3.433| 13.177| 0| 0| 2.079| 25.031 RTD| 2.400| 3.424| 12.928| 0| 0| 2.079| 25.031 RTD| 2.342| 3.424| 12.750| 0| 0| 2.079| 25.031 ^C---|-----------|-----------|-----------|--------|------|------------------------- RTS| 2.079| 3.438| 25.031| 0| 0| 00:00:09/00:00:09 root@cpc:/usr/xenomai/bin# " I ran it for more that 5 secs also Further i have checked if the real time driver module for the RTnet is installed so "root@cpc:/usr/src/linux-3.10.32# modinfo rt_8139too filename: /lib/modules/3.10.32-xenomai-3.0.1/kernel/drivers/xenomai/net/drivers/rt_8139too.ko license: GPL description: RealTek RTL-8139 Fast Ethernet driver author: Jeff Garzik <jgarzik@mandrakesoft.com> srcversion: 8917430E2BB14CA4186EE54 alias: pci:v*d00008139sv000013D1sd0000AB06bc*sc*i* alias: pci:v*d00008139sv00001186sd00001300bc*sc*i* alias: pci:v*d00008139sv000010ECsd00008139bc*sc*i* alias: pci:v000010ECd00008129sv*sd*bc*sc*i* alias: pci:v0000021Bd00008139sv*sd*bc*sc*i* alias: pci:v00001743d00008139sv*sd*bc*sc*i* alias: pci:v0000126Cd00001211sv*sd*bc*sc*i* alias: pci:v0000018Ad00000106sv*sd*bc*sc*i* alias: pci:v000002ACd00001012sv*sd*bc*sc*i* alias: pci:v00001432d00009130sv*sd*bc*sc*i* alias: pci:v000011DBd00001234sv*sd*bc*sc*i* alias: pci:v000014EAd0000AB07sv*sd*bc*sc*i* alias: pci:v000014EAd0000AB06sv*sd*bc*sc*i* alias: pci:v00001259d0000A11Esv*sd*bc*sc*i* alias: pci:v00001259d0000A117sv*sd*bc*sc*i* alias: pci:v000013D1d0000AB06sv*sd*bc*sc*i* alias: pci:v00001186d00001340sv*sd*bc*sc*i* alias: pci:v00001186d00001300sv*sd*bc*sc*i* alias: pci:v00004033d00001360sv*sd*bc*sc*i* alias: pci:v00001500d00001360sv*sd*bc*sc*i* alias: pci:v00001113d00001211sv*sd*bc*sc*i* alias: pci:v000010ECd00008138sv*sd*bc*sc*i* alias: pci:v000010ECd00008139sv*sd*bc*sc*i* depends: rtnet intree: Y vermagic: 3.10.32-xenomai-3.0.1 SMP preempt mod_unload modversions PENTIUM4 parm: cards:array of cards to be supported (e.g. 1,0,1) (array of int) parm: media:8139too: Bits 4+9: force full duplex, bit 5: 100Mbps (array of int) parm: rx_pool_size:number of receive buffers (uint) root@cpc:/usr/src/linux-3.10.32# " I have also observed that module 8139too is also running. As i am new to the linux so i want to make sure if i have installed the xenomai with rtnet correctly. Can you tell me is there a way i stop the 8139too module and make rt_8139too module as default driver for NIC. And then use TCPreplay command such as "tcpreplayy --pps=4000 --intf1=eth0 stream.pcap" to play back the pcap file as we can do in the non real kernel. Please guide me and find the attach xenomai config file with the email. I shall be thankful to you Regards Ali Umair ________________________________________ From: Gilles Chanteperdrix [gilles.chanteperdrix@xenomai.org] Sent: Tuesday, November 03, 2015 4:46 PM To: Umair Ali Cc: Xenomai Subject: Re: [Xenomai] Pcap replay tool for xenomai On Tue, Nov 03, 2015 at 02:31:34PM +0000, Umair Ali wrote: > [ 0.489562] Xenomai: real-time nucleus v2.6.0 (Movin' On) > loaded. Xenomai 2.6.0 is seriously outdated (released in 2011). > I have run the latency tests on the xenomai and it works fine. The results of the latency are as follows ----- > RTS| 0.545| 1.328| 12.077| 0| 0| 00:00:06/00:00:06 I hope you have run the test for more than 6 seconds before concluding that xenomai runs fine. > root@cpc:/usr/xenomai/bin# " > > Now i follow the following links to install the RTnet on xenomai: > 1) https://xenomai.org/rtnet-installation/ 2) > http://rtnet.org/doc.html > And used the guide also for the initial > test of the RTnet drivers. When i type the command "sudo ./rtnet > start" my pc froze and i need to do the brutal restart. But some > time it works and i am able to do ping by "sudo ./rtping <loop > back IP>". But after the "sudo ./rtnet stop" it never ping again. > The config.log and rtnet.conf files for the configuration of the > Rtnet are attached with the email. Also I did not observe any > error while installation. Therefore i am not sure if RTnet will > work for me. Please guide me how i can go from here to achieve my > goal. Thanks in advance for your time and advice That version of RTnet is not maintained by the Xenomai project. We merged RTnet in Xenomai 3, but in order to benefit from it, you would have to install Xenomai 3.0.1 (and note that the above installation instructions do not apply, since RTnet is now merged, it means the kernel-space support has to be enabled in the kernel configuration, and the user-space support is compiled unconditionally). Also note that the loopback interface is broken in Xenomai 3.0.1, it will be fixed in 3.0.2, however 8139too should work. Please keep the conversation on the mailing list. -- Gilles. https://click-hack.org -------------- next part -------------- A non-text attachment was scrubbed... Name: config.log Type: text/x-log Size: 49532 bytes Desc: config.log URL: <http://xenomai.org/pipermail/xenomai/attachments/20151105/57111a1d/attachment.bin> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Pcap replay tool for xenomai 2015-11-05 15:17 ` Umair Ali @ 2015-11-05 21:33 ` Gilles Chanteperdrix 2015-11-11 11:16 ` Umair Ali 0 siblings, 1 reply; 6+ messages in thread From: Gilles Chanteperdrix @ 2015-11-05 21:33 UTC (permalink / raw) To: Umair Ali; +Cc: Xenomai On Thu, Nov 05, 2015 at 03:17:45PM +0000, Umair Ali wrote: > Hello Gilles, > > I have managed to install the xenomai on Ubuntu 13.04 (kernel > 3.08). Not sure what you mean with kernel 3.08 here, since you talk about 3.10 later on. > The version of the xenomai is 3.0.1 and kernel version is > 3.10.32. The following is the output after the reboot RTnet requires I-pipe patch for kernel 3.14 or later. > I have also observed that module 8139too is also running. As i am > new to the linux so i want to make sure if i have installed the > xenomai with rtnet correctly. Can you tell me is there a way i > stop the 8139too module and make rt_8139too module as default > driver for NIC. Yes, you can unbind the device from the 8139too driver, then bind it to rt_8139too, or start the rt_8139too module after unbinding from 8139too. To know how to manual bind/unbind devices from drivers, see: https://lwn.net/Articles/143397/ > And then use TCPreplay command such as "tcpreplayy > --pps=4000 --intf1=eth0 stream.pcap" to play back the pcap file as > we can do in the non real kernel. As I already told you, the code is identical to send raw packets with Linux and Xenomai, but the compilation is different. So, if tcpreplay is not compiled for Xenomai, it will not use Xenomai APIs. I suggest you start reading a bit about Xenomai to understand what it does and how it works, starting from here: http://xenomai.org/start-here/ -- Gilles. https://click-hack.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Pcap replay tool for xenomai 2015-11-05 21:33 ` Gilles Chanteperdrix @ 2015-11-11 11:16 ` Umair Ali 0 siblings, 0 replies; 6+ messages in thread From: Umair Ali @ 2015-11-11 11:16 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Xenomai Hello, I have installed the xenomai 3.0.1 as a patch with the following versions. "Linux cpc 3.14.39-xenomai-3.0.1 #2 SMP PREEMPT Tue Nov 10 18:02:47 EET 2015 i686 i686 i686 GNU/Linux". I have realtek NIC with 8139too drivers. I was able to bind the rt_8139too drivers with the realtek NIC like below "root@cpc:/home/cpc/Desktop# tree /sys/bus/pci/drivers/rt_8139too/ /sys/bus/pci/drivers/rt_8139too/ ├── 0000:05:04.0 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:05:04.0 ├── bind ├── module -> ../../../../module/rt_8139too ├── new_id ├── remove_id ├── uevent └── unbind" Now my question is that is there any way we can test the driver or use it the way we can use the 8139too drivers on non real time kernel. Although i have configured the rtnet.conf file with drive name and nic device id and Ip address. But still i can not see the ether interface up. I have two NIC. Eth0 interface is with broadcom driver and eth1 is with realtek drivers. Ifconfig command shows only eth0 and lo interfaces only. and if i run the command 'ifconfig eth1 up' it gives error 'No such device'. So is there any way i can use the rt_81390 as normal interface. Thanks & Regards Ali Umair ________________________________________ From: Gilles Chanteperdrix [gilles.chanteperdrix@xenomai.org] Sent: Thursday, November 05, 2015 11:33 PM To: Umair Ali Cc: Xenomai Subject: Re: [Xenomai] Pcap replay tool for xenomai On Thu, Nov 05, 2015 at 03:17:45PM +0000, Umair Ali wrote: > Hello Gilles, > > I have managed to install the xenomai on Ubuntu 13.04 (kernel > 3.08). Not sure what you mean with kernel 3.08 here, since you talk about 3.10 later on. > The version of the xenomai is 3.0.1 and kernel version is > 3.10.32. The following is the output after the reboot RTnet requires I-pipe patch for kernel 3.14 or later. > I have also observed that module 8139too is also running. As i am > new to the linux so i want to make sure if i have installed the > xenomai with rtnet correctly. Can you tell me is there a way i > stop the 8139too module and make rt_8139too module as default > driver for NIC. Yes, you can unbind the device from the 8139too driver, then bind it to rt_8139too, or start the rt_8139too module after unbinding from 8139too. To know how to manual bind/unbind devices from drivers, see: https://lwn.net/Articles/143397/ > And then use TCPreplay command such as "tcpreplayy > --pps=4000 --intf1=eth0 stream.pcap" to play back the pcap file as > we can do in the non real kernel. As I already told you, the code is identical to send raw packets with Linux and Xenomai, but the compilation is different. So, if tcpreplay is not compiled for Xenomai, it will not use Xenomai APIs. I suggest you start reading a bit about Xenomai to understand what it does and how it works, starting from here: http://xenomai.org/start-here/ -- Gilles. https://click-hack.org ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-11-11 11:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 10:49 [Xenomai] Pcap replay tool for xenomai Umair Ali
2015-11-03 11:47 ` Gilles Chanteperdrix
[not found] ` <2396B4D2166B62479FBBE370D4A7C1F30A705DA6@mb2010-3.intra.tut.fi>
2015-11-03 14:46 ` Gilles Chanteperdrix
2015-11-05 15:17 ` Umair Ali
2015-11-05 21:33 ` Gilles Chanteperdrix
2015-11-11 11:16 ` Umair Ali
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.