当前位置:网站首页>Baoyan postgraduate entrance examination interview - Network
Baoyan postgraduate entrance examination interview - Network
2022-06-26 07:52:00 【moluggg】
Ashore some midstream 985, The important knowledge points summarized below :
1. Functions of computer network :
① data communication : File transfer 、 E-mail, etc
② Resource sharing : Data sharing 、 Software sharing, etc
③ distributed processing : Assign tasks to other computers on the network to reduce the burden
⑤ Load balancing
④ Improve reliability : They are interchangeable
TCP/IP Five layer structure and corresponding protocols 、 effect :
| The physical layer | ( Transmission unit : The bit ) Transparently transmit bitstreams over physical media | Two theorems , Channel multiplexing technology | |
| The link layer : | ( Transmission unit : frame ) Package into frames , Transparent transmission , Error control , flow control , Provide services for network layer | SDLC,HDLC,PPP,STP | The sliding window ,GBN Deal with the SR agreement ;ALOHA Department agreement ,CSMA Department agreement ,MAC frame |
| The network layer | ( Transmission unit : The datagram ) Datagram service , Heterogeneous network interconnection 、 Routing and forwarding 、 Congestion control | IP,ARP(IP-MAC)DHCP( Dynamic allocation IP) | Routing and algorithms 、 agreement ; Network forwarding process ;NAT; Subnet partition ; Multicast ; Datagram and virtual circuit , Three exchanges |
| Transport layer | ( Transmission unit : Message segment )① Logical communication between different processes ② Provide a port for the application layer to deliver the data of the application process down ③ Reuse and reuse technology , Error detection technology ④ Two protocols are provided TCP,UDP | TCP,UDP | Three handshakes 、 Four handshakes 、 flow control 、 Congestion control 、 |
| application layer | FTP,Http | ||

What are the relay systems ?
① The physical layer : Repeater 、 A hub
② Data link layer : bridge 、 Switch
③ The network layer : Router
④ The network layer goes up : gateway
ISO,OSI More session layer and presentation layer
TCP、IP The physical layer , The data link layer is merged into the network interface layer
Code element , channel , Interaction mode of communication parties , Two theorems
Network address translation NAT: It refers to the conversion of private network address to public network address
Switching mode of communication network :
① Circuit switching : Connection required 、 The data transfer 、 Connection release
② Message switching : No connection needed , Store and forward transmission mode is adopted , Dynamic distribution circuit .
③ Packet switching : Solve the problem of large messages in message exchange , The length of the group is fixed , Simplified storage management .
How media access is controlled
Static channel division and medium control
① Frequency division multiplexing
② Time division multiplexing
③ Bo Fen takes
④ Code points : Each chip is equivalent to a vector , The chips sent by each station are orthogonal to each other .
6. Dynamic partition of media access control :
① ALOHA: Don't test , Send at random , There are conflicts , Random resend —— Throughput is very low
② Timeslot ALOHA : It can only be sent at the beginning of each time slot —— Throughput ratio ALOHA Twice as big
③ CSMA agreement : Before sending, listen to whether the public channel is sending , Send when the channel is found to be idle ( Whether there is data on the road is unknown )
④ CSMA/CD : carrier sense 、 collision detection - Listen before sending , Send and listen , If no collision is detected after the contention period, it is determined that no collision has occurred . If... Is detected , Then send a congestion signal to let all users know and use the backoff algorithm , Wait a random time to return to step 2.
⑤ CSMA/CA : If the channel is detected to be idle, wait DIFS after , Send the whole frame of data ;
( From the second frame ) Otherwise, execute the backoff algorithm , If a busy channel is detected, the backoff timer remains unchanged , Otherwise the countdown , Until 0 , Send the whole frame , After receiving the confirmation frame, the second frame will be sent .
Flow control mode and transmission mechanism
Stop waiting : Send a frame , Send the next frame after receiving the response
Sliding window mechanism : Send window : The range of frames that can be sent , Slide a frame forward without receiving a confirmation frame
Receiving window : The range of windows that can be received , Every time a frame is received, the window slides forward and sends a confirmation frame
Reliable transmission mechanism :
Stop waiting for agreement : Over time retransmission
back off N Frame protocol : The sender can send multiple frames simultaneously and continuously , After the receiver detects the ordered frames and makes them correct , Return a confirmation frame ( The current maximum number of frames ), When the sender receives the acknowledgement frame , The window slides to the next frame of the maximum numbered frame .
If a group of frames is wrong , The group is discarded , Send a confirmation frame , The content is the number of the currently confirmed maximum number frame
Choose retransmission protocol (SR): Single frame confirmation , The receiving window becomes larger , Frames in the window are welcome , It doesn't require order , If in front of the window N If all frames have been received, they can be delivered to the network layer and the window can be slid .
Send window : The elements in the window can be sent , If the element in the window is sent and timed by the timer , If an acknowledgement frame is not received within the time limit, the frame will be retransmitted . front N Each element receives a confirmation frame , Windows can slide .
bridge 、 A hub 、 Switch
A hub :
bridge :
The data processing object is a frame , It has the ability of addressing and routing , according to mac The destination address of the frame forwards and filters the frame .
The same conflict domain can become a network segment
advantage : It can interconnect different types of LANs , Expand the scope of Physics , Different physical layers can be used
shortcoming : It is suitable for LAN with few users , Otherwise, it will occur Broadcast storm ( Too much broadcast information causes network congestion , Intra segment broadcast )
Transparent bridge :
Plug and play , Self learning algorithm

Source routing bridge : When sending frames , The detailed best routing information ( Routing is minimal 、 Shortest time ) Put it at the beginning of the frame .
Ethernet switch :– Multi interface bridge , The same principle as the bridge , There are multiple interfaces , That is, you can connect multiple conflict domains .
cut-through switches
Store and forward switch

NAT, HYPERNET , Multicast , Socket
Subnet mask and subnet partition :
Subnet partition : network number + The two-level address of the host number is not flexible enough , Utilization is very low
Partition subnet knowledge will IP The host number part of the address is divided , Can be expressed as {< network number >,< Subnet number >,< Host number >} In the third part of , The first two parts can be collectively referred to as network prefixes
HYPERNET :
Reduce the number of routes , Reduce the routing burden .
ARP Address resolution protocol :IP Address to MAC Address mapping
Dynamic Host Configuration Protocol DHCP: Dynamically assign to the host IP Address , It's the application layer protocol , be based on UDP
Internet control message protocol ICMP: Improve IP The chance of a successful datagram delivery
Multicast :
Similar to broadcasting , Multicast data is sent only once , When the transmission path changes, the data is copied and then forwarded , Multicast the last time
Multicast address 224.0.0.0 - 239.255.255.255
Socket :
IP Part is used to distinguish different hosts , The port number is used to distinguish different processes
Network layer forwarding packet flow
1. From the destination host IP Address D Get the network address N,
If network N Connect directly to this router , Then the datagram is delivered directly to the destination host D, This is called direct delivery .
If the destination address in the routing table is D Specific host routes for , Then the datagram is sent to the next hop router specified in the routing table ;
Otherwise, the table has reached N The routing of the network , Then send the datagram to the next hop router specified in the routing table ;
If there is a default route in the routing table , The datagram is sent to the default router specified in the routing table .
Otherwise, it is delivered to the default route , If there is no default route, the forwarding packet will report an error .
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-CrEKiZrU-1643375281769)(mindmaster_image/1e484639018d7785a262e22f567ccbc4.png)]
Three handshakes , Four handshakes
Three handshakes established , Four handshakes released

SYN Flooding attack

wait for 2MSL The reason for time :
TCP And UDP
UDP
No connection needed , Unreliable transmission ;
The message segment setting length is moderate , No need to slice
The head length is short , Low overhead
no congestion control , It will not affect the sending efficiency of the host
Support one-to-one , One to many , For one more , Many to many interactive communication
UDP test : Consider a message segment as a number of segments composed of 16 A message segment consisting of bit substrings , Sum by binary inverse code operation , If the result of the summation is 1 Right ( Insufficient even digit complement 0)
TCP
Point to point , Need to establish a connection , reliable , Byte stream oriented , Full duplex communication
why TCP reliable ,UDP unreliable
TCP There are three handshakes to establish a connection , Four waves close the connection mechanism . In addition, there are sliding windows and congestion control algorithms . The most important thing is to retain the mechanism of timeout retransmission . There is also verification for each message , Ensure the reliability of each message .
UDP Datagram oriented connectionless , The datagram goes out , You don't keep data backups . Only in the IP Add checksum multiplexing to the header of datagram . UDP There is no concept of server and client . UDP If the message is too long, give it to IP Cut into small pieces , If a message is discarded .
TCP Why it takes three times instead of two : Prevent the invalid request message segment from being suddenly transmitted to the server B, So there's a mistake

** Why three handshakes when connecting , It's four handshakes when it's closed ?**https://www.cnblogs.com/bj-mr-li/p/11106390.html
answer : Because when Server End receipt Client Terminal SYN After connecting the request message , It can be sent directly SYN+ACK message . among ACK Messages are used to answer ,SYN Messages are used to synchronize . But when you close the connection , When Server End receipt FIN When the message , It's not likely to shut down immediately SOCKET, So you can only reply one first ACK message , tell Client End ,“ You sent it FIN I received the message ”. Only when I Server All messages are sent , I can send FIN message , So we can't send . So it takes four steps to shake hands .
Why? TIME_WAIT Status needs to pass 2MSL( Maximum segment lifetime ) To return to CLOSE state ?
stay Client Send the last ACK reply , But it's time to ACK May be lost **.Server If not received ACK, Will be sent repeatedly FIN fragment .** therefore Client Can't close now , It has to confirm Server Received this ACK.Client Will send out ACK Then go to TIME_WAIT state .Client A timer will be set , wait for 2MSL Time for . If it is received again within that time FIN, that Client Will be reissued ACK And wait again 2MSL.
None of the following : sketch SYN attack
SYN Attack and use TCP Protocol defect , By sending a large number of semi connection requests , Occupy half connection queue , cost CPU And memory resources .
How to optimize :
- To shorten the SYN Timeout Time
- Record IP**, If you receive a continuous IP Duplication SYN message , From this IP All packets from the address will be discarded .**
Flow control and congestion control :
TCP flow control
When the two sides are communicating , The rate of the sender is not necessarily the same as that of the receiver , If the sender's transmission rate is too fast , It will cause the receiver to be unable to handle , At this time, the receiver can only store the data that cannot be processed in the cache ( Out of order packets are also stored in the cache ).
The following figure shows how to use the cumulative confirmation algorithm :
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-TwdfTVQy-1643375281771)(mindmaster_image/183406-762447.png)]
TCP Congestion control :
Slow start and hard plug to avoid :
Congestion window from 1 Start exponential growth to the threshold , Post addition growth , If there is a network jam ( That is, the confirmation is not received on time ) The threshold is less current window ( Not the original threshold ) Half of ,
Congestion window from 1 Continue to do the above actions .

Fast retransmission and fast recovery :
redundancy ACK
Whenever an out of order segment larger than the expected sequence number arrives , Send a redundancy ACK, Indicates the sequence number of the next expected byte .
The sender has sent 1,2,3,4,5 Message segment
The receiver receives 1, Return to 1 The confirmation of ( The confirmation number is 2 The first byte of )
The receiver receives 3, Still return to 1 The confirmation of ( The confirmation number is 2 The first byte of )
The receiver receives 4, Still return to 1 The confirmation of ( The confirmation number is 2 The first byte of )
The receiver receives 5, Still return to 1 The confirmation of ( The confirmation number is 2 The first byte of )The sender received 3 For message segments 1 Redundancy of ACK—— Think 2 newspaper The text segment is missing , Retransmission 2 Message segment No ( The fast retransmission )
Fast retransmission : The sender continuously receives 3 Redundancy ACK, It's a packet loss ( At this time, there is no need to control whether the arrival time is timed out ) , Packet loss means that the network is likely to be congested , To prevent or prevent network congestion , A fast retransmission is required + Fast recovery algorithm , Algorithm is as follows :
The threshold value is reduced to current window Half the size , Then the window size is added .


DNS And http,ftp
1.P2p Model :
Not many hosts have the function of uploading and downloading, which reduces the pressure of the service , Multiple customers and can share documents directly .
2.DNS:
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-FYmUwmPh-1643375281773)(mindmaster_image/172831-854679.png)]
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-NsO88mEw-1643375281773)(mindmaster_image/183644-380898.png)]
3.FTP:
FTP use Customer / The server works The way ,TCP Reliable transmission
A main process , Responsible for accepting new requests ; In addition, there is the nogango series process , Responsible for handling individual requests . The working steps are as follows :
① Open the control port 21 , Enable client processes to connect to
② Wait for the client process to send a request
③ Start slave process control client request , The master and slave processes are concurrent , The slave process terminates after processing
④ Back to the waiting state , Continue to accept requests from other customer processes
Http characteristic :
Reliable transmission 、 No state ( User visits more than once , The response was the same )
Persistent and non persistent connections
The order in which a page is accessed
The order in which a page is accessed :
① Browser analysis URL
② Browser direction DNS Domain name server requests resolution IP Address
③ DNS It is concluded that IP
④ Browser pass IP Address to find the server and request a link (80 port )tcp
⑤ Send a specific message after the connection is established http request
⑥ The server passes http The response sends the file to the browser
⑦ Release tcp
⑧ The browser parses the file and displays it to the user
http And https The difference between
http All transmitted content is clear text , And neither the client nor the server can verify each other's identity . https Having security ssl Encrypted transport protocol , Encryption uses symmetric encryption , https The agreement needs to reach ca Apply for a certificate , Generally there are few free certificates , You need to pay a fee .
sketch TLS/SSL, HTTP, HTTPS The relationship between
SSL Its full name is Secure Sockets Layer That is, the condom layer , His successor is TLSTransport Layer Security Transport layer security protocol , Are used to provide security support for data communication at the transport layer .
Can be HTTPS The agreement is simply understood as HTTP agreement +TLS/SSL
https Connection process
- The browser sends the supported encryption algorithm information to the server
- The server selects a set of encryption algorithms supported by the browser , Send back to browser in the form of certificate
- client (SSL/TLS) Analyze the certificate and verify the validity of the certificate , Generate symmetric encryption key , We call this key client key, That is, the client key , Use the public key of the server to encrypt the client key asymmetrically .
- The client will initiate HTTPS Second of HTTP request , Send the encrypted client symmetric key to the server
- After the server receives the ciphertext from the client , Will use their own private key for asymmetric decryption , The decrypted plaintext is the client key , Then use client key to encrypt data symmetrically , So the data becomes ciphertext .
- The server sends the encrypted ciphertext to the client
- The client receives the ciphertext sent by the server , Use client key to decrypt it symmetrically , Get the data sent by the server . such HTTPS Second of HTTP End of request , Whole HTTPS Transmission complete
After entering a web address in the browser , What exactly happened
Conduct DNS Parsing operation , according to DNS The result of parsing can be found on the server IP Address
adopt ip Addressing and arp, Find the server , And use three handshakes to establish TCP Connect
Browser generation HTTP message , send out HTTP request , Wait for the server to respond
Server processing request , And return to browser
according to HTTP Open long connection or not , Conduct TCP The process of waving
The browser renders the page according to the received static resources
边栏推荐
- Webrtc has become the official standard of W3C and IETF, and mobile terminal development
- What are the key points of turnover box management in warehouse management
- Request&Response
- Automatic backup of MySQL database in the early morning with Linux
- Chapter 3 (data types and expressions)
- Kalman filter_ Recursive Processing
- The difference between setstoragesync and setstorage
- Uniapp wechat withdrawal (packaged as app)
- [North Asia data recovery] a server data recovery method in which the partitions in the RAID5 array are formatted due to the misoperation of the NTFS file system
- Jemter 压力测试 -可视化工具支持-【安装篇】
猜你喜欢

Chapter VIII (classes and objects)

Household enterprises use WMS warehouse management system. What are the changes

Jemter 压力测试 -基础请求-【教学篇】

What are the key points of turnover box management in warehouse management

Redis(5)----浅谈压缩列表

Junit

Arrangement and insertion structure

buuresevewp

What is the difference between bone conduction earphones and ordinary earphones? Advantages of bone conduction earphones

Web technology sharing | webrtc recording video stream
随机推荐
[UVM practice] Chapter 2: a simple UVM verification platform (3) add various components to the verification platform
Nine hours, nine people and nine doors (01 backpack deformation) - Niuke
What are the key points of turnover box management in warehouse management
Gavin teacher's insight on transformer live class - multi state transition of financial BOT and rasa interactive behavior analysis of Rasa project (52)
Minor problems in importing D
Is it safe for individuals to buy stocks with compass software? How to buy stocks
Okhttp3 source code explanation (IV) cache strategy, disadvantages of Android mixed development
Detach an entity from jpa/ejb3 persistence context
Mxnet implementation of network in Nin network
Pic 10B parsing
ASP. Net and Net framework and C #
[UVM practice] Chapter 3: UVM Fundamentals (3) field automation mechanism
Solve psycopg2 NotSupportedError: PQconninfo not available in libpq < 9.3
Median segmentation (find rules) - Niuke
数据中心灾难恢复的重要参考指标:RTO和RPO
Children play games (greed, prefix and) - Niuke winter vacation training camp
[NLP] vector retrieval model landing: Bottleneck and solution!
Yyds dry inventory Druid connection pool usage
2022 ranking of bank financial products
Exit of shell internal value command