Python Learning note __16.1 Introduction to network programming--TCP/IP

Source: Internet
Author: User

# This is a learning note for the Liaoche teacher Python tutorial


1 , overview

    1) In order to connect the computer, the communication protocol must be stipulated. In order to connect all the different types of computers in the world, it is necessary to stipulate a set of global protocols, in order to achieve the goal of the Internet, Internet Protocol cluster (Internet Protocol Suite) is the Universal protocol standard, With the Internet, any private network, as long as it supports this protocol, can be connected to the Internet.

    2) because the Internet Protocol contains hundreds of protocol standards, but The most important two protocols are TCP and IP protocols, so everyone puts the Internet protocol short for the TCP/IP protocol.

    3) The unique identifier of each computer on the Internet is the IP address, similar to 123.123.123.123. If a machine is connected to two or more networks, such as a router, it will have two or more IP addresses, sotheIP address is actually the computer's network interface, usually the NIC .

    4) The IP protocol is responsible for sending data from one computer to another on the network. The data is split into a small piece and then sent out via IP packets. Because of the complexity of the Internet link, there are often multiple lines between the two computers, so the router is responsible for deciding how to forward an IP packet. The IP packet is characterized by the number of routes sent by the block, but not guaranteed to arrive, and not guaranteed in order .

    5) The IP address is actually a 32-bit integer (called IPv4), and the IP address represented by the string, such as 192.168.0.1, actually represents a 32-bit integer grouped by 8 digits, for readability.

    6) The IPV6 address is actually a 128-bit integer, which is an upgraded version of the IPV4 currently in use, with a string representation similar to 2001:0db8:85a3:0042:1000:8a2e:0370:7334.

    7) The TCP protocol is based on the IP protocol. The TCP protocol is responsible for establishing a reliable connection between two computers to ensure that packets arrive sequentially. The TCP co-assembly establishes the connection by shaking hands, then numbering each IP packet, ensuring that the other party receives it sequentially, and automatically re-sends if the package is lost.

    8) Many of the more advanced protocols are based on the TCP protocol, such as the HTTP protocol for the browser, the SMTP protocol for sending mail, and so on.

    9) A TCP message contains both the source and destination IP addresses, the source and destination ports, in addition to the data to be transmitted.

    10) What role does the port have? When communicating with two computers, it is not enough to send only the IP address because there are multiple network programs running on the same computer. After a TCP message comes, whether it is to the browser or QQ, you need a port number to differentiate. Each Network program requests a unique port number for the operating system, so that two processes that establish a network connection between the two computers require their respective IP addresses and their respective port numbers .

    11) A process may also establish links to multiple computers at the same time, so it will request many ports.



Python Learning note __16.1 Introduction to network programming--TCP/IP

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.