<?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: Cem Batuhan Yaman</title>
    <description>The latest articles on DEV Community by Cem Batuhan Yaman (@cbyeuler).</description>
    <link>https://dev.to/cbyeuler</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4195295%2F55f06653-58be-4e00-a0d1-4e4b2dfabae4.jpg</url>
      <title>DEV Community: Cem Batuhan Yaman</title>
      <link>https://dev.to/cbyeuler</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cbyeuler"/>
    <language>en</language>
    <item>
      <title>Building a Backend Brain #2: From DNS Lookups to TCP Handshakes</title>
      <dc:creator>Cem Batuhan Yaman</dc:creator>
      <pubDate>Wed, 28 Oct 2026 13:51:52 +0000</pubDate>
      <link>https://dev.to/cbyeuler/building-a-backend-brain-2-from-dns-lookups-to-tcp-handshakes-2n5n</link>
      <guid>https://dev.to/cbyeuler/building-a-backend-brain-2-from-dns-lookups-to-tcp-handshakes-2n5n</guid>
      <description>&lt;p&gt;Hey, beautiful internet people!&lt;/p&gt;

&lt;p&gt;In the last chapter, we talked about how the internet works and what happens under the hood when a client talks to a server. In this chapter, we are going to zoom in on a very specific part of that journey.&lt;/p&gt;

&lt;p&gt;The core question for today is:&lt;br&gt;
&lt;strong&gt;What actually happens between typing a URL into your browser and establishing a connection with a server?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the first part of this series, we mapped out the cast of the characters: clients that ask for things, servers that host the data, IP addresses that act like street addresses, and ports that point to specific apartments in the buildings.&lt;/p&gt;

&lt;p&gt;When you build for the web, it’s easy to take infrastructure for granted. You write &lt;code&gt;fetch('[https://api.mywebsite.com/data](https://api.mywebsite.com/data)')&lt;/code&gt;, hit save, and data magically appears on your screen.&lt;/p&gt;

&lt;p&gt;As we established in Episode #1, that magic is actually a client talking to a server via an IP address and a port.&lt;/p&gt;

&lt;p&gt;Let's take a closer look at what happens the exact millisecond you type "youtube.com" into your address bar and hit Enter.&lt;/p&gt;

&lt;p&gt;Your browser knows where you want to go, but it needs an IP address to reach the destination. If that address isn't already cached, your system needs to look it up.&lt;/p&gt;

&lt;p&gt;It’s like knowing you want to visit &lt;em&gt;“Grandma’s House”&lt;/em&gt; without knowing which city or street she lives on.&lt;br&gt;
Before your browser can send its HTTP request over a new TCP connection, two important steps usually need to happen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It asks the internet's phonebook (&lt;em&gt;DNS&lt;/em&gt;) where the server actually lives.&lt;/li&gt;
&lt;li&gt;It knocks on the server’s door and exchanges synchronization signals (&lt;em&gt;TCP Handshake&lt;/em&gt;) to make sure the line is clear and stable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;think of these procedures as it follows:&lt;br&gt;
1- The Phonebook Lookup (DNS) Translating the friendly URL into raw IP address.&lt;br&gt;
2-The Digital Handshake (TCP) Establishing a reliable connection so the client and server can begin exchanging application data.&lt;/p&gt;

&lt;p&gt;Let’s break them down one by one.&lt;/p&gt;
&lt;h2&gt;
  
  
  1- DNSL How Does Your Computer Find Grandma's House?
&lt;/h2&gt;

&lt;p&gt;Remember our example from earlier?&lt;/p&gt;

&lt;p&gt;You want to visit Grandma's House, but you don't know her address.&lt;/p&gt;

&lt;p&gt;Fortunately, the internet has a solution for that: &lt;strong&gt;DNS, or the Domain Name System.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of DNS as the internet's phonebook. Instead of remembering something like &lt;code&gt;142.250.184.14&lt;/code&gt;, you can simply remember a domain name like &lt;code&gt;google.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Much easier, right?&lt;/p&gt;

&lt;p&gt;But computers need numerical addresses to route packets across the internet. So when you type a domain name, your system needs to find an IP address associated with it.&lt;/p&gt;

&lt;p&gt;That's DNS resolution.&lt;/p&gt;

&lt;p&gt;Let's test this on our own.&lt;br&gt;
On your pc open up your terminal if you're using Windows, PowerShell will work perfectly.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nslookup google.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;this will get you somehting resembling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    google.com
Addresses:  2607:f8b0:4005:805::200e
            142.250.190.14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Neat right? You've just performed a DNS lookup.&lt;/p&gt;

&lt;p&gt;Let's examine what we are actually looking at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server: The DNS resolver that answered our query.&lt;/li&gt;
&lt;li&gt;Address (at the top): The resolver's IP address.&lt;/li&gt;
&lt;li&gt;Name: The domain you wanted to resolve.&lt;/li&gt;
&lt;li&gt;Address (at the bottom): The IP addresses returned for that domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notice something interesting?&lt;/p&gt;

&lt;p&gt;A single domain can have multiple IP addresses!&lt;/p&gt;

&lt;p&gt;That's completely normal. Large websites frequently use distributed infrastructure, and DNS can return different addresses depending on factors such as your location and the DNS resolver you're using.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Let's Perform a DNS Lookup Using Go
&lt;/h2&gt;

&lt;p&gt;Time to get our hands dirty!&lt;/p&gt;

&lt;p&gt;Go has a fantastic standard library for network programming. We don't even need to install an external package for our first experiment.&lt;/p&gt;

&lt;p&gt;Create a file named &lt;code&gt;dns_lookup.go&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

 &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
     &lt;span class="s"&gt;"fmt"&lt;/span&gt;
     &lt;span class="s"&gt;"net"&lt;/span&gt;
 &lt;span class="p"&gt;)&lt;/span&gt;

 &lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="n"&gt;domain&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s"&gt;"google.com"&lt;/span&gt;

     &lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LookupIP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"DNS lookup failed: "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
         &lt;span class="k"&gt;return&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;

     &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Resolved addresses for: "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

     &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;ips&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ip&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run it:&lt;br&gt;
&lt;code&gt;go run dns_lookup.go&lt;/code&gt;&lt;br&gt;
You should see something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Resolved addresses for: google.com
142.250.190.14
2607:f8b0:4005:805::200e
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, your actual IP addresses might differ.&lt;/p&gt;

&lt;p&gt;Let's break down the important part:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ips, err := net.LookupIP(domain)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This line asks Go's networking library to resolve the hostname into IP addresses.&lt;/p&gt;

&lt;p&gt;The returned value &lt;code&gt;ips&lt;/code&gt; is a slice of IP addresses, because a hostname can resolve to more than one address.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;err&lt;/code&gt; tells us whether something went wrong.&lt;/p&gt;

&lt;p&gt;We then iterate over the returned addresses and print them.&lt;/p&gt;

&lt;p&gt;That's it!&lt;/p&gt;

&lt;p&gt;We've just resolved a domain name programmatically.&lt;/p&gt;

&lt;p&gt;A small technical detail: &lt;code&gt;net.LookupIP&lt;/code&gt; uses the system's configured name-resolution mechanism. Depending on the environment, this may involve DNS, local host configuration, or other resolution mechanisms.&lt;/p&gt;

&lt;p&gt;The important takeaway is that we didn't have to manually communicate with root servers, TLD servers, or authoritative servers.&lt;/p&gt;

&lt;p&gt;Go handles the hostname resolution through the available resolver.&lt;/p&gt;

&lt;p&gt;Now..&lt;/p&gt;

&lt;p&gt;We have the destination's IP address.&lt;/p&gt;

&lt;p&gt;We know where Grandma lives.&lt;/p&gt;

&lt;p&gt;How do we actually knock on her door?&lt;/p&gt;

&lt;h2&gt;
  
  
  TCP: Knocking on the door.
&lt;/h2&gt;

&lt;p&gt;we now have the destination's IP address, and know where the Grandma lives.&lt;/p&gt;

&lt;p&gt;The IP address get us to the building, the port tells us which apartment we're interested in.&lt;/p&gt;

&lt;p&gt;but knowing the address and actually ringing the bell or knocking on the door are two very different things.&lt;/p&gt;

&lt;p&gt;We still need to establish a connection.&lt;/p&gt;

&lt;p&gt;Enter TCP, Transmission Control Protocol.&lt;/p&gt;

&lt;p&gt;TCP provides a reliable, ordered stream of bytes between two endpoints.&lt;/p&gt;

&lt;p&gt;That means it is designed to handle things like lost segments, duplicated data, and data arriving out of order.&lt;/p&gt;

&lt;p&gt;It does this using mechanisms such as sequence numbers, acknowledgments, retransmissions, and flow control.&lt;/p&gt;

&lt;p&gt;But before the client and server begin exchanging normal application data, they generally establish the connection using something called the &lt;strong&gt;three-way handshake&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And no, unfortunately, it doesn't involve three computers shaking hands.&lt;/p&gt;

&lt;h2&gt;
  
  
  The TCP three way handshake
&lt;/h2&gt;

&lt;p&gt;Imagine the following conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client:&lt;/strong&gt; "Hello! I'd like to establish a connection. Here's my starting sequence number."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server:&lt;/strong&gt; "I heard you! Here's my starting sequence number, and I'm acknowledging yours."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client:&lt;/strong&gt; "Great! I've received yours too."&lt;/p&gt;

&lt;p&gt;That's essentially what happens during a TCP handshake.&lt;/p&gt;

&lt;p&gt;The actual messages are called:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SYN&lt;/strong&gt; - Synchronize&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SYN-ACK&lt;/strong&gt; - Synchronize and Acknowledge&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ACK&lt;/strong&gt; - Acknowledge&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;this is basically what's happening in the figure belove.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw1qklhmrcwzcg697718x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw1qklhmrcwzcg697718x.png" alt="Diagram showing the TCP connection" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: The client sends SYN&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The client requests a new TCP connection and proposes an initial sequence number.&lt;/p&gt;

&lt;p&gt;This is the client's way of initiating communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: The server responds with SYN-ACK&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The server acknowledges the client's sequence number, supplies its own initial sequence number, and communicates relevant TCP options.&lt;/p&gt;

&lt;p&gt;At this point, the server has responded, but the handshake isn't complete from its perspective.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: The client sends ACK&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The client acknowledges the server's sequence number.&lt;/p&gt;

&lt;p&gt;Once the server receives this acknowledgment, both sides have completed the connection establishment process.&lt;/p&gt;

&lt;p&gt;And there we have it!&lt;/p&gt;

&lt;p&gt;A TCP connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  But why three messages?
&lt;/h2&gt;

&lt;p&gt;Good question.&lt;/p&gt;

&lt;p&gt;Why not just send one request and receive one response?&lt;/p&gt;

&lt;p&gt;Because TCP needs both sides to synchronize their sequence number spaces and acknowledge each other's initial sequence numbers.&lt;/p&gt;

&lt;p&gt;The server needs confirmation that its SYN reached the client, too.&lt;/p&gt;

&lt;p&gt;A three-way exchange provides that confirmation while establishing the connection state on both ends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One thing worth remembering: TCP reliability is not the same thing as security.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TCP does not verify that a server is trustworthy, and it doesn't encrypt the bytes traveling between the endpoints.&lt;/p&gt;

&lt;p&gt;For HTTPS, TLS provides encryption and server authentication on top of the transport connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up: We've Found Grandma's House, and We've Knocked on the Door!
&lt;/h2&gt;

&lt;p&gt;Well, beautiful internet people, we've covered quite a bit today!&lt;/p&gt;

&lt;p&gt;We started with a simple question: &lt;strong&gt;What actually happens when you type a URL into your browser and hit Enter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Along the way, we learned how DNS acts as the internet's phonebook, translating human-readable domain names into IP addresses. We even wrote a little Go program to perform our own DNS lookup!&lt;/p&gt;

&lt;p&gt;Then we met TCP and explored how the famous three-way handshake works:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SYN -&amp;gt; SYN-ACK -&amp;gt; ACK&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But here's the thing.&lt;/p&gt;

&lt;p&gt;There's still plenty more to explore, and I originally intended to cover TCP programming in this chapter as well.&lt;/p&gt;

&lt;p&gt;However, I think we've already thrown quite a bit of information at you today, and the last thing I want is for this series to turn into an endless wall of technical explanations.&lt;/p&gt;

&lt;p&gt;After all, we're here to learn, not to compete in an endurance reading championship!&lt;/p&gt;

&lt;p&gt;So I've decided to split this topic into two chapters. I'd much rather we take our time, experiment with what we've learned, and actually understand what's going on than rush through everything in one sitting.&lt;/p&gt;

&lt;p&gt;And besides, we've only found Grandma's address and knocked on her door.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We haven't actually had a conversation with her yet!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's where Chapter 3 comes in.&lt;/p&gt;

&lt;p&gt;Next time, we'll roll up our sleeves, write a TCP client and server in Go, exchange some actual data, and see how these concepts translate into working code.&lt;/p&gt;

&lt;p&gt;Until then, play around with the DNS examples, break something (preferably in your own development environment!), and keep asking questions.&lt;/p&gt;

&lt;p&gt;See you in the next chapter!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>networking</category>
      <category>go</category>
    </item>
    <item>
      <title>Building a Backend Brain #1: Demystifying Clients, Servers, and Ports</title>
      <dc:creator>Cem Batuhan Yaman</dc:creator>
      <pubDate>Tue, 20 Oct 2026 05:00:14 +0000</pubDate>
      <link>https://dev.to/cbyeuler/building-a-backend-brain-1-demystifying-clients-servers-and-ports-1can</link>
      <guid>https://dev.to/cbyeuler/building-a-backend-brain-1-demystifying-clients-servers-and-ports-1can</guid>
      <description>&lt;p&gt;Hey, beautiful internet people! &lt;/p&gt;

&lt;p&gt;I thought for my very first post and article, the topic should be how the internet actually works and what happens behind the scenes!&lt;/p&gt;

&lt;p&gt;I remember my early days on the internet, trying to figure out how programming even works and spending countless hours going down rabbit holes on this exact topic. Looking back, I realized it would be amazing to write an article breaking it all down, not just to share with others, but to really cement those fundamentals for myself.&lt;/p&gt;

&lt;p&gt;This post is going to be the kickoff of a brand-new series where I'll be tackling system design, networking ideas, and sharing the core concepts that I've found most valuable on my journey.&lt;/p&gt;

&lt;p&gt;Let's dive into the first one!&lt;/p&gt;

&lt;h4&gt;
  
  
  How the Internet Works: Clients, Servers, IP Addresses, and Ports
&lt;/h4&gt;

&lt;p&gt;Before we go any deeper let's just see what's happening under the hood, every time you type a URL into your browser or fire a &lt;code&gt;curl&lt;/code&gt; command into a terminal, an intricate dance of networking protocols and application code happens in milliseconds. &lt;br&gt;
Understanding how a request travels from a client to a server, and how languages like Go handle it, is essential for any backend developer.&lt;/p&gt;

&lt;h5&gt;
  
  
  The Foundation: The Client/Server Model and Ports
&lt;/h5&gt;

&lt;p&gt;It is important to understand that most devices and machines communicating over a network act as &lt;strong&gt;hosts&lt;/strong&gt;, taking on the role of either a &lt;strong&gt;client&lt;/strong&gt; or a &lt;strong&gt;server&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The primary difference lies in their roles during communication: &lt;strong&gt;clients initiate requests, while servers receive and respond to those requests.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbxx17eo1qs1vumpmeyje.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbxx17eo1qs1vumpmeyje.png" alt="A diagram that shows the connection between servers and clients" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep in mind that these roles are relative to a particular interaction. A server, for example, can act as a client when requesting resources or services from another server.&lt;/p&gt;

&lt;p&gt;While clients initiate requests, servers run software designed to receive, process, and respond to those requests.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A host is not necessarily a client or server at all times. A host is a network-connected device or system that can communicate over a network. Client and server describe roles that software takes in a particular interaction.&lt;/li&gt;
&lt;li&gt;A server is not necessarily a dedicated computer. Server software can run on an ordinary laptop, a virtual machine, or a cloud instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  IP Addresses: Where Does the Data Go?
&lt;/h5&gt;

&lt;p&gt;Now that we understand who's talking to whom, there's another question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does the network know where to send the information&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;IP (Internet Protocol) address&lt;/strong&gt; is a numerical address assigned to a network interface, allowing devices to communicate over IP networks, including the internet.&lt;/p&gt;

&lt;p&gt;When a client sends a request to a server, the data is packaged into IP packets containing two important pieces of information: a &lt;strong&gt;source IP address&lt;/strong&gt; and a &lt;strong&gt;destination IP address&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of these as the sender's and recipient's addresses on a letter. The destination address helps the network determine where the packet should go, while the source address identifies where it came from.&lt;/p&gt;

&lt;p&gt;Now, I don't want to bore you to death with technical details, but there is something worth understanding about how these addresses are structured.&lt;/p&gt;

&lt;p&gt;There are two versions of IP addresses in widespread use today: IPv4 and IPv6. For now, we'll focus on IPv4.&lt;/p&gt;

&lt;p&gt;An IPv4 address consists of 32 bits, divided into four groups of 8 bits called octets. Each octet is represented as a decimal number ranging from 0 to 255.&lt;/p&gt;

&lt;p&gt;I know, I know, this sounds like a lot, but I promise it's not that complicated!&lt;/p&gt;

&lt;p&gt;Imagine it like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 octet = 8 bits&lt;/li&gt;
&lt;li&gt;4 octets = 32 bits&lt;/li&gt;
&lt;li&gt;each octet = a decimal value between 0 and 255 &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, 192.168.1.10 is a valid IPv4 address.&lt;/p&gt;

&lt;p&gt;We'll leave IPv6 and the more complicated details of IP addressing for another time.&lt;/p&gt;

&lt;h4&gt;
  
  
  Ports: Finding the Right Application
&lt;/h4&gt;

&lt;p&gt;Alright, so we know how a packet can find its destination.&lt;/p&gt;

&lt;p&gt;But here's another question: &lt;strong&gt;What if that machine is running multiple network applications? How does incoming traffic reach the right one?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;ports&lt;/strong&gt; come in.&lt;/p&gt;

&lt;p&gt;Think of an IP address as the address of an apartment building and a port number as an apartment number.&lt;/p&gt;

&lt;p&gt;The IP address helps traffic reach the correct destination, while the port number helps the operating system deliver it to the appropriate application endpoint.&lt;/p&gt;

&lt;p&gt;Ports are represented by numbers ranging from &lt;code&gt;0&lt;/code&gt; to &lt;code&gt;65535&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Some common examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;80&lt;/code&gt; &amp;lt;--&amp;gt; HTTP&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;443&lt;/code&gt; &amp;lt;--&amp;gt; HTTPS&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;8080&lt;/code&gt; &amp;lt;--&amp;gt; Commonly used by development servers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;3030&lt;/code&gt; &amp;lt;--&amp;gt; Another popular port for local development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These port numbers are used by transport protocols such as TCP and UDP, which we'll explore in the next article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;And that's it for our first introduction!&lt;/p&gt;

&lt;p&gt;Today, we've established three fundamental ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clients and servers&lt;/strong&gt; describe the roles software performs during communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP addresses&lt;/strong&gt; help networks deliver packets to their destinations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ports&lt;/strong&gt; help identify the appropriate application endpoint on a host.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Of course, there's much more happening behind the scenes.&lt;/p&gt;

&lt;p&gt;We've only scratched the surface!&lt;/p&gt;

&lt;p&gt;In the next article, we'll explore &lt;strong&gt;TCP, how connections are established, and how HTTP requests travel between clients and servers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;See you in the next one!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>networking</category>
      <category>backend</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
