TCP/IP protocol stack

Source: Internet
Author: User
Tags file transfer protocol

The TCP/IP protocol is actually a set of protocols, including many protocols, which constitute the TCP/IP protocol stack. But the Transmission Control Protocol (TCP) and the Internet Protocol (IP) are the most important of them, ensuring the complete data transmission of the two Protocols.
The basic transmission unit of the TCP/IP protocol is data packets. The TCP/IP protocol is responsible for dividing data into several data packets, adding a packet header to each data packet, and adding the address of the receiving end to the packet header of each data packet. If data loss or data distortion occurs during transmission, the TCP/IP protocol automatically requires data to be re-transmitted and regrouped.
The IP protocol ensures data transmission, and the TCP protocol ensures the quality of data transmission.
1. Data Link Layer of TCP/IP
The data link layer is not part of the TCP/IP protocol, but it is the interface between various communication networks and TCP/IP on which TCP/IP depends, these communication networks include multiple WAN networks, such as arpanft, MILNET, and X.25 public data networks, as well as various LAN networks, such as Ethernet and IEEE Standard LAN. The IP layer provides special functions to resolve physical address translation with various networks.
Generally, each physical network can use its own data link layer protocol and Physical Layer Protocol, without the need to set up a dedicated TCP/IP protocol on the data link layer. However, when you use a serial line to connect a host to a network or to a network, for example, when you use a telephone line or modem to connect or two networks that are far away from each other through a data leased line, you need to run the dedicated slip (Serial Line IP) protocol PPP (Point to Point Protocal) Protocol on the data link layer.
1. Slip Protocol
Slip provides a simple method to encapsulate IP groups on a serial communication line. It allows remote users to easily access TCP/IP networks through telephone lines and modem.
Slip is a simple frame group method, which also has some problems. First, slip does not support dynamic IP Address allocation during the connection process. Both parties must inform the other party of the IP address in advance, which makes it inconvenient for individual users without fixed IP addresses to access the Internet, there is no protocol type field in the slip frame, so it can only support IP protocol; moreover, the slip Frame Column validation field, so the link layer cannot detect transmission errors, transmission errors must be solved by upper-layer entities or modem with error correction capabilities.
2. PPP protocol
To solve the problems of slip, a PPP protocol was developed in the serial communication application. The PPP protocol is an effective point-to-point communication protocol, which is composed of frames on the serial communication line, the Link Control Protocol LCP for establishing, preparing, testing, and removing data links and a group of network control protocols NCPs used to support different network layer protocols.
Because verification fields are set in PPP frames, PPP has the error check function on the link layer. The LCP protocol in PPP provides a means for both parties to negotiate parameters, and provides a set of NCPs protocols, so that PPP can support multiple network layer protocols, such as IP, IPX, and OSI. In addition, the NCP that supports IP addresses provides the ability to dynamically allocate IP addresses when establishing connections, solving the Internet problems for individual users.
Ii. TCP/IP Network Layer
The network layer includes four important protocols: Internet Protocol IP, Internet Protocol ICMP, address translation protocol ARP, and reverse address translation protocol RARP.
The functions of the network layer are mainly provided by IP addresses. In addition to the end-to-end grouping and distribution function, IP addresses also provide many expansion functions. For example, in order to overcome the frame size restrictions on the data link layer, the network layer provides data partitioning and restructuring functions, which enables large IP data packets to be transmitted on the Internet through small groups.
Another important service at the network layer is to establish an interconnected network on an independent LAN, that is, the Internet. Packets transmitted between networks are transmitted to another network through a vro based on its destination IP address.
1. Internet Protocol IP)
The most important protocol at the network layer is the IP address. It connects multiple networks into one Internet connection, which can distribute high-level data in the form of multiple data packets through the Internet.
The basic task of an IP address is to send a datagram over the Internet. Each IP address datagram is independent of each other. The IP layer on the host provides services to the transport layer. The IP address obtains data from the source shipping object and passes it to the IP layer of the target host through its data link layer service. The IP address does not guarantee service reliability. When the host resources are insufficient, it may discard some data packets, and the IP address does not check the packets discarded by the data link layer.
During transmission, the high-level protocol transmits data to an IP address, and the IP address then encapsulates the data as an Internet datagram, and delivers the data to the data link layer protocol for transmission over a LAN. If the destination host is directly connected to the local network, the IP address can directly send the datagram to the destination host. If the destination host is far away from the network, the IP router transmits the datagram, the vro transmits the data packets to the target host or the next vro in turn through the next network. That is, an IP datagram is transmitted from one IP module to another through the interconnected network until the end point.
A router that needs to connect to a separately managed network can select any protocol it needs. Such a protocol is called the Inter-Intranet connector protocol IGP (interior gateway protocol ). In an IP environment, an independent management system is called an autonomous system.
The protocol used by routers that span different management domains (such as from the private network to the pdn) is called the external network connector protocol EGP (exterior gateway protocol ), EGP is a set of simple and well-defined formal protocols.
2. Interconnectivity Control Packet protocol ICMP
From the functions of IP connection protocol, we can know that IP provides an unreliable packet Group Transfer Service that cannot receive packets. If the network is blocked due to a router failure, you need to notify the sending host to take corresponding measures.
To enable the Internet connection to report errors or provide unexpected information, a special packet mechanism is added to the IP layer, that is, the Internet Control Packet protocol ICMP.
The Group receiver uses ICMP to notify the sender of the IP module of certain changes. ICMP is usually generated by a station that finds a message from another station that has a problem. For example, the destination host or relay router can discover the problem and generate the relevant ICMP. If a group cannot be transmitted, ICMP can be used to warn the group Source, indicating that the network, host, or port is inaccessible. ICMP can also be used to report network congestion. ICMP is part of the formal IP protocol. ICMP data is sent by IP. Therefore, it is functionally the third layer of the network, but it is actually encoded like layer-4 Protocol-1.
3. address translation protocol ARP
In a TCP/IP network, each host is assigned a 32-bit IP address, which is a logical address that identifies the host internationally. In order for packets to be transmitted over the physical network, the physical addresses of each other must be known. In this way, there is a problem of converting an Internet address to a physical address. Taking the Ethernet environment as an example, in order to correctly transmit packets to the destination site, the 32-bit IP address of the destination site must be converted to the 48-bit Ethernet destination IP address da. In this case, a group of services at the network layer need to convert the IP address to the corresponding physical network address, which is arp.
When sending a packet, if the source network layer only sends the packet to an IP address but does not have the corresponding ethernet address, the network layer broadcasts the ARP request to obtain the destination site information, the target station must answer the ARP request. In this way, the origin site can receive a 48-bit ethernet address and put the address in the corresponding cache ). The address content in the cache can be directly referenced in the next address translation from the source site to the same target site. Address translation protocol ARP allows the host to find the physical address of any physical host in the same physical network. You only need to provide the IP address of the target host. In this way, the physical address of the network can be transparent to the network layer services.
In the Internet environment, in order to send packets to the host of another network, the datagram first directs the network IP router of the sender. Therefore, the sender must first determine the physical address of the router and then send the data to the receiver in sequence. In addition to the basic ARP mechanism, you also need to set proxy arp on the vroarp to replace the destination station with the IP router to respond to the sender's ARP request.
4. Reverse address translation protocol RARP
The reverse address translation protocol is used in a special case. If a site has its own physical address but no IP address after initialization, it can send a broadcast request through the RARP protocol to solicit its own IP address, the RARP server is responsible for answering. In this way, a site without an IP address can obtain its own IP address through the RARP protocol. This address is valid before the next system restart and does not require continuous broadcast requests. RARP is widely used to obtain the IP address of a diskless workstation.
Iii. TCP/IP Transport Layer
TCP/IP provides two main protocols at this layer: Transmission Control Protocol (TCP) and user data protocol (UDP). In addition, there are some other protocols, for example, the NVP protocol used to transmit digital speech.
1. Transmission Control Protocol TCP
TCP provides a reliable data stream service. When the transmission of data that is subject to error interference, basic network faults, or heavy network loads make the Internet basic transmission system (without connecting packets to the system) unable to work normally, other protocols are required to ensure reliable communication. TCP is such a protocol, which corresponds to the transport layer of the OSI model. It provides end-to-end connection-oriented reliable transmission based on the IP protocol.
TCP adopts the "positive validation with retransmission" technology to achieve transmission reliability. A simple "positive confirmation with retransmission" refers to the receiver that communicates with the sender. Each time data is received, a confirmation message is sent back, and the sender keeps a record for each sent message, the next packet group will be sent after confirmation is received. When the sender sends a packet group, a timer is started. If the timer count is complete and it is confirmed that it has not arrived, the sender resends the packet group.
Simply confirming that retransmission is a serious waste of bandwidth, TCP also uses a traffic control mechanism called "Sliding Window" to improve the network throughput, the window range determines the number of datagram sent by the sender but not confirmed by the receiver. The window slides forward whenever the recipient receives a message correctly. This increases the number of unconfirmed data packets in the network and increases the network throughput.
TCP communication is established on the basis of connection-oriented, and implements a "virtual circuit" concept. Before communication between the two parties, establish a connection, and then the two parties can send data streams on it. This data exchange method can improve efficiency, but the overhead is required to establish connections in advance and remove connections afterwards. Three handshakes are used to establish a TCP connection. The whole process consists of three processes: the sender requests the connection, and the receiver sends another confirmation about the confirmation.
2. User Datagram Protocol UDP
The User Datagram Protocol is an extension of the IP protocol group. It adds a mechanism by which the sender can distinguish multiple receivers on a computer. In addition to the data sent by a user process, each UDP packet also contains the number of the destination port of the packet and the number of the source port of the packet, so that UDP can be expanded, this makes it possible to deliver data packets between two user processes.
UDP relies on the IP protocol to transmit packets, so its services are not reliable like IP addresses. This service does not require confirmation, sorting of packets, or throttling. UDP packets can be lost, duplicated, or out of order on the right.
4. TCP/IP application layer
The upper layer of TCP/IP differs greatly from the OSI reference model, and there is no clear hierarchy. FTP, telnet, SMTP, and DNS protocols are widely implemented on different models, and many other high-level protocols are defined in TCP/IP.
1. File Transfer Protocol FTP
The file transfer protocol is a protocol provided by the Internet for accessing remote machines. It allows users to perform file operations between local machines and remote machines. When FTP is working, two TCP connections are established, one for transferring files and the other for transfer control.
FTP adopts the Client/Server mode, which includes the client ftp and Server FTP. The client initiates the transfer process through FTP, and the server responds to the request. Most FTP users have an interactive interface. users with the right to use FTP can flexibly transfer files to or retrieve files from afar.
2. Remote Terminal Access Telnet
A telnet connection is a TCP connection used to transmit data with telnet control information. It provides a standard method for interaction with terminal devices or terminal processes, and supports connection from terminals to terminals and communication from processes to distributed computing.
3. DNS
DNS is a Domain Name Service protocol that provides domain name-to-IP address conversion and allows decentralized management of domain name resources. DNS was originally designed to enable the mail sender to know the IP addresses of the mail receiving host and mail sending host, and then developed into a protocol that can serve many other targets.
4. Simple Mail Transfer Protocol SMTP
In Internet standard, email is a single file-based protocol for reliable and effective data transmission. SMTP, as a service at the application layer, does not care about what transmission service is used below. It may send mail over a TCP connection over the network, or simply send emails between processes on the same machine through the process communication channel. In this way, mail Transmission is independent of the transmission subsystem and can transmit mail in the TCP/IP environment, the OSI transport layer, or the X.25 protocol environment.
Before sending an email, you must negotiate the sender and receiver. When the SMTP service process agrees to send mail to a basic receiver, it directly delivers the mail to the receiver user or routes the mail one by one through the network connector until the mail is sent to the receiver user. During the mail transmission, the route is recorded. In this way, you can find the sender based on the original route when the email cannot be transmitted normally.

TCP/IP protocol stack

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.