<?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: Palak Hirave </title>
    <description>The latest articles on DEV Community by Palak Hirave  (@hirave_palak).</description>
    <link>https://dev.to/hirave_palak</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%2F3630495%2F48174bfa-0c80-4a70-9234-1589821227e8.jpeg</url>
      <title>DEV Community: Palak Hirave </title>
      <link>https://dev.to/hirave_palak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hirave_palak"/>
    <language>en</language>
    <item>
      <title>Day 23 of 100</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Fri, 24 Jul 2026 10:33:11 +0000</pubDate>
      <link>https://dev.to/hirave_palak/day-23-of-100-41l0</link>
      <guid>https://dev.to/hirave_palak/day-23-of-100-41l0</guid>
      <description>&lt;p&gt;Today I made the capstone project for the beginners section of my 100 days of python challenge. It is similar to the Crossy Roads game. There is a turtle which has to make it to the end of the screen before any of the colourful blocks(which move from the right to left) hit it. Each time it crosses the northern boundary(the turtle starts in the south and heads upwards) it returns to its original position for the next level, except this time the blocks are moving faster. &lt;/p&gt;

&lt;p&gt;Overall I had a great time building this project. After a quick overview into how the game was supposed to work I found that it was quite straightforward and didn't need much problem solving. I flew though creating the turtle, scoreboard and game over screen but got a little stuck on how to make so many blocks and how to detect if a block has collided with the turtle. In the end, it worked out quite nicely. &lt;/p&gt;

&lt;p&gt;When it comes to the actual program, I should have cleaned up the code a bit but was not quite sure how to. Mostly on the car_manager part(The cars are the blocks). I could have turned all of the workings for the blocks/cars I did in the while loop into separate functions in the CarManager class and then simply called them but I wasn't quite sure how to. That is definitely something to improve/look into next time. I am quite happy to finally be in the intermediate territory of python programming. &lt;/p&gt;

&lt;p&gt;Here's the code - &lt;/p&gt;

&lt;h2&gt;
  
  
  main.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Screen&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Player&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;car_manager&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CarManager&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scoreboard&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Scoreboard&lt;/span&gt;

&lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Screen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Turtle Crossing Game&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;player&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Player&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;scoreboard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Scoreboard&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;cars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="n"&gt;car&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CarManager&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;cars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;loop_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;MOVE_SEGMENT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

&lt;span class="n"&gt;game_is_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;game_is_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&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;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cars&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backward&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MOVE_SEGMENT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onkey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;move_up&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Up&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&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;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ycor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;280&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;scoreboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_score&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reset_pos&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;MOVE_SEGMENT&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;

    &lt;span class="n"&gt;loop_count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;loop_count&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;car&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CarManager&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;cars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;loop_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;cr&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cars&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;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;distance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;game_is_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;scoreboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;game_over&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exitonclick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  player.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Turtle&lt;/span&gt;

&lt;span class="n"&gt;STARTING_POSITION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;280&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;MOVE_DISTANCE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;FINISH_LINE_Y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;280&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Player&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Turtle&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;black&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;turtle&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setheading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;penup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;STARTING_POSITION&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;move_up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forward&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MOVE_DISTANCE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;reset_pos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;STARTING_POSITION&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  scoreboard.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Turtle&lt;/span&gt;

&lt;span class="n"&gt;FONT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Courier New&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bold&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Scoreboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Turtle&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;black&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;penup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hideturtle&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;280&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;260&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Score:0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FONT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Score:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FONT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;game_over&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Game Over.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;FONT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  car_manager.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Turtle&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;

&lt;span class="n"&gt;COLORS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;red&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;orange&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;yellow&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;green&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;blue&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;purple&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;STARTING_MOVE_DISTANCE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;MOVE_INCREMENT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CarManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Turtle&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;COLORS&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;square&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;penup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shapesize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stretch_wid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stretch_len&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random_y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;collision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;


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

&lt;/div&gt;



</description>
      <category>python</category>
      <category>beginners</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Learning Log</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Fri, 24 Jul 2026 05:42:24 +0000</pubDate>
      <link>https://dev.to/hirave_palak/learning-log-27g6</link>
      <guid>https://dev.to/hirave_palak/learning-log-27g6</guid>
      <description>&lt;p&gt;Hello. Here I will be listing the resources I used for learning cybersecurity and in the order I completed them. Feel free to use any of the resources for your own learning. I'll make sure to update this list as I progress. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://academy.hackthebox.com/achievement/2551127/293" rel="noopener noreferrer"&gt;https://academy.hackthebox.com/achievement/2551127/293&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://academy.hackthebox.com/achievement/2551127/289" rel="noopener noreferrer"&gt;https://academy.hackthebox.com/achievement/2551127/289&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=MdPbxXDtkVs" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=MdPbxXDtkVs&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>networking</category>
      <category>learning</category>
      <category>devjournal</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Day 22 of 100</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Wed, 22 Jul 2026 07:12:47 +0000</pubDate>
      <link>https://dev.to/hirave_palak/day-22-of-100-nam</link>
      <guid>https://dev.to/hirave_palak/day-22-of-100-nam</guid>
      <description>&lt;p&gt;I'm coming back to this series after quite a long time. It's nice to get back to programming. &lt;/p&gt;

&lt;p&gt;Today I build the Ping Pong game with a simple UI. Here's the code - &lt;/p&gt;

&lt;h2&gt;
  
  
  main.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Screen&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;paddle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Paddle&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ball&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Ball&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scoreboard&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Scoreboard&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Screen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bgcolor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;black&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Pong&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;r_paddle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Paddle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;l_paddle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Paddle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ball&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Ball&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;scoreboard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Scoreboard&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onkey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r_paddle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Up&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onkey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r_paddle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;down&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Down&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onkey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l_paddle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onkey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l_paddle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;down&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;s&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;game_is_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;game_is_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;faster&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;move&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;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ycor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;280&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ycor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;280&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bounce_y&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;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;distance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r_paddle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xcor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;distance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l_paddle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xcor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;320&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bounce_x&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;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xcor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;380&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reset_pos&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;scoreboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;l_point&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;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xcor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;380&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ball&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reset_pos&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;scoreboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;r_point&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exitonclick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  ball.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Turtle&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Ball&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Turtle&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;circle&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;white&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;penup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_new&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_new&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;faster&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;move&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;new_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xcor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_new&lt;/span&gt;
        &lt;span class="n"&gt;new_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ycor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_new&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bounce_y&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_new&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bounce_x&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_new&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;faster&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;0.7&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;reset_pos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;faster&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bounce_x&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  paddle.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Paddle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;turtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Turtle&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xcord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ycord&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;white&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;square&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shapesize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stretch_wid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stretch_len&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;penup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_cord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;xcord&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_cord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ycord&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setpos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_cord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_cord&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_cord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_cord&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jump&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_cord&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jump&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;down&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x_cord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_cord&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jump&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y_cord&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jump&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  scoreboard.py
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;turtle&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Scoreboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;turtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Turtle&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;white&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;penup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hideturtle&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;l_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_score&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;l_score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;align&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;center&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Arial&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;normal&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;align&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;center&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Arial&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;normal&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;l_point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;l_score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_score&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;r_point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r_score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_score&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

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

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>python</category>
      <category>challenge</category>
      <category>programming</category>
    </item>
    <item>
      <title>Proxies</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Tue, 21 Jul 2026 04:36:27 +0000</pubDate>
      <link>https://dev.to/hirave_palak/proxies-5hgb</link>
      <guid>https://dev.to/hirave_palak/proxies-5hgb</guid>
      <description>&lt;p&gt;A proxy is a mediator that sits between two points/connections. Unlike a gateway, which just checks the source and destination IP Address, a proxy opens up the data packets and inspects what is inside and then makes a call as the whether or not to send on the data packet. Proxies can filter content, scan for malware, cache data(save a copy of popular websites locally to speed up load times for everyone else on the network), and hide your identity or rewrite the web request before sending it along. Proxies almost always operate at layer 7 of the OSI Model. &lt;/p&gt;

&lt;h2&gt;
  
  
  Dedicated Proxy / Forward Proxy
&lt;/h2&gt;

&lt;p&gt;A Forward Proxy sits in front of clients (like employees' laptops) and acts as an intermediary before their traffic hits the internet.&lt;/p&gt;

&lt;p&gt;eg. When you try to visit example.com:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your browser sends the request to the Forward Proxy inside your company.&lt;/li&gt;
&lt;li&gt;The proxy inspects the request (checking rules like "Is this site allowed? Is it safe?").&lt;/li&gt;
&lt;li&gt;The proxy reaches out to example.com on your behalf, gets the webpage, and hands it back to you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Forward Proxies Block Malware (C2 Communication)&lt;/strong&gt;&lt;br&gt;
When malware infects a machine, it needs to reach back out to the attacker's server, known as a Command and Control (C2) server, to receive instructions or steal data.&lt;/p&gt;

&lt;p&gt;In a corporate environment with a forward proxy the infected computer cannot connect directly to the internet. To talk to the outside world, the malware must know how to route its traffic through the proxy. If the malware tries to make a direct connection without going through the proxy, the corporate firewall simply drops the connection, leaving the malware stranded and unable to operate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The "System Proxy" vs. Firefox Advantage&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows Native Apps&lt;/strong&gt; (Chrome, Edge, IE, WinSock): Most Windows malware uses built-in Windows network tools (like WinSock). Because these built-in tools automatically read and use the computer's "System Proxy" settings, the malware unintentionally routes its traffic right through the corporate proxy, where security teams can detect and block it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Firefox&lt;/strong&gt; (Cross-Platform/libcurl): Firefox ignores Windows' built-in system proxy settings and uses its own independent networking code (libcurl).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a company exclusively uses Firefox and configures proxy settings inside Firefox itself (rather than at the Windows system level), standard malware using Windows built-in tools won't know how to find those proxy settings. The malware fails to talk to its C2 server because it doesn't know where the proxy is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Malware Tactics&lt;/strong&gt;&lt;br&gt;
If malware realizes web traffic (HTTP/HTTPS) is blocked, it might try using DNS requests to leak data or get commands (since DNS requests often bypass web proxies). However, security tools like Sysmon easily log and alert on weird DNS patterns, catching the attacker anyway.&lt;/p&gt;

&lt;p&gt;Burp Suite is a popular cybersecurity tool used by ethical hackers and security testers. While usually set up on a tester's machine as a forward proxy to capture and tweak web requests in real-time, it is flexible enough to be reconfigured as a reverse proxy or a transparent proxy depending on the test scenario.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reverse Proxy
&lt;/h2&gt;

&lt;p&gt;This is the reverse of the Forward Proxy. Rather than monitoring requests that go out, it monitors requests that come into the network. The most common goal of this type of proxy is to listen on and forward it to a closed-off network. &lt;/p&gt;

&lt;p&gt;Penetration Testers will configure reverse proxies on infected endpoints. The infected endpoint will listen on a port and send any client that connects to the port back to the attacker through the infected endpoint. This is useful to bypass firewalls or evade logging. Organizations may have IDS (Intrusion Detection Systems), watching external web requests. If the attacker gains access to the organization over SSH, a reverse proxy can send web requests through the SSH Tunnel and evade the IDS.&lt;/p&gt;

&lt;h2&gt;
  
  
  (Non-) Transparent Proxy
&lt;/h2&gt;

&lt;p&gt;All these proxy services act either transparently or non-transparently.&lt;/p&gt;

&lt;p&gt;With a transparent proxy, the client doesn't know about its existence. The transparent proxy intercepts the client's communication requests to the Internet and acts as a substitute instance. To the outside, the transparent proxy, like the non-transparent proxy, acts as a communication partner.&lt;/p&gt;

&lt;p&gt;If it is a non-transparent proxy, we must be informed about its existence. For this purpose, we and the software we want to use are given a special proxy configuration that ensures that traffic to the Internet is first addressed to the proxy. If this configuration does not exist, we cannot communicate via the proxy. However, since the proxy usually provides the only communication path to other networks, communication to the Internet is generally cut off without a corresponding proxy configuration.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Networking Topologies</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Tue, 21 Jul 2026 03:51:19 +0000</pubDate>
      <link>https://dev.to/hirave_palak/networking-topologies-52dn</link>
      <guid>https://dev.to/hirave_palak/networking-topologies-52dn</guid>
      <description>&lt;p&gt;A network topology is the layout of a network—how devices are connected to one another both physically and logically.&lt;/p&gt;

&lt;p&gt;Networks are made up of two main types of hardware:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hosts&lt;/strong&gt;: The end devices using the network (computers, servers, phones, laptops).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Components&lt;/strong&gt;: Devices that sit in the middle (routers, switches, bridges) to direct traffic and make sure data gets from host A to host B.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The topology you choose determines what hardware you need to buy and how data is allowed to travel across the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physical vs. Logical Topology&lt;/strong&gt;&lt;br&gt;
This is one of the most important distinctions in networking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Physical Topology&lt;/strong&gt;: The physical setup you can see and touch. It includes the actual cables, where the devices are located in a room, and how cables run through walls.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Logical Topology&lt;/strong&gt;: The invisible pathway data takes. It’s how signals actually travel from device to device across the network, regardless of what the cable setup looks like physically.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: You could arrange four computers physically in a circle on a single desk (looks like a ring), but if they all plug into a central box in the middle, data travels in a star pattern logically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Three Areas of Network Topologies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connections (The Medium)&lt;/strong&gt;&lt;br&gt;
These are the channels data travels through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wired&lt;/strong&gt;: Twisted-pair copper cables (standard Ethernet), coaxial cables (older cable TV style), and glass fiber cables (ultra-fast light pulses).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wireless&lt;/strong&gt;: Wi-Fi, cellular networks (4G/5G), and satellite links.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Nodes (The Intermediaries)&lt;/strong&gt;&lt;br&gt;
A node is any connection point where data is sent, received, or forwarded. This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Interface Controller (NIC)&lt;/strong&gt;: The network card/chip inside your computer that allows it to talk to a network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Traffic Hardware&lt;/strong&gt;: Devices that manage signal flow—such as Repeaters (boost signal), Switches (direct traffic in a building), Routers (connect different networks/internet), and Firewalls (security filters).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: A node doesn't always have to be a full computer, it can be a small smart sensor or microcontroller.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Classifications (The Layout Patterns)&lt;/strong&gt;&lt;br&gt;
Networks generally follow eight fundamental structural shapes (or a combination of them):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Point-to-Point&lt;/strong&gt;: A direct, dedicated line between exactly two devices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bus&lt;/strong&gt;: Every device connects to one single central trunk cable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Star&lt;/strong&gt;: All devices plug directly into one central hub or switch (the most common modern setup).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ring&lt;/strong&gt;: Each device connects to two neighbors, forming a closed circle of data flow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mesh&lt;/strong&gt;: Devices connect directly to multiple other devices (or all of them) for high reliability/redundancy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tree&lt;/strong&gt;: A hierarchical setup combining star networks onto a main backbone cable (looks like a family tree).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Daisy Chain&lt;/strong&gt;: Linking devices together in a linear chain, one after another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid&lt;/strong&gt;: Combining two or more of the above shapes (e.g., mixing a Star and a Mesh) to handle larger or more complex environments.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>network</category>
      <category>networking</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Types of Networks</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Tue, 21 Jul 2026 03:15:02 +0000</pubDate>
      <link>https://dev.to/hirave_palak/types-of-networks-237f</link>
      <guid>https://dev.to/hirave_palak/types-of-networks-237f</guid>
      <description>&lt;p&gt;&lt;strong&gt;Common Terms&lt;/strong&gt; - networking terms and topologies that are commonly used &lt;br&gt;
&lt;strong&gt;Book Terms&lt;/strong&gt; - networking terms that are not so common and you don't need to be able to recite them unless you are taking a networking exam &lt;/p&gt;

&lt;h2&gt;
  
  
  Common Terms
&lt;/h2&gt;

&lt;p&gt;We have already gone over most of these previously so I am just going to summarize them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WAN&lt;/strong&gt; - Stands for Wide Area Network and is most commonly known as the Internet however a WAN is just a collection of LANs put together. Companies and Governments also tend to have internal WANs. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LAN/WLAN&lt;/strong&gt; - Stands for (Wireless) Local Area Network and tends to assign IP addresses for local use. In some cases you may be assigned an IP address to use over the internet but this is rare. There is no difference between a LAN and WLAN aside from the fact that one doesn't need cables and is wireless. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VPN&lt;/strong&gt; - Stands for Virtual Private Network and is used to make it appear as though your device is physically plugged into a different network. There are three main types. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Site-To-Site VPN&lt;/strong&gt; : The client and server are Network Devices, typically either Routers or Firewalls, and share entire network ranges. This is most commonly used to join company networks together over the Internet, allowing multiple locations to communicate over the Internet as if they were local.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Remote Access VPN&lt;/strong&gt; : It connects your device to a private network by creating an encrypted tunnel, making your computer appear as if it is inside that network. Other devices then see the VPN server's IP address rather than your own, which adds a layer of security. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSL VPN&lt;/strong&gt; : Stands for Secure Sockets Layer VPN and rather than downloading VPN software, it runs directly in your browser and they can stream applications or desktop sessions. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Book Terms
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GAN&lt;/strong&gt; - This stands for Global Area Network and whilst the Internet is one of them, international companies also have them as they connect multiple WANs to connect company computers worldwide. This is typically done though international undersea cables or satellite transmission. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MAN&lt;/strong&gt; - Stands for Metropolitan Area Network and is used to connect multiple LANs over a local area e.g. a city. Instead of sending sensitive corporate files over the public internet, which can slow down during peak traffic hours, the company rents or uses direct high-speed optical fiber cables. Because these fiber links are direct and high-powered, sending a file to an office 10 miles across town feels just as fast as sending a file to the printer in the next room. Internationally companies can then plug these MANs into a WAN(for countries/continents) or a GAN(for global reach). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PAN/WPAN&lt;/strong&gt; - Stands for (Wireless) Personal Area Network and is used to connect devices for data exchange. These typically span a few meters and are therefore not suitable for connecting devices in a home/building. &lt;/p&gt;

</description>
      <category>network</category>
      <category>networking</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Network Security</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Sun, 10 May 2026 07:16:52 +0000</pubDate>
      <link>https://dev.to/hirave_palak/network-security-4cgj</link>
      <guid>https://dev.to/hirave_palak/network-security-4cgj</guid>
      <description>&lt;p&gt;A Firewall is a network security device, either hardware, software, or a combination of both, that monitors incoming and outgoing network traffic. Firewalls enforce a set of rules (known as firewall policies or access control lists) to determine whether to allow or block specific traffic. &lt;/p&gt;

&lt;p&gt;Firewalls operate by analyzing packets of data according to predefined rules and policies, commonly focusing on factors such as IP addresses, port numbers, and protocols. This process, known as traffic filtering, is defined by system administrators as permitting or denying traffic based on specific conditions, ensuring that only authorized connections are allowed. Additionally, firewalls can log traffic events and generate alerts about any suspicious activity. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Packet Filtering Firewall&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Operates at Layer 3 (Network) and Layer 4 (Transport) of the OSI model.&lt;br&gt;
Examines source/destination IP, source/destination port, and protocol type.&lt;br&gt;
Example: A simple router ACL that only allows HTTP (port 80) and HTTPS (port 443) while blocking other ports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Stateful Inspection Firewall&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tracks the state of network connections.&lt;br&gt;
More intelligent than packet filters because they understand the entire conversation.&lt;br&gt;
Example: Only allows inbound data that matches an already established outbound request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Application Layer Firewall (Proxy Firewall)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Operates up to Layer 7 (Application) of the OSI model.&lt;br&gt;
Can inspect the actual content of traffic (e.g., HTTP requests) and block malicious requests.&lt;br&gt;
Example: A web proxy that filters out malicious HTTP requests containing suspicious patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Next-Generation Firewall (NGFW)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Combines stateful inspection with advanced features like deep packet inspection, intrusion detection/prevention, and application control.&lt;br&gt;
Example: A modern firewall that can block known malicious IP addresses, inspect encrypted traffic for threats, and enforce application-specific policies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intrusion Detection and Prevention Systems (IDS/IPS)
&lt;/h2&gt;

&lt;p&gt;They are security solutions designed to monitor and respond to suspicious network or system activity. An Intrusion Detection System (IDS) observes traffic or system events to identify malicious behavior or policy violations, generating alerts but not blocking the suspicious traffic whilst an Intrusion Prevention System (IPS) operates similarly to an IDS but also takes an additional step by preventing or rejecting malicious traffic in real time. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Techniques&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signature-based detection - Matches traffic against a database of known exploits.&lt;/li&gt;
&lt;li&gt;Anomaly-based detection - Detects anything unusual compared to normal activity.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Wireless Networks</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Sun, 10 May 2026 05:24:44 +0000</pubDate>
      <link>https://dev.to/hirave_palak/wireless-networks-52j</link>
      <guid>https://dev.to/hirave_palak/wireless-networks-52j</guid>
      <description>&lt;p&gt;A wireless network is a communication system that uses radio waves or other wireless signals to connect devices together. This enables them to communicate and extanche data without the need for physical cables. This technology allows devices to connect to the interent, share files and access services seamlessly over the air, offering flexibility and convenience in personal and professional environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mobility - Users can move around freely within the coverage area.&lt;/li&gt;
&lt;li&gt;Ease of installation - No need for extensive cabling.&lt;/li&gt;
&lt;li&gt;Scalability - Adding new devices is simpler than a wired network.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interference - Wireless signals can be disrupted by walls, other electronics, or atmospheric conditions.&lt;/li&gt;
&lt;li&gt;Security risks - Without proper security measures, wireless transmissions can be easier to intercept.&lt;/li&gt;
&lt;li&gt;Speed limitations - Generally, wireless connections are slower compared to wired connections of the same generation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wireless Router
&lt;/h2&gt;

&lt;p&gt;A router is a device that forwards data packets between computer networks. In a home or small office setting, a wireless router combines the functions of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routing - Directing data to the correct destination (within your network or on the internet).&lt;/li&gt;
&lt;li&gt;Wireless Access Point - Providing Wi-Fi coverage. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Component&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WAN (Wide Area Network) Port - Connects to your internet source (e.g., a cable modem).&lt;/li&gt;
&lt;li&gt;LAN (Local Area Network) Ports - For wired connections to local devices (e.g., desktop computer, printer).&lt;/li&gt;
&lt;li&gt;Antennae - Transmit and receive wireless signals. (Some routers have internal antennae.)&lt;/li&gt;
&lt;li&gt;Processor &amp;amp; Memory - Handle routing and network management tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Moblie Hotspot
&lt;/h2&gt;

&lt;p&gt;It allows a smartphone (or other hotspot devices) to share its cellular data connection via Wi-Fi. Other devices (laptops, tablets, etc.) can then connect to this hotspot just like they would to a regular Wi-Fi network. A mobile hotspot uses cellular data, connecting devices to the internet via a cellular network, such as 4G or 5G. The range of a hotspot is typically limited to just a few meters. Running a hotspot can also significantly drain the battery of the device creating the hotspot. For security, access to the hotspot is usually protected by a password, similar to the security measures used for a home Wi-Fi network. &lt;/p&gt;

&lt;h2&gt;
  
  
  Cell Towers
&lt;/h2&gt;

&lt;p&gt;A cell tower/site is a structure where antennas and electronic communications equipment are placed to create a cellular network cell. This cell in a cellular network refers to the specific area of coverage provided by a single cell tower, which is designed to seamlessly connect with adjacent cells created by other towers. Each tower covers a certain geographic area, allowing mobile phones (and other cellular-enabled devices) to send and receive signals.&lt;/p&gt;

&lt;p&gt;Cell towers function through a combination of radio transmitters and receivers, which are equipped with antennas to communicate over specific radio frequencies. These towers are managed by Base Station Controllers (BSC), which oversee the operation of multiple towers. BSCs handle the transfer of calls and data sessions from one tower to another when users move across different cells. Finally, these towers are connected to the core network via backhaul links, which are typically fiber optic or microwave links.&lt;/p&gt;

&lt;p&gt;Cell towers are differentiated by their coverage capacities and categorized primarily into macro cells and micro/small cells. Macro cells consist of large towers that provide extensive coverage over several kilometers, making them ideal for rural areas where wide coverage is necessary. On the other hand, micro and small cells are smaller installations typically located in urban centers. These towers are placed in densely populated areas and fill the coverage gaps left by macro cells. Imagine you are on a road trip, streaming music on the phone. As you move, your phone switches from one cell tower to the next to maintain connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequencies in Wireless Communications
&lt;/h2&gt;

&lt;p&gt;As mentioned earlier, wireless communications utilize radio waves to enable devices to connect and communicate with each other. These radio waves are emitted at specific frequencies, known as oscillation rates, which are measured in hertz (Hz). Common frequency bands for wireless networks include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frequency Bands&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;2.4 GHz (Gigahertz) – Used by older Wi-Fi standards (802.11b/g/n). Better at penetrating walls, but can be more prone to interference (e.g., microwaves, Bluetooth).&lt;/li&gt;
&lt;li&gt;5 GHz – Used by newer Wi-Fi standards (802.11a/n/ac/ax). Faster speeds, but shorter range.&lt;/li&gt;
&lt;li&gt;Cellular Bands – For 4G (LTE) and 5G. These range from lower frequencies (700 MHz) to mid-range (2.6 GHz) and even higher frequencies for some 5G services (up to 28 GHz and beyond).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Different frequencies play crucial roles in wireless communication due to their varying characteristics and the trade-offs between range and speed. Lower frequencies tend to travel farther but are limited in the amount of data they can carry, making them suitable for broader coverage with less data demand. In contrast, higher frequencies, while capable of carrying more data, have a much shorter range. Additionally, frequency bands can get congested as many devices operate on the same frequencies, leading to interference that degrade performance. To manage and mitigate these issues, government agencies (such as the FCC in the United States) regulate frequency allocations, ensuring orderly use of the airwaves and preventing interference among users.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Internet Architecture</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Sun, 10 May 2026 04:09:56 +0000</pubDate>
      <link>https://dev.to/hirave_palak/internet-architecture-5bka</link>
      <guid>https://dev.to/hirave_palak/internet-architecture-5bka</guid>
      <description>&lt;p&gt;Internet Architecture describes how data is organized, transmitted, and managed across networks. Different architectural models serve different needs, some offer a straightforward client-server setup (like a website), while others rely on a more distributed approach (like file-sharing platforms). &lt;/p&gt;

&lt;h2&gt;
  
  
  Peer-to-Peer (P2P) Architecture
&lt;/h2&gt;

&lt;p&gt;This is when computers and devices are linked directly to each other without the need for a central server. This system can be fully decentralised or partially centralized as the server does some tasks but doesn't host any of the data. This setup allows nodes to communicate directly with each other, sharing resources such as files, processing power, or bandwidth, without the need for a central server. &lt;/p&gt;

&lt;p&gt;For example, three friends finished college and want to share their college photos with eachother. Instead of uploading all the photos to a single website or server, each of them sets up a folder on their own computer that can be accessed by the others. They use a file-sharing program that connects their computers directly.&lt;/p&gt;

&lt;p&gt;First, they install a Peer-to-Peer (P2P) file-sharing application on their computer and then select the folder containing the photos to share with the other friends. Everyone preforms the same setup on their computers and once everyone is connected though the P2P application, they can all browse and download photos directly from the other's shared folders. This allows for a direct exchange of files without the need for a central server.&lt;/p&gt;

&lt;p&gt;A popular example of Peer-to-Peer (P2P) architecture is torrenting, as seen with applications like BitTorrent. In this system, anyone who has the file, referred to as a seeder, can upload it, allowing others to download it from multiple sources simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability - Adding more nodes can increase total resources (storage, CPU, etc.).&lt;/li&gt;
&lt;li&gt;Resilience - If one node goes offline, others can continue functioning.&lt;/li&gt;
&lt;li&gt;Cost distribution - Resource burden, like bandwidth and storage, is distributed among peers, making it more cost-efficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Management complexity - Harder to control and manage updates/security policies across all nodes&lt;/li&gt;
&lt;li&gt;Potential reliability issues - If too many peers leave, resources could be unavailable.&lt;/li&gt;
&lt;li&gt;Security challenges - Each node is exposed to potential vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Client-Server Architecture
&lt;/h2&gt;

&lt;p&gt;This model is one of the most widely used architectures on the Internet. Clients(user devices) send requests, such as a web browser asking for a webpage, and the severs then respond to these requests, like a web server hosting that webpage. This model typically involves centralized servers where data and applications reside, with multiple clients connecting to these servers to access services and resources.&lt;/p&gt;

&lt;p&gt;Say, you want to check the weather forecast on a website. You start by opening the web browser on you phone or computer, and proceed to type in the website's name, e.g., weather.com. When we press enter, the browser sends a request over the Internet to the server that hosts weather.com. This server, a powerful computer set up specifically to store the website’s data and handle requests, receives the query and processes it by locating the requested page. It then sends back the data (regarding the request) to our browser, which receives this information and displays the webpage, allowing us to see the latest weather updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single-Tier Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a single-tier architecture, the client, server, and database all reside on the same machine. This setup is straightforward but is rarely used for large-scale applications due to significant limitations in scalability and security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two-Tier Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The two-tier architecture splits the application environment into a client and a server. The client handles the presentation layer, and the server manages the data layer. This model is typically seen in desktop applications where the user interface is on the user's machine, and the database is on a server. Communication usually occurs directly between the client and the server, which can be a database server with query-processing capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three-Tier Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A three-tier architecture introduces an additional layer between the client and the database server, known as the application server. In this model, the client manages the presentation layer, the application server handles all the business logic and processing, and the third tier is a database server. This separation provides added flexibility and scalability because each layer can be developed and maintained independently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;N-Tier Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In more complex systems, an N-tier architecture is used, where N refers to any number of separate tiers used beyond three. This setup involves multiple levels of application servers, each responsible for different aspects of business logic, processing, or data management. N-tier architectures are highly scalable and allow for distributed deployment, making them ideal for web applications and services that demand robust, flexible solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Centralized control - Easier to manage and update.&lt;/li&gt;
&lt;li&gt;Security - Central security policies can be applied.&lt;/li&gt;
&lt;li&gt;Performance -Dedicated servers can be optimized for their tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single point of failure - If the central server goes down, clients lose access.&lt;/li&gt;
&lt;li&gt;High Cost and Maintenance - Setting up and sustaining a client-server architecture is expensive, requiring constant operation and expert management , making it costly to maintain.&lt;/li&gt;
&lt;li&gt;Network Congestion - High traffic on the network can lead to congestion, slowing down or even disrupting connections when too many clients access the server simultaneously.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hybrid Architecture
&lt;/h2&gt;

&lt;p&gt;A Hybrid model blends elements of both Client-Server and Peer-to-Peer (P2P) architectures. In this setup, central servers are used to facilitate coordination and authentication tasks, while the actual data transfer occurs directly between peers. This combination leverages the strengths of both architectures to enhance efficiency and performance.&lt;/p&gt;

&lt;p&gt;For example, when you open a video confrencing app(eg. Zoom) and log in, the username and password are verified by central servers, which also manage the session by co-ordinating who is in the meeting and controlling access. Once you are logged in and the meeting begins, the video and audio data is transferred directly between your device and other's, bypassing the central server. This reduces lag and enchances the video quality. By using the central server for initial connection and control tasks, while the bulk of data transfer occurs in a peer-to-peer style, you can reduce the server load and leverage direct, fast connections between peers. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Efficiency - Relieves workload from servers by letting peers share data.&lt;/li&gt;
&lt;li&gt;Control - Central server can still manage user authentication, directory services, or indexing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantage&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex Implementation - Requires more sophisticated design to handle both centralized and distributed components.&lt;/li&gt;
&lt;li&gt;Potential Single Point of Failure - If the central coordinating server fails, peer discovery might stop.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cloud Architecture
&lt;/h2&gt;

&lt;p&gt;Cloud Architecture refers to computing infrastructure that is hosted and managed by third-party providers, such as AWS, Azure, and Google Cloud. This architecture operates on a virtualized scale following a client-server model. It provides on-demand access to resources such as servers, storage, and applications, all accessible over the Internet. In this model, users interact with these services without controlling the underlying hardware.&lt;/p&gt;

&lt;p&gt;Services like Google Drive or Dropbox are some examples of Cloud Architecture operating under the SaaS (Software as a Service) model, where we access applications over the internet without managing the underlying hardware. Below are five essential characteristics that define a Cloud Architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Characteristic&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On-demand self-service - Automatically set up and manage the services without human help.&lt;/li&gt;
&lt;li&gt;Broad network access - Access services from any internet-connected device.&lt;/li&gt;
&lt;li&gt;Resource pooling - Share and allocate service resources dynamically among multiple users.&lt;/li&gt;
&lt;li&gt;Rapid elasticity - Quickly scale services up or down based on demand.&lt;/li&gt;
&lt;li&gt;Measured service - Only pay for the resources you use, tracked with precision.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability - Easily add or remove computing resources as needed.
-Reduced cost &amp;amp; maintenance - Hardware managed by the cloud provider.
-Flexibility - Access services from anywhere with Internet connectivity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vendor lock-in - Migrating from one cloud provider to another can be complex.&lt;/li&gt;
&lt;li&gt;Security/Compliance - Relying on a third party for data hosting can introduce concerns about data privacy.&lt;/li&gt;
&lt;li&gt;Connectivity - Requires stable Internet access.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Software-Defined Architecture (SDN)
&lt;/h2&gt;

&lt;p&gt;Software-Defined Networking (SDN) is a modern networking approach that separates the control plane, which makes decisions about where traffic is sent, from the data plane, which actually forwards the traffic. Traditionally, network devices like routers and switches housed both of these planes. However, in SDN, the control plane is centralized within a software-based controller. This configuration allows network devices to simply execute instructions they receive from the controller. SDN provides a programmable network management environment, enabling administrators to dynamically adjust network policies and routing as required. This separation makes the network more flexible and improves how it's managed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Centralized control - Simplifies network management.&lt;/li&gt;
&lt;li&gt;Programmability &amp;amp; Automation - Network configurations can be changed quickly through software instead of manually configuring each device.&lt;/li&gt;
&lt;li&gt;Scalability &amp;amp; Efficiency - Can optimize traffic flows dynamically, leading to better resource utilization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Controller Vulnerability - If the central controller goes down, the network might be adversely affected.&lt;/li&gt;
&lt;li&gt;Complex Implementation - Requires new skill sets and specialized software/hardware.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Domain Name System DNS</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Sun, 10 May 2026 02:57:36 +0000</pubDate>
      <link>https://dev.to/hirave_palak/domain-name-system-dns-8bh</link>
      <guid>https://dev.to/hirave_palak/domain-name-system-dns-8bh</guid>
      <description>&lt;p&gt;It helps us find an IP adress for a given name(eg. &lt;a href="http://www.dev.to"&gt;www.dev.to&lt;/a&gt;) &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain Name - A readable address like &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; that people can easily remember&lt;/li&gt;
&lt;li&gt;IP Address - A numerical label (e.g., 93.184.216.34)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It helps us so that rather than remebering a series of numbers, we can simply type in the name of the website we want and have it convert that into the IP address. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS Hierarchy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Root servers - top of the hierarchy&lt;br&gt;
Top-Level Domains (TLDs) - eg. .com, .to, .org, .net or country codes like .uk and .de &lt;br&gt;
Second-Level Domains -  example in example.com or dev in dev.com&lt;br&gt;
Subdomains/Hostname - eg. www in &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; or accounts in accounts.google.com&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.example.com/home.html" rel="noopener noreferrer"&gt;https://www.example.com/home.html&lt;/a&gt; . &lt;/p&gt;

&lt;p&gt;https - Scheme &lt;br&gt;
www - Subdomain &lt;br&gt;
example - Second-Level Domain &lt;br&gt;
.com - TLD &lt;br&gt;
home.html - Page Name &lt;br&gt;
. - Root &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS Resolution Process (Domain Translation)&lt;/strong&gt;&lt;br&gt;
Step 1  - We type &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; into our browser.&lt;/p&gt;

&lt;p&gt;Step 2  - Our computer checks its local DNS cache (a small storage area) to see if it already knows the IP address.&lt;/p&gt;

&lt;p&gt;Step 3  - If not found locally, it queries a recursive DNS server. This is often provided by our Internet Service Provider or a third-party DNS service like Google DNS.&lt;/p&gt;

&lt;p&gt;Step 4  - The recursive DNS server contacts a root server, which points it to the appropriate TLD name server (such as the .com domains, for instance).&lt;/p&gt;

&lt;p&gt;Step 5  - The TLD name server directs the query to the authoritative name server for example.com.&lt;/p&gt;

&lt;p&gt;Step 6  - The authoritative name server responds with the IP address for &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Step 7  - The recursive server returns this IP address to your computer, which can then connect to the website’s server directly.&lt;/p&gt;

&lt;p&gt;DNSs are useful as it enables us to just type in the website we want rather than trying to remember a string of IP addresses. The DNS will automatically find and translate the domain name into the correct IP address. &lt;/p&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Network Address Translation (NAT)</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Sun, 03 May 2026 04:51:33 +0000</pubDate>
      <link>https://dev.to/hirave_palak/network-address-translation-nat-592m</link>
      <guid>https://dev.to/hirave_palak/network-address-translation-nat-592m</guid>
      <description>&lt;p&gt;As we have talked about before, the Internet relies on numerical addresses, IP addresses to route data from one device to another. IPv4 offers around 4.3 billion addresses, we have discussed that that is not enough. While there is IPv6, another solution to this issue is through Network Address Translation (NAT)&lt;/p&gt;

&lt;p&gt;NAT allows multiple devices on a private network to share a single public IP address. This not only helps conserve the limited pool of public IP addresses but also adds a layer of security to the internal network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Private vs. Public IP Addresses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Public IP addresses are globally unique identifiers that are assigned by Internet Service Providers (ISPs). Devices with these IP addresses can be accessed from anywhere on the Internet, allowing them to communicate across the global network. &lt;/p&gt;

&lt;p&gt;On the other hand, private IP addresses are designated for use within local networks such as homes, offices and schools. These are not routable on the global internet, so they cannot be forwarded by internet backbone routers. Defined by RFC 1918, common IPv4 private address ranges include 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. This setup ensures that these private networks operate independently of the internet while facilitating internal communication and device connectivity.&lt;/p&gt;

&lt;p&gt;Private IP addresses contribute to conserving public IP addresses. Using Network Address Translation (NAT), a local network can utilize private IP addresses while sharing a single public IP address, reducing the number of public IPs needed. This setup makes devices accessible from the internet without using multiple public addresses. Additionally, private IPs help secure the network by isolating internal devices from direct exposure to the internet, protecting them from potential external threats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Network Address Translation (NAT) is a process carried out by a router or a similar device that modifies the source or destination IP address in the headers of IP packets as they pass through. This modification is used to translate the private IP addresses of devices within a local network to a single public IP address that is assigned to the router.&lt;/p&gt;

&lt;p&gt;For example, say that your home network has a few devices, laptop, smartphone, tablet and a smart thermostat. All of these have their own private IP addresses which they can use to connect to eachother. But when, suppose the laptop wants to access a DNS Server on the internet, it will need a public IP address. As the packet passes though the router, the router will change the private IP address into a public one. This public IP address is the same for all of the devices in the network. As the response arrives, the router's NAT table, which keeps track of IP mappings, identifies that 203.0.113.50:4444 corresponds to the laptop at 192.168.1.10:5555 (ports 4444 and 5555 are dynamic).  All of this is done by the NAT process. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of NAT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Static NAT - Involves a one-to-one mapping, where each private IP address corresponds directly to a public IP address.&lt;/p&gt;

&lt;p&gt;Dynamic NAT - Assigns a public IP from a pool of available addresses to a private IP as needed, based on network demand.&lt;/p&gt;

&lt;p&gt;Port Address Translation (PAT) - Also known as NAT Overload, is the most common form of NAT in home networks. Multiple private IP addresses share a single public IP address, differentiating connections by using unique port numbers. This method is widely used in home and small office networks, allowing multiple devices to share a single public IP address for internet access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits and Trade-Offs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Benefits&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conserves the limited IPv4 address space.&lt;/li&gt;
&lt;li&gt;Provides a basic layer of security by not exposing internal network structure directly.&lt;/li&gt;
&lt;li&gt;Flexible for internal IP addressing schemes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trade-Offs&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex services like hosting a public server behind NAT can require additional configuration (e.g., port forwarding).&lt;/li&gt;
&lt;li&gt;NAT can break certain protocols that rely on end-to-end connectivity without special handling.&lt;/li&gt;
&lt;li&gt;Adds complexity to troubleshooting connectivity issues.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DHCP - What is it?</title>
      <dc:creator>Palak Hirave </dc:creator>
      <pubDate>Sun, 03 May 2026 04:18:45 +0000</pubDate>
      <link>https://dev.to/hirave_palak/dhcp-what-is-it-5a20</link>
      <guid>https://dev.to/hirave_palak/dhcp-what-is-it-5a20</guid>
      <description>&lt;p&gt;DHCP stands for Dynamic Host Configuration Protocol. Rather than manually assigning IP addresses to devices when they join the network, DHCP does this on its own. Once a new device connects to the network, the DHCP is responsible for assigning in network configuration parameters such as subnet mask, default gateway, DNS servers, and an IP address. This saves time and effort as you do not have someone manually doing this every time a device joins the network. It also prevents human error. DHCP's recycle IP addresses when they are done being used. Eg. device has left the network, so its IP address is assigned to another device who needs one. &lt;/p&gt;

&lt;p&gt;DHCP works via interactions between the server and client. &lt;/p&gt;

&lt;p&gt;DHCP Server : A network device (router/dedicated server) that manages IP address allocation. It maintains a pool of available IP addresses and configuration parameters.&lt;/p&gt;

&lt;p&gt;DHCP Client : Any device that connects to the network and requests network configuration parameters from the DHCP server.&lt;/p&gt;

&lt;p&gt;You can use the acronym, DORA to remember how the process works. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Discover &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When a device first connects to the network, it figures out where the DHCP Servers are located. It does this by broadcasting a DHCP Discover message. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Offer &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A DHCP Server on the network sees this message and responds with an DHCP Offer message, which offers the client an IP address and lease. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Request &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The client receives this message and responds with a DHCP Request message. This says that the client has accepted the given IP address and lease. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Acknowledgement&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The server sends a DHCP Acknowledgement message which confirms that the client has been given an IP address, the client can start using this IP address to communicate on the network. &lt;/p&gt;

&lt;p&gt;Now the device doesn't get to keep this lease and IP address forever. When the DHCP assigns the lease, it has been given with a certain amount of time, say 24 hours, and once that time is up the lease ends and you can no longer connect till you get a new one. You also lose your IP address as you will not be considered as part of the network. So, once the lease is coming to an end, the device sends out a DHCP Request, saying that its lease needs to be renewed and to continue with the same IP address. If possible, the DHCP responds with an DHCP Acknowledgement message saying that the lease has been renewed. &lt;/p&gt;

&lt;p&gt;A simple example would be that Rebecca wants to connect to her office's network with a new device. The first thing the device will have to do in order to connect is send a DHCP Discover message. Once a DHCP Server sees it, it will respond with a DHCP Offer containing a lease and the IP address(e.g. 192.168.3.64). The device then accepts it with a DHCP Request message and the server responds with a DHCP Acknowledgement message. Once the time on the lease is starting to finish, the device sends another DHCP Request message in order to continue using it as well as the IP address. &lt;/p&gt;

</description>
      <category>networking</category>
      <category>learning</category>
      <category>beginners</category>
      <category>network</category>
    </item>
  </channel>
</rss>
