FormularioInternet and Security: definizioni, teoremi e formule delle note, in ordine di capitolo
In questa pagina 7
I. Fundamentals and Performance
Network Types and Topologies
Formula (links in a complete mesh). With nodes, physical links are needed (full duplex).
Grafico interattivo: Number of links versus number of nodes n: the star grows linearly (n - 1), the complete mesh with the square (n(n - 1)/2); for n = 5 they are 4 and 10, for n = 10 they are 9 and 45
Circuit Switching and Packet Switching
Formula (delivery time in CS). With links (hops) between sender and receiver, propagation time per link, switching time per node, a message of bits and bitrate :
Formula (delivery time in datagram PS). A message of bits split into packets, each with a header of bits (so packets of bits), equal links of bitrate and propagation , no queues or processing:
Formula (optimal number of packets). Expanding, ; differentiating with respect to and setting to zero: , hence
Grafico interattivo: Delivery time T_PS (seconds) versus number of packets K, with N = 4, M = 1 Mbit, H = 400 bit, R = 10 Mbit/s, tp = 1 ms: minimum near K = 87 (about 0.111 s); at K = 1 it is 0.404 s
Network Performance Analysis
Formula (end-to-end delay). The time to deliver a message to the destination, from the instant the first bit leaves the source, is the sum of four contributions:
Formula (transmission delay). To put all bits of a packet of length on the line (one bit after the other) at bitrate :
Formula (propagation delay). Time for a bit to go from one end of the medium to the other, at speed over distance : In vacuum m/s; in cables m/s (copper and fibre: light in the medium goes at with refractive index ).
Introduction to Queueing Theory
Formula (distribution and mean number in the system, M/M/1). The number of customers in the system is geometric:
Grafico interattivo: Distribution of the number of customers in the M/M/1 system with rho = 0.8: p(n) = 0.2*0.8^n, decreasing geometric (p(0) = 0.2 = 1 - rho, p(1) = 0.16, p(2) = 0.128); the mean is rho/(1-rho) = 4
Formula (queue and times, M/M/1). Removing the number in service () from the number in the system: With Little:
Formula (M/G/1 with constant service).
Grafico interattivo: Normalized mean system time E[s]*mu versus load factor rho: M/M/1 (1/(1-rho)) and constant service (1 + rho/(2(1-rho))). Both diverge as rho tends to 1
II. Link Layer
Multiple Access Protocols - ALOHA and CSMA
Formula (minimum frame duration in CSMA/CD). To be sure a transmission succeeded,
Grafico interattivo: Space-time diagram of the CSMA/CD worst case (position on the x axis from A at 0 to B at 1; time on the y axis in units of tau_p): A starts at t = 0, B starts at t = tau_p, just before sensing A; the collision reaches A at t = 2 tau_p, so A must still be transmitting
Performance of Multiple Access Protocols
Formula (throughput of pure ALOHA).
Formula (mean delay of pure ALOHA).
Formula (throughput of slotted ALOHA).
Grafico interattivo: Throughput S versus offered load G: pure ALOHA S = G e^(-2G) (maximum 0.18 at G = 0.5) and slotted ALOHA S = G e^(-G) (maximum 0.37 at G = 1)
Formula (throughput of non-persistent CSMA). The throughput is the mean useful time per cycle over the mean cycle duration :
Grafico interattivo: Normalized throughput of non-persistent CSMA for different normalized propagation delays a = tau_p/t_F, compared with slotted ALOHA (G axis in log scale)
Formula (mean delay of non-persistent CSMA).
Formula (mean delay of TDMA).
Formula (mean delay of FDMA).
LAN - Ethernet and Wi-Fi
Formula (minimum frame size). A frame of size with bitrate lasts . To detect the collision it must hold , i.e.
ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective Repeat
Formula (Stop-and-Wait).
Formula (Go-Back-N, window ).
Formula (Selective Repeat).
Formula (goodput of Selective Repeat as a function of ).
Formula (optimal frame size).
Grafico interattivo: Selective Repeat efficiency eta(x) = (x - o)/x * (1 - Pb)^x with overhead o = 50 bit: maximum 0.62 at x = 250 bit for Pb = 0.001 and 0.18 at x = 100 bit for Pb = 0.01
III. Network Layer
Network Layer and IPv4 Addressing
Formula (CIDR block ). addresses; network address = first bits unchanged and the rest set to 0; broadcast = first bits unchanged and the rest set to 1; usable hosts .
Formula. , network , broadcast . An address belongs to the network with address and mask if and only if .
IPv4 Datagram and Fragmentation
Formula (checksum). Sum all 16-bit header words (checksum field set to 0), add any carry beyond 16 bits back to the result (one's complement), and take the bitwise NOT. At the receiver the sum of all words, checksum included, must be .
Formula. With total length , header (usually 20) and MTU : payload ; maximum payload per fragment ; number of fragments ; offset of fragment (from 0) .
Subnetting, VLSM and Supernetting
Formula. From a network with prefix , borrowing bits for the SubnetID gives new prefix , subnets, each with addresses, i.e. usable hosts.
Formula. , , .
Routing Algorithms - Link State and Distance Vector
Formula (Bellman-Ford update). Node receives from neighbour the estimates . For every destination : If the path through is shorter, store the new cost and next hop . is the direct link cost to .
ICMP, Ping and Traceroute
Formula (ICMP checksum). As for IP: one's complement of the one's complement sum of the 16-bit words, with the checksum field set to 0.
IV. Transport Layer
UDP - User Datagram Protocol
Formula. . Example: length 12 carries bytes.
Formula. Sum all 16-bit words of pseudo-header, header (checksum field ) and data (pad with a zero byte if the data length is odd), fold the carry back (one's complement), and take the bitwise NOT. The receiver sums everything, checksum included: with no error the result is .
TCP - Connection, Reliability and Flow Control
Formula. (20-byte headers).
Formula. ; a new byte can be sent if . rwnd depends on the receiver, cwnd on the network.
Formula. .
Formula (maximum throughput).
TCP Congestion Control
Formula (Jain fairness index). For flows with rates : It is 1 if all rates are equal and if one flow uses everything.
Formula. .
Formula. With blocks the option length is bytes. Options are at most 40 bytes, so (); with the timestamp option (12 bytes) only 28 bytes remain and .
TCP Retransmission Timeout Estimation
Formula (SRTT).
Formula (MAD).
Formula (RTO).
Analytical Model of TCP Send Rate
Formula.
Formula (mean window).
Formula (mean duration). .
Formula (square root).
Formula (general form).
Formula.
Formula (full model).
Formula (approximate model).
Formula (window cap).
V. Application Layer
DNS - Domain Name System
Formula (resolution time with empty cache). Each question-answer pair costs one RTT with its partner (DNS messages are tiny, so RTT ): . With a fraction of requests answered from the local DNS cache, .
HTTP and the Web
Formula (page with embedded objects, objects in all, transmission times neglected).
- non-persistent: ;
- persistent without pipelining: ;
- persistent with pipelining: .
Formula (mean time with a cache). With hit ratio : , where (the cache is always crossed).
VI. Network Security
Hash Functions and Symmetric Cryptography
Formula (Diffie-Hellman). Alice and Bob agree on a large prime (e.g. 2048 bits) and a generator (small). A picks and sends ; B picks and sends . A computes , B computes , and .
Formula (HMAC). With the hash block size (usually 64 bytes) and padded with zeros to : with and repeated times. Two hashes are used because with Merkle-Damgård hashes, knowing allows computing the hash of without (length extension); the outer hash prevents it.
Public-Key Cryptography, RSA and TLS
Formula (RSA key generation).
- Choose two large primes and .
- .
- .
- Choose with .
- , so .
Public key ; secret key ; the secrets are never shared.
Formula (encryption and decryption). For : , .
VII. Katharà Laboratory
Emulating Networks with Katharà
Formula.
ifconfig <interface> <address> netmask <mask> broadcast <broadcast address> [mtu <bytes>] up, equivalent toifconfig eth0 <address>/<length> up.
Static Routing and Diagnostic Tools in Katharà
Formula.
route add -net <network>/<prefix> gw <next hop> dev <interface>: "the network is reached through the next hop leaving from the interface". The next hop must be in a network directly connected to that interface.
RIP and Advanced Routing in Katharà
Formula (RIP metric). The metric is the number of routers crossed to reach the network: for connected networks, plus at each router forwarding the advertisement; means unreachable. The administrative distance of RIP is .
Cisco Routers
Formula.
ip route <network> <mask> <next hop>: "to reach<network>/<mask>send to<next hop>", with the mask in full. The default route is network0.0.0.0with mask0.0.0.0.
Firewall Configuration with iptables in Katharà
Formula (filter rule).
iptables --table filter --append CHAIN [criteria] --jump TARGET: adds at the end of the chain a rule applying the target to packets satisfying all the criteria.