To learn more about networking fundamentals check out my udemy course Fundamentals of Networking for Effective Backends Head to network.husseinnasser.com for a discount coupon
being in the industry for over 10y as Networking background, sometimes these nitty gritty details are just overlooked. The whole idea of jumping on your 10mins videos .... just brings it back to your top with additional knowledge. What a channel, I have almost watched each and every single video and I am falling in love in Software Engineering
I'm studying Google cybersecurity and your explanations help me to better understand the concepts. Thank you so much for your kindness in sharing your knowledge.
how could you explain a complicated concept in such a simple way. It helps a lot to also explain the reason of synchronization, acknowledgement and random sequence number for both server and client. Thank you.
Your videos are amazing, I don't know why your are not viral yet. Also wanted to ask a question, There is a registration form, whenever someone register , I need to show the live count of the people registered on the home page, but there could be 3k+ users at the same time. So If I want to display the live count, 2option will be to call an API everysecond for 3k users or WebSockets. Everyone told me wesockets , because the api could overload the server. But my question is if API will overload the server , wont websocket load the server too? Cuz its technically sending and receving data from the server. Would appreciate your suggestion on this
Debug Media I think the websocket approach or SSE is good in this case. Server side logic 1) User opens page 2) a websocket connection established with server 3) cron job runs on server every 10 seconds , get count and push the count to every websocket connection in the server. (Repeat for every server in the cluster) 4) 3k users register at once, database updated 5) cron job picks up next 10 seconds and push new count to all clients. The trick is to run some load balancing in case many users open many pages so you handle the load. I talked about that in scaling load balancers in websockets The load will be the database to be honest here so if you can maximize the time to hit the db the better 10 seconds is enough... You have to add some local cache on the server (state) of the current count of users and push that number for people who just joined the server (new wrb socket connection) so page doesn’t open up empty for 10 seconds Again thats one solution obviously .. you can come up with others that use pull model but that require caching and might be more complicated Does it make sense? What have you come up with? And what do other people reading this think? Would love to know 👍
@@hnasr 3k users won't be registering at the same time, But it's more like 3k sockets will be created as they visit the page so they can see the live count. So, currently, I'm calling an API on the refresh of the page, till I find a solution to this. Because I thought creating 3k sockets might affect the server, it is deployed on AWS. But I will give your solution a shot with the cron job.! Thank you so much. In one of the video, you said you were in Bahrain. I am in Dubai, But I don't speak Arabic (cuz that's what usually people ask when I say I am in Dubai haha )
Great video. This helps to understand the handshake in more practical way. Just wanted to know whether you have already created the video for TCP termination as well. Apologies for asking as I know you are already creating lot of quality content.
when is a new tcp connection started. meaning how long does a tcp connection last, or when is it closed. is every request to a website a new tcp conneciton?
Both sides need to prove their abilities of sending and accepting data. If only 2 handshakes, only client knows that server has proper abilities of sending and receiving data but server doesnt know whether client can accept data as well, so client need to reply server its ability. Then both sides can trust each other. Thats my understanding
We need to learn more about the ACKs and how the TCP connection is closed... I can't wait for the next video :) You also could've put it all together as a 30 minute video (like how you normally do - or are you prefer to do shorter videos now?)
Hi Hussein I have question about the actual get request you send request from the client and server sends ack for it and then I assumed server should know is really client get the ack for it because maybe client send this tcp request again if he doesn't get ack My question is does client send ack for also ack? Thank you for response
Sending the HTTP GET request is oversimplified in the video and can lead to confusion. You have mixed the application layer and transport layer. Any application layer data can be divided into multiple transport layer request response.
thank you for this amazing video, but I have a question does the third message of the three-way handshake need a seq number or not? (ACK that the client send after receive the SYN/ACK from the server)
Sundaram Jha here is one usecase --Port forwarding with NAT and iptables (transparent proxying) - “Run” you... th-cam.com/video/uuWzk8U4dJE/w-d-xo.html via @TH-cam
Sir, I am confused about one thing. When server sends that ACK 700 and SYN 200, then 200 is the sequence of the packets that server will send as response to get request ??
Doesn't the server also need to know the total number of packets to know when all of them have arrived? Or it receives another acknowledgement from the client when it has sent the acknowledgements for all of the individual packets?
Hey..Hussien So here is what my ISP does to deny me service. It allows three way handsake( SYN, SYN ACK, ACK) successful but then when clienthello is sent, the DPI injects a RST packet both to the client request and server request hence closing the connection on both ends.. So iam like hmmmm ,,, Cant i somehow trigger both the client and server to ignore the RST packet and continue with the handsake hence establishing a successful connect.. ...... Planning to implement simple client and server to test this theory maybe in python but have basic coding skills(need your recommendation)
To learn more about networking fundamentals check out my udemy course Fundamentals of Networking for Effective Backends Head to network.husseinnasser.com for a discount coupon
being in the industry for over 10y as Networking background, sometimes these nitty gritty details are just overlooked. The whole idea of jumping on your 10mins videos .... just brings it back to your top with additional knowledge. What a channel, I have almost watched each and every single video and I am falling in love in Software Engineering
You are so simple that makes agressive understanding for a beginner. Thanks for that!!!
after 3 years this video still helps,thanks man
I was struggling with understanding this for a while. You made it so simple. Thank you!!
Sent from heaven. Our very own GURU.
Saved my day! I appreciate it as a beginner.
Long Chen 😊🙏 glad it helped!
I'm studying Google cybersecurity and your explanations help me to better understand the concepts. Thank you so much for your kindness in sharing your knowledge.
You’ve helped me learn WebSockets! Thank you!
Jaguar Trials glad I could help 😊
Awesome! what a clear and beautiful explanation. Confusion cleared. Thanks a lot! 👍
Shahzad Ahmad Bhatti thanks 🙏 😊
Thanks hussein for this great explanation. Saludos desde Argentina 🧉🧉
05:30 i'm not a network engineer but i have read once that the randomness is to ensure that there is no confusion with other packets
how could you explain a complicated concept in such a simple way. It helps a lot to also explain the reason of synchronization, acknowledgement and random sequence number for both server and client. Thank you.
Your videos are amazing, I don't know why your are not viral yet.
Also wanted to ask a question,
There is a registration form, whenever someone register , I need to show the live count of the people registered on the home page, but there could be 3k+ users at the same time. So If I want to display the live count, 2option will be to call an API everysecond for 3k users or WebSockets.
Everyone told me wesockets , because the api could overload the server. But my question is if API will overload the server , wont websocket load the server too? Cuz its technically sending and receving data from the server.
Would appreciate your suggestion on this
Debug Media I think the websocket approach or SSE is good in this case.
Server side logic
1) User opens page
2) a websocket connection established with server
3) cron job runs on server every 10 seconds , get count and push the count to every websocket connection in the server. (Repeat for every server in the cluster)
4) 3k users register at once, database updated
5) cron job picks up next 10 seconds and push new count to all clients.
The trick is to run some load balancing in case many users open many pages so you handle the load. I talked about that in scaling load balancers in websockets
The load will be the database to be honest here so if you can maximize the time to hit the db the better 10 seconds is enough...
You have to add some local cache on the server (state) of the current count of users and push that number for people who just joined the server (new wrb socket connection) so page doesn’t open up empty for 10 seconds
Again thats one solution obviously .. you can come up with others that use pull model but that require caching and might be more complicated
Does it make sense? What have you come up with? And what do other people reading this think? Would love to know 👍
@@hnasr 3k users won't be registering at the same time, But it's more like 3k sockets will be created as they visit the page so they can see the live count.
So, currently, I'm calling an API on the refresh of the page, till I find a solution to this. Because I thought creating 3k sockets might affect the server, it is deployed on AWS.
But I will give your solution a shot with the cron job.!
Thank you so much.
In one of the video, you said you were in Bahrain. I am in Dubai, But I don't speak Arabic (cuz that's what usually people ask when I say I am in Dubai haha )
Your explanation is excellent!
Glad it was helpful!
This was a great video. Some feedback: Could find any relevant material in the content on "impact" of handhake on performance
Ma man spittin gold
Sir ur so good about to make understand really thank full for this video .
I will name my son after you!! Great tutors!
Great video. This helps to understand the handshake in more practical way. Just wanted to know whether you have already created the video for TCP termination as well. Apologies for asking as I know you are already creating lot of quality content.
thank you so much for this!
when is a new tcp connection started. meaning how long does a tcp connection last, or when is it closed. is every request to a website a new tcp conneciton?
Both sides need to prove their abilities of sending and accepting data. If only 2 handshakes, only client knows that server has proper abilities of sending and receiving data but server doesnt know whether client can accept data as well, so client need to reply server its ability. Then both sides can trust each other. Thats my understanding
Could you make a video about QUIC please, how does it work and its handshakes?
Awesome topic.
We need to learn more about the ACKs and how the TCP connection is closed... I can't wait for the next video :)
You also could've put it all together as a 30 minute video (like how you normally do - or are you prefer to do shorter videos now?)
Thanks Harry! I mix now. Sometimes longer or shorter videos based on the topic. But good idea!
Hi Hussein I have question about the actual get request you send request from the client and server sends ack for it and then I assumed server should know is really client get the ack for it because maybe client send this tcp request again if he doesn't get ack
My question is does client send ack for also ack?
Thank you for response
Sending the HTTP GET request is oversimplified in the video and can lead to confusion. You have mixed the application layer and transport layer. Any application layer data can be divided into multiple transport layer request response.
thank you for this amazing video,
but I have a question does the third message of the three-way handshake need a seq number or not? (ACK that the client send after receive the SYN/ACK from the server)
what is Iptables? why it is exist & how we whitelist other particular site to consume our API. if could you please create a video.
Sundaram Jha here is one usecase --Port forwarding with NAT and iptables (transparent proxying) - “Run” you... th-cam.com/video/uuWzk8U4dJE/w-d-xo.html via @TH-cam
Can you explain the OSI and TCP/IP please, thank you
Sir, I am confused about one thing. When server sends that ACK 700 and SYN 200, then 200 is the sequence of the packets that server will send as response to get request ??
Doesn't the server also need to know the total number of packets to know when all of them have arrived? Or it receives another acknowledgement from the client when it has sent the acknowledgements for all of the individual packets?
Thats for a higher protocol to decide, HTTP for example uses content length header and new line
When u remember OK is also 200 6:02
Please, Make video for comparing TCP vs WebSocket. What exactly they do differenlty.
Vimal Mistry I actually did compare it to tcp here check out the playlist WebSockets
th-cam.com/play/PLQnljOFTspQUGjfGdg8UvL3D_K9ACL6Qh.html
Hey..Hussien
So here is what my ISP does to deny me service.
It allows three way handsake( SYN, SYN ACK, ACK) successful but then when clienthello is sent, the DPI injects a RST packet both to the client request and server request hence closing the connection on both ends..
So iam like hmmmm ,,,
Cant i somehow trigger both the client and server to ignore the RST packet and continue with the handsake hence establishing a successful connect..
......
Planning to implement simple client and server to test this theory maybe in python but have basic coding skills(need your recommendation)
I would instead encrypt the entire packet so the ISP can’t find out the domain your going to, try TLS 1.3 and ESNI ?
@@hnasr
Thought about that too..
Gonna try that and get back to you
@@chebalid7524 did u implemented?
Does TLS setup happen immediately after this handshake ?
kidsWillSeeGhosts correct immediately after.
What's a ghost byte?
thanks
Great
sir can you navigate me to the part where u explain what happens after TCP handshake.
NO Oxygen try this one Wiresharking CURL - How a single GET request translates to 10 TCP Packets
th-cam.com/video/gOEiBliwMUA/w-d-xo.html
What basically happen is optionally TLS and then the protocol
lets do elastic search also....!!!!
Hussein, can you please tutor me?
You hit the mike? lmfao wth??
stop doing drama and concentrate on content. this pitch up-down is irritating.