tags:: #note/boat #note/develop #on/networking
# Networking Fundamentals
A **computer network** allows nodes to share resources by communicating with each other.
## Networking Devices
### Clients
A **client** is a device that uses the resources and services provided by [[Networking Fundamentals#Servers|servers]].
### Servers
A **server** is a device that provides resources and services for [[Networking Fundamentals#Clients|clients]].
### Switches
A **switch** is used to provide connectivity within a [[Local Area Network|Local Area Network (LAN)]].
#### Characteristics of Switches
- Have many network interfaces/ports for end hosts to connect to
- Provide connectivity to hosts within the same LAN
- Do not provide connectivity between LANs or over the internet
### Routers
A **router** is used to provide connectivity between LANs.
#### Characteristics of Routers
- Have fewer interfaces/ports than switches
- Used to send data over the internet
### Firewalls
**Firewalls** are security devices that control traffic entering and exiting a network. They must be configured with rules to control which traffic is allowed and which is blocked.
**Host-based firewalls** are software applications that filter traffic on a host machine.
#### Characteristics of Firewalls
- Monitor and control network traffic based on configured rules
- Can be places inside or outside the network
- "Next Generation Firewalls" include modern and more advanced filtering capabilities
## Networking Models
Networking models provide a structure for networking protocols and standards.
**Protocol**: set of rules defining how network devices and software should work
### OSI Model
- Not in use today, but still referred to often
- OSI stands for "Open Systems Interconnection"
- Created by ISO in the late 70s/early 80s
- Categorizes different functions in a network
- Functions are divided into 7 "Layers" that work together to make the network work
- Data is encapsulated as it moves down the stack, then de-encapsulated as it moves back up
- Network engineers don't usually work with the top 3 layers (5-7), but devs do
- Top 3 layers prepare the data, bottom 4 layers do the actual work of sending it over the network
- **Protocol Data Units (PDUs)**: name to reference data, segments, packets, and frames
| **Layer** | **Name** | **Description** |
| ---- | ---- | ---- |
| 7<br> | Application | Interacts with software applications |
| 6 | Presentation | Translates between application and network formats |
| 5 | Session | Controls sessions between communicating hosts |
| 4 | Transport | Segments and reassembles data for communications between hosts |
| 3 | Network | Provides logical addressing and connectivity between hosts |
| 2 | Data Link | Provides node-to-node connectivity |
| 1 | Physical | Defines physical characteristics of the medium used to transfer data |
#### Layer 7 - Application
- Closest to the end user
- Interacts with software applications
- HTTP and HTTPS are Layer 7 protocols
- Doesn't include the application itself
- Functions:
- Identifying communication partners
- Synchronizing communication
#### Layer 6 - Presentation
- Data in application layer is in "application format", so it needs to be translated to a network format to be sent over the network
- Presentation layer does the translating
- Example: encryption and decryption
- Also translates between different Application-Layer formats
#### Layer 5 - Session
- Manages connections between the local application and the remote application
#### Layer 4 - Transport
- Breaks large pieces of data into smaller segments that are easier to send over the network
- Smaller segments are less likely to cause transmission problems if errors occur
- Provides host-to-host communication
- Appends a Layer 4 header to the end of the data
- Combination of data and L4 header is called a **segment**
#### Layer 3 - Network
- Provides connectivity between hosts on different networks
- Provides logical addressing (IP addresses)
- Provides path selection between source and destination
- Routers operate at layer 3
- Appends a Layer 3 header to the segment
- Includes source and destination IP addresses
- Combination of data, L4 header, and L3 header is called a **packet**
#### Layer 2 - Data Link
- Adds a L2 header and tailer to the packet, creating a **frame**
- Defines how data is formatted for transmission over a physical medium
- Detects and corrects errors from Physical Layer
- Uses Layer 2 addressing, separate from Layer 3
- Switches operate at layer 2, look at destination address to know where to send data to
#### Layer 1 - Physical
- Defines physical characteristics of data transfer medium (ex, voltage levels, physical connectors, cable specs, etc.)
- Digital bits converted to electrical or radio signals
### TCP/IP Suite
- Conceptual model and set of communications protocols
- Developed by DARPA
- Actually used in modern networks
- OSI layers 5-7 merged to be TCP/IP Layer 4
- Transport layer is the same between OSI and TCP/IP
- Network layer of OSI maps to Internet layer of TCP/IP
- OSI layers 1-2 map to TCP/IP Link layer
- When people talk about layers, they usually mean OSI layers
| **Layer** | **Name** | **Description** |
| ---- | ---- | ---- |
| 4 | Application | Combination of OSI layers 5-7 |
| 3 | Transport | Same as OSI transport layer |
| 2 | Internet | Same as OSI network layer |
| 1 | Link | Combination of OSI layers 1-2 |
## References
_Free CCNA | Network Devices | Day 1 | CCNA 200-301 Complete Course_. YouTube Video. Vol. 1. 63 vols. CCNA 200-301 Complete Course, 2019. [https://youtu.be/H8W9oMNSuwo?si=-hl3EvXq8JcOK6HP](https://youtu.be/H8W9oMNSuwo?si=-hl3EvXq8JcOK6HP).
_Free CCNA | OSI Model & TCP/IP Suite | Day 3 | CCNA 200-301 Complete Course_. YouTube Video. Vol. 3. 63 vols. CCNA 200-301 Complete Course, 2019. [https://youtu.be/t-ai8JzhHuY?si=fPFljSbhkeEJODXh](https://youtu.be/t-ai8JzhHuY?si=fPFljSbhkeEJODXh).