Alternate Packing Mechanism in CoBOS Device Servers
How does a CoBos device server such as a UDS pack serial data into frames and send it out over the network. Is there some standard size gap detect? Or is there some other mechanism that delimits packets?
Packing refers to the process of taking serial data that has been received at the serial port and packing it into Ethernet datagrams for transmission across the network to another host.
There are two packing algorithms that can be used on the UDS device server.
The standard packing on a UDS uses a gap timer of 10ms. This results in close-to-optimal throughput and bandwidth usage for most applications.
If more control over the way data is packed into Ethernet frames is needed then you can use the Alternate Packing settings in the UDS, which allow you to set a different value for the gap timer and also enable the use of send characters, trailing characters, etc.
In Setup Mode you can enable the Alternate Packing Algorithm by changing the value of Flush Mode to 80 or some other value that sets bit 7. In general, a Flush Mode of 80 will work fine; the buffer clearing options are very rarely required.
For Flush Mode options see pages 53 and 54 of the User Guide for your device server, e.g. the User Guide for the UDS2100 is here:
http://www.lantronix.com/pdf/UDS2100_UG.pdf
The User Guide is also on the CD that shipped with your device server.
When Alternate Packing is enabled, the Pack Control settings become available. As shown in table 7-9 on page 54 of the User Guide the possible settings for the gap timer are 12ms, 52ms, 250ms and 5 seconds. Most folks use either 12ms or 52ms, the higher values will only work if there is very sparse data coming into the serial port and if the data is not very time sensitive.
For instance, if you use 5 seconds as the gap timer and a single character is received about every 4 seconds the data may not be sent until the MTU (Maximum Transmission Unit) value is reached. With the default MTU of 1400 it could take a while to get a packet together to send in this scenario. No matter what the pack control settings are the UDS will always send a packet when its buffer reaches the MTU value.
You can also allow trailing characters (e.g. a CRC or Checksum) and configure the handling of Send Characters. See the description of these options at the top of page 55 of the User Guide referenced abote. Defining Send Characters is documented a little farther down on page 55, after the section on DisConnTime.
For instance, if you have a serial device that sends data "packets" that always end with the same one or two characters you can force the UDS to pack each data "packet" into an ethernet packet and send it when it detects those characters.
Also see:
FAQ# 11 - Cobox, UDS10, UDSx00, SDSx100, XPort, WiPort - Packing Algorithms
Cobox, UDS10, UDSx00, SDSx100, XPort, XPort Direct, WiBox, xDirect, xPico or WiPort - Packing Algorithms
FAQ# 1015 - Using Pack Control For UDS, SDS, XPort, WiPort & WiBox Products
Using Pack Control For UDS, SDS, xDirect, xPico, XPort & WiPort Products
[Originally Published On: 03/30/2009 04:51 PM]