<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajaelbahraouy on Medium]]></title>
        <description><![CDATA[Stories by Rajaelbahraouy on Medium]]></description>
        <link>https://medium.com/@rajaelbahraouy?source=rss-643563a10c3c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nwCp9yXwoDY1OnWHYjkwBg.jpeg</url>
            <title>Stories by Rajaelbahraouy on Medium</title>
            <link>https://medium.com/@rajaelbahraouy?source=rss-643563a10c3c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:16:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajaelbahraouy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OverTheWire Bandit — Complete Write-Up: 12 Levels to Get Started in Cybersecurity]]></title>
            <link>https://medium.com/@rajaelbahraouy/overthewire-bandit-complete-write-up-12-levels-to-get-started-in-cybersecurity-6026bbdf56cc?source=rss-643563a10c3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6026bbdf56cc</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[overthewire]]></category>
            <category><![CDATA[linux-cybersecurity]]></category>
            <category><![CDATA[beginner-friendly]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Rajaelbahraouy]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 16:21:08 GMT</pubDate>
            <atom:updated>2026-04-06T16:39:33.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*GPeuRMLgPH96MUyd01caLA.png" /></figure><blockquote><em>A step-by-step walkthrough of Levels 0 to 11 of the famous Bandit wargame, with explained commands and terminal screenshots.</em></blockquote><h4><strong><em>Introduction — What is OverTheWire Bandit?</em></strong></h4><p>If you’re just getting started in cybersecurity and looking for a serious but accessible training ground, OverTheWire Bandit is made for you.<br>Bandit is a free online wargame hosted at overthewire.org. The concept is simple: you connect to a remote Linux server via SSH, and each level challenges you to find a hidden password using Linux commands. Every password you find unlocks the next level.<br>It is the perfect entry point to learn:<br><strong>·</strong> Fundamental Linux commands<br>· File system navigation<br>· Text processing tools<br>· Basics of cryptography and encoding<br>In this write-up, I’ll walk you through the first 12 levels (0 to 11), with the commands used, traps to avoid, and key concepts to remember.</p><p>⚙ <strong>Prerequisites</strong><br>You will need an SSH client:<br>· Linux / macOS: the native terminal is enough<br>· Windows: use Git Bash, PuTTY, or Windows Terminal<br>The base connection to the Bandit server:<br>Host : bandit.labs.overthewire.org<br>Port : 2220</p><h3><strong>Level 0 — Connecting via SSH</strong></h3><p><strong><em>Goal : </em></strong>The goal of Level 0 is simply to connect to the server. Both the username and password are bandit0.<br><strong><em>Command : </em></strong>ssh bandit0@bandit.labs.overthewire.org -p 2220</p><p>When the terminal asks “Are you sure you want to continue connecting?”, type yes. Then enter the password: bandit0.<br><strong><em> Key Concept — SSH</em></strong><br>SSH (Secure Shell) is a secure and encrypted remote connection protocol. The basic syntax is:<br>ssh &lt;username&gt;@&lt;host&gt; -p &lt;port&gt;</p><h3><strong>Level 0 → 1 — Reading a Basic File</strong></h3><p><strong><em>Goal : </em></strong>The password for the next level is stored in a file called readme in the home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*1xVrovrvJ34jG-VCnm59HA.png" /></figure><p><strong><em>Command :</em></strong></p><p>ls<br> cat readme</p><p><strong>* Key Concept</strong></p><blockquote><strong><em>ls </em></strong>: List files in the current directory</blockquote><blockquote><strong><em>cat &lt;file&gt;</em></strong> : Display the content of a file</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*Ds6Cm0owuFRfS65B9Zg5FQ.png" /></figure><h3><strong>Level 1 → 2 — File With a Special Name (</strong>-<strong>)</strong></h3><p><strong><em>Goal : </em></strong>The password is stored in a file named — (a single dash).</p><p><strong>⚠ The Trap !</strong></p><blockquote>cat — does <strong>not</strong> work: the command interprets the dash as stdin (keyboard input) and the terminal <strong>freezes</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*IcjJJqZGvw2C_6ry4GQV9A.png" /></figure><p><strong><em>Command :</em></strong></p><p><strong>ls</strong><br> # Does NOT work — terminal freezes<br><strong> <em>cat -</em></strong><br> <br> # ✓ Solution — prefix with ./<br><strong> <em>cat ./-</em></strong></p><p>The ./ explicitly tells cat “this file in the current directory”, so it treats it as a filename, not an option flag.</p><blockquote><strong>Key Concept :</strong></blockquote><p>For any file whose name starts with -, prefix it with ./:</p><p>cat ./- # ✓<br> cat &lt; - # ✓ alternative</p><h3><strong>Level 2 → 3 — File With Spaces in the Name</strong></h3><p><strong><em>Goal : </em></strong>The password is stored in a file named spaces in this filename.</p><p><strong>⚠ The Trap !</strong></p><blockquote>cat spaces in this filename looks for <strong>4 separate files</strong> split by spaces — none of which exist.</blockquote><p><strong><em>Command :</em></strong></p><p># Does NOT work<br><em>cat spaces in this filename </em><strong><em>or </em></strong><em>cat “- -spaces in this filename- -” </em><strong><em>or </em></strong>cat spaces\ in\ this\ filename<br> <br> # ✓ Solution :<br>cat - - “- -spaces in this filename- -“</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*binZA75WRVH_0xzqVHtZbg.png" /><figcaption><em>Result of cat- -“- -spaces in this filename- -“ — the password </em><strong><em>MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx</em></strong><em> is displayed, followed by a successful connection to the next level.</em></figcaption></figure><blockquote><strong>Key Concept :</strong></blockquote><p>Spaces in filenames require either <strong>quotes</strong> or <strong>backslash escaping</strong>:</p><p>cat “my file” # <em>double quotes</em><br> cat ‘my file’ # <em>single quotes</em><br> cat my\ file # <em>backslash escape</em></p><h3><strong>Level 3 → 4 — Hidden File</strong></h3><p><strong><em>Goal : </em></strong>The password is stored in a <strong>hidden file</strong> inside the inhere directory.</p><p><strong>⚠ The Trap!</strong></p><p>In Linux, any file whose name starts with . is <strong>invisible</strong> with a regular ls.</p><p><strong><em>Command :</em></strong></p><p>ls <em># shows only “inhere</em>”<br> cd inhere<br> ls <em># looks empty!</em><br> ls -a<em> # shows EVERYTHING, including hidden files</em><br> cat …Hiding-From-You</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*trc92hS2G5iuQ2gAZEog7w.png" /><figcaption><em>The sequence is clear — ls inside inhere looks empty, then ls -a reveals the hidden file …Hiding-From-You, and cat displays the password </em><strong><em>2WmrDFRmJIq3IPxneAaMGhap0pFhF3NJ.</em></strong></figcaption></figure><p><strong>Key Concept :</strong></p><p><strong>ls -a</strong> <em># shows ALL files, including those starting with “.”</em><br> <strong>ls -la</strong> <em># same + details (permissions, size, date, owner)</em></p><h3><strong>Level 4 → 5 — Finding the Only Human-Readable File</strong></h3><p><strong><em>Goal: </em></strong>Among 10 files in inhere (named -file00 to -file09), only one contains text readable by a human.</p><p><strong>⚠ The Trap!</strong></p><blockquote>Files have names starting with — (same issue as Level 1) and most contain <strong>binary data</strong> — unreadable garbage.</blockquote><p><strong><em>Command :</em></strong></p><p>cd inhere<br> ls -a<br> file ./-* <em># identifies the type of each file</em><br> cat ./-file07 <em># the only “ASCII text” one</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*dQw2scnUgsn3j9UUi937Fg.png" /><figcaption><em>file ./-* reveals that all files are data (binary) except ./-file07 which is ASCII text. Running cat ./-file07 displays the password </em><strong><em>4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw</em></strong><em>.</em></figcaption></figure><p><strong>Key Concept — </strong>file</p><p>file &lt;filename&gt; <em># identifies the true type of a file</em><br> file ./* <em># applies to all files in the folder</em></p><p><em>ASCII text = human-readable. data = binary. The file command ignores extensions and analyzes the actual content.</em></p><h3><strong>Level 5 → 6 — Property-Based Search With </strong>find</h3><p><strong><em>Goal: </em></strong>The target file is somewhere in the inhere directory tree and has these 3 properties: <strong>human-readable</strong>, <strong>1033 bytes</strong>, <strong>not executable</strong>.</p><p><strong>⚠ The Trap!</strong></p><p>There are 20 subdirectories (maybehere00 to maybehere19), each containing multiple files. Manually inspecting all of them is impossible.</p><p><strong><em>#Commands:</em></strong></p><p>cd inhere<br> ls<em> # 20 directories!</em><br> find . -type f -readable ! -executable -size 1033c<br> cat ./maybehere07/.file2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mg0CNzTOhvEPwyWGBKGCZg.png" /><figcaption><em>The 20 maybehere directories are visible, then the find command with all its criteria pinpoints ./maybehere07/.file2 immediately. cat reveals the password HWasnPhtq9AVKe0dmk45nxy20cvUa6EG.</em></figcaption></figure><p><strong>Key Concept — </strong>find</p><p>find . -type f <em># search files only (not directories)</em><br> find . -size 1033c <em># exact size in bytes (c = bytes)</em><br> find . -readable <em># files readable by the current user</em><br> find . ! -executable <em># NOT executable (! = negation)</em></p><h3><strong>Level 6 → 7 — Server-Wide Search + Silencing Errors</strong></h3><p><strong><em>Goal :</em></strong>The file is <strong>somewhere on the entire server</strong> (not just the home directory), owned by user: bandit7, group: bandit6, size 33 bytes.</p><p><strong>⚠ The Trap!</strong></p><blockquote>find / generates <strong>hundreds of “Permission denied” errors</strong> that drown out the real result.</blockquote><p><strong><em>Command :</em></strong></p><p><strong>Step 1 — without filtering errors (chaos):</strong></p><p>find / -user bandit7 -group bandit6 -size 33c</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*TNkHgM7QrtccoUYkJfVJgg.png" /><figcaption>find / -user bandit7 -group bandit6 -size 33c →<strong>without filtering errors (chaos)</strong></figcaption></figure><p><strong>Step 2 — with error redirection:</strong></p><p>find / -user bandit7 -group bandit6 -size 33c 2&gt;/dev/null</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*mhejar0WY6jS6x6jEkV6hA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Z162VJXHT_Jzjo9KyLKYtw.png" /><figcaption><em>Clean output of find / -user bandit7 -group bandit6 -size 33c 2&gt;/dev/null → /var/lib/dpkg/info/bandit7.password, then cat reveals the password morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj.</em></figcaption></figure><p><strong>Key Concept — Error Redirection</strong></p><p>2&gt;/dev/null # redirects stderr (error stream) to /dev/null (“the trash”)<br> # 2 = stderr, &gt; = redirect, /dev/null = Linux black hole</p><blockquote><em>This trick is </em><strong><em>essential</em></strong><em> in Linux to get clean output when running system-wide searches.</em></blockquote><h3><strong>Level 7 → 8 — </strong>grep<strong> and the Pipe </strong>|</h3><p><strong><em>Goal: </em></strong>The password is in data.txt, <strong>next to the word “millionth”</strong>. The file contains tens of thousands of lines.</p><p><strong>⚠ The Trap !</strong></p><blockquote>cat data.txt scrolls through a wall of text — completely unusable.</blockquote><p><strong><em>Command :</em></strong></p><p># Useless — thousands of lines<br> cat data.txt<br> <br> #✓ Filter with grep<br> grep “millionth” data.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/187/1*i5PNv0pR7C0JaYGAzKSwXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*TX8t_BEELDFbPzFdQKTgEQ.png" /><figcaption><em>data.txt contains thousands of word/password pairs — the raw output is overwhelming and unworkable.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*8C1WM78DGtZ15sPNH3n78Q.png" /><figcaption><em>Caption: After ^C to stop the output, grep “millionth” data.txt returns a single line with the password dfwvzFQi4mU0wfNbFOe9RoWskMLg7eEc.</em></figcaption></figure><p><strong>Key Concept — </strong>grep<strong> and </strong>|</p><p>grep “word” file <em># finds lines containing “word”</em><br> cat file | grep “word” <em># equivalent using the pipe</em></p><p><em>The </em><strong><em>pipe</em></strong><em> | is one of the most powerful concepts in Linux — it chains commands by passing the output of one as the input of the next.</em></p><h3><strong>Level 8 → 9 — </strong>sort<strong> + </strong>uniq<strong>: Finding the Unique Line</strong></h3><p><strong><em>Goal: </em></strong>The password is the <strong>only line that appears exactly once</strong> in data.txt.</p><p><strong>⚠ The Trap!</strong></p><blockquote>uniq only works on <strong>adjacent lines</strong>. You must sort the file first with sort to group identical lines before filtering.</blockquote><p><strong><em>Command :</em></strong></p><p># × uniq alone — doesn’t work, lines are not sorted<br> uniq data.txt<br> <br> # × sort alone — sorts but doesn’t remove duplicates<br> sort data.txt<br> <br> #✓ The winning combination<br> sort data.txt | uniq -u</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*UuEhbs_4wsdqdH7PgHLZ6A.png" /><figcaption><em>uniq data.txt still shows hundreds of lines because identical lines are not adjacent.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*3ShRgomvLA87tVEA_6ui9A.png" /><figcaption><em>The end of uniq output, then sort data.txt begins — the intermediate step before the final solution.</em></figcaption></figure><p><strong>Key Concept — </strong>sort<strong> + </strong>uniq :</p><p>sort file <em># sorts lines alphabetically</em><br> uniq -u file<em> # prints ONLY lines that appear exactly once</em><br> sort file | uniq -u <em># perfect combo: sort then isolate the unique line</em></p><h3><strong>Level 9 → 10 — </strong>strings<strong> on a Binary File</strong></h3><p><strong><em>Goal</em>: </strong>The password is in data.txt among the few human-readable strings, <strong>preceded by several = characters</strong>. The file contains binary data.</p><p><strong>⚠ The Trap!</strong></p><blockquote>cat data.txt displays unreadable binary garbage. You need to extract only the readable text strings.</blockquote><p><strong><em>Command :</em></strong></p><p># Unreadable binary output<br> cat data.txt<br> <br> # Extract readable strings and filter by “=”<br> strings data.txt | grep “=”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*rWy07ViDDUe21yBnAeHArg.png" /><figcaption><em>Connecting to bandit9 — ready for the level.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*gZ1Y6h8SBOXxdVlC6-VP7A.png" /><figcaption><em>cat data.txt outputs pure binary — completely unreadable.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*h6lMfN1Be35s6i4Tqv5Asg.png" /><figcaption><em>strings data.txt | grep “=” cleanly filters and reveals ========== password, ========== is, ========== FGUW5illVJrxX9kMYMmlN4MgbpfMiqey — the password is </em><strong><em>FGUW5illVJrxX9kMYMmlN4MgbpfMiqey</em></strong><em>.</em></figcaption></figure><p><strong>Key Concept — </strong>strings</p><p>strings file # extracts all readable text strings from a binary<br> strings file | grep X # filters among those strings</p><p><em>strings is widely used in </em><strong><em>reverse engineering</em></strong><em> and </em><strong><em>digital forensics</em></strong><em> to analyze binary files and executables.</em></p><h3><strong>Level 10 → 11 — Base64 Decoding</strong></h3><p><strong><em>Goal</em>: </strong>The password is in data.txt, encoded in <strong>Base64</strong>.</p><p><strong><em>Command :</em></strong></p><p>cat data.txt <em># shows a long string ending with “==”</em><br> base64 -d data.txt <em># decodes it</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*5fKIrJlvAi7FQDYhuqYZow.png" /><figcaption><em>cat data.txt shows the Base64 string VGhlIHBhc3N3b3JkIGlzIGR0UjE3M2ZaS2IwUlJzREZTR3NnMlJXbnBOVmozcVJyCg==. Running base64 -d data.txt decodes it and reveals The password is </em><strong><em>dtR173fZKb0RRsDFSGsg2RWnpNVj3qRr</em></strong><em>. Followed by a successful connection to bandit11.</em></figcaption></figure><p><strong>Key Concept — Base64</strong></p><p>Base64 is <strong>encoding</strong>, not encryption — anyone can decode it instantly. It’s used to transport binary data as text.</p><p>base64 -d file # <em>decode a Base64 file</em><br> echo “string==” | base64 -d # <em>decode a string directly</em></p><p><em>Identification tip: a Base64 string often ends with = or ==.</em></p><h3><strong>Level 11 → 12 — ROT13 Decoding</strong></h3><p><strong><em>Goal : </em></strong>The password is in data.txt, where all letters have been <strong>shifted by 13 positions</strong> in the alphabet — the ROT13 cipher.</p><p><strong>What is ROT13?</strong></p><p>ROT13 is a simple substitution cipher:</p><p>A→N B→O C→P … M→Z<br> N→A O→B P→C … Z→M</p><p>Since the alphabet has 26 letters, applying ROT13 <strong>twice</strong> returns the original text.</p><p><strong><em>Command :</em></strong></p><p>cat data.txt <em># Shows: “Gur cnffjbeq vf 7k16JAr…” — almost readable but shifted!</em><br> <br> cat data.txt | tr ‘A-Za-z’ ‘N-ZA-Mn-za-m’ <em># Shows: “The password is 7x16WNeHIi5YkIhWsfFIqoognUTyj9Q4”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*erW0laQ000Xu7ZlnUUyMKA.png" /><figcaption><em>cat data.txt shows Gur cnffjbeq vf 7k16JArUVv5LxVuJfsSVdbbtaHGlw9D4 (ROT13 encoded). The command cat data.txt | tr ‘A-Za-z’ ‘N-ZA-Mn-za-m’ decodes it and returns The password is </em><strong><em>7x16WNeHIi5YkIhWsfFIqoognUTyj9Q4</em></strong><em>. Followed by a successful connection to bandit12.</em></figcaption></figure><p><strong>Key Concept — </strong>tr<strong> (translate)</strong></p><p>tr ‘SET1’ ‘SET2’ <em># replaces each char in SET1 with corresponding char in SET2</em><br> tr ‘A-Za-z’ ‘N-ZA-Mn-za-m’ # <em>full ROT13 (uppercase + lowercase</em>)</p><blockquote><em>ROT13 was historically used in forums to hide spoilers. Today it’s a CTF classic for introducing substitution ciphers — weak but educational.</em></blockquote><h3><strong>** Summary of All 12 Levels</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*VA21YU55EEWBHIwJWlGrhg.png" /></figure><h3><strong># Conclusion </strong><em>💬</em></h3><p>In just 12 levels, Bandit walked you through concepts that appear in real-world cybersecurity scenarios:</p><ul><li><strong>Advanced Linux navigation</strong> (ls -a, cd, find)</li><li><strong>Command-line text processing</strong> (cat, grep, sort, uniq, strings, tr)</li><li><strong>Encoding vs Encryption</strong> (Base64 ≠ encryption, ROT13 = weak cipher)</li><li><strong>System error handling</strong> (2&gt;/dev/null)</li><li><strong>Pipes</strong> and command chaining (|)</li></ul><p>These tools form the <strong>essential toolkit</strong> of any pentester, security analyst, or system administrator.</p><p><em>What’s next? Levels 12 and beyond dive into </em><strong><em>recursive decompression</em></strong><em>, </em><strong><em>SSH keys</em></strong><em>, </em><strong><em>network ports</em></strong><em>, and </em><strong><em>cronjobs</em></strong><em> — getting closer and closer to real-world attack scenarios.</em></p><p><em>Write-up completed as part of a cybersecurity lab assignment — OverTheWire Bandit is available for free at </em><a href="https://overthewire.org/wargames/bandit/"><em>overthewire.org.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6026bbdf56cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSI Model Explained: The 7 Layers of Networking]]></title>
            <link>https://medium.com/@rajaelbahraouy/osi-model-explained-the-7-layers-of-networking-885420e5603e?source=rss-643563a10c3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/885420e5603e</guid>
            <category><![CDATA[osi-model-explained]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Rajaelbahraouy]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 15:06:03 GMT</pubDate>
            <atom:updated>2026-03-14T17:41:22.024Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCzGe93N6yje5gDjkEMPZA.png" /></figure><h3>What Is the OSI Model?</h3><p>OSI stands for Open Systems Interconnection. It is a conceptual reference model published by the International Organization for Standardization (ISO) in 1984. Its purpose was to define a universal standard for how different computer systems communicate over a network, regardless of their vendor, hardware, or operating system.</p><p>The model divides the communication process into seven distinct layers. Each layer has a specific role and communicates only with the layers directly above and below it. This separation of concerns makes networks easier to design, troubleshoot, and secure.</p><p>Although modern networks primarily use the TCP/IP model in practice, the OSI model remains the foundational framework taught in every networking and cybersecurity curriculum — and is the standard vocabulary used when analyzing protocols, designing systems, or diagnosing problems.</p><h3>The 7 Layers at a Glance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*A2pnqJVDSlqm0v3XZQ_7gQ.png" /></figure><h3>Layer-by-Layer Breakdown</h3><h3>Layer 1 — Physical</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*3UIf5jipAWmzyO8H1p7ehw.png" /></figure><p>The Physical layer transmits raw binary data — 0s and 1s — over a physical medium. It defines the electrical, optical, or radio characteristics of the signal: voltage levels, timing, cable types, and connector shapes. It has no concept of addressing or logical structure; it simply moves bits from point A to point B.</p><p><strong>Data unit: </strong>Bit</p><p><strong>Protocols &amp; standards: </strong>Ethernet (IEEE 802.3), USB, DSL, Wi-Fi (IEEE 802.11 physical spec), Bluetooth</p><p><strong>Technologies: </strong>Copper cables (Cat5/Cat6), fiber optic cables, hubs, repeaters, NICs, modems</p><p><em>Analogy: The roads and highways of a city. It provides the infrastructure for movement — it does not know or care what is being transported.</em></p><h3>Layer 2 — Data Link</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*N-jASZL8gIxQ0B_DMi_U6w.png" /></figure><p>The Data Link layer organizes raw bits from Layer 1 into structured units called frames. It handles communication between two directly connected nodes on the same network segment. It assigns physical addresses (MAC addresses) to identify devices, detects transmission errors using CRC, and controls access to the shared medium.</p><p>The Data Link layer is divided into two sub-layers: the MAC (Media Access Control) sub-layer, which handles addressing and medium access, and the LLC (Logical Link Control) sub-layer, which manages flow control and error checking.</p><p><strong>Data unit: </strong>Frame</p><p><strong>Protocols: </strong>Ethernet, Wi-Fi (802.11), ARP, PPP, VLAN (802.1Q)</p><p><strong>Technologies: </strong>Switches, bridges, network interface cards (NICs)</p><p><em>Analogy: Traffic lights and lane markings between two adjacent intersections — organizing local traffic, preventing collisions, and ensuring orderly flow.</em></p><h3>Layer 3 — Network</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*G1kgoeCwqw3j-PshaZgV4Q.png" /></figure><p>The Network layer handles end-to-end delivery of data across multiple interconnected networks. It uses logical addresses (IP addresses) to identify source and destination, and routing protocols to determine the best path through a network of networks. Unlike Layer 2, which only moves data between adjacent nodes, Layer 3 can span the entire internet.</p><p><strong>Data unit: </strong>Packet</p><p><strong>Protocols: </strong>IPv4, IPv6, ICMP, OSPF, BGP, RIP, NAT</p><p><strong>Technologies: </strong>Routers, Layer-3 switches</p><p><em>Analogy: A GPS navigation system — it looks at the entire map, calculates the most efficient route, and guides data across multiple cities (networks) to reach the destination.</em></p><h3>Layer 4 — Transport</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*mscovL2W5eegy-qt_9Uy3w.png" /></figure><p>The Transport layer is responsible for end-to-end communication between two hosts. It segments large messages into smaller pieces, numbers them for reassembly, and ensures they arrive completely and in order (TCP) — or delivers them as fast as possible without guarantees (UDP). Port numbers allow multiple services to run simultaneously on the same device.</p><p><strong>Data unit: </strong>Segment (TCP) / Datagram (UDP)</p><p><strong>Protocols: </strong>TCP, UDP</p><p><strong>Key concepts: </strong>Port numbers, three-way handshake, flow control, congestion control, error recovery</p><p><strong>Technologies: </strong>Firewalls and load balancers often operate at this layer</p><p><em>Analogy: Mailing a large book by tearing it into individual pages. The postal service numbers every page, tracks them, and reassembles them in order at the destination.</em></p><h3>Layer 5 — Session</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*sqYPBkkJjB-kDYURsfNxmw.png" /></figure><p>The Session layer establishes, maintains, and terminates communication sessions between two applications. It manages dialog control (who sends when), synchronization checkpoints (so a broken transfer can resume rather than restart), and session recovery. In practice, its functions are often handled by the application or transport layer in modern protocols.</p><p><strong>Data unit: </strong>Data</p><p><strong>Protocols: </strong>NetBIOS, RPC, SIP, PPTP, NFS</p><p><strong>Key concepts: </strong>Session establishment and teardown, checkpointing, synchronization</p><p><em>Analogy: A phone operator who connects your call, keeps it active, and formally ends it when you hang up. If the line drops, they reconnect you from where the conversation left off.</em></p><h3>Layer 6 — Presentation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*9T0huq0CTIhAxgEnvo9j7A.png" /></figure><p>The Presentation layer is responsible for data translation and syntax. It ensures that data created by the Application layer of one system can be read by the Application layer of another, even if the two systems use different internal data formats. It also handles encryption and decryption (TLS/SSL operates here) and data compression.</p><p><strong>Data unit: </strong>Data</p><p><strong>Standards &amp; formats: </strong>TLS/SSL, JPEG, PNG, MPEG, ASCII, UTF-8, JSON, XML, Base64</p><p><strong>Key concepts: </strong>Encoding, serialization, encryption, compression</p><p><em>Analogy: A professional translator at an international conference — converting each delegate’s words into a language everyone understands, and sealing sensitive messages in a private envelope (encryption).</em></p><h3>Layer 7 — Application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*0NgIMwGnGWvyI7onIYYWxQ.png" /></figure><p>The Application layer is the topmost layer and the one closest to the end user. It does not refer to the applications themselves (your browser, email client, etc.), but to the network protocols those applications use to communicate. It defines how applications request services from the network and how they exchange data.</p><p><strong>Data unit: </strong>Data</p><p><strong>Protocols: </strong>HTTP/HTTPS, SMTP, IMAP, POP3, FTP, SFTP, DNS, DHCP, SNMP, SSH, Telnet</p><p><strong>Key concepts: </strong>Application-level addressing (URLs, domain names), authentication, data exchange formats</p><blockquote><em>Analogy: The front desk of a hotel — the first point of contact for guests, handling requests and directing them to the right service, while the complex operations behind the scenes remain invisible.</em></blockquote><h3>How Data Travels Through the OSI Layers</h3><p>When you type a URL and press Enter, your data passes through all seven layers twice — once on the way out (encapsulation), and once on the way in at the server (decapsulation).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O14Oh46UGm4upXFwdkN3hg.png" /></figure><h3>Encapsulation — Sender Side (Top to Bottom)</h3><ol><li>Layer 7 (Application): Your browser generates an HTTP GET request. DNS resolves the domain to an IP address.</li><li>Layer 6 (Presentation): The data is encrypted (TLS) and encoded into the correct format.</li><li>Layer 5 (Session): A session is opened and tracked between your browser and the web server.</li><li>Layer 4 (Transport): TCP breaks the data into segments, numbers them, and assigns port 443 (HTTPS).</li><li>Layer 3 (Network): IP packets are created with source and destination IP addresses. The best route is selected.</li><li>Layer 2 (Data Link): Frames are built with MAC addresses for the next hop (your gateway router). CRC error codes are added.</li><li>Layer 1 (Physical): Frames are converted to electrical signals, light pulses, or radio waves and transmitted.</li></ol><h3>Decapsulation — Receiver Side (Bottom to Top)</h3><p>The web server receives the raw signal and processes each layer in reverse order, stripping the header added at each step, until the original HTTP request arrives at Layer 7 and the server can respond to it.</p><p>Each layer adds a header during encapsulation. The combination of data plus its headers at each layer is called a Protocol Data Unit (PDU): bits → frames → packets → segments → data.</p><h3>Why the OSI Model Matters</h3><h3>For Network Engineers</h3><ul><li>Standard vocabulary for describing and designing network architectures.</li><li>Enables interoperability between hardware and software from different vendors.</li><li>Each layer can be upgraded or replaced independently without affecting others.</li></ul><h3>For Cybersecurity Professionals</h3><ul><li>Attacks map to specific layers — enabling precise analysis and response.</li><li><strong>Layer 1: </strong>Physical tapping, cable cutting</li><li><strong>Layer 2: </strong>MAC spoofing, ARP poisoning, VLAN hopping</li><li><strong>Layer 3: </strong>IP spoofing, route hijacking, ICMP flood</li><li><strong>Layer 4: </strong>SYN flood, port scanning, session hijacking</li><li><strong>Layer 6–7: </strong>SSL stripping, man-in-the-middle, SQL injection, phishing</li><li>Firewalls, IDS/IPS, VPNs, and WAFs are each designed to protect specific layers.</li></ul><h3>For Troubleshooting</h3><p>The OSI model gives you a systematic, bottom-up diagnostic process:</p><ol><li>Is the cable connected and the NIC active? (Layer 1)</li><li>Is the MAC address resolving and the switch forwarding correctly? (Layer 2)</li><li>Is the IP address correct and the route reachable? (Layer 3)</li><li>Is the TCP connection completing the three-way handshake? (Layer 4)</li><li>Is the session being established and maintained? (Layer 5)</li><li>Is the data being correctly encoded or decrypted? (Layer 6)</li><li>Is the application protocol responding as expected? (Layer 7)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*3wmcWg0YA801s_Dbsg_e3w.png" /></figure><h3>Conclusion</h3><p>The OSI Model remains one of the most important conceptual frameworks in computer networking. By dividing communication into seven distinct layers, it allows engineers, developers, and cybersecurity professionals to understand how data moves through a network in a structured and systematic way.</p><p>Even though real-world implementations often rely on the TCP/IP model, the OSI model continues to serve as the universal language for learning networking concepts, analyzing protocols, and troubleshooting complex network issues.</p><p>Understanding these seven layers is a fundamental step for anyone beginning a journey in networking, cybersecurity, or IT infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=885420e5603e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>