Results 1 to 3 of 3
  1. #1
    Member dreamtfk's Avatar
    Join Date
    Feb 2002
    Location
    Orlando FL
    Posts
    1,882

    Dowloading vs. Uploading

    Why does my connection slow to a crawl when I am uploading data but when I am downloading several files I can still surf the internet?
    i5 3570K @ 4.2Ghz (34c) & CoolerMaster Hyper 212
    Asus P8Z77-V
    G.Skill Ripjaw 1600 4GBx2
    Sapphire 6950 2GB Unlocked/OC'd to 6970 Specs
    Corsair Graphite 600T (Awesome!)
    Corsair 650TX PSU
    120GB Intel(Boot)/Samsung 840 250GB (Gaming)/1TB Samsung (Storage)
    Acer 27" Monitor

  2. #2
    Member
    Join Date
    Apr 2002
    Location
    Xanadu
    Posts
    3,538
    Cause you have an asynchronous connection: your pipe for downloading is bigger than for uploading.
    Every datapacket needs to send an acknowledgement back to the sender to ensure the transmssion was without error. This ACK packet is a lot smaller than the datapacket (usually 8 bytes or so vs. the 1500 of the data packet). When you download something the upstream channel for this ACK packet is free and it uploads fast, you can still surf the web. If you upload something, that upload channel is already totally full and those ACK packets you generate by surfing have to be put into a queue and wait for a time. Sometimes up to several seconds. The webserver you surf however can't send the next datapacket down unless you acknowledge the last one with your ack packet. So it takes a lot of time for every 1500 byte packet to get through from that webserver

  3. #3
    Senior Member
    --
    I teach people how to read your email.
    su root's Avatar
    Join Date
    Aug 2001
    Location
    Ontario, Canada
    Posts
    5,444
    In general, a TCP/IP Transfer, it goes like this:
    Client > Server: Hi (SYN)
    Server > Client: Hi (SYN, ACK)
    Client > Server: Nice to meet you (SYN, ACK)
    Client > Server: Gimmie parts 1-3 of file XYZ
    Server > Client: [DATA 1]
    Server > Client: [DATA 2]
    Server > Client: [DATA 3]
    Client > Server: OK, I got those fine (ACK), Gimme parts 4-6
    ...

    This is done so that if any part along the way is dropped or corrupted, instead of returning ACK, the client just asks for the missing pieces. This is true for any kind of TCP transfer... downloading of webpages, images, FTP, etc.

    TCP Windowing will stretch this as much as possible, so stable transfers do not require the client to ACK as often, speeding it up, but unstable transfers require a lot more ACKing.

    Now look at the timeframe, the server can transmit parts 1-3 very quickly, but then has to wait for the ACK from the client. Depending on the latency of your connection, you may be 50ms or 800ms away from the server, so it may take a while (like 1.6 seconds in the 800ms example) for the ACK to get back to the server to continue loading the webpage.

    Since cable and DSL have such a restricted upload pipe, data is transferred slower in upload, so, if you have a 768kilobit upload, then you can only transfer 96 kilobytes per second. Now, in a normal network, it's FIFO (first in, first out) queueing for upload, so since your network is high-speed 100MBit, your computer has no problem transmitting a bunch of upload packets, but when they get to your modem, it can only send them so fast, so the modem will build a queue of packets to send... if you then return an ACK, it will be placed behind the upload packets in queue... if the queue has 200kilobytes in it, then the ACK has to wait an additional 2 seconds before it's actually transmitted.

    To speed it up, you can implement traffic shaping, which, when properly configured, will keep the queue on your router or firewall (instead of on your modem), and when a high-priority packet comes through, like an ACK, it can jump to the front of the queue. Another way is to restrict uploading so that it doesn't fill your upload cap, leaving room for ACKs and other traffic.

    DNS requests, although not TCP traffic, will also get hit by this... when you first request a webpage, you may need to do a DNS lookup, before even connecting to the server (when your browser says, "Looking up hostname XYZ.com...", or similar), if your upload queue is a constant 500ms wait, then counting only the queueing time on your modem, it'll take 500ms to send the DNS request, then 1 second for the TCP handshake, so essentially, 1.5 seconds before you even request what you want.
    "Some people, when confronted with a problem, think 'I know, Ill use regular expressions.' Now they have two problems."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •