The Internet and how data travels · Internet y cómo viajan los datos
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.
La Internet
- La Internet es una inmensa red de computadoras que están conectadas entre sí.
- Ninguna computadora única está a cargo. Muchas computadoras comparten la tarea.
- Cuando abres una página web, tus datos viajan a través de muchas de estas computadoras.
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).
Los datos se dividen en paquetes
- Los datos grandes no viajan en un solo bloque.
- Se cortan en pedazos pequeños llamados paquetes.
- Cada paquete lleva un fragmento de los datos, además de una dirección (a dónde va) y un número (su orden).
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.
Enrutamiento: muchos caminos
- El enrutamiento significa elegir un camino para cada paquete a través de la red.
- Los paquetes pasan por muchas computadoras llamadas routers en el camino.
- Diferentes paquetes pueden tomar caminos diferentes hacia el mismo destino.
[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.
Redundancia y tolerancia a fallos
- La redundancia significa que hay más de un camino entre dos puntos.
- Debido a esto, la Internet tiene tolerancia a fallos: sigue funcionando incluso si falla un enlace.
- Si el router B falla, los paquetes simplemente usan otra ruta, 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: las reglas
- Las computadoras deben ponerse de acuerdo sobre reglas para poder comunicarse. A un conjunto de reglas lo llamamos protocolo.
- IP (Protocolo de Internet) asigna una dirección a cada computadora y ayuda a enviar cada paquete.
- TCP (Protocolo de Control de Transmisión) verifica que todos los paquetes lleguen y los vuelve a ordenar.
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: la Web
- La Web (World Wide Web) son las páginas y enlaces que abres en un navegador.
- La Web utiliza un protocolo llamado HTTP (Protocolo de Transferencia de Hipertexto).
- Tu navegador envía una solicitud HTTP ("por favor, dame esta página"); el servidor envía una respuesta HTTP (la 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 qué este diseño es robusto
- No hay un único punto que controle todo, por lo que no hay un único punto de fallo para toda la Internet.
- Muchos caminos + paquetes = la red puede evitar problemas.
- Reglas compartidas (TCP/IP, HTTP) permiten que computadoras muy distintas funcionen juntas.
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.
Palabras clave
- Paquete: un pequeño fragmento de datos con una dirección y un número de orden.
- Enrutamiento: elegir un camino para los paquetes a través de los routers.
- Redundancia / tolerancia a fallos: muchos caminos, para que un fallo no detenga la red.
- TCP/IP: reglas para enviar paquetes y ensamblarlos en orden.
- HTTP: las reglas que usa la Web para solicitar y 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.
Errores comunes
- Los datos se dividen en paquetes que viajan por separado y luego se ensamblan.
- La Internet y la World Wide Web no son lo mismo.
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.
Ahora tú practica
- Estas tareas modelan cómo viajan realmente los datos: divídelos, ensámbleslos y eviten un fallo.
- Presiona Comprobar respuesta para probar tu código.
Data travels in packets · Los datos viajan en paquetes
The Internet splits data into packets that are routed and reassembled. · Internet divide los datos en paquetes que se enrutan y reensamblan.
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 reordena los paquetes según su número. packets es una lista de pares [order, text] que llegaron desordenados. Escribe reassemble(packets) que los ordene por order y devuelva el texto unido. Ejemplo: reassemble([[2, "O FR"], [1, "HELL"], [3, "IEND"]]) devuelve "HELLO FRIEND".
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.
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"]]. · Los grandes datos se dividen en paquetes de tamaño fijo. Escribe split(text, size) que devuelva una lista de pares [order, chunk] (el orden empieza en 1), donde cada fragmento tenga como máximo size caracteres. Ejemplo: split("HELLO FRIEND", 4) devuelve [[1, "HELL"], [2, "O FR"], [3, "IEND"]].
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.
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 · no contain broken. · La redundancia proporciona más de una ruta, por lo que la red puede enrutar alrededor de una falla. paths es una lista de rutas (cada una una lista de nombres de routers). Una ruta funciona solo si evita al router broken. Escribe working_routes(paths, broken) que devuelva las rutas que no contienen broken.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.