TCP/IP protocol-Getting Started

Source: Internet
Author: User

Life was not a rehearsal

"No rehearsal in life."

reference : TCP/IP Primer Classic (fifth edition)

TCP/IP Detailed Volume One: protocol

First, what is TCP/IP

TCP/IP is a family of protocols that define network data transfer rules, and most network devices now communicate using the TCP/IP protocol

Second, TCP/IP tiering 

1. Layering

Application Layer
Transport Layer
Network layer
Data Link Layer

  

2, the main functions of each layer

Data Link layer: Processing communication cable and interface details, the network layer from the IP datagram into a frame, and then into a bit stream, so that it can be transmitted between the communication media

Network layer: Provides logical addressing capabilities to make data transfer independent of the hardware address

Transport Layer: Provides end-to-end communication for applications on two hosts, providing traffic control, error control, and acknowledgement services

Application layer: Handling Specific application details

3. Common protocols and profiles on each floor

Protocols on each layer

(I re-painted the picture on the book ...) )

Introduction to the Agreement:

TCP: Provides a reliable Transport layer service for connection-oriented

UDP: Send and receive datagrams for applications, no connection, unreliable

IP: The core protocol of the network layer, providing services such as logical addressing, routing, etc.

ICMP:IP protocol, which is used to exchange error messages and other important information with other hosts or routers

Igmp:internet Group Management protocol, used to multicast UDP datagrams to multiple hosts

ARP and RARP: Used to convert IP addresses and hardware addresses to each other

Iii. some important concepts

1, IP address: IP address is the network layer is abstracted out with a 32bit (IPv4) integer to represent the logical address, used to uniquely identify each device on the network, the commonly used notation is dotted decimal, such as: 192.168.1.1

IP Address Classification:

Range of IP addresses:

2, Physical Address (MAC address): Network device identity, the factory has been cured in the network hardware, in Ethernet using 48 bit to represent, commonly used 6 colon-delimited hexadecimal integers, such as: 00:0c:29:d2:58:6b

3, port number (port): The port number is an application for the transport layer of an identity, the transport layer through the port number to distinguish between different applications, TCP and UDP with 16bit port number to identify the application

4. Socket (socket): An address composed of an IP address and a port number, such as: 111.121.131.141.21 to Port 21st of a host with an IP address of 111.121.131.141

5, Subnet mask (mask): Similar to the IP address of the 32bit address, you can distinguish the network number and host number, to determine whether the IP address is within the same subnet

6. Domain Name System (DNS): The domain Name System is a distributed database that provides mapping information between IP addresses and host names

7, IP header of the protocol domain: in the IP header has a length of 8bit protocol domain, used to identify the datagram from the upper layer of which protocol

8, encapsulation: When the user sends data from the native application to a certain host on the network, the data will be added from the top of the protocol stack to the corresponding header (and tail), and then the link layer is converted to a bitstream sent to the transmission medium, this process is called encapsulation. The process is as follows:

9, sub-use: When the host receives data from the transmission media, the bitstream will be from the bottom of the protocol stack up, remove the corresponding header (and tail), and according to the header information sent to the specified protocol, and finally according to the port number sent to the application, the user received data, this process is called split. The process is as follows:

10. Standard documentation: About TCP/IP standards, access to RFC documents

Iv. simple description of the whole process of data transmission

Assuming now that I'm sending a copy of the data from my computer to a host, assuming I'm using the Transport layer's TCP protocol, the process would look like this:

Note: No further details are discussed here, such as IP sharding, ARP parsing, packet loss, etc.

Package: ①~④

① I prepared the data and clicked on the sending of the application, the application sends the data to the TCP protocol of the transport layer via the specified port; (application tier)

The ②TCP protocol, with the TCP header (including information such as the source port number and destination port number), is encapsulated as a TCP fragment, and the transport layer sends TCP fragments to the IP protocol of the Network layer; (Transport layer)

③IP Protocol plus IP header (including the local IP address and destination IP address and other information, has been DNS resolved) encapsulated as an IP datagram, the network layer will send IP datagram to the data link layer; (Network layer)

The ④ data link layer, plus the Ethernet header and tail, encapsulates the IP datagram as an Ethernet frame, and a more segmented sub-layer transforms the Ethernet frame into a bitstream, which is then transferred to the router on my subnet; (Data link layer)

IP Addressing and routing options: ⑤~⑥

The routers of the ⑤ subnet convert bits into Ethernet frames, and the data link layer strips the Ethernet frames from the Ethernet headers and tails and sends them to the IP layer; (Data link layer)

⑥IP layer Check the IP header of the datagram, first determine whether the destination IP address is within the same subnet according to the subnet mask: (Network layer)

If the destination IP address is within the subnet, then the router will encapsulate the datagram and send it to the designated host or router via the Data link layer

If the destination IP address is no longer within the subnet, then the router will encapsulate the datagram and send it through the data link layer to the router on the subnet where the current route is located (one layer above the network transfer), and the router continues to execute ⑤ after it receives the packet.

Divided by: ⑦~⑩

⑦ The destination host receives the bitstream, it translates to an Ethernet frame, then removes the Ethernet header and tail, and sends the IP protocol to the network layer; (Data link layer)

The ⑧IP protocol checks the IP datagram, discovers the destination IP address is the native IP address, removes the IP header and sends the TCP protocol to the transport layer according to the protocol domain; (network layer)

The ⑨ transport layer sends the data after the TCP header is removed to the specified application based on the destination port number (transport layer)

⑩ applications receive data; (Application layer)

At this point, completed a complete data transfer ~ ~

TCP/IP protocol-Getting Started

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.