Skip to content

Commit

Permalink
Add linting rules with markdownlint-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
laaraujo committed May 9, 2024
1 parent 6cafc6e commit b5934f8
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 82 deletions.
19 changes: 19 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
default: true

# Spaces for indent
MD007:
indent: 4

# Line length
MD013: false

# Multiple headings with the same content
MD024:
siblings_only: true

# Inline HTML
MD033: false

# Images should have alternate text (alt text)
MD045: false

6 changes: 6 additions & 0 deletions .pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.40.0
hooks:
- id: markdownlint
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Personal notes for learning [CCNA](https://www.cisco.com/site/us/en/learn/training-certifications/certifications/enterprise/ccna/index.html) topics.


## Contents

* [Network Devices](./contents/network_devices/)
* [Interfaces and Cables](./contents/interfaces_and_cables/)
* [OSI model and TCP/IP suite](./contents/osi_model_and_tcp_ip_suite/)
Expand All @@ -14,14 +14,12 @@ Personal notes for learning [CCNA](https://www.cisco.com/site/us/en/learn/traini
* Routing
* [IPv4 Header](./contents/ipv4_header/)


## Network node icons

The following are the icons use in some diagrams from [Jeremy's IT Lab](https://www.youtube.com/playlist?list=PLxbwE86jKRgMpuZuLBivzlM8s2Dk5lXBQ) I used in this repo:

![Icon used in various diagrams and examples](/docs/node_icons.png)


## Sources

* [Jeremy's IT Lab](https://www.youtube.com/playlist?list=PLxbwE86jKRgMpuZuLBivzlM8s2Dk5lXBQ)
* CCNA Course from [Jeremy's IT Lab](https://www.youtube.com/playlist?list=PLxbwE86jKRgMpuZuLBivzlM8s2Dk5lXBQ)
28 changes: 7 additions & 21 deletions contents/ethernet_lan_switching/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# Ethernet LAN Switching


## Table of contents
* [What is a LAN ?](#what-is-a-lan)

* [What is a LAN ?](#what-is-a-lan-)
* [Ethernet Frame](#ethernet-frame)
* [MAC Address](#mac-address)
* [ARP](#arp)
* [Ping](#ping)
* [MAC Address Table](#mac-address-table)
* [Examples](#examples)


## What is a LAN ?

A Local Area Network is a network contained within a relatively small area.
LANs use L2 layer frames.

![](docs/some_LANs.png)


## Ethernet Frame

![A complete ethernet frame structure](docs/ethernet_frame.png)

* 26 bytes 🔥
* 26 bytes 🔥

* `HEADER`
* 22 bytes
Expand All @@ -35,7 +34,7 @@ LANs use L2 layer frames.
* `TRAILER`
* 4 bytes
* `FCS` (Frame Check Sequence): used by the receiving device to detect any errors that may have occurred in transmission

![Preamble + SFD are usually not considered part of the ethernet header](docs/ethernet_frame_without_preamble_n_sfd.png)

* 18 bytes without Preamble + SFD 🔥🔥🔥
Expand All @@ -44,29 +43,25 @@ LANs use L2 layer frames.
* 64 bytes - 18 bytes (header + trailer) = 46 bytes for the **packet** (minimum)
* if payload is less than 46 bytes, padding bytes are added


### Preamble

* 7 bytes (8 bits * 7 = 56 bits)
* 10101010 * 7
* Allows deviced to sync their receiver clocks


### SDF (Start Frame Delimiter)

* 1 bytes (8 bits)
* 10101011
* Marks the end of the preable, and the beginning of the rest of the frame


### Destination and Source

* 6 bytes each (8 bits * 6 = 48 bit) address of physical device
* indicate the devices sending and receiving the frame
* consist of destination and source `MAC address`
* `MAC` = Media Access Control


### Type / Length

* 2 bytes (8 bits * 2 = 16 bits)
Expand All @@ -76,14 +71,12 @@ LANs use L2 layer frames.
* IPv6 = 0x86DD (Hexadecimal) = `34525` in decimal
* ARP Packet = 0x0806 (Hexadecimal) = `2054` in decimal


### FCS (Frame Check Sequence)

* 4 bytes (32 bits) in length
* detects corrupted data by running a *"CRC"* algorithm over the receiving data
* `CRC`: "Cyclic Redundancy Check"


## MAC Address

* 6 bytes (48 bits) physical address assigned to the device when it is made
Expand All @@ -93,7 +86,6 @@ LANs use L2 layer frames.
* Last 3 bytes are unique to the device itself 🔥
* Written as 12 **hexadecimal** characters


## ARP

* stands for Address Resolution Protocol
Expand All @@ -105,7 +97,6 @@ LANs use L2 layer frames.
* `ARP Reply` is a `unicast` ethernet frame
* **broadcast** MAC address used in **ARP Request** is FF.FF.FF.FF.FF.FF


### ARP Table

Use `arp -a` to view the ARP table and show all ARP entries
Expand All @@ -115,7 +106,6 @@ Use `arp -a` to view the ARP table and show all ARP entries
* `type static`: default entries
* `type dynamic`: learned via ARP


## Ping

* network utility used to test reachability
Expand All @@ -131,12 +121,10 @@ In the above example the first of the 5 requests sent failed because of ARP.

![](docs/wireshark_ping.png)


### Cisco IOS ARP

![](docs/ios_show_arp.png)


## MAC Address Table

To **show** the MAC Address table in CISCO devices use:
Expand All @@ -151,7 +139,6 @@ To manually **clear** the MAC Address table in CISCO devices use:

![](docs/clear_mac_address.png)


## Examples

### Example 1
Expand All @@ -174,7 +161,6 @@ We will have `PC1` send data to `PC2` in the same LAN where the Switch has an em
* `unknown unicast frame`: frame for which the switch doesn't have an entry in its MAC Address Table. In this case the frame is `FLOODED` (forwarded to all of its interfaces except the one it received the packet on)
* `known unicast frame`: frame for which destination is already "known" in the switches MAC Address Table. In this case the frame is `FORWARDED` to the specified destination.


### Example 2

`PC1` will send data to `PC3` and `PC3` will reply to `PC1` where the Switch has an empty MAC Address Table
Expand Down Expand Up @@ -203,10 +189,10 @@ We will have `PC1` send data to `PC2` in the same LAN where the Switch has an em
8. `SW1` already associated `PC1` Mac Address to `F0/1` interface so it will `FORWARD` the frame to `PC1` directly
![](docs/example_2/8.png)


### Example 3 🔥

`PC1` wants to send data to `PC3` where:

* `PC1` doesn't know `PC3` MAC Address
* `PC1` knows `PC3` IP address

Expand All @@ -216,7 +202,7 @@ We will have `PC1` send data to `PC2` in the same LAN where the Switch has an em
2. `SW1` adds `PC1` to its MAC Address table and `FLOODS` the request
![](docs/example_3/2.png)

3. `PC2` ignores the request because Destination IP doesn't match
3. `PC2` ignores the request because Destination IP doesn't match
![](docs/example_3/3.png)

4. `SW2` adds `PC1` to its MAC Address table and `FLOODS` the request
Expand Down
15 changes: 7 additions & 8 deletions contents/interfaces_and_cables/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Interfaces and Cables


## Table of contents

* [Network Protocols](#network-protocols)
* [Bits and Bytes](#bits-and-bytes)
* [Ethernet](#ethernet)
Expand All @@ -12,7 +12,6 @@
* [Fiber-optic Cable standards](#fiber-optic-cable-standards)
* [UTP vs Fiber-optic Cabling](#utp-vs-fiber-optic-cabling)


## Network Protocols

Agreed upon system of communicating between network devices.
Expand Down Expand Up @@ -59,7 +58,7 @@ Type of copper **cables** used in ethernet standards.

#### Straight-through cable connections

```
```log
1 --- 1
2 --- 2
Expand All @@ -71,7 +70,7 @@ Type of copper **cables** used in ethernet standards.

#### Crossover cable connections

```
```log
1 --- 3
2 --- 6
Expand All @@ -82,16 +81,16 @@ Type of copper **cables** used in ethernet standards.
![](docs/crossover_router_and_router.png)

#### **Auto MDI-X** 🔥

Truth is that most modern network devices don't need to worry about straight-through or crossover cables because of Auto MDI-X.

It allows deviced to automatically detect which pins their neighbor is transmiting data on, and then adjust which pins to use to transmit/receive data.


### 1000BASE-T and 10GBASE-T

In addition to using **ALL** pairs of wires, each pair is `BI-DIRECTIONAL`. This is part of the reason why they can operate at much faster speeds.

```
```log
1 --- 1
2 --- 2
Expand All @@ -114,6 +113,7 @@ In addition to using **ALL** pairs of wires, each pair is `BI-DIRECTIONAL`. This
![](docs/fiber_cable.png)

![](docs/fiber_optic_layers.png)

* `1` : Fiber glass core, where light is transmitted
* `2` : Cladding that reflects light
* `3` : Protective buffer
Expand All @@ -139,8 +139,8 @@ In addition to using **ALL** pairs of wires, each pair is `BI-DIRECTIONAL`. This
![](docs/multimode_fiber.png)

## Fiber-optic Cable standards
![](docs/fiber_optic_standards.png)

![](docs/fiber_optic_standards.png)

## UTP vs Fiber-optic Cabling

Expand All @@ -151,4 +151,3 @@ In addition to using **ALL** pairs of wires, each pair is `BI-DIRECTIONAL`. This
| Vulnerable to EMI | EMI proof |
| RJ45 ports are cheaper than SFP ports | SFP ports are more expensive (and single-mode ir more expensive than multimode) |
| Leak faint signal outside of cable (security risk) | No signal leak |

Loading

0 comments on commit b5934f8

Please sign in to comment.