On 2012-08-22 10:57, florian rieger wrote: > Hi everybody, > > I have some problems understanding the TDMA Implementation of RTnet and was > hoping that someone here can help me. I'm using version 0.9.12 of RTnet on a > 2.6.38.8 Kernel. > > First of all I'm not sure about the correct configuration, I'm have two > stations and I'm using the rtnet start script to start them up. I want the > stations to share each TDMA cycle (which should be 10ms) equally. So I > modified the /etc/rtnet.conf file, commented out the TDMA_SLAVES, TDMA_CYCLE > and TDMA_OFFSET parameters and uncommented the TDMA_CONFIG="/etc/tdma.conf" > line. One Station is configured to act as TDMA_MODE="master", the other one > as TDMA_MODE="slave". I'd like to have the following TDMA configuration: > > +------+-----------+-----------+------+ > | sync | station 1 | station 2 | sync | > +------+-----------+-----------+------+ > 0 5000 10000 > > So the tdma.conf on both stations looks the same: > > /etc/tdma.conf > master: > ip 10.0.8.2 > cycle 10000 > slot 0 0 > > slave: > ip 10.0.8.3 > slot 0 5000 > > In /proc/rtnet/rtmac/tdma_slots I found out that this results in time-slots > with a sizes of only 1500us,
You don't configure the slot size above, you configure their position (offset) in the cycle. The size means the MTU here, and it is in bytes. Sorry, should be explained somewhere, but I guess we lack this. > so I expanded my configuration according an example I found in the > Documentation to: > > master: > ip 10.0.8.2 > cycle 10000 > slot 0 0 1/1 5000 > > slave: > ip 10.0.8.3 > slot 0 5000 1/1 5000 > > But when I run rtnet -v start I get the message: > > /usr/sbin/tdmacfg rteth0 slot 0 0 -p 1/1 -s 5000 > ioctl: Invalid argument I think to remember that the MTU will be rejected here as the underlying NIC doesn't support it (no jumbo frames). > > master and slave keep searching each other without success.. So I returned to > use the old configuration for the moment and found another behavior I can't > explain. I'm running the rttcp-client/rttcp-server program and configured it > to send its 6 Byte message with a cycle time of 11ms (a TDMA cycle has 10ms, > 5ms each station). When I measure (using tcpdump and wireshark) the arrival > time of the packets, it seems like they are transmitted always at the > beginning of a time slot, eg. direct after the sync frame for one direction > and 5000ms after the sync frame for the other direction. I supposed to see > some variance of the arrival time within each time slot depending on the > actual transmit time of the package. Nope, packets are queued by the TDMA layer and then sent as precisely as possible at the beginning of the specified slot. This is time-driven and running in a separate context than the application that issues the packet. So, unless you issue it right before the TDMA cyclic thread starts for its slot, you will miss the cycle, and the packet will only be delivered in the next one. Also note that there can be only one packet per slot. If you want to send multiple packets per cycle, define as many slots for the station. > > For example, when I send a package at the beginning of a time slot, is it > transmitted instantly? And on the other side, when I send a package at the > very end of a time slot it will arrive with a time offset which is roughly > the slot time right? > > Well, I hope I explained myself understandable, if anybody can help it would > be really appreciated! Hope I was able to answer the questions. Jan
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ RTnet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rtnet-users

