Постоянное соединение в HTTP | Курс "Компьютерные сети"

Постоянное соединение в HTTP | Курс "Компьютерные сети"

New Section

The lecture discusses the evolution of HTTP connections, emphasizing the shift from simple web structures to complex modern web pages requiring multiple resources.

Evolution of Web Structures

  • Initially, HTTP 1.0 operated in a request-response mode where clients requested and servers provided web pages, suitable for simple text-based HTML pages.
  • Modern web pages are intricate, comprising various resources like images, videos, scripts, and external blocks from different sites.
  • Introduces the concept of persistent connections where a single TCP connection can be used to fetch multiple resources beyond just HTML files.
  • Persistent connections in HTTP are termed as "HTTP persistent Connection" or "HTTP Keep alive," enhancing webpage loading speed by avoiding repeated connection setups.

Optimizing Data Transfer Speed

Explores techniques such as persistent connections and window size adjustment to enhance data transfer efficiency in HTTP.

Enhancing Data Transfer Efficiency

  • Using persistent connections eliminates the need for frequent connection establishments, improving data transfer speed significantly.
  • TCP adjusts data transmission speed through window size; larger windows facilitate faster data transfer rates.

Managing Connection Persistence

Discusses mechanisms like the "Connection: Keep" header and its impact on maintaining open connections.

Connection Persistence Management

  • Introduction of the "Connection: Keep" header post HTTP 1.0 publication allowed clients to request servers to keep connections open for further resource retrieval.
  • Even without the "Connection: Keep" header, some servers maintain open connections unless explicitly closed using "Connection Close," balancing resource utilization with connection persistence.

Resource Utilization Challenges

Explores server resource constraints and automatic connection closure strategies due to high client demand variability.

Resource Management Challenges

  • Servers automatically close idle connections after a set time (e.g., 5-20 seconds) to optimize resource allocation amidst fluctuating client requests.

Enhancing Data Transmission Speed

Introduces HTTP pipelining as a technology to expedite data transmission by sending multiple requests simultaneously.

Accelerating Data Transmission

New Section

This section discusses the limitations of technology in resource transmission order and how HTTP version 2 protocol addresses these issues by allowing numbered requests for resource delivery.

Resources Transmission Order

  • Resources must be transmitted in the same order as the requests arrived. If an issue occurs with loading a resource, other resources cannot be transmitted even if they are ready.
  • HTTP version 2 protocol resolves this problem by enabling request numbering and transmission flexibility.

New Section

The discussion shifts to the potential enhancement of web page loading speed through multiple HTTP connections and varied resource loading strategies.

Web Page Loading Speed Enhancement

  • Server resources can be sent to clients in any order, but pipeline processing is rarely used in practice.
  • Increasing web page loading speed involves opening multiple HTTP connections from the client to the server for parallel resource loading.
  • Each connection can handle different types of resources like stylesheets, Java scripts, and images, optimizing load times.

New Section

Exploring the benefits of persistent HTTP connections in reducing resource loading time and avoiding repetitive TCP handshakes.

Benefits of Persistent Connections

  • Utilizing a single TCP connection for multiple resource downloads reduces setup time without requiring repeated three-way handshakes.
  • Modern browsers typically use four to eight simultaneous HTTP connections for efficient resource retrieval.

New Section

The evolution of persistent connections in HTTP protocols from version 1.0 to version 1.1 is discussed, highlighting default persistent connections in the latter.

Evolution of Persistent Connections

  • In HTTP 1.0, there was no support for persistent connections; however, this feature was added post-publication as "Connection: Keep-alive."
  • In contrast, all connections are persistent by default in HTTP 1.1, making "Connection: Keep-alive" header usage optional.
Video description

Постоянное соединение в протоколе HTTP. Лекции по курсу "Компьютерные сети" - https://goo.gl/0aIOuf Страница курса - http://www.asozykin.ru/courses/networks_online Постоянное соединение HTTP (HTTP keep-alive, HTTP persistent connection) - использование одного TCP-соединения для загрузки нескольких ресурсов Преимущества постоянного соединения: - Сокращение накладных расходов на установку TCP-соединения. - Нет необходимости каждый раз начинать передачу данных с маленьким размером окна TCP (медленный старт). В стандарте HTTP 1.0 возможности использовать постоянное соединение нет. После публикации стандарта HTTP 1.0 был предложен заголовок "Connection: keep-alive". Пример использования заголовка "Connection: keep-alive": HTTP-запрос: GET /courses/networks HTTP/1.0 Host: www.asozykin.ru Connection: keep-alive HTTP-ответ: HTTP/1.0 200 OK Server: nginx Content-Type: text/html; charset=UTF-8 Content-Length: 5161 Connection: keep-alive В стандарте HTTP 1.1 по умолчанию все соединения постоянные. Технология конвейерной обработки HTTP (pipelining) - отправка сразу нескольких HTTP запросов через постоянное соединение не дожидаясь ответа. Сервер также передает сразу несколько запрошенных ресурсов. Для ускорения загрузки Web-страниц браузеры открывают сразу несколько соединений с Web-сервером. Каждое такое соединение может быть постоянным и использовать конвейерную обработку. Лекция "Протокол HTTP" - https://youtu.be/RlccXUx4LVw Лекция "Протокол TCP" - https://youtu.be/CKUOb4htnB4 Лекция "Протокол TCP: скользящее окно" - https://youtu.be/hd6QNXK5rPk Лекция "Протокол TCP: соединение" - https://youtu.be/7DitlqcesKI Лекция "Протокол TCP: управление перегрузкой" - https://youtu.be/lGUPQjvSMeo Практические занятия по курсу "Компьютерные сети" - https://goo.gl/YP3l83 Мой канал с краткими и понятными объяснениями сложных тем в ИТ и компьютерных науках: https://goo.gl/kW93MA