1. Lan is not a machine on the network, how to debug?
1, a single machine cannot surf the internet, others can
(1) Ping www.baidu.com Check can be linked to the network?
If ping, but not internet: browser problems, poisoning and other issues
(2) Ping gateway
The goal is to troubleshoot physical link problems (network cable, NIC, driver, IP settings, etc.)
1) If the Ping gateway is not in the way, look at the IP settings and ping the IP of the IP or other machines in the ping network
If ping yourself IP is different: Check IP settings, NIC driver, physical link
If the other machine IP in the ping network is on, the gateway does not allow you to connect.
2) Ping the gateway-pass payment, check DNS settings are correct
Ping the public network IP, see the unblocked situation. Like Ping 203.81.19.1.
Host/dig/nslookup checking Domain name resolution
( 3 ) Internet routing problems (configuration and hardware) and ISP Line Problems
Login route, check superior line, call ISP technology
Auxiliary Troubleshooting: Other people can surf the Internet, IP address conflict, ARP virus, core switch broken, switch loop (see log)
2 , Large area on the net
Router, ISP, core switch, ARP virus spoofing gateway, gateway address occupied, Ldns problem
The core switch is broken, the switch loop
2, customers reflect the opening of the site slow, how to wrong?
1 , Ping your website to see if the line is unblocked
Can ping through, do not lose packets. HTTP Service issues (service outage, service overloaded)
Can ping pass, drop packet. The room bandwidth is not stable, each line is unstable
Ping does not pass, ping www.baidu.com, can ping Baidu, explain the engine room outage, or HTTP service problems (service outage, service overload)
TRACEROUTE-D website IP See the client to the server between the various lines there is no problem
2 , the computer room business is correct '
Check if Service Web service is turned on, firewall is blocked
Telnet www.xx.com:80
Nmap Www.xx.com-p 80
Curl www.xx.com or wget www.xx.com equivalent to browser access
Server is overloaded with server and service connections, high load, high CPU, high IO
3 , external issues
Website purchase bandwidth is full, through the traffic monitoring server to view
Chain outside chain (call external website URL has a problem)
Google Chrome Direct F12
4 , other issues
Individual customer problems, such as the line of the user's line and the bandwidth of the website does not match
Cluster architecture (hundreds of servers serving)
Web Service Issues
Database issues, log in to the database, see if there are slow query statements show processlist, adjust MySQL configuration, optimize SQL statements
Storage, and so on, is not a storage server such as NFS,MFS load and disk IO high
3, the TCP/IP protocol three handshake and four wave process
the first server and client are in cloesed state, the server creates Socket start listening, the server is in Listen Status ( CLOSED : Default state)
client sends SNY after becoming syn_sent (wait for a matching connection request after sending a connection request) status
Server Received SYN after the Send ACK and the SYN to the client, by LISTEN status becomes waiting for client ACK of the Syn_recv (wait for confirmation of connection request after receiving and sending a connection request) status
the server receives ACK later becomes established state. The client becomes established after the ACK is sent
client sends FIN after entering fin_wait1 status (Waiting for server ACK )
Server Received FIN after entering close_wait status (and data to be sent).
fin_wait1 received ACK Enter Fin_wait2 status (Waiting for server FIN )
after the server data is sent, send FIN to the client, by close_wait into Last_ack (Waiting for the client ACK ). After receiving the client ACK , it becomes cloesed
client sends ACK after, wait 2MSL time, the server is not sending FIN , you enter CLOSED
4. How the HTTP protocol works
1) Address resolution
2) Encapsulating HTTP request Packets
3) encapsulated into TCP packet, establish TCP connection (three-time handshake
4) client sends request command
5) Server Response
6) The server shuts down the TCP connection, and if the server has code: connection:keep-alive, the TCP connection remains open after sending
5. DNS parsing principle
Take www.baidu.com. (The last point is the root server, generally omitted) as an example
The client first looks at the local DNS cache and the local DNS server (recursive)-the "request from the local DNS server to the external DNS server (iteration)-" check first. (Root DNS server, global 13)-"check. COM (top-level domain name server)-" check. Baidu.com server-"-" Check www.baidu.com server-"back
5.1. The difference between recursion and iteration
Recursion is a process that calls itself constantly, and the problem is scaled down in the recursive process, so that the solution to the problem eventually gets
Iteration is a function code reuse, the output as input, again processing, iterative is a far closer approximation
6. OSI7 Layer Network Model
Application Layer-Provides a structure for the application software to enable the use of network services (with various application layer protocols) PDU data Unit
Presentation Layer--"encrypt and decrypt information, translate, compress and decompress."
Session Layer--"create and manage sessions between users on different machines"
Transport Layer-"guaranteed end-to-end transmission (TCP,UDP) segment
Network Layer--"control subnet operation, logical addressing, packet transmission, routing, ARP,RARP Packet/message transmission
Data Link layer--"point-to-point transmission, physical addressing (MAC) frame transfer
Physical Layer-"physical media", bitstream transmission
7. How to see what service name corresponds to a known port?
Lsof-i Port number
Netstat-intup | grep Port number
8. How does the route add a network route?
Route add 10.41.0.0 Mask 255.255.0.0 10.27.0.1 #添加目标为10.41.0.0, subnet mask is 255.255.0.0, Next hop address is 10.27.0.1 route
Route add default GW 192.168.120.240 #添加默认网关
9. The difference between snapshots and backups
Backup: Copying from one place to another, the data in two places is completely independent.
Snapshot: A storage token for a file system. Imagine the time series T0......t1......t2.......t3,t1 and T2 each time to generate a snapshot of a file path, a, B, the storage overhead is T1 to T2 during the cow write-time copy of the data change part, rather than the backup copy as the full data under a path. Snapshot first creation takes the longest time, because the storage tag for all files is recorded, and each subsequent snapshot is just a different state than the last snapshot.
Linux Exercises-4 web quiz