【HCIA】Network foundation

1. Hub (HUB): a layer of equipment.

    1. Existence mechanism: CSMA/CD mechanism -carrier sense multiple access/conflict detection mechanism.
         "Polite data transmission" ---- Low transmission efficiency When
        a user in the conflict domain wants to send data, listen first, listen to whether there is data being transmitted on the egress link, and if there is no data transmission, start data; if If there is data transmission, then wait, wait for no data transmission before sending data. A more vivid example : each user in the conflict domain sits on a round table and chats. When one person is talking, everyone else can't make a sound. After this person has finished speaking, other people can talk. For example, when A finishes speaking, B and C both detect and prepare to speak at the same time, there will be a conflict. At this time, there will be an avoidance algorithm that gives B and C a random number of seconds. For example, B waits for 3s, C waits for 5s, after 3s B starts to speak, while C is still waiting. When C is about to speak, he finds that someone is talking and starts to wait...  2. Features       ①Cannot perform one-to-one data transmission (without ID)       ②Cannot transmit wirelessly, there is signal attenuation ③There is       a collision domain (when the nodes send data at the same time, the electric waves cancel each other, and all the interfaces on the HUB are in the same collision domain)       ④The data transmission delay is too large       ⑤Unsafe The problem of the HUB must be solved and the bridge was studied. Later Upgraded to a switch again.
       
   





       

 

2. Switch (bridge): Layer 2 equipment

 1. MAC address : also called physical address.
     ①Each network card has a globally unique MAC address.
     ② Representation: 48 binary digits, using hexadecimal representation.
         For example: 00-E0-4C-68-01-62
    first 24 binary bits : distinguish different manufacturers . The first 24 digits assigned to each manufacturer by the international IANA organization are unique in the world. It can be assigned to 2^24 vendors at most.
    The last 24 binary bits : distinguish different network cards . Each manufacturer can make 224 network cards when they get a world-only first 24 digits. This means that each manufacturer can manufacture up to 224 network cards.
2. Working principle
      ① Self-learning : The switch will record the source MAC address in the data packet and combine it with the interface number of the data packet to generate a MAC address table .
The MAC address table information has an aging time . If a user has no traffic through the switch within 5 minutes, this piece of MAC address information will be deleted.
      ② Forwarding : Based on the target MAC address in the data packet, check the learned MAC address table for forwarding. If there are records in the table, directly forward one-to-one; if there are no records, copy the data packet n copies and then flood it.
         Copy: The switch restores the current to binary so it can be copied.
         Flooding : The data flow received by an interface is forwarded to all interfaces except this interface.
3. Features
      ①Can send and receive data one-to-one (unicast) (forwarding according to MAC address)
     ②Can transmit wirelessly (revert the radio wave to binary, and then convert the binary to electric wave to send)
      ③Isolate conflict domain. Each interface of the switch is a collision domain.
(Layer 2 devices can convert current into data for storage and forwarding)
  If multiple switches are connected, a large flooding area will cause network stalls.

 

3. OSI: Open System Interconnection (Seven-Layer Reference Model)

1. Levels : application layer, presentation layer, session layer, transport layer, network layer, data link layer, physical layer
(ISO: International Organization for Standardization)
2. Layered thinking:
control layer: upper three layers,
data layer: lower four Layer
     ① Application layer : Receive user data and provide a human-computer interaction interface.
          Application layer where - the human language (video, voice, image, etc.) Translation encoding (ASCII, GBK32, UTF-8, etc.)
     ② presentation layer : encoding as binary
     ③ session layer : a recording session to connect or disconnect the like . Establish (manage: maintain, terminate) a virtual connection for each type of data (traffic) transmitted.
     ④Transport layer: Provide port numbers to indicate different applications or services; define data transmission methods ( TCP/UDP ); distinguish traffic.
          (1) Port number : port ID, the value range is 1-65535. (1-1023 is called famous port or static port, 1024-65535 is called high port or dynamic port)
          (2) Common well-known ports : HTTP (Hypertext Transfer Protocol) -80 (TCP)
                                             HTTPS (Hypertext Secure Transfer Protocol) -443 (TCP)
                                             RIP (Routing Information Protocol) -520 (UDP)
                                             FTP (File Transfer Protocol)- 20/21 (TCP)
                                             SMTP (Simple Mail Transfer Protocol)-25 (TCP)
                                             DHCP (Dynamic Host Configuration Protocol)-67/68 (UDP)
                                             TELNET (Telnet Protocol)-23 (TCP)
                                             SSH (Secure Shell Protocol)-22 (TCP)
                                             DNS (Domain Name Resolution System)-53 (TCP&UDP)
           

          (3) TCP: Transmission Control Protocol.  "Connection-oriented reliable transport layer protocol"
             connection-oriented: three handshake, four disconnection Reliable: four reliable transmission mechanisms ( confirmation, retransmission , flow control-sliding window, sorting-numbering)
             

                Connection-oriented example: User A visits the web page of the server
 

                                 A Server: 80
                                    -----------Request to establish a connection (SYN=1)-------------->
     

("Three-way handshake") <----------------Agree to establish a connection--------------------                       
                                   ---- -----------------Confirm(ACK=1)---------------->
                                                                data...


                                   ----------------Request to disconnect (FIN=1)------------>
                                  <----------- -----Agree to disconnect ----------------------
("Disconnect four times") ----------- ------Request to disconnect (FIN=1)----------->                       
                                  <----------------Agree to disconnect-- --------------------

            (4) UDP: User data packet protocol. "Non-connection-oriented unreliable transmission protocol"
            (5) Segmented transmission of data: When large data is transmitted, the segmented transmission is performed according to the MTU value.
            (6) MTU : Maximum transmission unit. The default is 1500B, which can be modified but not recommended.
           

               Example: A data of 2000B can be divided into two packages of 1500B and 500B?
                     Not possible . Because the maximum transmission unit is 1500B, the data needs to be encapsulated layer by layer, and the header also occupies bytes, so the data part of a data packet must not exceed 1500B.


            (7) Commonly used free domain name resolution system server:
                                 114.114.114.114 (Jiangsu Nanjing Telecom)
                                 8.8.8.8 (Silicon Valley, USA) ⑤Network
     layer: addressing and addressing.
        IP: Network interconnection protocol. The two versions are IPv4 and IPv6. The router performs logical addressing based on the IPv4 address (32-bit binary). The
     data link layer:
controls the physical layer. The switch works at this layer
     ⑦Physical layer : defines the electrical, voltage, and current transfer methods. HUB works on this layer.

 

Four, TCP/IP protocol stack (layered structure of practical applications)

      1. Application layer
      2, transport layer
      3, network layer
      4, data link layer
      5, physical layer

   Encapsulation of data packets : When data is sent from one end to the other, data headers need to be added layer by layer according to the layered structure of the TCP/IP protocol stack.

    ARP : Address Resolution Protocol. Always request the other party's MAC address for the other party's IP address.

Guess you like

Origin blog.csdn.net/trichloromethane/article/details/107658312