Workings of bandwidth and throughput (22)

1 Name: CyB3r h4xX0r g33k 2005-09-29 14:42 ID:zCwTWETR

I am very confused about bandwidth. There's only one thing I can tell for sure about it and that is stuff like "100mbit is faster tahn 10mbit" but sometimes not even that is true.
Theoretically a person with 10mbit would be able to get a top speed of 10/8 mb/s = 1.25 mb/s right? If that's true how come I can get 6 mb/s when downloading with a 10mbit line from another person with 10mbit?

Also, many people open very few slots on DC with the excuse that if many people download from the same guy at the same time they will get a much slower speed than just having a few guys downloading at a time thus having a lower amount of slots. The also use math to explain the shared speed as something like (bandwidth/8)/users.
However to my experience this is not the case. I have seen many times where I've had uploads in like 150 kb/s and then two other guys connecting and downloading at pretty much the same maybe slightly lower, say 125 kb/s, which would mean a total upload of 3*125 kb/s = 375 kb/s. Which would mean that it's actually no problem at all having lots of people download from you.
Also, is this not how BitTorrent works? You upload to a lot of people and also download from a lot people at once and the speeds with BitTorrent are usually superior to other P2P programs.

So how exactly should bandwidth be interpreted and treated?

2 Name: CyB3r h4xX0r g33k 2005-09-29 20:03 ID:oMM4XuDm

Way to through around megabytes and megabits while labeling them all mb!

There isn't a significant amount of overhead for anything less than say... 100 connections but there is a point to limiting slots. Not everyone has (or rather hardly anyone) has 10 Mbit pipes and it allows a certain quality of service. If you have 35 Kbyte/sec upload and you don't have a limit on the connections, the speed wouldn't be horrible for up to ~5 people, but if you have 35 people all getting 1Kbyte/sec no one is going to be really happy. If you haven't maxed out your upload with one connection, there is certainly no reason not to let someone else connect.

With bittorrent you may be connected to a lot of other peers, but you generally are only transfering with a select few of them at any one time.

Also even with a 10 Mbit line, even connected to another person on 10Mbit you are never going to really reach 10Mbitps transfer as IP, TCP/UPD, ethernet etc all have overhead.

Frankly, i'm not even sure what you are asking but

3 Name: CyB3r h4xX0r g33k 2005-09-29 22:39 ID:zCwTWETR

>Way to through around megabytes and megabits while labeling them all mb!

I don't think I did that, but I could've written "(10 mbit/s)/8 = 1.25 mb/s" or just "10 mbit/s = 1.25 mb/s" to show that the 10 was in mbit/s. Sorry about that.

>Not everyone has (or rather hardly anyone) has 10 Mbit pipes

Pretty much everyone has at least 10mbit where I live. Many also have 100mbit, me included, although I don't really need that much. 10mbit is just fine.

>Frankly, i'm not even sure what you are asking but

Well, pretty much what was in the examples. Wether having a slot/hub limit on hubs are bad or not. I don't really like that "3 hubs max" rule people use as it limits your searching. I also want to understand it's seemingly random behaviour.

You mention "overhead", what is that?

4 Name: dmpk2k!hinhT6kz2E 2005-09-30 01:50 ID:Heaven

You're not just sending the raw data. You're also sending the address of the receiver, sender, a checksum, and often a few other bits of information.

If you send one megabyte of data, it will be cut up into a few hundred or thousand packets, and each packet will have extra information added to it (the stuff mentioned above). Then when you send it out over ethernet it'll have another layer of information wrapped around that. So you end up with:

|----------------------------------------------------------|
| |-------------------------------------------| |
| Ethernet | |------------------------------| | |
| data | IP data | raw data | | |
| | |------------------------------| | |
| |-------------------------------------------| |
|----------------------------------------------------------|

(not drawn to scale)

And that's ignoring what happens when there's a collision, or the IP layer gets congested. IP in particular was never meant for massive speeds.

One complicating factor, at least for some some types of data, is that what you're sending is often compressed on the fly. So it's possible to receive more data that 10Mbit/s, although the data rate on the wire will be slower.

5 Name: CyB3r h4xX0r g33k 2005-09-30 02:01 ID:oMM4XuDm

Slot limits aren't bad and not having slot limits isn't always bad either.

>>4 Is mostly correct, think of it this way, when you send someone a letter you put it an an envelope right? If you can only send 100 grams of letters at once and each envelope has a mass of 1 gram and each letter is 10 grams, you can only send 9 letters at once. Stuff over the internet needs envelopes and addresses too.

6 Name: !WAHa.06x36 2005-09-30 11:07 ID:HVuFciKh

On the subject of limiting upload:

First off, it's safe to assume most people on P2P don't have a very clear idea of what they're doing. That's not to say they're wrong, though, they might just not understand why they're right.

The main problem is asynchronous lines, like DSL and cable. You have a lot less upload bandwidth than download. However, a TCP connection is always two-way, so while you're downloading, the computer needs to send back acknowledgement packets to the computer you're downloading from to tell it the data arrived. However, if your uplink is maxed out, those packets get delayed. Which means your download will slow down. Overall, maxing out your uplink will degrade your connection quite badly, which is why people limit uploads. In DC, where there isn't (at least there wasn't back when I was using it) a bandwidth limiter, you have to just make do with limiting the number of slots and hoping for the best.

7 Name: CyB3r h4xX0r g33k 2005-10-01 10:48 ID:MncG4Gb6

>You have a lot less upload bandwidth than download.

Standart ADSL over copper:
Upload max 1mbit
Download max 8mbit..
My ISP:
Upload max 256kbit
Download max 1mbit.
Now my isp can't really say "we give you less upload because of technical reasons.." They just don't want people using p2p.

8 Name: reppie 2005-10-01 21:23 ID:UgedtBS4

>>5
The trick is to give TCP ACK packets a higher priority than data packets, in the outgoing queue. That way, uploading something won't have much of a negative impact on the other connections.

9 Name: !WAHa.06x36 2005-10-01 21:36 ID:Heaven

>>8

That's the trick, all right, it's too bad no OS will actually do that for you.

10 Name: Redhatter 2005-10-02 05:42 ID:dycOvKwI

Not quite... AFAIK Linux iptables is capable of doing this.

iptables -t mangle -A POSTROUTING -j CONNMARK --set-mark {value}

and you'd use that in your traffic shaping rules to tweak the priority of those marked packets.

The exact mechanics of this, I'm not completely sure about though -- but I know marking packets is involved. ;-)

11 Name: Redhatter 2005-10-02 05:44 ID:dycOvKwI

Duh, that should be...

iptables -t mangle -A POSTROUTING --tcp-flags ACK ACK -j CONNMARK ....

12 Name: reppie 2005-10-02 06:50 ID:UgedtBS4

>>9
No OS does it by default (and rightly so), but it's easy to do, at least on the BSDs:
http://www.benzedrine.cx/ackpri.html

13 Name: !WAHa.06x36 2005-10-02 12:54 ID:Heaven

That's a funny use of the word "easy".

14 Name: CyB3r h4xX0r g33k 2005-10-02 13:00 ID:Heaven

>>13

Well if you were a BSD contributor, you'd find it easy.

15 Name: Redhatter 2005-10-02 13:11 ID:dycOvKwI

Level of difficulty is always relative to user experience.

Some network admins would have no problems setting up IPSec VPNs -- yet I can never get my head around them. (I stick to PPTP and OpenVPN for that reason -- they're simple)

Some people stick to using Windows because they don't understand Linux or Unix -- I personally find Windows harder to use than Linux -- largely because it always assumes I'm the dumb$#ยก! user that doesn't know anything about computers. (And boy do I hate that!) Linux at least looks at me at eye level. ;-)

16 Name: dmpk2k!hinhT6kz2E 2005-10-02 15:11 ID:Heaven

> Some people stick to using Windows because they don't understand Linux or Unix -- I personally find Windows harder to use than Linux

And the game is on!

17 Name: Redhatter 2005-10-02 19:54 ID:dycOvKwI

ROFL No, I'm not going to turn this into a Windows vs Linux slagfest!

This isn't Slashdot! ;-)

18 Name: CyB3r h4xX0r g33k 2005-10-04 19:27 ID:M9TOjTC2

Did somebody say Slashdot ?!

Imagine a Beowulf cluster of these!
I, for one, welcome our new iron-eating overlords
You're new here, aren't you? :-)
The 2.0 kernel is great, even though it is old it is quite reliab=20 ]} $}1}&..}=3Dr}'}"}[NO CARRIER]
I predict that this story will appear again on the front page of Slashdot within the next 48 hours.
In Soviet Russia, Post Firsts You!
I better stop cut and pasting these from wikipedia some awsome website!

19 Name: CyB3r h4xX0r g33k 2005-10-04 19:28 ID:Heaven

:( It parsed my ^ H into something else...

20 Name: CyB3r h4xX0r g33k 2005-10-04 23:49 ID:Ec6FWNSf

>>19
well, duh. ^ H is supposed to X it out, right?

21 Name: dmpk2k!hinhT6kz2E 2005-10-05 06:35 ID:Heaven

Don't forget petrified Natalie Portmans or hot grits down someone's pants.

22 Name: CyB3r h4xX0r g33k 2005-10-05 15:35 ID:Heaven

I like my hot grits on a naked and petrified Natalie Portman thank you very much

This thread has been closed. You cannot post in this thread any longer.