Communication between computers

The communication between computers is as follows: After knowing the IP address of the other party, the computer sends ARP broadcast messages to obtain the Mac address (nic address) of the other party and sends data to the NIC.

When received by the nic:

  • If the nic discovers the target of the dataThe Mac addressIf it is itself, it will pass the data to the upper layer for processing
  • If the nic discovers the target of the dataThe Mac addressNot their own, will be discarded data, will not be handed over to the next layer to process

How computers link to each other:

  • Cable directly connected
  • Coaxial cable
  • A hub
  • The bridge
  • switches
  • The router

Cable directly connected

The direct network cable connection is very simple. After the two computers are directly connected through the network cable, as long as the IP addresses are on the same network segment, they can communicate

Process:

  1. The computer is 0 (1)All we know is the targetThe IP addressis192.168.1.11
  2. sendARPBroadcast, which contains the sourceThe IP addressAnd the sourceThe Mac address, the targetThe IP address, now the targetThe Mac addressforFFFF.FFFF.FFFF
  3. The computer is 0 (2)We have target on the radioThe IP addressIs their own, so reply to the broadcast message, which put their ownThe Mac addressadd
  4. The computer is 0 (1)receivedThe computer is 0 (2)theThe Mac address
  5. The two computers can begin to communicate

Coaxial cable

As is shown inCoaxial cableIs a relatively old way, it has the following characteristics and shortcomings:

  • Coaxial cableBelong toHalf duplex communicationThat is, only one message can be sent at a time, and if the first computer in the picture sends a message, the message will be sent forward until it is reachedThe end resistanceOr any other computer
  • Prone to conflict
  • Every time a message is sent, it is sent to every computer, so the message is not secure
  • ifCoaxial cableThe failure of one segment leads to the failure of the entire communication

A hub

A hubIs theCoaxial cableAfter an improved way, its characteristics are as follows:

  • alsoHalf duplex communication
  • Easy to conflict
  • A hubIt’s also a very mindless way to send messages to all connected devices

The bridge

You can see it in the picture aboveThe bridgeIt links twoA hub, its characteristics are as follows:

  • In contrast toA hubNo brain,The bridgeEach interface side is recordedThe Mac address, knowing that theThe Mac addressAfter that, the message is sent with identification, no longer likeA hubThat will be sent to all devices
  • Because each interface side will be recordedThe Mac addressTo isolate conflict domains

switches

A switch can be thought of as a combination of a hub and a bridge:

  • Equivalent to multi-interfaceThe bridge
  • implementationFull duplexcommunication
  • thanA hubA more secure
  • inLocal area network (LAN)In theswitchesCan be used as the final plan

The router

The routerThe process of receiving and sending information is different from the others aboveA computerandComputer BIn the same network segment, the default gateway must also be set as192.168.1.1And the sameComputer CandComputer DIn the same network segment, the default gateway must also be set as192.168.2.1And configureThe routerThe gateway address of the connection port, described in more detail nextA computerandComputer CThe communication process of

Process:

  • A computersendARPBroadcast acquisition andThe routerConnected to port 0The Mac address
  • A computerSend a message to the router through port 0Destination IPis192.168.2.11
  • Router port 1 sendsARPRadio accessComputer CtheThe Mac address
  • A computerandComputer CCommunicate through the router gateway

Cable direct connection, coaxial cable, hub, bridge, switch:

  • The connected devices must be the sameNetwork segment
  • The connected devices are in the same stateBroadcast domains

Router:

  • Data can be forwarded between different network segments
  • isolationBroadcast domains