Python basics------The Python-based socket programming

Source: Internet
Author: User

Introduction of C/S architecture and B/S architecture

Slightly

Ii. OSI seven-layer model

Slightly

Third, Socket Layer

1.:

    

The socket layer is a layer that is directly abstracted from the application layer and the transport layer.

2. What is the socket layer?

   A socket is an intermediate software abstraction layer that the application layer communicates with the TCP/IP protocol family, which is a set of interfaces. In design mode, thesocket is actually a façade mode, it is the complex TCP/IP protocol family hidden behind the socket interface, for the user, a set of simple interface is all, let the socket to organize data to meet the specified protocol. So, we do not need to understand the TCP/UDP protocol, the socket has been packaged for us, we only need to follow the socket rules to program, write the program is naturally follow the TCP/UDP standard.

Iv. sockets

1. What is a socket?

The combination of the source IP address and destination IP address and the source port number and destination port number is called a socket. The servers and services that are used to identify client requests.

It is an abstract representation of the endpoint in the network communication process, including the five kinds of information necessary for network communication: The protocol used by the connection, the IP address of the local host, the protocol port of the local process, the IP address of the remote host, the protocol port of the remote process.

2, why will there be sockets?

When the application layer communicates data through the transport layer, TCP and UDP encounter problems that simultaneously provide concurrent services for multiple application processes. Multiple TCP connections or multiple application processes may require data to be transmitted over the same TCP protocol port. To differentiate between different application processes and connections, many computer operating systems provide an interface called socket (socket) for applications interacting with the TCP/IP protocol, differentiating network traffic and connections between different application processes.

3. How Sockets work:

    

Python Basics------The python base socket programming

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.