Networking

Fundamentals

Network Rete ネットワーク

Collection of devices and packet switchers connected through communication links

Internet インタネット

Collection of computer networks under the Internet Protocol Suite (TCP/IP)

Area networks

Networks may have differing scales, from a personal to global scale. The following 'areas' listed below are in ascending order of magnitude, with each area being a network of smaller areas

Distributed computing

Coordination of devices to access common resources

Client-server

Distributed computing model interpreting devices with fixed roles for resource distribution

Peer-to-Peer (P2P)

Distributed computing model interpreting devices with flexible roles for resource distribution

Virtual private Network (VPN)

Multiple network sites connected to be one LAN

Virtual LAN (VLAN)

Partition of a LAN that has its own broadcast domain, broadcasts do not go to the whole LAN but stay within the confines of its virtually designated one

Proxy

Middle server mediating between intended source and destination, able to inspect traffic between them

MPLS

Multi Protocol Label Switching; Routing LANs to connect to other LANs

Edge

OSI model Modello OSI OSI参照モデル

Reference model comprised of 7 layers, representing different levels of scope in a network

TCP/IP model

Protocol

Standard of network rules acting on an OSI layer, dictating the format, handling, forwarding, and routing of a data unit on a network.

Protocol Data Unit (PDU)

Packet Switching Commutazione di pacchetto パケット交換

The concept of breaking data down into packets and routing them along the most efficient path through devices such as routers and switches

Communication links

Physical transmission medium, may guided (wired) or unguided (wireless)

Digital Subscriber Line (DSL)

Network system used to communicate digital data over telephone lines

Digital Subscriber Line Access Multiplexer (DSLAM)

Device that combines digital signals sent by DSLs into one signal that is routed over to an ISP, and combines telephone signals that is routed over the telephone network

DSL modem

Cable modem

Modem that allows for sending digital signals over television cable

Cable Modem Termination System (CMTS)

Device that combines digital signals sent by modems into one signal that is routed over to an ISP, and combines TV signals that is routed over the TV network

Bandwidth

Maximum rate of data that can be sent across a path

Baud rate ボーレート

Signals transmited per second

Bit rate

Bits transmitted per second

Packet Queuing and loss

When the arrival rate is greater than the transmission rate, packets will begin to queue in the router's RAM. If the router's RAM is maxed then packets can become lost

Forwarding 転送

The process of locally routing data from to the input link to the intended output link

Store and Forward ストアアンドフォワード

Technique of storing network data in a network device's memory buffer and then retransmitting the data along the network

Routing ルーティング

The process of globally routing data from to the input link to the intended output link

Circuit switching Commutazione di circuito 回線交換

Data has a predefined route to take to arrive to a host with a guaranteed bandwidth

Tier 1 Network

Network that is connected to all other Tier 1 networks and is a transit free network

Internet Service Provider (ISP)

Content Delivery Network(CDN)

Internet Exchange Point (IXP)

Network node where ISPs and CDNs connect

Loss Perdita 損失

Phenomenon where a packet fails to reach a node

Attenuation

Distortion or loss of a signal as it travels through a link

Delay Ritardo 遅延

Phenomenon that prolong time between transmission and reception of a packet. There are different types of delay:

The total delay of an event is modelled by \(\sum D_{n}\) (all the delays together)

End-End Delay

The theoretical time taken for a quantity of data to travel in the data link and reach the final destination, modelled by such equation:

\(D_{T}=\sum_{n=1}^{H}\frac{S}{R_{n}}\)

\(D_{T}=\sum_{n=1}^{H}\frac{S}{R_{n}}+\sum_{n=1}^{N-1}\frac{S}{R_{H}}\)

Where:

Arrival rate Tasso di arrvio 到着率

\(aL\)

Traffic intensity Intensita di traffico 通信強度

Ratio of rate of packets arriving on rate of transmitting packets

\(\frac{aL}{R}\)

Throughput Capacita di trasmissione 処理能力

Rate at which bits are being sent from sender to receiver, either as:

Bottleneck link

Slowest link on a path which constrains throughput, the weakest chain

Application layer

Process Communication Communicazione di processi プロセス間通信

Two processes on two different device OSs communicating through a network

Socket ソケット

Structure in a program that receives and sends data on a network, analogous to a mailbox

Identifier Identificatore 識別名

Identifying codes for the device and the related process (device's IP address and process' port number)

Port

Protocol on the application level, which defines:

There are \(2^{16}=65536\) of these ports

Application protocols

XML HTTP Request (XHR)

Request that gains information from a server in XML or JSON format

HTTP header

Object Oggetto オブジェクト

Data object such as an html, png, jpeg, gif files

Universal Resource Locator (URL)

String that points to a resource on a network, specifying:

https://www.website.com:80/pages/index.html?foo=42&bar=84#head

State

Memory of user activity in networking

Round Trip Time (RTT) 往復遅延時間

Time for a small packet to travel from client to server and back again

Persistent HTTP

HTTP session that includes the request for the page and for the recursive objects the page refers to. The connection takes one RTT to establish, and each object takes one RTT

\(TRT=\text{RTT}_{h}+\text{RTT}_{html}+\text{Tx}_{html}+\text{RTT}_{f}+\sum_{n=1}^{N}\text{Tx}_{n}\)

Where:

Non-Persistent HTTP

Collection of HTTP sessions for each request of each individual object; cannot recursively include sub-objects. Each object takes 2 RTTs since each object has its own connection

\(TRT=\text{RTT}_{h}+\text{RTT}_{html}+\text{Tx}_{html}\sum_{n=1}^{N}\text{RTT}_{h}+\text{RTT}_{n}+\text{Tx}_{n}\)

Where:

Parallel processing

Processes running concurrently, uses more resources but saves time, and time is money my friends. With this, the Non-Persistent HTTP TRT is calculated by the following instead:

\(TRT=\text{RTT}_{h}+\text{RTT}_{html}+\text{Tx}_{html}\sum_{n=1}^{\lceil\frac{N}{M}\rceil}\text{RTT}_{h}+\text{RTT}_{f}+\text{Tx}_{n}\)

Where:

Request message

HTTP messages to request resources, which can be of the following types:

Response message

A status code with a phrase sent after a request message

HTTP status codes

Cookie クッキー

Data sent through HTTP bodies in order to remember user data and gives HTTP pseudo-state

Web cache

Storage buffer that stores output of recent request

Mail server

CRUD API

Create, Read, Update, Delete API; an API that allows for the aforementioned actions, such as HTTP

SMTP

Simple Mail Transfer Protocol; persistent mailing protocol used in TCP to send emails, running on port 25. Messages for some reason must be in 7 bit ASCII

Request message

SMTP messages to communicate with mail server, which can be of the following types:

Domain Name System (DNS)

Hierarchial system of devises for mapping domains with IP adresses

DNS Resolver

Server that resolves DNS query by consulting its cache or by recursing query to a root name server

Root name server

Server that redirects DNS query to appropriate TLD name server

TLD name server

Server that redirects DNS query to appropriate authoritative name server

Authoritative DNS server

Server that resolves DNS query by consulting its database of DNS records

DNS records

A DNS can resolve a range of different types of networking addresses, and the record chooses which address it should resole. Here are some examples:

DNSSEC

DNS request sent with encryption and authentification

FQDN

Fully Qualified Domain Name; Full domain of a website

DHCP

Dynamic Host Configuration Protocol; Protocol for routers to provide a local IP to devices

Zone

File that contains entries that map domains with IP addresses

Primary zone

The first zone referenced for DNS mapping

Secondary zone

If the first zone fails, this zone is referenced. This zone can only be edited by syncing with the primary zone after some time interval

AXFR

Asyncrhonous full transfer; copies whole primary zone to secondary zone

IXFR

Iterative transfer; copies only new records and modified records to secondary zone

DNSSEC

Voice over IP (VoIP)

Class of application layer technologies for transporting voice data over a network

Transport layer

Segment Segmento 分

Fraction of application message sent on the network layer and rearranged into an application message by reciever

Transport layer

Logical communication between processes; how segments are sent

Network layer

Logical communication between hosts; how routes are formed

Multiplexing Multiplazione マルチプレックス

Combining several input signals into one output signal

Handling data from multiple sockets and adding a transport and network header

Frequency Division Multiplexing (FDM)

Multiplexing frequencies by overlapping them and sending them through one medium

Time Division Multiplexing (TDM)

Multiplexing signals by interpreting data for a different hosts at different time intervals

Demultiplexing ディマルチプレックス

Dividing a multiplexed signal back into all the original input signals

Using the transport and network header to send segments to correct socket

Transport protocol

Protocol on the transport level that defines how a message arrives at a destination (impacting speed and quality)

Transmission Control Protocol (TCP)

Connection-oriented transport protocol with a header denoting the following information:

User Datagram Protocol (UDP)

Connectionless transport protocol with a header denoting the following information:

UDP Multiplexing

UDP socket defined by destination port and destination IP; so all datagrams from any source directed to the same destination IP and port go to the same socket

TCP Multiplexing

TCP socket defined by 4-tuple; Destination IP, Destination port, Source IP, Source port. This means there is a socket for each client

Checksum 検査合計

Error checking technique by calculating the sum of all data values treated as 16 bit integers, unequal checksums imply bit flips

Utilisation

Fraction of time that a host is trasmitting data into a link in relation to the transmission time and RTT; shows how efficient reducing transmission time would be

\(U_{sender}=\frac{D_{trans}}{D_{trans}+\text{RTT}}\)

\(\text{RTT}=2D_{prop}\)

Reliable Data Transfer (RDT)

Transferring data is susceptible to loss and delay, hence ideas of how to migitage these are necessary for a rubust networking system. RDT is an educational idealised protocol that demonstrates idealised processes that can be undertaken to successfully transport datagrams.

RDT1.0

Transfer over a reliable channel

RDT2.0

Transfer over an ureliable channel with a checksum and the following two flags to signify whether the checksum succeeds: ACK and NAK.

RDT2.1

RDT2.0 but with packet sequence numbers

RDT2.2

RDT2.1 but without NAK, only sends ACKs for last successful transfer

RDT3.0

Transfer over an unreliable with loss, comprised of RDT2.2 and uses timing to assume when packet is lost

Pipelining

The idea of sending packets back-to-back without waiting for the RTT of an ACK from the other host, sending packets while other packets are still in transmission

Go-Back-N ARQ

Protocol for determining window of size n where n represents the amount of packets than are allowed to be pipelined at once. When the sender receives a repeated acknowledgement number before the timeout, Go-Back-N will "go back" and start transmitting from that packet. If one of the receiver's ACKs are lost, Go-Back-N will examine the acknowledgement number of the next ACK to ensure the packet was received and continue as if nothing happened

\(N+N-L+1\)

Selective repeat ARQ

Protocol for determining window of size n where n represents the amount of packets than are allowed to be pipelined at once. When the sender receives a repeated acknowledgement number before the timeout, selective repeat will "selectively" retransmit only that packet and then continue from the packet it was on before. If one of the receiver's ACKs are lost, selective repeat will examine the acknowledgement number of the next ACK to ensure the packet was received and continue as if nothing happened

RTT Estimation

To determine whether a datagram is lost, one must find some method to calculate the expected RTT (relating to average) and a time-out interval (relating to variance)

Exponentially Weighted Moving Average (EWMA)

Recursive algorithm for calculating an estimated RTT

Expected RTT

\(\overline{\text{RTT}}_{i}=(1-\alpha)\overline{\text{RTT}}_{i-1}+\alpha \text{RTT}_{i}\), where:

RTT Deviation

\( s_{i}=(1-\beta) s_{i-1}+ \beta |\text{RTT}_{i}-\overline{\text{RTT}}_{i}|\), where:

Moving timeout interval (MTI)

The appropriate timeout interval can be defined as such, 4 average deviations away from the expected RTT

\(\text{TOI}_{i}=\overline{\text{RTT}}_{i}+ 4 s_{i}\)

TCP Protocol format

Sequence number

A sequence number in a TCP packet represents how many bytes were sent in the payloads before that packet. As well as the payloads, if the flag has a SYN bit enabled, the flag byte then contributes to this number

Acknowledgement number

An acknowledgement number in a TCP packet represents how many bytes the host has received. As well as the preivous payload, if the flag has a SYN bit enabled, the flag byte then contributes to this number

TCP flags

TCP sending process

  1. Form segment with a sequence number
  2. Initiate timer
  3. Transmit segment and wait

TCP fast retransmit

If 3 ACKs for the same sequence received, assume it is lost and retransmit

Byzantine fault

When an unreliable host sends a messages to another host that contradicts other information it has received

TCP 3-way handshake

The one, the only, the SYN SYNACK ACK.

TCP connection closure

Window

Amount of packets a connection has 'in-flight' at any point in time

RWND

Receiver windows size of a TCP connection in bytes, how many bytes at once a receiver advertises to be able to receive

Conjestion Window (CWND)

Congestion windows size of a TCP connection in bytes, window of bytes that are sent before receiver sends an ACK

Congestion

Congestion occurs when there are too many sources to a router, this leads to longer delays (which in turn can mess with TCP timing) and packet loss through buffer overflows at the router

\(R_{n}=\frac{R}{N}\)

The throughput for a node is the bandwidth of the router divided by the amount of nodes on the LAN

Conjection control

Optimising the window to be as large as possible without unmanageable loss is ideal.

Slow start

  1. Let \(\text{CWND}=1\)
  2. If pipeline successful, \(\text{CWND}_{i}=2\text{CWND}_{i-1}\)
  3. Else if loss occurs, make the SSTHRESH (Linear threshold) half the window size \(\text{SSTHRESH}=\frac{\text{CWND}}{2}\)
  4. Make the CWND increase like when \(\text{CWND}_{i}=\text{CWND}_{i-1}+1\) when \(CWND \geq SSTHESH\)

AIMD

TCP rate

\(\text{TCPR} \approx \frac{\text{CWND}}{\text{RTT}}\) in bytes per second, where:

\(\text{E}(\text{TCPT})=\frac{3\text{W}}{4\text{RTT}}\) in bytes per second, where:

Internet layer

Control plane

Responsible for routing datagram from source to destination based on network topology. there are two common techniques to employ the control plane:

Data plane

Responsible for forwarding packet to an output port based on the router's pre-determined forwarding

Router architecture

Input port

HOL Blocking

Head Of the Line Blocking; when the datagram queued at the head of the decentralised layer prevents queue from continuing on the next packet time

Switching fabrics

Bus Contention Contesa di bus バス競合

Output port

Drop policy

Priority of which datagrams to drop from buffer if the buffer is going to overflow

Packet Queuing Techniques

Buffer Management

Time To Live (TTL)

Amount of hops a packet may take before being discarded by a router, this is used to alleviate network traffic as some packets may be caught in infinite loops

Internet Protocol (IP)

Internet/network protocol used for addressing and routing, characterised by the use of an IP address and defined by the following header:

There are two distinct standards for IP which have notably different address structurs along with other features:

IPv4 address

32 bit address split into 4 octets separated by a '.', represented as binary or decimal

116.255.5.177

IPv6 address

128 bit address split into 8 quartets separated by a ':' (or for trailing 0 octets, ::``), represented as hexadecimal. IPv6 differs from IPv4 in a variety of ways:

2401:d002:8307:af00:87e5:93ca:4814:48f8

Internet Control Message Protocol (ICMP)

Internet/Network protocol for error and operational reports, encapsulated in IPv4

IPsec

Internet/network protocol Encrypting IP packets and authenticating source. It has two modes:

Routing schemes

Subnetting

Subnet mask

4 part octet where each bit that is 1 represents the network part of an IP, and each bit that is 0 represents the host part of the IP

IP class

Original 5 different classifications of IPv4 addresses, denoted as letters from A to E

Classless interdomain routing (CIDR)

IP allocation method for routing based on subnet rather than class

CIDR suffix

'/' followed by the number of bits available in the subnet

Local IP assignment

Dynamic Host Configuration Protocol (DHCP)

Application Protocol that assists in a variety of tasks:

IP forwarding

Determining whether to forward a datagram on same subnet or another based on whether they are on the same subnet

Forwarding Table

Table that maps IP ranges (expressed by an IP and a subnetmask) to specific router interface

Route aggregation

Using hierarchy of routers with different subnets and their own forwarding table to speed up addressing

Longest Prefix matching

When forwarding table shows multiple interfaces to forward to, choose result with larger subnetmask (smaller range of IPs)

Network Address Translation (NAT)

Translating a WAN IP/port with a LAN IP/port. Was controversial for it's ability to manipulate port numbers and use routers above the 3rd OSI layer, but is now contemporarily used.

Tunneling

Wrapping or "encapsulating" an IPv6 header inside an IPv4 header to send IPv6 packets on IPv4 routers

Interface

Output physical port in a forwarding table

Graph theory representation of routing

Let a network of routers be a weighted graph, the problem of intra-AS routing can be reduced to the shortest path problem, defining:

Link cost

Edge weight \(w \in W\) based on physical link's bandwidth, calculated differently for different IGP

Autonomous System (AS)

Also called a domain, a region of a collection of routers

Gateway router

Router serving as an edge into another AS, that can perform intraAS (routing within AS) and interAS (routing to another AS)

Routing protocols

Application protocols that generates optimised path for data in a network.

Link state routing

Class of IGP routing protocols where routers share their knowledge of a network to all routers in the network and use Dijkstra's algorithm to determine optimal path

Distance vector routing

Class of IGP routing protocols where routers can only compute link cost to its immediate neighbours and use Bellman-Ford algorithm to determine optimal path

Path vector routing

Class of EGP routing protocols

Border Gateway Protocol (BGP)

Protocol used to share routing information aggregately from getting from one AS to another

BGP routes

BGP messages

BGP advertising policy

BGP can advertise routes by a certain criteria

Simple Network Management Protocol (SNMP)

Network management protocol that reports and logs the status of devices on an AS. it has the following message types:

Link layer

Link Categories

Types of communication

Interference Interferenza 干渉

Cyclic Redundancy Check (CRC)

Error checking algorithm by verifying that the message represented as a polynomial plus the generator ponlynomial minus the transmitted remainder is divisible by the generator polynomial over the finite field \( (\{0,1\},+,\times)\)

\(m_{T} = m_{R} \iff m_{R}+g-r \equiv 0 \mod g\)

This error checking method utilizes modern algebra to use divisibility to infer two numbers are identical. It is a useful algorithm as the 'minus' operation finite field \( (\{0,1\},+,\times) \) is actually has the same definition as the XOR orerator \( \oplus \). In fact, \( \oplus \) is also the same as the 'addition' operator on the finite field, so the finite field can be represented like \( (\{0,1\},\oplus,\times) \). This XOR equivalence makes CRC convenient to implement on a hardware level (i.e, in CPUs)

Parity checking

Adds extra bit to each byte which is 1 if amount of 0s and 1s is even and 0 if they aren't. If the parity doesn't match the signal is retransmitted

Hamming code

Adds extra bit to each byte which is 1 if amount of 0s and 1s is even and 0 if they aren't. If the parity doesn't match the signal is retransmitted

Ideal Multiple Access Protocol

Multiple Access Protocol

Distributed algorithm that determines how nodes share a channel, this protocol occurs on the channel in question itself too

MAC protocol Taxonomy

Can either be:

Hamming code

A matrix of bits where the parity of each row and column is examined, this allows to identify and change errors of 1 bit and identify 2 bit errors

TDMA

Time Division Multiple Access; dividing access to channel in fixed rounds

FDMA

Frequency Division Multiple Access; dividing access to channel by fixed frequencies

Pure ALOHA

Random Access Multiple Access Protocol where data is just transmitted with strong error checking

SLotted ALOHA

Random Access Multiple Access Protocol where data is transmitted with strong error checking, but on collision, transmit frame in subsequent slot with randomly with probability \(p\). There are some notable forumae:

Efficiency analysis

For transmission probability \(p\) and amount of nodes \(n\) \(s(p)=np(1-p)^{n-1}\) is the probability that some node transmits without collision

For some network, we would like to set the transmission probability as \(p^{*} : \forall p \in [0,1], s(p^{*}) \geq s(p) \) to optimise success.

Finding the maxima by solving \(\frac{ds(p^{*})}{dp} = 0\) results in \(p^{*}= \frac{1}{n}\)

Substituting this optimised parameter and taking the limit for infinite nodes results in \(\lim_{n \to \infty} n(\frac{1}{n})(1-(\frac{1}{n}))^{n-1}= \frac{1}{e}\)

Carrier Sence Multiple Access (CSMA/CD)

Random Access MAC protocol that checks if data is being sent on a LAN, if not, the data is sent

Polling

When master node invites other nodes to submit when it is their turn

Token ring

Collision checking on a ring topology, only node with the token can transmit data

Media Access Control (MAC)

Portion of data-link layer responsible for interaction between linked devices

MAC address

48 bit address split into 6 octets separared by either a identifying the the NIC of a device and its IEEE standard.

MAC addresses have the following parts:

Address Resolution protocol (ARP)

Data-Link protocol that translates local IP addresses with MAC address. It works by broadcasting an ARP request on the LAN for an IP and the node that has the matching IP will respond and the router will successfully populate the ARP table

Topology

Link structure of a network

Link wiring

Straight Through

For non-similar devices

Crossover cable

Cable where both terminals have different color configurations. This is used for connecting two devices that have the same input and output pins

Ethernet (IEEE 802.3)

Wired LAN technology with speeds of 10Mbs-400Gbps, may use a bus or switched (star) topology. Various types, such as copper (twisted pair) or fiber

Power over Ethernet (PoE)

Switch feature that employs unused wires in ethernet cables as power cables

Ethernet frame

Network Interface Card (NIC)

Card in device that handles transmission and reception of bits on a network

Networking hardware

Switch table

Table used to map MAC addresses with interface and its TTL, it is able to do this by "self-learning"

Self-learning

Process used to build switch table

Mobile networks

Wi-Fi (IEEE 802.11)

RF

Service Set Identifier (SSID)

Assignable name of a Wi-Fi network

Wireless encryption protocols

Wireless encryption protocols

Cisco

CDP

Cisco Discovery Protocol

Uncategorised

RFC1918

Network Attached Storage (NAS)

SS7

Global Title (GT)

Public Switched Telephone Network (PSTN)

Subsriber Identity Module card (SIM card)

International Mobile Subscriber Identity (IMSI)

15 digit ID that identifies a SIM card

Share

File on a server

Network File System (NFS)

Network File System; File system over a server

DFS

Distributed File System

RSS

Really Simple Syndication; a web feed system that can be used with HTML

AWS

Amazon Web Services; Hosted computing through servers, let you set up VPSs

SSE

Server send events, signals sent between multiple servers, used in the handshake process.

IEEE

Institute of Electrical and Electronics Engineers; Institution that creates the networking standards

Telnet

COM

Communication port

LPT

Line printer terminal; used for connecting printers physically

DSS

Direct Station Selection; Allows for phone number extensions (making it possible to transfer call to other people on a network)

NTLM

NT LAN Manager; security protocols for Windows NT OS

TGT

Ticket Granting Ticket

TGS

Ticket Granting Server

AS

Authentification Server

KDC

Key Distribution Center; third party including the TGS and AC