Load balancing in Layer 4 vs Layer 7 with HAPROXY Examples

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 259

  • @hnasr
    @hnasr  3 года назад +11

    Learn the fundamentals of the backend, scaling and load balancing with my Introduction to NGINX udemy course nginx.husseinnasser.com

  • @bahaaeldeen4699
    @bahaaeldeen4699 4 года назад +104

    this playlist just keep getting better and better honestly it may be the greatest channel in the tech field

    • @hnasr
      @hnasr  4 года назад +7

      Glad you enjoy it! Thanks Bahaa

  • @anamulkabir1014
    @anamulkabir1014 3 года назад +12

    "More we repeat more we learn!" that's the way to teach - thank you so much Nasser, you are the best!

  • @siddharthshukla9832
    @siddharthshukla9832 3 года назад +7

    dude, i simply love the way you articulate. It is like listening to a story. I tried to look up some other videos on this topic. But frankly speaking, the difference between Layer 4 and 7 was never explained so easily. Hats off to you Hussein

  • @robertluong3024
    @robertluong3024 3 года назад +1

    I randomly came here from your NAT video just for fun. I didn't expect to leave with a clear understanding of this. You're awesome.

  • @amitbist2k2
    @amitbist2k2 5 лет назад +5

    Great, I am a unix sysadmin and you helped me understand some old stuff making it easier. Those good old days!

  • @arunsatyarth9097
    @arunsatyarth9097 4 года назад +50

    29:50 "I dont want the load balancer to look at my data." Sir, the fact that you dont have a million subscribers is a crime on humanity.

    • @esra_erimez
      @esra_erimez 4 года назад +3

      Agreed

    • @chiefolk
      @chiefolk 4 года назад +1

      I think the data here is URL u just entered in the browser which gives IP address so doesn't make sense if you don't want to see them this URL for privacy reasons

  • @iammjpops
    @iammjpops 3 года назад

    I dont know if I would have understood L4 and L7 R-Proxy better...
    THANKS A LOT!
    Bow to you!

  • @aniekutmfonekere740
    @aniekutmfonekere740 3 года назад +2

    the best channel ever with real-world application of tech

  • @davidlira8853
    @davidlira8853 3 года назад

    this helped me have a better understanding of the difference between a Layer 4 Load Balancer and a Layer 7 Load Balancer.
    Now I understand that an ingress is a Layer 7 Load Balancer

  • @aarthydesikan9939
    @aarthydesikan9939 4 года назад +6

    Very well explained, thanks so much! Your way of explaining with an intent to capture audience attention but the same time not compromising the technical details is very nice.

  • @tikz.-3738
    @tikz.-3738 3 года назад +3

    Was just looking for websockets ended up watching 7hrs in a row ur awesome and ur just the teacher I wanted no 5min videos tho it was quite hard to click on those 40min videos once I did it didn't felt like I was watching something for 40mins well it's just interest and great content quality but dude heads off to u thanks for all this awesome knowledge at once place

    • @hnasr
      @hnasr  3 года назад +1

      ❤️❤️ that is awesome 👏 thank you for your kind words and glad you enjoyed the content 🙏🙏

    • @tikz.-3738
      @tikz.-3738 3 года назад

      @@hnasr still counting, after learning from all the linked and suggested videos I'm finally seeing the first video of websockets for which I initially came 😂 came for websockets became network engineer and more aware back-end engineer ur awesome dude I have no words for the content quality and availability

  • @SunilRana-tm8lm
    @SunilRana-tm8lm 3 года назад +2

    Hi Hussein!
    I recently came across your channel and now I wish I had found this earlier. Thanks for the amazing informatic videos.

  • @fireystella
    @fireystella 2 года назад

    Ur content is super great! And ur narration 😂 just when I’m losing my attention you say something funny and then I’m paying attention again 😆😆 many thanks!

  • @sebschrader
    @sebschrader 3 года назад +9

    Most load balancers (and especially HAProxy and nginx!) still use two different TCP connections in L4 mode with potentially different timeouts, window sizes etc. There are load balancers that simply forward packets (e.g. Linux ipvs) and only have a single end-to-end TCP connection between the client and the backend, but these are more uncommon.

    • @JuanManuelMunozBetancur
      @JuanManuelMunozBetancur Год назад

      Hi, could you please share any documentation to verify this information

    • @wathekbeji8569
      @wathekbeji8569 Месяц назад +1

      Absolutey true. I just captured packets on the interfaced where HAProxy runs and it turns out it uses different TCP connections for the backend servers.

  • @MI5500
    @MI5500 Год назад +1

    This guy will be a great dad 😂😁

  • @jeetendrashinde2855
    @jeetendrashinde2855 4 года назад

    An excellent demostration of difference between the 2 Load balancers, good job Hussein !!

    • @hnasr
      @hnasr  4 года назад

      Thanks Jeetendra!! appreciate it

  • @ArdhenduShekhar-sw4uy
    @ArdhenduShekhar-sw4uy 5 месяцев назад +1

    HE PUT A THAT'S WHAT SHE SAID JOKE IN THERE. ABSOLUTE LEGEND.

  • @ujemvi
    @ujemvi 4 года назад +8

    He killed me with the "pew pew pew" at the round robin demonstration

  • @r3jk8
    @r3jk8 3 года назад

    Thumbs up for the clear explanation of this topic and also for the super funny comment “that’s what she said.” 14:11

  • @xavierk99
    @xavierk99 7 месяцев назад

    A great explanation with a lot of energy. Love it!

  • @ezekielchoke2580
    @ezekielchoke2580 4 года назад

    What you're describing around the 30 minute mark - sharing the pool of connections - is exactly what nginx does. It's sometimes called multiplexing. In our case, this causes an issue, since the application behind the LB needs to recognize the client and attempts to set a very long cookie, which the client truncates.

  • @Iliasbhal
    @Iliasbhal 4 года назад

    BTW, you are clearly the best teacher on youtube.
    I think you can teach anything actually ;).
    You are making learning so much joyful.

    • @hnasr
      @hnasr  4 года назад

      Iliasbhal aww 😊 thank you so much I am glad you enjoy the content

  • @richardmaduka4747
    @richardmaduka4747 4 года назад +5

    Your content is gold.

  • @eraldkeshi3645
    @eraldkeshi3645 3 года назад +2

    HI Hussein ! I'm so happy to have found a channel with such a great content. I have noticed that besides the videos, your slides are also very clear and concise. It would be really helpful if you could also share a link to them ! Keep up the good work

    • @hnasr
      @hnasr  3 года назад

      Glad you like them! thanks Erlad!

  • @Obsi995
    @Obsi995 4 года назад +1

    guys not only is he extremely helpful but he also loves The Office :'( amazing

    • @hnasr
      @hnasr  4 года назад +1

      If you are an office fan You will like this http/2 video ruclips.net/video/fVKPrDrEwTI/видео.html

  • @briansaunders4745
    @briansaunders4745 3 года назад

    Can you create a video about the Denial of Service features of a load balancer, and talk about how an ADC is the same or like a load balancer? Very cool delivery and the humor is appreciated and very good!

    • @hnasr
      @hnasr  3 года назад

      Thanks Brian, I talked about DOS here ruclips.net/video/4I7tPW8of2g/видео.html

  • @DevOpsEnver
    @DevOpsEnver 3 года назад

    MashAllah you are so good and professional in your area.

  • @TechverseByAjay
    @TechverseByAjay 2 года назад

    Good to see configuration in the video

  • @SinghGaurav9
    @SinghGaurav9 4 года назад +2

    Hey man, thanks for the video, it was informative.
    Your funny style made it even more interesting.

  • @rishabhjain5459
    @rishabhjain5459 3 года назад +1

    Thanks for making our life easy and also for making your videos a lot more entertaining. :D

  • @smartstack
    @smartstack 2 года назад +1

    very crisp & informative

  • @coolzsatyen1
    @coolzsatyen1 2 года назад

    Great Explanation, however you said you love to repeat, then you do not follow DRY principles :)... Keep posting such great videos. Appreciate !!

  • @icbm7
    @icbm7 3 года назад +1

    was the page not changing at 21:37 was because of the browser cache?

  • @subhamprasad1373
    @subhamprasad1373 3 года назад

    thank you, for your hard work. you are such an amazing person, sharing all this wonderful knowledge.

  • @pkcc9381
    @pkcc9381 5 лет назад

    U are AWESOME. U made this video even though this is not most voted topic in ur last survey.

    • @hnasr
      @hnasr  5 лет назад +2

      PK CC you guys are awesome! Of course I will make videos on topic you guys interested in. Ill just adjust priorities. Hope you enjoy it and thanks for commenting ! Stay awesome 😎

  • @wangsonny8694
    @wangsonny8694 3 года назад

    thanks for this great video, helps a lot for preparing system design interviews!

  • @iQatif
    @iQatif 3 года назад +1

    شكرا ابو علي

    • @hnasr
      @hnasr  3 года назад

      العفو

  • @GlenMillard
    @GlenMillard 4 года назад +24

    "..that's what she said!!!..." Ha - someone is a Micheal Scott fan!!

    • @hnasr
      @hnasr  4 года назад +3

      You think? ruclips.net/video/fVKPrDrEwTI/видео.html

    • @pajeetsingh
      @pajeetsingh 3 года назад

      TLDR?

    • @davidlira8853
      @davidlira8853 3 года назад

      that cracked me up lol

  • @goatslayer5957
    @goatslayer5957 8 месяцев назад

    The man the legend!

  • @Mayank0391
    @Mayank0391 5 лет назад

    Again a very nice video. A detailed tutorial video of haproxy would be great.

    • @hnasr
      @hnasr  5 лет назад +2

      Thanks 😊 haproxy tutorial is requested a lot! Ill need to make it soon. Have so much other videos on my backlog

  • @dr99tm23
    @dr99tm23 3 года назад +1

    thank you a lot.

  • @recepinanc3351
    @recepinanc3351 4 года назад +1

    Thank you for the great post!

  • @parasarora5869
    @parasarora5869 3 года назад +1

    yeeahhh...!! This was fun .. :) .. great video sir !

  • @BoyzaLetlojane
    @BoyzaLetlojane 4 года назад +1

    Enjoyed this video. Learning made fun!! :)

  • @deeptshukla5141
    @deeptshukla5141 4 года назад

    Great placement of that's what she said! Great tutorial @Hussein

  • @AhmedMohamed-xs5ij
    @AhmedMohamed-xs5ij 5 лет назад +1

    This tutorial is great

  • @mamyname
    @mamyname 4 года назад

    Keep up the good Tutorials.. thanks for sharing :)

    • @hnasr
      @hnasr  4 года назад

      Glad you like them!

  • @pablohernandez4305
    @pablohernandez4305 3 года назад

    Great video

  • @casual-corner-k8s
    @casual-corner-k8s 4 года назад

    great explanation

    • @hnasr
      @hnasr  4 года назад

      Glad you liked it

  • @bobbycyy2462
    @bobbycyy2462 3 года назад

    wonderful video!

  • @manasdalai3934
    @manasdalai3934 4 года назад

    Loved it. Great content.

    • @hnasr
      @hnasr  4 года назад

      Glad you enjoyed it!

  • @xinyuzhang
    @xinyuzhang 3 месяца назад

    Oh I bought your lecture on udemy, teacher

  • @mohamedjasim3916
    @mohamedjasim3916 3 года назад

    Just amazing ....

  • @dangaines405
    @dangaines405 2 года назад

    Great content!

    • @hnasr
      @hnasr  2 года назад

      Thanks Dan!

  • @mohamedshlibik6190
    @mohamedshlibik6190 3 года назад

    Great stuff indeed

  • @RandomShowerThoughts
    @RandomShowerThoughts 5 лет назад

    This was a hell of video!

  • @pengdu7751
    @pengdu7751 4 года назад

    great video and explanation. the flying red dot is a bit distracting

    • @hnasr
      @hnasr  4 года назад +1

      thanks and apologies for the red dot, I try to get better as I make more videos

    • @pengdu7751
      @pengdu7751 4 года назад

      @@hnasr but overall great work. keep'em coming. it's been so fun and informational watching your videos. right to the point with demos. I teach in college part time and I wish I could be as a good speaker as you.

    • @hnasr
      @hnasr  4 года назад

      Thank you Peng for your kind words. I find making videos help improve my skills. I still need lots of work, particularly getting to the point quicker

  • @mr.roulette7537
    @mr.roulette7537 2 года назад

    Thanks Sir!!

  • @negiworldnegi
    @negiworldnegi 4 года назад +1

    awesome!

  • @nafasm
    @nafasm 4 года назад

    Great video.Thank You

    • @hnasr
      @hnasr  4 года назад

      Thanks Nafas!

  • @girishnl
    @girishnl 3 года назад

    Great video. great content, very well explained. thank you for your effort :-)

  • @hichamlotfi4277
    @hichamlotfi4277 3 года назад

    you are the best

  • @anicetdidi7957
    @anicetdidi7957 4 года назад +1

    Great! :) funny and clear

    • @hnasr
      @hnasr  4 года назад

      😊 thanks !

  • @narularitesh
    @narularitesh 3 года назад

    Hi Hussein, your method of explanation is amazing, simple and logical. You are right bang on it. Amazing. I am really impressed, because I have always been confused with LBs. I have a few doubts (and probably some ideas for content enhancement based on my doubts), is there a way I can connect with you. Any support is helpful. Thanks.

  • @pajeetsingh
    @pajeetsingh 3 года назад

    Good one.

  • @animatrix1851
    @animatrix1851 4 года назад +3

    I have a small question, also thank you for answering my question on your other video!!! So essentially, my thinking is that you'd need to balance your load if one server is .. well being overloaded. So in this instance, if i do setup a load balancer that doesn't redirect me but actually funnels the data through itself. Then, what's preventing the load balancer from being overloaded itself ? It's handling all the tcp connections of both the servers in your example right ? Sure, it's not doing cpu work but there's some I/O throttling that'll happen eventually right ? I'm just confused here because if that's the case would you put a load balancer to that load balancer, there's still going to be a single point of failure if the balancer dies/overloads.
    Correct me if i'm assuming that I/O load could be high, maybe funneling bytes isn't that tiring and the load balancer could do it no problem. (or) maybe the tcp connection splits away after the initial hit and the data doesn't go through the balancer anymore ?
    I'd love for you to answer this since i've not been able to wrap my head around this part.

    • @chandanapericharla
      @chandanapericharla 4 года назад +1

      Your concerns are totally valid. If there are too many concurrent connections, it can throttle the load balancer itself bringing down the overall availability of the system. Hence, heavy traffic applications like Google and Facebook opt for distributed load balancing where the load balancer is not a single server. Google offers one such service called GCLB-Google cloud load balancer. You can find some info on it here:landing.google.com/sre/workbook/chapters/managing-load/

    • @vjmathew6962
      @vjmathew6962 3 года назад +1

      may be you would have found your answer, if not, see keepalived video of Hussein. You will get an idea
      Edit : keywords VIP ( virtual ip ), VRRP

  • @ayalaginy1734
    @ayalaginy1734 4 года назад +1

    i love you man

    • @hnasr
      @hnasr  4 года назад

      Ayala Giny ❤️❤️❤️

  • @sneharajit41
    @sneharajit41 3 года назад

    I understand the concept of two flavors of load balancer but my question is since a load balancer is basically a software and processes the incoming request why both are not working in a single layer(layer 7)?

  • @brurytangkere4874
    @brurytangkere4874 3 года назад

    Hi, is there example if the HAProxy Loadbalancer using redis db as a session

  • @LawZist
    @LawZist 5 лет назад

    Great stuff!

  • @richardwang3438
    @richardwang3438 5 лет назад +1

    i am a load balancer expert now!

  • @pajeetsingh
    @pajeetsingh 3 года назад +1

    How does actual forwarding works? Create new socket between RP and Server? There has to be at least two open socket invoked in client to backend, is not it? It is just the RP makes it look like one TCP connection.

    • @DYamanoha
      @DYamanoha 3 года назад

      Yeah I was a bit confused about the '1 tcp connection' pro that was called out for Layer 4 LBs. The only way this could work is if you had 2 sockets for each logical connection. One for the client connection, and one for the back-end server connection. As soon as the proxy accepts a client connection it must store that socket along with a new socket connection to which ever back-end server was chosen. Bytes just get copied between the receive and send buffers of the socket pairs. All this ip swapping is automatically done through the socket API abstraction. The same would have to happen for layer 7 LBs. Afaik, the only difference is that Layer7 LBs deserialize the http protocol. One huge benefit is per. http request routing, which can help even out load across your backends.

  • @m3hdim3hdi
    @m3hdim3hdi 4 года назад +1

    الله يرحم والديك

    • @hnasr
      @hnasr  4 года назад +1

      ووالديك مهدي.. تسلم عزيزي

  • @MinhTran-vl4vz
    @MinhTran-vl4vz 4 года назад

    Could you make a tutorial about L7 - load balancer with „Envoy“ ? I do think it has a tremendous potential in this industry

    • @hnasr
      @hnasr  4 года назад

      Minh Tran thanks Minh for the suggestion I agree. L7 load balancing is complex topic that needs its own video. Envoy is a good candidate

  • @charayou8156
    @charayou8156 3 года назад

    Caching for L4 can be done based on the hash of the request ... you don't need to understand the data to cache it.

    • @hnasr
      @hnasr  3 года назад

      The moment you said request you have moved to L7. There isn’t a concept of a request in L4, its just segments/packets with no context on higher layers.
      E.g. One HTTP request = many TCP segments

    • @charayou8156
      @charayou8156 3 года назад

      @@hnasr Hi Hussein, By request I meant TCP block. But I guess it will be a bit awkward if it's made up of more than one segment. Nice video by the way.

  • @RNCode1234
    @RNCode1234 7 месяцев назад

    @hnasr
    If Layer 4 load balancer heavily relies on IP Address which is Layer 3. Why do we still call it Layer 4 load balancer? We could call it Layer 3 load balancer. Isn't it?

  • @blablabla050484
    @blablabla050484 4 года назад

    Great explaination,
    and Very Cool Cursor movements.
    what kind is it ?

    • @hnasr
      @hnasr  4 года назад

      Rico Agung Firmansyah Thanks 🙏 I use google slides

  • @AtulPoddar-x1d
    @AtulPoddar-x1d 11 месяцев назад

    How does the layer 7 LB know which client to respond to, when it receives the response from server? In layer 4, it is done by maintaining a NAT, and it is the same TCP connection.

  • @abdelrahmanabdelfattah1092
    @abdelrahmanabdelfattah1092 3 года назад +1

    Thanks for this great video, I have a question, what is the difference between using an SSL certificate on layer 4 load balancer vs using it on layer 7 load balancer?

    • @hnasr
      @hnasr  3 года назад +2

      Fantastic question. Layer 7 load balancer must terminate TLS while Layer 4 load balancer doesn’t have to. L4 LB can terminate TLS means serve the certificate from the LB, which means it can decrypt and look at the content. It can also decides to Passthrough the TLS. Hello all the way to the backend which means it is end to end encryption and cert is served from Backend

  • @antoniorap8825
    @antoniorap8825 Год назад

    Hey, thank for this helpfull and amazing tutorial and explaination. sorry for my bad english.
    I have a question, the backend IP can be found / detected by anyone ?? its there a possibility to hide a tcp connection using netcat to the load balancer proxy, and connecting to the backend, with sniffing maybe no?
    thank for people who respond and help !

  • @jexxiewoo8390
    @jexxiewoo8390 5 лет назад +1

    Thanks for the content! Just sometimes the screen got chopped off 35:58

    • @hnasr
      @hnasr  5 лет назад +3

      Jexxie Woo thanks 🙏 I did notice that after i posted the video. Thankfully nothing in the chopped screen is important. Appreciate your comment ! And ill make sure to avoid that in the future.

  • @JenniferKrisystin
    @JenniferKrisystin Год назад

    2023 Still relevant. A+

  • @twitchizle
    @twitchizle 3 года назад

    Im here cuz of ur poll

  • @jianxiongng1979
    @jianxiongng1979 3 года назад

    I had a Nginx behind the HAProxy, how can I pass the authentication of Nginx back to Nginx server through the HAProxy?

  • @Textras
    @Textras 4 года назад +1

    Have you done a video on H2C smuggling?

    • @hnasr
      @hnasr  4 года назад +1

      Textras I have not! Didn’t know about it thanks for sharing.. I only discussed HTTP 1.1 smuggling. I wouldn’t worry about h2 clear text though since most h2 setups are secure

    • @Textras
      @Textras 4 года назад

      @@hnasr saw it here twitter.com/theBumbleSec/status/1303305853525725184?s=19

    • @hnasr
      @hnasr  4 года назад +1

      It is actually a serious one if you backend supports h2c, I need to discuss this thanks for sharing!

  • @tusharh4723
    @tusharh4723 3 года назад

    Hi Hussein, great content. Thanks!!
    One question is in your example of layer 7 load balancing with Haproxy I did not see ssl certificate mentioned in configuration,then how Haproxy was able to work on layer7????

  • @viswa9109
    @viswa9109 Год назад

    From my understanding, one http request can potentially span multiple packets. if that is the case, how does layer 4 proxy take care of that. Like if it does a round robin or something else and sends the packets to different servers, wouldn't the packets be useless?
    How does the layer4 proxy handle this
    Edit: Ok so, I see that stickiness is employed. Just had to rewatch the video!

  • @edenr1988
    @edenr1988 4 года назад +1

    Awesome tutorials, I've learned a lot from them about networking thanks !! :) you seems to know a lot about networking so I have one question (maybe not 100% related to this video, it's also related to previous videos that you released) - I have the following use case, I want to redirect traffic to my local private network from a public cloud provider VM and I was thinking whether I should use iptables tcp forwarding (after seeing your other tutorial) or for example nginx / haproxy ws tunnel. Do you happen to know what's the pros and cons of these approaches ? what would be most reliable in terms of latency and security ? should I be just fine with iptables TCP forwarding ? or should I go with ws tunnel (The next step would be to build client / server app to automate the update of my private NAT IP address on that server so I can keep getting traffic from that "cloud static ip", I would also make it open source with MIT once I get into implemention)
    I've tested the iptables tcp proxy from your other tutorial and it did in fact worked, I could recieve traffic and respond from a cloud instance that was transfering the tcp packet to my local network. I've never tried ws tunnel thought and would like to know your opinion.
    To be more specific I have a Kubernetes Ingress on my local network (Layer 7 Loadbalancer) that the traffic would be transfered to it using portforwarding on my router. So from the cloud instance all I need is the static ip address basically (and the point of it is that I would be able to use more resources by only creating one single instance for probably $5 a month), I just want to transfer the client to my private cluster on my private network, the rest would be handled on my local private network.

  • @Midhunchowdary
    @Midhunchowdary 3 года назад

    Wondering if microservices can run behind Layer 4 LB by running the services on different ports?

  • @ranjithamarkachari8217
    @ranjithamarkachari8217 2 года назад

    nice

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 2 года назад

    in layer 4 ,we have one connection between the client and the load balancer and the server ? how is that happening , what about the acks > and what happen if the packet is lost between one node and the other ?

  • @brianpayne3468
    @brianpayne3468 3 года назад

    Can you do a log-format in using logging (rsyslog) in HAProxy. I like to troubleshoot an HAProxy issue where it is dropping connections in rare occasions.
    Something to do with a sticky-bit in HAProxy timing out. The HAProxy is used as a Load Balancer ( reversed proxy) and runs as a container. Only connect using HTTPS in the Load Balancer using ports 80, 443, and 7999.
    From the logs, I like to see why and where it is dropping the connection. I would like to see the log info on the time duration of the connection.
    I am currently using 3.2.14 version of HAProxy.
    Thanks!

  • @krozaine
    @krozaine 3 года назад

    Layer 4 Load Balancer Demo : How did HAProxy know 4444 is down? Was it the first failed request that told it or was it some heartbeat type of mechanism between HAProxy and the backend services? Also, I am curious about the "check" keyword mentioned in the cfg file.

    • @hnasr
      @hnasr  3 года назад +2

      Haproxy periodically does a health check against the backends and see if they are alive. And if they are not they remove it from the backend pool

  • @tobiisurmaster
    @tobiisurmaster 4 года назад

    Great video Hussein! I was wondering if you could clear something up for me. In Layer 4 load balancing you mention that only one TCP connection is used - the connection between the client and the load balancer. How exactly does the load balancer communicate with the backend servers in this scenario? My naive assumption was that it'll need to maintain TCP connections to the backend servers in order to communicate with them, but this isn't the case for L4 load balancing.

    • @hnasr
      @hnasr  4 года назад +1

      tobiisurmaster thanks for your question! Again it really depends on the implementation but one implementation is to use NAT or network address translation.
      Think about your router, when you want to establish a TCP connection between your machine and a server say google.com you have one TCP connection between you and google despite having your router in between.
      Every single packet goes through your router and your router maintains a table (NAT) and replaces the sourceIP address with its own . This is very similar to what layer 4 load balancer does. Its one connection between you and the final destination backend server the only difference is that you don’t know which destination server you will hit, the LB now replaces the destination IP address in this case. And when the backend responds to the LB the LB replaces the sourceIP from backend ip to its own IP. So the LB just plays on table.
      Again this is one implementation there are many others.,

    • @tobiisurmaster
      @tobiisurmaster 4 года назад

      @@hnasr I see. Thanks for clarifying!

    • @aryankumar87771
      @aryankumar87771 2 года назад

      @@hnasr thanks, perfectly explained

  • @CODINC
    @CODINC 4 года назад

    Hussein what is the use of load balancer if i can use reverse proxy because reverse proxy is a load balancer? Is it any efficient?

  • @93kazem
    @93kazem 4 года назад

    Would like to see how HA proxy works :) A bit more in depth maybe?

    • @hnasr
      @hnasr  4 года назад +1

      Qasim Albaqali hey Qasim, check out my in depth HAPROXY Video HAProxy Crash Course (TLS 1.3, HTTPS, HTTP/2 and more)
      ruclips.net/video/qYnA2DFEELw/видео.html

  • @ncebamandizvidza
    @ncebamandizvidza Год назад

    The sneaking in of that's what she said :)

  • @MuhammadAbusaa
    @MuhammadAbusaa 5 лет назад

    Layer 7 is like ingress "path routing" + load balancing between servers

  • @hingusanjay
    @hingusanjay 4 года назад +1

    Great tutorial. One question, if load balancer algo it round robin, then it was sticking to 4444 or 5555 only without you killing one of the server?

    • @la4123
      @la4123 9 месяцев назад

      I'm wondering abaut that either. It's so weird.