9.1.2 TCP/IP

Jun 07, 2016 pm 03:31 PM
control tcp

Transmission Control Protocol/Internet Protocol; 1. TCP/IP协议介绍 TCP/IP(又称TCP/IP协议簇)是一组用于实现网络互连的通信协议,其名称来源于该协议簇中两个重要的协议(IP协议和TCP协议)。基于TCP/IP的参考模型将协议分成四个层次,它们分别是网络

Transmission Control Protocol/Internet Protocol;

1.   TCP/IP协议介绍

TCP/IP(又称TCP/IP协议簇)是一组用于实现网络互连的通信协议,其名称来源于该协议簇中两个重要的协议(IP协议和TCP协议)。基于TCP/IP的参考模型将协议分成四个层次,它们分别是网络接口层、网际互连层(IP层)、传输层(TCP层)和应用层。图17-4画出了TCP/IP模型以及该模型与OSI模型各层的对照关系。

 

9.1.2 TCP/IP

图17-4 OSI模型与TCP/IP模型对照图

①    网络接口层:网络接口层与OSI参考模型中的物理层和数据链路层相对应。

②    网际互联层:网际互联层对应于OSI参考模型的网络层,主要解决主机到主机的通信问题。该层有四个主要协议:网际协议(IP)、地址解析协议(ARP)、互联网组管理协议(IGMP)和互联网控制报文协议(ICMP)。IP协议是网际互联层最重要的协议,它提供的是一个不可靠、无连接的数据报传递服务。

③    传输层:传输层对应于OSI参考模型的传输层,为应用层实体提供端到端的通信功能。该层定义了两个主要的协议:传输控制协议(TCP)和用户数据报协议(UDP)。TCP协议提供的是一种可靠的、面向连接的数据传输服务;而UDP协议供的是不可靠的、无连接的数据传输服务。

④    应用层:应用层对应于OSI参考模型的会话层、表示层和应用层,为用户提供所需要的各种服务,例如FTP、Telnet、DNS、SMTP等。

2. OSI模型与TCP/IP模型比较说明

(1)OSI模型与TCP/IP模型比较说明

OSI引入了服务、接口、协议、分层的概念,TCP/IP借鉴了OSI的这些概念建立TCP/IP模型。OSI先有模型,后有协议,先有标准,后进行实践;而TCP/IP则相反,先有协议和应用再提出了模型,且是参照的OSI模型。OSI太复杂,TCP/IP简单却并不全面。OSI花了很长时间进行标准化,与此同时,TCP/IP已被广泛使用,已成为网络互联事实上的标准。

 

(2)OSI模型与TCP/IP模型

表17-1列出了OSI模型与TCP/IP模型的协议对照及协议说明。

表17-1 OSI模型与TCP/IP模型协议对照表

OSI中的层

功能

TCP/IP协议簇

应用层

文件传输,电子邮件,文件服务,虚拟终端

TFTP、HTTP、SNMP、FTP、SMTP、DNS、Telnet

表示层

数据格式化,代码转换,数据加密

没有协议

会话层

解除或建立与别的接点的联系

没有协议

传输层

提供端对端的接口

TCP、UDP

网络层

为数据包选择路由

IP、ICMP、OSPF、BGP、IGMP 、ARP、RARP

数据链路层

传输有地址的帧以及错误检测功能

SLIP、PPP、MTU

物理层

以二进制数据形式在物理媒体上传输数据

ISO2110、IEEE802、IEEE802.2

3. TCP/IP通信过程图

   下图17-5画出了两台主机通过TCP/IP协议的通信过程,其中应用层使用的是FTP协议。除物理层是实际传输数据的,其他对等层只是虚拟通信(所以画的是虚线),对等层一般需要遵照相同的协议。上层传输数据只与相邻上下层有关系。TCP及以下层是由操作系统内核实现,是处理通信细节。而应用层程序是通过socket编程实现的,处理的是应用程序细节。

9.1.2 TCP/IP

图17-5 TCP/IP通信过程图

 

4. TCP/IP数据包

TCP/IP数据包说明如图17-6所示。IP层传输单位是IP分组,属于点到点的传输;TCP层传输单位是TCP段,属于端到端的传输。

9.1.2 TCP/IP

图17-6 TCP/IP数据包说明图

 

     摘录自《深入浅出Linux工具与编程》


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to reset tcp/ip protocol in win10? How to reset the tcp/ip protocol stack in windows 10 How to reset tcp/ip protocol in win10? How to reset the tcp/ip protocol stack in windows 10 Mar 16, 2024 am 11:07 AM

How to reset tcp/ip protocol in win10? In fact, the method is very simple. Users can directly enter the command prompt, and then press the ctrl shift enter key combination to perform the operation, or directly execute the reset command to set it up. Let this site do the following. Let us carefully introduce to users how to reset the TCP/IP protocol stack in Windows 10. Method 1 to reset the tcp/ip protocol stack in Windows 10. Administrator permissions 1. We use the shortcut key win R to directly open the run window, then enter cmd and hold down the ctrl shift enter key combination. 2. Or we can directly search for command prompt in the start menu and right-click

How to use TCP to implement conversation between client and server in python How to use TCP to implement conversation between client and server in python May 17, 2023 pm 03:40 PM

TCP client A client sample code that uses the TCP protocol to achieve continuous dialogue: importsocket#Client configuration HOST='localhost'PORT=12345#Create a TCP socket and connect to the server client_socket=socket.socket(socket.AF_INET,socket .SOCK_STREAM)client_socket.connect((HOST,PORT))whileTrue:#Get user input message=input("Please enter the message to be sent:&

Using Netty4 for TCP communication in Java API development Using Netty4 for TCP communication in Java API development Jun 17, 2023 pm 11:18 PM

TCP is a type of computer network communication protocol and a connection-oriented transmission protocol. In Java application development, TCP communication is widely used in various scenarios, such as data transmission between client and server, real-time transmission of audio and video, etc. Netty4 is a high-performance, highly scalable, and high-performance network programming framework that can optimize the data exchange process between the server and the client to make it more efficient and reliable. The specific implementation steps of using Netty4 for TCP communication are as follows: Introduction

See you soon! TCP waves twice, have you seen it? What about the four handshakes? See you soon! TCP waves twice, have you seen it? What about the four handshakes? Jul 24, 2023 pm 05:18 PM

The "connection-oriented" mentioned here means that you need to establish a connection, use the connection, and release the connection. Establishing a connection refers to the well-known TCP three-way handshake. When using a connection, data is transmitted in the form of one send and one confirmation. There is also the release of the connection, which is our common TCP four wave waves.

Linux SIGPIPE signal Linux SIGPIPE signal Feb 19, 2024 pm 04:00 PM

Among the TCP communication parties, for the convenience of description, the communication parties are replaced by A and B in the following. According to the TCP protocol, if B continues to send data after A closes the connection, B will receive A's RST response. If B continues to send data, the system will send a SIGPIPE signal to inform that the connection has been disconnected and stop sending. The system's default processing behavior for the SIGPIPE signal is to let process B exit. The default processing behavior of the operating system for the SIGPIPE signal is very unfriendly. Let us analyze it. TCP communication is a full-duplex channel, which is equivalent to two simplex channels, and each end of the connection is responsible for one. When the opposite end "closes", although the intention is to close the entire two channels, the local end only receives the FIN packet. According to the provisions of the TCP protocol, when a

How to send multiple files using a single TCP connection in Java? How to send multiple files using a single TCP connection in Java? Apr 27, 2023 am 08:49 AM

Why is there this blog about using one TCP connection to send multiple files? I have been reading some related things recently. There is no problem in simply using Socket for programming, but this only establishes some basic concepts. Still nothing can be done about the real problem. When I need to transfer files, I find that I seem to have just sent the data (binary data), but some information about the file is lost (the file extension). And each time I can only use one Socket to send one file, there is no way to send files continuously (because I rely on closing the stream to complete sending files, which means that I actually don’t know the length of the file, so I can only send files as one Socket connection represents a file).

What is the difference between tcp and ip What is the difference between tcp and ip Sep 04, 2023 pm 02:19 PM

TCP and IP are two different protocols in the Internet: 1. TCP is a transport layer protocol, while IP is a network layer protocol; 2. TCP provides functions such as segmentation, sorting, confirmation and retransmission of data packets. , and the IP protocol is responsible for providing source and destination addresses for data packets; 3. TCP is a connection-oriented protocol, while the IP protocol is connectionless; 4. TCP also provides flow control and congestion control.

The interviewer asked: How many HTTP requests can a TCP connection send? The interviewer asked: How many HTTP requests can a TCP connection send? Feb 22, 2023 pm 12:00 PM

There was once such a classic interview question: What happens in the process from the URL being entered in the browser to the page being displayed? I believe that most students who have prepared can answer it, but if you continue to ask: If the received HTML contains dozens of image tags, in what way, in what order, how many connections are established, and what protocol are used to download these images? What about?

See all articles