• The MAC address

    • Basic concept

      The MAC address is also calledPhysical addressIs solidified in the NIC ROM, is the manufacturer in the production of nic when written into, a total of 6 bytes (each byte consists of two hexadecimal) is stipulated by the IEEE80 standard, The first three bits are distributed by IEEE and the second three bits are distributed by manufacturers (so manufacturers need to purchase the addresses of the first three bits from IEEE to produce network cards). When all 48 bits are 1, namely, ff-ff-ff-ff-ff, FF represents the broadcast address. Network communications require the MAC address of the network card. If the communicating party only knows the IP address of the other party, it sends an ARP broadcast to obtain the MAC address of the destination IP address and then completes the communication

    • Of the MAC

      The first three are unique identifiers of the organization (distributed by IEEE), and the last three are network interface identifiers (distributed by vendors), as shown below:

      Therefore, you can find that the first three MAC addresses of network adapters generated by the same manufacturer are the same

    • MAC address representation
      • Windows

        60-FF-0A-CA-22-88
      • Linux, Android, Mac, iOS 60:FF:0A:CA:22:88
      • Packet Tracer

        60FF.0ACA.2288
      • Broadcast address FF-FF-FF-FF-FF-FF
    • Example Query the local MAC address
      • Windows

        ipconfig /all
      • Mac

        Connect to wifi Hold down the Option key and click on wifi

    • Obtaining MAC Addresses

      As mentioned above, there must be a MAC address on the basis of communication. When the communication party does not know the MAC address, it can send ARP broadcast through the IP address to obtain the target MAC address (for cross-network segment, it first finds the gateway MAC address of the router). After obtaining the target MAC address, the IP address and MAC address mapping message will be cachedARP cache(The storage time is two minutes by default, and will be automatically deleted after expiration.)

  • The IP address

    • Basic concept

      An Internet protocol address is an IP address shared by every host on the Internet. Currently, THERE are two versions of IP addresses: IPv4 (32 bits, 4 bytes) and IPv6 (128 bits) 16 bytes), originally IPv4, but in nineteen nineteen the world ran out of IP addresses so IPv6 was introduced.

      It is usually divided into four “8-bit binary numbers” (that is, four bytes) as shown below

    • IP address composition
      • An IP address consists of two parts: network ID and host ID
      • The network ID and host ID can be obtained from the subnet mask
      • You can also use the subnet mask to enter the network segment where the host resides. Network segment = Subnet mask &IP address
    • IP Address Classification
      • Class A address

        The first eight bits are network ids, and0 at the beginningThe last 24 bits are the host ID, and the default subnet mask is 255.0.0.0

        As shown in the figure below

        Therefore, the value range of each part is as follows:
        • The first part, 0, cannot be used
        • 127 is the reserved network segment, and 127.0.0.1 is the loopback address representing the local address
        • All host IDS are 0, indicating the network segment where the host resides
        • Host ids with all 1s are unavailable, indicating broadcast addresses
      • A class B address

        The first 16 bits are the network ID, and10 the beginningThe last 16 bits are the host ID. The default subnet mask is 255.255.0.0

        As shown in the figure below

        Value range: The network ID is the same as the host ID, unlike the class A address
      • Class C address

        The first 24 bits are network ids, andThe beginning of 110The last eight bits are the host ID. The default subnet mask is 255.255.255.0

        As shown in the figure below

        Value range: The network ID is the same as the host ID, unlike the class A address
      • Class D addresses start with 1110, multicast addresses
      • Class E addresses start with 1111 and are reserved

      Note: Only type A\B\C addresses can be assigned to hosts. All 0 host ids cannot be used, indicating the network segment where the host resides. All 1 host ids cannot be used, indicating the broadcast address

    • CIDR representation of a subnet mask

      IP: 192.168.8.12 Subnet mask: 255.255.255.0 CIDR: 192.168.8.12/24 24 indicates that the subnet mask contains 24 1s, 1111 1111 1111 1111 1111 1111 0000 0000 is 255.255.255.0

    • subnetting
      • The cause of a subnet scoring change

        If we need 1000 hosts in the same network segment, then class C address is not enough (it can only accommodate 254 hosts), so we need to apply for a class B address at this time, but class B address can accommodate 65534 hosts altogether, so there are 64,534 idle IP addresses at this time, which causes a waste of resources. Therefore, it is necessary to rationally divide subnets to avoid the waste of resources

      • How do I divide subnets

        Use host bits to divide multiple subnets

        For example, if a Class C address needs to be equal-length, the subnet mask should be 255.255.255.0 and then 255.255.255.128. In this case, the highest bit of the host bit becomes the network ID, as shown in the following figureTherefore, two network segments of equal length are divided, namely 192.168.1.0 and 192.168.1.128, whose subnet masks are 255.255.255.128. CIDR means 192.168.1.0/25 and 192.168.1.128/25.

        As shown in the following figure, the two machines cannot communicate with each other when they are connected through a switch

      • Equal-length subnets

        Said the subnetting on concept, at the same time, for example, a division of this example is the isometric subnetting, the subnet mask is the same move backwards thought, which is from the original 24 to 25, such was long in addition to divided into two equal length subnet, the same can also be divided again a little bit small. If the first two bits of the host bit are network ids, the host bit will be divided into four subnets of equal length. As shown in the following figure, a Class C address is divided into four subnets of equal length

        • First subnet 192.168.1.1 to 192.168.1.62: The subnet mask must be moved to the left to ensure that the network parts remain the same.
        • The second subnet 192.168.1.65 to 192.168.1.126
        • The third subnet 192.168.1.129 to 192.168.1.190
        • The fourth subnet 192.168.1.193 to 192.168.1.254
      • Variable length subnets

        The difference between isometric subnets is that the subnet mask of the subnet is not the same, continue to take the above example

        First, the length is divided into two sections, and then the latter section is divided into two subnets, as shown in the figure below:

    • Super net

      Said to the division of the main is to divide a net segment into several smaller segments, super net is merging two segments, such as the need to 400 hosts on the same network segment, apply for a class C IP address is a waste, to apply for a class B address and too much, so this time can apply for two class C address then merged into a larger network segment.

      The operation of the hypernet is different from that of a subnet. The network ID of the subnet is moved backwards by one bit, while that of the hypernet is moved forwards by one bit. For example, the two network segments 192.168.0.0/24 and 192.168.1.0/24 are merged into one network segment, which becomes 192.168.0.0/23.

      Note that not all two network segments can be merged: only when the subnet mask is moved to the left, the network segment remains the same.