Is this the end of WebSockets? - The New WebTransport Protocol

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there is a new protocol in town and it's called web transport so the first question is is this the end of warp sockets let's find out guys if you're new here i discuss back in engineering and anything related to the backend and that includes communication protocol so if you like this content subscribe hit that like button and do all that stuff let's just jump into it so guys websocket for the longest time we have been using websockets since its emergence and it was was designed to use the restrictive web model that we have uh and build a two-way communication between a client and server because we didn't have that client and server on top of the http protocol always request response you make a request get paused and then you wait or asynchronously wait and then you get a response but we don't have a way for the server to send us information after which the client has requested them some some piece of content right we don't have this by direction we want to build chatting app we want to build a gaming app so people smart people from the ietf sat down and built the websocket protocol and i made a video many videos about it check out the playlist right here if you want to learn more about it but i've been browsing uh the rfcs and following some people on twitter and i've learned about a new protocol called web transport and it does exactly the same thing so the first thing that came to my mind why do we need a new protocol if there is an existing one that does exactly that that means there are some limitations that we don't know about in warp sockets well some of them we knew about some of them we just not not things that you and i run into today day-to-day basis that's a critical thing by the way guys there are problems with everything in the world that sounds very political there are problems with every protocol with every technology it's just do you have that problem or not that's a question you should ask yourself so regardless the website could have problems and i'm going to discuss some of these problems in a minute so what are the limitation of the websocket protocol so the first one that comes to mind is the head of line blocking at the tcp layer right because that's the same problem that we have with http 2. i talked about that right here but in a nutshell let's say you're sending an image and that's a large image and that you are going to use that websocket protocol to send that image and if you want to do that that means you have to break that image into small pieces of data and then you stuff this well with the client the websocket client will stuff this into a web socket message and that basically means it has headers add its own pr websocket protocol stuff and then these will be shipped so that means this is now just a websocket message it doesn't know it's a picture right so if you send now normal mob socket traffic like i don't know chat or hi or hello in the same websocket connection then in the tcp stack this high might be blocked because all of this image has to be reassembled why because we're using the tcp protocol and the order of the segments or the packets that we receive must be honored and as a result if you have semantic or use cases where the order doesn't matter like i don't care if the picture was or the high received before the picture i don't care of course whenever whatever received first please show it to to my client to my destination right that's the problem of the upsocket and you might say saying i'm gonna i'm just gonna solve this by creating multiple websocket connections one for file transfer one for uh one for chat and that's exactly what uh what discord uses actually we talked about that a little bit so that's a kind of a work workaround so you use that's what ftp uses as well if you think about it if tp has like dual channel where some channel for the data transfer i believe i'm not networking engineers please correct me if i say something stupid but there's two channels one for just metadata and one for the actual data so that they don't have this blocking problem that you have right so that's one problem another problem is and this might not be a problem for you and i but the client must initiate the connection well you say i was saying duh of course client has to initiate a connection that's how that's how how things work now we that's when you know to avoid all the netting problems or security that client has to ensure the connection maybe but you can make but the server cannot send any information without the client awareness http push try to do something like that by creating a new stream and then the server create a new stream and then push content to the client it wasn't successful chrome actually removed it check out the video here right so and so the server can't have a way to establish a unique let's say channel to the client and and and send it some own information without having that client to communicate to it first so that's missing in websocket so the the the this thing this new protocol called web transport tries to address these problems and it comes in three flavors actually i was like yeah oh i was surprised so the first flavor is web transport on top of http 2. so they took this protocol and they made it on top of http 2 now right and i'm going to make a dedicated video about web transport but this is in a nutshell so you can do whoop transport on top of http 2. that's interesting by the way you can do web sockets on top of tgd2 i'm going to talk about in another video right so that's nothing fancy here is just compatibility i guess they made web transport on top of http 3 so quick http 3 and quick and the final which is my favorite they made web transport on top of quick am i safe isn't that the same thing as db3 no this is great for people who don't want the bloat of http like database people they don't like that i don't like your stupid headers that you have http guys i want to tap into the raw protocol which is quick and i still need to make a video about quick sorry advice guys i talked about it many times in the channel but in general it's just very similar to http 2 it's just they moved it down to layer 4 which is beautiful all right so so now you can essentially use the web transport to create streams you communicate through extremes and we'll come to the details will that address most of the needs will that solve these websocket problems are these even problems to me i don't think they are and but again the swoop transport thing might in the future replace wipe sockets but i don't think the problems of warp sockets are severe enough for users like you and i to consider switching protocols because we just got used to it whoop socket is great the idea of having streaming though through websockets like streaming video or content this thing if they did it right again this is all under draft nothing is finalized it's fresh vertical so if they did it right you can essentially use this warp transport to transfer video content stream audio without having the head line blocking so it's just like this be streaming nicely it's a stream of data and and and the client will just take it as is so there and since we're using udp specifically in http 3 and quick you don't have the problem with nfl blocking tcp it will not be treated as packets that have to be blocked and sequenced no that would be really powerful yeah again we'll have to wait and see there was a meeting oh the ietf that i attended i attended i just watched the live stream not part of it but it was interesting that the way they broke this into three or three parts i don't see the value of whoop transport to be honest in http 2 because that's just tcp which is that's just yeah the same problem with head of loan blocking so what's the value of making the effort to build that protocol hdb2 when you can just focus on this db3 on quick but that's just me i don't think there's a value to do that right because websocket works with http too right it works as a as a as a as a tunnel and i'm gonna make a video about that in details in the future all right guys i'm going to leave the question to you do you think uh web transport will replace web sockets at all and all other platforms and when it comes to web transform or other protocols in the future let me know in the comment section below i'm going to see you on the next one you guys stay awesome goodbye
Info
Channel: Hussein Nasser
Views: 84,833
Rating: 4.8091898 out of 5
Keywords: hussein nasser, backend engineering, websockets protocol, websockets vs webtransport, websockets http/2, websockets http/3, websockets http/1.1, websockets limitations, websockets vs http, websockets problems, websockets slow
Id: jvdg-jOYK5E
Channel Id: undefined
Length: 10min 23sec (623 seconds)
Published: Fri Nov 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.