Re: Sockets best for real-time?



"Guillem" <guillemvicens-nospam@xxxxxxxxxxxxxxxxxx> wrote in message
news:xn0enfizsdkovk002@xxxxxxxxxxxxxxxxxxxxxxxxx
Arthur Hoornweg wrote:

The disadvantage of UDP is that there's no guarantee that a packet
doesn't get lost.

that's the reason I did not even mention it. Personally I think this
point could be a serious problem for a RTS


It's worth clarifying this: Packet loss AT THE ETHERNET LEVEL is a fact of
life with ALL network protocols, including TCP. A dedicated full-duplex
point-to-point link between two machines should mean that packet loss is
'practically' not a problem, but you don't really have a true network then.

Where UDP and TCP differ is their approach to packet loss: TCP guarantees
data delivery by retransmitting lost packets, while UDP does not. You can
add simple retransmission capabilities to UDP protocols, particularly if you
just have a command-packet/response-packet style of comms. And TCP's secure
redelivery costs time and bandwidth.

With TCP, the time taken to deliver or receive a packet is essentially under
control of the network stack, not the programmer. With UDP, you can control
a lot more yourself, making it very suitable for many simple realtime
systems.

However, IMO, unless you absolutlely need the 'simplicity' and low-level
control that UDP (or your own IP-based protocol) gives you, stick with TCP.
And, if you want to optimise responsiveness with TCP/IP, you must understand
the Nagle (TCP_NODELAY) flag!

Either way, make sure you know how to use Ethereal. It will be your best
friend!

- Roddy




.



Relevant Pages

  • Re: Incoherent E-mails
    ... The Novell crap was originally run on IPX ... The term in the early-mid nineties was "packet storm". ... The original advantage of UDP was ... > 60 bytes for TCP. ...
    (alt.computer.security)
  • Re[2]: Why TCP is more secure than UDP?
    ... The point that you use TCP ur UDP doesnt really matter, ... Suppose this service just echoes back any packet I send it. ... BD> Suppose my tricky friend "Moe" is across the internet at 10.0.0.1 (Oh ...
    (Security-Basics)
  • Re: recvfrom() strange operation
    ... I have only one escape way for this kind of UDP operation. ... TCP receive you always send data to upper level in sequence, ... In case of UDP you do not know the packet ...
    (comp.os.linux.development.system)
  • Re: TCP Blocking sockets
    ... the tcp buffers don't fill up etc due to slow link speeds. ... With TCP/IP the receiving system will wait for the packet to ... >arrives, ... UDP doesn't ensure you data delivery, ...
    (alt.comp.lang.borland-delphi)
  • Re: A question regarding MTU: how it can effect TCP performance + other queries
    ... Can you check if your physical NIC has TCP large send offload enabled? ... I can't think of anything for the UDP case however, that just seems strange to me. ... Are you grouping multiple UDP packets in one TCP packet? ... encapsulated within another TCP packet when passed to physical interface, while for UDP I am sending UDP packet encapsulated within TCP packet when passed to physical interface. ...
    (microsoft.public.development.device.drivers)