A simple explanation of the TCP/IP Model

Source: Internet
Author: User
Tags ftp protocol

Memo:

1. The initial purpose of network protocol design is to transmit text.

2. layer-4 forms the Internet

3. The transmission process is as follows:

--------------------------------------------

From http://www.ruanyifeng.com/blog/2009/03/tcp-ip_model.html

 

 

The TCP/IP model is the foundation of the Internet.

To understand the internet, you must understand this model. However, I have never understood it.

A few days ago, betterexplained wrote an article about this model. I suddenly realized that I understood the overall Internet architecture for the first time.

Next, I will explain how the Internet was built based on my own understanding. If not, please correct me.

What is the TCP/IP model?

The TCP/IP model is a general term for a series of network protocols. These protocols aim to enable information exchange between computers.

The so-called "protocol" can be understood as the language in which machines talk. Each protocol has its own purpose. The TCP/IP model consists of hundreds of protocols that regulate all aspects of information exchange on the Internet.

Layer-4 Structure of TCP/IP Model

These protocols can be roughly divided into four layers. The previous layer of protocols are based on the following protocols. As shown in the figure below:

The bottom-to-top layers are link layer, Internet layer, transport layer, and application layer ).

They can be understood as follows:

1) The Connection layer is responsible for establishingCircuit connectionIs the physical basis of the entire network. Typical protocols include Ethernet and ADSL;

2) the network layer allocates addresses and transfersBinary dataThe main protocol is the IP protocol;

3) transport layer is responsible for TransmissionText DataThe main protocol is TCP;

4) the application layer is responsible for transmitting variousFinal form dataIs a layer that deals directly with users. Typical protocols include HTTP and FTP.

The key to understanding this structure is to understand the original purpose of scientists designing the Internet in 1970s, that is, to transmit text. All protocols were originally designed for this purpose, and the core of the Internet architecture was text dialogs.

Instance: use Telnet to create an HTTP conversation

To observe how text is transmitted over the Internet, let's do a small experiment.

Step 1: click "run" in the "Start" menu and enter "Telnet Google.com 80 ".

The Telnet command is an application layer protocol. It is used to establish a TCP connection between two hosts, that is, to open a channel for text transmission between the two hosts.

"Telnet Google.com 80" indicates creating a text transmission channel between the local machine and Google.com on port 80. The so-called "Port" is actually a parameter of the TCP protocol, used to help the TCP protocol determine the text sent from the other host, which application layer protocol is used in the end. Port 80 is the port of the HTTP protocol. For a list of common ports, refer to here.

In addition, unlike Windows 2000 and Windows XP, Vista does not have a Telnet client installed by default. You can refer to the installation instructions of Microsoft. If you are using a Linux system, you can directly enter the preceding command in the command line window.

Step 2: Enable local display.(Skip this step for non-Windows systems .)

Follow these steps: Press "Ctrl +]" in the Telnet window, enter the "set localecho" command, and press the Enter key twice in a row.

Now, you can directly talk to The Google.com host.

Step 3: You can try to talk to Google casually to see how it works.

I entered "Hello World !".

As a result, Google's answer is as follows:

"400 bad request" indicates that Google cannot read your speech. This is not surprising, because at this time you are in the TCP text channel, HTTP conversation. Therefore, your speech must comply with the HTTP protocol so that Google can understand it.

Step 4: Enter "Get/HTTP/1.1" to ask Google for the homepage root file. The protocol used is HTTP 1.1.

Google's response is as follows:

"200 OK" indicates that the data is required to be successful. Below the header information is the source code of the homepage file displayed by Google in the browser.

Summary

In the preceding example, the HTTP protocol is used. To use another "application layer protocol" to communicate with the host, you only need to change the port. For example, "Telnet ftp.website.com 21" indicates that the FTP protocol is used for dialog.

The underlying protocols of all these dialogs are TCP because they are responsible for text transmission. TCP must rely on the IP protocol to transmit binary data, it is inseparable from the underlying physical protocol responsible for network connection.

Therefore, the layer-4 network architecture enables communication across the Internet.

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.