Linux Networking: How The Kernel Handles A TCP Connection

Поділитися
Вставка
  • Опубліковано 6 чер 2024
  • I am going to walk you through the details of how a TCP connection request and network packets are handled by the Linux kernel. I will use LTTng tracer and Tracecompass trace analysis tools for the purpose of this video.
    More information about LTTng:
    lttng.org/docs/v2.13
    More on Tracecompass:
    www.eclipse.org/tracecompass/
    / @eclipsetracecompass7421

КОМЕНТАРІ • 67

  • @Tubu-fu2lh
    @Tubu-fu2lh 6 днів тому +1

    Wow! I now understand so many things taught in computer networks class. It was all imagination to me before. Thankyou

  • @linkernick5379
    @linkernick5379 11 місяців тому +105

    This video is unique: it is too deep for the majority of users, but a few ones, who need it to be watched, they seem to be saved by you, dear author! 🎉

    • @deeplinux2248
      @deeplinux2248  8 місяців тому +9

      Thanks for the comment.

    • @epolpier
      @epolpier 17 днів тому +1

      It's not deep at all, it barely scratches the surface...

    • @StreamersFail
      @StreamersFail 10 днів тому +1

      @@epolpier your music playlist is hilarious

    • @natking1u1z99
      @natking1u1z99 9 днів тому

      “Too deep for the majority of users” speak for yourself buddy 😂😂😂

    • @khardian2823
      @khardian2823 6 днів тому

      Sadly, most people don't know what "majority of users" mean, thus making your comment too deep for the majority of users.

  • @aospware
    @aospware 14 днів тому +10

    Tons of books and videos have never been able to do this ever. Keep on this great work. I wish to see more such stuff from you.

  • @danielzhu194
    @danielzhu194 5 місяців тому +11

    This is one of the greatest UA-cam videos of all time. It was not only incredibly thorough, but also very easy to digest (assuming the viewer has a basic understanding of kernel concepts like interrupt handlers, etc). I also appreciate how you would periodically “zoom out” to review the forest after diving deep into the individual trees.

  • @XYZ56771
    @XYZ56771 8 днів тому

    Indeed, this kind of teaching is what we need. Thank you!

  • @pneuma33
    @pneuma33 6 місяців тому +3

    You pulling up the kernel was truly deep Linux.. subscribed

  • @MorbusCQ
    @MorbusCQ 6 місяців тому +5

    I learned more from watching this than my professor. I'm taking computer networks at the moment and this covers a lot of the course material, but in far more detail.

    • @deeplinux2248
      @deeplinux2248  6 місяців тому +1

      Good to hear that. If you want to be able to produce this on your own then watch this video:
      ua-cam.com/video/QmALYlJCAfg/v-deo.html

  • @AmolGautam
    @AmolGautam 7 днів тому

    This was in really helpful. Thanks

  • @thedanielspindler
    @thedanielspindler Місяць тому +1

    Thank you, this is an amazing video. Very well presented and explained. Keep up the good work!

  • @hoodrobinson1159
    @hoodrobinson1159 7 місяців тому +1

    Holy this channel is SO underrated, these real world examples helps me learning OS & network, big thanks.

  • @jindiggs
    @jindiggs Рік тому +3

    Please continue, you got my full support !
    Thank you.

  • @bramgn
    @bramgn 7 місяців тому +4

    Wow, this channel is a diamond in the rough! Glad to have stumbled upon it! Keep it up!

  • @MrRaja
    @MrRaja 6 місяців тому +1

    I am interested in Linux more and more recently and this somewhat helps put a picture to the background process we are unaware of.

  • @GudinVladimir
    @GudinVladimir 6 місяців тому

    Wow! This is realy excellent tutorial! It was so interest to investigate syscall interconnections and time consumption of different parts. This live format is absolutly amazing! Thanks a lot for your work!

  • @zelllers
    @zelllers 6 місяців тому +4

    So cool. I'm coming at this from a networking background, familiar with packet captures but seeing the kernel traces, system calls, file descriptors, and all that it really gave me a much better picture of what's going on there. I loved it, subscribed and definitely will check out your other videos.
    Thank you

  • @zalavadiaridham
    @zalavadiaridham Рік тому +9

    Amazing video and great in-depth explanation. Thank you!

    • @deeplinux2248
      @deeplinux2248  Рік тому

      I am happy that you have found this useful. Is there any other particular kernel area that you may be interested in?

  • @lxn7404
    @lxn7404 5 місяців тому

    Finding your channel was my Christmas present 🤩

    • @deeplinux2248
      @deeplinux2248  5 місяців тому

      Wow that is such a nice complement. Merry Christmas!

  • @ratatui900
    @ratatui900 7 місяців тому

    oh my god, this is what's called top level content, this vid delayed my sleep schedule for an hour yesterday

  • @suyashpurwar631
    @suyashpurwar631 7 місяців тому +2

    Please keep making such videos! I wan this level of depth!

    • @deeplinux2248
      @deeplinux2248  7 місяців тому +1

      Then take your time and watch this one as well:
      ua-cam.com/video/NEFwr6lFJWA/v-deo.html

  • @abhinavjain9264
    @abhinavjain9264 8 місяців тому +21

    I have no words to appreciate the deep respect you have earnestly earned in my heart. This is awesome, please keep it up, I love the tracing frameworks in Linux and such videos just makes learning kernel so much more fun.

    • @deeplinux2248
      @deeplinux2248  8 місяців тому +1

      Wow that is truely flattering. Thanks!

  • @thapakazi_
    @thapakazi_ 5 місяців тому

    woooooh, these are dope details. now I wanna learn more... thanks for sharing this resource 🙇‍♂

  • @danielmoreno968
    @danielmoreno968 7 місяців тому

    Thank you so much for this information!

  • @jindiggs
    @jindiggs Рік тому

    Wow man, this is so much stuff going on !!!! I love it.

    • @deeplinux2248
      @deeplinux2248  Рік тому +3

      Glad that you liked it. You may want to view this one which really drills down into the kernel code for tracing how a TCP connection is handled.
      ua-cam.com/video/8UmPwVFswvY/v-deo.html

  • @nose05031980
    @nose05031980 3 місяці тому

    Well done, mate! Thank you! Subscribed.

  • @suscactus420
    @suscactus420 7 місяців тому

    thank you so much for this. it's a great video

  • @QuantumQ80
    @QuantumQ80 8 місяців тому

    Awesome video! ❤

  • @darkside3ng
    @darkside3ng 10 днів тому

    Amazing!

  • @tanchienhao
    @tanchienhao 8 місяців тому

    Awesome channel!! Subscribed

  • @abdurrahmanrafi7946
    @abdurrahmanrafi7946 6 місяців тому

    You made my day... Thanks a lot.

  • @maixicek
    @maixicek 6 місяців тому

    very good video, thank you

  • @ashishratnawat2711
    @ashishratnawat2711 7 місяців тому +1

    Thank you very much!

  • @user-te4eb2nw4w
    @user-te4eb2nw4w 8 місяців тому

    love it. Always wondered. Now I know.

  • @vadiks20032
    @vadiks20032 6 місяців тому +1

    wow thank you i didn't understand anything but i will still leave a like and comment

  • @PhillipMaii
    @PhillipMaii 3 місяці тому

    great content, thanks!

  • @ricardorosa5315
    @ricardorosa5315 3 місяці тому

    GOLD!!!!

  • @chabaslabas
    @chabaslabas 6 місяців тому

    Thanks a lot!

  • @4skinntim420
    @4skinntim420 4 місяці тому

    This is amazing content! I am amazed by the fact that I (a complete linux kernel newbie) can understand what is happening. The information presented here is very valuable to my research (I want to know how select/epoll works in regards to concurrency and multithreading). Keep up with the great work and can I ask a question - is 'softirq' some kind of lightweight kernel thread or what is it?

    • @deeplinux2248
      @deeplinux2248  4 місяці тому +1

      Thanks for the encouraging feedback. Softirq is not a kernel thread, it is simply an interrupt handler which serves software interrupts. These are generally functions which are called by the kernel when an interrupt is raised. A softirq has the seconds highest priority after hardirq which serves actual hardware interrupts coming from net or disk, for example.
      If you require some cobtext of execution in the kernel then you can use simple threads but in kernel space, or if you require a kernel routine then go with tasklets.

  • @yb9737
    @yb9737 5 місяців тому

    THANK YOU

  • @kimaegaii
    @kimaegaii 6 днів тому

    Thank you. Is there any video that might prep us for this video. I've been working with Linux a long time , but I got lost with what the program you're using and sort of had more questions along the way of what's going on. Sorry and thanks.

  • @internet.security.analyst
    @internet.security.analyst 6 місяців тому

    짱이다짱

  • @ganeshkirshna
    @ganeshkirshna 2 місяці тому

    This is really a great deep dive video i have ever seen, just wanted to know at timefram 21:56, you have mentioned that it will create a new socket for data transfer? but generally TCP relays on the same socket for listening and data transferring right? Can you please advice me on this?

    • @deeplinux2248
      @deeplinux2248  2 місяці тому +1

      Very good question. In the tcp protocol we have two kinds of sockets, listen and data sockets.
      A listen socket is only applicable on the server side and is unique per server ip/port. The data socket is one per source dest ip port quadruple. The listen socket is only there to accept new connection requests. Once a connection request is received the kernel creates a new data socker per incoming ip port.
      From the application side you wont see these different sockets.

  • @candyboah
    @candyboah 6 місяців тому

    Прикольно

  • @Corteum
    @Corteum 16 днів тому

    How is it different to how Windows or MacOS handles it?

  • @Lircking
    @Lircking 7 місяців тому

    it feels like I should watch another video before I can understand this one. Any recommendations?

    • @deeplinux2248
      @deeplinux2248  7 місяців тому +1

      It depends what area you have issues with.
      If you want to get comfortable with the visualization and analysis tool then this is the official Tracecompass channel playlist:
      ua-cam.com/video/8o2dar9tfLg/v-deo.html

    • @BunuConstantin
      @BunuConstantin 5 місяців тому

      @@deeplinux2248 Hi, i can suggest something that may can help you:
      1. About tracing in linux kernel: ua-cam.com/video/JRyrhsx-L5Y/v-deo.html
      2. Memory Management in linux Kernel : ua-cam.com/video/7aONIVSXiJ8/v-deo.html.
      3: Networking fundamentals: ua-cam.com/video/bj-Yfakjllc/v-deo.html

  • @Nowlala
    @Nowlala 3 місяці тому

    may i know , what will i learn from learnig these ? like how will it impact my learning in linux basically

    • @deeplinux2248
      @deeplinux2248  3 місяці тому

      Depends what your goal is in your Linux journey. A user or even a simple admin then probably not much. But if you debug kernel issues or write network software in the lower layers then you would not be asking this question😉

  • @flintthuang
    @flintthuang 2 місяці тому

    starting from 17:10, why readfds=0x8 means fd 3?

    • @flintthuang
      @flintthuang 2 місяці тому

      i got it, 0x8 = 1000, 1 is at bitmap position 3. with the same logic 0x11 = 10001, it contains fd 4 and fd 0

  • @OMGHADDSXO._.
    @OMGHADDSXO._. 7 місяців тому +1

    Intro music is far too loud btw, but thanks for this!

  • @djtomoy
    @djtomoy День тому

    Very inefficient, I would have done it much differently myself

  • @pppkenken6610
    @pppkenken6610 6 місяців тому

    tsuzuki computer club. Amigo