# vas-y, viens, on recrée TOUT internet... de zéro

https://www.youtube.com/watch?v=HRa31C7zfzk
Translation: fr

[00:02] Just a click.
  Juste un clic.

[00:04] And your data's on the other side of the world.
  Et vos données sont à l'autre bout du monde.

[00:09] One of the most brilliant inventions that humanity has ever come up with, in fact.
  L'une des inventions les plus brillantes que l'humanité ait jamais imaginées, en fait.

[00:14] And today, we're going to recreate it, step by step, right from scratch, starting from zero.
  Et aujourd'hui, nous allons la recréer, étape par étape, à partir de zéro.

[00:19] We saw it firsthand when we rebuilt a computer in Minecraft.
  Nous l'avons vu de nos propres yeux lorsque nous avons reconstruit un ordinateur dans Minecraft.

[00:23] In computing, everything is a matter of bits, of zeros and ones.
  En informatique, tout est une question de bits, de zéros et de uns.

[00:27] With that, you can encode and represent any information you can imagine.
  Avec cela, vous pouvez encoder et représenter n'importe quelle information que vous pouvez imaginer.

[00:31] The Internet takes data from one machine, in the form of bits, and transmits it to another, no matter where it is in the world.
  Internet prend des données d'une machine, sous forme de bits, et les transmet à une autre, peu importe où elle se trouve dans le monde.

[00:38] Here's the problem we're trying to solve.
  Voici le problème que nous essayons de résoudre.

[00:40] First of all, we need a way to carry bits from one place to another.
  Tout d'abord, nous avons besoin d'un moyen de transporter des bits d'un endroit à un autre.

[00:44] Say we take copper, make it into a cable, and connect our two computers with it.
  Disons que nous prenons du cuivre, que nous en faisons un câble et que nous y connectons nos deux ordinateurs.

[00:49] On the sending side, the machine has a network card that can, in practice, vary the voltage on that cable up and down a bit.
  Du côté de l'envoi, la machine possède une carte réseau qui peut, en pratique, faire varier un peu la tension sur ce câble.

[00:56] To represent a one, it can, for example, set the voltage to five volts for just a moment, then, to represent a zero, it switches it to -5.
  Pour représenter un un, elle peut, par exemple, régler la tension à cinq volts pendant un instant, puis, pour représenter un zéro, elle la fait passer à -5.

[01:03] And with that simple back-and-forth, it can send its bits.
  Et avec ce simple va-et-vient, il peut envoyer ses bits.

[01:06] The other machine, sitting on the other end of the wire, would simply have to watch those changes in voltage at any given time and, from them, infer the sequence that was sent.
  L'autre machine, située à l'autre bout du fil, devrait simplement observer ces changements de tension à tout moment et, à partir de ceux-ci, déduire la séquence qui a été envoyée.

[01:15] That is what we call NRZ encoding.
  C'est ce que nous appelons le codage NRZ.

[01:17] And there you go—pretty simple.
  Et voilà, c'est assez simple.

[01:18] Too simple?
  Trop simple ?

[01:19] Yeah.
  Ouais.

[01:20] If I send you this signal, it’s easy for you to tell where the zeros are and where the ones are.
  Si je vous envoie ce signal, il est facile pour vous de dire où sont les zéros et où sont les uns.

[01:25] But if I send you this—a long string of ones or zeros—well then you’re less sure.
  Mais si je vous envoie ceci — une longue chaîne de uns ou de zéros — eh bien, vous êtes moins sûr.

[01:30] It all depends on how fast I’m counting.
  Tout dépend de la vitesse à laquelle je compte.

[01:32] Maybe I’m the fast kind, and in my head I hear it as one one one one one one one, but the other guy’s slow, and so to him it’s one… one.
  Peut-être que je suis du genre rapide, et dans ma tête je l'entends comme un un un un un un un, mais l'autre gars est lent, et donc pour lui c'est un… un.

[01:40] Except that’s not at all what I sent that dummy.
  Sauf que ce n'est pas du tout ce que j'ai envoyé à cet idiot.

[01:43] Well, machines have exactly the same problem, too, really, there.
  Eh bien, les machines ont exactement le même problème, aussi, vraiment, là.

[01:45] Each one has its own clock, and in real life they’re simply not perfectly synced with each other.
  Chacune a sa propre horloge, et dans la vraie vie, elles ne sont tout simplement pas parfaitement synchronisées entre elles.

[01:50] So it’s not as drastic as in my previous example, but even a tiny variation can mean that, over a long run of ones or zeros, if you let it run long, the count drifts, and you can end up missing one along the way.
  Donc ce n'est pas aussi drastique que dans mon exemple précédent, mais même une minuscule variation peut signifier que, sur une longue série de uns ou de zéros, si vous la laissez durer longtemps, le compte dérive, et vous pouvez finir par en manquer un en cours de route.

[02:00] That’s what we call a clock slip.
  C'est ce que nous appelons un glissement d'horloge.

[02:03] And that doesn’t happen with varied bit sequences,
  Et cela n'arrive pas avec des séquences de bits variées,

[02:05] Because the receiver can use the voltage changes, the transitions, to work out where the bits are supposed to be, and it can keep resyncing continuously as well.
  Parce que le récepteur peut utiliser les changements de tension, les transitions, pour déterminer où les bits sont censés se trouver, et il peut également continuer à se resynchroniser en permanence.

[02:13] Whereas, on a long monotone run, it can do nothing but rely on its own clock, and that clock may drift out of sync with the transmitter’s over time.
  Alors que, sur une longue séquence monotone, il ne peut rien faire d'autre que de se fier à sa propre horloge, et cette horloge peut se désynchroniser de celle de l'émetteur avec le temps.

[02:24] But the solution is obvious.
  Mais la solution est évidente.

[02:25] We just need to find a way to ensure enough variation, no matter what happens.
  Nous devons simplement trouver un moyen d'assurer suffisamment de variation, quoi qu'il arrive.

[02:30] Another important point: we want roughly as many zeros as ones, so the average voltage is zero volts, and we achieve what’s called DC balance overall.
  Autre point important : nous voulons à peu près autant de zéros que de uns, afin que la tension moyenne soit de zéro volt, et nous obtenons ce qu'on appelle un équilibre CC global.

[02:39] That’s because if the average voltage is too high, the cable becomes less reliable, and it’ll introduce random errors.
  C'est parce que si la tension moyenne est trop élevée, le câble devient moins fiable et introduira des erreurs aléatoires.

[02:45] A really simple fix for both problems is that, instead of representing a one and a zero with a constant voltage, we can say a one is a low voltage followed by a high voltage, and the reverse for a zero.
  Une solution très simple à ces deux problèmes est que, au lieu de représenter un un et un zéro par une tension constante, nous pouvons dire qu'un un est une tension basse suivie d'une tension haute, et l'inverse pour un zéro.

[02:56] That way, a long sequence of zeros or ones goes from this to this.
  De cette façon, une longue séquence de zéros ou de uns passe de ceci à cela.

[03:00] So now you’ve got more clock issues, and the average level is still sitting at zero volts.
  Donc maintenant, vous avez plus de problèmes d'horloge, et le niveau moyen reste à zéro volt.

[03:05] That’s Manchester encoding, except it’s kinda crap—with all due respect, obviously.
  C'est le codage Manchester, sauf que c'est un peu nul — avec tout le respect que je vous dois, évidemment.

[03:10] You go from one beat per bit to two beats, so the bits per second we send, our data rate, gets, in practice, slowed down on the wire right there.
  Vous passez d'un battement par bit à deux battements, donc les bits par seconde que nous envoyons, notre débit de données, est, en pratique, ralenti sur le câble à ce moment-là.

[03:17] But we wanna go as fast as possible, though!
  Mais nous voulons aller aussi vite que possible, cependant !

[03:20] That’s where the scrambler comes in.
  C'est là que le brouilleur intervient.

[03:22] It’s probably the most efficient, and the coolest, way to deal with it.
  C'est probablement le moyen le plus efficace et le plus ingénieux de gérer cela.

[03:26] The idea is simple: before we send our bits, we slightly tweak them to produce a pseudo-random pattern, using a predefined linear feedback shift register.
  L'idée est simple : avant d'envoyer nos bits, nous les modifions légèrement pour produire une séquence pseudo-aléatoire, en utilisant un registre à décalage à rétroaction linéaire prédéfini.

[03:34] Then, at the receiving end, we just reverse the process to recover the bits we sent, exactly as they were.
  Ensuite, à la réception, nous inversons simplement le processus pour récupérer les bits que nous avons envoyés, exactement tels qu'ils étaient.

[03:40] That random pattern statistically gives you as many ones as zeros, which in turn fixes clock slip and achieves direct-current balancing, cleanly.
  Ce motif aléatoire vous donne statistiquement autant de uns que de zéros, ce qui corrige le glissement d'horloge et permet un équilibrage du courant continu, proprement.

[03:48] Problem solved, and you do it while still keeping the same data rate.
  Problème résolu, et vous le faites tout en conservant le même débit de données.

[03:51] Pretty slick, right?
  Plutôt astucieux, n'est-ce pas ?

[03:53] This scrambler is often paired with a line code like 64B 66B, for example.
  Ce brouilleur est souvent associé à un code en ligne comme le 64B 66B, par exemple.

[03:57] So what’s it for?
  Alors, à quoi cela sert-il ?

[03:58] If I’m sending you pseudo-random bits nonstop, in a stream, how do you know exactly where the message I’m sending to you begins?
  Si je vous envoie des bits pseudo-aléatoires sans arrêt, dans un flux, comment savez-vous exactement où commence le message que je vous envoie ?

[04:05] We need a marker to delimit it.
  Nous avons besoin d'un marqueur pour le délimiter.

[04:07] That’s what 64B 66B does.
  C'est ce que fait le 64B 66B.

[04:08] It’ll split our message into 64-bit blocks, and add two-bit headers right up front, along with
  Il divisera notre message en blocs de 64 bits et ajoutera des en-têtes de deux bits juste au début, avec

[04:13] Control blocks for the receiver side.
  Blocs de contrôle pour le côté récepteur.

[04:15] It doesn’t change the data rate much.
  Cela ne change pas beaucoup le débit de données.

[04:17] It keeps a steady transition to resynchronize the clock, and clearly marks the start and end of the transmission with those control blocks.
  Il maintient une transition stable pour resynchroniser l'horloge, et marque clairement le début et la fin de la transmission avec ces blocs de contrôle.

[04:24] And we’re already doing pretty well, but maybe you want even more bandwidth.
  Et nous nous en sortons déjà plutôt bien, mais peut-être voulez-vous encore plus de bande passante.

[04:29] Well, back at first I told you we were using just two voltage levels: one to represent a one, and the other a zero.
  Eh bien, au début, je vous ai dit que nous utilisions seulement deux niveaux de tension : l'un pour représenter un un, et l'autre un zéro.

[04:34] So why stop there, really?
  Alors pourquoi s'arrêter là, vraiment ?

[04:36] We can totally use four voltage levels, for example.
  Nous pouvons tout à fait utiliser quatre niveaux de tension, par exemple.

[04:39] This way, each level would represent not one bit, but two this time!
  De cette façon, chaque niveau représenterait non pas un bit, mais deux cette fois-ci !

[04:42] That’s PAM-4 modulation, basically.
  C'est essentiellement la modulation PAM-4.

[04:44] We’re sending two bits at a time right now.
  Nous envoyons deux bits à la fois en ce moment.

[04:46] So now we double our bit rate.
  Donc maintenant, nous doublons notre débit binaire.

[04:47] But be careful, because the faster we go, the more complicated it gets.
  Mais attention, car plus nous allons vite, plus cela devient compliqué.

[04:51] The voltage levels we use are now much closer together, which makes this modulation really sensitive to noise, and then one sudden hit can flip your bits, so you end up seeing errors more often.
  Les niveaux de tension que nous utilisons sont maintenant beaucoup plus proches les uns des autres, ce qui rend cette modulation très sensible au bruit, et une soudaine perturbation peut inverser vos bits, vous finissez donc par voir des erreurs plus souvent.

[05:01] Luckily, there’s a way to detect those errors, and even correct them automatically, all by itself.
  Heureusement, il existe un moyen de détecter ces erreurs, et même de les corriger automatiquement, tout seul.

[05:06] It’s magic!
  C'est magique !

[05:07] No.
  Non.

[05:08] It’s math.
  C'est des mathématiques.

[05:09] It’s called FEC.
  Cela s'appelle la FEC.

[05:10] There are several algorithms that take care of it, but the most powerful of them is LDPC.
  Il existe plusieurs algorithmes qui s'en chargent, mais le plus puissant d'entre eux est le LDPC.

[05:15] The whole challenge here is adding checks to our data stream without slowing our throughput down by adding too many.
  Tout le défi ici consiste à ajouter des vérifications à notre flux de données sans ralentir notre débit en en ajoutant trop.

[05:20] Because, naïvely, you could just repeat everything three times, just to be sure.
  Car, naïvement, on pourrait simplement tout répéter trois fois, juste pour être sûr.

[05:25] But that completely kills the transmission speed we worked so hard to improve.
  Mais cela tue complètement la vitesse de transmission que nous avons travaillé si dur à améliorer.

[05:29] The solution is a Sudoku.
  La solution est un Sudoku.

[05:30] In a Sudoku, to check each number, you take a quick pass and verify the sums: you look and see if every row, every column, and every box, after you add all the entries together, still adds up to 45.
  Dans un Sudoku, pour vérifier chaque nombre, vous faites un passage rapide et vérifiez les sommes : vous regardez si chaque ligne, chaque colonne et chaque carré, après avoir additionné toutes les entrées, totalisent toujours 45.

[05:41] If even one number is wrong, then several rows, columns, and boxes won’t add up to 45 as well.
  Si ne serait-ce qu'un seul nombre est faux, alors plusieurs lignes, colonnes et carrés ne totaliseront pas non plus 45.

[05:46] And to find the culprit, you just look for the number that keeps showing up in every wrong sum, and you know that’s the one you need to change, the one to fix.
  Et pour trouver le coupable, vous cherchez simplement le nombre qui apparaît constamment dans chaque somme erronée, et vous savez que c'est celui que vous devez changer, celui à corriger.

[05:54] With LDPC, we’re going to split our data stream up into several overlapping chunks.
  Avec le LDPC, nous allons diviser notre flux de données en plusieurs segments qui se chevauchent.

[05:58] And for each of those chunks, we’re going to compute their parity, basically.
  Et pour chacun de ces segments, nous allons calculer leur parité, en gros.

[06:02] That means we count how many ones there are, and if it’s an even number, we write down zero as the result.
  Cela signifie que nous comptons combien il y a de uns, et s'il s'agit d'un nombre pair, nous écrivons zéro comme résultat.

[06:07] If it’s odd, then we write down one.
  S'il est impair, alors nous écrivons un.

[06:10] So when a data bit is wrong, several parity bits will end up giving inconsistent results overall.
  Ainsi, lorsqu'un bit de données est erroné, plusieurs bits de parité finiront par donner des résultats incohérents dans l'ensemble.

[06:15] You just look at which bit is showing up in all of those parity checks, the one that appears in every calculation, and you flip it to correct it.
  Il suffit de regarder quel bit apparaît dans tous ces contrôles de parité, celui qui figure dans chaque calcul, et de l'inverser pour le corriger.

[06:22] By doing that, we don’t add a huge amount of extra bits, and we still keep our crazy data rate.
  En faisant cela, nous n'ajoutons pas une énorme quantité de bits supplémentaires, et nous conservons notre débit de données incroyable.

[06:27] And there you go, we’ve finally got a cable to send our bits.
  Et voilà, nous avons enfin un câble pour envoyer nos bits.

[06:30] It’s worth noting that there are plenty of other ways to get what we want.
  Il est intéressant de noter qu'il existe de nombreuses autres façons d'obtenir ce que nous voulons.

[06:33] This was just a quick overview, really.
  Ce n'était vraiment qu'un aperçu rapide.

[06:35] And if we’ve been talking about copper cables that work with electrical voltage, you can do the same thing with another medium.
  Et si nous avons parlé de câbles en cuivre qui fonctionnent avec une tension électrique, vous pouvez faire la même chose avec un autre support.

[06:41] For example, with light in fiber-optic cables: instead of varying the voltage, you can vary the light intensity to encode our bits.
  Par exemple, avec la lumière dans les câbles à fibre optique : au lieu de faire varier la tension, vous pouvez faire varier l'intensité lumineuse pour encoder nos bits.

[06:48] By doing that, you can travel hundreds of kilometers before you have to amplify the signal.
  En faisant cela, vous pouvez parcourir des centaines de kilomètres avant de devoir amplifier le signal.

[06:53] That’s why fiber-optic cables are what connect continents to each other.
  C'est pourquoi les câbles à fibre optique sont ce qui relie les continents entre eux.

[06:56] It’s those famous undersea cables, down on the ocean floor, that the Internet basically runs on.
  Ce sont ces célèbres câbles sous-marins, au fond de l'océan, sur lesquels repose essentiellement Internet.

[07:02] But you can also use radio waves, too: you make the electromagnetic field vibrate, to create a carrier wave, and you encode our bits by changing its frequency, its amplitude, or its phase—sometimes even several properties at the same time.
  Mais vous pouvez aussi utiliser des ondes radio : vous faites vibrer le champ électromagnétique pour créer une onde porteuse, et vous encodez nos bits en modifiant sa fréquence, son amplitude ou sa phase, parfois même plusieurs propriétés en même temps.

[07:14] For the rest of the video, we’ll assume we’re only using cables, just to keep things simple.
  Pour le reste de la vidéo, nous supposerons que nous n'utilisons que des câbles, simplement pour simplifier les choses.

[07:19] The idea would be the same if we also threw some wireless in there, there’d just be a bunch of extra, specific constraints we would’ve had to deal with.
  L'idée serait la même si nous y ajoutions du sans-fil, il y aurait simplement un tas de contraintes spécifiques supplémentaires auxquelles nous aurions dû faire face.

[07:27] Maybe we’ll cover those someday on my second channel.
  Peut-être que nous aborderons cela un jour sur ma deuxième chaîne.

[07:29] If today’s project interests you, and you’re in high school or college, you’d probably love to go into cybersecurity.
  Si le projet d'aujourd'hui vous intéresse et que vous êtes au lycée ou à l'université, vous aimeriez probablement vous lancer dans la cybersécurité.

[07:35] Well, perfect timing: I’ve got the ideal school to recommend—Oteria, the video sponsor.
  Eh bien, ça tombe bien : j'ai l'école idéale à vous recommander, Oteria, le sponsor de la vidéo.

[07:40] These days, everyone can code thanks to AI, but not many people really know cybersecurity.
  De nos jours, tout le monde peut coder grâce à l'IA, mais peu de gens connaissent vraiment la cybersécurité.

[07:44] So the code we cooked up works, that’s great, but it’s got huge holes everywhere, just waiting to be exploited.
  Donc le code que nous avons concocté fonctionne, c'est génial, mais il a d'énormes failles partout, qui ne demandent qu'à être exploitées.

[07:49] Knowing how to spot them and fix them.
  Savoir comment les repérer et les corriger.

[07:53] Doing DevSecOps becomes a super in-demand skill.
  Faire du DevSecOps devient une compétence très demandée.

[07:55] And a job in cyber is also a chance to become a pentester, hack companies legally, and get paid for it.
  Et un travail dans la cyber est aussi une chance de devenir pentester, de pirater des entreprises légalement et d'être payé pour cela.

[08:01] I can’t think of anything more fun to do.
  Je ne peux pas imaginer quelque chose de plus amusant à faire.

[08:03] And you can become all that thanks to Oteria, who’ll teach you every skill you need.
  Et vous pouvez devenir tout cela grâce à Oteria, qui vous enseignera toutes les compétences dont vous avez besoin.

[08:08] I got to attend their Capture the Flag on campus and see it with my own eyes.
  J'ai pu assister à leur Capture the Flag sur le campus et le voir de mes propres yeux.

[08:11] With them, it’s not just classes—it’s hands-on, real-world practice, and it pays off.
  Avec eux, ce ne sont pas seulement des cours, c'est de la pratique concrète, réelle, et cela porte ses fruits.

[08:15] Their Capture the Flag team ranks in the top three among French student teams.
  Leur équipe de Capture the Flag se classe dans le top trois des équipes étudiantes françaises.

[08:20] The program runs five years overall: a three-year bachelor’s track in AI, development, and hardware, then a two-year master’s with that specialization major.
  Le programme dure cinq ans au total : un cursus de licence de trois ans en IA, développement et matériel, suivi d'un master de deux ans avec cette spécialisation.

[08:28] But don’t take my blah-blah: they have an open house Saturday, February 7, 14:00 to 17:00.
  Mais ne vous contentez pas de mes paroles : ils organisent une journée portes ouvertes le samedi 7 février, de 14h00 à 17h00.

[08:33] Check it out and join their workshops to see how they teach and if you like it.
  Allez voir et participez à leurs ateliers pour découvrir comment ils enseignent et si cela vous plaît.

[08:37] You can even spend the day like an Oteria student.
  Vous pouvez même passer la journée comme un étudiant d'Oteria.

[08:40] It’s for high schoolers.
  C'est destiné aux lycéens.

[08:41] On Wednesday, February 25, you’ll sit in on programming classes, networking, hardware.
  Le mercredi 25 février, vous assisterez à des cours de programmation, de mise en réseau et de matériel.

[08:46] Everything’s focused on cybersecurity.
  Tout est axé sur la cybersécurité.

[08:48] I’ll put a link in the description.
  Je mettrai un lien dans la description.

[08:50] OK, so we can link two computers—two network cards, more precisely.
  OK, donc nous pouvons relier deux ordinateurs, ou plus précisément, deux cartes réseau.

[08:54] Now, we’d need to link to billions of machines.
  Maintenant, nous aurions besoin de nous connecter à des milliards de machines.

[08:56] But your PC can’t have a cable that connects it to everyone.
  Mais votre PC ne peut pas avoir un câble qui le relie à tout le monde.

[09:00] Let’s do it step by step.
  Faisons cela étape par étape.

[09:01] First, let’s connect to all the PCs close to us, physically—within the same home, for example.
  Tout d'abord, connectons-nous à tous les PC proches de nous physiquement, au sein d'une même maison par exemple.

[09:07] A first problem shows up: there are several machines we might want to reach.
  Un premier problème apparaît : il y a plusieurs machines que nous pourrions vouloir atteindre.

[09:11] We need a way to tell them apart: a unique identifier, so we can address the right recipient.
  Nous avons besoin d'un moyen de les distinguer : un identifiant unique, afin de pouvoir adresser le bon destinataire.

[09:17] That identifier is what we call the MAC address.
  Cet identifiant est ce que nous appelons l'adresse MAC.

[09:20] It’s unique to each network card in each machine, and it lets us clearly identify it.
  C'est unique à chaque carte réseau dans chaque machine, et cela nous permet de l'identifier clairement.

[09:25] That uniqueness is made possible thanks to the IEEE.
  Cette unicité est rendue possible grâce à l'IEEE.

[09:28] As soon as a company wants to manufacture network cards, it has to ask for a range of MAC addresses it can use.
  Dès qu'une entreprise veut fabriquer des cartes réseau, elle doit demander une plage d'adresses MAC qu'elle peut utiliser.

[09:33] A MAC address is a number made up of six bytes, written in hexadecimal.
  Une adresse MAC est un nombre composé de six octets, écrit en hexadécimal.

[09:38] With that, you can represent 2 to the power of 48 possible values.
  Avec cela, vous pouvez représenter 2 à la puissance 48 valeurs possibles.

[09:42] So, basically, we’re not about to run out.
  Donc, en gros, nous ne sommes pas près d'en manquer.

[09:44] We’ve now got an identity to label each possible recipient on the network.
  Nous avons maintenant une identité pour étiqueter chaque destinataire possible sur le réseau.

[09:48] But nothing ties us to any of them yet, not so far.
  Mais rien ne nous lie encore à aucun d'entre eux, pas jusqu'ici.

[09:51] And like I said earlier, we don’t want a cable for every single machine—that’d be a total mess.
  Et comme je l'ai dit plus tôt, nous ne voulons pas d'un câble pour chaque machine, ce serait un désordre total.

[09:56] The solution, since the early 2000s, is the switch.
  La solution, depuis le début des années 2000, est le commutateur.

[09:59] No, the switch.
  Non, le commutateur.

[09:59] Not “the Switch,” you dumbass.
  Pas « la Switch », espèce d'idiot.

[10:01] A switch is kind of a hub that every machine on our local network is connected to.
  Un commutateur est une sorte de concentrateur auquel chaque machine de notre réseau local est connectée.

[10:06] And when one machine wants to communicate with another, it can do it through the switch, without needing a direct connection.
  Et quand une machine veut communiquer avec une autre, elle peut le faire via le commutateur, sans avoir besoin d'une connexion directe.

[10:14] A few questions come up: how does the switch know which MAC address is connected to it?
  Quelques questions se posent : comment le commutateur sait-il quelle adresse MAC lui est connectée ?

[10:19] Right now, we’ve just plugged in some cables.
  Pour l'instant, nous avons juste branché des câbles.

[10:21] It’s a black box for the moment.
  C'est une boîte noire pour le moment.

[10:23] It’s never gotten the info on the connected MACs.
  Il n'a jamais obtenu les informations sur les adresses MAC connectées.

[10:25] So how can a machine tell it where to send its message?
  Alors, comment une machine peut-elle lui dire où envoyer son message ?

[10:28] We need some kind of shared language, a language that lets us say who our message is for, so it can be forwarded.
  Nous avons besoin d'une sorte de langage partagé, un langage qui nous permet de dire à qui notre message est destiné, afin qu'il puisse être transmis.

[10:34] This shared language is what we call the Ethernet protocol.
  Ce langage partagé est ce que nous appelons le protocole Ethernet.

[10:37] Before sending any data, the network card will basically just add the info needed to route it correctly, and it usually puts that in a header.
  Avant d'envoyer des données, la carte réseau ajoute simplement les informations nécessaires pour les acheminer correctement, et elle place généralement cela dans un en-tête.

[10:44] In that header, you’ll note, in particular, the recipient’s MAC address and the source MAC address—from us.
  Dans cet en-tête, vous noterez, en particulier, l'adresse MAC du destinataire et l'adresse MAC source, la nôtre.

[10:48] And then, right at the very front of it all, we don’t forget to add a preamble.
  Et puis, tout au début, nous n'oublions pas d'ajouter un préambule.

[10:53] A predefined sequence of bits that warns the machine that’s about to receive all this to wake up, and then tells it where this Ethernet frame begins, where it starts.
  Une séquence de bits prédéfinie qui avertit la machine sur le point de recevoir tout cela de se réveiller, puis lui indique où commence cette trame Ethernet.

[11:02] Because yeah, what we’ve made here, right here, is an Ethernet frame.
  Parce que oui, ce que nous avons créé ici, juste ici, est une trame Ethernet.

[11:06] A frame with a maximum size of 1500 bytes of useful data, no more.
  Une trame d'une taille maximale de 1500 octets de données utiles, pas plus.

[11:09] So if the message you need to send is huge, you have to split it into several Ethernet frames.
  Donc, si le message que vous devez envoyer est énorme, vous devez le diviser en plusieurs trames Ethernet.

[11:14] That’s mostly a reliability and network management thing.
  C'est principalement une question de fiabilité et de gestion du réseau.

[11:17] Basically, if you send five gigs of data in one go and there’s an error, it’d be a pain to have to
  En gros, si vous envoyez cinq gigaoctets de données en une seule fois et qu'il y a une erreur, ce serait pénible de devoir

[11:22] Resend everything.
  Renvoyez tout.

[11:23] But if it’s split into small chunks, you’ll only have to resend the frame that messed up, and that also helps keep the network from getting clogged.
  Mais s'il est divisé en petits morceaux, vous n'aurez qu'à renvoyer la trame qui a échoué, et cela aide aussi à éviter que le réseau ne soit encombré.

[11:30] But we’ll come back to that a bit later, in a moment.
  Mais nous y reviendrons un peu plus tard, dans un instant.

[11:33] Thanks to this extra info, another machine like the switch can very quickly tell exactly who I am, and also who my message is meant for.
  Grâce à ces informations supplémentaires, une autre machine comme le commutateur peut très rapidement savoir exactement qui je suis, et aussi à qui mon message est destiné.

[11:40] But we’ve still got the first problem to solve.
  Mais nous avons encore le premier problème à résoudre.

[11:42] Now, the switch knows what we want to do, but how does it know where the recipient is, who to forward this frame to?
  Maintenant, le commutateur sait ce que nous voulons faire, mais comment sait-il où se trouve le destinataire, à qui transmettre cette trame ?

[11:49] That’s thanks to its configuration.
  C'est grâce à sa configuration.

[11:51] And what’s great is, it’s completely automatic.
  Et ce qui est génial, c'est que c'est complètement automatique.

[11:54] It’s plug and play.
  C'est du plug and play.

[11:55] Here’s how it works.
  Voici comment cela fonctionne.

[11:55] At first, our switch knows nothing at all; it’s just cables plugged into a box for now.
  Au début, notre commutateur ne sait rien du tout ; ce ne sont pour l'instant que des câbles branchés dans une boîte.

[12:00] But as soon as it receives an Ethernet frame to forward out one of its interfaces, it can figure out which machine is connected to that port.
  Mais dès qu'il reçoit une trame Ethernet à transmettre par l'une de ses interfaces, il peut déterminer quelle machine est connectée à ce port.

[12:07] You look at the source MAC address in the frame.
  Vous regardez l'adresse MAC source dans la trame.

[12:09] It can then write that down in what’s called its switching table.
  Il peut alors l'inscrire dans ce qu'on appelle sa table de commutation.

[12:13] It records the MAC address, the associated interface, and an expiration time.
  Il enregistre l'adresse MAC, l'interface associée et un délai d'expiration.

[12:16] That way, if that device is no longer on our home network, the entry is automatically deleted.
  De cette façon, si cet appareil n'est plus sur notre réseau domestique, l'entrée est automatiquement supprimée.

[12:21] Alright, for now we’ve only got one entry in this table, and we don’t know where the recipient of
  Très bien, pour l'instant nous n'avons qu'une seule entrée dans cette table, et nous ne savons pas où se trouve le destinataire de

[12:26] The frame we were sent is.
  La trame qui nous a été envoyée est.

[12:27] So what do we do?
  Alors, que faisons-nous ?

[12:28] The switch isn’t gonna mess around: it’ll broadcast the message, meaning it sends it out through all its other interfaces, all its other cables.
  Le commutateur ne va pas tergiverser : il diffusera le message, ce qui signifie qu'il l'envoie via toutes ses autres interfaces, tous ses autres câbles.

[12:35] And it’s on the other machines to decide to themselves, “This message isn’t for me, so I just ignore it,” or “It’s for me, so I can read the data.”
  Et c'est aux autres machines de décider par elles-mêmes : « Ce message n'est pas pour moi, donc je l'ignore », ou « Il est pour moi, donc je peux lire les données ».

[12:43] Soon, the switching table we started building will include every machine on our network connected to our switch.
  Bientôt, la table de commutation que nous avons commencé à construire inclura chaque machine de notre réseau connectée à notre commutateur.

[12:49] And when a frame comes in, it can do what’s called forwarding: check its table, find the destination in it, the right interface, and send it the data.
  Et lorsqu'une trame arrive, il peut effectuer ce qu'on appelle le transfert : vérifier sa table, y trouver la destination, la bonne interface, et lui envoyer les données.

[12:57] And congratulations!
  Et félicitations !

[12:58] We’ve built a local area network, a local network.
  Nous avons construit un réseau local, un réseau local.

[13:01] Okay, back to our diagram, with all the machines.
  D'accord, revenons à notre schéma, avec toutes les machines.

[13:03] So right now, at this point, we’ve got lots of separate local networks, little homes in a way, and within each one our goal is already reached.
  Donc, pour l'instant, à ce stade, nous avons beaucoup de réseaux locaux séparés, de petites maisons en quelque sorte, et au sein de chacun, notre objectif est déjà atteint.

[13:11] What’s left to do—and this is a big one—is build an infrastructure that lets us send a message from one machine, from one home, to another, wherever it happens to be in the world.
  Ce qu'il reste à faire — et c'est un gros morceau — est de construire une infrastructure qui nous permet d'envoyer un message d'une machine, d'une maison, à une autre, où qu'elle se trouve dans le monde.

[13:20] And that problem was solved a long time ago by an infrastructure we all know: the post office.
  Et ce problème a été résolu il y a longtemps par une infrastructure que nous connaissons tous : la poste.

[13:25] If you understand the post office, you understand the Internet.
  Si vous comprenez le fonctionnement de la poste, vous comprenez Internet.

[13:28] You’re not gonna hand your mailman an envelope with the recipient’s social security number and expect him to find them.
  Vous n'allez pas remettre à votre facteur une enveloppe contenant le numéro de sécurité sociale du destinataire en vous attendant à ce qu'il le trouve.

[13:34] No, you write an address that’s gradually, step by step, more and more specific.
  Non, vous écrivez une adresse qui est progressivement, étape par étape, de plus en plus précise.

[13:38] You start with the most general info first, the country, so it can go to a national postal network like La Poste, for sorting and delivery, step by step.
  Vous commencez par les informations les plus générales, le pays, afin qu'il puisse être acheminé vers un réseau postal national comme La Poste, pour le tri et la distribution, étape par étape.

[13:46] They then check the ZIP code and pass your letter on to a regional network, which checks your city and brings it to a local network that checks the street, and hands it to the right households, who then give it to the right person.
  Ils vérifient ensuite le code postal et transmettent votre lettre à un réseau régional, qui vérifie votre ville et l'apporte à un réseau local qui vérifie la rue, et la remet aux bons foyers, qui la donnent ensuite à la bonne personne.

[13:58] This hierarchy of interconnected networks is the Internet.
  Cette hiérarchie de réseaux interconnectés est l'Internet.

[14:02] Replace postal networks with Autonomous Systems, ASs, and you’re almost there.
  Remplacez les réseaux postaux par des systèmes autonomes, les AS, et vous y êtes presque.

[14:07] In practice, those ASs are often Internet service providers, ISPs.
  En pratique, ces AS sont souvent des fournisseurs d'accès à Internet, les FAI.

[14:12] There are different tiers of ASs, interconnected, that together make up the Internet as a whole.
  Il existe différents niveaux d'AS, interconnectés, qui constituent ensemble l'Internet dans son ensemble.

[14:17] The biggest networks, what we call the Internet backbone, are the tier-one autonomous systems: AT&T, Orange, and companies like them.
  Les plus grands réseaux, ce que nous appelons l'épine dorsale de l'Internet, sont les systèmes autonomes de niveau un : AT&T, Orange et des entreprises comme celles-ci.

[14:25] They’re the ones who own the undersea cables we talked about earlier.
  Ce sont eux qui possèdent les câbles sous-marins dont nous avons parlé plus tôt.

[14:29] But what makes them tier one is that they can communicate with anyone on the net without paying transit fees.
  Mais ce qui fait d'eux des réseaux de niveau 1, c'est qu'ils peuvent communiquer avec n'importe qui sur le réseau sans payer de frais de transit.

[14:35] They do what’s called peering with each other, so they can reach pretty much anyone for free, just by sharing parts of their network.
  Ils pratiquent ce qu'on appelle le peering entre eux, ce qui leur permet d'atteindre pratiquement tout le monde gratuitement, simplement en partageant des parties de leur réseau.

[14:42] Tier two ASes are smaller.
  Les systèmes autonomes de niveau 2 sont plus petits.

[14:43] That’s where you tend to find national providers like Free or SFR, for example.
  C'est là que l'on trouve généralement des fournisseurs nationaux comme Free ou SFR, par exemple.

[14:47] They can absolutely do peering between themselves to send data for free, but if they ever have to use a Tier 1 AS to reach an IP, they’ll have to pay fees.
  Ils peuvent tout à fait faire du peering entre eux pour envoyer des données gratuitement, mais s'ils doivent un jour utiliser un système autonome de niveau 1 pour atteindre une adresse IP, ils devront payer des frais.

[14:56] Finally, there’s a Tier 3, even smaller, that has to pay Tier 2 or 1.
  Enfin, il existe un niveau 3, encore plus petit, qui doit payer les niveaux 2 ou 1.

[15:00] Local networks are often included in these ASes.
  Les réseaux locaux sont souvent inclus dans ces systèmes autonomes.

[15:03] It’s going to be individuals, universities, businesses.
  Il s'agit des particuliers, des universités et des entreprises.

[15:06] And each of these autonomous systems can also create internal sub-networks, subnets, to manage things better.
  Et chacun de ces systèmes autonomes peut également créer des sous-réseaux internes, des sous-réseaux, pour mieux gérer les choses.

[15:12] Typically, internet service providers will have geographic points of presence, for instance, where they’ll connect to all their customers living in Marseille, Strasbourg, the Creuse, and so on.
  En général, les fournisseurs d'accès à Internet disposent de points de présence géographiques, par exemple, où ils se connectent à tous leurs clients vivant à Marseille, Strasbourg, dans la Creuse, et ainsi de suite.

[15:23] Here we are with a kind of equivalent to the postal networks we saw earlier, more or less.
  Nous voici avec une sorte d'équivalent des réseaux postaux que nous avons vus plus tôt, plus ou moins.

[15:27] What we need now, at this point, is a hierarchical address, and you can probably guess which one:
  Ce dont nous avons besoin maintenant, à ce stade, c'est d'une adresse hiérarchique, et vous pouvez probablement deviner laquelle :

[15:32] It’s the Internet Protocol address.
  C'est l'adresse de protocole Internet.

[15:34] Four groups of eight bits, written in decimal format, with dots separating them.
  Quatre groupes de huit bits, écrits au format décimal, avec des points les séparant.

[15:38] Every address uniquely identifies a machine connected to the Internet.
  Chaque adresse identifie de manière unique une machine connectée à Internet.

[15:42] The gradual, hierarchical aspect of an IP address comes from the fact that each of these machines sits inside a network, which can itself sit inside an even larger network, and so on.
  L'aspect graduel et hiérarchique d'une adresse IP vient du fait que chacune de ces machines se trouve à l'intérieur d'un réseau, qui peut lui-même se trouver à l'intérieur d'un réseau encore plus grand, et ainsi de suite.

[15:52] And all the machines that belong to the same network necessarily share the same IP prefix, the same first bits.
  Et toutes les machines qui appartiennent au même réseau partagent nécessairement le même préfixe IP, les mêmes premiers bits.

[15:58] The bigger the network is, the smaller that prefix is, and the more there are inside it.
  Plus le réseau est grand, plus ce préfixe est petit, et plus il y en a à l'intérieur.

[16:04] You can write that with CIDR notation: a slash with the number of prefix bits.
  Vous pouvez écrire cela avec la notation CIDR : une barre oblique suivie du nombre de bits du préfixe.

[16:09] That splits our IP into two parts.
  Cela divise notre IP en deux parties.

[16:11] The subnet part—the sub-network—represented by this prefix, that all the machines or sub-networks inside it will share, and the host part, which will be unique to each machine or sub-network nested in it.
  La partie sous-réseau — le sous-réseau — représentée par ce préfixe, que toutes les machines ou sous-réseaux à l'intérieur partageront, et la partie hôte, qui sera unique à chaque machine ou sous-réseau imbriqué à l'intérieur.

[16:22] So if I want to communicate with that machine, for example, just like that, I don’t have to bother, you know, taking the time to track it down directly, right there in the middle of billions of other IPs.
  Donc, si je veux communiquer avec cette machine, par exemple, juste comme ça, je n'ai pas à m'embêter, vous savez, à prendre le temps de la localiser directement, juste là au milieu de milliards d'autres adresses IP.

[16:31] I can dramatically narrow down my search, whenever I need to.
  Je peux considérablement restreindre ma recherche, chaque fois que j'en ai besoin.

[16:35] I can begin by first looking for the biggest network it belongs to, based on its prefix, which means I no longer have to search across 32 bits, but only across eight bits here.
  Je peux commencer par chercher le plus grand réseau auquel il appartient, basé sur son préfixe, ce qui signifie que je n'ai plus à chercher sur 32 bits, mais seulement sur huit bits ici.

[16:43] And that makes things a lot simpler.
  Et cela rend les choses beaucoup plus simples.

[16:45] Once that network is found, I hand it my message, and it’ll take care of finding the second-biggest network the recipient belongs to.
  Une fois ce réseau trouvé, je lui remets mon message, et il se chargera de trouver le deuxième plus grand réseau auquel appartient le destinataire.

[16:52] Since it’s nested inside it, that’s easy: there are only so many of them.
  Puisqu'il est imbriqué à l'intérieur, c'est facile : il n'y en a qu'un nombre limité.

[16:56] And so on, until all we’re left with is searching a limited number of full IP addresses.
  Et ainsi de suite, jusqu'à ce qu'il ne nous reste plus qu'à rechercher un nombre limité d'adresses IP complètes.

[17:00] That’s what we call route aggregation, and that’s what makes the Internet scalable.
  C'est ce qu'on appelle l'agrégation de routes, et c'est ce qui rend Internet évolutif.

[17:05] And that’s also what lets you infer your location.
  Et c'est aussi ce qui vous permet de déduire votre emplacement.

[17:08] Like I said earlier, ISPs have geographic points of presence, and your public IP has the prefix of a point of presence.
  Comme je l'ai dit plus tôt, les FAI ont des points de présence géographiques, et votre IP publique possède le préfixe d'un point de présence.

[17:15] So I know you live in Marseille just from your IP.
  Donc je sais que vous habitez à Marseille juste à partir de votre IP.

[17:18] The allocation of these IP addresses is handled by organizations, like MAC addresses; the RIRs do it.
  L'attribution de ces adresses IP est gérée par des organisations, tout comme les adresses MAC ; ce sont les RIR qui le font.

[17:23] They give an Autonomous System an IP range to use called a prefix, plus a number.
  Ils donnent à un système autonome une plage IP à utiliser appelée préfixe, plus un numéro.

[17:29] From there the AS can then use that range to create subnets, assign IP ranges to its customers, and
  À partir de là, l'AS peut ensuite utiliser cette plage pour créer des sous-réseaux, attribuer des plages IP à ses clients, et

[17:36] So on.
  Ainsi de suite.

[17:36] Okay, you see the idea, right?
  D'accord, vous voyez l'idée, n'est-ce pas ?

[17:38] Now let’s talk practical.
  Parlons maintenant de choses pratiques.

[17:39] That IP address we were talking about, we need to include it as well in our data, in the packet itself, so it can be routed, like we did for the MAC.
  Cette adresse IP dont nous parlions, nous devons également l'inclure dans nos données, dans le paquet lui-même, afin qu'elle puisse être routée, comme nous l'avons fait pour l'adresse MAC.

[17:47] So, we’ll do exactly the same thing.
  Donc, nous ferons exactement la même chose.

[17:49] We add a header with a destination IP and a source IP.
  Nous ajoutons un en-tête avec une IP de destination et une IP source.

[17:52] Put together, that makes an Internet datagram, just like for Ethernet.
  Mis ensemble, cela forme un datagramme Internet, tout comme pour Ethernet.

[17:55] Just like Ethernet, for the same reasons, our data has to be split into packets with a maximum length.
  Tout comme pour Ethernet, pour les mêmes raisons, nos données doivent être divisées en paquets avec une longueur maximale.

[18:01] In theory it’s 65 535 bytes, but in practice we use Ethernet’s value: 1500 bytes.
  En théorie, c'est 65 535 octets, mais en pratique, nous utilisons la valeur d'Ethernet : 1500 octets.

[18:06] Because the Internet protocol is simply an extra layer on top of the Ethernet protocol we built earlier, and it’s what we use to encapsulate the Internet datagram.
  Parce que le protocole Internet est simplement une couche supplémentaire au-dessus du protocole Ethernet que nous avons construit précédemment, et c'est ce que nous utilisons pour encapsuler le datagramme Internet.

[18:16] Because, in fact, the info in the Ethernet header is absolutely crucial to go from one machine to the next, as we just saw.
  Parce qu'en fait, les informations contenues dans l'en-tête Ethernet sont absolument cruciales pour passer d'une machine à la suivante, comme nous venons de le voir.

[18:22] If a network card receives a packet that doesn’t have its MAC address, it ignores it.
  Si une carte réseau reçoit un paquet qui ne contient pas son adresse MAC, elle l'ignore.

[18:27] The network card, it doesn’t know what an IP address is.
  La carte réseau ne sait pas ce qu'est une adresse IP.

[18:30] So we can see the Internet as the layer that lets us trace a route from one destination to another.
  Nous pouvons donc considérer Internet comme la couche qui nous permet de tracer un itinéraire d'une destination à une autre.

[18:35] And Ethernet is the layer that lets us go from one machine to another, to do one step on that.
  Et Ethernet est la couche qui nous permet de passer d'une machine à une autre, pour effectuer une étape sur ce trajet.

[18:40] Journey.
  Voyage.

[18:40] You need both, and they complement each other.
  Vous avez besoin des deux, et ils se complètent.

[18:43] And the machines along our route—those are what we call routers.
  Et les machines le long de notre itinéraire, c'est ce que nous appelons des routeurs.

[18:47] They’re linked together, and their job is to carry data from one Internet Protocol address to another.
  Ils sont reliés entre eux, et leur travail consiste à transporter des données d'une adresse de protocole Internet à une autre.

[18:52] To do that, packets arrive at their input ports, where a queue can form.
  Pour ce faire, les paquets arrivent à leurs ports d'entrée, où une file d'attente peut se former.

[18:57] It isn’t infinite, and if there’s heavy congestion, we could lose new arrivals.
  Elle n'est pas infinie, et en cas de forte congestion, nous pourrions perdre les nouvelles arrivées.

[19:01] So we need to redirect them fast.
  Nous devons donc les rediriger rapidement.

[19:03] The router will take each packet and look at where it needs to go, using its destination IP, and forward it to the next router on its path.
  Le routeur prendra chaque paquet et regardera où il doit aller, en utilisant son adresse IP de destination, et le transmettra au routeur suivant sur son chemin.

[19:10] The question now is: how does the router know which route to follow?
  La question est maintenant : comment le routeur sait-il quel itinéraire suivre ?

[19:14] The answer will depend on where we are on the internet.
  La réponse dépendra de l'endroit où nous nous trouvons sur Internet.

[19:17] When we’re looking for a route inside an AS, we can know all the routers that are in it, which means we can use a Link State routing protocol based on the famous Dijkstra algorithm.
  Lorsque nous recherchons un itinéraire au sein d'un AS, nous pouvons connaître tous les routeurs qui s'y trouvent, ce qui signifie que nous pouvons utiliser un protocole de routage à état de lien basé sur le célèbre algorithme de Dijkstra.

[19:27] Now, let’s represent our AS as a graph.
  Maintenant, représentons notre AS sous forme de graphe.

[19:29] In this graph, simply a node is a router.
  Dans ce graphe, un nœud est simplement un routeur.

[19:32] And an edge is a cable that links it to another.
  Et une arête est un câble qui le relie à un autre.

[19:34] Each edge has a weight.
  Chaque arête a un poids.

[19:35] The higher it is, the more expensive it is to take that cable, so we’ll want to avoid it.
  Plus il est élevé, plus il est coûteux d'emprunter ce câble, nous voudrons donc l'éviter.

[19:40] That can, for example, be tied to bandwidth.
  Cela peut, par exemple, être lié à la bande passante.

[19:42] The lower it is, the more it makes sense to go another way to get there faster.
  Plus c'est bas, plus il est logique d'emprunter un autre chemin pour y arriver plus rapidement.

[19:46] So we’d assign a high weight to discourage that path.
  Nous attribuerions donc un poids élevé pour décourager ce chemin.

[19:48] But from a router’s point of view, for now it knows none of that.
  Mais du point de vue d'un routeur, pour l'instant, il ne sait rien de tout cela.

[19:52] It only knows its neighbors, the ones it’s directly linked to.
  Il ne connaît que ses voisins, ceux auxquels il est directement relié.

[19:55] In fact, each router sends an LSA message that floods to all the other routers.
  En fait, chaque routeur envoie un message LSA qui est diffusé à tous les autres routeurs.

[20:00] In it, it says who it is, the Internet Protocol address of its interfaces, and which prefix it can serve.
  Il y indique qui il est, l'adresse IP de ses interfaces et quel préfixe il peut desservir.

[20:05] In some cases, the internal routers in that area can be hidden from the other routers;
  Dans certains cas, les routeurs internes de cette zone peuvent être cachés des autres routeurs ;

[20:10] they only know the exit router, which makes things simpler.
  ils ne connaissent que le routeur de sortie, ce qui simplifie les choses.

[20:13] It also lists in the LSA its neighboring routers and the cost associated with reaching them.
  Il liste également dans le LSA ses routeurs voisins et le coût associé pour les atteindre.

[20:17] And once the router has received all the LSA messages, it has the complete network.
  Et une fois que le routeur a reçu tous les messages LSA, il possède la topologie complète du réseau.

[20:21] We can use Dijkstra’s algorithm to fill what’s called the routing table, which, for a given destination, tells the next step along the path.
  Nous pouvons utiliser l'algorithme de Dijkstra pour remplir ce qu'on appelle la table de routage, qui, pour une destination donnée, indique la prochaine étape du chemin.

[20:29] Let’s put ourselves as router A in this graph, and run Dijkstra for it.
  Mettons-nous dans la peau du routeur A dans ce graphe et exécutons Dijkstra pour lui.

[20:33] We’re going to visit every other node in the graph, and each time, write down the shortest path to reach the nodes we come across.
  Nous allons visiter chaque autre nœud du graphe et, à chaque fois, noter le chemin le plus court pour atteindre les nœuds que nous rencontrons.

[20:39] We start where we are, at node A.
  Nous commençons là où nous sommes, au nœud A.

[20:41] We can see we can reach our neighbors with the cost, based on the weights of the edges.
  Nous pouvons voir que nous pouvons atteindre nos voisins avec le coût, basé sur les poids des arêtes.

[20:45] The other nodes, we have no way to contact them for now, so we mark them as unreachable.

[20:50] Next we visit the closest node, that is E.

[20:53] We move there and look at its neighbors.

[20:55] We see we can reach F at one plus three equals four units of cost, and that’s it.

[21:00] We visit the next closest node, C.

[21:02] We look at its neighbors and do the same update again.

[21:05] We can reach B faster, in three instead of four, so we replace what we wrote down.

[21:10] Same for F, it’s faster.

[21:11] And finally, we add D.

[21:13] Then we visit B, which lets us reach D faster, so we note that down in our notes.

[21:17] And to finish up, we visit F and D.

[21:19] But those don’t change anything;

[21:21] we’re done, we’ve got all the most optimized routes to traverse our graph.

[21:25] So, thanks to the LSA, we know which prefix is reachable via which router, and thanks to Dijkstra,

[21:31] the fastest route to reach it.

[21:32] With those two pieces of info, we can fill in the routing table.

[21:36] When a packet reaches this router, we look at its destination,

[21:39] then check which prefix in the routing table gives the longest possible match with that Internet

[21:44] Protocol address, and forward the packet right on to the next router along its path.

[21:48] If we don’t get any match, there’s usually a default route you can use, and it will typically

[21:53] forward the packet on to a more general router—say, the router you have at home.

[21:57] So, in effect, all packets will follow this default route, and it will take the packet to a first

[22:02] router at your internet service provider, for your connection.

[22:04] We know how to build routes within an AS, sure, but for routes that need to cross several ASes, it

[22:09] gets a lot trickier.

[22:10] We can’t just talk to every router, so we don’t have a complete view of the network.

[22:14] That means Dijkstra is unusable here.

[22:16] So, in the end, how do we do it?

[22:18] Well, we can build our routes thanks to efficient communication between neighboring routers, using

[22:23] BGP. So, picture this situation: a new AS wants to join the internet.

[22:27] It begins by announcing its presence to a router in a neighboring AS, through external BGP.

[22:32] In other words, it tells it, “You can reach me;

[22:35] I’m your next hop,” as far as routing is concerned.

[22:37] The router in AS 2 adds to its BGP table that it can reach AS 4.

[22:41] It also has to warn its neighbors.

[22:43] Except it’s that router there that’s connected to the others.

[22:47] So you need to inform it, by propagating the info to the internal routers with an internal BGP.

[22:53] Router 4 gets the info: to reach AS 4, go through me, router 2.

[22:56] Router four then adds to its routing table that, to reach AS 4’s prefix, you have to go through

[23:02] router two.

[23:03] Same for router three: it checks how to reach router two in its table, sees it has to go through

[23:08] router number four, and so it adds AS 4’s prefix with router four as the next hop.

[23:12] And finally, same thing for router one, except it also notifies AS one and three via external BGP,

[23:18] giving them the route to AS4 and their next hop: that router one in AS 2.

[23:23] Both ASes take note of this info;

[23:25] they know AS4 exists and how to reach it.

[23:27] They forward it internally.

[23:29] And finally, they’ll let each other know about a new route to AS 4.

[23:33] AS 1, for example, will tell AS 3: you can reach it through me, AS 2, and AS 4.

[23:38] So two routes are written down to reach AS 4 via AS 3.

[23:41] The info is spread internally, then AS 3, in turn, will try to tell AS 2 about this new route.

[23:46] Except AS2 is already on that route, so it’s pointless to go further.

[23:51] So the info stops spreading, and that’s it.

[23:53] And there you go: everyone knows about AS4.

[23:56] You’ll notice that AS1 and AS3 have two routes to reach AS4.

[23:59] To choose which one will be used:

[24:01] Usually, you just take the shortest path, but actually distance isn’t the number-one criterion.

[24:07] There are several, and the main one for this choice is the local preference picked by the AS

[24:12] administrator. Let’s say we also have this route to reach AS 4.

[24:16] Normally this one is faster, but maybe transit through AS 2 is paid.

[24:20] So the administrator asks his routers to favor this route, because there are agreements with that AS

[24:26] to transit for free.

[24:27] Once the preferred route is chosen, the router can fill its routing table with the new AS prefix and

[24:33] the next router’s IP.

[24:34] And there you go: we know how to reach any local network thanks to the combo of BGP and Link State.

[24:41] Up to now, we’ve only talked about IP.

[24:43] Our protocols rely only on IPs.

[24:45] Except we need a MAC address to send from one machine to another, from one router to another, for

[24:50] instance. So we need a translation tool inside the machines.

[24:53] That way, we can quickly map an IP to a MAC.

[24:56] And that tool is ARP.

[24:57] A protocol that automatically builds an IP-to-MAC mapping table inside a machine.

[25:01] Basically, as soon as the machine wants to send a message to an IP, it checks its ARP table.

[25:07] If it’s not in there, we send an ARP packet to our whole local network.

[25:11] So that packet won’t go past the routers.

[25:13] And between routers, it’ll stay just between them, basically.

[25:17] And this packet just asks who owns that IP address.

[25:20] If it belongs to a machine, it replies: it’s me.

[25:22] Here’s my MAC address.

[25:24] An address we can use in the Ethernet header to send our data.

[25:27] And if we want to send a message to an IP outside our local network, we know it right away,

[25:31] immediately. So then we put in the MAC of the nearest router, so we can use the Internet Protocol.

[25:36] The router receives the data, looks at the destination IP, finds the next router’s IP in its routing

[25:41] table, and grabs the matching MAC using its ARP table.

[25:44] It builds an Ethernet header with this new MAC, re-encapsulates the data with it, and sends it to

[25:49] the next router. And so on.

[25:51] Okay, so you’re thinking we’re doing pretty well—except we’ve got a huge problem.

[25:55] Literally. An IP is 32 bits;

[25:57] that’s 4 billion and change possible addresses.

[25:59] Except there are way more than 4 billion machines connected to the Internet.

[26:03] Luckily, there’s a really clever solution.

[26:05] Basically, several devices on a local network all share the same IP address, the router’s.

[26:10] And then you’re thinking, wait, how can that possibly work?

[26:13] If I want to talk to Claude’s computer, it still needs its own unique IP address.

[26:18] And it does. That’s where private IPs come in.

[26:21] But to build them, we first of all need to introduce a new concept: Internet ports.

[26:25] Reaching a machine is good.

[26:27] Reaching the right software—the right bit of code that actually needs that data—is better.

[26:32] That’s what a port number is for: to identify the software requesting the incoming data.

[26:36] We’ll add that info into one last header layer, which we’ll talk about in more detail in a moment.

[26:41] Usually, you write the port after the Internet Protocol address with a colon, then its number.

[26:46] OK, keep that in mind, it’s gonna be useful.

[26:48] When a computer wants to join your router’s local network, it has to ask what’s called a DHCP server

[26:54] for an IP address to use.

[26:55] To do that, it sends a DHCP request to the whole local network, because it doesn’t know the server’s

[27:00] address, so it sends it everywhere.

[27:02] The server gets that request and will offer our computer an IP address it picked from its pool of

[27:08] IPs. That pool is chosen by the network administrator.

[27:11] So it could totally be public IPs reachable from anywhere, but in our case it’ll be a private IP.

[27:17] A private IP is just an IP from a predefined, reserved range.

[27:20] These IPs only make sense inside your local network, because the same ones can be used by another

[27:25] machine as well, on another local network.

[27:28] So they’re unusable the moment you leave that local network.

[27:31] And what our router does, basically, is that as soon as a machine with a private IP wants to make an

[27:36] Internet request, it writes it down in a so-called NAT table.

[27:40] It notes that machine’s private address and its source port, and links them to its own IP address

[27:45] and one of its free ports, chosen at random.

[27:48] Then it swaps the IP and the port in the header for its own, and sends the whole request out onto

[27:52] the Internet.

[27:53] And when that request gets a reply back, the reply comes back to the router’s IP, on the port it had

[27:57] chosen. Then it just looks in the NAT table to see who it swapped that port with.

[28:01] Replace the IP again, and then forward the response back to the machine on the local network that

[28:07] actually has that private IP.

[28:08] That’s how thousands of machines can share just one IP address, the one belonging to their router.

[28:14] But even with all that, there’s still a shortage of IP addresses, so we’re transitioning, little by

[28:18] little, from IP version four to IP version six, which is basically the same thing—just a whole lot

[28:23] longer.

[28:24] And we took the opportunity to improve two or three things along the way, but overall, it’s the same

[28:29] thing. Okay, last thing about IP addresses: they’re a pain to remember.

[28:33] So we tie them to a domain name.

[28:35] Wow! So human!

[28:37] We store the mapping on a DNS server, and when you make a request for YouTube.

[28:41] com, for instance, your computer will contact a DNS to get the matching IP address and use it.

[28:47] I think we can give ourselves a hand.

[28:48] We can reach any machine in the world now, but we reach it any which way, and there’s zero control

[28:53] over what happens.

[28:54] Packets can arrive in a total mess, completely out of order, and some can even just get lost along

[28:59] the route.

[29:00] That has to change, so it’ll be up to the sender and the receiver to take care of it, through a

[29:05] layer called transport.

[29:06] And the one we’re going to look at, really in detail, is the most popular one on the Internet: TCP.

[29:11] To do our checks, we need some information to check, and you can probably guess it already: it’s

[29:15] sitting in yet another header we add on top, packed with a whole bunch of useful data.

[29:19] We’ll talk about each field later, when we actually need it, but you can already spot right there

[29:25] those famous source and destination ports we mentioned earlier.

[29:28] All of it together makes up a TCP segment, and the whole thing has to stay under 1500 bytes because

[29:33] of Ethernet.

[29:34] The first step, if you want to send data reliably, is to establish a connection, with what’s called

[29:39] a three-way handshake.

[29:40] So the receiver reaches out to the sender by sending a TCP segment.

[29:44] In the header of that segment, the SYN flag is set, which means it wants to start the transmission

[29:49] from the start.

[29:50] The receiver also picks a sequence number at random, but, well, to keep things simple for now, let’s

[29:55] say it’s zero.

[29:56] That number is what will let us number the packets we’re going to send, so we can reorder them

[30:01] correctly afterward and still be sure we don’t miss any at all.

[30:04] The sender replies with its own TCP segment, and it includes the SYN-ACK flag, for acknowledgment.

[30:09] He approves.

[30:10] He gives an Acknowledgement number, which is equal to the next packet number he expects to receive.

[30:15] You calculate it by taking the sequence number sent by the receiver and adding the number of bytes

[30:21] received. Here, just one, so it’s one.

[30:23] That way, you can be sure he received that packet.

[30:25] The sender also adds its own sequence number, normally random, but let’s say zero to keep things

[30:30] simple. And finally, the receiver replies with one last message, with the acknowledgement flag.

[30:36] The acknowledgment number equals the sender’s packet number plus the number of bytes received, which

[30:41] is one, and its sequence number is indeed one, just as the sender expected.

[30:45] The connection is established;

[30:46] the sender can now send its data.

[30:48] For example, it sends a packet with 1000 bytes.

[30:50] The receiver gets that and sends an ACK back to the sender in response, with an acknowledgment

[30:55] number of 1001.

[30:56] That tells the sender everything’s fine, that it got the 1000 bytes, and then we just do it again.

[31:01] And if there’s ever a problem, there won’t be an ACK coming back.

[31:05] It’ll time out on the sender’s side, and it’ll resend the packet.

[31:08] But we agree, sending one packet at a time is pretty slow.

[31:11] We’d like to send as many packets as possible, so we get good throughput.

[31:15] And that’s exactly what we’re gonna do here.

[31:17] The number of bytes we can send like this depends on two things.

[31:21] Number one: the receiver’s buffer capacity.

[31:23] Number two. If the Internet is congested, we won’t be able to go as fast.

[31:27] We have no way to know that ahead of time, for sure.

[31:29] But the sender is the one that’s going to find that exact value, by itself.

[31:33] Right at the very start, it’ll send just one packet.

[31:36] If it goes well, it’ll send two, then four, then eight, and so on.

[31:39] And as soon as we drop a packet, we know right away that we’re going too fast.

[31:43] Then we cut the number of packets we send in half, and we ramp up again much more gradually, until

[31:48] we lose one again. We bring the rate back down, and do it again, over and over.

[31:52] That gives a sawtooth pattern around the optimal rate.

[31:54] Thanks to all that, we can send data reliably.

[31:57] But maybe you need speed.

[31:58] You don’t care if it’s in the right order, if a pixel is missing, for example for voice chat.

[32:03] Well then you’re not gonna use TCP, you’ll probably use UDP.

[32:07] Its header, by comparison, is tiny, and for a good reason:

[32:10] We check nothing, we just blast it out as fast as we can, and we don’t care if the data actually

[32:15] ever arrives. Speaking of data, the receiver and the sender also need to agree on what,

[32:19] exactly, they’re exchanging with each other, so that they can provide a specific service—like

[32:24] displaying a web page,

[32:26] for instance—using HTTP, which defines how a web resource should be sent and requested.

[32:30] It’s one of the many application-layer protocols that lets you structure data properly, so that you

[32:36] can send emails, display a web page, transfer files—basically, just do something useful with your

[32:42] data, you know.

[32:43] Okay, so we’ve got a way to send bits down a cable, thanks to what’s called the physical layer.

[32:48] A way to address them to the right machine through a link layer,

[32:51] and then carry them clear to the other side of the world through a network layer,

[32:55] all while making sure the delivery is reliable and reaches exactly the right application,

[32:59] in the end, with the TCP protocol, which makes up the transport layer.

[33:03] And finally, we can structure the data we send, so it provides a specific, really useful service,

[33:08] with an application layer like HTTP.

[33:10] So yeah—anyway, we’ve basically rebuilt the whole internet from scratch.

[33:13] I think that’s worth a subscription, right?

[33:16] Maybe a like, maybe a comment?

[33:17] In any case, thanks a lot for watching the video, and I’ll see you next time!
