[Java network programming 01] 2021.11.10

Basic part of network:

The IP layer does not provide reliable network forwarding, that is, the network system is unreliable. The reliability is controlled by the host transport layer connected to the network

  1. TCP/IP system:

    Application Layer (SMTP, POP3)

    Transport Layer (TCP, UDP) / / Transmission control protocol, User Datagram protocol

    IP internet layer Network Layer (IP) //Internet Protocol / / where the IP layer is a virtual network, which is a network composed of multiple routers

    Data link LayerData link layer

  2. Layer of equipment:

    Transport layer and above: gateway

    IP internet layer: router

    Data link layer: bridge

    Physical layer: repeater

  3. IP address

    Ipv4:  32 Bits, four bytes ::={network number}{Host number}
    A Class: 8-digit network number: 24 digit host number, the first digit of network number is 0
    B Class: 16 bit network number, 16 bit host number, one or two digits of network number, 10
    C Class: 24 digit network number, 8-digit host number, the first three digits of network number: 110

    In the network number of the IP address, all 0 indicates the local network, all 1 indicates the local address loopback test local:

    In the host number, all 0 indicates the single network address connected to (the host is in; the network address bit is All 1 indicates all hosts under the network

    Class A, all host numbers 0 and 1 are reserved

    Class B, all zeros after host number 10 are reserved

    Class C, all zeros after host number 110 are reserved

    Network number range:
    A Class: 0 0000001~0 1111110, 1~126, //127 reserved for local loopback test
    B Class: 10 000000:00000001~10 111111:11111111, 128.1 ~191.255
    C Class: 1.1 million:00000000:00000001~110 11111:11111111:11111111 //192.0.1~ 223.255.255

    A router must be connected to two networks. Therefore, two network numbers and two local area network routers are connected. The connection between the routers constitutes a special network, that is, a network containing only one connection (but with IP address). Generally, in order to save IP resources, no IP address is assigned to this network, that is, no numbered network / anonymous network / unnumbered network

  4. Subnet Division

    The IP address is divided into three levels, and the external is still two levels: = {network number} {subnet number} {host number}

    subnet mask: all parts of the network address (including network number and subnet number) are 1, and all host numbers are 0

    eg: If 8 is divided into subnets, the subnet mask is: / / because it is a class B address, the subnet number has 8 bits.

    Method for obtaining an IP address network number: the IP address and operator netmask can be obtained (whether there is subnet division or not)

    If a network is not divided into subnets, the default subnet mask is exactly the network number, then the default subnet mask of class A is, and the default subnet mask of class B is

    Subnet division quantity of subnet number:

    eg: the subnet mask of a class B network is (192:1100 0000)

    Then the number of subnets under this class B address is 255.255.0100 0000 and 255.255.1000 0000, of which all 0 and all 1 cannot be divided into subnets

  5. CIDR no classification code (construct hypernetwork)

    The IP address changes to two levels,: = {network prefix > < host number >}

    Recording method: slash notation, and finally write down the number of network prefixes That is, the first 20 are network prefixes and the last 12 are host numbers
  6. IPV6

    • Address division

      3 class
       Unicast address( Unicast): Delivered to only one computer
       Multicast address( multicast): Deliver to a group of computers
       Anycast address( anycast): Delivered to one of a group of computers, usually the nearest one
    • Address representation

      Colon hexadecimal notation (16 8 bytes,-->, 8 16 bytes, representing 8 4-digit hexadecimal
      1. Zero compression policy: a series of zeros can be represented by a pair of colons, but the zero compression policy can only be used once in an address
      FF05:0:0:0:0:0:0:B3,Can be compressed to: FF05::B3
      1. Suffixes that can be used in conjunction with dotted decimal notation

        0:0:0:0:0:0: # There are 6 hexadecimal zeros in front, followed by 4 bytes of hexadecimal addresses, a total of 16 bytes
         It can also be expressed as ::
  7. TCP three handshakes / four waves (connection establishment and connection release)

    Three handshakes:

    A --> SYN = 1, seq = x						B
    A <-- SYN = 1, ACK = 1, seq = y, ack = x +1	  B
    A --> ACK = 1, seq = x+1, ack = y+1			 B

    Four waves:

    A --> FIN = 1, seq = u						B
    A <-- ACK = 1, seq = v, ack = u +1			 B
    A <-- FIN = 1, ACK = 1, seq = w, ack = u+1	  B
    A --> ACK = 1, seq = u+1, ack = w + 1		 B

Posted by amylisa on Wed, 10 Nov 2021 18:16:23 -0800