I. OSI model
SI model is mainly used as a general model for theoretical analysis, while TCP/IP protocol model is the actual communication protocol of the Internet. The two are generally used for mapping analysis, and the following is not strictly distinguished and declared.
The OSI model layer has three main layers:
|… The host… | operating systems and software applications such as, say, the session
|… Network… | Internet network and related transmission protocol, the network (TCP/IP)
|… Medium… | related data link, physical physical medium
Model diagram:
1, the host needs to network transmission data, network is essentially a service, between the host and the network by the transmission layer interface, just like you want to call express send things;
2. The network can provide two kinds of services:
- TCP’s reliability is resource-intensive and inefficient (large chunks, important files, etc.)
- UDP does not guarantee reliability, but high efficiency (video, voice, unimportant small files, etc.)
3, HTTP used to achieve hypertext transfer, FTP file transfer, SMTP mail processing
TCP, UDP and IP protocols are the basis of Internet communication. It is like the Constitution and the application of agreements is like the specific criminal law, civil law, marriage Law, and Minor Protection law...... And so on, in a certain field of specific application and specific implementation, but the most basic one: unconstitutional invalid.Copy the code
The difference between TCP and HTTP
TCP/IP is a transport layer protocol that deals with how data is transferred over the network.
HTTP is an application-layer protocol that deals with how to wrap data.
The relationship between TCP/IP and HTTP: The WEB uses HTTP as an application-layer protocol to encapsulate HTTP text information, and then uses TCP/IP as a transport layer protocol to send it to the network.
TCP/IP stands for Transmission Control Protocol/Internet Protocol, which refers to a series of protocols;
“IP” stands for the Internet protocol used by TCP and UDP to send packets from one network to another
Think of IP as a kind of highway that allows other protocols to travel on and find exits to other computers. TCP and UDP are the “trucks” on the highway, carrying the cargo of protocols like HTTP, FILE transfer protocol FTP, etc.
HTTP(Hypertext Transfer Protocol) is a protocol that uses TCP to transfer information between two computers, typically a Web server and a client. The client sends an HTTP request to the Web server using a Web browser, and the Web server sends the requested information to the client.
TCP,UDP, and HTTP application scenarios
Socket
Realize the physical connection between the server and the client, and data transmission. There are two protocols: TCP and UDP. Sockets are at the transport layer of network protocols.
TCP
Transmission control protocol, connection-oriented protocol, stable and reliable. Before the client and server exchange data, a TCP connection must be established between them before data can be transmitted.
UDP
For broadcast data transmission, UDP does not provide reliability. It simply sends datagrams from applications to the IP layer, but does not guarantee that they will reach their destination. UDP does not need to establish a connection between the client and the server before transmitting data packets, and there is no timeout retransmission mechanism, so the transmission speed is very fast.
Http
HTTP requests include HTTP, SOAP based on HTTP. Common HTTP data requests include GET, POST, and Web services