The Internet and how data travels · A Internet e como os dados viajam
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.
A Internet
- A Internet é uma vasta rede de computadores interconectados.
- Nenhum computador único está no comando. Muitos computadores compartilham o trabalho.
- Quando você abre uma página web, seus dados viaja através de muitos desses computadores.
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).
Dados são divididos em pacotes
- Dados grandes não viajam em uma única peça.
- Eles são cortados em pedaços pequenos chamados pacotes.
- Cada pacote carrega um trecho de dados, além de um endereço (para onde vai) e um número (sua ordem).
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.
Roteamento: muitos caminhos
- Roteamento significa escolher um caminho para cada pacote pela rede.
- Pacotes passam por muitos computadores chamados routers no caminho.
- Diferentes pacotes podem tomar caminhos diferentes para o mesmo lugar.
[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.
Redundância e tolerância a falhas
- Redundância significa que há mais de um caminho entre dois pontos.
- Devido a isso, a Internet tem tolerância a falhas: continua funcionando mesmo se uma conexão falhar.
- Se o roteador B quebrar, os pacotes apenas usam outra rota, como 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: as regras
- Computadores devem concordar com regras para poderem conversar. Chamamos um conjunto de regras de protocolo.
- IP (Internet Protocol) dá a cada computador um endereço e ajuda a enviar cada pacote.
- TCP (Transmission Control Protocol) verifica se todos os pacotes chegam e os recoloca na ordem.
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: a web
- A web (World Wide Web) são as páginas e links que você abre em um navegador.
- A web usa um protocolo chamado HTTP (HyperText Transfer Protocol).
- Seu navegador envia um pedido HTTP (request) ("por favor, me dê esta página"); o servidor envia uma resposta HTTP (response) (a página).
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.
Por que este projeto é forte
- Nenhum ponto único controla tudo, então não há ponto único para quebrar toda a Internet.
- Muitos caminhos + pacotes = a rede pode rotionar ao redor de problemas.
- Regras compartilhadas (TCP/IP, HTTP) permitem que computadores muito diferentes trabalhem juntos.
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.
Palavras-chave
- Pacote: um pequeno fragmento de dados com endereço e número de ordem.
- Roteamento: escolher um caminho para pacotes através de roteadores.
- Redundância / tolerância a falhas: muitos caminhos, para que uma falha não interrompa a rede.
- TCP/IP: regras para enviar pacotes e reconstituí-los em ordem.
- HTTP: as regras que a Web usa para solicitar e enviar páginas.
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.
Erros comuns
- Os dados são divididos em pacotes que viajam separadamente e são reconstituídos.
- A Internet e a World Wide Web não são a mesma coisa.
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.
Agora você tenta
- Essas tarefas simulam como os dados realmente viajam: dividi-los, reconstituí-los e rotear ao redor de uma falha.
- Clique em Check answer para testar seu código.
Data travels in packets · Dados viajam em pacotes
The Internet splits data into packets that are routed and reassembled. · A Internet divide os dados em pacotes que são roteados e reensamblados.
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". · TCP recoloca os pacotes na ordem correta pelo seu número. packets é uma lista de [order, text] pares que chegaram embaralhados. Escreva reassemble(packets) que os ordene por order e retorne o texto unido. Exemplo: reassemble([[2, "O FR"], [1, "HELL"], [3, "IEND"]]) resulta em "HELLO FRIEND".
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
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"]]. · Big data é dividido em pacotes de tamanho fixo. Escreva split(text, size) que retorne uma lista de [order, chunk] pares (a contagem começa em 1), onde cada fragmento tem no máximo size caracteres. Exemplo: split("HELLO FRIEND", 4) resulta em [[1, "HELL"], [2, "O FR"], [3, "IEND"]].
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
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 · não contain broken. · Redundância fornece mais de um caminho, permitindo que a rede roteie ao redor de uma falha. paths é uma lista de rotas (cada rota é uma lista de nomes de roteadores). Uma rota funciona apenas se evitar o roteador broken. Escreva working_routes(paths, broken) retornando as rotas que não contêm broken.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.