Introduction to TCP/IP and Sockets, part 1: Introducing the protocols and API

Sdílet
Vložit
  • čas přidán 3. 07. 2024
  • This is a basic introduction to the Internet protocols and how to use them in programs using sockets.
    This is the first of two introduction videos on the Internet Protocol and its family of associated protocols (UDP, TCP, etc.) as well as Sockets, a pseudo-standard interface made for programmers to write programs which use these protocols.
    The slides for this video can be found here: tinyurl.com/ybfjnekq
    Also check out the part 2 video, where I cover real C++ code examples of this: • Introduction to TCP/IP...
    Index for skipping to the sections you care about:
    00:00 - Introduction
    00:33 - Internet Protocol
    04:05 - IP fragmentation
    05:04 - IP headers
    09:14 - IP is "best effort" delivery
    10:28 - User Datagram Protocol (UDP)
    12:08 - Transmission Control Protocol (TCP)
    14:03 - TCP connection states
    18:21 - TCP headers
    22:08 - Sockets API
    23:20 - Connection-oriented socket functions
    27:30 - Datagram-oriented socket functions
    28:35 - Socket addresses (sockaddr)
    29:34 - Socket options (sockopt)
    31:21 - Blocking vs. Non-Blocking (fcntl)
  • Věda a technologie

Komentáře • 96

  • @mochileiro17
    @mochileiro17 Před 3 lety

    Great video! Clutter-free, easy to understand and follow! Love it

  • @muhammadadam0
    @muhammadadam0 Před 3 lety

    Loved the video. Thanks for your time and effort. Sharing the slides is very appreciated.

  • @engineering1year734
    @engineering1year734 Před 3 lety

    Really awesome video. All these concepts now makes sense to me. Thanks for quality content.

  • @UnitedIngvar
    @UnitedIngvar Před 2 lety

    Thank you for your amazing video! The explanation is perfect, everything is so well-covered. Love it!

  • @cynthiali4606
    @cynthiali4606 Před 2 lety +1

    Thanks for making this so easy to understand! I've been looking for videos to help me with work in this area for the past couple of days and this is by far the best one. :)

  • @idamjelde2776
    @idamjelde2776 Před 3 lety +2

    This is good! And I like that you have the sections with titles, so that it is easier to jump back and forth in the video to find what you want. Great work!

  • @jahoopyjaheepu497
    @jahoopyjaheepu497 Před 3 lety +1

    Best networking video on CZcams. Thank you for creating this series.

  • @tabeebrahman4843
    @tabeebrahman4843 Před 3 lety +19

    this video was amazing. the explanations are clear and has given me the most perspective when it comes to the socket programming. most of the other videos out there assume the viewer has much more knowledge then what your video does, its almost like psuedo code for socket protocols, super understandable and fairly comprehensive.

  • @harryjohnsonperu724
    @harryjohnsonperu724 Před 3 lety +1

    Fantastically explained. Its been so long since i have learned all this in University. This was a nice refresher. Thank you

  • @tourdesource
    @tourdesource Před rokem

    This video has helped me enormously. Thank you so much.

  • @shubhankaringale278
    @shubhankaringale278 Před 2 lety

    I never thought it was, that easy to understand. Thanks a lot.

  • @Coconasty
    @Coconasty Před rokem

    I can not explain how much I enjoyed this video! So well explained, I was very confused on this topic

  • @2NormalHuman
    @2NormalHuman Před rokem

    this is the best explanation of computer networks that i could find on youtube, thank you for your work

  • @halilibrahimgungor364
    @halilibrahimgungor364 Před 3 lety

    Awesome an overview for this topic! Thanks.

  • @hfe1833
    @hfe1833 Před 3 lety

    This video almost summarize the details I read in some books into clear and details video. Thank u

  • @goldomcsas1464
    @goldomcsas1464 Před 3 lety

    Amazing, video. Thanks. You are a very concise and clear teacher. You are very good at not bogging down the technical info with too much technical grammar; congrats!

  • @itvrlogic5600
    @itvrlogic5600 Před rokem

    Great explanation, thanks

  • @bhavana6217
    @bhavana6217 Před 3 lety +1

    Hey! This video has helped me a lot to learn the basics! I can't thank you enough :')

  • @chenxu6931
    @chenxu6931 Před 3 lety

    Thanks for making this video, great explanation!

  • @RxRip01
    @RxRip01 Před 3 lety

    Thank you for providing this as I am trying to learn and create my own web server from scratch. I wish CZcams algorithm will pick up your channel more as you provide quality content every time. Just subscribed too.

  • @devpriysahu2223
    @devpriysahu2223 Před 3 měsíci

    Really great, Knowing and teaching are 2 difficult art and you mastered both.

  • @timurakhalaya6289
    @timurakhalaya6289 Před 2 lety

    Greatest explanation there is ! 🚀👍

  • @lesterballesteros2924
    @lesterballesteros2924 Před 3 lety

    Keep making videos this is really helpful, i hope you get more recognition!

  • @adelabdellatif
    @adelabdellatif Před 3 lety

    Perfect, That was quite good and detailed enough...Thanks.

  • @mikemcgrath579
    @mikemcgrath579 Před 2 lety

    This was a legendarily well articulated explanation. Thank you for donating your time to make this.

    • @rhymu
      @rhymu  Před 2 lety

      Glad you enjoyed it!

  • @rodrigocastilla3375
    @rodrigocastilla3375 Před 3 lety

    By faaaaaaaaaaaaa ... aaaaaaaar the best explanation I have ever found on CZcams. Thanks, congratulations and reapsect 🤜🤛

  • @trenholmelodge1820
    @trenholmelodge1820 Před 3 měsíci

    Just amazing. How come he is so clear and easy to understand..Others should follow his technique.

  • @syasyanik855
    @syasyanik855 Před 4 lety +1

    Thank you for your video. Really clear explanations and entertaining to learn!

    • @rhymu
      @rhymu  Před 4 lety

      I'm glad you enjoyed it! :D

  • @ankitrathore3946
    @ankitrathore3946 Před 2 lety

    Now that’s quality content

  • @mateusztyc1667
    @mateusztyc1667 Před 2 měsíci

    Love this, thank you!

  • @matsredman7640
    @matsredman7640 Před 2 lety

    Super good! Thanks!

  • @samdaou2082
    @samdaou2082 Před 3 lety

    Awesome Video, really helpful explanations to go along with some initially scary diagrams. Appreciate the help. :)

  • @etha909
    @etha909 Před 4 lety +2

    Was watching your videos on learning Rust when I saw this introduction.
    Extremely well presented!

    • @rhymu
      @rhymu  Před 4 lety

      I'm glad you enjoyed it! :D

  • @thejunglecarrot
    @thejunglecarrot Před 3 lety

    Great video, thanks so much!

  • @reverse_shell
    @reverse_shell Před 4 lety +22

    Rhymu, absolutely loved the video! The diagrams aren't so scary once you've explained them. I am heading to the second video now! :D

    • @rhymu
      @rhymu  Před 4 lety +2

      I'm glad you liked it!

  • @oshinwane6902
    @oshinwane6902 Před 2 lety

    very well explained although i suggest watching other videos too since this one completes the journey !

  • @HanumanthDasar-fi8dd
    @HanumanthDasar-fi8dd Před 2 měsíci

    real internet Guru

  • @PaulDiracTWR
    @PaulDiracTWR Před 4 lety

    Thank you for this.

  • @AnantaAkash.Podder
    @AnantaAkash.Podder Před 3 měsíci

    By far the BEST Explanation about SOCKET... Everyone is just saying Socket is just Ip address+port... But it is very Ambiguous... You just Explained it very well... Socket is nothing but An API... Through which my Web Application Code talks to Kernel & thus tells kernel to do some stuffs with all the Protocols...
    Thank you very Much Sir...❤️❤️❤️

  • @7race725
    @7race725 Před 3 lety

    I am a beginner in embedded systems and not sure that web-programming will be applicable on my job. I've decided to familiarize a little with such stuff like TCP/IP and obtained nothing but a mess in my head. Your videos are really clear and now i see a difference between TCP and IP, lol. In fact, that topic seems to be interesting for me. Thank you very much.

  • @pengperry7236
    @pengperry7236 Před 3 lety

    helped a lot,thank you so much

  • @ali51717
    @ali51717 Před 4 lety +6

    As a game developer concerned mostly with cpp. this is a fantastic video and I am very glad I found your channel.
    I just want to say special thanks for the time you put into those videos, the production quality, slides, and animations, I know they take way more time than the recording itself, so allow me again to say thanks.

    • @rhymu
      @rhymu  Před 4 lety +3

      Thank you so much! I enjoy making these videos, and just wish I had more time to spend on them.

    • @ali51717
      @ali51717 Před 4 lety +1

      @@rhymu
      I couldn't follow the second video, ( I am completely new to network programming and I Just saw your video, and I understand now how to TCP works but I felt the next part was little advanced to me,
      May i Know any good resources you think that will enable me to understand the next part? I am already reading through the rfc you mentioned and it all looks good.

    • @rhymu
      @rhymu  Před 4 lety +1

      @@ali51717 I fear that I made the difficulty ramp too steep between these two videos. I should have made a video in between that perhaps gets a little into the code but not so advanced. Thank you for the feedback!
      I think if you feel ready for it, either the POSIX threads or WinSock documentation pages would be good to guide you towards the programming aspect. A good starting point might be here: docs.microsoft.com/en-us/windows/win32/winsock/getting-started-with-winsock

    • @ali51717
      @ali51717 Před 4 lety

      @@rhymu I am very thankful for your reply.
      I will check those right away thanks!

  • @hammerheadlemon
    @hammerheadlemon Před 4 lety +1

    Great. Thank you.

    • @rhymu
      @rhymu  Před 4 lety +1

      You are welcome!

  • @AbidAhsan-yp4dc
    @AbidAhsan-yp4dc Před 4 lety

    Man... you have just summarized stuffs I learned in two networking courses.. hats off... will you continue the series?

    • @rhymu
      @rhymu  Před 4 lety +1

      I'm glad you liked it! I'm considering making another video exploring some common techniques for constructing and parsing messages sent across the network: JSON, protocol buffers, and serialization techniques in general.
      If there is some aspect of networking you would like me to consider for a future video, please let me know!

  • @klr607
    @klr607 Před 2 lety

    Nice video. TY

  • @kevinhawekotte4432
    @kevinhawekotte4432 Před 3 lety

    Thank you!

  • @dark_red_blood
    @dark_red_blood Před rokem

    Thanks man

  • @Lucas-md8gg
    @Lucas-md8gg Před měsícem

    Will you update the playlist, one day? Your teaching is pretty good

  • @hussainigoattv9222
    @hussainigoattv9222 Před 4 lety +1

    Man you are a hero! please make web development tutorials on nodeJS

    • @rhymu
      @rhymu  Před 4 lety +3

      I'll let you in on a secret, just don't tell anyone else. :D I know almost nothing about NodeJS! I would be glad to make web development tutorials on NodeJS. However, I will need to study it myself, first.
      In the mean time, may I refer you to my guru for web development? Check out Chris Griffing and his Twitch stream, where he often demonstrates web development live: twitch.tv/cmgriffing -- He probably can recommend several NodeJS learning resources. In the past, he has already recommended this site which covers web development in general, and has a lot of other learning resources as well: freecodecamp.org/

    • @hussainigoattv9222
      @hussainigoattv9222 Před 4 lety

      @@rhymu I will be waiting. Thanks very much :)

  • @samuelkatz2463
    @samuelkatz2463 Před 3 lety

    bravo!

  • @darkknight0258
    @darkknight0258 Před 2 lety

    this is the fastest channel that I clicked subscribe, lol the this small packets joke

  • @webdeveloperninja9220
    @webdeveloperninja9220 Před 2 lety

    Helped me fix a bug on a microcontroller thanks

  • @toragodzen
    @toragodzen Před rokem

    👍thanks🤘

  • @mirazh8216
    @mirazh8216 Před 3 lety

    thanks

  • @shawnl1155
    @shawnl1155 Před 2 lety

    You're a really good teacher. Wish I got this quality from my university.

  • @kentmiggalen9756
    @kentmiggalen9756 Před 2 lety

    nice Tutorial Gilfoyle

  • @sergiim5601
    @sergiim5601 Před 2 lety

    Very nice explanation! I miss your twitch streams though (:

    • @rhymu
      @rhymu  Před 2 lety

      Twitch streams starting back up December 1st for Advent of Code 2021!

  • @trungthanhbp
    @trungthanhbp Před 3 lety

    Please make more video like this, for education purpose ^^ video in stream is quite long, ~3hour/video

  • @kennylee6499
    @kennylee6499 Před 4 lety +1

    This was a great video! I’m new to cpp and am interested in learning more about server development in the context of game servers/dev. Do you have any tips/advice on how to go about this? I’m definitely going to check out more of your channel too!

    • @rhymu
      @rhymu  Před 4 lety +6

      This is a very challenging area to study, with many parts to consider. Games can be very demanding when it comes to server requirements; players want low-latency as well as high availability, and games have a rather unique challenge other kinds of servers don't have: keeping the games fair by preventing players from cheating.
      I'm by no means an expert; I recommend the blogs and presentations made by experts in the field, such as this one about client-side game architecture: www.gabrielgambetta.com/client-server-game-architecture.html
      If you prefer CZcams content, check out videos such as this one, made by the creators of "Rocket League", which covers some of the challenges and solutions they came up with for the networking aspects of their game: czcams.com/video/ueEmiDM94IE/video.html

  • @615rip2
    @615rip2 Před rokem

    OH my god!!!!!!!!!!!!!!!!!!

  • @kdjdjsj3645
    @kdjdjsj3645 Před 2 lety

    no offense to other IT channels but their presentation and microphones betray their expertise lol. your video is well made and v easy to follow, great stuff

  • @youssefamrkadry
    @youssefamrkadry Před 3 lety

    I love you

  • @shrutiyn962
    @shrutiyn962 Před 3 lety +1

    hey great video! had a few questions:
    1. You mentioned that sockets are like access point to access the protocol stack, what do you mean by that? why should there be an access point? Whats the need for an access point?
    2. Why do we need sockets? if the packet gets the destination IP(from network layer) and the destination port number (from the transport layer) then why do i need sockets in UDP? The packets go through the network and gets routed to the destination right? I understand we need sockets in TCP because its connection oriented and so to establish the connection we need sockets but why in UDP? please correct me if I'm wrong here.
    I'm having a hard time understanding the concept of sockets and its need. HELP!

    • @rhymu
      @rhymu  Před 3 lety +1

      1. What I mean by access point is a handle or object that an application uses in conjunction with the operating system APIs to send and receive data through a network interface. Think of a socket as analogous to a file handle.
      2. You need sockets because a socket is the interface between the application and the operating system for exchanging network packets. Think from the operating system's perspective: "I just got this packet from google.com; which application should I deliver it to?" The answer is the operating system keeps a table of sockets, where each socket is "bound" to a protocol, local address and port number, and is associated with one of the many applications that are running on the host. The operating system inspects the packet to find the protocol, local address and port number, and looks up which socket in its table that maps to. If it finds one, it delivers the packet to the application associated with it. Just like a file or a mailbox. It doesn't matter if it's connection-oriented or packet-oriented. It's about the addressing and binding.

    • @shrutiyn962
      @shrutiyn962 Před 3 lety +1

      @@rhymu ah! That makes sense.. thanks so much! :)

  • @jianliangge2174
    @jianliangge2174 Před 3 lety

    Like

  • @alisadm
    @alisadm Před 2 lety

    Is the Header Checksum the same as the Frame Check Sequence?

    • @rhymu
      @rhymu  Před 2 lety +1

      Yes, the header checksum is specifically the frame check sequence used for these protocols. (Frame Check Sequence being a general term and in the case of TCP/IP the implementation of it is the header checksum).

    • @alisadm
      @alisadm Před 2 lety

      @@rhymu Thanks! ❤

  • @user-kw3tv5ij1j
    @user-kw3tv5ij1j Před 2 lety

    The video is excellent but a pop filter would improve the audio quality a lot.

    • @rhymu
      @rhymu  Před 2 lety

      Thanks for the suggestion. It's been on my list of setup improvements for a while, along with a better microphone.

  • @KangJangkrik
    @KangJangkrik Před 3 lety

    Interestingly, I got a lot of trouble while using Python rather than C in term of TCP

  • @mindgr13
    @mindgr13 Před rokem

    Isn't it TCP that divides data into multiple packets and not the IP?

  • @byte-strategist
    @byte-strategist Před 2 lety

    Watch in 2x thank me later..

  • @zes3813
    @zes3813 Před 2 lety

    wrg, soundx doesnt matter, no such thing as yellx etc or not

    • @rhymu
      @rhymu  Před 2 lety

      true, the wolf sees the gtb and then the yellx no longer exists or maybe it does... wait what are we talking about?

  • @samucancld
    @samucancld Před 2 lety

    Great explanation except for the awful SM

  • @Crce-vv6pm
    @Crce-vv6pm Před 3 lety

    Great Video, Thanks!

  • @zaur66
    @zaur66 Před 2 lety

    Thank you !

    • @rhymu
      @rhymu  Před 2 lety

      You're welcome!