1

By data corruption I mean frame/packet corruption, we can stick to the corruption due to a collision for simplicity.

I know that switches can detect frame corruption if they are not set to cut-through forwarding. But are they always doing it ? And how does a switch detect a corruption? I assume it is done by checking CRC but confirmation would be appreciated.

I have read that similar mechanisms (cut-through and store-and-forward) can be found in routers. So do routers detect packet corruption in the same way as switches do ? And does working in layer 3 have any impact on this process ?

Finally hubs. Can they detect any data corruption or are they always forwarding data without any checks ?

Wiki says [1] that store and forward method is typically used on bridges and points out that frame integrity is verified so I take it for granted.

[1] https://en.wikipedia.org/wiki/Bridging_%28networking%29#Simple_bridging

2 Answers 2

3

Ethernet interfaces on hosts, switches, routers, etc. will detect corrupted frames and drop them.

Routers will also look at the IPv4 Header Checksum (IPv6 does not have this) to see if a packet header is corrupt, and drop the packet if it is.

Hosts will look at the transport protocol to see if it is corrupt for those transport protocols that have a checksum, and they will drop those corrupt datagrams.

Hubs, on the other hand, simply repeat any received signals out the other interfaces, so there is no detection of corruption. Think of a hub as a powered cable.

4
  • could you please define what you mean by dropping a frame? How TCP protocol can remain to be reliable when dropping a frame occurs on layer 2/3 devices?
    – zajer
    Jun 14, 2020 at 15:54
  • 3
    Dropping a frame simply means that the device will not forward the frame; it simply goes away as if it never existed. TCP has a mechanism to tell if a segment never arrived at the destination, and it will resend any missing segment. That is a whole other story.
    – Ron Maupin
    Jun 14, 2020 at 15:57
  • Just to make sure, we can consider bridges as ethernet interfaces, right? So they will also detect corrupted frames just as switches, routers and hosts.
    – zajer
    Jun 14, 2020 at 16:00
  • 1
    A bridge will have ethernet interfaces. Remember, modern bridges are called switches. Switch originally was a marketing term for a high-density bridge.
    – Ron Maupin
    Jun 14, 2020 at 16:02
2

How do routers. switches, bridges and hubs deal with corrupted data?

Frames and packets failing the integrity test (by FCS or header checksum) are dropped.

By data corruption I mean frame/packet corruption, we can stick to the corruption due to a collision for simplicity.

A collision fragment is not considered a corrupt frame, it is always dropped. Since the FCS is at the end of a frame it hasn't been transmitted on collided frames yet. (Assuming the network is working normally and there are no late collisions.)

Collisions are detected on the physical layer and retransmission is scheduled immediately. A frame is only deleted from the sender's buffer when it has been transmitted in entirety.

Of course, repeaters, half-duplex transmission and CSMA/CD are all but obsolete today.

I know that switches can detect frame corruption if they are not set to cut-through forwarding.

Cut-through switches also detect FCS failure but have already finished forwarding when they do. Most often, a FCS failure rate above a certain level switches the forwarding to store-and-forward to avoid forwarding corrupt frames.

But are they always doing it ? And how does a switch detect a corruption?

They do it all the time by recalculating the FCS and comparing it to the frame's one.

I have read that similar mechanisms (cut-through and store-and-forward) can be found in routers.

Most routers use store-and-forward but that doesn't really matter.

So do routers detect packet corruption in the same way as switches do ?

For IPv4, routers check the header checksum (and recalculate it when forwarding). IPv6 headers carry no checksum, so v6 packets cannot be checked. Neither checks the integrity of user data (L4+).

Of course, routers also check the FCS for received frames or any other checksum providing by the link layer in use - other protocols than Ethernet do exist.

Finally hubs. Can they detect any data corruption or are they always forwarding data without any checks ?

Hubs have no concept for anything but channel bits or symbols. They cannot check for corruption nor do they need to. Since forwarding is done immediately, bit for bit, the receiving node will check the frame's integrity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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