Hypertext Transfer Protocol

Network Performance

Latency(Propagation time; Transmission time)

Data Transfer Rate(Bandwidth)

Retransmission(Dropped packets)

Under Light Traffic

Message Length Message Transmission Time = Latency +Message Length/Bandwidth

OSI reference Model

Application:HTTP, SMTP, POP, IMAP, FTP, VOIP JSON, XML, ASN.1, MIME

Presentation:JSON, XML, ASN.1, MIME

Session:SSL

Transport:IP, X.25

Network:IP, X.25

Data Link:Ethernet MAC, PPP

Physical:USB, Bluetooth, 1000BaseT

IP stack

middleware=presentation+session

Internet Protocol (IP)
• A set of protocols for the interconnection of many LANs and WANs that make up the Internet
• IPv4 and IPv6 (network layer)

IP Transport Layer Protocols
• Transmission Control Protocol (TCP)
– Connection-oriented
– Full duplex
– Reliable and in-order
– Flow and congestion control
• User Datagram Protocol (UDP)
– Connectionless
– Packets may arrive out of sequence – Corrupt data are dropped

Application Layer Protocols
Request Protocols
Request-Reply Protocols
Request-Reply-Acknowledge Protocols

In a networked system a client is considered to be a requester of some service and a server is the provider of a service.

A protocol used at the application layer for communication between a client and a server is typically layered on top of either TCP or UDP and is sometimes classified into one of three types:
Request protocol where a single request is made from the client to the server, used when the client does not require a response and no confirmation is required.

If UDP is used then there is no guarantee that the request has actually been received by the server. Request-Reply protocol where a request is made from the client to the server, prompting the server to perform some function and return an appropriate reply. Often this communication is implemented over TCP but can be more efficiently implemented over UDP as the reply itself provides a confirmation to the client that the server received the request, and if the client does not receive a response within a reasonable time then it can just send another request. For efficiency the server might cache responses in case it receives a request multiple times from a client.

Request-Reply-Acknowledge protocol which is similar to a request-reply protocol but where after receiving a reply the client confirms its receipt by sending an acknowledgement message to the server. When the server receives the acknowledgement it can clear its cache.

The request-reply protocol is the most common type of protocol for client-server communication. The Hypertext Transfer Protocol (HTTP) is an important and very common request-reply protocol implemented over TCP that is used for communication with web servers. In HTTP version 1.0 a client initiates a TCP connection to a server, typically on port 80, sends a request message to the server, which sends back a response, and then the connection is closed.

As HTTP clients are frequently browsers that must make a request for each resource in a web page (such as for each image in the page), HTTP 1.1 allows the connection to remain alive for a series of further request-reply exchanges, avoiding the overhead of reestablishing a connection for each request.
An HTTP request is an ASCII text string that starts with an HTTP method name, followed by the URL of a resource on the server, the version of HTTP used (such as HTTP/1.1), some headers (containing information such as acceptable data formats and whether to keep the connection alive), and an optional message body containing data. Method names supported by HTTP include:

GET which requests the server to retrieve the specified resource, such as data or
the output of a program,
HEAD which is the same as GET but only information about the resource is re- trieved, such as when it was last modified,
POST which is similar to GET but can be more suitable for passing data with the request,
PUT which requests the server to store the data in the request at the specified URL (this operation might not be allowed by the server),
DELETE which requests the server to delete the resource at the specified URL (this operation might not be allowed by the server),
OPTIONS which requests the server to respond with a list of the method names that it allows to be applied to the resource at the specified URL,
TRACE which requests the server to echo back the request message (used for testing).
An HTTP response from the server to a client starts with the version of HTTP, a three-digit status code (such as 200 for okay, 400 for bad request, or 404 for resource not found), a corresponding text reason, some headers (containing information about the server and resource such as its MIME content type and length), and an optional message body (which might contain data such as the resource for a GET or POST request).
The class EchoWebServer slightly modifies the approach of EchoServer from Section 1.2. Instead of replying with an exact copy of a TCP request it treats it as an HTTP request and sends an HTTP reply containing the request in the message body as an HTML page. Although at first this might appear strange, it is very common for web servers to send HTTP replies containing HTML pages so that the response can be viewed by a browser.
Testing the class EchoWebServer with a Firefox browser (using the URL http://localhost:8080/) results in the following web page being displayed:
EchoWebServer Response

Cookies

If a client allows cookies (small pieces of text data) to be stored, then the server can create a cookie containing a unique ID for each clien, which it sends to the client as part of its first response, and which the client includes with any further requests. These cookies can be read by the server whenever it needs to distinguish between clients (such as when items are added to a shopping cart or an on-line payment is made. The ID stored in each cookie is typically used to look up session information for that client in a hash table.
URL-rewriting Any URL that is returned to a client has extra information appended to it by the server in order to identify that client, such as:
<FORM ACTION=
"http://localhost:8080/Whatever;mysessionid=123">
...
</FORM>
This information can be extracted from the next GET or POST request that
is made when the form data is submitted.
Hidden form fields A form that has been passed back to a client contains a hidden input holding information to identify the client:
firstname=Joe&lastname=Bloggs&Fire=fire

The hidden input does not appear when the web page is displayed, but its name and value is included when the form is submitted.
Server programs are extensively used as web servers in both the Internet and organization intranets for processing web page form submissions and providing HTTP replies containing HTML suitable for presentation in a web browser. Such programs are called common gateway interface (CGI) programs.

原文地址:https://www.cnblogs.com/hahaccy/p/10703758.html

时间: 2024-10-16 21:31:33

Hypertext Transfer Protocol的相关文章

HTTP协议(HyperText Transfer Protocol,超文本传输协议)

HTTP协议(HyperText Transfer Protocol,超文本传输协议)是因特网上应用最为广泛的一种网络传输协议,所有的WWW文件都必须遵守这个标准.HTTP是一个基于TCP/IP通信协议来传递数据(HTML 文件, 图片文件, 查询结果等).:::::::::::::::::::::::::::::::::::::::::::::::::::::HTTP 简介http:/ /www.iis7.com/b/plc/HTTP协议是Hyper Text Transfer Protoco

Telnet协议,SSH协议(安全外壳协议),SSL协议(安全套接层协议),HTTPS(Hypertext Transfer Protocol Secure)安全超文本传输协议

2.Telnet协议 Telnet协议是TCP/IP协议族中的一员,是Internet远程登陆服务的标准协议和主要方式.它为用户提供了在本地计算机上完成远程主机工作的能力.在终端使用者的电脑上使用telnet程序(如putty),用它连接到服务器.终端使用者可以在telnet程序中输入命令,这些命令会在服务器上运行,就像直接在服务器的控制台上输入一样.可以在本地就能控制服务器.要开始一个telnet会话,必须输入用户名和密码来登录服务器.Telnet是常用的远程控制Web服务器的方法. 3.SS

Simple Mail Transfer Protocol

https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol https://zh.wikipedia.org/wiki/简单邮件传输协议 Simple Mail Transfer Protocol (SMTP) is an Internet standard for electronic mail (email) transmission. First defined by RFC 821 in 1982, it was last up

FTP(File Transfer Protocol)是什么?

文件传输协议 FTP(File Transfer Protocol),是文件传输协议的简称.用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(Application).用户可以通过它把自己的PC机与世界各地所有运行FTP协议的服务器相连,访问服务器上的大量程序和信息.[编辑本段]FTP的作用 正如其名所示:FTP的主要作用,就是让用户连接上一个远程计算机(这些计算机上运行着FTP服务器程序)察看远程计算机有哪些文件,然后把文件从远程计算机上拷到本地计算机,或把本地计算机的文件

基于TCP的TFTP(Trivial File Transfer Protocol,简单文件传输协议) 的c编程实现

我们或许都听到过,TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂.开销不大的文件传输服务. 本文就简单的叙述下tftp的小文件传输功能以及客户端对服务器的列表功能. 之前就一直很纳闷,我们经常在网上下载什么东西或者从别处传输一个文件,具体是怎么实现的呢?于是乎,翻查一些资料,加上自己对网络编程的逐步加深,所以功夫不负有心人,还算是大致的完成了下. 本例程实现的功能呢?

FTP - File Transfer Protocol

1 FTP - File Transfer Protocol 2 FTP 实际上使用了两个 TCP 链接. 一个作为控制信道用, 主要传输一些指令和响应, 3 比如 ACK 或 错误码. 另一个链接是数据信道, 用来传输文件和一些诸如目录列表的 4 信息等. 5 6 from ftplib import FTP, all_errors 7 FtpServerAddr = '' 8 user = '' 9 PW = '' 10 acct = '' 11 12 FH = FTP(FtpServerA

Trivial File Transfer Protocol (TFTP)

Assignment 2The Trivial File Transfer Protocol (TFTP) is an Internet software utility fortransferring files that is simpler to use than the File Transfer Protocol (FTP) butless capable. It is used where user authentication and directory visibility ar

HTTP-----HyperText Transfer Protocol超文本传输协议

http/0.9:仅纯文本(超链接),ASCII HTML:HyperText Mark Language URI:Uniform Resource Idetnifier,统一资源标识符 统一:路径格式上的统一 URL:Uniform Resource Locator   统一资源定位符 protocol://Host:Port/path/to/file HTTP方法:获取web资源/对象的方法 http/0.9: GET http/1.0: PUT, POST, DELETE, HEAD ht

MTP(Media Transfer Protocol(媒体传输协议))简介

---恢复内容开始--- 1,简单说明 MTP,微软公司规定的新的传输规则(字面本来应该是协议的,但是自己感觉更像是规则,制定了基本上的所有路线,剩下的是你想怎么选择罢了,使用者完全没有可能在它的框架里面再生成其他的东西).MTP不但应用在USB(以USB端口传输数据的设备)方面,还应用在IP方面.不过主要还是在USB设备方面.现在很多手机都支持. 2,基本的工作原理 关于MTP的文档,我会在参考文件处列出.仅供大家参考. MTP协议本身,规定了USB设备的所有信息,文件读取方式,传输方式,读取