Switches using CSMA/CD

daan5000daan5000 Member Posts: 34 ■■■□□□□□□□
Hi there

While studying for my CCNA cert, I came up with a question to which I think I know the answer, but I just want to be absolutely sure.

In case a switch is connected to a hub, it will automatically go into half-duplex mode on the interface the hub is connected to. This means it will have to use CSMA/CD.

Now, if a hub receives a frame on one of its ports that is destined for one of the hosts in the hub network, it will buffer the frame until the medium is idle. Now, will the switch:

a) Keep the frame buffered after forwarding it in case the frame ends up in a collision anyway?
b) just remove the frame from its buffer the moment it forwards the frame and rely on the sending host to retransmit the frame? (in that case, dunno how the sending host knows its frame ended up in a collision in another network segment).

Answer a looks the most logical to me, but then again, won't this cause the buffer to overflow?

Thanks in advance

Comments

  • TWXTWX Member Posts: 275 ■■■□□□□□□□
    If I remember right the hub buffers nothing. It retransmits what it receives on one interface to all interfaces. The hub is essentially a fancy wire, like the old thin-net, but allows for better distances and speed.

    If anyone is talking on the hub, no one else can talk on the hub.
  • theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    I believe it would be up to the protocol(s). TCP is reliable/connection-oriented, so it will resend data that is not ACKed by the recipient. EIGRP uses Reliable Transport Protocol which requires which also uses ACKs to confirm delivery of certain types of message (Updates, Queries, SIA-Queries, and SIA-Replies). UDP is connectionless/unreliable, but some of the Application Layer Protocols that use it have their own methods of determining if data arrived or not and resending lost data.

    There are also times when resending lost data may not be the best option. For example, a certain amount of packet loss is tolerable with Voice and Video, while the additional overhead, delay, and jitter resulting from reliable delivery are undesirable.
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
  • OctalDumpOctalDump Member Posts: 1,722
    It's a good question, and I can't answer it. But to correct what the other posts have said, the NIC will handle retransmission in a Collision Detected event. TCP retransmission only happens if the maximum retries is exceeded, or if it is a "late collision", after the first 512 octets, which CSMA/CD cannot handle.
    That is to say that the retransmission is handled at layer 2 under CSMA/CD.

    I have actually an answer now:
    https://learningnetwork.cisco.com/message/281319#281319

    It appears that the switch DOES retransmit the frame, since it knows about CSMA/CD. Not sure if that is sufficient answer.

    In the case of B (where a switch doesn't properly handle CSMA/CD or late collisions), the upper layer protocols will need to handle retransmission, so TCP can do that, or if using UDP it will happen in the application or maybe not care (like VoIP).
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • james43026james43026 Member Posts: 303 ■■□□□□□□□□
    daan5000 wrote: »
    Hi there

    While studying for my CCNA cert, I came up with a question to which I think I know the answer, but I just want to be absolutely sure.

    In case a switch is connected to a hub, it will automatically go into half-duplex mode on the interface the hub is connected to. This means it will have to use CSMA/CD.

    Now, if a hub receives a frame on one of its ports that is destined for one of the hosts in the hub network, it will buffer the frame until the medium is idle. Now, will the switch:

    a) Keep the frame buffered after forwarding it in case the frame ends up in a collision anyway?
    b) just remove the frame from its buffer the moment it forwards the frame and rely on the sending host to retransmit the frame? (in that case, dunno how the sending host knows its frame ended up in a collision in another network segment).

    Answer a looks the most logical to me, but then again, won't this cause the buffer to overflow?

    Thanks in advance

    1.) What determines the duplex and speed of a link is auto-negotiation, and the max speed of the link, as such 100 Mb/s defaults to half-duplex if no negotiation takes place, and 1000 Mb/s defaults to full-duplex.

    2.) CSMA/CD would be used for half-duplex

    3.) a hub doesn't understand what a destination is in the same sense as a switch, a hub will literally duplicate and broadcast all traffic received to all connected ports no matter what you do.

    4.)No a switch doesn't keep frames buffered once they are transmitted, retransmission is something the sending device would need to do, B is correct. A host wouldn't know that a collision happened on another network segment, retransmission of data would rely on either a protocol being used such as TCP, or in some cases applications have built in mechanisms to deal with lost packets.

    I think you would do well to read about the two approaches Cisco takes to layer 2 forwarding decisions, being cut-through switching, and store-and-forward switching. These are two technologies that greatly influence how long a packets stays in a buffer before being transmitted to a queue.
  • daan5000daan5000 Member Posts: 34 ■■■□□□□□□□
    OctalDump wrote: »
    It's a good question, and I can't answer it. But to correct what the other posts have said, the NIC will handle retransmission in a Collision Detected event. TCP retransmission only happens if the maximum retries is exceeded, or if it is a "late collision", after the first 512 octets, which CSMA/CD cannot handle.
    That is to say that the retransmission is handled at layer 2 under CSMA/CD.

    I have actually an answer now:
    https://learningnetwork.cisco.com/message/281319#281319

    It appears that the switch DOES retransmit the frame, since it knows about CSMA/CD. Not sure if that is sufficient answer.

    In the case of B (where a switch doesn't properly handle CSMA/CD or late collisions), the upper layer protocols will need to handle retransmission, so TCP can do that, or if using UDP it will happen in the application or maybe not care (like VoIP).

    This was the answer I was looking for. Thanks very much.
Sign In or Register to comment.