cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
14418
Views
0
Helpful
10
Replies

about CSMA/CD

yuanguitao
Level 1
Level 1

Hi, everyone. Now i was confused by the CSMA/CD. as we all know this protocol work in the layer 2. and this protocol promise only one connection can trasmit or receive data online at one moment. if so QQ截图20130910170600.png,Can PC-A communicate with other clinets int the fig above.what if i exchange the hub for a switch?

The other question is that my network adapter has deployed to 100 full deplux now witch connects a switch directly, and i don't know if CSMA/CD is working now ? because CSMA/CD only allow half-deplux.  I am waiting for your answers. thank you !

1 Accepted Solution

Accepted Solutions

azmunnabi
Level 1
Level 1

Hi WEI,

Here is some light on Half/Full Duplex and CSMA/CD.

Half Duplex and CSMA/CD:

1. Hub and Co axial cable operate in half duplex mode. (Communication is possible in one direction at an instant.)

2. CSMA/CD is an access method used in half duplex communication.

CSMA/CD: As in half duplex - only one direction communication is possible at a time. There exists chance of collision when two ends of the physical medium tries to use the medium at the same time.

In case of collision JAM is invoked, send to all stations, back off timer starts and frame is resend.

[Refer CSMS/CD operation]

3. Thus in half duplex (CSMA/CD is operating); bandwidth is shared.

The communication between two ends may be slow because of collision and retransmission, but it doesn't mean that the communication will not happen as retransmission is always there. ( although the number of retransmission may be limited). Yes because of shared bandwidth the communication is slow.

[So In your topology Host A can communicate to any other PC. Any two device can communicate]

Full Duplex:

1. Switch and Copper twisted pair operate in full duplex. ( Communication is possible in both direction at the same time.)

2. No use of CSMA/CD in Full Duplex. CSMA/CD is operative when device is operating in half duplex.

As communication is possible in both direction in full duplex mode, there is no chance of collision and no mechanism is required to detect the same.

HUB and Switch:

Hub: Hub always operate in half duplex mode. CSMA/CD is operative.

- Hub brings in all the connected devices to creates one segment and all the devices are then in one collision domain.

Switch: Switch operates in full duplex mode by default. No CSMA/CD operates.

- Switch separates the network segment. Each port of switch creates the segment and is one collision domain.

When Hubs is connected to Switch; the link is supposed to work as half duplex. (As hub operates in half duplex mode)

So the switch port connected to hub is configured to operate in half duplex mode only.

Thus CSMA/CD will now operate and it is collision prone segment.

* microsegmentation: Referred by Cadet and Joseph seems to me is significant in Switches.

          But can't say much on this term. If someone can add on this, it will be of help.

Hope all the above points help.

Please correct if I am wrong at some or if some need modifications.

Thanks

View solution in original post

10 Replies 10

cadet alain
VIP Alumni
VIP Alumni

Hi,

a switch lets you do full-duplex by microsegmentation as each port is now its own collision domain and in full duplex CSMA-CD is disabled as it has no more use now.

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The   Author of this posting offers the information contained within this   posting without consideration and with the reader's understanding that   there's no implied or expressed suitability or fitness for any purpose.   Information provided is for informational purposes only and should not   be construed as rendering professional advice of any kind. Usage of  this  posting's information is solely at reader's own risk.

Liability Disclaimer

In   no event shall Author be liable for any damages whatsoever (including,   without limitation, damages for loss of use, data or profit) arising  out  of the use or inability to use the posting's information even if  Author  has been advised of the possibility of such damage.

Posting

Can PC-A communicate with other clinets int the fig above.what if i exchange the hub for a switch?

Sure, and if you exchange the hub with a switch PC-A can still communicate with the other clients.  Whether a hub or switch, your 3 clients are all in the same L2 domain.  One advantage of a switch, unicast traffic between any two hosts is usually not seen by any other hosts, preserving bandwidth.  If you had 4 hosts, hosts A and B could communicate "privately" while hosts C and D did too.  With a hub, all 4 hosts would share the same bandwidth.  (NB: this is the [switch] microsegmentation that Alain refers to.)

The other question is that my network adapter has deployed to 100 full deplux now witch connects a switch directly, and i don't know if CSMA/CD is working now ? 

When full duplex is activated, CSMA/CD is not longer working as it's no longer needed.  Full duplex requires the connection to be physically p2p between a pair of devices.  CSMA/CD is designed to share the same "wire" with multiple hosts.

Hubs cannot do full duplex, switches may optionally support it.

azmunnabi
Level 1
Level 1

Hi WEI,

Here is some light on Half/Full Duplex and CSMA/CD.

Half Duplex and CSMA/CD:

1. Hub and Co axial cable operate in half duplex mode. (Communication is possible in one direction at an instant.)

2. CSMA/CD is an access method used in half duplex communication.

CSMA/CD: As in half duplex - only one direction communication is possible at a time. There exists chance of collision when two ends of the physical medium tries to use the medium at the same time.

In case of collision JAM is invoked, send to all stations, back off timer starts and frame is resend.

[Refer CSMS/CD operation]

3. Thus in half duplex (CSMA/CD is operating); bandwidth is shared.

The communication between two ends may be slow because of collision and retransmission, but it doesn't mean that the communication will not happen as retransmission is always there. ( although the number of retransmission may be limited). Yes because of shared bandwidth the communication is slow.

[So In your topology Host A can communicate to any other PC. Any two device can communicate]

Full Duplex:

1. Switch and Copper twisted pair operate in full duplex. ( Communication is possible in both direction at the same time.)

2. No use of CSMA/CD in Full Duplex. CSMA/CD is operative when device is operating in half duplex.

As communication is possible in both direction in full duplex mode, there is no chance of collision and no mechanism is required to detect the same.

HUB and Switch:

Hub: Hub always operate in half duplex mode. CSMA/CD is operative.

- Hub brings in all the connected devices to creates one segment and all the devices are then in one collision domain.

Switch: Switch operates in full duplex mode by default. No CSMA/CD operates.

- Switch separates the network segment. Each port of switch creates the segment and is one collision domain.

When Hubs is connected to Switch; the link is supposed to work as half duplex. (As hub operates in half duplex mode)

So the switch port connected to hub is configured to operate in half duplex mode only.

Thus CSMA/CD will now operate and it is collision prone segment.

* microsegmentation: Referred by Cadet and Joseph seems to me is significant in Switches.

          But can't say much on this term. If someone can add on this, it will be of help.

Hope all the above points help.

Please correct if I am wrong at some or if some need modifications.

Thanks

Disclaimer

The   Author of this posting offers the information contained within this   posting without consideration and with the reader's understanding that   there's no implied or expressed suitability or fitness for any purpose.   Information provided is for informational purposes only and should not   be construed as rendering professional advice of any kind. Usage of  this  posting's information is solely at reader's own risk.

Liability Disclaimer

In   no event shall Author be liable for any damages whatsoever (including,   without limitation, damages for loss of use, data or profit) arising  out  of the use or inability to use the posting's information even if  Author  has been advised of the possibility of such damage.

Posting

Switch: Switch operates in full duplex mode by default. No CSMA/CD operates.

For backward compatibility, switch ports normally default to half duplex.  If they and the connected device support auto-negotiation, they will generally negotiate full-duplex.  Otherwise, you normally have to "hard code" the port for full duplex operation.

* microsegmentation: Referred by Cadet and Joseph seems to me is significant in Switches. 

          But can't say much on this term. If someone can add on this, it will be of help.

Before there were switches, one way to improve LAN performance was to segment the existing LAN so not as many hosts were in the same broadcast domain; sharing the same bandwidth.  This might be accomplished by using a bridge (a modern switch is also known as a multi-port bridge).

Microsegmentation is placing a single host on its own LAN segment.

thanks for your terrific answer. well, if pc or other clients connect to a switch, they will be set to full duplex auto, because the switch can provide a single interface for each client just like providing a individual path. so it won't come up with collison between them, then CSMA/CD will be out of use. am i right?

but what if two switches(access layer) connected and deployed trunk? How to avoid collison? will csma/cd work?

The last question, if the cable between a switch and a client(may be pc, AP, and so on) cannot work normallly. for example, the distribution frames is not so stable, the client would be up or down randomly. if that can cause collsion?

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

if pc or other clients connect to a switch, they will be set to full duplex auto, because the switch can provide a single interface for each client just like providing a individual path. so it won't come up with collison between them, then CSMA/CD will be out of use. am i right?

Yes.

but what if two switches(access layer) connected and deployed trunk? How to avoid collison? will csma/cd work?

Two switches can do either half duplex for full duplex, the latter avoids collisions although the latter might overflow a queue dropping frames/packets.  Normally, if supported, full duplex is preferred because it both avoid collisions and allows two way concurrent transmission (effectively doubling the available bandwidth).

The last question, if the cable between a switch and a client(may be pc, AP, and so on) cannot work normallly. for example, the distribution frames is not so stable, the client would be up or down randomly. if that can cause collsion?

No, because when operating in CSMA/CD mode, rules are to listen first before attempting to transmit.  This would apply whether host has been on-line for some time or just activated the link.  A collision is when, after listening, wire appears available, multiple hosts begin transmitting at about the same time.  The hosts should detect the collision, stop transmitting, and then each host waits a "random" amount of time before trying again.  (The independent random wait is to try to avoid a cycle of hosts waiting the same amount of time, again seeing the wire isn't being used, and again transmitting at about the same time.)

Karan Puri
Level 1
Level 1

Make u short ans..

When u set half duplex in an interface; device keep on monitoring tx line...

Now which algorithm monitor this, ans is csma/cd..

u can do some lab test the csma/cd... set one side full duplex and other end half.. n check sh int f0/0 ! in coll!err!tx.. u will find collision...

Thanks Joseph and Karan for correcting.

Switch operates in full duplex mode by default. No CSMA/CD operates.

It was wrongly written.

Thanks to clarify that Switch defaults to Half duplex for backward compatiblity.

@Joseph:

As you have written:

 If they and the connected device support auto-negotiation, they will generally negotiate full-duplex.  Otherwise, you normally have to "hard code" the port for full duplex operation.

Can you please put some example where hard coding needs to be done and auto negotiate fails.

How can we know in auto scenario that auto negotiation is failed, and the port needs to be hard coded?

    

What I make of Switch and connecting device is:

A Switch operates by itself weather the connecting device is hub, switch, host or router.

Full Duplex ethernet (free of CSMA/CD) is used when, connection is between Switch, Host or Routers.

Whenever, Hub is invloved, half duplex (CSMA/CD operative) is used.

Auto-Detect Mechanism:

It first decide the exchange capabilities and then see if the device can run full duplex and if it can't it will run half duplex.

Disclaimer

The  Author of this posting offers the information contained within this  posting without consideration and with the reader's understanding that  there's no implied or expressed suitability or fitness for any purpose.  Information provided is for informational purposes only and should not  be construed as rendering professional advice of any kind. Usage of this  posting's information is solely at reader's own risk.

Liability Disclaimer


In  no event shall Author be liable for any damages whatsoever (including,  without limitation, damages for loss of use, data or profit) arising out  of the use or inability to use the posting's information even if Author  has been advised of the possibility of such damage.

Posting

@Joseph:

As you have written:

If they and the connected device support auto-negotiation, they will generally negotiate full-duplex.  Otherwise, you normally have to "hard code" the port for full duplex operation.

Can you please put some example where hard coding needs to be done and auto negotiate fails.

How can we know in auto scenario that auto negotiation is failed, and the port needs to be hard coded?

How you know it fails, if both sides of the link say they support auto, but they don't establish full duplex, it failed.  Then you can often manually set full duplex, which should be done on both sides.  (Note - early on, you would often see failure between different vendor NICs, but it's unusual for it to fail now a days on modern equipment.)

There's also the situation where one or both NICs support full duplex but they don't support auto.  Then you have to hard code it.  (Don't see much of this anymore either.)

yuanguitao
Level 1
Level 1

Great, thank you very much.

Review Cisco Networking products for a $25 gift card