Vault sync: 2022-01-26 13:24:31

This commit is contained in:
2022-01-26 13:24:31 +01:00
parent 29c0f2b719
commit 9ae3834c41
49 changed files with 17 additions and 10 deletions

View File

@@ -0,0 +1,12 @@
# ARP (Address resolution protocol)
ARP is used to create messages to find out MAC address of hosts
An ARP query message is a broadcast message similar to "Who is the owner of this IP Address". This query is broadcasted so everyone receives it.
The reply send by the owner of the IP Address (ARP Reply) contains the MAC address of the owner of the IP Address. This reply is a unicast message which means that it is a one-on-one transmission. So from one sender to one receiver on a network.
![[apr-request.png]]
## ARP Example
![[ARP-request-example.png]]

View File

@@ -0,0 +1,3 @@
# Comminucation Mediums
## Cables
## Wireless

View File

@@ -0,0 +1,20 @@
# Computer Networks
Computers can exchange data if they are connected which each other.
This means that they can share resources, like:
- Hardware resources
- Data
- Programs
in #client-server-architecture, a computer (server) hosts, delivers, and manages resources and providers services to clients trough computer networks.
Examples: gameservers, webservers, email servers, etc...
- Applications require a medium/structure for exchanging messages/data therefore we need a **network**
- A group of interconnected computers is called a network.
- Computers in a network can operate independently.
There are different types of computer networks: [[Network Types]]

View File

@@ -0,0 +1,14 @@
# Dynamic Host Control Protocol (DHCP)
Address allocation can happen trough 2 ways.
Fixed allocation:
- Wasteful because if a hosts is not active the IP Address is still allocated.
Dynamic allocation:
- A DHCP server manages the allocation of IP Addresses and leases them for a certain amount of time.
Dynamic allocation works like this:
1. A host broadcasts a request for an IP Address.
2. A DHCP server replies with a offer for an IP Address.
3. The host replies accepting the offer.
4. Server confirms the allocation of the IP Address.

View File

@@ -0,0 +1,13 @@
# ICMP
Messages are not guaranteed to be delivered without error. Problems with sending and receiving connections happens all the time.
In case of errors, the sender needs:
1. To be informed about the problem.
2. Make corrections in the message.
3. Retry sending the message.
ICMP Protocol is responsible for sending error messages.
ICMP Messages are used to verify the status of the network.
![[example-icmp.png]]

View File

@@ -0,0 +1,38 @@
# Internet protocol Version 4 (IPV4)
- IP is the principal communications protocol in the network layer.
- IP has the task of delivering packets from source host to destination host based on IP addresses.
IP defines datagram structure that encapsulate the data to be delivered.
An IP datagram (packet) consists of a header part an a text part. (payload)
The header has a 20 byte fixed part an a variable length optional part.
![[IP-packet.png]]
Some of the fields in a packet are not always used.
## Packet encapsulation
Packets are encapsulated in data link frames (Ethernet)
![[packet-enscapsulation-2.png]]
## Fragmentation
Mostly, data link frames are smaller in size than IP Packets
So the IP Packet does not fit in the data link frame.
In these cases the packet is split up into multiple parts (fragments) and each fragment is send in a separate frame.
![[packet-fragmentation.png]]
The receiver host then combines all fragments before using them
Therefore the receiver should know which part of the message each fragment belongs (hence the fragment offset field in IP header)
![[packet-fragmentation-2.png]]
Ecapsulating a packet in a frame requires:
- Sender MAC Address (can be found out)
- Receiver MAC Address (Should be found out

View File

@@ -0,0 +1,16 @@
# IPv6
**IPv4 has several problems:**
- Scarce IPv4 address.
- IPv4 header contains fields that are not used by every packet (should be optional)
- IPv4 imposes extra processes on routers, the network can become slower (such as fragmentation and checksum calculations)
- IPv4 does not provide any security measurement at network layer.
**IPv6 Format:**
![[IPV6-format.png]]
Most of the mandatory fields of IPv4 header and some of IPv4 options are available trough IPv6 options. (Linked by next header)
IPv6 provides encryption and authentication features.
Routers are not allowed to perform fragmentation.
NO Checksum calculations, error checking is already implemented in both data link layer and transport layer.

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

View File

@@ -0,0 +1,139 @@
# 1. Physical Layer
This layer is responsible for the actual physical transfer of data between devices via cables or other mediums using switches, routers, etc..
This layer also converts the data into a bit-stream of 1's and 0's.
The signal convention must be the same on both devices. (Meaning of a 0 and a 1)
## In depth
Information on computers is stored in a digital format. To transmit this information we have to convert the information to signals.
Physical layer is responsible for this conversion. The Physical layer deals with the actual physical transmission of electrical signals.
You could say the physical layer is a bridge between real life and software.
## Waves
Waves, like you would see on a lake, or in electrical cables are made when a physical quantity changes in the form of a moving ridge.
Waves by them self store no real information.
## Signal
A signal is a wave (carrier) that holds information. (wave + data = signal)
The carrier is a type of wave we add our information to. In most cases a sine wave is used as a carrier wave,
![[encoder.png]]
A encoder converts analog or digital information in signals that can be transmitted across different [[Comminucation Mediums]]
The process of adding data to a carrier wave is called Modulation
## Modulation
Adding data to carrier waves is called modulation.
This can be done in 3 different ways.
### Amplitude
![[modulation-amplitude.png]]
Amplitude or the strength (height) of a wave changes over time.
### Frequency
![[modulation-frequency.png]]
Frequency is the amount of waves that pass a fixed point in a given amount of time.
### Phase
![[modulation-phase.png]]
Phase specifies the location or timing of a point within a wave cycle of a repetitive waveform.
![[modulation-phase-2.png]]
## Analog
**Analog Signals** can have a infinite number of possible values in a range.
For example: 0.0 <-> 1.0
- 0.1436367436473......
- 0.54454764654765......
**Analog data** is continuous and have continuous values.
Values in analog data are always changing.
A good analogy for analog data is like a physical (analogue) clock with hands.
The hands on a clock like that are always moving (continuous) and do not have a specific value.
## Digital
Digital data is information represented as a string of discrete symbols each of which can take on one of only a finite number of values from some alphabet, such as letters or digits.
For example:
- a
- b
- 1
- 0
These values are specific and are not changing.
## Transmitting Impairments
Signals most often have to deal with problems during transmission. Problems like this are called transmission impairments.
Important transmission impairments are:
### Attenuation
Attenuation is the strength or amplitude of a signal is decreasing over time and distance.
A good analogy for this would be the loss of volume you would hear from a speaker the further you are away from it.
![[attenuation.png]]
This makes is more difficult to correctly capture the signal on the receiving end.
We can solve this issue by dividing the communication line up in smaller segments and amplify the signal between segments.
### Distortion
![[distortion.png]]
Distortion is the change that occurs in a signal that affects how the signal looks.
For example talking to someone while behind a thick glass pane changes how you sound on the other side.
We can solve this by using a lower bit rate. Bit rate is kinda like the information per second. This way the signal is less susceptible to distortion.
### Noise
![[noise-signal.png]]
Noise is when data is added to a signal and therefore changing the data itself.
Analogy for this when you are listening to someone talk and somebody else is talking at the same time trough your conversation.
We can solve this by using a stronger signal (bit like talking louder).
This will reduce the impact noise has on the signal.
This is also called signal to noise ratio (SNR)
## Transmission Media
These signals are send through a transmission medium. A transmission medium is a physical object that can carry the information from source to destination.
Transmission mediums are often space (air), metallic cable or fiber optic cables.
Transmission media are divided in 2 groups.
### Guided media
Guided media like cables provide a conduit from one device to another.
I like to think of it as you can steer the signal by moving the cable for example.
Coaxial cable, twisted pair cable and fiber optic cables.
![[type-cables.png]]
### Unguided media
Unguided media transport electromagnetic waves without using a physical conductor.
This is called wireless transmission. (Technically using the air around you as a conductor)
Signals are broadcast tough space and thus available for everyone to pick up.

View File

@@ -0,0 +1,54 @@
# 2. Data link Layer
The Data Link Layer is responsible for handling the data transfer between two devices on the **same** network. (so a bit like the Network Layer)
The Data Link Layer also splits up packets into smaller chunks called a frame. The reverse happens on the receiving device (reassembling frames into packets).
Like the Network Layer the Data Link Layer is also responsible for flow control and error checking.
## Error Detection
Transmissions are not always error free. In case of an error, it should be detected and the message should be re transmitted (whenever possible)
Detecting errors are handled by different algorithms:
- Parity bits
- CRC
## Data Framing
Data is split up in smaller chunks called frames. For each frame we add some extra data:
- Who is sender?
- Who is receiver?
- Length of chunk
- Type of chunk (normal message, error message, control message)
- Error checking values (ex. CRC code)
- Data and metadata are put in single message called frame
## Ethernet Protocol
Ethernet is a protocol used at the data link layer of wired networks.
Ethernet uses specific hardware addresses to identify hosts on a network.
These 6-byte-integer addresses are names Medium Access Control (MAC Address)
Ethernet frame has the following format:
![[ethernet-frame.png]]
## Wireless networks
Wireless networks do not use a physical medium for data transmission. The data is send through radio waves.
- Each member of a wireless network is called a station.
Networks are implemented in different sizes:
- Wireless local area networks (WLAN)
- Wireless Metropolitan Area Networks (WMAN)
- Wireless Wide Area Networks (WWAN)
### BSS Network
A BSS is a network with a specific station called Access Point.
All transmissions from a station to another are trough the Access Point.
Access Points also connect the network (BSS) other networks, hence the name internet.
### AD-HOC Networks
AD-HOC networks do not have a central node (access point).
Every station can send data directly to a other station.

View File

@@ -0,0 +1,136 @@
# 3. Network Layer
The Network Layer is responsible for handling the data transfer between two different networks. This means that this layer is not needed if the receiving device is on the same network.
The Network Layer breaks up segments from the Transport layer into smaller chunks called [[Packets]]. The reverse happens on the receiving device (reassembling packets into segments).
Furthermore the Network Layer also finds the optimal path to travel from origin network to the destination network. This is called routing.
## Routing
Routing is finding the shortest (most efficient) path from source to destination and forwarding the messages over that calculated path.
Routing is difficult because it has to deal with a lot of things:
- Network topology may change.
- New hosts may be added.
- Some connections/hosts may be removed.
- Distance between hosts may change.
Routers use tables called routing tables. The table contains the next point on the shortest path to each destination.
Steps:
1. Routing: Finding the most efficient path(s)
2. Forwarding: Send info to the nest point from the routing table.
A router can not practically store all hosts in the table as that would be way to many.
So instead the router stores only possible destination networks.
The address to identify a host on a networks should have the format:
{Network, Host}
## Forwarding
When a router receives a packet:
1. Extracts the destination address from packet.
2. Separates the network ID from the rest of the address.
3. Looks if it can match the networks id in routing table.
4. If Match found: Sends packet using suggested paths in its table for that destination.
5. If no match found: Send packet over the default path which is the path to the next (probably a higher level) router.
### Separating network ID from address
Router needs to know how many digits are used as network ID.
Routers keep this information in their routing table.
A binary number named a netmask is used to show the network ID where 1's show the network ID.
#### Example:
Network ID is marked as bold.
- Netmask:
**11111111.11111111**.00000000.00000000
- Address:
**195.210**.23.14
## Router
Router is a member of multiple networks.
![[routers-example.png]]
For each connection to a network a routers uses a network interface card (NIC) and a IP address.
This way a router can have multiple IP addresses.
Each connection is identified by a interface, label or an address.
Example of a routing table:
![[routing-table.png]]
### Updating router tables
Routers are responsible for updating routing tables themselves.
When a router detects a change in connections, it immediately informs other routers about it.
Routers use optimum route finding algorithms to update their tables.
Exchanging routing information between routers is done periodically even when there is no change in the network.
The most commonly used routing algorithms are:
- Distance vector routing (RIP)
- Link-state Routing (OSPF, IS-IS)
## Addressing problem
We now do have a addressing issue because:
- We have a MAC Address but we do not have a Network ID or host ID. Which is what we need for our routers.
- MAC addresses are hardwired in the NIC's
So we need a new type of ID to uniquely identify a host in the internet.
This address will we at a higher level of protocols (Network layer) and is therefore protocol dependent.
### IPV4
IPV4 are 4 byte integers. We use them in the following format:
0-255.0-255.0-255.0-255 ex. 192.168.100.1
This is called a dotted decimal, each address contains 4 decimals of 8 bits (octets)
Example: 00000000.00000000.00000000.00000000
### Classful addresses
Classful addresses define 3 networks types
Class A: First decimal shows the network ID, remaining 3 decimals show the host ID. (Large networks)
Class B: First two decimals shows the network ID, remaining 2 decimals show the host ID. (Mid networks)
Class C: First three decimals shows the network ID, remaining 1 decimal show the host ID. (Small networks)
### Classless addresses
In classless addresses the number of bits is used for a Network ID is given as a number after the address
Example 144.24.13.172/**20 (20 bits used for network ID)**
### Exceptions in IPV4
![[exceptions-ipv4.png]]
Also the following addresses are not used as a valid and unique IPv4 Addresses:
10.0.0.0 - 10.255.255.255/8 (16.777.216 hosts)
172.16.0.0 - 172.31.255.255/12 (1.048.576 hosts)
192.168.0.0 - 192.168.255.255/16 (65.536 hosts)
We use these IP addresses as local addresses. The local addresses are translated into a global IP when sending messages to a host in a other network. This translation process is called NAT.
### Scarce IP address problem
With 32 bits, the maximum possible IPv4 addressed is 2^32 = 4 billion
**We need more addresses.**
## IPV6
Solution! Make it bigger!
In a IPv6 each address is a 16 byte integer. The address itself is written in hexadecimal.
Every address contains 8 groups of 4 hexadecimal digits, separated by colon (.).
**Example:**
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Only classless addresses are used!

View File

@@ -0,0 +1,10 @@
# 4. Transport Layer
The Transport Layer is responsible for the end-to-end communication between 2 devices.
The Transport layer on the sending device takes data from the Session Layer and breaks them up in chunks called segments.
On the receiving device the Transport Layer reassembles the segments of data that the Session Layer can consume.
While sending data via a network data can get corrupted, the Transport layer also ensures the data being received is complete and correct, and requesting a retransmission if its not.
The Transport Layer also controls the flow of outgoing data so that the receiver is not overwhelmed with data. (fast to slower connections for example)

View File

@@ -0,0 +1,10 @@
# 5. Session Layer
The session layer is responsible for opening and closing connections between two devices. The duration of a connection is called the session.
The session layer ensures that the connections remains active and open so that the data being received and/or send is complete.
For example when sending a big file to someone, which takes some time, the session layer will keep the connection open long enough to send the complete file.
The session layer also synchronizes the data transfer with checkpoints. For example, if a 50 MB file is send to a device, the session layer could set a checkpoint every 10 MB. In case of a disconnect (session close), the session could be restored to a certain checkpoint and the data transfer can resume where it disconnected.
This way we do not need to completely resend the file.

View File

@@ -0,0 +1,13 @@
# 6. Presentation Layer
The presentation layer is responsible for preparing the data so that it can be used by the Application Layer.
**Presentation layer is responsible for:**
- Translation of data
- Encryption of data
- Compression of data
For example, two devices can use different types of encoding on their data, the presentation layer will translate the data in a way that the Application Layer can understand.
When sending sensitive data, we would like to encrypt the data so that its secure. The Presentation layer is responsible for encrypting and decrypting ingoing or outgoing data.
Also when sending of receiving data we sometimes want to compress the data so that sending and receiving data is more efficient. (smaller size)

View File

@@ -0,0 +1,14 @@
# 7. Application Layer
The application Layer provides services to the end user. So this is the layer the user actually interacts with.
These services are usually protocols that interact with the data that the user uses.
**Examples of services (protocols):**
- HTTP
- FTP
- IRC
- SSH
- DNS
- SMTP
For example a web browser like Google Chrome uses the HTTP protocol to browse files on the internet. And the mail client Outlook uses the SMTP protocol to send mail via the internet.

View File

@@ -0,0 +1,9 @@
# Network Address Translation
We can share one global IP using NAT.
- All members of a network can share IP address, but internally they should use local IP address to distinguish them from each other.
- Therefore, when a message is send to an outside host the sender IP address is replaced by the shared IP address of the network. (IP Address translation)
![[NAT-example.png]]

View File

@@ -0,0 +1,54 @@
# Network Hardware
## Hosts
Hosts are the actual clients/devices on a network.
Examples: Computers, printers, servers, etc....
## Hubs / Repeaters
Hubs connect hosts in [[Network Types#Broadcast network]] networks, they forward all messages in all possible directions. This means that hubs are non-intelligent.
![[hubs.png]]
## Switches
Switches like hubs also connect hosts in broadcast networks. Switches however forward messages in the direction of their intended receivers. This makes the switches intelligent.
This property of a switch is called filtering.
Switches contain a table that stores all [[MAC-Address]] of connected devices (of each port) in a table.
They read the frame of a incoming message, extract the destination MAC Address and forward it to the corresponding port on the switch.
## Bridges
## Routers
Router is a member of multiple networks.
![[routers-example.png]]
For each connection to a network a routers uses a network interface card (NIC) and a IP address.
This way a router can have multiple IP addresses.
Each connection is identified by a interface, label or an address.
Example of a routing table:
![[routing-table.png]]
### Updating router tables
Routers are responsible for updating routing tables themselves.
When a router detects a change in connections, it immediately informs other routers about it.
Routers use optimum route finding algorithms to update their tables.
Exchanging routing information between routers is done periodically even when there is no change in the network.
The most commonly used routing algorithms are:
- Distance vector routing (RIP)
- Link-state Routing (OSPF, IS-IS)

View File

@@ -0,0 +1,21 @@
# Network Software
Network software is a set of rules defining how a [[Packet]] should be handled on a network (creation, delivery, etc...).
**These rules are defined as protocols**
The standard model that everyone uses is the [[OSI Model]]
![[packet-encapsulation.png]]
## Network Protocols
Network protocols defines the rules needed for multiple computers to communicate correctly with each other. You can compare it to our rules in natural languages.
- Protocols are divided into multiple layers (abstraction)
- Each layer has their own responsibilities.
- When a layer is replaced, other layers do not get affected. (Layers work independently)
### Examples
- A user does not need to understand how WiFi works exactly, or how signal errors are handled. (Abstraction)
- We can replace the Ethernet cable of a computer with a WiFi module and the internet connection should work exactly the same. (Layers work independently)

View File

@@ -0,0 +1,46 @@
# Network Types
The interconnection between computers in a network can be done in 2 ways
## Broadcast network
![[broadcast-network.png]]
In a broadcast network, every message ([[Packet]]) is sent to every client on the network. Only intended recipients read the packet. Other clients will ignore.
### Disadvantages
- In a broadcast network you cant send multiple messages at the same time ([[collision problem]])
- Suffers from heavy load
- Cannot scale in size.
## Point to Point network
![[point-to-point-network.png]]
[[Packets]] in point-to-point networks are sent from one node to the other until the destination is reached.
Preferably the shortest path is taken.
## When use what
**Smaller Networks**
[[#Network Types#Broadcast network]]
Lighter traffic and lower possibility of collision (smaller dimension).
**Bigger Networks**
[[#Network Types#Point to Point network]]
Suits better.
## Combining Point to Point with Broadcast
Smaller networks use Broadcast internally and are connected to other networks using point to point network.
The device that connects point to point network with a broadcast network is called a [[Network Hardware]]
![[point-to-point-with-broadcast.png]]
This way you have a network of smaller networks (Internet)
### How is a packet send through a combined network?
- Packet is broadcasted by sender in source network
- Gateway of source network receives packet and passes it on trough the point-to-point network. (till it reaches destination network)
- Destination network receives packet and broadcasts it in the destination network.
- Indented client receives packet.

View File

@@ -0,0 +1,13 @@
# OSI Model
The OSI Model is a layered protocol model. It was proposed by the International Organization for Standardization. The model can be used as a reference to understand how networks operate.
![[OSI-model.png]]
The model was created to have a standard which hardware/software producers could use so that different products could work with each other.
For example, before this model was introduced, hardware from company A could not work together with hardware of company B because the protocols and techniques used were completely different.
As you can see the model has 7 layers. Each layer has their own responsibility.
**Note: We don't actually "use" the OSI model, we mostly use the [[TCP/IP Model]] now. The implementation is exactly the same, only some layers are different.**