In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the way to achieve one-to-one communication in the local area network. I hope you will gain a lot after reading this article. Let's discuss it together.
We know that the local area network uses the broadcast channel for transmission, and the broadcast channel can achieve one-to-many communication. But in reality, one-to-many communication is not always necessary, so how to carry out one-to-one communication between two hosts? The problem is not that simple, and we need to consider many aspects:
How the host transmits the generated information to the channel
If multiple hosts share the channel, how to control the collision between information?
How to send a message to a specific host
The function of network adapter (network card)
The network adapter is what we usually call the network card. When the host communicates with the external LAN, it adapts through the network card. Because the host and the network card are transmitted in parallel, and the network card and the local area network home are transmitted through serial, so the network card needs to adapt between the two.
In the ROM (read-only memory) of the network card, write the hardware address of the computer, that is, the MAC address. This MAC address is very important and is the key to achieving one-to-one communication. We'll talk about it later.
CSMA/CD protocol
Because the local area network uses a shared channel, since it is a shared channel, we have to control the problem of sending first and later of the host. Because if multiple hosts send messages at the same time, there will be confusion. There is a famous LAN protocol CSMA/CD (Carrier sense multiple access / collision Detection), which solves this problem.
The agreement is very easy to understand, and let's use an example to illustrate that in a meeting venue, some people attended the meeting. There is no moderator at the meeting and everyone is free to speak. However, it is only when other people have finished speaking that the meeting is quiet before they can speak. If more than one person is speaking at the same time, those who speak at the same time have to finish their speech, and then after waiting for a random time, if the meeting is quiet, they can speak again. Why this is a random time, it is easy to understand that if it is a fixed time, the speaker will still speak at the same time after a period of time.
One-to-one communication through MAC address
After solving the above problems, let's take a look at how hosts communicate one-to-one. As mentioned above, there is a MAC address on the network card, and the following is an MAC address
A0-A4-C2-4B-9F-56
It is composed of 48 bits (6 bytes), and the MAC address of each network card is unique in the world. Since it is unique, it can be used for one-to-one communication between hosts.
The basic unit of communication in a local area network is data frames. When host An in the local area network wants to communicate with another host B in the same local area network, the destination address (MAC address of B) should be written at the beginning of the data frame sent by A, and then the data frame will be broadcast to all hosts in the local area network. When the network cards of other hosts accept the data frame, check whether the destination address is the same as their own MAC address, and discard it if it is inconsistent. In this way, the local area network with broadcast characteristics can achieve one-to-one communication.
After reading this article, I believe you have a certain understanding of the method of realizing one-to-one communication in the local area network. I would like to know more about it. Welcome to follow the industry information channel. Thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.