Note: write this article is mainly in the study of the front-end review computer network to write, so did not put the whole computer network knowledge points are included, there are key, hope forgive me
Computer network overview physical layer Data link layer Network layer Transport layer Application layer Network security
First, computer network overview
1. The role of computer networks in the Information Age
1.
Some important features of the 21st century are digitalization, informatization and networking. It is an information age with network as the core. Cable TV and computer networks
3. There are two kinds of Internet translation names:
Internet (recommended by the National Technical Committee) Internet (folk term, most widely used)
2. Three basic concepts of computer networks:
A computer network (network for short) consists of a number of nodes and the links that link them. The nodes of the network may be computers, hubs, switches, or routers. The Internet is a network of separate networks of computers linked together, so it is also called a network. The computers connected to the network are called hosts. In the same way, the Internet is a network of internets
3. Three stages of Internet development
The first stage is the development of ARPANET to the Internet. The second stage is the establishment of the three-level structure of the Internet: the three-level structure is the backbone, regional network, campus network or (enterprise network). The third stage is the multi-level ISP structure of the Internet
2. An Internet service provider (more on that in Section 4)
2. Composition of the Internet
1. The topology of the Internet is very complex, and there are two main categories in terms of working mode:
edges: Consists of all hosts connected to the Internet. This part is directly used by users for communication and resource sharing
Core part:It consists of a large number of networks and routers connected to these networks. Its main function is to provide services for the edge parts
2. Classify according to the scope of the network (key points)
1, WAN WAN 2, MAN 3, LAN LAN 4, PERSONAL area network PAN
3. Performance of computer network (consider when optimizing the front end)
1. Speed:
Computer transmission signals are transmitted by digital signals. So the rate is the data transfer rate, also known as data rate or bit rate
2, bandwidth,
1. Bandwidth refers to the frequency band width of a signal, in Hertz
3. Throughput
Throughput refers to the actual amount of data moving over a network (channel or interface) at a given time
4, time delay
The time delay is exponential. The time delay for data to be transmitted from one end of the network to the other end includes:
Transmission delay: time required for the host or router to send data propagation delay: time required for the electromagnetic wave to travel a certain distance in the channel Processing delay: time required for the host or router to process packets Queuing delay: time required for queuing in the transmission queue
4 computer Network Architecture (key)
1. ARPANET proposed to deal with problems in layers and solve big problems into local problems. 2. IBM proposed the system network architecture SNA in 1974. 4, at present, the mainstream is TCP/IP protocol, although it is not an international standard, but has been recognized by default
5. Network Protocol:
Rules established for the exchange of data across a network. Standards or conventions are called network protocols. Three elements of network protocol:
1. Syntax: structure and format of data and control information. 2. Semantics: what kind of control information needs to be sent, what kind of action needs to be completed and what kind of response needs to be made
6. Benefits of computer stratification:
1. Each layer is independent; 2. Good flexibility; 3
TCP/IP is a four-tier architecture:
The application layer
Transport layer
The network layer
Network interface layer
In the following section, I will carefully explain the application and knowledge of each layer. Here is a general understanding of 7.1 application layer
The application layer is the highest level in the architecture. The task is to complete the specific network application protocol through the interaction between application processes, including domain name DNS, HTTP protocol, SMTP protocol of email and so on. The data unit of application layer interaction is called message
7.2 the transport layer
The transport layer is responsible for the communication between processes in two hosts to provide common data transfer services. Main protocols:
Transmission control protocol (TCP) — provides reliable link-oriented data transfer services. The unit of data transfer is packet segment User Data Packet Protocol ***UDP — provides connectionless. Best effort data transfer service, the transmission unit is the user datagram
7.3 the network layer
The network layer is responsible for the communication services provided by different footprints on the packet switch network. When sending data, the network layer encapsulates the packet segments or user datagrams generated by the transport layer into packets or packets for transmission. In TCP/IP protocol, because IP protocol is used, packet data is also called IP data network layer.
7.4 Data Link Layer
The data link layer is referred to as the link layer for short. When two hosts transmit data, they transmit data on the links one by one, requiring special link layer protocols.
7.5 the physical
Data is transmitted at the physical layer in bits, sending 0 or 1
Front-end learning focuses on the TCP/IP protocol family
So I will focus on these two aspects in the following content
Second, the physical layer
Knowledge of the physical layer
1. The main task of the physical layer is to determine some properties related to the interface of the transmission media, such as mechanical properties, electrical properties, and functional properties
2 A data communication system can be divided into three parts: source system, transmission system and destination system. The source system includes source point (source station, message source) and sender, and the destination system includes receiver and destination (or destination station, message home).
3, the purpose of communication is to transmit messages, such as voice, text, images, video and so on are messages. Data is an entity that transports messages. Signals are electrical or electromagnetic representations of data.
4. Signals can be divided into analog signals (continuous signals) or digital signals (discrete signals) according to the different values of the message parameters represented in the signal. The basic waveform representing the different discrete values of the digital signal is called a symbol
5, according to the information interaction mode, communication can be divided into one-way communication (simplex communication) and two-way alternate communication (half duplex communication) and two-way communication (full-duplex communication) signals from the signal source is called baseband signal, the signal on the channel transmission requires after modulation, a baseband modulation and bandpass modulation
6. To increase the rate of transmission over the channel, use better transmission media or use advanced modulation techniques, but the transmission rate is not changeable
7. Transmission media fall into two main categories:
Guided transmission media (twisted pair, coaxial cable or fiber) Non-guided transmission media (wireless or infrared, atmospheric laser)
Data link layer
Data link layer knowledge points
1. A link is a physical line from a node to an adjacent node. A data link is based on a link with some necessary hardware, such as network adapters and software, such as the implementation of protocols. 2. The channels used by the data link layer are mainly point-to-point channels and broadcast channels. 3, data link layer transmission protocol data unit is frame data link layer three basic problems are encapsulated into frame transparent transmission and error detection. 4. Point-to-point protocol is the most widely used protocol for data link storage. It is characterized by simplicity, only detecting errors, not correcting errors, not using serial numbers, and not carrying out flow control. 5, LAN advantages are broadcast function, from a site can be very convenient access to the whole network, easy to expand the system and gradually evolve, improve the reliability of the system availability and survivability. 6, a Shared communication media resources, there are two ways, one is static channel, divided into various reuse technology, the second is dynamic media intervention, also called a multipoint access, random access or controlled access 7, Ie802 committee had the local area network (LAN) data link layer split into two layers, namely the logical link control and media access control layer, But now the LLC sub-layer is history. 8, the computer and the external LAN communication is mainly through the communication adapter or network adapter, it is also known as the network interface or network card, the hardware address of the computer is in the ROM adapter
Four, network layer (key!!)
Relationship between IP addresses and physical addresses Traditional classified IP addresses and classless interzone routing CIDR Works
1. Two services provided by the network layer
In the new generation of Internet design ideas:The network layer only wants to provide simple, flexible, connectionless, best-effort datagram services
There are two main types: virtual circuit service and datagram service
TCP/IP is based on the datagram service
2. Internet Protocol IP
The Internet protocol IP is one of the two most important protocols in the TCP/IP architecture and there are three other protocols that support IP
Address resolution protocol: ARP Internetwork control packet protocol: ICMP Internetwork group management protocol: IGMP
3. IP address and its representation method
The entire network is a single, abstract network. An IP address is a unique 32-bit identifier assigned worldwide to every host on the Internet or to every interface of a route. The IP address is assigned by ICANN, the Internet corporation for assigning names and numbers. The orchestration of IP addresses has gone through three historical stages:
1. IP address of the classification
2. Subnets
3, constitute the ultra network
What you need to remember is actually this picture right here
Consider the following when classifying IP addresses into three categories:
Networks vary greatly,
Some networks have many hosts
In order to meet the different needs of different users, some hosts are divided into ABC classes
4. IP address features
Each IP address consists of a network number and a host number
An IP address actually identifies the interface between a host (or router) and a link
A network is a collection of hosts with the same network number, so several Lans connected by forwarders or Bridges are still one network
In early IP addresses, all networks assigned network numbers are equal. Equality means that the Internet treats each IP address equally
IP address and hardware address
Physical address is the address used by the data link layer and physical layer, while IP address is the address used by the network and the above layer, which is a logical address (IP address is realized by software).
6. Divide subnets and construct hypernets
The reason for subnets is that the IP address utilization is not high and the two-tier IP address is not flexible. Therefore, there are three levels of IP address. The three levels of IP address division only divides the host number of the IP address, rather than changing the original network number of the IP address
Subnet mask:
The calculation process of subnet mask is quite complicated. If you are interested, you can read the following article:
Two methods of assigning a subnet mask
Here’s a summary of what you need to remember about subnet masks:
The CIDRde 32-bit subnet mask consists of a string of 1s and 0s. The number of ones is the length of the prefix, and as long as you do the logic and the arithmetic of the IP address and the address mask, The default mask for A class A address is 255.0.0.0. The default mask for A class B address is 255.255.0.0. The default mask for A class C address is 255.255.255.0
7, IPV6
IPV6 still supports connectionless delivery. But the main change to calling the protocol data unit PUD a packet, rather than IPV4 data:
1. Larger address space 2. Extended address hierarchy 3. Flexible header format 4. Improved options 5
IPV6 datagrams fromThe basic firstandEffective loadcomposition
8. IP multicast
IP multicast refers to multicast over the Internet. It only needs to be sent once and can be sent to multiple sets of IP addresses without replication. A router that can run a multicast protocol is called a multicast router
Five, transport layer
Knowledge:
Transport layer Basic Concepts None Features of connection and UDP Features of link-oriented TCP Other features of TCP
1. Overview of transport Layer agreement
The transport layer is the upper application layer to provide communication services, belonging to the highest part of the communication-oriented part, only the host protocol stack has the transport layer, and the router in the network core function part uses the functions of the following three layers when forwarding packets
2. Two major agreements for the transport layer
The difference between:
TCP is connection-oriented and UDP is connectionless
UDP program structure is simple
TCP is byte stream oriented and UDP is datagram based
TCP ensures data correctness, while UDP may lose packets
TCP guarantees data order, UDP does not
3, ports,
Application layer all application process can be transmitted to the IP layer through the transport layer, it is reusable, IP layer after receiving the data distribution to the application layer, which is used, the points and use it every time you may not know which is the specific application of the computer function process, this time is used in port, is the end point of the communication of application process, as long as all the send a message to the corresponding port, TCP and UDP do the rest of the work, and ports are an address where the application layer interacts with transport entities between various protocol processes. Ports are divided into:
1. Port used by the server
2. The port number used by the client ranges from 49152 to 65535, also known as the transient port number
4. User datagram Protocol UDP (emphasis)
Features:
UDP is connectionless UDP do your best to deliver UDP is message-oriented UDP without congestion control UDP supports one-to-one, one-to-many, many-to-one and many-to-many interaction communication UDP header overhead is low
UDP header format:
1, the source port – in the need to reply to each other is used, do not need to be all 0
2. Destination port: — Must be used when the destination delivers packets
Length: — Length of UDP user datagram. The minimum value is 8
4, check and — detect UDP user data in the transmission of error, error discarded
5, Transmission control protocol TCP (key) 1
The main features of TCP:
Each TCP connection can have only two endpoints, and each TCP connection can only have point-to-point. 3. TCP provides reliable delivery services. 4
Links to TCPDE:
TCP links as the most basic abstraction, each TCP has two endpoints, not the host and application process, TCP endpoints are sockets or sockets, port numbers spliced to IP address to form a socket. Each TCP connection is uniquely identified by two endpoints at both ends of the communication
How TCP works:
Stop waiting for protocol:
1. No errors:
2. Something goes wrong
3. Confirm loss and confirm lateness
4. Channel utilization The advantage of the stop-wait protocol is simple, but the disadvantage is that the channel utilization is low
The header format of the TCP packet segment
TCP is byte stream oriented, but the data unit transmitted by TCP is a packet segment.
The meaning of each field in the fixed part of the header
1. Length: from 0 to 31, so each behavior is 32 bits, accounting for 4 bytes. At least 5 lines, TCP header minimum 20 bytes, maximum 60 bytes. 2.16-bit Source port number: sending port number 3.16-bit Destination port number: receiving port number 4.32 Bits Serial number: indicates the number. Initial value: The first data is randomly generated by the system during the first interaction. How does the serial number value change? The first is a random value, and the second is the offset of the sent data in the entire byte stream + the first generated value. The data values are also small and arrive in order: to ensure that the data is not out of order, as shown in the figure: Suppose that the data is sent in 100 bytes and the initial value is 2000, the initial value + the offset is the next ordinal value. 5.32 digit confirmation number: After data is sent to the receiving end, the receiving end sends a feedback confirmation mechanism to the sending end. If the receiver receives 2000, the receiver replies 2001. The acknowledgement number can also handle duplicate message segments, discarding 6.4 bit headers once the same sequence number is received: 15 4-bytes and up to 60 bytes. For the bottom layer, the control protocol is a bunch of data, sent or a bunch of data, how to determine which is the header and which is the data carried by the receiver? The 4-bit header length is verifiable, with the first 20 bytes being the data carried after the header. If the option part carries 4 bytes, the first 24 bytes are carried data after the header. 8. Control bit UGR, ACK, PSH, RST, SYN, FIN: Urgent UGR: When UGR is set to 1, the sending application process tells the sender TCP that there is urgent data to be transmitted. The sender’s TCP then inserts the emergency data at the top of the column data, while the data after the emergency data remains normal data. ACK: Indicates the acknowledgement packet segment. The acknowledgement number field is valid only when ACK=1. When ACK=0, the confirmation number is invalid. Push PSH: When two application processes communicate interactively, sometimes the application on one side wants to receive a response immediately after typing a command. In this case, TCP can use PSUH(push operation). In this case, the sender TCP sets PSH to 1 and immediately creates a packet segment to send. The receiving TCP receives a packet segment with PSH=1 and delivers it to the receiving application as soon as possible, rather than waiting for the entire cache to fill up. Reset RST: When RST=1, it indicates that the TCP connection has a serious error, the connection must be released, and a new transport connection must be re-established. **RST=1 can also be used to reject an invalid packet segment or to refuse to open a connection. Synch SYN: Used to synchronize serial numbers when establishing a connection. When SYN=1, ACK=0, it indicates a connection request packet segment. If the peer accepts the connection, set SYN=1 and ACK=1 in the corresponding packet segment. Therefore, SYN 1 indicates that this is a connection request or connection accept packet segment. Terminate FIN: Releases a connection. When FIN=1, it indicates that the sender of this packet segment has finished sending data and requests to release the transport connection. 9.16-bit window size: Traffic control. The window value is an integer ranging from 0 to 216-1. The window value tells the other party how much data the other party is allowed to send, starting with the confirmation number in this paragraph. Heartbeat packet mechanism: 10.16-bit checksum: CRC cyclic redundancy detection algorithm 11.16-bit emergency pointer: TCP emergency pointer is a method for sending emergency data to the receiver. The emergency pointer is a positive offset. This is added to the value of the ordinal field to indicate the ordinal number of the next byte of the last emergency data. This field is the offset of the emergency pointer relative to the current ordinal number, which is called the emergency offset. 12. Option part: Variable length, minimum 0 bytes, maximum 40 bytes. When the options section is not used, the TCP header is 20 bytes. MTU limit: For example, an Ethernet packet contains 1500 bytes. The IP header contains 20 bytes. The TCP header and data together contain 1480 bytes.
6, the implementation of TCP reliable transmission
1. A sliding window in bytes
TCP’s sliding Windows are all in bytes. Any data that has been sent must be retained for use in case of timeout retransmission until confirmation is received. The serial number inside the send window indicates the serial number allowed to be sent, and the back part of the send window indicates that it has been sent and confirmed.
If a packet segment is sent and no ACK is received within the confirmed time, the retransmission mechanism is triggered. After a period of time, an acknowledgement packet is received. How do I determine whether the packet is an acknowledgement of the packet sent before or after?
If the received acknowledgement is for the retransmission packet, but the host considers it to be for the original packet segment, the calculated RTT and timeout retransmission time are larger. If the subsequent data is received after timeout retransmission, the timeout retransmission time is longer. If the received acknowledgement is an acknowledgement of the original packet, but the host considers it as an acknowledgement of the retransmission segment, the calculated RTT and timeout retransmission time RTO are too small, resulting in excessive retransmission of packet segments. 2. Fast retransmission 3. Delayed reply If the host sends an ACK reply immediately, the return window may be relatively small. You can wait an appropriate amount of time, and you can increase the window value returned. The client server also receives a message at the application layer. After the client sends a message to the server, the corresponding server also sends a message back to the client. UDP does not have the problem of sticky packets. First, the “packet” in sticky packets refers to data packets at the application layer. In the TCP header, there is no packet length like UDP, only a field with the same serial number. From the perspective of the application layer, the data delivered by the application layer to the transport layer is a series of bytes. When the application program sees this series of bytes, it does not know from which part to which part is a complete application packet. From the transport layer’s point of view, TCP is a packet that comes in and is sequenced in a buffer. How to avoid sticky bags? In the application layer, the packets are separated, and the boundary between the two packets is defined. For steady packets, it is enough to ensure that they are read according to a fixed size each time. For variable length packets, you can specify a packet length field in the header to know where the packet ends. For packages with side lengths, explicit separators can also be used between packages. (Application layer protocols are determined by the programmer.) Restart the machine: The machine is powered off or the network cable is disconnected in the same way that the process is terminated: Once the receiving end performs a write operation and finds that the connection is no longer available, the receiving end resets the connection. Even if no write operation is performed, TCP has a built-in keepalive timer to periodically check whether the other end is still available. If the other end is not available, the connection is released. Tcp-based application layer protocols are as follows: HTTP, HTTPS, SSH, Telent, FTP, and SMTP TCP is generally used for reliable transmission, file transmission, and important status updates. UDP is used in the communication field that requires high speed transmission and real-time performance.
The original link referenced here is the original link
Application layer
1, the application layer protocol is to solve the problem of one kind of application, and the solution of the problem is through are located in different host communications between the multiple applications of process and work together to complete, followed by the application layer provides application process in the communication protocol, many of the application layer protocol is based on client/server mode, the customer is the requester, the server is a service provider
2, domain name system (DNS) is a naming system used on the Internet. It is used to convert the machine names used by people into IP addresses. DNS is an online distributed database system, and adopts the client server mode.
Domain-to-ip address resolution is done jointly by many domain name servers (DNS) on the Internet
4, the Internet uses the naming method of hierarchical tree structure, in any host or router linked on the Internet, there is a unique level will be the name, that is, the domain name, the dot in the domain name and the dot decimal IP address in the point has no relationship
5. The DNS server is divided into root DNS server, top-level DNS server, permission DNS server and local DNS server
6, file transfer protocol FTP uses TCP reliable transport service, in the file transfer, FTP client and server to establish two parallel TCP links, control links and data links, is actually used to transmit data is data links.
Reference Book: Computer Network 7th Edition (Xie Xiren)
At present, first write this, there is a little bit of content behind will take time to fill, we refueling !!!! It’s just that I can’t stand it