I have been very interested in networking for quite a while, and I have been wondering this question. I've been thinking about this in complete binary, meaning how does a 0 of a data packet not get interfered by a 1? For example, if two data packets are somehow sent at the same time, how do they not merge if one packet is (of course not this short) 101101 and another is 011010? How does it now become 111111 and mess everything up? This also brings up how the validation of a packet header is used, as that I am also confused about too. Is it just based on how instant these packets of data are sent and that it's almost impossible for multiple to send at the same time? I hope this isn't too confusing, but I would be happy if someone could broadly explain this. Thank you

  • 1
    In all modern switched networks, packets are never sent at the same time. They are queued and sent one at a time.
    – Ron Trunk
    Apr 22 '18 at 4:19

You are describing a problem called collision. There are different network media and protocols that are subject to collision, and the protocols must have a method to detect when that happens. Your question is really too broad to go into details, and those will vary with the medium and protocol, but I will give you some information.

The original ethernet was on a shared medium (coax cable) where more than one host could send at the same time, and is uses CSMA/CD (Carrier Sense with Multiple Access using Collision Detection). A host needs to listen to the medium to see if it is free before sending, but that doesn't guarantee that there will be no collision because it takes a finite amount of time for a signal to cross the medium. The ethernet hosts will detect a collision and send a jamming signal, back off a random amount of time, and try to resend. (Switched ethernet has eliminated collisions for all practical purposes.)

Wi-Fi also uses a shared medium, so it is subject to collisions, and it uses CSMA/CA (Carrier Sense with Multiple Access using Collision Avoidance), but that doesn't mean that it can entirely avoid collisions.

  • Thank you so much for answering my question. About the answer, would collisions only lead to a packet loss, or could certain protocols be corrupted until fixed?
    – TheRyGuy
    Apr 22 '18 at 4:22
  • 5
    The protocols ignore collisions, which are handled at the physical level by the hardware, and collisions are not passed up to the protocol data-link layer. The protocol data-link layer will also (generally) have error detection built into it that will drop any frames that are corrupted for other reasons. For example, ethernet has the FCS that is calculated based on the bits of the frame, and if it doesn't match, the frame is dropped as corrupt and not passed up to the next layer in the network stack.
    – Ron Maupin
    Apr 22 '18 at 4:34
  • @TheRyGuy: Collisions per se do not lead to packet loss. It leads to retransmit. However, too many collisions will overwhelm the system and lead to packet loss. We call the too-many-collisions situation "noisy". This is because "collisions" need not only occur between nodes in the system but also with things like someone using an arc welder next door (electric arcs like lightning generate signal at almost all radio frequencies)
    – slebetman
    Apr 22 '18 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.