What Really Happens When You Make an HTTP Request? Chai aur Computer network — Transcript
Full transcript
- 0:00Hello everyone, welcome back to another
- 0:01video. And in this video, we're going
- 0:03to talk about what happens when you
- 0:05make an HTTP request. Okay? So, I'm
- 0:07starting this playlist with this video
- 0:09because I'm assuming you've built a few
- 0:11servers. Maybe to do applications or
- 0:13you've worked on a project where you
- 0:15have a front end and a back end
- 0:16involved, where you're making HTTP
- 0:18requests from the front end to the back
- 0:20end. And you know how you do that. But
- 0:23you have no idea what happens under the
- 0:25hood. Okay? So, that's what we're going
- 0:27to demystify in this video. What's the
- 0:29agenda of this video? I'm going to
- 0:31introduce a lot of networking concepts
- 0:33in this video. I mean, I won't give you
- 0:35an in-depth explanation. I'll just
- 0:37introduce you to them so that when we
- 0:39look at them in-depth in the playlist,
- 0:41or create a dedicated video for them,
- 0:42you'll have a reminder that when I
- 0:44first learned about HTTP requests, this
- 0:46component was in this section. Okay? So
- 0:48, with that said, let's jump into the
- 0:50video. Now, let's see what happens when
- 0:52you make an HTTP request. Okay? So,
- 0:53let's have the React front end. It's
- 0:57running on my local laptop at 12701 and
- 0:583000. We all know what this is? This is
- 1:01my local host. This is a looped backing
- 1:03IP. Okay? And 3000 is my port on which
- 1:05my React JS is running. Then I also
- 1:07have a React JS back end that I
- 1:09deployed on AWS EC2. And that's running
- 1:13on IP 10001 and port 443. Okay? It can
- 1:17be 8000, but I've chosen 443. Let's
- 1:19note, I've also hosted the backed JS
- 1:21server with the domain name https
- 1:23apix.com. What is ps? This is a
- 1:27protocol secured by HTTP. We'll look at
- 1:28this in detail in the future. There
- 1:30will be a dedicated video for each of
- 1:32these concepts I'm introducing. Okay?
- 1:35One disclaimer: in this video, I'll use
- 1:37this as my source IP. What is my source
- 1:39? The one initiating the request. Okay?
- 1:41The one initiating the request is my
- 1:43front end. And this will be my
- 1:44destination IP, 10001. But the
- 1:46disclaimer is, this can't be my public
- 1:48IP, because this is a looped back end
- 1:49IP. That means this IP has no
- 1:53significance outside of this laptop.
- 1:56But in this video, for simplicity, I'll
- 1:58consider this IP as a source IP. Just
- 2:01note this. But after this video, we'll
- 2:03cover everything in detail about IP,
- 2:04MAC, ports, TCP, and HTTP in a
- 2:07dedicated video. For simplicity, I'm
- 2:09using the source IP address here as
- 2:11localhost. And my destination IP
- 2:13address is 10001. Currently, 10001
- 2:15generally falls within a private IP
- 2:18range. But for simplicity, let's use
- 2:20this as my public IP address. I just
- 2:22wanted to add a disclaimer so no one
- 2:24can hack it. For simplicity, let's keep
- 2:26this as the source IP address and this
- 2:28as the destination IP address. So, what
- 2:29is an HTTP request? Whenever you
- 2:32execute this code, the response is
- 2:34equal to await fetch https apix.com.
- 2:38Let's use the slash profile address and
- 2:40send an HTTP request. So, this is how
- 2:42we code this HTTP request. As a
- 2:44developer, we write this code and
- 2:46forget it. But let's see what happens
- 2:48under the hood of this code. Now, the
- 2:50first thing that happens is we do a DNS
- 2:52query. Why? Because in Fetch, if you
- 2:54see this, this is my domain name. And
- 2:56over the internet, because this is my
- 2:58local laptop. This is my AWS EC2
- 3:00instance, which is in a different data
- 3:02center. So, physically, these are two
- 3:04different machines. Okay? So, to
- 3:05connect them, we have to travel over
- 3:07the internet. And to travel over the
- 3:10internet, just knowing the host name
- 3:12isn't enough because what is this? This
- 3:14is just a string. And using a string to
- 3:16travel over the network over the
- 3:18internet isn't feasible. So, what do we
- 3:20need? We need the IP address of my
- 3:22destination. When I'm writing this
- 3:24request in this front-end code, as a
- 3:26developer, I'll use the domain name.
- 3:28API example.com. But what does Fetch do
- 3:31under the hood? It will make a DNS
- 3:33request. What is DNS? Domain Name
- 3:35System. Okay? What is a Domain Name
- 3:37System? Simply put, there's a dedicated
- 3:39video on it. What does it do? It takes
- 3:41a host name as input and returns its
- 3:44relative public IP address, which in
- 3:47our case, we've assumed is 10001.
- 3:50That's it. That's the job of DNS.
- 3:52Obviously, we'll look at DNS in detail
- 3:54to see exactly what it entails. What is
- 3:57a recursive resolver? What are DNS
- 3:59resolvers, authoritative name servers?
- 4:01What are root servers? What are
- 4:02top-level domain servers? We'll explore
- 4:04everything in depth in the future. But
- 4:06for now, the first thing that happens
- 4:08is it runs a fetch DNS query for this
- 4:10domain name, which will return the
- 4:12public IP address that this host name
- 4:14holds. Meaning, whatever the public IP
- 4:16address of this host name is, the one I
- 4:18configure in my DNS settings. Whenever
- 4:19I deploy NoteJS, it will be returned by
- 4:22my DNS. Okay? So we've got the
- 4:24destination IP using DNS. Okay? Now
- 4:26let's keep note of all these criteria
- 4:28we've noted. So these are the criteria
- 4:31we've noted. What is our source IP?
- 4:3312701 Again, this is a loop back. But
- 4:35for this video, let's assume this is my
- 4:37public IP. Okay? Then what is the
- 4:39source port? It's 3000. What is the
- 4:41destination IP? 10001. What is the
- 4:43destination port? It's 443 because it's
- 4:46HTTPS. Where will the ReactJS front end
- 4:50run? The browser, that's the web app
- 4:51run on the browser. So, whenever the
- 4:53browser sees HTTPS, it will assume that
- 4:56your destination port will be 443. Okay
- 4:59? So, we've got these criteria. Now
- 5:01let's see what happens next. So I've
- 5:02already created the flow. I've created
- 5:04the design. Now let's see exactly what
- 5:07happens. This HTTP request looks
- 5:09something like this. Right? It will
- 5:11have HTTP. What is the type of request?
- 5:13What is the path name that is the slash
- 5:15profile. Right? Here we are making an
- 5:17API call using our slash profile. Right
- 5:19? Then there will be a header where we
- 5:20will insert our bearer token
- 5:21authentication token. There will be
- 5:23some cookies. There will be some custom
- 5:24headers. Right? So this is what my HTTP
- 5:26request looks like. And HTTP is based
- 5:29on TCP. That means whenever you make an
- 5:32HTTP call, under the hood it uses the
- 5:34TCP protocol. What is TCP? It is
- 5:36Transmission Control Protocol. In the
- 5:38future, there will be a dedicated
- 5:40module on this where there will be five
- 5:42or six videos in which we will
- 5:43demystify TCP in depth. We'll learn
- 5:45everything about TCP. Flow control,
- 5:47congestion control, everything. For now
- 5:49, just remember that HTTP is built on
- 5:51top of TCP. Okay? Right? This is an
- 5:53HTTP request. First thing, what happens
- 5:55? We convert this text, which is a kind
- 5:58of text, into bytes. Why? Because when
- 6:00data travels over the network, it's
- 6:02obviously going to be bits, ones and
- 6:04zeros. Right? So, how do we need to
- 6:06convert our text, which is a string,
- 6:08into bytes? So, when we make the
- 6:10request, this HTTP request is converted
- 6:13into bytes using some text encoder.
- 6:15That's enough for now. In the future,
- 6:17we'll look at these details when we
- 6:19look at HTTP to see exactly what its
- 6:20structure is. Okay? Now, we've got the
- 6:22bytes of this HTTP request. I've
- 6:24represented them in hexadecimal form.
- 6:27So, I've got a big stream of bytes.
- 6:30Once this is done, my browser says, "
- 6:33I've prepared the data that I need to
- 6:36send to this back end. Please send this
- 6:39data over the internet." Who does it
- 6:41say this to? My operating system. This
- 6:43object. The browser's job is simply to
- 6:45understand the request. Run DNS queries
- 6:48, get the IP address, get the public IP
- 6:50address, and get the port address.
- 6:51Right? Once that's done, the whole
- 6:53thing is ready. Now, to actually send
- 6:55it physically, it has to take help from
- 6:57the underlying operating system. Right?
- 7:00So, the browser tells me to send this
- 7:01data over the network. Now, my OS's TCP
- 7:03/IP stack comes into the picture. What
- 7:06is an OS's TCP/IP stack? My underlying
- 7:09OS, whether it's Mac OS, Windows, or
- 7:11Linux, has its own implementation for
- 7:13all these things, including networking.
- 7:16That's TCP, UDP, ICMP, and IP, which
- 7:18we'll obviously see in detail in the
- 7:20future. All these things are dealt with
- 7:23at the OS level. Because at the end,
- 7:25whatever your request is physically
- 7:26transferred through the network card,
- 7:28the network interface card, is
- 7:29controlled by the OS. The browser can't
- 7:31handle it. The browser can't control it
- 7:33. So, once the browser is ready with
- 7:36the bytes of my actual HTTP request, it
- 7:38delegates the actual networking work to
- 7:41my OS's TCP/IP stack. That's nothing
- 7:43but your OS's IP/TP stack. Okay? So, it
- 7:45says send the data over the network.
- 7:47Now, what does the OS's TCP/IP stack
- 7:49say before sending this data to my back
- 7:52end? Because HTTP is based on TCP, and
- 7:55TCP is a connection-oriented protocol.
- 7:58We'll see this in detail in the future.
- 7:59Why is that? What do you mean by
- 8:01connection-oriented protocol? Before we
- 8:03can actually send this data between our
- 8:06source and destination, we need to
- 8:08establish a TCP connection. Keep in
- 8:11mind that I have a client, which is my
- 8:13front end, and a server, which is my
- 8:15back end. To send any data to the
- 8:17server, my client needs a pipe through
- 8:20which it will send data. To create that
- 8:23pipe, TCP uses something called a TCP
- 8:26three-way handshake. We'll cover this
- 8:28in detail in a dedicated video. What
- 8:30exactly is this? But what does it do at
- 8:31a higher level? This will create a TCP
- 8:34connection between my front end and
- 8:36back end, through which all this data
- 8:38will flow. Okay? So, what's the first
- 8:41thing the OS does? As soon as the
- 8:42browser tells it to send this data over
- 8:44the network, it first creates a TCP
- 8:45connection. This is the starting point.
- 8:47Once the connection is established, it
- 8:49takes this entire block and breaks it
- 8:52into chunks. Okay? This is the
- 8:53essential part. Because this data can
- 8:55be very large. Right now, my HTTP
- 8:57request might be 500 bytes or 600 bytes
- 9:00. But there's a chance I might have a
- 9:021GB PDF file. So, this is a lot of data
- 9:04. Right? So, this data can be big. What
- 9:06does TCP say? Instead of sending this
- 9:08whole data at a time, I'll break it
- 9:10into smaller chunks. This chunking has
- 9:14an algorithm. It also depends on your
- 9:17MTU (Maximum Transmission Unit) and MSS
- 9:20(Maximum Segment Size). We'll have a
- 9:22dedicated video on MTU and MSS in the
- 9:24future. Okay? So, don't worry, you'll
- 9:26understand all this in detail. So,
- 9:28based on MSS and MTU, the size of this
- 9:31chunking is defined: whether it's a
- 9:33two-byte chunk or maybe a 10-byte chunk
- 9:36. Right? This depends on multiple
- 9:38factors. Okay? Now, let's assume it
- 9:40created two-byte chunks. So, this is
- 9:42one byte of FE12. Okay? Which I've
- 9:44entered here in this diagram. Then this
- 9:46byte of 00 appears. This is the
- 9:48hexadecimal representation of my HTTP
- 9:50request. It's not actual. I've entered
- 9:52this hexadecimal format at random. But
- 9:54let's assume that this hexadecimal
- 9:56format is the HTTP request itself. So,
- 9:58we're breaking the hexadecimal format
- 10:00of this HTTP request into smaller
- 10:02chunks. This chunking is also done by
- 10:05the TCP/IP stack of OC OS. Let's assume
- 10:08it created these 20 chunks. Okay?
- 10:10That's a total of 20 chunks. There are
- 10:11a few chunks in between as well. Once
- 10:12the connection is established, I'm
- 10:14converting all the data into chunks.
- 10:16Along with converting this into chunks,
- 10:18this means that after converting the
- 10:20actual data into chunks, it will attach
- 10:22a source port and a destination port.
- 10:24This is the important part. TCP deals
- 10:26with port numbers. What is a port?
- 10:29React JS running on 3000? 3000 is a
- 10:31port. FastAPR running on 8000? 8000 is
- 10:33a port. Okay? So, my port tells me
- 10:36which of the 1000 processes running on
- 10:38that one physical machine I want to
- 10:41forward the data to. In this case, my
- 10:43source port will be 3000, which is the
- 10:46port of my React.js front end. So, my
- 10:48source port tells me where this segment
- 10:51comes from. This is the instance part.
- 10:53And what is the destination port? It's
- 10:54the port of my EC2 instance's React.js
- 10:56back end. If you see 443, why? Because
- 10:58my HTTP is running on PS. So the
- 11:00browser assumes it's running on port
- 11:02443. Right? So, 4443 is the point when
- 11:04this segment is seen and it reaches my
- 11:07EC2 instance. What is an EC2 instance?
- 11:09It's a standalone machine. There could
- 11:10be 1000 processes running on it. Maybe
- 11:12I just ran Python's instance on it.
- 11:14Maybe I also ran Django on it, which
- 11:16runs on different ports. So the
- 11:18destination port indicates, in this
- 11:20case, 443, that this segment is
- 11:23destined for my JS backend. Whenever
- 11:25this segment reaches this backend,
- 11:27we'll see in the future how it will
- 11:29arrive. As soon as it reaches, based on
- 11:32the destination port, the data from
- 11:34that segment, the data in between, is
- 11:36forwarded to this new backend. Okay? So
- 11:38that's the meaning of port numbers. Now
- 11:41, in this TCP segment, along with my
- 11:43data, FPE 12, this is part of my data.
- 11:45What I've created by breaking up the
- 11:46actual HTTP request is a chunk. The
- 11:48source port is the source port, and the
- 11:50destination port is the JS port. Along
- 11:52with this, there are many other things
- 11:54that we'll see in the future. In a
- 11:55separate video, we'll look at the
- 11:57anatomy of a TCP segment. Okay? But
- 11:59along with this, we also have a
- 12:00sequence number in it. What is a
- 12:02sequence number? These chunks that I
- 12:04created, I will send them independently
- 12:05through the network to the destination.
- 12:07Okay? Here, let's say, is my
- 12:08destination. This is my data that I've
- 12:10broken up in order. That means F12
- 12:12comes first. 0A comes second, then this
- 12:14, then this. Okay? There's a chance
- 12:16when I send this independently? There's
- 12:18a chance that this chunk of mine will
- 12:20arrive first, and then this chunk will
- 12:21arrive. So, this is how TCP ensures
- 12:23that the data I've sent reaches the
- 12:25destination in the same order it's
- 12:27broken up. So, it has something called
- 12:30a sequence number. Okay? We'll look at
- 12:33this in detail in a dedicated video.
- 12:35We'll see exactly what it is and how
- 12:36it's calculated. So, based on sequence
- 12:38numbers, TCP can actually reorder these
- 12:41chunks so that your data reaches its
- 12:43destination in the same order you send
- 12:45it. Okay? So, we'll look at this in
- 12:47detail in future videos. Okay? Once the
- 12:49TCP segment is ready, we'll encapsulate
- 12:50the TCP segment further. First, we took
- 12:55the data and broke it down and
- 12:55encapsulated it with port numbers. Now,
- 13:02we'll take that TCP segment and
- 13:02encapsulate it inside an IP packet.
- 13:04What is my IP packet? Where I
- 13:05encapsulate the TCP segment into a
- 13:07source IP and a destination IP. This is
- 13:10the important part. Now, it also looks
- 13:12at my OS's TCP/IP stack. What will it
- 13:14do? What is my source IP? 12701. Again,
- 13:16a big disclaimer. This is the loop back
- 13:19IP. This is not a public IP, but for
- 13:21simplicity, I've used this IP in this
- 13:22video. Let's consider it as the public
- 13:25IP where my React JS is running.
- 13:27Similarly, this is my AWS destination
- 13:29IP, 10001. No need to worry about this
- 13:32loop backg, it is. Ignore it. Just
- 13:34consider it as the public IP. So, my
- 13:36source IP is 1701. My destination IP is
- 13:3910001. Using that, I encapsulated this
- 13:41TCP segment. That's it. That's your IP
- 13:44packet. Obviously, IP packets contain
- 13:45other things in headers. We'll cover
- 13:47that in detail in a future dedicated
- 13:49video when we look at the anatomy of an
- 13:50IP packet. Okay? But for now,
- 13:52understand that the DCB segment
- 13:53encapsulates an IP packet with its
- 13:55source IP and destination IP. Why do we
- 13:56need a source IP and a destination IP?
- 13:58Obviously, what is a source IP? The IP
- 13:59of the machine from which I'm sending
- 14:01the request—in this case, that's just
- 14:02React's front end. What is a
- 14:03destination IP? The IP of the machine
- 14:05to which I want to send the data. Now,
- 14:08this destination IP helps routers
- 14:10decide how to reach this machine. Okay?
- 14:14So, as soon as React JS sends this IP
- 14:16packet, it goes to my first router. The
- 14:18router sees the destination IP. We'll
- 14:20see how this happens in detail. But I'm
- 14:22giving you a high-level explanation
- 14:23here. It sees the destination IP, then
- 14:25it will decide if it knows where this
- 14:27IP is. Okay? There's a chance it might
- 14:29know where this IP is. But since it's
- 14:31my AWS EC2 instance, technically my
- 14:33home router doesn't know it. Based on
- 14:35this, it will decide which router to
- 14:37send it to next, which may also know
- 14:39the destination IP. Okay? It's not even
- 14:41sure it knows the router. But it makes
- 14:44a decision and decides, "I should send
- 14:46this packet to this router, which also
- 14:47knows where this IP address is." So,
- 14:49through these hops, we'll reach AWS EC2
- 14:52. Right? So, in this journey we're
- 14:54making, hop after hop, the destination
- 14:56IP address is used at each hop to
- 14:58determine whether this IP address is
- 15:00known to us by the routers. Right? So,
- 15:03that's the meaning of the destination
- 15:04IP. What's the meaning of the source IP
- 15:06address? The first thing is, where did
- 15:07this data come from? As soon as this
- 15:09data reaches the back end, it will know
- 15:10, "Yes, this data came from here.
- 15:12That's this. Again, 12701 is my public
- 15:14IP." Right? It came from here. So, as
- 15:16soon as my back end receives this
- 15:18request, it will have a response ready.
- 15:20That's the profile it fetched from the
- 15:22DB. It created a JSON. First name,
- 15:24username, email, phone number,
- 15:25everything related to the profile. Now
- 15:27it needs to return a response to this
- 15:29request. Where should it return it?
- 15:30Then it will see the source IP address
- 15:32that came in the request. Right? So
- 15:34this is how the source IP address and
- 15:35destination IP address are used. Now,
- 15:37once this IP packet is ready, further
- 15:39encapsulation occurs. Which is kind of
- 15:41a final step where we encapsulate this
- 15:44IP packet with the source and
- 15:45destination MAC addresses. What is a
- 15:48MAC address? A media access control
- 15:50address, like my destination IP address
- 15:54, tells me how to reach this EC2
- 15:56instance as we travel across the
- 15:59internet. But once we reach the network
- 16:01of that EC2 instance, that means that
- 16:03EC2 instance will be connected to a
- 16:05router, right? So, as I travel through
- 16:07the internet, I'll first reach that
- 16:10router. Once I reach that router, once
- 16:13I reach that local network, the MAC
- 16:15address is required for that router to
- 16:18send data to that AC2 instance. So, the
- 16:20MAC is a type of physical address for
- 16:22that device. The IP is a type of
- 16:24virtual address for that device. The IP
- 16:26indicates the location of that device
- 16:28on the Internet. And once we reach the
- 16:30local network of that device, we need
- 16:33the MAC address. We'll learn about this
- 16:35in detail when we learn about MAC
- 16:37addresses and when we look at routing.
- 16:39In routing, you'll learn what MAC
- 16:41addresses and IP addresses mean. Okay?
- 16:43That's enough for now. IP is a type of
- 16:45virtual addressing. MAC is a type of
- 16:47physical address for that device. The
- 16:49actual physical address of that device.
- 16:51Now, what will my source IP be? It will
- 16:53be the MAC address of my local laptop's
- 16:54network interface card. What is the
- 16:56network interface card? It's a device.
- 16:58It's a physical device with a kind of
- 17:00antenna on it that can transmit or
- 17:03receive data in the form of signals.
- 17:05That's your network interface card.
- 17:07We'll look at this in detail when we
- 17:09learn about the structure of a MAC
- 17:10address. But we have a nic network
- 17:12interface card, which has a MAC address
- 17:14. That's mine as a source address
- 17:16attached in this frame. The destination
- 17:18MAC should technically be the MAC
- 17:20address of my NJS backend. But I don't
- 17:23know the MAC address of my NJS backend.
- 17:25Because this isn't in my local network.
- 17:28What is my local network? It's my
- 17:29machine. My router is connected. My
- 17:31mobile is connected, and my printer is
- 17:33connected. All these devices are part
- 17:35of a local area network. That means my
- 17:37laptop is aware of the router, mobile,
- 17:40and the printer. Beyond that, it
- 17:42doesn't have direct access to all the
- 17:44devices on the internet worldwide. It
- 17:46can only access them through the router
- 17:48. Okay? So, technically, my note is
- 17:50just running on an EC2 instance, which
- 17:52is also a physical machine. It will
- 17:54also have a network interface card
- 17:55through which it receives and transmits
- 17:57signals. Its MAC address will not be
- 17:59known to my React JS front end. So, on
- 18:01a higher level, what happens? Whenever
- 18:03I don't know the destination MAC
- 18:05directly, I will add a fallback MAC
- 18:07address which is of my default gateway.
- 18:10We will understand what a default
- 18:12gateway is. Now you will say that I
- 18:13added this fallback MAC address to my
- 18:15default gateway. What is my default
- 18:16gateway? My router. Now you will say,
- 18:18how do I know this MAC address? Because
- 18:20the router is a different machine. So,
- 18:22there is something called @AR. That is
- 18:24Address Resolution Protocol. What is
- 18:26this? It is a kind of DNS in which it
- 18:28takes in an IP address. It goes into
- 18:31the ARC and it will spit out the MAC
- 18:33address of the device that is holding
- 18:36that IP. That means my laptop, where I
- 18:38have my React JS front end running,
- 18:41will send a kind of request, an RRP
- 18:44request, to every device on that
- 18:46network. That means my laptop will send
- 18:49an RRP request to my mobile, to my
- 18:51printer, to my router, asking, "Who has
- 18:53this IP?" Let's say my router, this is
- 18:56my router, its IP is 192.168.1. So my
- 19:01laptop will ask, "Who has IP 192.168.1?
- 19:03" This request, an RRP request, will
- 19:08literally go to my mobile, my router,
- 19:11and my printer, but only the person
- 19:13with this IP will reply to it. So my
- 19:16mobile and my printer will ignore it,
- 19:19my router will catch it, and the router
- 19:21will then reply to me, "The MAC of the
- 19:24device holding 192.168.1 is this." Okay
- 19:27? We'll obviously cover this structure
- 19:28in a future dedicated video. This is
- 19:30how it's used. Okay? So, the source MAC
- 19:32is my machine's. The destination MAC is
- 19:35, as I told you, because I don't know
- 19:36the MAC address of my EC2 instance.
- 19:37I'll fall back to the MAC address of my
- 19:39default gateway. In my case, my default
- 19:41gateway is my router. I'm also going to
- 19:43create a dedicated video on the default
- 19:45gateway. It's the device through which
- 19:47I access the internet. In my case, it's
- 19:48my router. So, here's where my router's
- 19:50MAC address will be. How? I'll create
- 19:52an RAPP Request Address Resolution
- 19:53Protocol. I'll also create a dedicated
- 19:55video on this, explaining how the app
- 19:57works in detail. So, this is how my
- 19:59frame is ready. Once this frame is
- 20:02ready, we'll transmit it as bits over
- 20:05the wire or over the air. Right now, my
- 20:08network interface card (NIC) has an
- 20:10antenna. Okay, what will it do? It will
- 20:12transmit this frame using radio signals
- 20:14(if I'm using Wi-Fi), electrical
- 20:16signals (if I'm using Ethernet), and
- 20:18light signals (if I'm using fiber
- 20:19optics). As soon as it's transmitted,
- 20:22it's happening in this part of my
- 20:24request. That means my request, my data
- 20:27, this entire data that I've broken
- 20:29down and sent hasn't even reached my
- 20:32back end. This instance is still in
- 20:34this part of my flow. What you see is
- 20:37where the request is actually being
- 20:39transmitted from the front end. That's
- 20:41where we're transmitting that request
- 20:43to the back end. It hasn't reached
- 20:44there yet. So, you can see the entire
- 20:46flow where we just write this code and
- 20:48receive the response. There are so many
- 20:51things in that 1/4 part, and I've taken
- 20:53this at a high level because I want to
- 20:55introduce these concepts to you so that
- 20:57we can carry forward those concepts and
- 21:00understand them in dedicated videos. So
- 21:03that was the high-level overview of
- 21:05what happens whenever you send a single
- 21:08HTTP request. We saw about DNS. We
- 21:11introduced DNS. We introduced IP
- 21:13addresses, ports, destination IP, and
- 21:15destination port. Okay? We introduced
- 21:17STTP, then we introduced what a TCP
- 21:19connection is, then we introduced the
- 21:21TCP three-way handshake, then we
- 21:22introduced chunking within TCP, then we
- 21:24looked at a higher level what a
- 21:26sequence number is, then we introduced
- 21:28how a TCP segment is formed, then we
- 21:30introduced how an IP packet is formed,
- 21:32then how a frame is formed and how it's
- 21:34transmitted over the network in the
- 21:35form of bits, then we saw what MAC
- 21:37addresses are, then we saw a small
- 21:39introduction to exactly what R is. So,
- 21:41my agenda of including all these things
- 21:44in this video is to tell you about them
- 21:47. Okay? Everything here was a
- 21:49high-level overview of each concept.
- 21:52We'll explore each concept in detail in
- 21:54the future. That's why I introduced you
- 21:56to these concepts in this video. So
- 21:58please rewatch this video. Just
- 22:00understand the flow. Don't worry if you
- 22:03don't understand, we are definitely
- 22:05going to demystify every concept in
- 22:07depth in this entire playlist. So
- 22:09that's it for this video. I hope you
- 22:11gain some knowledge. If you did, please
- 22:12like the video. If you have any doubts
- 22:14or suggestions, please leave them in
- 22:15the comments. I hope to see you in the
- 22:17next one.
About this transcript
This page contains the full transcript of What Really Happens When You Make an HTTP Request? Chai aur Computer network by Chai aur Code, generated from the public captions YouTube serves with the video. The transcript has 4,401 words across 634 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.