Data communication and network notes-CSMA/CD and CSMA/CA

Source: Internet
Author: User

Data communication and network notes-CSMA/CD and CSMA/ca csma/CD Working Principles CSMA/CD (Carrier Sense Multiple Access/Collision Detect) that is, the multi-channel access/conflict detection mechanism of the carrier listener, which works in the shared Ethernet and is applied to the Layer 2 data link layer of OSI. Its working principle is: Listen to whether the channel is idle before sending data. If it is idle, send data immediately. If the channel is busy, send data after a period of time to the end of the information transmission in the channel. If two or more nodes send requests after the last message transmission is complete, it is determined as a conflict. If a conflict occurs, stop sending data immediately. Wait for a random period of time and try again. Describe the first conflict. The two sides of the conflict are site A and Site C. At the moment t1, Site A starts to send frames and transmits frames from left to right. At the moment t2, Site C does not listen to the first position sent by site A, and site C starts to send frames, transmission to both sides. At A time point after time t2, the conflict occurred. At time t3, Site C received the first position of Site A, and he detected the conflict, he gave up the transmission. At Moment 4, Site A received the first position of Site C, and he gave up the transmission. They all waited for a random time and tried again. The minimum frame length must be limited to CSMA/CD. Before the last frame, the sending site must detect the conflict. If there is any conflict, the transmission should be abandoned. This is because once the entire frame is sent, the site cannot retain the copy of the frame and cannot control the line conflict detection. Therefore, the frame transmission time is at least twice the maximum transmission time, that is, twice the transmission time from A to D. In Ethernet, the minimum frame length is 64 bytes. The maximum frame length because the channel is shared by all hosts, if the data frame is too long, some hosts cannot send data for a long time, and some send data may exceed the buffer size of the acceptor, this causes buffer overflow. To prevent a single host from occupying too long a channel, the maximum frame length of an Ethernet frame is 1518 bytes. CSMA/CA working principle CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) that is, the multi-channel Access/conflict Avoidance mechanism of the Carrier listener, generally working in the wireless network. · The workflow can be divided into two parts: 1. before sending data, listen to the media status and wait for no one to use the media for a period of time before sending the data. Because the random time used by each device is different, the chance of conflict can be reduced. 2. Before sending data, Send a small Request to Send a packet (RTS: Request to Send) to the target end, and wait until the target end responds to the CTS: Clear to Send packet. Use the RTS-CTS handshake program to ensure that the next data transfer will not be collided. At the same time, because RTS-CTS packets are small, the invalid overhead of the transfer is reduced. CSMA/CA provides wireless shared access through these two methods. This explicit ACK mechanism is very effective in dealing with wireless problems. However, for both 802.11 and 802.3, this method adds extra burden, so the 802.11 Network and similar Ethernet network are always inferior in performance. Why does a wireless network generally use CSMA, CACSMA, or CD? The basic idea is that a website must be able to receive signals when detecting a conflict during transmission. When there is no conflict, the site receives a signal: its own signal. When a conflict occurs, the site receives two types of signals: its own signal and the signal transmitted by the second site. In order to distinguish between the above two situations, the signals received in different situations should be significantly different. In other words, signals from the second site need to increase a lot of energy for the signals generated by the first site. In a wired network, the energy for receiving signals is basically the same as that for sending signals. That is to say, in a conflict, the detected energy almost doubles. However, in a wireless network, a large amount of sent signal energy is lost during transmission. The power of receiving signals is also small. Therefore, a conflict may increase by only 5% ~ 10% of the extra energy, which does not play a role in effective conflict detection. Therefore, we should try to avoid conflicts in wireless networks.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.