<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mufida Zuhra</title>
    <description>The latest articles on DEV Community by Mufida Zuhra (@mufida_zuhra).</description>
    <link>https://dev.to/mufida_zuhra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F690578%2F4ca1eb38-4a8a-44ba-92a7-ca7fbc845106.jpg</url>
      <title>DEV Community: Mufida Zuhra</title>
      <link>https://dev.to/mufida_zuhra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mufida_zuhra"/>
    <language>en</language>
    <item>
      <title>HTTP Explained Like You are 5</title>
      <dc:creator>Mufida Zuhra</dc:creator>
      <pubDate>Fri, 27 Aug 2021 00:41:34 +0000</pubDate>
      <link>https://dev.to/mufida_zuhra/http-explained-like-you-are-5-23c2</link>
      <guid>https://dev.to/mufida_zuhra/http-explained-like-you-are-5-23c2</guid>
      <description>&lt;p&gt;Most of us probably know that HTTP stands for&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;H&lt;/strong&gt;ypertext &lt;strong&gt;T&lt;/strong&gt;ransfer &lt;strong&gt;P&lt;/strong&gt;rotocol&lt;/p&gt;

&lt;p&gt;But what is it exactly?&lt;/p&gt;

&lt;p&gt;Let's break down http word by word. It is a hypertext, transfer, protocol.&lt;/p&gt;

&lt;p&gt;It is a protocol to transfer a hypertext.&lt;/p&gt;

&lt;p&gt;Ok but what is a hypertext?&lt;/p&gt;

&lt;p&gt;The main difference between a hypertext and a normal text lies in the word &lt;strong&gt;'hyper'&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which means &lt;strong&gt;'linked'&lt;/strong&gt; texts.&lt;/p&gt;

&lt;p&gt;A hypertext links texts to another texts. It creates a series of interconnected texts.&lt;/p&gt;

&lt;p&gt;So if you find a clickable link in a text, and that link lead you to another text, that is essentially what a hypertext is. Which is pretty much what web pages are all about!.&lt;/p&gt;

&lt;p&gt;When you click a link in a webpage, it will lead you to another page, right?&lt;/p&gt;

&lt;p&gt;So hypertext is just a normal web pages!. That is all there is to it!.&lt;/p&gt;

&lt;p&gt;And HTTP is the protocol that &lt;strong&gt;rules&lt;/strong&gt; how hypertexts a.k.a web pages are&lt;br&gt;
transferred from the server to the client.&lt;/p&gt;

&lt;p&gt;If you're not sure what client-server is all about, here's a refresher:&lt;/p&gt;

&lt;p&gt;When you visit a website, the &lt;strong&gt;client&lt;/strong&gt; is the device you use to visit that website. So this could be your phone, your laptop, or your computer.&lt;/p&gt;

&lt;p&gt;While the &lt;strong&gt;server&lt;/strong&gt; is the machine that's hosting that website. Normally located miles away on the other side of the world.&lt;/p&gt;

&lt;p&gt;When you open google chrome to visit youtube, chrome here is the &lt;strong&gt;client&lt;/strong&gt; and youtube is the &lt;strong&gt;server&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You need to know that pretty much every interaction on the web happen between a &lt;strong&gt;client&lt;/strong&gt; and a &lt;strong&gt;server&lt;/strong&gt;. And client-server interaction is all about&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;request&lt;/strong&gt; and &lt;strong&gt;response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If chrome wants a youtube homepage, chrome will send a &lt;strong&gt;request&lt;/strong&gt; to the youtube server and youtube will send a &lt;strong&gt;response&lt;/strong&gt; by giving chrome the youtube homepage. This is what request and response is all about. A request comes from the client, and the server replies with a response.&lt;/p&gt;

&lt;p&gt;And HTTP rules this request and response process.&lt;/p&gt;

&lt;p&gt;If we humans interact in real life, we also have 'rules' to communicate to one another, right?. Where we perhaps begin with saying hi first, then show good body gestures, choose polite words, and maintain eye contact.&lt;/p&gt;

&lt;p&gt;It's the same thing with the client and server interaction on the internet.&lt;/p&gt;

&lt;p&gt;HTTP is the rule that governs this interaction.&lt;/p&gt;

&lt;p&gt;For a better understanding, think of http as the '&lt;strong&gt;language&lt;/strong&gt;' spoken by the client and the server. It is the 'language' they speak to send request and receive response.&lt;/p&gt;

&lt;p&gt;This is the essence of HTTP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client&lt;/strong&gt; and &lt;strong&gt;server&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request&lt;/strong&gt; and &lt;strong&gt;response&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That being said, everything about HTTP revolves around details and information about the &lt;strong&gt;request and response&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Information about the request and response process is found in what's called the&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP message&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think about this like the 'grammar structure' of HTTP.&lt;/p&gt;

&lt;p&gt;If you intercept a client and server 'conversation', you'll find that the 'grammar' they speak or the HTTP message is consist of two main parts:&lt;/p&gt;

&lt;p&gt;the HTTP header&lt;br&gt;
the HTTP body&lt;/p&gt;

&lt;p&gt;The HTTP body contain the actual data that is being interchanged between a client and a server.&lt;/p&gt;

&lt;p&gt;But you need to know that information and details about the request and response are found inside the &lt;strong&gt;HTTP headers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And the HTTP header for &lt;em&gt;request&lt;/em&gt; is &lt;strong&gt;different&lt;/strong&gt; to the http header for &lt;em&gt;response&lt;/em&gt;. The structure looks similar but the information they carry is different.&lt;/p&gt;

&lt;p&gt;Request is about the client asking something from the server, right? so the request http header contain information about what kind of request that the client want from the server.&lt;/p&gt;

&lt;p&gt;Think about it, what kind of action can you do on a website?. You can view pages, you can upload photos, texts, videos, you can delete files, you can click a button, etc.&lt;/p&gt;

&lt;p&gt;Your action is defined by what's called the&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And it is typically a get or a post method. If you're not sure what they mean, when you're visiting a website, your action is either passive or active, right?.&lt;/p&gt;

&lt;p&gt;Passive is when you're viewing things. Like viewing a page, or watching a youtube video, where the server is giving you something. where you &lt;strong&gt;retrieve or get&lt;/strong&gt; something from the server.&lt;br&gt;
This is what a &lt;em&gt;get&lt;/em&gt; method is.&lt;/p&gt;

&lt;p&gt;Active is when you upload a comment, or upload an insta story, or tap a like button. where you &lt;strong&gt;post or submit&lt;/strong&gt; something to the server.&lt;br&gt;
This is what a &lt;em&gt;post&lt;/em&gt; method is.&lt;/p&gt;

&lt;p&gt;Of course there are other methods beside get and post. we also have put, patch, delete, etc. But get and post are the most common request methods.&lt;/p&gt;

&lt;p&gt;So HTTP request header must contain the http methods to define the client action. This is to tell the server what to do with the client request.&lt;/p&gt;

&lt;p&gt;On the other hand, the http response header must contain what's known as&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the http status codes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What is a status code?&lt;/p&gt;

&lt;p&gt;When you type '&lt;a href="http://www.linkedin.com" rel="noopener noreferrer"&gt;www.linkedin.com&lt;/a&gt;', your browser is sending a get request to the linkedin server, asking linkedin to give you the homepage. When linkedin responds by giving you the homepage, it contains a&lt;/p&gt;

&lt;p&gt;HTTP status code of &lt;em&gt;200&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Which means &lt;em&gt;successful&lt;/em&gt; response.&lt;/p&gt;

&lt;p&gt;But when you are requesting for a page that does not exist, like when you mistyped a link, linkedin will check its server, see that the server has no file for this link, so instead, linkedin will send an error message.&lt;/p&gt;

&lt;p&gt;like a &lt;em&gt;404&lt;/em&gt; page.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;404&lt;/em&gt; means the server you send a request to does not have the page or the file that you requested for.&lt;/p&gt;

&lt;p&gt;This 404 error message and the 200 success message are&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP status codes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The status code helps the client know what kind of 'reaction' the server is giving upon its request. And of course it's not limited to 200 and 404.&lt;/p&gt;

&lt;p&gt;There are other numbers like 403, 504, 100, etc, each represents different 'reaction'.&lt;/p&gt;

&lt;p&gt;So to recap, HTTP is the protocol that govern the request and response process between a client and a server. When a client is communicating with a server, their request and response details are defined inside&lt;br&gt;
the http headers. The http header for client is different to the http header for server.&lt;/p&gt;

&lt;p&gt;Client is about asking request and server is about giving response. To understand the client request, the server needs to know the client action, which is defined by the &lt;strong&gt;HTTP methods&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To know whether the server has completed the request, the client needs to know the server response. which is defined by the &lt;strong&gt;http status codes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;they are defined in the &lt;strong&gt;startline&lt;/strong&gt; of an HTTP header message.&lt;/p&gt;

&lt;p&gt;HTTP request header contains the HTTP methods&lt;/p&gt;

&lt;p&gt;the HTTP response header contains the HTTP status codes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FMessages%2Fhttpmsgstructure2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FMessages%2Fhttpmsgstructure2.png" alt="HTTP message"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>http</category>
      <category>ip</category>
      <category>internet</category>
      <category>networking</category>
    </item>
    <item>
      <title>Understanding How DHCP Works</title>
      <dc:creator>Mufida Zuhra</dc:creator>
      <pubDate>Sat, 21 Aug 2021 03:25:37 +0000</pubDate>
      <link>https://dev.to/mufida_zuhra/understanding-how-dhcp-works-5ep2</link>
      <guid>https://dev.to/mufida_zuhra/understanding-how-dhcp-works-5ep2</guid>
      <description>&lt;p&gt;There are two ways a computer can be assigned an IP address:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using &lt;strong&gt;static&lt;/strong&gt; IP addresses&lt;/li&gt;
&lt;li&gt;Using &lt;strong&gt;dynamic&lt;/strong&gt; IP addresses&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dynamic IP, as the name suggests, is the IP address that &lt;strong&gt;can change&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you go to a cafe, you are using their wifi, right?. You are using an IP address assigned by the cafe's &lt;strong&gt;ISP&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you leave and went home, you are no longer assigned to that IP address but now assigned to your house's.&lt;/p&gt;

&lt;p&gt;That IP address you previously used in the cafe can now be used for other devices in that cafe.&lt;/p&gt;

&lt;p&gt;The protocol that assigns dynamic IP to devices is called &lt;strong&gt;DHCP&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;DHCP stands for &lt;strong&gt;D&lt;/strong&gt;ynamic &lt;strong&gt;H&lt;/strong&gt;osting &lt;strong&gt;C&lt;/strong&gt;onfiguration &lt;strong&gt;P&lt;/strong&gt;rotocol.&lt;/p&gt;

&lt;p&gt;It is a protocol that governs how devices set an IP address to connect to the internet.&lt;/p&gt;

&lt;p&gt;For a static IP address, you'll have to manually set the IP address yourself.&lt;/p&gt;

&lt;p&gt;This normally involves an IT man coming to your house, where they also have to configure the subnet mask, the default gateway, and the DNS server.&lt;/p&gt;

&lt;p&gt;If you have more than one computer, you'll have to set the configuration for other computers/devices manually as well.&lt;/p&gt;

&lt;p&gt;On the other hand, every device that follows DHCP will immediately connect to the internet and request for their own IP addresses.&lt;/p&gt;

&lt;p&gt;This whole process happens &lt;strong&gt;automatically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;DHCP will set your IP address, the subnet mask, the default gateway, and the DNS server, all automatically. And these are important information in order to connect to the internet.&lt;/p&gt;

&lt;p&gt;You can check the settings in your computer ipconfig or phone to see whether your IP is set to &lt;strong&gt;automatic&lt;/strong&gt; or not.&lt;/p&gt;

&lt;p&gt;If it is, then your device is employing a dynamic hosting protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  But how does it work?
&lt;/h2&gt;

&lt;p&gt;When you first turn on your device, your device will &lt;strong&gt;broadcast&lt;/strong&gt; a request to the DHCP servers, asking to be assigned an IP address. this broadcast message is called&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DHCPDISCOVER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wherever your device is located, it will broadcast this message, looking for a DHCP server.&lt;/p&gt;

&lt;p&gt;The broadcast is sent via &lt;strong&gt;UDP&lt;/strong&gt; connection, not TCP/IP.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Notice the word &lt;strong&gt;'broadcast'&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This device has no idea where the DHCP server is.&lt;/p&gt;

&lt;p&gt;In a TCP/IP protocol, your device needs to connect to its destination first before communicating over the internet.&lt;/p&gt;

&lt;p&gt;In this case, your device has no idea who the destination is. It just broadcast the message, hoping there's a server somewhere to pick it up.&lt;/p&gt;

&lt;p&gt;Say there's indeed a DHCP server close by.&lt;/p&gt;

&lt;p&gt;This server hears the &lt;code&gt;dhcpdiscover&lt;/code&gt; message, establishes a connection, and sends a response with a corresponding IP address, a subnet mask, DNS server, and the default gateway.&lt;/p&gt;

&lt;p&gt;It figures out which IP address to give to you based on the available ranges they have.&lt;/p&gt;

&lt;p&gt;One more information they send back to you is something called the&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;lease&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What is this?&lt;/p&gt;

&lt;p&gt;Since the IP is dynamic, that means there is a certain &lt;em&gt;duration&lt;/em&gt; for how long you can use that particular IP address, right?.&lt;/p&gt;

&lt;p&gt;This is why dynamic IP addresses are&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;leased&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They are &lt;strong&gt;leased&lt;/strong&gt; to your device so that they can be reusable.&lt;/p&gt;

&lt;p&gt;If you type this in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ipconfig /all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see the obtained date and the expiration date of the lease.&lt;/p&gt;

&lt;p&gt;Just to show you how dynamic it is, If you want to terminate your IP release right now, you can type this in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ipconfig /release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But note that you'll lose internet connection :p&lt;/p&gt;

&lt;p&gt;To renew your lease again, you can type this in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ipconfig /renew
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and your internet connection will be back.&lt;/p&gt;

&lt;p&gt;And this pretty much sums up the basics of DHCP!.&lt;/p&gt;

</description>
      <category>dhcp</category>
      <category>ip</category>
      <category>internet</category>
      <category>dns</category>
    </item>
  </channel>
</rss>
