This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money. Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

Network overview and model

Computer network is the combination of computer technology and communication technology. It realizes remote communication, remote information processing and resource sharing.

Functions of computer network: data communication, resource sharing, load balancing, high reliability. The computer network is divided according to the distribution range and topological structure as shown in the figure below:

Bus (low utilization rate, large interference, low price), star (LAN formed by switch, heavy load of central unit), ring (fixed flow direction, low efficiency, difficult expansion), tree (expansion of bus, hierarchical structure), distributed (arbitrary node connection, difficult and high cost of management).

In general, office Lans have a star topology, with the switch in the middle. If the switch fails, the entire network goes down. Similarly, small networks connected by routers are star-shaped.

1.1 OSI/RM seven-layer model

WLAN technical standard :IEEE 802.11

Wan protocols include PPp point-to-point protocol, ISDN Integrated Services Digital Network, xDSL (DSL digital subscriber lines :HDSL, SDSL, MVL, ADSL), DDN digital line, X. 25, FR Frame relay, ATM asynchronous transmission mode.

1.2 the TCP/IP protocol

Network protocol three elements: syntax, semantics, timing.

TCP/IP has two representative transport layer protocols, namely TCP and UDP.

  • TCP three-way handshake is reliable

  • UDP, unreliable protocol.

  • The port number is used for addressing

1.3 Network Layer Protocol:

  • IP: the most important core protocol at the network layer. It transmits packets between source and destination IP addresses. It is disconnected and unreliable.

  • ICMP: Internet Control Message protocol used to transmit control messages between P hosts and routers. Control messages refer to the messages about the network itself, such as whether the network is connected, whether the host is reachable, and whether the route is available.

  • ARP and RARP: address resolution protocols. ARP translates an IP address to a physical address, and RARP translates a physical address to an IP address.

  • IGMP: Network group management protocol that allows computers on the Internet to participate in multicast. IGMP is a protocol used by computers to report members of a multicast group to neighboring multicast routers.

1.4 Transport Layer Protocol:

  • TCP: one of the most important protocols in the whole TCP/IP protocol family. On the basis of unreliable data provided by IP protocol, the retransmission technology is adopted to provide a reliable, connection-oriented, full-duplex data transmission service for applications. It is used in scenarios where a small amount of data is transmitted and high reliability is required.

  • UDP is an unreliable and connectionless protocol that improves the transmission rate. It is generally used in scenarios where a large amount of data is transmitted but the reliability is not high but the transmission speed is high.

1.5 Application Layer Protocol:

FTP and HTTP based on TCP are reliable transmission. DHCP and DNS based on UDP are unreliable transmissions.

  • FTP: A reliable file transfer protocol used to control the two-way transfer of files over the Internet.

  • HTTP: Hypertext Transfer protocol, used to transfer hypertext from the wWw server to the local browser. The secure web page protocol after SSL encryption is HTTPS.

  • SMTP and POP3 are simple mail transfer protocols. They are a set of rules for transmitting mails from source addresses to destination addresses. Mail packets are expressed in ASCI format.

  • Telnet: Remote connection protocol. It is the standard protocol and main method for remote login services over the Internet. TFTP: unreliable and inexpensive small file transfer protocol.

The IP address

Host bits: All “WISE Man” are local network addresses. All “1s” are broadcast addresses and other “wise man” are host addresses.

In the address of the said machine’s IP address is a 32-bit binary code, every eight insert a space, can improve the readability, to facilitate the understanding and Settings, typically dotted decimal method are used to indicate: the 32-bit binary code every 8 bit binary converted to decimal, becomes 4 decimal number, and then inserted in each decimal interval., As shown below, the final value is 128.11.3.31:

Because each decimal number is converted from eight binary numbers, the value of each decimal number ranges from 0 to 255.

Category IP Address The IP address is divided into four segments, each consisting of eight bits and a total of 32 bits.

Logically, the 32-bit IlP addresses are divided into network numbers and host numbers. IP addresses can be divided into the following types according to the number of network numbers: