Re: Serial (rs232 etc.) to IP



I'm not sure if I am missing something, but this seems like a stupid
conversation :)

TCP is a connection based protocol and as such it ensures that all data is
received in the correct order and without errors.

There is no need to 'use' another protocol like Telnet if all you wish to do
is transfer a serial stream of characters from one place to another over IP.
That is what TCP/IP does.

Open a socket on one end and listen.

Start sending characters to the remote socket.

TCP uses a sliding window mechanism, which is effectively a buffer of data
that has been sent that has not yet been acknowledged. The sender will
continue to send until this sliding window is full. As data is acknowledged
from the remote end, the window opens up some more and more data can be
sent.

The size of the window dictates how much data you can send before you must
receive an ACK from the other end.

Every time a SYN is sent, the other end must ACK, unless the remote end has
implemented delayed acknowledgement. You can normally decline delayed
acknowledgement when the socket is first negotiated.

Job done!

Hope this helps.


"Ignacio G.T." <igtorque.remove@xxxxxxxxxxxxxxx> wrote in message
news:4360df29$0$26325$892e7fe2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Paul Keinanen wrote:
>> On 26 Oct 2005 10:57:55 -0700, cs_posting@xxxxxxxxxxx wrote:
>>
>>
>>>>..and by doing this also ruin the serial line throughput when a half
>>>>duplex protocol is used with short message frames. Some converters
>>>>wait 10-100 ms after the last serial character received, before the
>>>>(TCP or UDP) IP-frame is sent. For instance at 115200 bit/s, this
>>>>corresponds to 100-1000 character times.
>>>
>>>This is a valid concern, however there's a bit of a problem with single
>>>character packets when many common embedded TCP devices try to talk to
>>>common desktop operating systems.
>>>
>>>TCP requires that you hang onto all outgoing data until it has been
>>>acknowledged, because if it's not acknowledged you will have to resend
>>>it. Most embedded implementations handle this by sending a packet, and
>>>then being unable to send another until the first has been
>>>acknowledged. The Windows TCP stack often takes as much as 200 ms to
>>>acknowledge a packet when only one is outstanding, so single character
>>>packets can be slowed down to the rate of only five per second!
>>
>>
>> If you are using a protocol that was initially written for serial line
>> communication with normal CRC checks and timeout controls, why bother
>> with TCP, just use simple UDP. If the UDP frame is lost, let the
>> original serial line protocol timeout mechanism handle any missing
>> data.
>>
>
> This has at least one problem: these serial line protocols usually assume
> that packets arrive in order. This makes sense for these protocols (I
> cannot imagine a message jumping over the previous one and reaching its
> destiny sooner than the other), but not for IP packets.


.



Relevant Pages

  • Re: Serial (rs232 etc.) to IP
    ... >> corresponds to 100-1000 character times. ... >character packets when many common embedded TCP devices try to talk to ... If you are using a protocol that was initially written for serial line ...
    (comp.arch.embedded)
  • Re: Serial (rs232 etc.) to IP
    ... Some converters wait 10-100 ms after the last serial character received, before the (TCP or UDP) IP-frame is sent. ... character packets when many common embedded TCP devices try to talk to common desktop operating systems. ... If you are using a protocol that was initially written for serial line ...
    (comp.arch.embedded)
  • Re: paket size TCP
    ... > you have lots of protocol turnarounds. ... Eventually TCP will not be able ... opportunity to merge the data into fewer packets. ...
    (comp.os.linux.development.system)
  • Re: Socket help...
    ... >> You are going to have to give us more details of the protocol, ... > I think the packets are pretty simple; just one or two characters at a time. ... the "RST flag" is extremely ... TCP in some bizarre way, or are you talking about some higher-level ...
    (comp.lang.tcl)
  • Re: Simulating smaller MTU? ie sending small packets.
    ... >> lower the overall throughput is going to be. ... >> fact that TCP packet have to be acknowledged. ... but the acknowledgement doesn't have to be for every individual ... The acknowledgements are serial numbered as to which packets they ...
    (comp.lang.perl.misc)