Let's read the Linux TCP source code

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2024

ความคิดเห็น •

  • @adalbertofelipe
    @adalbertofelipe ปีที่แล้ว +67

    Nice analysis! Sometimes, to read a source code of a complex protocol is hard, but with a experienced programmer become less complicated.

  • @loganhoneycutt5398
    @loganhoneycutt5398 ปีที่แล้ว +2

    I have absolutely no clue wtf is being talked about but I am still here watching. Subscribed.

  • @pushqrdx
    @pushqrdx ปีที่แล้ว +6

    Never knew i'd enjoy this type of content so much, it's unique and weirdly entertaining. subscribed

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +2

      lol, that's a perfect description. I'm glad you're enjoying it!

  • @rdubb77
    @rdubb77 ปีที่แล้ว +76

    Vint Cerf and Bob Kahn's creation literally powers the modern world. Cannot overstate what they accomplished.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +10

      Yeah it really is amazing

    • @ImperiumLibertas
      @ImperiumLibertas ปีที่แล้ว +6

      Plumbing, antibiotics, TCP IP

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      lol, the history of human civilization :)

    • @Miles-co5xm
      @Miles-co5xm 4 หลายเดือนก่อน

      World was same before plumbing and antibiotics

    • @chucky29949
      @chucky29949 21 วันที่ผ่านมา

      @@Miles-co5xm really? i think before those there was more bacteria in the world. especially in humans.

  • @wiseskeshom4673
    @wiseskeshom4673 ปีที่แล้ว +10

    Wow, what a great idea, I really enjoyed it. I can't believe that there is a cool channel like this exist in TH-cam.
    I also like the idea of a full live video like this. please keep this style on going. I've learned a lot when you make a guess to how the code should work.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +3

      Thanks! When I started, I never expected anyone would call this a cool channel. I'm really glad it seems to be resonating with some people :)

    • @paulstelian97
      @paulstelian97 ปีที่แล้ว +1

      Is this the idea behind the channel, jumping in code without learning frameworks and everything around it?

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +3

      Hey, sorry it's taken me so long to respond. I'm seeing a bunch of comments I missed from a few weeks ago.
      Yes, that's the idea behind the channel. It's definitely a channel about jumping into code. Learning frameworks around things is definitely a good idea, but you sometimes need to understand a piece of code before you have the luxury of learning the surrounding context. So not having a requirement to understand the frameworks has allowed us to explore much more than we could have if each repo had a list of prerequisites.

  • @AshishKumar-qi5gk
    @AshishKumar-qi5gk ปีที่แล้ว +2

    Great video. This also explains why we see subtle differences in the TCP stack implementation in Linux and in Windows.

  • @JoneKone
    @JoneKone ปีที่แล้ว +3

    This is what chatGPT said about sock and socket. 40:50
    In the context of the Linux kernel's implementation of the TCP protocol, tcp_sock and tcp_socket are related but distinct data structures that represent different aspects of a TCP connection.
    tcp_sock is a data structure that represents a TCP socket at the transport layer. It is used to manage the state of a TCP connection, including things like the sequence numbers and window sizes used for flow control, as well as various TCP options and flags. Each tcp_sock structure is associated with a particular inet_sock structure, which represents the socket at the network layer.
    tcp_socket, on the other hand, is a data structure that represents a TCP socket from the perspective of the Linux kernel's networking stack. It contains various fields and methods used to manage the socket's state and handle network I/O operations, and is used to interface with the tcp_sock structure at the transport layer.
    In short, tcp_sock represents the TCP connection itself, while tcp_socket represents the Linux kernel's view of the TCP connection as a network socket.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      That is excellent thank you! This is also the conclusion I came to. I did a follow up video on the Linux socket code. I looked at both sock and socket. The video has time stamps created by another TH-camr that shows when I'm looking at socket vs sock. th-cam.com/video/mkWgvsYu7Rs/w-d-xo.html

  • @nguyenhoangminh6775
    @nguyenhoangminh6775 ปีที่แล้ว +33

    Wow, your channel is great, unique, exciting. Reading source code of major software is interesting and enthusiastic newbies need some help [like me]. Keep going!

  • @andelsonnicolaslopezysabel2501
    @andelsonnicolaslopezysabel2501 ปีที่แล้ว +1

    Always waiting for you awesome videos, full of useful information.

  • @antonfernando8409
    @antonfernando8409 10 หลายเดือนก่อน +2

    Nice job, me first time looking into tcp code or any linux github code for that matter, great into.

  • @linonator
    @linonator ปีที่แล้ว +1

    I just found a TH-cam gem ! Happy your vid showed up on my timeline

  • @yimyim117
    @yimyim117 ปีที่แล้ว +4

    Nice analysis! I'm currently studying computer science and one big thing I learned is looking through source code of implementations is a key in developing real programming skills.
    Also I'm amazed about how you go through everything unedited with your real thought process, that's a crucial part in developing the skills and also empowers people to try it out themselves.
    People get scared pretty fast when they see youtubers going through code like it's butter and understanding everything on the spot(almost nobody does lol)
    Had to smirk a bit though when you forgot bitshift is multiplication by base 2 :'). Honestly although I've thoroughly learned the OSI and TCP/IP Model and especially TCP with congestion control this videos showed me how fast you can literally "unlearn" all these concepts if you don't do repetition atleast one a few months.

    • @axesaspw
      @axesaspw ปีที่แล้ว

      You are DDOS MASTER?

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      > Also I'm amazed about how you go through everything unedited with your real thought process, that's a crucial part in developing the skills and also empowers people to try it out themselves.
      Thank you so much, it means a lot to me to get comments like this. I feel like you understand what I'm up to, which is honestly something I'm not sure I always understand myself :).
      > Had to smirk a bit though when you forgot bitshift is multiplication by base 2 :')
      Lol, in my defense, while I often confuse >, I always remember one multiplies by 2 and the other divides by two. I guess the mnemonic I should remember is that "a

  • @internethistory6957
    @internethistory6957 ปีที่แล้ว +3

    there are only few who makes such video. thanks.

  • @thedevlavender
    @thedevlavender 6 หลายเดือนก่อน +1

    Interesting concept, it's like when your read for a kid. You're not just decoding the text for the kid, you're building literary. Although one could likely benefit more by having the code read by someone familiarized with it. If Alan Cox was reading the code with you that would have been perfect lol

  • @adrianbiro2167
    @adrianbiro2167 ปีที่แล้ว +3

    Cool content, looking forward to learning something with you, thanks for the video!

  • @pawarranger
    @pawarranger ปีที่แล้ว +3

    wow nice video concept, I've always wanted something like this

  • @dealwithit1556
    @dealwithit1556 ปีที่แล้ว +2

    Really interesting video, I have just started learing about TCP and this is awesome

  • @coop_0128
    @coop_0128 ปีที่แล้ว +1

    Very cool vid, l just stumbled on this in my recommended videos, thanks!

    • @coop_0128
      @coop_0128 ปีที่แล้ว +1

      Just want to add: as I watch the video I really enjoy seeing your research process live, it’s really useful to try to apply these techniques for myself when going through source code or reading documentation!

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว

      Thank you and welcome!

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว

      Oh great! Let me know how it works!

  • @Azazog
    @Azazog ปีที่แล้ว +1

    Great video! Wishing you all the best with your channel, happy I found you, subscribed.

  • @bloodmercury7047
    @bloodmercury7047 ปีที่แล้ว +1

    very intersting concept and very useful keep up the good videos

  • @Auxytocin
    @Auxytocin ปีที่แล้ว +1

    chill videos to fall asleep to. youtube algorithm brought me here (not saying it's boring btw)

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      Awesome 😁I fully support falling asleep to my stuff. My dream would be to achieve Bob Ross levels of chill.

  • @amitozsidhu6693
    @amitozsidhu6693 ปีที่แล้ว +1

    just stumbled upon this video and channel and its amazing

  • @r1nlx0
    @r1nlx0 ปีที่แล้ว +1

    The content looks great, subscribed

  • @Frastio10
    @Frastio10 ปีที่แล้ว +1

    wow thanks, it helped me alot, i always wonder how people read big open source codes. thank you for the video!

  • @sparshpriyadarshi
    @sparshpriyadarshi ปีที่แล้ว +1

    love this archeology thing you've going on here... subbed

  • @beauremus
    @beauremus ปีที่แล้ว +5

    This is a video style I didn't expect to like!
    How do you feel about more descriptive variable names? It seems to me it could have saved you leaving the code on several occasions.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +2

      I'm glad you like it!
      I'm a fan of descriptive variable names. Names can get really long in some styles of Java, but I find them a bit terse in this style of C. If I had to guess, I'd say that descriptive variable names and a handful of targeted code comments are probably the quickest way to improve the readability of a code base.

  • @JamesSjaalman
    @JamesSjaalman ปีที่แล้ว +2

    Before diving into the details, please do some reading. Suggested reading: Comer, and Stevens.. BTW: most of the congestion avoidance and window negotiaition code should be considered (important) details. And Nagle is certainly one of the important details.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      Hey thanks for the book recommendation.

    • @JamesSjaalman
      @JamesSjaalman ปีที่แล้ว +1

      The point of my (pedantic, I'm sorry ...) suggestion is that the ip.h and tcp.h structurers in Comer are basically the same, including identifiers.(of course lhe Linux stack added some fields, etc, but the skeletton remained)
      @@ants_are_everywhere

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      @@JamesSjaalman I'm always happy to get book and reference recommendations 🙂. I'll take a look at the structures in Comer (and a few other books) before I do the sockets stream next week. I think that should help orient me more.

  • @searchthefacts6171
    @searchthefacts6171 ปีที่แล้ว +1

    nice video bro ,the video that i need for long time

  • @thebirdhasbeencharged
    @thebirdhasbeencharged ปีที่แล้ว +9

    Pairing these with chatgpt is incredible, feels like I could have written this myself lol. Great job. Suggestion for a future video is a package manager, message queue and database (sqlite).

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +4

      Thank you! These are great suggestions.
      For package managers, I've done Guix and Nix if you want to count them. I am planning to do Apt and some of the classic package managers. Let me know if there's one you especially want to see.
      SQLite is a great idea. I'll probably also do MariaDB and Postgres for completeness.
      I don't know a ton about the world of open source message queues. Would something like RabbitMQ be good? I'll also look at Redis at some point, which I think some people use like a message broker.
      Guix video: th-cam.com/video/xccqwN7Negw/w-d-xo.html
      Nix video: th-cam.com/video/0tp86yOQ6XY/w-d-xo.html

    • @thebirdhasbeencharged
      @thebirdhasbeencharged ปีที่แล้ว +1

      @@ants_are_everywhere Ah, I didn't look hard enough, rabbit or zeromq are good candidates. Since package managers were done before (I was thinking more of something in the js ecosystem) maybe you could do a messenger app like (hexchat, telegram) etc.
      I've only watched this and grpc videos so far. Another couple suggestions would be something multi threaded (job queue or task system), maybe enki and wicked engine. Again fantastic work with these, keep em coming.

    • @isAif47
      @isAif47 ปีที่แล้ว +2

      ​@@ants_are_everywhere I would love to see a video about sqlite

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +4

      @@isAif47 I'll definitely do Sqlite. I haven't scheduled it yet, but it's on my short list of things I'd like to get to pretty soon, especially since it's used in so much mobile development.

    • @edoyak122466
      @edoyak122466 ปีที่แล้ว +3

      I'd love SQLite too.

  • @heyyounotyouyou3761
    @heyyounotyouyou3761 ปีที่แล้ว +2

    Love the channel name

  • @lethu_z
    @lethu_z ปีที่แล้ว +1

    I died at "he definitely looks like a wizard" 🤣 I just imagined Gandalf.

  • @pajeetsingh
    @pajeetsingh ปีที่แล้ว +1

    Are you implementing quic?

  • @skolarii
    @skolarii ปีที่แล้ว +10

    really enjoyed the video. could you open the code in an IDE next time so that when you're looking at structs you dont know about for example, you can Ctrl + Left Click to go into the struct definition where the fields might be documented.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +2

      I'm glad you enjoyed it!
      I'll be building out the code exploration tools soon, after we look at some LSP implementations in a couple of weeks. Since we've looked a bit at compilers and some related tools, I thought it would be fun to introduce those IDE features as something the audience understands from the show. So I'm really just waiting to work through the non-LSP backlog before I enable them.
      That said, I used to use IDE features like "jump to definition" a lot in the past. But over time I've found that they can obscure the structure of the code. So these days I use them mostly for moving around quickly in code I already understand pretty well. Whereas for unfamiliar code, I like to have a general sense of where things are before I start jumping from symbol to symbol. That's just a personal preference, obviously. But in general (and not just in programming) I've found that paring down to the simplest tools and then building up works better for me than reaching straight for the most capable tools first.

    • @skolarii
      @skolarii ปีที่แล้ว +1

      @@ants_are_everywhere thanks for the explanation, that makes perfect sense. looking forward to future videos.

  • @moralfuxery
    @moralfuxery ปีที่แล้ว +1

    Almost everywhere now has IPv6 around me, i would just love to know when the actual switch will happen if ever completely. I mean they could keep it around for the next 30 years to keep backwards compatibility yeah? Idk why but i prefer IPv4. I like subnetting because im a psychopath.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      This is a good question, but unfortunately I have no idea when the switch will happen. It's probably true that ipv4 will live on for 30 years somewhere, just like we still have major companies running COBOL. I suspect ipv6 adoption will steadily but slowly increase until it reaches some threshold, at which point we'll see an abrupt switchover where ipv4 becomes suddenly outdated. For example, as older employees retire at tech companies and newer employees who grew up with ipv6 get promoted, eventually there will be nobody around who really likes ipv4.
      I feel like ipv4 NAT unintentionally gave us some privacy, and I'm not sure privacy is completely thought out in ipv6. So that's at least one area where if consumers immediately adopted ipv6, the world broadly probably wouldn't understand the privacy implications for a decade or more.

  • @Maraus92
    @Maraus92 ปีที่แล้ว +1

    What browser are you using? :)

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +3

      I'm using IceCat, which is essentially an unbranded Firefox that comes on the VM I'm using. I'm doing these in a Guix VM I set up for the video where I look at the Guix code: th-cam.com/video/xccqwN7Negw/w-d-xo.html

  • @pranaypallavtripathi2460
    @pranaypallavtripathi2460 ปีที่แล้ว +1

    Please do one such analysis for hping3 too !!!!

  • @dharmendrasoni3637
    @dharmendrasoni3637 ปีที่แล้ว +1

    Perfect video for falling asleep😊

  • @watchthespacefromtheeveres7102
    @watchthespacefromtheeveres7102 ปีที่แล้ว +1

    please do the same thing for http/https protocols. i really waited for a long time like that something

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +2

      Sure! There's a chance I'll start with HTTP/2 since that also connects up with gRPC. And then I'll probably do HTTPS first by looking at a TLS implementation like OpenSSL or GnuTLS.

    • @watchthespacefromtheeveres7102
      @watchthespacefromtheeveres7102 ปีที่แล้ว +1

      @@ants_are_everywhere wonderful!

  • @tobiano1366
    @tobiano1366 ปีที่แล้ว +2

    Please, make a video reading the Bitcoin source code

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +2

      I will! It's already on my list. I'll look at Satoshi's original code code if I can find it. If I can't find the Satoshi code, then I'll look at the current version of Bitcoin core.

  • @BGFutureBG
    @BGFutureBG ปีที่แล้ว +3

    4:25 dude 💀

  • @skeletonman3432
    @skeletonman3432 ปีที่แล้ว +2

    Would love to see Godot engine!

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว

      I've got you covered 😀 th-cam.com/video/ryBuDww2zxs/w-d-xo.html
      Some people have sound problems with this video. Please let me know if you run into issues... I haven't been able to reproduce it.

  • @sreerajchundayil588
    @sreerajchundayil588 ปีที่แล้ว

    I need a Linux VFS review.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว

      I'm going to do NFS at some point, I think we might cover some of the VFS stuff there

  • @raxneff
    @raxneff ปีที่แล้ว +2

    My tip would be to somewhat prepare yourself for that topic. Things like (in 18:34) not knowing that a left-shift 1 multiplies by 2, and that's in TCP to wait 2x as long as before to not overload the system, is a little bit embarrassing. But I like the format of reviewing actual code.

    • @kerbatonbaton8108
      @kerbatonbaton8108 ปีที่แล้ว +3

      It's hard to know everything, he is reading code to learn new stuff, its not embarrassing.
      I also keep forgetting how bit shifting works because i never use it and most compilers will optimize the times 2 anyways.

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +1

      @@kerbatonbaton8108 Thanks for speaking up I really appreciate it :)

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +2

      Thanks for taking the time to write feedback, and especially for giving me a time code so I know exactly what you're talking about. I'll add an Errata section to the video for known errors.
      To expand on @kerbaton baton's point, in an improvised live show like this there are going to be mistakes. Sometimes I'll read something wrong or forget a particular bit of syntax for a language. In this case I confused a symbol for its mirror reverse. I don't think any of those things are particularly embarrassing. They're no doubt confusing to the viewer, though, so I'd like to correct them where possible. But they're also a realistic part of thinking on your feet.
      In this particular case, we'd already mentioned bitwise operations and bit shifting on previous episodes. We had also seen exponential backoff once or twice. This function didn't let you set the base of the exponent or a jitter, so I wasn't sure yet what exactly it was doing the first time I was looking at it.

    • @raxneff
      @raxneff ปีที่แล้ว +1

      OK, "embarrassing" is maybe the wrong word, and yes @kerbatonbaton8108 not knowing everything but being interested is preferred by me too.
      My point is that such videos could be of much better quality if you don't just look on code, but watch one or two TY videos about the topic before!

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +8

      @@raxneff You have a good point, but I think the definition of "better quality" depends on the kind of video I'm trying to make.
      The idea of this series is that it's kind of like code archaeology. I enter an unfamiliar repo and try to figure out what's happening based on the code. If I researched the code base before I started, then that would be a bit like having a call-in show where you prepared for the questions ahead of time.
      I've read the TCP spec before, several years ago. And I've seen various other presentations of it, like in OS theory books, networking theory books, etc. But this video is supposed to be about finding your way in a maze, and I think the authenticity of that experience would suffer if I prepared too much in advance.

  • @v1Broadcaster
    @v1Broadcaster ปีที่แล้ว +1

    no he looks exactly like a spell casting wizard...

  • @szymoniak75
    @szymoniak75 ปีที่แล้ว +1

    Interesting

  • @MegaJehanzaib
    @MegaJehanzaib ปีที่แล้ว +2

    Just get to the point straight away please.

  • @GamingSmithJohn
    @GamingSmithJohn ปีที่แล้ว +4

    I really like the idea behind these analysis videos but I must critisize the length of it. Try to cut through the parts that are seemingly not that interesting regarding the core idea of the subject that you are trying to poke (try to aim for less than 20 minutes a video and if it exceeds that then cut them into part 1 and 2 and ect) and then prepare a script that you may or may not fully commit to but the necessary parts will still be there for you to mention. Think of channels like Fireship and how he tries to bring through the ideas behind in videos in such a short but packed videos. Overall, great work!

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +11

      Thanks for the feedback. Those really are great tips, but I think they're tips for a different genre of video than I'm doing.
      These videos are definitely in the "watch me work" or "study with me" genre of long form live streams. I will eventually make other sort of content, and that will probably include some polished scripted content. But the vibe I'm going for here is something relatively chill you can put on in the background while banging out some code. I used to watch Bob Ross at work for that sort of thing. The series I'm doing now is essentially what I would have liked to watch when I ran out of Bob Ross videos.
      The idea for the current series is it's a bit like Survivorman. Each stream I'm dumped into an unfamiliar codebase and have to try to make sense of what I'm looking at with minimal support from outside sources. It's not so much about the individual code bases as it is about the skill of wayfinding in a complicated codebase and also the feeling that collectively we've opened a path through the open source ecosystem. And I certainly never have the expertise necessary to say anything very authoritative about any of the projects I'm looking at.
      However, I agree that my recent few videos have been longer than I wanted them to be. I think about 1 hour is the goal, with 1.5 being an upper bound and some shorter ones being 30-45 minutes. I do re-watch my videos and correct things that I feel don't work. But I also experiment a lot, so unfortunately there's a chance that any given video might end up with a section that isn't so great. So I'm always happy to hear feedback and I'll always give it serious consideration.

    • @szymoniak75
      @szymoniak75 ปีที่แล้ว +15

      I actually like this unedited, not scripted format .. you get to see the full thought process

    • @ants_are_everywhere
      @ants_are_everywhere  ปีที่แล้ว +10

      @@szymoniak75 Hey thanks! That's nice to hear. I'm glad it's working for some folks.

  • @lmulling
    @lmulling ปีที่แล้ว

    sus

  • @phpdeveloper2044
    @phpdeveloper2044 ปีที่แล้ว

    that needs a rewrite