OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Generality of HTTP

[ Lists Home | Date Index | Thread Index ]

On Wed, 23 Jan 2002, Bullard, Claude L (Len) wrote:

> Thanks Al for the tutorial.  While you are in that
> mode, could you expand a little more on the timing
> aspects of TCP vs UDP?

Sure...

One of the big downers with TCP for things involving short messages - as
opposed to large data transfers, where it excels - is the damned
setup latency.

Opening a TCP connection requires a three way handshake. Closing it down
requires... two way handshake, IIRC. And then there's the actual data
transfer itself, plus acknowledgements each way.

A UDP RPC will usually take two packets - request, response.

A TCP RPC (be it an XML-RPC or whatever) will take many... let me run a
test: I'll telnet to an echo port and send a packet while tcpdump-ing it:

Connection setup:

14:49:34.118676 localhost.55285 > localhost.echo: S 3761093512:3761093512(0) win 32304 <mss 16152,sackOK,timestamp 318087710 0,nop,wscale 0> (DF) [tos 0x10]
14:49:34.118719 localhost.echo > localhost.55285: S 3764439617:3764439617(0) ack 3761093513 win 32280 <mss 16152,sackOK,timestamp 318087710 318087710,nop,wscale 0> (DF)
14:49:34.118744 localhost.55285 > localhost.echo: . ack 1 win 32304 <nop,nop,timestamp 318087710 318087710> (DF) [tos 0x10]

Sending my request:

14:49:37.390247 localhost.55285 > localhost.echo: P 1:8(7) ack 1 win 32304 <nop,nop,timestamp 318088037 318087710> (DF) [tos 0x10]
14:49:37.391546 localhost.echo > localhost.55285: . ack 8 win 32280 <nop,nop,timestamp 318088037 318088037> (DF)

Getting my response:

14:49:37.392491 localhost.echo > localhost.55285: P 1:8(7) ack 8 win 32280 <nop,nop,timestamp 318088037 318088037> (DF)
14:49:37.392514 localhost.55285 > localhost.echo: . ack 8 win 32304 <nop,nop,timestamp 318088037 318088037> (DF) [tos 0x10]

Closing down the connection:

14:49:41.065798 localhost.55285 > localhost.echo: F 8:8(0) ack 8 win 32304 <nop,nop,timestamp 318088404 318088037> (DF) [tos 0x10]
14:49:41.069620 localhost.echo > localhost.55285: F 8:8(0) ack 9 win 32280 <nop,nop,timestamp 318088405 318088404> (DF)
14:49:41.069737 localhost.55285 > localhost.echo: . ack 9 win 32304 <nop,nop,timestamp 318088405 318088405> (DF) [tos 0x10]

--------------------------------------------------------------------------

Compare this with the following:

14:51:15.882157 localhost.32957 > localhost.echo:  udp 6 (DF)
14:51:15.882263 localhost.echo > localhost.32957:  udp 6 (DF)

...that's the same request and reponse in UDP!

I tested this with the 'echo' service in inetd, using both the TCP and UDP
versions. The TCP test was performed with telnet. The UDP test was
performed with netcat.

Although proper use of HTTP/1.1 will spread the overhead of connection
setup and teardown, HTTP/1.1 is a relatively complex protocol to implement
and there is still the issue of the seperate acks of request and response
as opposed to piggybacking them with the data transfers as UDP-based
protocols do.

And that overhead is only spread out with HTTP/1.1 if you're doing
relatively basic client/server stuff where the client talks mainly to the
same server all the time. Some applications are like that, but the
exciting peer to peer distributed web services that gather data from all
over the Internet and present the user with a summary sure as hell won't
:-)

>
> len
>

ABS

-- 
                               Alaric B. Snell
 http://www.alaric-snell.com/  http://RFC.net/  http://www.warhead.org.uk/
   Any sufficiently advanced technology can be emulated in software





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS