<?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: stungnet</title>
    <description>The latest articles on DEV Community by stungnet (@stungnet).</description>
    <link>https://dev.to/stungnet</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%2F1055170%2F461dcc16-472e-4086-b9eb-4e0359a2b50e.png</url>
      <title>DEV Community: stungnet</title>
      <link>https://dev.to/stungnet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stungnet"/>
    <language>en</language>
    <item>
      <title>Why Every Developer Should Consider the Linux &amp; Neovim Leap</title>
      <dc:creator>stungnet</dc:creator>
      <pubDate>Sun, 17 Sep 2023 04:42:04 +0000</pubDate>
      <link>https://dev.to/stungnet/why-every-coder-should-consider-the-linux-neovim-leap-no3</link>
      <guid>https://dev.to/stungnet/why-every-coder-should-consider-the-linux-neovim-leap-no3</guid>
      <description>&lt;h1&gt;
  
  
  Table of Contents:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Needing Change&lt;/li&gt;
&lt;li&gt;Turning Point&lt;/li&gt;
&lt;li&gt;
Into the Terminal

&lt;ul&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;Neovim&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Looking Back, Looking Forward

&lt;ul&gt;
&lt;li&gt;List of Benefits&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;A Guide to Getting Started&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a id="introduction"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When I first began coding, few things were as intimidating as confronting a barrage of error messages in the terminal. Attempting to decipher these messages and pinpoint my missteps felt overwhelming. This initial experience instilled in me a genuine apprehension towards the terminal. It appeared far more intricate compared to my then-favored IDE, VSCode. Within VSCode, running code was as simple as a click of a button. For Git operations, a user-friendly GUI on the side shielded me from the underlying complexities. Moving, creating, copying, renaming files done with the click of my mouse. While these abstractions seemed helpful on the surface, they inadvertently fostered a superficial understanding. I felt confident, believing I had grasped the nuances of what I was doing. In reality, my comprehension of the terminal and its intricacies remained elementary.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkebxrpmdd62u4dh1dbsx.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkebxrpmdd62u4dh1dbsx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a id="change"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Needing Change
&lt;/h2&gt;

&lt;p&gt;VSCode's comforts, once my sanctuary, started feeling more like a limitation. Whenever I faced challenges needing deeper system interactions or more nuanced controls, I'd dodge or find workarounds. Habitually, I'd resort to Stack Overflow, blindly copying solutions. This makeshift approach held until a project showcased my shortcomings. Up against a merge conflict, while my IDE hesitated, my colleague tackled it effortlessly using the terminal. This vivid contrast was a wake-up call that to grow, I needed to learn the terminal.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftebmqc3j89ucovkez6d7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftebmqc3j89ucovkez6d7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a id="turning"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning Point
&lt;/h2&gt;

&lt;p&gt;With this realization, I embarked on a quest to understand the terminal. My research led me to two pivotal decisions: transitioning to Linux and adopting Neovim. The appeal of Linux lay in its terminal-centric design; it compelled daily terminal interactions, something I've come to appreciate deeply. Neovim's allure came from an eye-opening video by ThePrimeagen titled "&lt;a href="https://www.youtube.com/watch?v=bdumjiHabhQ" rel="noopener noreferrer"&gt;My Developer Workflow - How I use i3, tmux, and vim.&lt;/a&gt;" His seamless window navigation with i3 and rapid file transitions were nothing short of mesmerizing.  &lt;/p&gt;

&lt;p&gt;If he so happens to read this, thanks for your constant content, vim btw.&lt;/p&gt;




&lt;p&gt;&lt;a id="into"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Into the Terminal
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxb7zfdcghy4trvui2mk.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxb7zfdcghy4trvui2mk.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a id="linux"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linux&lt;/strong&gt;: Transitioning from Windows to Ubuntu felt like navigating a maze. The initial days were filled with challenges: from decoding unfamiliar directories to wrestling with package installations. But, configuring i3 opened up a new realm of efficient window management, while tmux elevated my terminal game. By embracing these tools, what began as a daunting journey transformed into a masterclass in seamless navigation and multitasking. Ubuntu became less of an OS to adapt to and more of a playground.
&lt;a id="neovim"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neovim:&lt;/strong&gt; Starting with Neovim was an adventure on its own. I chose the path less taken by avoiding pre-built configurations. Sure, it made my journey steeper than most, but the satisfaction? Unparalleled. I remember the euphoria of setting up my first plugin manager, tweaking the theme, and personalizing options. Every step felt like a revelation. While VSCode offered convenience, Neovim gave me control. But beyond its capabilities, what bolstered my Neovim experience was its incredible community. The /r/neovim subreddit became an invaluable resource for me, teeming with enthusiasts who were ever-ready to help, share, and guide. Each plugin I added, each configuration I tweaked, required research and decision-making. And clicking 'install' on VSCode just couldn't replicate that deep sense of engagement. After about a week of immersing myself, not only did I craft a working config I was proud of, but I also picked up a bit of Vimscript and Lua, thanks in part to the collective knowledge of the Neovim community.
&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufn1bbcx9nywvuvqpu96.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufn1bbcx9nywvuvqpu96.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a id="looking"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Back, Looking Forward
&lt;/h2&gt;

&lt;p&gt;In another &lt;a href="https://dev.to/stungnet/the-silent-power-of-data-structures-and-algorithms-a-developers-guide-3g83"&gt;blog post&lt;/a&gt; last week, I talked about how diving deep into Data Structures and Algorithms profoundly enhanced my coding skills. Similarly, my expedition within the terminal has reshaped my perspective. The more time I invested in this environment, the more intuitive it became. I've grown adept with key bindings and configuring to my liking. Currently, my arsenal comprises i3, Neovim, and Ubuntu. Coding on any other OS now feels like a step back; I miss that seamless dance between windows and tasks. &lt;br&gt;
&lt;a id="benefits"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;A list of benefits I've seen:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mouse-Free Productivity: I find myself rarely using the mouse now. Engaging deeply with my code without switching between keyboard and mouse feels more fluid and immersive.&lt;/li&gt;
&lt;li&gt;Decoding Errors with Ease: Lengthy error messages that once overwhelmed me now seem more navigable. My relationship with them has evolved into one of understanding.&lt;/li&gt;
&lt;li&gt;Unveiling System Depths: Venturing into the terminal, I've gained a deeper grasp of the foundational technologies that govern our digital realms.&lt;/li&gt;
&lt;li&gt;Tailored Workspace: The power to mold and customize my environment to my exact liking is liberating. Every detail is a reflection of my preferences.&lt;/li&gt;
&lt;li&gt;Rapid File and Window Transitions: My productivity has soared due to the swift navigation between files and windows. Every second saved compounds over the course of a project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Some potential pitfalls:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Over-customization: The ability to tailor every detail can lead you down the rabbit hole of relentless tweaking. There's the temptation to perfect your config continuously. My advice? Once you have it in a functional, productive state, let it be for a month or so before revisiting. Nowadays, I rarely make changes to mine.
&lt;/li&gt;
&lt;li&gt;Steep Learning Curve: Diving into Linux or Neovim can be daunting for those accustomed to more user-friendly interfaces. The initial investment in learning can be high.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted to share this journey with you because diving into Linux and Neovim opened new doors for me in coding. I genuinely believe they can offer you some fresh perspectives and tools, making coding even more enjoyable and efficient. Give it a whirl; it might just be the game-changer you didn't know you needed.&lt;/p&gt;




&lt;p&gt;&lt;a id="guide"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A Guide to Getting Started:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1q8ecfvjtiywopiduvo.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1q8ecfvjtiywopiduvo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this post has peaked your interest in wanting to take that step into the terminal this list should do you well:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ubuntu Installation&lt;/strong&gt; : I use Learn Linux TV for all my Linux needs, he does great content - &lt;a href="https://youtu.be/f_8cD4HFvhc?si=NKer5Qnx9-E7nE8r" rel="noopener noreferrer"&gt;Ubuntu 22.04 LTS - Full Installation Walkthrough&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Neovim&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prebuilt Configs&lt;/strong&gt; ‒ If you want to just test out Neovim without going through the configuration yourself you can start with a prebuilt config:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LazyVim&lt;/strong&gt;: Where I would start with prebuilt: &lt;a href="https://www.lazyvim.org/" rel="noopener noreferrer"&gt;LazyVim&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;A guide looking at the LazyVim setup: &lt;a href="https://www.youtube.com/watch?v=N93cTbtLCIM" rel="noopener noreferrer"&gt;Zero to IDE with LazyVim&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;LunarVim&lt;/strong&gt;: &lt;a href="https://www.lunarvim.org/" rel="noopener noreferrer"&gt;LunarVim&lt;/a&gt;
&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NvChad&lt;/strong&gt;: &lt;a href="https://nvchad.com/" rel="noopener noreferrer"&gt;NvChad&lt;/a&gt; &lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AstroVim&lt;/strong&gt;: &lt;a href="https://astronvim.com/" rel="noopener noreferrer"&gt;Getting Started | AstroNvim&lt;/a&gt; &lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Setting up your own config guides&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TJ DeVries&lt;/strong&gt;: &lt;a href="https://www.youtube.com/watch?v=stqUbv-5u2s" rel="noopener noreferrer"&gt;Effective Neovim: Instant IDE - YouTube&lt;/a&gt; ‒ One of the Neovim contributor greats, taking you to an instant IDE.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ThePrimeagen&lt;/strong&gt; : &lt;a href="https://www.youtube.com/watch?v=w7i4amO_zaE&amp;amp;t=1299s" rel="noopener noreferrer"&gt;0 to LSP : Neovim RC From Scratch - YouTube&lt;/a&gt; ‒ Honestly just watch all his videos regarding vim/neovim, this is his most recent on setting up a config. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chris@machine&lt;/strong&gt; : &lt;a href="https://youtu.be/ctH-a-1eUME?si=anmImD7Nyl7fNpl8" rel="noopener noreferrer"&gt;Neovim IDE from Scratch - Introduction (100% lua config)&lt;/a&gt; ‒ Chris is the creator of LunarVim, this is where I started content wise I'm not sure how up to date it would be now, but still worth the mention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Josean Martinez&lt;/strong&gt;: &lt;a href="https://www.youtube.com/@joseanmartinez/videos" rel="noopener noreferrer"&gt;Josean Martinez - YouTube&lt;/a&gt; ‒ Recently dropping some new content, his tutorials are worth the watch if you want to set your own up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deams of Code&lt;/strong&gt;: &lt;a href="https://www.youtube.com/@dreamsofcode/videos" rel="noopener noreferrer"&gt;Dreams of Code - YouTube&lt;/a&gt; ‒ Has a couple of specific Neovim configuration setups, including (Python, NodeJS, Golang, Rust) &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Devaslife&lt;/strong&gt;: &lt;a href="https://www.youtube.com/watch?v=ajmK0ZNcM4Q&amp;amp;t=2524s" rel="noopener noreferrer"&gt;How to set up Neovim for coding React, TypeScript, Tailwind CSS, etc on a new M2 MacBook Air&lt;/a&gt; ‒ Might be a bit dated but I love his video styles.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Learning to navigate in Vim&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=X6AR2RMB5tE&amp;amp;list=PLm323Lc7iSW_wuxqmKx_xxNtJC_hJbQ7R" rel="noopener noreferrer"&gt;Vim As Your Editor: Vim As Your Editor - Introduction&lt;/a&gt; ‒ Series by ThePrimeagen &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Helpful links&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/rockerBOO/awesome-neovim" rel="noopener noreferrer"&gt;rockerBOO/awesome-neovim&lt;/a&gt;: Collections of awesome neovim plugins. ‒ RockerBOO has a repo that has almost every plugin for Neovim by category, this is a gold mine.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.reddit.com/r/neovim/" rel="noopener noreferrer"&gt;/r/neovim&lt;/a&gt; any questions go here the community is very welcoming and helpful.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://neovim.io/" rel="noopener noreferrer"&gt;Home - Neovim&lt;/a&gt; ‒ Neovim site&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://neovimcraft.com/" rel="noopener noreferrer"&gt;neovimcraft&lt;/a&gt; ‒  Site related to configs and plugins available&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dotfyle.com/this-week-in-neovim" rel="noopener noreferrer"&gt;This Week in Neovim&lt;/a&gt; - Neovim news&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Some Config Examples&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mine&lt;/strong&gt; : &lt;a href="https://github.com/0xlvl3/.dotfiles/tree/main/nvim/.config/nvim" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ThePrimeagan&lt;/strong&gt;: &lt;a href="https://github.com/ThePrimeagen/init.lua/tree/249f3b14cc517202c80c6babd0f9ec548351ec71" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;folke&lt;/strong&gt;: &lt;a href="https://github.com/folke/dot/tree/master/nvim" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;josean-dev&lt;/strong&gt;: &lt;a href="https://github.com/josean-dev/dev-environment-files/tree/main/.config/nvim" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;If you found value in this post, please give it a like or drop a comment. Your feedback helps and is much appreciated. Happy coding!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>opensource</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The Silent Power of Data Structures and Algorithms - A Developer's Guide</title>
      <dc:creator>stungnet</dc:creator>
      <pubDate>Fri, 08 Sep 2023 00:29:37 +0000</pubDate>
      <link>https://dev.to/stungnet/the-silent-power-of-data-structures-and-algorithms-a-developers-guide-3g83</link>
      <guid>https://dev.to/stungnet/the-silent-power-of-data-structures-and-algorithms-a-developers-guide-3g83</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Algorithms are the 'thought processes' of software."&lt;/em&gt; - &lt;strong&gt;Adam Osborne&lt;/strong&gt;  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
In the realm of Computer Science, the study and analysis of algorithms and data structures (DSA) stands as a foundational pillar. If your journey was anything like mine, formal education might not have been the path you took. I learned to code the way many of us do: by simply diving in and coding. Without the structured guidance of a university course, I charted my own course, hopping from one tutorial to another and building applications along the way. For a while, I believed I was on top of my game. That was until I encountered the intricate world of DSA. It was a humbling revelation, making me realize that my understanding was still in its infancy. But from this point, I began a deeper exploration into DSA. In this blog post, I aim to share why DSA is so pivotal and how it can elevate your skills as a developer.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxs14u6tn0ep2jqqunou.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxs14u6tn0ep2jqqunou.png" alt="math cal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you want to skip and see the list click here&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  What's An Algorithm? Think Gym Routine.
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Remember the first time you stepped into a gym? The vast array of equipment and exercises could be overwhelming. Then perhaps you met a trainer, or found a workout plan online, detailing a specific sequence: "10 squats, 15 push-ups, 3 sets of bicep curls." That's your algorithm in action—a carefully planned sequence ensuring you efficiently work towards your fitness goals. Rather than randomly hopping from one machine to the next and risking ineffective workouts (or worse, an injury), algorithms provide a structured plan to tackle problems with finesse and precision.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqkr6cptr6remhpnf3n7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqkr6cptr6remhpnf3n7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Data Structures? Picture This.
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6clerv0z4zwf2wxa75uw.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6clerv0z4zwf2wxa75uw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ever been to one of those trendy salad bars where you can mix and match ingredients? There are separate containers for lettuce, tomatoes, olives, and so on. You wouldn’t want to fish for feta cheese in a tub mixed with olives and cucumbers, right? Data structures operate on a similar principle. They’re like those individual containers, ensuring data is stored neatly and accessibly. So, when you need a specific ingredient (or piece of data), you know exactly where to look without diving through a chaotic mix.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Real-World Impact of DSA
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tnume6sk1woklisstaa.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tnume6sk1woklisstaa.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You see, once I had these "aha!" moments about DSA, coding no longer felt like blind trial and error. It was like having a gym routine tailor-made for every project. The algorithms became my exercise plans, ensuring that every line of code was working efficiently towards the goal. And data structures? They became the organizational system I never knew I needed, much like those separate containers at salad bars keeping everything tidy.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"The algorithm is where you write down the solution to your problem. The data structure is what carries this solution around and makes it effective."&lt;/em&gt; - &lt;strong&gt;Scott Meyers&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Why Should You Care About DSA?
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
To those who’ve never set foot in a gym or bothered about salad bar organization, you might be wondering, "Why does any of this matter for coding?" Well, just as a well-structured gym routine can be the difference between building muscle or merely sweating it out, understanding DSA can differentiate a good developer from a great one.&lt;/p&gt;

&lt;p&gt;In practical coding projects, you're often faced with decisions: How to store user data? Which method to use when searching for specific information? How to ensure that your app runs swiftly, even when faced with tons of data? That’s where DSA shines. Algorithms give you efficient methods to process data, while data structures offer optimal ways to store and retrieve it.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Learning Curve – It’s Worth the Climb
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
I won't sugarcoat it: diving into DSA felt like my first week at the gym all over again. There was unfamiliar terminology, complex concepts, and moments of sheer frustration. But much like persisting with a gym routine brings visible results, investing time into DSA has sharpened my coding skills.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoz4c32t9zq9rissl7wl.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoz4c32t9zq9rissl7wl.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a id="dsa-recommendations"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Embarking on the DSA Adventure: My Recommendations So Far
&lt;/h3&gt;

&lt;p&gt;Before we dive into this list, there's something I'd like to make clear: I'm still very much on my own journey with DSA. By no means do I claim to be an expert; I'm still navigating the intricacies and experiencing those 'aha!' moments every other day. However, during this exploration, I've stumbled upon some fantastic resources that have been instrumental in shedding light on the complex world of algorithms and data structures.&lt;/p&gt;

&lt;p&gt;I believe in sharing as we learn. So, consider this list less of an 'ultimate guide' and more of a friendly nudge in the right direction—a collection of stepping stones from someone a few steps ahead, eager to lend a helping hand. I hope these recommendations serve you as well as they've served me!&lt;/p&gt;

&lt;h4&gt;
  
  
  Websites
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Coursera&lt;/strong&gt; - Specifically the Algorithms Specialization by Stanford University.

&lt;ul&gt;
&lt;li&gt;&lt;a href="//www.coursera.org/learn/algorithms%20part1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//www.coursera.org/learn/algorithms%20part2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;LeetCode&lt;/strong&gt; - Perfect for practicing algorithms and data structure problems.
&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Neetcode&lt;/strong&gt; - Resources related to algorithms and data structures.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;HackerRank&lt;/strong&gt; - Another platform for coding challenges and DSA practice. &lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;MIT OpenCourseWare&lt;/strong&gt; - Introduction to Algorithms is a gold standard. 

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/" rel="noopener noreferrer"&gt;Introduction To Algorithms&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  YouTube
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BroCode&lt;/strong&gt; - &lt;a href="https://youtu.be/CBYHwZcbD-s?si=BZ-gJUsyE1i1LZkp" rel="noopener noreferrer"&gt;Learn Data Structures and Algorithms for free&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pasan Premaratne and Jay McGavren&lt;/strong&gt; - &lt;a href="https://youtu.be/8hly31xKli0?si=7iOGn7cNtVfPxcIU" rel="noopener noreferrer"&gt;Algorithms and Data Structures Tutorial - Full Course for Beginners&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Abdul Bari&lt;/strong&gt; - &lt;a href="https://youtube.com/playlist?list=PLDN4rrl48XKpZkf03iYFl-O29szjTrs_O&amp;amp;si=tAT25rneKzExm2ht" rel="noopener noreferrer"&gt;Algorithms - Full Playlist&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Steven from NullPointer Exception&lt;/strong&gt; - &lt;a href="https://www.youtube.com/watch?v=zg9ih6SVACc" rel="noopener noreferrer"&gt;Data Structures - Computer Science Course for Beginners&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;William Fiset&lt;/strong&gt; - &lt;a href="https://www.youtube.com/watch?v=RBSGKlAvoiM" rel="noopener noreferrer"&gt;Data Structures Easy to Advanced Course - Full Tutorial from a Google Engineer&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Books
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;"&lt;strong&gt;Introduction to Algorithms&lt;/strong&gt;" - Widely considered the DSA bible.
&lt;a href="https://www.goodreads.com/book/show/108986.Introduction_to_Algorithms?from_search=true&amp;amp;from_srp=true&amp;amp;qid=J952WQnAhe&amp;amp;rank=1" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"&lt;strong&gt;Data Structures and Algorithms Made Easy&lt;/strong&gt;" - Great for beginners. &lt;a href="https://www.goodreads.com/book/show/11289197-data-structures-and-algorithms-made-easy?ref=nav_sb_ss_1_40" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"&lt;strong&gt;Algorithms&lt;/strong&gt;" - In-depth and comprehensive. &lt;a href="https://www.goodreads.com/book/show/28439166-algorithms-fourth-edition-deluxe?from_search=true&amp;amp;from_srp=true&amp;amp;qid=8Adl00p7vJ&amp;amp;rank=1" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"&lt;strong&gt;The Algorithm Design Manual&lt;/strong&gt;" - Known for its real-world applicability. &lt;a href="https://www.goodreads.com/book/show/425208.The_Algorithm_Design_Manual?from_search=true&amp;amp;from_srp=true&amp;amp;qid=A5UELZxJqH&amp;amp;rank=1" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"&lt;strong&gt;Grokking Algorithms&lt;/strong&gt;" - A more visual and beginner-friendly approach. &lt;a href="https://www.goodreads.com/book/show/22847284-grokking-algorithms-an-illustrated-guide-for-programmers-and-other-curio?from_search=true&amp;amp;from_srp=true&amp;amp;qid=E8s8tGENhh&amp;amp;rank=1" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"&lt;strong&gt;Cracking the Coding Interview&lt;/strong&gt;" - DSA questions commonly asked in tech interviews. &lt;a href="https://www.goodreads.com/book/show/12544648-cracking-the-coding-interview?from_search=true&amp;amp;from_srp=true&amp;amp;qid=TSbRQ9zVNZ&amp;amp;rank=1" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"&lt;strong&gt;Algorithm Design&lt;/strong&gt;" - Great for gaining a deep understanding. &lt;a href="https://www.goodreads.com/book/show/145055.Algorithm_Design?from_search=true&amp;amp;from_srp=true&amp;amp;qid=8QiT7yQwC9&amp;amp;rank=2" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thanks for joining me on this DSA journey! If you found value in this post, please give it a like or drop a comment. Your feedback helps and is much appreciated. Happy coding!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>From Wires to Wireless: Understanding LAN &amp; WLAN in Your Home</title>
      <dc:creator>stungnet</dc:creator>
      <pubDate>Sun, 03 Sep 2023 00:29:11 +0000</pubDate>
      <link>https://dev.to/stungnet/from-wires-to-wireless-understanding-lan-wlan-in-your-home-730</link>
      <guid>https://dev.to/stungnet/from-wires-to-wireless-understanding-lan-wlan-in-your-home-730</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Ever wondered about the magic that powers your home's or small office's internet? Every time you stream a movie, jump into a video call, or play an online game, you're using something special called a network. This is typically referred to as a SOHO (Small Office/Home Office) setup. Believe it or not, within this setup, you've probably established both a LAN and a WLAN, even if those terms sound a tad technical. But don't fret! In this blog post, we'll demystify these terms and guide you through understanding the network that's right within your walls. So, let's begin by defining these terms.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  LAN (Local Area Network)
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
A LAN, or Local Area Network, is kind of like the hidden highways connecting all your digital devices in a close-knit space. Think of it as the behind-the-scenes magic that lets your computer talk to your printer or lets multiple computers share files. While LANs can sometimes span large areas like big corporate offices, for our chat today, let's picture the more cozy setting of your own home or a small office. Most of the time, these connections are made using cables – you might recognize the familiar blue Ethernet ones!&lt;br&gt;&lt;br&gt;
&lt;br&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frinjwe2xodk2uqhvsjc5.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frinjwe2xodk2uqhvsjc5.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;In the network diagram above, the switch plays the central role, directing communication among the various clients. This illustration showcases typical clients you might find in a LAN setup.&lt;/em&gt;
  &lt;/p&gt;



&lt;h3&gt;
  
  
  WLAN (Wireless Area Network)
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
A WLAN is just like a LAN but without the cables. Instead of using physical wires, devices connect using radio waves, often through Wi-Fi. Your smartphone, tablet, or laptop might connect to the internet without any cables, right? They're part of your home's WLAN, connecting wirelessly to a device often called a wireless router.&lt;br&gt;&lt;br&gt;
&lt;br&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5133jblanbrfnxdszw79.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5133jblanbrfnxdszw79.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;In the network diagram depicted, the wireless router stands as the linchpin, orchestrating wireless connections among a diverse array of devices. This visualization highlights the usual suspects in a WLAN environment: smartphones catching up on messages, laptops streaming videos and tablets downloading ebooks.&lt;/em&gt;
  &lt;/p&gt;




&lt;h2&gt;
  
  
  Devices
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Now that we've laid the foundation with a clear understanding of what LAN and WLAN are, let's delve deeper into the intricacies of the setup. Specifically, we'll explore the devices that make it all possible, especially in the context of a SOHO (Small Office/Home Office) environment.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Wireless Router
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
When you think of connecting to the internet at home, the first device that probably comes to mind is the wireless router. It's that box with blinking lights that might be sitting on a shelf or behind your TV. But what's inside this magical box, and how does it do its job? Let's peel back the layers and explore its individual components.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrlmj835p6dwfyx6wvgm.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrlmj835p6dwfyx6wvgm.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;D-Link wireless router: a compact yet powerful device, adept at ensuring a seamless Wi-Fi experience throughout your home.&lt;/em&gt;
  &lt;/p&gt;



&lt;h4&gt;
  
  
  Router
&lt;/h4&gt;

&lt;p&gt;The word 'router' gives a hint about its main job – to 'route' or direct. Just as traffic lights ensure cars move smoothly on roads, a router directs digital traffic, making sure your online movie, email, or game reaches its destination without any hitches.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gwiggw8oeuaqua82yrk.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gwiggw8oeuaqua82yrk.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Check out the backbone of our office internet! This router might look complex with all its interfaces, but each one plays a part in keeping us connected. It's like a busy highway directing traffic!&lt;/em&gt;
  &lt;/p&gt;



&lt;h4&gt;
  
  
  Wireless Access Point
&lt;/h4&gt;

&lt;p&gt;This component lets us break free from cables! It broadcasts wireless signals with a unique name, known as the SSID (Service Set Identifier). When you're trying to connect your smartphone, laptop, or TV and you see a list of Wi-Fi names? That's the SSID. By selecting the right one and entering a password (if required), your device can access the internet without being tethered by a cable.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8awlweibfdvp9artpzdr.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8awlweibfdvp9artpzdr.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Small but mighty! These little Cisco devices give you Wi-Fi in big places like offices. You might not always see them, but they're hard at work.&lt;/em&gt;
  &lt;/p&gt;



&lt;h4&gt;
  
  
  Switch
&lt;/h4&gt;

&lt;p&gt;While the freedom of wireless connectivity from a wireless router is undoubtedly convenient, there's another crucial part of our network setup that comes into play when we use cables: the 'switch'. The switch is like the behind-the-scenes coordinator, ensuring devices within the same LAN chat with each other without needing to involve the router. So, when your computer and printer, both connected by cables, need to 'talk', it's the switch that makes the conversation happen seamlessly.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkrnfcf4dgt2se95cmm1.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkrnfcf4dgt2se95cmm1.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;See this network switch? It's packed with ports, way more than our main router. While the router decides where data should go, this switch ensures all our devices can talk to each other. Think of it as the busy crossroads in our office's digital town.&lt;/em&gt;
  &lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
For the sake of convenience and simplicity, manufacturers often bundle all these functionalities—router, switch, wireless access point—into one device that most people commonly refer to as a 'wireless router'. You might even hear some folks call it a 'modem' or just a 'router'. However, as we've learned, labeling it merely as a 'router' might be a tad oversimplified given its multi-faceted roles.&lt;/p&gt;

&lt;p&gt;In the cozy confines of our homes or small offices, this all-in-one solution works beautifully. It's efficient, space-saving, and perfectly tailored to our needs. But when we step outside into the world of enterprise networks or expansive corporate setups, the story changes. Here, due to the sheer scale and specific requirements, these devices are typically standalone, each serving its unique purpose.&lt;/p&gt;

&lt;p&gt;So, the next time you glance at your 'wireless router', remember: it's not just a simple box. It's a versatile powerhouse, deftly handling multiple roles, all designed to give you a seamless internet experience&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion - SOHO Network Diagram
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
In wrapping up, visualizing our discussions, I've assembled a practical network diagram that embodies a typical SOHO LAN/WLAN setup using Packet Tracer. This illustration showcases a multifunctional wireless router at its heart, bridging both wired and wireless devices. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41pmoyi06jda0j4v72x5.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41pmoyi06jda0j4v72x5.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
You'll notice two smartphones and a laptop seamlessly connecting via Wi-Fi, demonstrating the flexibility and convenience of wireless connections. Meanwhile, a computer and a printer, both integrated through Ethernet cables, exemplify the stability and speed of wired connections. Through this representation, I hope to demystify the intricate dance of devices on your home network. It's my aspiration that you now possess a clearer understanding of how each device interplays, ensuring you stay connected, whether you're printing a document, streaming a video, or simply browsing the web.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>ccna</category>
      <category>beginners</category>
      <category>network</category>
    </item>
    <item>
      <title>From Data to Frame: The Evolution of PDUs Across the OSI Model</title>
      <dc:creator>stungnet</dc:creator>
      <pubDate>Sat, 26 Aug 2023 09:21:44 +0000</pubDate>
      <link>https://dev.to/stungnet/from-data-to-frame-the-evolution-of-pdus-across-the-osi-model-21gd</link>
      <guid>https://dev.to/stungnet/from-data-to-frame-the-evolution-of-pdus-across-the-osi-model-21gd</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3io9u6vcrk4nkx4tq933.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3io9u6vcrk4nkx4tq933.png" alt="intro image"&gt;&lt;/a&gt;&lt;br&gt;
In a recent exploration, I delved into the intricacies of the OSI model, detailing the distinct roles played by each layer throughout the networking stack. If you haven't had the chance to read that article, I recommend starting there &lt;a href="https://dev.to/stungnet/unpacking-the-osi-model-3fha"&gt;Unpacking The OSI Model&lt;/a&gt;. Building on that foundation, this article aims to dive deeper, specifically focusing on the Protocol Data Units (PDUs) across the OSI layers – illuminating their operations and their crucial encapsulations. So let's commence, by starting at the layer you interact with the: Application Layer.&lt;/p&gt;




&lt;h3&gt;
  
  
  Application Layer (Layer 7) - Data
&lt;/h3&gt;

&lt;p&gt;Within the Application Layer, the PDU is referred to simply as "Data". This data is raw and unstructured. Meaning it is the user's actual message, the file they're transferring, the content of the webpage they're accessing, or even the video they're streaming. As this data descends the networking stack, it undergoes layers of encapsulation, only to be de-encapsulated at its destination, reverting to its original, unadulterated form. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8kzakfasqonhkcawfmh.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8kzakfasqonhkcawfmh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Presentation Layer (Layer 6) - Data
&lt;/h3&gt;

&lt;p&gt;The PDU within the Presentation layer is still known as "Data", though the Data doesn't remain the same raw data we have in the Application Layer. This Data gets reformatted for compatibility, encrypted for security and compressed for transmission speed. The process here sets the stage for its journey further through the stack.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c1bex4wf7g1j96bz2u5.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c1bex4wf7g1j96bz2u5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Session Layer (Layer 5) - Data
&lt;/h3&gt;

&lt;p&gt;Within the Session Layer, our PDU is still recognized as "Data", marking its final appearance under this name. This layer is crucial in orchestrating the rhythm of communication: it not only establishes, maintains, and terminates sessions between two devices but also ensures the synchronization and structured management of the data being transferred. It's here that the mechanics of dialogue come into play, guaranteeing that the conversation between devices remains harmonious and coordinated.  &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4783bpn80y6uqsxrignt.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4783bpn80y6uqsxrignt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Transport Layer 4 (Layer 4) - Segment/Datagram
&lt;/h3&gt;

&lt;p&gt;At the Transport Layer, our PDU evolves distinctly, transitioning from the generalized "Data" to either "Segment" (within the realm of TCP) or "Datagram" (when dealing with UDP). This transformation is pivotal to end-to-end communication, as data is systematically divided into segments or datagrams for efficient transport, the PDU gains these essential attributes, encapsulated within what's known as the L4 Header.&lt;br&gt;&lt;br&gt;
 &lt;br&gt;&lt;br&gt;
&lt;strong&gt;Transport Layer Header (L4 Header):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type of PDU:&lt;/strong&gt; Data is categorized as either "Segment" (TCP) or "Datagram" (UDP).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port Numbers:&lt;/strong&gt; PDUs are endowed with source and destination port numbers to guide the data to its designated application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sequencing:&lt;/strong&gt; Every PDU receives a unique sequence number, safeguarding the order of data upon its arrival.&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2zwqt5tinl6p3ij91cr.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2zwqt5tinl6p3ij91cr.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Network Layer (Layer 3) - Packet
&lt;/h3&gt;

&lt;p&gt;At the Network Layer, our evolving PDU gains another vital header, morphing it into what we recognize as a 'Packet'. This transformation isn't merely structural; the new header equips the packet with essential attributes to navigate the vast topology of interconnected networks. Specifically, it incorporates logical addressing (IP addresses), routing indicators, and other metadata that routers and switches utilize to determine the packet's optimal path through the network. This layer ensures that each packet, regardless of its source or the path it takes, will find its way to its intended destination. &lt;br&gt;
 &lt;br&gt;&lt;br&gt;
&lt;strong&gt;Network Layer Header (L3 Header):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Logical Addressing:&lt;/strong&gt; The introduction of source and destination IP addresses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifetime Management:&lt;/strong&gt; Incorporation of the TTL field.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service Type Specification:&lt;/strong&gt; The addition of the ToS field.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Header Integrity:&lt;/strong&gt; Implementation of the header checksum.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol Specification:&lt;/strong&gt; Insertion of the protocol number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packet Size Management:&lt;/strong&gt; Fragmentation and reassembly details added.&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrcgw5lt51wnra3lcdwq.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrcgw5lt51wnra3lcdwq.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Data Link Layer (Layer 2) - Frame
&lt;/h3&gt;

&lt;p&gt;At the Data Link Layer, our PDU is framed and readied for its voyage across the local network. This encapsulation introduces the frame's 'local address', guiding it toward its destination within the immediate network. Moreover, mechanisms such as error-checking ensure its safe transit.&lt;br&gt;&lt;br&gt;
 &lt;br&gt; &lt;br&gt;
&lt;strong&gt;Data Link Layer Header (Frame Header):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source MAC Address:&lt;/strong&gt; A unique identifier hardwired into the sending device's network interface card.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination MAC Address:&lt;/strong&gt; The physical address of the intended recipient within the local network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type/Length Field:&lt;/strong&gt; Indicates either the type of protocol encapsulated within or the frame's length.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Link Layer Trailer (Frame Trailer):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frame Check Sequence (FCS):&lt;/strong&gt; A CRC-based value, calculated from the frame's content, ensuring transmission accuracy.&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjk6n00vfpd83j19v3odu.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjk6n00vfpd83j19v3odu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Physical Layer (Layer 1) - Bits
&lt;/h3&gt;

&lt;p&gt;Entering the foundational depths of our OSI journey, we reach the Physical Layer. Here, our meticulously crafted frame is translated into electrical pulses, optical signals, or radio waves, depending on the transmission medium. It's not about the content anymore; it's about the signal and its representation. This layer doesn't concern itself with headers or PDUs; it simply transmits raw binary data, one bit at a time.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5p20ydx4173zk1p3lwo.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5p20ydx4173zk1p3lwo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;As we journeyed through the OSI model, we've observed data undergoing encapsulation, layer by layer, prepped for its digital voyage. But this is only half the tale. For the end user to interact with this data, the reverse occurs. De-encapsulation systematically peels away the headers, restoring the data to its original form at the Application Layer. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8ilutm69gnv51jbk5a0.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8ilutm69gnv51jbk5a0.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
 &lt;br&gt;&lt;br&gt;
However, it's worth noting that while the OSI provides a structured blueprint, it's primarily a conceptual model. In practice, data handling might not always align perfectly with each OSI layer's defined function. In every online exchange, it's these rapid, detailed processes that make our digital communications possible. Truly, it showcases the wonders of today's network technologies. Thank you for joining me on this exploration, and I appreciate your time spent reading!  &lt;/p&gt;




&lt;p&gt;&lt;em&gt;In my upcoming blog post, I'll delve deeper into this subject using Packet Tracer, offering a hands-on, simulated exploration of networking intricacies. Stay tuned for a dynamic journey through virtual network configurations!&lt;/em&gt;  &lt;/p&gt;

</description>
      <category>networking</category>
      <category>backend</category>
      <category>ccn</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Unpacking The OSI Model</title>
      <dc:creator>stungnet</dc:creator>
      <pubDate>Sat, 19 Aug 2023 05:40:36 +0000</pubDate>
      <link>https://dev.to/stungnet/unpacking-the-osi-model-3fha</link>
      <guid>https://dev.to/stungnet/unpacking-the-osi-model-3fha</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_gt3hALP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gruqyavomgh5ss21inmw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_gt3hALP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gruqyavomgh5ss21inmw.jpg" alt="cover" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;At a cursory glance, the Open Systems Interconnection (OSI) model can appear daunting with its myriad layers and intricate details. Yet, these layers ingeniously simplify what's essentially a complex dance of computer communication. By segmenting the process into seven distinct layers, the OSI model offers a clear roadmap for understanding how devices talk to each other. In this blog post, I intend to break it down so you can grasp these concepts with ease, I will illustrate this through using a post office as our guiding analogy. &lt;/p&gt;




&lt;h3&gt;
  
  
  Physical Layer 1 (Infrastructure)
&lt;/h3&gt;

&lt;p&gt;The Physical Layer is like the foundation of a house in the world of computer networking. It's all about the actual stuff you can touch – like wires, cables, and some devices. This layer makes sure that when two computers want to 'talk', they have a set way to do it, no matter what kind of wire or connection they use. It ensures that the message gets through in a smooth and dependable manner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mLr94myH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7byf9kg56lqwtlvshixa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mLr94myH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7byf9kg56lqwtlvshixa.jpg" alt="physical layer image" width="800" height="200"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Meet Sam, our dedicated OSI Post Office worker. At Layer 1, or the Physical Layer, Sam represents the hands-on, tangible side of things. Just as a mailbox, post office, and mail are physical entities in our world, the Physical Layer is all about the actual hardware and cables in networking. It's where the real, touchable parts of communication take place.&lt;/em&gt;
  &lt;/p&gt;




&lt;h3&gt;
  
  
  Data Link Layer 2 (Sorting)
&lt;/h3&gt;

&lt;p&gt;The Data Link Layer is like a sorting room for computer data. It makes sure data goes to the right place using something called a MAC address. This address is like a name tag, ensuring the data reaches the right computer. It also uses Ethertype to tell the computer what kind of data it's getting. So, when the data arrives, the computer knows what to do with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6rGUI9Sj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8ycfjh23zkg9qa7t0l1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6rGUI9Sj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8ycfjh23zkg9qa7t0l1.jpg" alt="data link image" width="800" height="200"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;In our post office story, think of the Data Link Layer as the part where Sam sorts the mail. The MAC address is like the name on the envelope, making sure each letter goes to the right home. And the Ethertype? It's how Sam knows if the mail is a simple letter, a bigger box, or a package. Just like how mail needs sorting, computers use these 'labels' to understand their data.&lt;/em&gt;
  &lt;/p&gt;




&lt;h3&gt;
  
  
  Network Layer 3 (Routing)
&lt;/h3&gt;

&lt;p&gt;When our computer wants to send information, it needs a way to make sure it gets to the right place. This is where the Network Layer comes in. It adds special tags to our information, sort of like labels on a package in the post office.&lt;/p&gt;

&lt;p&gt;These labels or 'tags' have details like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Version: Is it an old or new type of label?&lt;/li&gt;
&lt;li&gt;Time To Live (TTL): A timer that ensures our package doesn't wander around lost for too long.&lt;/li&gt;
&lt;li&gt;Protocol: A special rule that helps the receiver understand and open our package correctly.&lt;/li&gt;
&lt;li&gt;Source and Destination IP: The 'from' and 'to' addresses for our package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these tags, our information can find its way easily to its destination.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cs-I1WIp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oypwo2g0neb0pwlztqr6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cs-I1WIp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oypwo2g0neb0pwlztqr6.jpg" alt="network layer image" width="800" height="200"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Sam, with his trusty route map, prepares each piece of mail by adding essential labels. These ensure every mail finds its right path and reaches its destination seamlessly.&lt;/em&gt;
  &lt;/p&gt;




&lt;h3&gt;
  
  
  Transport Layer 4 (Transport)
&lt;/h3&gt;

&lt;p&gt;When data comes to the Transport Layer, it's like checking the delivery method on a package.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If it's TCP: Think of this like a careful delivery service. The system checks a special label (called the port number) to figure out which app should get the data. TCP also double-checks to make sure everything arrived in the right order and nothing is missing. It's thorough, making sure the data delivery is just right before sending it to its final spot.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If it's UDP: This is more like express delivery. It's quick and doesn't wait around. The system still checks where the data should go using that port number label, but it doesn't spend time making sure everything is perfect. It gets the data to its destination fast.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, in a nutshell, TCP is the careful, thorough method, and UDP is the speedy one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IDxMd3LT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/94huz4yl6d3a62vv40xb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IDxMd3LT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/94huz4yl6d3a62vv40xb.jpg" alt="transport layer image" width="800" height="200"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Sam stands at a sorting table with two bins labeled 'TCP' and 'UDP'. He's intently examining labels on each package, placing them in their respective bins.&lt;/em&gt;
  &lt;/p&gt;




&lt;h3&gt;
  
  
  Session Layer 5 (Connection Established)
&lt;/h3&gt;

&lt;p&gt;The Session Layer is like a manager for a chat between two devices. Here's how it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Starting the chat (Establishment): It sets up the chat and decides if both devices will talk back-and-forth (two-way) or if one will just listen (one-way).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keeping the chat smooth (Maintenance): While they talk, it ensures messages are sent and received clearly and that both devices are on the same page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ending the chat (Termination): When they're done talking, it wraps things up neatly so both devices know the conversation is over.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iUvBAupE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nznscys8mnbcv4kge9vb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iUvBAupE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nznscys8mnbcv4kge9vb.jpg" alt="session layer image" width="800" height="200"&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Sam's Delivery Steps: First, he sends a notification about the upcoming package. Next, we see him diligently biking, making sure the package stays safe. Finally, the package rests on the doorstep, signifying a completed delivery and termination of the session.&lt;/em&gt;
  &lt;/p&gt;




&lt;h3&gt;
  
  
  Presentation Layer 6 (Interpreter)
&lt;/h3&gt;

&lt;p&gt;Once the packets arrive, the Presentation Layer steps in to make sure our computer understands the data. It changes the data into a format the system recognizes. However, not all data types need this change. This layer's main jobs are to convert the data, adjust its size, and secure or unlock it if needed.&lt;/p&gt;




&lt;h3&gt;
  
  
  Application Layer 7 (The Recipient)
&lt;/h3&gt;

&lt;p&gt;The Application Layer is where users directly interact with the data. Think of it as a user's personal desk where they access websites, send emails, or transfer files. This layer offers the right tools and ensures the data is presented in a user-friendly manner. Some of the key tools available on this "desk" are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP/HTTPS for websites.&lt;/li&gt;
&lt;li&gt;FTP for moving files.&lt;/li&gt;
&lt;li&gt;SMTP for sending emails.&lt;/li&gt;
&lt;li&gt;DNS for finding websites by name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end of this journey, when someone gets their data, they might not think about the complicated process it took. They're just happy to see what they asked for.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Just like a post office guarantees each letter reaches its intended recipient, the OSI model directs our digital data flawlessly to its end point. By following Sam’s journey, we've unraveled the layers behind our daily online activities.&lt;/p&gt;

&lt;p&gt;The next time you open a website or send a text, imagine Sam diligently sorting and delivering behind the scenes. Remember, every intricate system breaks down into simple steps, and grasping these basics is the pathway to expertise. Dive deep and keep exploring!&lt;/p&gt;

</description>
      <category>network</category>
      <category>networking</category>
      <category>backend</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Making a basic HTTP server with Golang</title>
      <dc:creator>stungnet</dc:creator>
      <pubDate>Thu, 30 Mar 2023 21:32:04 +0000</pubDate>
      <link>https://dev.to/stungnet/making-a-basic-http-server-with-golang-37lk</link>
      <guid>https://dev.to/stungnet/making-a-basic-http-server-with-golang-37lk</guid>
      <description>&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5h2sv6fuemh21gpmr5e.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5h2sv6fuemh21gpmr5e.png" alt="Image description" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Golang is widely used for building web applications. The ease of spinning up a HTTP server is one of its key features and today I'm going to show you just how easy it is to spin one up in a few lines. Then register some paths that will show some strings let's get started!&lt;/p&gt;

&lt;p&gt;&lt;small&gt;Finished code:&lt;/small&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="c"&gt;// formatting and printing values to the console.&lt;/span&gt;
    &lt;span class="s"&gt;"log"&lt;/span&gt;      &lt;span class="c"&gt;// logging messages to the console.&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt; &lt;span class="c"&gt;// Used for build HTTP servers and clients.&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;// Port we listen on.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;portNum&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;":8080"&lt;/span&gt;

&lt;span class="c"&gt;// Handler functions.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&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;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Homepage"&lt;/span&gt;&lt;span class="p"&gt;)&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;Info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&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;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Info page"&lt;/span&gt;&lt;span class="p"&gt;)&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;log&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;"Starting our simple http server."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Registering our handler functions, and creating paths.&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/info"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;log&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;"Started on port"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;portNum&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;"To close connection CTRL+C :-)"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Spinning up the server.&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;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;portNum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&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;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fatal&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="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h2&gt;
  
  
  Required packages
&lt;/h2&gt;

&lt;p&gt;For this we could really use just two packages &lt;code&gt;fmt&lt;/code&gt; and &lt;code&gt;net/http&lt;/code&gt; known as (&lt;code&gt;http&lt;/code&gt;), but I enjoy having &lt;code&gt;log&lt;/code&gt; to print certain things out in my code. If you aren't familar with these packages I've commented there use case next to them.&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;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;      &lt;span class="c"&gt;// formatting and printing values to the console.&lt;/span&gt;
    &lt;span class="s"&gt;"log"&lt;/span&gt;      &lt;span class="c"&gt;// logging messages to the console.&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt; &lt;span class="c"&gt;// Used for build HTTP servers and clients.&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h2&gt;
  
  
  Defining handler functions
&lt;/h2&gt;

&lt;p&gt;Handler functions by name will handle incoming HTTP requests. These functions will take two arguments &lt;code&gt;http.ResponseWriter&lt;/code&gt; which we call &lt;code&gt;w&lt;/code&gt; and &lt;code&gt;r&lt;/code&gt; a pointer to a &lt;code&gt;http.Request&lt;/code&gt; this is standard for declaring a handler function.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;Anatomy of a handler function:&lt;/small&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;

&lt;span class="c"&gt;// handlerFunc handles incoming HTTP requests.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;handlerFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Message here to the response writer.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So what are these two arguments? when we make a request to a HTTP server, the server must process this and send back a response back to the client. Our &lt;code&gt;http.ResponseWriter&lt;/code&gt; is used to write this response back to the client, and the &lt;code&gt;http.Request&lt;/code&gt; object contains information about the incoming request.&lt;/p&gt;

&lt;p&gt;So filling in our handler functions with some data now we write strings that will appear on our pages saying &lt;code&gt;Homepage&lt;/code&gt; and &lt;code&gt;Info&lt;/code&gt;. This is where you would pass your HTML templates if we were creating a web app. For now we just want to see our strings appear on the page.&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;func&lt;/span&gt; &lt;span class="n"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&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;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Homepage"&lt;/span&gt;&lt;span class="p"&gt;)&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;Info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&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;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Info"&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;h2&gt;
  
  
  Handling the func
&lt;/h2&gt;

&lt;p&gt;Now to handle the functions we just created we use the &lt;code&gt;http.HandleFunc&lt;/code&gt; function. this function will take two arguments, a path as a string and a handler function which we just created above. &lt;/p&gt;

&lt;p&gt;&lt;small&gt;The basic pattern of a HandleFunc is below:&lt;/small&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;

&lt;span class="c"&gt;// HandleFunc is used to register a handler function for a specific path on your HTTP server.&lt;/span&gt;
&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now let's register some paths with the handler functions we created earlier.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;

&lt;span class="c"&gt;// Keeping it simple we will place them in our main function.&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="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/info"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Info&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;h2&gt;
  
  
  We've now created two paths by registering our handler functions to &lt;code&gt;/&lt;/code&gt;for our homepage and &lt;code&gt;/info&lt;/code&gt; for our info page. Let's now learn how we can spin up our server on our chosen port.
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Can you hear me?
&lt;/h2&gt;

&lt;p&gt;The last part is spinning up our server and listening. Listening in terms of network programming refers to the process of waiting for incoming network connections. Using the &lt;code&gt;http.ListenAndServe&lt;/code&gt; function we can start a HTTP server and "listen" for incoming requests on a specified network address and port. Once a reuqest is received, it is passed to the appropriate handler function for processing.&lt;/p&gt;

&lt;p&gt;Anatomy of a ListenAndServe:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;

&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ServeMux&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now let's listen on port 8080 and for our ServeMux we are just using the default &lt;code&gt;http.ServeMux()&lt;/code&gt; by using &lt;code&gt;nil&lt;/code&gt;. ListenAndServe also returns a err, so we can error check.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;

&lt;span class="c"&gt;// Spinning up the server.&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;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;portNum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&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;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fatal&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="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now run your &lt;code&gt;main.go&lt;/code&gt; with &lt;code&gt;go run main.go&lt;/code&gt; and visit &lt;code&gt;your_ip_here:8080&lt;/code&gt; or &lt;code&gt;your_ip_here:8080/info&lt;/code&gt; in your browser to see a string printed on your new HTTP server and registered paths. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhibqg1pt82xema81unm.jpg" alt="Image description" width="558" height="321"&gt;
&lt;/h2&gt;

&lt;p&gt;Congratulations on starting up a HTTP server, in the next post I'll show you how to add some HTML to this!&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
