0

Let's say we have this:

Network 1                      Network 2
-----------------------------  ----------------
|   \  /                    |  |    \  /      |
|    \/                     |  |     \/       |
| ----------  ------------  |  | ----------   |
| |Router 1|--|Computer 2|  |  | |Router 2|   |
| ----------  ------------  |  | ----------   |
|     |                     |  |     |        |
|     |                     |  |     |        |
| ------------              |  | ------------ |
| |Computer 1|              |  | |Computer 3| |
| ------------              |  | ------------ |
-----------------------------  ----------------

We will assume all computers are sending data at the same time.

Let's say Computer 1 is sending something like "hello" (which isn't totally realistic), and Computer 2 is sending "goodbye". Wouldn't the signals get jumbled up and it would get something like "hegol" and "loodobye"? If Computer 3 was sending it's own encrypted thing and Router 1 read it, it seems like it would be a big mess.

How do routers tell the difference between one computer's signal and another's?

2 Answers 2

0

Darren's answer is correct, from a Networking 101 point of view. Using the MAC address will help determine which computer a message is meant to be used for.

Expanding on that somewhat, a port number (used by UDP or TCP) will make sure the byte is treated as part of the correct conversation. So, when your web browser downloads multiple graphics simultaneously, matching up the source TCP port numbers will help determine whether the bytes are meant for one graphic or another.

However, moving beyond Networking 101, there's also CSMA:CA, which stands for Carrier Select Multi-Access: Collision Avoidance. This feature is simply part of the Wi-Fi standard. This is in contrast to CSMA:CD, which stands for Carrier Select Multi-Access: Collision Detect, which is simply part of the Ethernet standard.

In Wi-Fi, you never have two devices talking at the same time. They take turns. Each turn is very short, so multiple devices can have turns within a short amount of time. But they are never truly communicating simultaneously. If they did, there would be interference.

CSMA:CA will check whether the airwaves are in use. If not, a short message will be attempted, just to confirm that the device is allowed to talk now. After the remote end agrees, then the (quick) conversation can happen.

CSMA:CD is a bit more aggressive. If a copper wire is not sending a signal for a while, the device will try to send a message.

Both CSMA methods will try to detect if a collision occurs. If so, each device will try to randomize a "back-off" period before trying again to see if it is safe to send.

CSMA:CA is safer (making collisions less likely), but notably more expensive (in terms of additional time to wait and/or overhead of additional bytes). The reason why CSMA:CA is preferred for Wi-Fi is that collisions are potentially so much more horribly expensive for Wi-Fi compared to Ethernet. Not only are Wi-Fi speeds typically slower, but you are more likely to have an issue where one piece of equipment may share the media (the airwaves) with an undetected other piece of equipment.

For instance, if two laptops communicate with an access point (“AP”) in the middle, the AP may need to communicate with both laptops, even though the laptops may be out of range of each other (and so neither laptop knows that the other exists). To minimize risks of collisions, the test for availability is kept very short, and longer communication only happens when all devices indicate that "now" is probably a good time to risk some active communication.

In contrast, with Ethernet every device on a segment is likely to be able to notice that the media (the wiring) is actively being used, rather quickly. So collisions tend to be less prone to occur, and so greater risk is more likely to pay off. So the less expensive CSMA:CD gets used.

These protocols (CSMA:CA and CSMA:CD), which are part of other protocols (Wi-Fi and Ethernet) are very technical. For instance, if you have a couple of hubs hooked up, CSMA:CD can take into account how long it will take for the electrical signals to travel from a computer on one end of the switch to a computer on another end of the hub. Such calculations are considered as part of the decision on how long to back off when a collision occurs.

So, to summarize the answer, because of CSMA:CA, a complicated protocol that is just part of the even more complicated protocol called Wi-Fi, you'll actually never have two devices successfully ending conflicting communication at the same time. If two devices do try to send something at the same time, you end up with a collision and both devices will try again (at a later time) to re-send the data.

Wikipedia's article on "Carrier sense multiple access with collision avoidance" (CSMA:CA)

As an interesting side note: If you have a point-to-point Ethernet connection, you can end up with full-duplex mode. With full-duplex, both devices can send information at the same time. They also listen for "problems" caused by collisions. By "problems", I refer to the reflected (electrical) signals that occur when information is trying to be sent both ways. If there are such "problems" with the electrical signal, the device can analyze those "problems" and compare the data that was sent to the problematic electrical signals that were received, and figure out just what bits would have been sent from the other side to generate the precise reflected signals that are received. Therefore, the device can effectively receive data even while sending data. However, that gets too complicated when there are more than two devices.

3

This is networking 101.

Devices on an IP (Internet Protocol) network are uniquely identified by their MAC (Media Access Control) Address and their IP Address.

These addresses are (nearly always, unless something has gone wrong) unique to each device, particularly the MAC address which is set by the manufacturer and cannot normally be changed by an end-user.

Each Ethernet frame starts with an Ethernet header, which contains destination and source MAC addresses as its first two fields.

The router (wireless or wired) uses this information to identify the device the communication is coming from.

In terms of the part of the question asking about the second network (Computer 3); If we are talking about two different wifi networks with different SSIDs and keys, then even if they were both operating on the same channel, each wireless access point would disregard traffic that was not tagged with its own SSID.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .