Preface
In the Internet world, the importance of network protocols is self-evident. Many people know that the five-layer model or the seven-layer model in the network protocol are all "must-test questions" in the operating system. When going to school, whether it is rote memorization or various cheat sheets, you have to write down the following picture. Stepping into the work, into the "no return" of web development, and found that it still cannot be left behind.
Knowledge points related to computer networks are often asked by developers during interviews. Of course, compared with the previous operating systems and databases, this piece of knowledge may not have that high proportion. But the excellent you, you must be fully prepared!
1. Hardcore! 30 illustrated HTTP common interview questions
- During the interview. The probability of HTTP being asked is relatively high.
- The editor I have taught 5 categories of frequently asked questions in HTTP interviews. At the same time, these 5 categories have a relatively large relevance to the development and evolution of HTTP. The form of question and answer + illustration will help you further. Learn and understand HTTP.
Basic concepts of HTTP
Five categories of HTTP status codes
Get and Post
HTTP features
TCP three-way handshake to establish a connection
HTTPS与HTTP
How does HTTPS establish a connection? What are the interactions between?
HTTP/1.1. HTTP/2. HTTP/3 演变
Two, IP basic knowledge family bucket, 45 pictures to take away
- Some time ago, some readers wanted me to write an article on IP classification addresses, subnet division, etc. His feedback was often confused and confused.
- So, let's talk about it! And if you want to get it all, I will challenge the editor's graphic skills by the way, so I will come to a family bucket of IP basic knowledge.
- After eating this IP basic knowledge family bucket, hold your stomach and shout: "It's so delicious!
The first is the appetizer "Basic knowledge of IP"
Followed by the main course "Basic knowledge of IP address"
Finally, the dim sum "IP protocol related technology"
3. I heard that you use ping very well. Give me an illustration of how ping works
- In our daily life or work, we are judging whether the network with the other party is smooth, and the ping command is the most used.
- "Then do you know how ping works?"-Soul torture from the interviewer
- Some friends may ask strangely: "Although I don't understand its work, but ping the Thief 6 I also use!"
- You are using 6. But when you are in front of the interviewer, you won't get up, after all, they also like to ask.
- Therefore, we must have an attitude of "knowing what is happening. Knowing what is happening", so as to avoid the situation of turning right when going out during the interview.
Assistant of IP protocol-ICMP protocol
ICMP target unreachable type code number
ping-use of query message type
4. What happened after typing the URL?
Lonely brother-HTTP
Real address query-DNS
Reliable transmission-TCP
Skinning each other-server and client
Five, hard or not, you have the final say! Nearly 40 illustrations of TCP three-way handshake and four waved interview questions that have been asked a hundred times
- Regardless of interviews for Java, C/C++, Python and other development positions, the knowledge of TCP can be said to be a must.
- Let TCP abuse me thousands of times, and I still treat TCP as my first love.
- The editor of Yaoxiang was often swiped by TCP interview questions in school recruitment. I really love and hate...
- The past will not be okay, let us dispel this fear today, and face it bravely with a smile!
- So I compiled the interview questions about TCP three times to raise hands and four times to wave hands, and discuss with everyone.
Basic understanding of TCP
What is TCP?
TCP connection establishment
Why is it a three-way handshake? Not two or four times?
TCP connection dropped
Prevent data packets made by old connections
Socket programming
The TCP three-way handshake process has been completed and is in the ESTABLISHED state
6. Are you still worried about TCP retransmission, sliding window, flow control, and congestion control? After reading the diagram, don’t worry.
- I believe everyone knows that TCP is a reliable transmission protocol, so how does it ensure reliability?
- In order to achieve reliable transmission, many things need to be considered, such as data corruption, packet loss, duplication, and disordered fragment order. If these problems cannot be solved, there is no way to talk about reliable transmission.
- Then, TCP achieves reliable transmission through mechanisms such as sequence number, confirmation response, retransmission control, connection management, and window control.
- It focuses on the TCP retransmission mechanism, sliding window, flow control, and congestion control.
Retransmission mechanism
flow control
Congestion control
7. Actual combat! I use Wireshark to let you "see" TCP
- The data packet interaction in the network world is invisible to our naked eyes. They seem invisible. When we learn computer networks from textbooks, we feel very abstract, which increases the difficulty of learning.
- Not to mention, it was the same when I was in college.
- Until after work, I came to know two great tools for analyzing the network: tcpdump and Wireshark, these two great tools present the data packets that we have not seen before our eyes, at a glance.
- Alas, when the university was learning about the Internet, if you knew these two tools, you wouldn't be confused.
Invisible network packets
Decrypt TCP three-way handshake and four waved hands
Actual analysis of TCP three-way handshake abnormal situation
TCP quickly establishes a connection
TCP repeated confirmation and fast retransmission
TCP flow control
TCP delayed confirmation and Nagle algorithm
8. What happens when the TCP semi-connection queue and the full-connection queue are full? How to deal with it?
Many blogs on the Internet aim to increase the TCP semi-connection queue and the full-connection queue as follows
- The way to increase the TCP semi-connection queue is to increase /proc/sys/net/ipv4/tcp_ max_ syn_ backlog;
- The way to increase the TCP full connection queue is to increase the backlog in the listen() function;
Let me tell you first that the above methods are not accurate.
What are TCP semi-connection queue and full connection queue?
Actual combat-TCP full connection queue overflow
Actual combat-TCP semi-connection queue overflow
9. Interviewer: Substitution! He doesn't even understand TCP parameters
- The improvement of TCP performance not only examines the theoretical knowledge of TCP, but also examines the understanding and application of the kernel parameters provided by the operating system.
- The TCP protocol is implemented by the operating system, so the operating system provides many parameters to adjust TCP.
Performance improvement of TCP three-way handshake
Performance improvement of TCP four waves
Performance improvement of TCP data transmission
This [Illustrated Network Protocol] document has a total of 291 pages. Friends who need the full version can forward this article to the editor and scan the QR code below to get it! ! Remark:【666】
Of course, it’s far from enough to have documents alone. There are videos and matching courseware for learning and improvement. Try to understand the computer network. I believe there will be an extraordinary life! !
TCP/IP/Network IO learning video
TCP/IP network protocol
There are also courseware sharing
IO courseware
TCP/IP courseware
TCP/IP/IO network communication video and courseware acquisition, forwarding and following editor, private message [666] acquisition!
Well, I’m sharing it here today. I hope everyone can study hard and improve the computer network. I also hope that this article can be liked by everyone! !