1. Briefly describe the osi seven-layer model and the TCP/IP five-layer model. The
OSI seven-layer model:
1. Physical layer: use '0' and '1' to represent the level of voltage and the flashing of lights to define the specifications of connectors and network cables .
2. Data link layer: transfer and identify data frames between interconnected devices.
3. Network layer: address management and routing selection.
4. Transport layer: Manage data transmission between two nodes, responsible for reliable transmission (to ensure that data is reliably transmitted to the destination address).
5. Session layer: communication management, responsible for establishing and disconnecting communication connections (logical paths for data flow), and managing the layers below the transport layer.
6. Presentation layer: the conversion between the device's inherent data format and the network standard data format.
7. Application layer: Protocol for specific applications.
TCP/IP five-layer model:
physical layer, data link layer, Internet layer, transport layer, application layer (application layer, presentation layer, session layer)
2. Summary description TCP three-way handshake wave four times
First handshake: establish connection When the time, the client sends a syn package (syn=x) to the server, and enters the SYN_SENT state, waiting for the server to confirm; SYN: Synchronize Sequence Numbers (Synchronize Sequence Numbers).
The second handshake: the server receives the syn packet, it must confirm the client's SYN (ack=x+1), and at the same time it sends a SYN packet (syn=y), that is, the SYN+ACK packet, and the server enters the SYN_RECV state;
The third handshake: the client receives the SYN+ACK packet from the server, and sends an acknowledgment packet ACK (ack=y+1) to the server. After this packet is sent, the client and server enter the ESTABLISHED (TCP connection successful) state, which is completed three times shake hands.
Wave for the first time: The client sends a FIN to close the data transfer from the client to the server, and the client enters the FIN_WAIT_1 state.
The second wave: After receiving the FIN, the Server sends an ACK to the Client, confirming that the serial number is the received serial number + 1 (same as SYN, one FIN occupies a serial number), and the Server enters the CLOSE_WAIT state.
The third wave: Server sends a FIN to close the data transfer from Server to Client, and Server enters the LAST_ACK state.
Fourth wave: After the Client receives the FIN, the Client enters the TIME_WAIT state, and then sends an ACK to the Server, confirming that the serial number is the received serial number +1, the Server enters the CLOSED state, and completes the four waves.
3. Describe the difference between TCP and UDP
1. TCP is connection-oriented (such as dialing to establish a connection before making a call); UDP is connectionless, that is, there is no need to establish a connection before sending data.
2. TCP provides reliable services. UDP does its best to deliver, that is, reliable delivery is not guaranteed.
3. Each TCP connection can only be point-to-point; UDP supports one-to-one, one-to-many, many-to-one and many-to-many interactive communications
4. TCP header overhead 20 bytes; UDP has a small header overhead, only 8 bytes.
5. The logical communication channel of TCP is a full-duplex reliable channel, while UDP is an unreliable channel.
4. Summarize the ip classification and the number of IPs that can be allocated for each classification.
Public IP address:
Class A: 1.0.0.0 to 9.255.255.255, 11.0.0.0 to 126. 9.255.255.255
Class B: 128.0.0.0 to 172.15. 255.255, 172.32.0.0 to 191.255.255.255
Class C: 192.0.0.0 To 192.167.255.255, 192.169.0.0 to 223. 255.255.255
Private IP address:
Class A: 10.0.0.0 to 10. 255.255.255
Class B: 172.16.0.0 to 172.31.255.255
Class C: 192.168.0.0 to 192.168.255.255
5. Summarize the IP configuration method
1. Modify the configuration file
vi /etc/sysconfig/network-scripts/ifcfg-ethx
2. Ifconfig command (the ip address configuration will automatically become invalid after the computer is restarted)
Ifconfig ethx ipadd netmask xxxx
3. Use graphical tools