473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Stronger Than Dirt!

4 1402
In comp.lang.java.advocacy, John Bailo
<ja*****@texeme.com>
wrote
on Sat, 07 May 2005 02:07:37 -0700
<x5********************@speakeasy.net>:

AJAX demo:

http://texeme.com/ajaxtest.html


Congratulations; you've coded a self-denial-of-service attack to your server.

:-)

I've seen this before, admittedly. Google Maps is using the
Microsoft.XMLDOM object but their code is extremely messy to look at.
Your server is using a slightly different approach.

A better structuring of the problem would have keystroke validation
on the client side (e.g., a checksum on charge cards) and the completed
request would then have a more or less guaranteed valid request,
though there's only so much the client can in fact do.

In short, treat network transmissions as very costly.

--
#191, ew****@earthlink.net
It's still legal to go .sigless.
Jul 21 '05 #2
The Ghost In The Machine wrote:
In comp.lang.java.advocacy, John Bailo
<ja*****@texeme.com>
wrote
on Sat, 07 May 2005 02:07:37 -0700
<x5********************@speakeasy.net>:
AJAX demo:

http://texeme.com/ajaxtest.html

Congratulations; you've coded a self-denial-of-service attack to your server.

:-)

I've seen this before, admittedly. Google Maps is using the
Microsoft.XMLDOM object but their code is extremely messy to look at.
Your server is using a slightly different approach.

A better structuring of the problem would have keystroke validation
on the client side (e.g., a checksum on charge cards) and the completed
request would then have a more or less guaranteed valid request,
though there's only so much the client can in fact do.

In short, treat network transmissions as very costly.


Well, yes, but these are the days of broadband and bittorrents.

Shouldn't the web catch up and break away from the GET/POST global
transaction into pages with many tiny connections open?

--
Texeme
http://texeme.com
Jul 21 '05 #3
In comp.lang.java.advocacy, John Bailo
<ja*****@texeme.com>
wrote
on Mon, 09 May 2005 11:45:28 -0700
<sM********************@speakeasy.net>:
The Ghost In The Machine wrote:
In comp.lang.java.advocacy, John Bailo
<ja*****@texeme.com>
wrote
on Sat, 07 May 2005 02:07:37 -0700
<x5********************@speakeasy.net>:
AJAX demo:

http://texeme.com/ajaxtest.html

Congratulations; you've coded a self-denial-of-service attack to your server.

:-)

I've seen this before, admittedly. Google Maps is using the
Microsoft.XMLDOM object but their code is extremely messy to look at.
Your server is using a slightly different approach.

A better structuring of the problem would have keystroke validation
on the client side (e.g., a checksum on charge cards) and the completed
request would then have a more or less guaranteed valid request,
though there's only so much the client can in fact do.

In short, treat network transmissions as very costly.


Well, yes, but these are the days of broadband and bittorrents.

Shouldn't the web catch up and break away from the GET/POST global
transaction into pages with many tiny connections open?


RFC792 - ICMP header, 36 bytes
RFC791 - IP header, 24+ bytes
RFC793 - TCP header, 24 bytes
unknown - 12 byte dual-MAC

For purposes of this illustration I'm using tcpdump on
a simple telnet <hostname> 80, and issuing the request
"manually".

The state diagram in figure 6 illustrates the transmission.
The client sends a 74-byte message just to open a socket
(CTL=SYN). The server responds with a 78-byte response.
The sender sends a 66-byte message, and both sides are
now in ESTABLISHED state. That's 218 bytes and we've
not really done anything yet.

Now we can send a request. For purposes of this test I
sent a simple request: 'GET / HTTP/1.0\n\n'. This is 16
bytes, but to send it the packet size is encapsulated,
resulting in a packet size of 82 bytes.

The server responds with a 66-byte response. I'm not sure
precisely what it is, but the client sends a 68-byte response,
which results in two packets; the first is a 66-byte response,
and the second is a 480-byte response -- the header. However,
66 bytes of this 480-byte packet is TCP+IP+other such overhead.

So far:

16 bytes sent has resulted in 288 bytes over-the-wire from
the client. 414 bytes of the header response (of which part
seems to be a transparent proxy we use here at $EMPLOYER)
has resulted in 690 bytes over-the-wire from the server.

Payload? What payload? I've yet to *see* any payload, just
the HTTP headers! I've already spent more than half a kilobyte!
To be sure, on a high-speed network that's not as bad as
on a serial line, but from an efficiency standpoint I've
seen better.

I happen to know that 12 bytes of this is a dual pair of
MAC addresses (and in fact if one looks carefully at the
sniffed output and at the results of /sbin/tcpdump one
can see them). I also see an IP header and a TCP header.
But that only accounts for 60 bytes. To be sure, RFC791
specifies that options may be of variable length.

But lessee, I've sent 1 request of 16 bytes and have
received *nothing but overhead*: some of it's IP, some
of it TCP, some of it HTTP. The payload proper is still
pending, and I'm going to have to spend at least 60 bytes
of overhead to get him...maybe on both sides.

Costly? What do you think?

IPv6 will make it worse, though it's possible they'll optimize
some of this -- but there's only so much they can in fact
optimize.

--
#191, ew****@earthlink.net
It's still legal to go .sigless.
Jul 21 '05 #4

"The Ghost In The Machine" <ew***@sirius.athghost7038suus.net> wrote in
message news:0t************@sirius.athghost7038suus.net...
In comp.lang.java.advocacy, John Bailo
<ja*****@texeme.com>
wrote

Costly? What do you think?


Nice analysis. You are obviously correct in stating that a communication
roundtrip costs more than meets the casual eye.

However, an Ajax-like approach can actually result in less communication
costs. We have built our own HTML application framework based on a similar
idea over the last years. The application is initially loaded once using a
standard browser GET after which the page "manages itself" by exchanging
user events (actually, JS events) with the server-side application where
component level event listeners are called and page updates (delta's) are
collected and sent back to the page. There a small piece of generic JS that
was also responsible for transmitting the events picks up the delta's and
updates the page.

Agreed, if you send every JS event to the server you will fill up the net.
But the framework separates JS events in three categories by default,
allowing the application to selectively change the status of specific events
for specific components:

status=PURGE: default, ignore the event (actually, don't event mention it in
the HTML)
status=DELAYED: collect the event but buffer it locally in the JS on the
page for later transmission
status=IMMEDIATE: collect it and send it to the server along with all
previous DELAYED events

Only an event with status=IMMEDIATE will result in a communication
roundtrip. All events are sent to the server and processed in the correct
order. The delta's are collected while the listeners are called (totally
transparent to the application code) and sent back to the page where the
updates are performed.

The interesting thing is that this way only events that would normally
(traditional GET/POST HTML apps) have resulted in a FORM transmission or any
other type of page/frame refresh are set to IMMEDIATE (anchor clicks, menu
selections etc). Since the pages are usually updated locally only (delta's)
the amount of data exchanged is much smaller than an average HTML page.

The huge advantage is that on the application side we get a Swing like
programming model with component/event level listeners allowing full
compositional logic with embedding self-managing components.

We get tree components, tab components, splitter components, etc and
application level utility components which can be combined into more complex
components aso. just like when programming in Swing. Only we get a
zero-client-install browser interface and the luxury of HTML layout
management (instead of all the crummy Swing layout managers), decent fonts
etc.

Performance of these applications is a lot better than "normal" web
applications which is even more noticable when the communication channel is
slow, like i.e. an old 33K6 modem.

After 10+ years of Windows, Swing and plain-HTML level application
development, the last two years we experience a development speedup factor
of 2-3 when compared to any of the previous techniques used.

The idea behind AJAX is not bad at all. I just don't think it is a very good
framework they built on top.

Regards,

Silvio Bierman
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: middletree | last post by:
I've seen posts here and elsewhere which read something along the lines of "PULLNG MY HAIR OUT!!!!!" or "HELLLLPPP!". Well, I know that kind of subject line isn't descriptive, but I sure can...
0
by: SoftComplete Development | last post by:
SoftComplete Development Updates EXECryptor to v. 2.1.20 Software piracy! Cracked serial numbers! Thousands of commercial products are posted on the warez sites and become available to all who...
13
by: Mike MacSween | last post by:
Well, I suppose it was only 20 minutes work, but it would have been nice if I'd been prompted to save that new code module. After all, they ask you if you want to save new forms, reports etc.
4
by: John Bailo | last post by:
AJAX demo: http://texeme.com/ajaxtest.html -- Texeme Construct http://texeme.com
0
by: Michael Howes | last post by:
I have a webservice and use WSE so a user can upload a good sized file. The entire ASP.Net projects, web.config sets a Medium trust level IIS is set up to use "Integrated Windows authentication"...
13
by: momobear | last post by:
hi, is there a way to let python operate on sequence of int or short? In C, we just need declare a point, then I could get the point value, just like: short* k = buffer, //k is a point to a...
4
by: vinnie | last post by:
I have tried several times to make the flash website to communicate with the PHP script i have on the server, but it does not work. It should work in this way: when the fields on the forms are all...
3
by: HSXWillH | last post by:
I've looked through the site and not found what I'm looking for here. I am not code-versed or anything like that so my skills are rudimentary at best. I'm using Access 03 on a Windows Vista...
54
by: bearophileHUGS | last post by:
Empty Python lists don't know the type of the items it will contain, so this sounds strange: 0 Because that may be an empty sequence of someobject: 0 In a statically typed language in...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.