Computer Networks: TCP transport layer and application layer HTTP

Foreword

      In this two-day review of the relevant knowledge of computer networks, see tcp time to react, I was confused in the end how much the concept of ah.

1. The seven-layer model

        Pictures from Baidu

              

Seven layer model is the International Organization for Standardization (ISO) proposed, there are five, four, but are changed on the basis of the seven, we look at the seven.

2. Level Agreements

Network layer: IP protocol, ICMP protocol, ARP protocol, RARP protocol, and BOOTP.

Transport Layer: TCP protocol and the UDP protocol

Application Layer: FTP, HTTP, TELNET, SMTP, DNS and other protocols

Link layer: ARP, RARP

Above, tcp, udp protocol belonging to the transport layer, and I always thought of http and tcp is with a completely different level.

I do not know why I put things learned are forgotten, can only say that the work is too easy now, something too simple contact.

  HTTP ((Hypertext Transfer Protocol))

            HTTP is an application layer protocol, using the TCP protocol in the transport layer, IP at the network layer.

            Clients use a Web browser sends an HTTP request to the Web server, Web server sends the requested information to the client. After the request, will take the initiative to release the connection

            http is based on the tcp

    HTTP协议是建立在请求/响应模型上的。
首先由客户建立一条与服务器的TCP链接,
并发送一个请求到服务器,
请求中包含请求方法、URL、协议版本以及
相关的MIME样式的消息。服务器响应一个状态行,
包含消息的协议版本、一个成功和失败码以及相关的MIME式样的消息。
    HTTP/1.0为每一次HTTP的请求/响应建立一条新的TCP链接,
因此一个包含HTML内容和图片的页面将需要建立多次的短期的TCP链接。
一次TCP链接的建立将需要3次握手。
    另外,为了获得适当的传输速度,则需要TCP花费额外的回路链接时间(RTT)。每一次链接的建立需要这种经常性的开销,而其并不带有实际有用的数据,只是保证链接的可靠性,因此HTTP/1.1(Connection:keep-alive)提出了可持续链接的实现方法。
HTTP/1.1将只建立一次TCP的链接而重复地使用它传输一系列的请求/响应消息。
因此减少了链接建立的次数和经常性的链接开销。
http的长短链接本质上是tcp的长短链接

TCP and UDP

         tcp and udp focus in the transport layer protocol so ah.

TCP 
传输控制协议,提供的是面向连接、可靠的字节流服务。当客户和服务器彼此交换数据前,
必须先在双方之间建立一个TCP连接,之后才能传输数据。
TCP提供超时重发,丢弃重复数据,检验数据,流量控制等功能,
保证数据能从一端传到另一端。 理想状态下,TCP连接一旦建立,
在通信双方中的任何一方主动关闭连接前,TCP 连接都将被一直保持下去。
断开连接时服务器和客户端均可以主动发起断开TCP连接的请求
tcp链接要经过三次握手方式
UDP  
用户数据报协议,是一个无连接的简单的面向数据报的运输层协议。
UDP不提供可靠性,它只是把应用程序传给IP层的数据报发送出去,
但是并不能保证它们能到达目的地。
由于UDP在传输数据报前不用在客户和服务器之间建立一个连接,且没有超时重发等机制,故而传输速度很快

Socket

      socket is not agreement, but precisely a call interface.

tcp and udp transport layer protocol may be operated by tcp and udp socket.

WebSocket

WebSocket也是一种协议,并且也是基于TCP协议的。是应用层协议
具体流程是WebSocket通过HTTP先发送一个标记了 Upgrade 的请求,
服务端解析后开始建立TCP连接,省去了HTTP长连接每次请求都要上传header的冗余.
WebSocket在进行第一次HTTP请求之后,其他全部采用TCP通道进行双向通讯


Look websocket had seen when he stumbled, reading online articles feel stumbled.

While recording my article a bit, still not clear. Also you need to record the communication job.

Computer network this course, wanted time to study the crash. Ye Hao understand about the concept of reading a book, but to say which part of the agreement specifically what to do, what position to put all forgotten.

It is recommended that if the school computer network, to learn the best combination of courseware graphic

 

Guess you like

Origin blog.csdn.net/ab31ab/article/details/93498443