views:

56

answers:

2

These questions relate to the basics of networking, but I have not found an answer yet!

Question 1: Can a 100Mbps switch handle 2 simultaneous TCP streams running at 100Mbps? To illustrate this if you have 4 PC's on 1 switch (100Mbps with no other connections) and you had two separate streams, what speed would they reach? Would one stream impact on the others speed, or is a switch fast enough internally to deal with many streams?

2 streams on one network


Question 2: I have set up 1 PC (Linux) on a dedicated network switch, the PC has 2 Network Interface Cards (NIC). Both NIC's have different IP address' and work fine. If I send any data from one NIC to the other absolutely no traffic is send on the network switch. It seams that the kernel is intelligent and works out there's no need to send anything on the network as the IP's are on the same PC. How do I turn this off?

alt text


As I don't have access to 4 PC's I cannot test question 1 in the real world. These are very simple questions, but at the same time very difficult to answer.

Thanks!

+1  A: 

Question 1: Yes, any 100Mb/s switch should be able to handle two independent 100Mb/s streams, as each port is 100Mb/s and not the switch itself. Traffic does not hit the CPU unless it absolutely needs to, at which point the switch may bottleneck and slow down. Normal traffic should be fine, though.

Question 2: You need to write a program to do it manually, or find one online. I recommend looking at Libnet.

The problem is that the kernel knows that it owns both of those cards, so it doesn't bother actually sending the data out on the network. Using Libnet, you can manually construct packets and send them out of a specific interface.

The main trick, though, is that you need to send traffic in both directions (not much; you shouldn't need more than 1 packet a minute going in one direction, with everything else going in the other direction). The problem is that the switch will not know where the packets are supposed to go and will flood them to all ports, slowing everything down.

Jonathan
I would hope that a switch could handle as much data as it has ports, but I don't think its that simple. I think 'backplane bandwidth' is along the lines of what I need to find out. Although for cheaper switches, this figure is not available (great).
ross
I have tried the network traffic generator which binds to an interface. It's called D-ITG http://www.grid.unina.it/software/ITG/ but the traffic still doesn't reach the network switch.
ross
Technically it's the backplane bandwidth that you need to worry about, but if you're only talking about two streams then there should not be any problems.
Jonathan
I'm not familiar with any traffic generators out there; last time I needed to do this, I wrote my own using Libnet. I created two threads: one with a libnet instance bound to one interface, and one with a raw socket bound to the other interface. The sender generated raw Ethernet packets with a custom protocol ID and a few header fields, filling the rest of the space with random data. The receiver listened for packets, decoded the headers to see what was received, marked the packet as received, and discarded it.
Jonathan
+1  A: 

The answer to question 1 depends upon the backplane bandwidth of the switch - this is the total rate of traffic it can handle internally. If it has at least 200Mbps of backplane bandwidth, it can sustain two independent 100Mbps streams.

Cheaper switches tend to have less backplane bandwidth than more expensive "big iron" switches.

As for question 2, you could try and add manual routes to your own IP addresses, explicitly specifying the external devices (if you check route -C, you'll see that the routing cache has routes via the loopback device for your own IP addresses).

caf
That's a brilliant response :) I wish there was a way to find out a switch's backplane bandwidth. I have just tried 'route' but it doesn't like to tie the IP to the interface (invalid argument). Any ideas?
ross
@ross: I suspect you'll need to write a program using raw sockets, as Jonathan suggests.
caf