Python full stack learning record--3 (2018.1.13) Computer Basics

Source: Internet
Author: User
Tags ack ming ftp protocol

one, the Linux operating system
1, UNIX is the most stable and secure system in the world at present. is a time-sharing operating system, multiple online terminals and the use of multi-channel technology.
2, open source representative of the public, everyone can edit view, but does not mean free.
3, the server is the performance, stability, efficiency, uninterrupted operation. So Linux is more competent, window can not, run long will be very card.
4, Bridging: The way to the Internet with the switch, the equivalent of adding a computer network in the LAN.
5, virtual memory is generally set to 1.5-twice times the physical memory, but not more than 8G. More than 4G of physical memory is enough to run almost all of the current programs, no need to set up virtual memory.

OSI Layer Five Protocol of Network Foundation
1, the network through the computer's underlying physical media (network cable, switches, network cards, etc.), by a unified standard Internet Protocol link up.
2, the OSI five layer meaning: the physical layer is equivalent to the letter, the data link layer equivalent to the word, the network layer equivalent to the sentence, the transport layer equivalent to the grammar, the application layer is the actual dialogue and communication.
3, the Ethernet protocol stipulates that: a group of electrical signals constitute a packet, called a frame. Each data frame is divided into: header head and data two parts.
Where header head fixed 18 bytes, including: Sender address (source address), accounting for 6 bytes, receiver address (destination address), accounting for 6 bytes, data type, accounting for 6 bytes. It is written in the language of the sending of similar letters and the recipient's address and correspondence.
Data is a minimum of 46 bytes, up to 1500 bytes, and contains specific contents of the packet, similar to the body of the letter.
Head+data= the shortest 64 bytes, and a maximum of 1518 bytes. Sent over the Shard.
4, the network transmission process: through networking equipment (radio waves, cables, optical fiber, twisted pair) based on high and low frequency, to achieve the transmission of data between the physical layer of the terminal, and then the data Link layer to group data, converted to decimal data, and then converted to human language.
The data link layer defines an Ethernet protocol, and the Ethernet protocol specifies how the data is grouped, and Ethernet requires network cards for all machines that want to be networked. To this step realizes the broadcast communication in the LAN.
The destination computer is then located at the network layer by IP address and MAC address.
Then the transport layer is based on the port (TCP/UDP, each application has a port number, 0-1024 is the port for the system) to find the receiving software (because communication is the communication between the application software. )
Then to the application layer: based on the self-defined HTTP, FTP protocol. In fact, it is similar to passing letters between post offices.
5, MAC Address: Is the header head contains the source address and destination address origin. The Ethernet protocol stipulates that every device connected to the Internet must have another network card, and the address of the sending and receiving ends is the address of the network card, that is, the MAC address.
A person's physical characteristics is the Mac, and the communication address + name is equivalent to the IP address can be further analogy, the communication address is the IP address part of the network, the name of the host number in the IP part you can go to this country today, tomorrow can go to that city, communication address (IP network address part) will change, You can also go to the police station to change the name (IP host number part), but a person's physical characteristics (MAC) will never change, plastic surgery (Modify Mac) is not in the discussion, it uniquely identifies you this person. If the mail is sent to "Shanghai X District y Street z Building m room Xiao Ming collection", the last mail delivered m room (IP network), because Xiao Ming home may more than one person (multiple devices in the same broadcast network), Courier will ask, "who called Xiaoming, you have a letter", then Xiao Ming said " I am Xiao Ming ", the Postman sent the mail to Xiao Ming's hands. Still don't see what the physical features (MAC) have played in this process? When Xiao Ming said "I am Xiao Ming" time, the postman has the "Xiao Ming" This name and Xiao Ming's human appearance features linked, so he will put the letter into the hands of Xiaoming, and did not put into the hands of other people in this family.
6, communication, data transmission process: When sending a packet: in the application layer to generate data, in the Transport layer package header: The sender and Receiver of the MAC address, the transmission to the network layer and the IP address, and then to the data Link layer plus MAC address, and then to the physical layer broken into computer-readable binary data.
When receiving a packet: the other physical layer receives binary data, the data link layer removes the Ethernet head MAC address, the network layer removes the IP, the transport layer removes the port, and then to the application data layer.
third, network based on the process
1, the DHCP server is assigned a dynamic IP address, the IP address is leased. The computer does not have the IP address before the boot, each time the assignment IP address is different. As you go to travel, today in China, tomorrow may be in the United States.
2, DNS: Domain name resolution service. For example, open the Baidu website, you can open the IP address, or more convenient to open www.baidu.com directly. (There is a point behind it, called the root domain name, usually omitted) domain name. COM called top-level domain name, Baidu called the next level domain name. However, when you enter a domain name access, you still have to convert the DNS to an IP address.
3. When you visit a Web site, DNS accesses the local DNS and cache DNS first, and if there is a direct return resolution, if not, access the root DNS.
DNS is divided into local DNS, cache DNS, and root DNS. And if you want to access root DNS, it is slow.
4, the DNS query is the UDP protocol (just send, the maximum effective transmission of data only more than 500 knots, so the root DNS server only 13) 9 units in the United States, one in Japan, 1 in Sweden, 2 in Europe.
四、三次 shook hands and waved four times
1, the application software generated data to the transport layer, after finding the receiving software, but this is not the purpose, the ultimate purpose is to communicate with it.
2, three handshake and four waves of TCP:

Three handshake at the time of communication:
A, the client first to send a request to the server, the request will play a flag bit SYN (on behalf of the client to establish a link to the server, the link is sent as a standard protocol) at the same time send Seq=x, then the server returns ACK=X+1, the consent, then the client and the server can talk. Similarly, the server sends the same request to the client, so that the server can talk to the client, so that the two-way path is established.
The SYN seq=y indicates that the server wants the client to send a conversation request, ack=x+1 that the server agrees with the client's conversation request. Ack=y+1 indicates that the client has consented to the server's dialog request. Then prepare the message through the network card to the target computer, at this time working in the application layer, in the user state, ACK x+2 indicates that the server received a message from the client, and then switch to the kernel state, sent out by the network card. So the ACK x+2 is the signal to switch the user state to the kernel state. The cache on the client is then cleared.
B, the UDP protocol just send, send after the cache (because the cache is occupied by memory), regardless of the object is not present, in case the network is broken, the other side can not receive data, it appears unreliable, so to combine the TCP protocol, TCP has to wait for the other party to confirm the receipt of the message before clearing the cache.
4 waves at the time you break the link:
A, data sent out of the link, or occupy network resources.
B, after the client data transfer, send a disconnect request (the flag bit is fin) to the server, and then the server returns an ACK acknowledgement, this line is disconnected. The same goes for server and client disconnects. It was a four-time handshake.
C, when disconnected, four times cannot be combined to 3 times. Because the client data is sent out, the data transfer of the server is not necessarily broken.

Python full stack learning record--3 (2018.1.13) Computer Basics

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.