The Internet and how data travels
The Internet
- The Internet is a huge network of computers that are joined together.
- No single computer is in charge. Many computers share the work.
- When you open a web page, your data travels across many of these computers.
Интернет
- Интернет — это огромная сеть компьютеров, соединённых вместе.
- Ни один компьютер не управляет всем. Многие компьютеры разделяют работу.
- Когда вы открываете веб-страницу, ваши данные проходят через множество этих компьютеров.
Data is split into packets
- Big data does not travel in one piece.
- It is cut into small pieces called packets.
- Each packet carries a bit of the data, plus an address (where it goes) and a number (its order).
Данные разбиваются на пакеты
- Большие данные не передаются целиком.
- Они нарезаются на маленькие части, называемые пакетами.
- Каждый пакет несёт часть данных, а также адрес (куда он идёт) и номер (его порядок).
Your message: "HELLO FRIEND"
Split into packets:
[1] "HELL" to: 203.0.113.7
[2] "O FR" to: 203.0.113.7
[3] "IEND" to: 203.0.113.7
Routing: many paths
- Routing means choosing a path for each packet through the network.
- Packets pass through many computers called routers on the way.
- Different packets can take different paths to the same place.
Маршрутизация: множество путей
- Маршрутизация — это выбор пути для каждого пакета через сеть.
- Пакеты проходят через множество компьютеров, называемых маршрутизаторами, по пути следования.
- Разные пакеты могут следовать по разным путям к одному и тому же месту.
[You] --- router A --- router B --- [Website]
\ /
--- router C --- router D -
Packet 1 may go A -> B.
Packet 2 may go C -> D.
Both still arrive.
Redundancy and fault tolerance
- Redundancy means there is more than one path between two points.
- Because of this the Internet has fault tolerance: it keeps working even if one link fails.
- If router B breaks, packets just use another route, like C -> D.
Избыточность и отказоустойчивость
- Избыточность означает наличие более одного пути между двумя точками.
- Благодаря этому Интернет обладает отказоустойчивостью: он продолжает работать даже при выходе из строя одного канала связи.
- Если маршрутизатор B выходит из строя, пакеты просто используют другой маршрут, например C -> D.
[You] --- router A --- (router B BROKEN)
\
--- router C --- router D --- [Website]
The path through B fails.
Packets still arrive through C -> D.
TCP/IP: the rules
- Computers must agree on rules so they can talk. We call a set of rules a protocol.
- IP (Internet Protocol) gives every computer an address and helps send each packet.
- TCP (Transmission Control Protocol) checks that all packets arrive and puts them back in order.
TCP/IP: правила
- Компьютеры должны соглашаться на правила, чтобы обмениваться данными. Набор правил называется протоколом.
- IP (Internet Protocol) присваивает каждому компьютеру адрес и помогает отправлять каждый пакет.
- TCP (Transmission Control Protocol) проверяет прибытие всех пакетов и восстанавливает их в правильном порядке.
Packets arrive (maybe out of order):
[3] "IEND" [1] "HELL" [2] "O FR"
TCP reorders them by number:
[1] "HELL" + [2] "O FR" + [3] "IEND"
= "HELLO FRIEND"
HTTP: the web
- The web (World Wide Web) is the pages and links you open in a browser.
- The web uses a protocol called HTTP (HyperText Transfer Protocol).
- Your browser sends an HTTP request ("please give me this page"); the server sends an HTTP response (the page).
HTTP: веб-сеть
- Веб (Всемирная паутина) — это страницы и ссылки, которые вы открываете в браузере.
- Веб использует протокол под названием HTTP (HyperText Transfer Protocol).
- Ваш браузер отправляет HTTP-запрос («пожалуйста, дайте мне эту страницу»); сервер отправляет HTTP-ответ (саму страницу).
Why this design is strong
- No single point controls everything, so there is no single point to break the whole Internet.
- Many paths + packets = the network can route around problems.
- Shared rules (TCP/IP, HTTP) let very different computers work together.
Почему эта архитектура надежна
- Нет единого центра управления всем, поэтому нет и единой точки отказа всего Интернета.
- Множество путей + пакеты = сеть может обходить проблемы.
- Общие правила (TCP/IP, HTTP) позволяют очень разным компьютерам работать вместе.
Key words
- Packet: a small piece of data with an address and an order number.
- Routing: choosing a path for packets through routers.
- Redundancy / fault tolerance: many paths, so one failure does not stop the network.
- TCP/IP: rules to send packets and reassemble them in order.
- HTTP: the rules the web uses to request and send pages.
Ключевые слова
- Пакет: небольшой фрагмент данных с адресом и порядковым номером.
- Маршрутизация: выбор пути для пакетов через маршрутизаторы.
- Избыточность / отказоустойчивость: множество путей, поэтому один сбой не останавливает работу сети.
- TCP/IP: правила отправки пакетов и их сборки в нужном порядке.
- HTTP: правила, которые использует веб для запроса и передачи страниц.
Common mistakes
- Data is split into packets that travel separately and are reassembled.
- The Internet and the World Wide Web are not the same thing.
Распространенные ошибки
- Данные разбиваются на пакеты, которые перемещаются отдельно, а затем собираются обратно.
- Интернет и Всемирная паутина — это не одно и то же.
Now you try
- These tasks model how data really travels: split it, reassemble it, and route around a failure.
- Press Check answer to test your code.
Теперь попробуйте сами
- Эти задачи моделируют реальное движение данных: разделение, сборка и обход сбоя.
- Нажмите Check answer (Проверить ответ), чтобы протестировать свой код.
Data travels in packets
The Internet splits data into packets that are routed and reassembled.
TCP puts packets back in order by their number. packets is a list of [order, text] pairs that arrived shuffled. Write reassemble(packets) that sorts them by order and returns the joined text. Example: reassemble([[2, "O FR"], [1, "HELL"], [3, "IEND"]]) is "HELLO FRIEND".
Click Run to see the output here. · Нажмите Запустить, чтобы увидеть результат здесь.
Big data is cut into fixed-size packets. Write split(text, size) that returns a list of [order, chunk] pairs (order starts at 1), each chunk at most size characters. Example: split("HELLO FRIEND", 4) is [[1, "HELL"], [2, "O FR"], [3, "IEND"]].
Click Run to see the output here. · Нажмите Запустить, чтобы увидеть результат здесь.
Redundancy gives more than one path, so the network can route around a failure. paths is a list of routes (each a list of router names). A route works only if it avoids the broken router. Write working_routes(paths, broken) returning the routes that do not contain broken.
Click Run to see the output here. · Нажмите Запустить, чтобы увидеть результат здесь.