This is the second day of my participation in the November Gwen Challenge. Check out the details: the last Gwen Challenge 2021

Preface:

  • (1) This part of the online summary feels less, or it is not very easy to find.
  • (2) Then my mind suddenly went blank during the inspection. Don’t know what is what, finally let other students speak, really embarrassed dead.
  • (3) Then make up your mind to summarize this. It may not be accurate, but it’s enough to get started.
  • (4) If you have any questions, please point them out. If you think it will help you, please give me a thumbs up and support. I will continue to work hard.

The body of the

Similarities and differences between unknown frames and broadcast frames

  • Unknown frame:
    • First, the forwarding table of the Switch does not contain the destination Mac address of the frame
    • DEST ADDR is not all F(hexadecimal number)
  • Broadcast frame: We call the frame whose target address is all F a broadcast frame, and the corresponding binary number is all 1
  • Note: One hexadecimal number corresponds to four binary digits
  • An ARP packet is a broadcast frame
  • ARP (Address Resolution Protocol)
  • Baidu Encyclopedia explanation:

Own understanding of ARP

  • This might be a little hard to understand, but let me explain:

  • For example, if we want to send a packet to a host, we must know the IP address of the source and destination IP address. ARP is used to find and return the Mac address of the destination IP address before sending the desired packet.

  • Q: So why look for a Mac address, isn’t the IP enough? (Knocks on the blackboard)

  • A: We often say that if we know an IP address, we know it, but in fact, we know the Mac address. The translation process is operated by THE ARP protocol. Therefore, if we do not have a thorough understanding of the IP, we think that we know the location of the device.

  • When the network is powered up and we want to send packets, the first thing we send is ARP packets, which is to learn the address, for example, fromHost PC3 -> Host PC4 sends an ICMP packetIn the figure, we can see that THE ARP packet is sent before the customized ICMP packet. From the figure, we can know that ARP is a broadcast frame.

Detailed process of sending packets

We’re going to single step, which means we’re going to go one step at a time

  • 1.ARP packets are sent first

  • 2.ARP packets arrive at the Hub

    Hub features: brief overview: is no matter what frame, as long as you come to all I broadcast, if still do not understand, you can put him into a radio station, no matter what he will broadcast, because he is a radio station! The effect is as follows:

  • 3. When the frame reaches the Switch, the Switch learns the source address of the frame and forwards the frame.

  • The Switch broadcasts the frame because it is a broadcast frame.

    The Switch has the following features: Discarding same-network frames, forwarding different network frames, broadcasting broadcast frames, and broadcasting unknown frames

  • Note:

    • 1. What is an unknown frame again (because it is important)?

    • Unknown frames have two conditions:

    • First, the forwarding table of the Switch does not contain the destination Mac address of the frame

    • DEST ADDR is not all F(hexadecimal number)

    • 2. In this case, the source port of a packet is the same as the destination port (the port in this case is on the switch). If they are the same, the packet is considered to be on the same network and discarded.

    • View the forwarding table:

    • Overall display:

  • Q: Look closely at the image above. What do you see?

  • A: You will notice that the packages on the left side of the console have an (X) cross on them. Why is that? Is the package wrong?

  • It’s not.

  • This is the work of ARP: when an IP address is not the one I want, I discard the packet (in other words, it is not the one I want, so I just throw it away). If the match is successful, the device returns an ARP packet and writes its Mac address to the returned packet.

  • The diagram below:

  • 4. The Hub broadcasts packets sent from PC4.

    • When the packet arrives at the Switch, the Switch learns the source address and forwards the frame, since they can be considered to be connected to the same port (on the Switch), according to the characteristics of the Switch, the same network frame will be discarded:

    • View the forwarding table (which is indeed on the same port) :

    • At the same time, the packet is also sent to the ARP packet pc3 host, so far, the host PC3 will know the host PC4 Mac address, that is, know where he is, now you can send packets normally!

      Overall display:

  • 5. Send ICMP packets

  • 6. The Hub broadcasts this frame.

    Directly above:

  • 7. Send response after receiving:

    Directly above:

  • Completed 8.

Above the summary of the content of the package

  • Conclusion: What is explained above?

  • For switches we demonstrated: learning source addresses, discarding peer frames, broadcasting broadcast frames (ARP is our example)

  • For Hub: we understand the working process of Hub, no matter who it is, it needs to broadcast. (No matter whether he is god or demon, he should be treated equally and equally. Hahaha here says this sentence to help you understand better.)

  • Next, we will learn to forward foreign network frames and broadcast unknown frames

    Note: Both of these are for Switch, and that’s all for Hub.

Then explain, persistence is victory, come on!!

  • 1. Forwarding different network frames

    • 1. We are fromHost PC3 -> host PC5Send a packet, according to the above, to send firstARP packet, knowMac address of the destination hostHow much is.

    • 2. Host PC5 returns an ARP packet containing its Mac address. When the packet reaches the Switch (type on the blackboard), the Switch learns the source address and forwards the packet.

    • As shown below:

    • The packet goes to the switch (learning source address):

    • Overall display:

  • 3. If you know the Mac address of the destination host, you can send the packet.

  • 2. Broadcast unknown frames

Unknown frames (repeat) :

  • The destination Mac address of the frame does not exist in the forwarding table of the Switch

  • And the destination address (DEST ADDR) is not all F.

  • 1. Host PC3 -> host PC4 sends packets

    • As we already know, the host PC3 -> PC4 host can normally send packets

    • In addition, host PC3 and host PC4 have been recorded in the forwarding table

    • The diagram below:

    • Now if we clear the forwarding table, there are two cases

    • The first is to restart the forwarding table directly. But this is not recommended. So I will not tell the specific! If you want to learn how to do it. Leave a comment below

    • The second is command-line operations

    • Below, if you have any questions, please leave a comment below.

    • Post status: Nothing now

  • 1. Now let host PC3 -> host PC4 send packet, we send an ICMP packet

  • 2. Switch and HOST PC4 are displayed

  • 3. Host PC4 returns a response, the Switch will broadcast the frame, the frame is unknown, not in the forwarding table, and the destination address is not all F (hexadecimal, meet the condition of unknown frame).

    The frame information is as follows:

    Overall display:

  • 4. Discard the unnecessary packets and return the required packets

conclusion

  • Here, demo finished, if you help, welcome to like support
  • This thing will take all day to make.
  • Your support is what keeps me going.
  • Note: if there is wrong place, welcome to leave a message, we make progress together, thank you!