View Single Post
Old 05-17-2008, 08:47 AM   #13 (permalink)
pparks1
.
Points: 13,404, Level: 27
Points: 13,404, Level: 27 Points: 13,404, Level: 27 Points: 13,404, Level: 27
Activity: 27%
Activity: 27% Activity: 27% Activity: 27%
 

Local Time: 01:10 AM
Local Date: 09-07-2008
Join Date: Jun 2006
Location: Michigan
Posts: 4,914
pparks1 X3F Neophyte
Quote:
Originally Posted by gordonquinn View Post
you cant use a hub for this
a hub repeats signals, it will try and use the same ip for both machines in effect, therefore you will get limited or no connectivity
Actually, you understanding of what a hub does is a bit on the incorrect side. The part that is correct, is the fact that they are referred to as repeaters.

NETWORKING 101 by pparks1

Hubs
A hub is a shared bandwidth device. It's like a power strip to an extent. It gives you the ability to plug in multiple computers on the same network. A hub is not "intelligent" though and it has no idea where the computer is actually plugged in.

Thus, when a computer talks, it sends out the traffic and every single computer on the network sees the traffic (that's called broadcasting). The traffic is destined for 1 specific computer (addressed by IP and MAC), so the other computers simply ignore it, but they all have to see the traffic.

The other downside of a hub is that the devices can only transmit 1 at a time. So, if two computers try to send something at the same time, you have a collision on the wire. Both computers then wait a predetermined amount of time and then send again. This concept is called (CSMA/CD) Carrier Sense Multiple Access with Collision Detection. And while this method works, it's pretty inefficient.

It's completely and totally possible to have 2 devices or 10 devices or 30 devices on a hub obtain unique IP addresses. They won't all get the same one. But they all will have to see and ignore the traffic of the other computers getting the addresses. In addition, they all have to wait until the line is clear to attempt transmission. <--So, not very efficient.

Switches
Switches on the other hand are "intelligent". When you first turn on a switch however, it's as dumb as a hub though. The first time the computer communicates, the switch has no choice but to broadcast the traffic to all ports. Once this happens though, the switch records the MAC address and which port it came from and once it reaches it's destination it records the MAC address and the port there as well. From now on, when traffic comes to/from these two MAC addresses, the switch can send it directly to the computer since it now knows where that computer actually is.

In addition, switches are full duplex. Meaning that they send and receive traffic on different wires in the network cable. Thus speeds increase (you get a full 100Mbit send, and a full 100Mbit receive) and they don't have to worry about collisions (CSMA/CD).

Routers and NAT
Routers allow you to connect 2 networks together (for example, you home network which might be 1-10 devices) and your ISP's network (which later will be routed to the internet). The router performs NAT (Network Address Translation). So, when a computer on the inside of the network wants a webpage from say this forum, it will send a request to the router. The router will say, "Ok, 192.168.1.100 wants a website from X....so, I am going to remove the address of 192.168.1.100 (which is non-routable) and I'm going to put on the address from the ISP instead and send the request to X. I'm also going to make an entry in a table so that I know where to send the information when it comes back."

When the website traffic from X comes back, the router looks at the table and says, "Did anybody request traffic from X? Yep, it seems like 192.168.1.100 wanted it. So, I will remove the destination address (the ISP outside IP that your router has been given) and re-address it to 192.168.1.100 and deliver it to that host."

NAT is a basic firewall, because if somebody from website Y just decided to send you something, when the router gets it and consults it's tables, it will see that nobody requested anything from Y and will simply drop the packets. However, where NAT does you no good is when you do something stupid from an internal computer and thus requested the nefarious information from Y. In that case, the router will deliver it....regardless of the content. This is why it's imperative that you also use a software firewall....a NAT firewall cannot protect you from yourself.

Routers also usually come with 4 or more Switch ports on them.....so that they can be used to connect multiple computers to each other and then optionally route them to the internet if that is where the computers need to go.
__________________
Interested in Linux? Well, check out my comprehensive Ubuntu setup guide:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by pparks1; 05-17-2008 at 08:53 AM.
pparks1 is offline   Reply With Quote