Salta al contenuto
Note per Studenti Internet and Security - Mock Exam 1 Report

Internet and Security - Mock Exam 1

Questa pagina non ha ancora la versione ripasso: qui sotto c'è il testo completo.

In questa pagina 13

Mock exam built on the model of the written exams of the Internet course of Padova: the four exams of 2019-20 and the official simulations of 2024-25 (numerical exercises of 12 and 8 points: queues and TCP, addressing and forwarding). The official exam of Internet and Security has a written test in two modules, theory (questions on the course) and practice (network exercises like the ones done in class), plus a laboratory test. The theory module of the real exams is not public and the laboratory test is not simulated here: the questions below are written on the notes of this course, and the numbers of questions, the points and the duration are our proposal, not an official rule.

  • Theory module: 10 points. Ten questions with four options and exactly one correct answer, 1 point each, at least four on Network Security (here five: Quiz 6 to Quiz 10).
  • Practical module: 20 points. Exercise 1 (12 points) and Exercise 2 (8 points).
  • Total 30 points, duration 2 hours. For the practical module we propose books, notes and a calculator; for the theory module nothing.

Every result was checked with a program: the quiz computations (bit stuffing, delays, SHA-256 blocks, Diffie-Hellman), an event-by-event simulation of the queues (UDP, with and without TCP), the round model of TCP Reno and its first events, and the Python module ipaddress for subnets (disjoint, aligned, capacities, aggregation) and the longest prefix match.

Theory module

Quiz 1

Four hosts download files from four different servers at the same time through a common link of capacity 66 Mbit/s. Each server has an access link of 55 Mbit/s and each client an access link of 22 Mbit/s. All other links are much faster. What is the throughput of each download, if the common link is shared equally?

  • A) 22 Mbit/s
  • B) 66 Mbit/s
  • C) 1.51.5 Mbit/s
  • D) 33 Mbit/s
Show the result

Answer C.

Show the full solution

The throughput of a path is the minimum bitrate along it, but a shared link splits its capacity among the flows (Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →). Here the common link gives 6/4=1.56/4=1.5 Mbit/s to each of the four downloads. Comparing 1.51.5 Mbit/s with the access links (55 Mbit/s for the servers, 22 Mbit/s for the clients), the smallest value is 1.51.5 Mbit/s: the shared link is the bottleneck and each download runs at 1.51.5 Mbit/s.

The other options: A takes the client access as the bottleneck, forgetting that the common link is shared; B is the capacity of the common link as if it were used by one flow; D would be right for two downloads (6/26/2).

Quiz 2

A packet of 15001500 bytes crosses three links in series with store-and-forward routers. The links have bitrates 1212, 66 and 33 Mbit/s and propagation delays 11, 22 and 33 ms. Neglecting processing and queueing, what is the delay from the first bit sent to the last bit received?

  • A) 1313 ms
  • B) 1010 ms
  • C) 77 ms
  • D) 1818 ms
Show the result

Answer A: 1313 ms.

Show the full solution

With store-and-forward each router receives the whole packet before forwarding it, so every link adds its own dtrans+dpropd_{trans}+d_{prop} (Circuit Switching and Packet SwitchingA switching node can connect input to output in three ways. Circuit switching sets up a dedicated physical connection first (telephone network), delivery time T = 3N t_p + N t_s + M/R. Datagram packet switching splits the message into K packets with a header, each routed independently with store-and-forward, T = N t_p + (N+K-1)(M/K+H)/R, with optimal K = sqrt((N-1)M/H). Virtual circuit has three phases (setup, data, teardown): a dedicated logical connection without dedicated resources, with a local identifier that changes at each hop.Circuit Switching and Packet Switching →, Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →). The packet is 1500⋅8=12 0001500\cdot8=12\,000 bit, so dtrans=L/Rd_{trans}=L/R gives

1 ms,2 ms,4 ms1\ \text{ms},\qquad 2\ \text{ms},\qquad 4\ \text{ms}

on the three links, in total 77 ms; the propagation delays add 1+2+3=61+2+3=6 ms. Total 7+6=137+6=13 ms.

The other options: B counts only the slowest transmission (44 ms) plus the propagation; C forgets the propagation delays (the text gives them, so they must be included); D uses the bottleneck transmission time on every link, 3⋅4+6=183\cdot4+6=18 ms.

Quiz 3

The data link layer of a link uses bit stuffing with flag 01111110: the sender inserts a 0 after every five consecutive 1 of the data. The data field is

0111111011111011111111100111110

(3131 bits). How many bits are sent after stuffing?

  • A) 3333 bits
  • B) 3434 bits
  • C) 3636 bits
  • D) 3535 bits
Show the result

Answer D: 3535 bits (four stuffed zeros).

Show the full solution

The sender scans the data from the left, counts the consecutive 1 and inserts a 0 as soon as the count reaches five, then restarts the count (Data Link Layer and FramingThe data link layer (DLL) delivers a frame from a node to an adjacent node over a link. Services: framing, medium access (MAC) with 48-bit MAC addresses, flow control, error detection and correction. It splits into DLC (framing, error and flow control) and MAC (shared medium access). Framing delimits frames with a flag: byte-oriented protocols (8-bit flag, ESC) use byte stuffing, bit-oriented ones (flag 01111110) use bit stuffing, which inserts a 0 after every five consecutive 1s.Data Link Layer and Framing →). The data are made of the runs

0 , 111111 (six 1) , 0 , 11111 (five) , 0 , 111111111 (nine) , 00 , 11111 (five) , 0 .

  • the run of six: after the fifth 1 a 0 is inserted, the sixth 1 is then alone (count 11): one inserted bit;
  • the run of five: one inserted bit (after the fifth 1, even if the next data bit is already 0);
  • the run of nine: five 1, inserted 0, then four 1 (the count restarts, four is below five): one inserted bit;
  • the last run of five: one inserted bit.

Four bits are added: 31+4=3531+4=35. The stuffed frame is 01111101011111001111101111001111100, and the receiver removes every 0 that follows five 1 and gets the 3131 original bits back.

The other options come from missing or inventing insertions: A and B forget the runs of exactly five (a run of five also needs the extra 0) or count too few runs; C invents one more, for example a second insertion in the run of nine (after the first insertion the count restarts, and four 1 are below five).

Quiz 4

A shared Ethernet-like segment works at 100100 Mbit/s with CSMA/CD. The maximum distance between two stations is 400400 m and the signal speed is 2⋅1082\cdot10^{8} m/s. What is the minimum frame size that guarantees that a collision is always detected while the frame is being sent?

  • A) 2525 bytes
  • B) 5050 bytes
  • C) 400400 bytes
  • D) 6464 bytes
Show the result

Answer B: 400400 bit =50=50 bytes.

Show the full solution

A station is sure that its frame did not collide only after a round trip: the frame must last at least 2Tp2T_p (LAN - Ethernet and Wi-FiA LAN covers a limited area and is defined by the IEEE 802.x family (802.3 Ethernet, 802.11 Wi-Fi), which splits the link layer into LLC and MAC. Ethernet is connectionless, with no flow control and no ACK; it uses 1-persistent CSMA/CD; the frame is 64 to 1518 bytes (6-byte addresses, type/length, data 46-1500, 4-byte CRC) and the 64 B minimum comes from t_F >= 2 tau_p. From 10 Mbit/s on coax up to 10 Gbit/s on fibre, with full-duplex switches removing collisions. Wi-Fi (802.11) uses CSMA/CA, has BSS (with access point) and ad hoc modes, EBSS with a distribution system, adapts its bitrate to the SNR, and has hidden and exposed terminal problems, partly solved by RTS/CTS and NAV.LAN - Ethernet and Wi-Fi →). Here Tp=d/v=400/(2⋅108)=2 μT_p=d/v=400/(2\cdot10^{8})=2\ \mus, so 2Tp=4 μ2T_p=4\ \mus and

Smin=C⋅2Tp=108 bit/s⋅4⋅10−6 s=400 bit=50 bytes.S_{min}=C\cdot2T_p=10^{8}\ \text{bit/s}\cdot4\cdot10^{-6}\ \text{s}=400\ \text{bit}=50\ \text{bytes}.

The other options: A uses the one-way propagation only (200200 bit); C is 400400 bit read as bytes (always convert before dividing: bits are divided by 88); D is the minimum frame of the real standard (6464 bytes), a design value that keeps a margin for repeaters and is not the result of this computation.

Quiz 5

A stop-and-wait protocol sends frames of 40004000 bit on a link of 88 Mbit/s, with one-way propagation delay of 66 ms. The acknowledgment is so short that its transmission time is negligible. What is the efficiency of the link?

  • A) 7.7 %7.7\,\%
  • B) 96 %96\,\%
  • C) 4 %4\,\%
  • D) 2 %2\,\%
Show the result

Answer C: η=1/25=4 %\eta=1/25=4\,\%.

Show the full solution

The frame lasts tF=4000/(8⋅106)=0.5t_F=4000/(8\cdot10^{6})=0.5 ms, so the normalized propagation is a=τp/tF=6/0.5=12a=\tau_p/t_F=6/0.5=12. In a cycle of tF+2τpt_F+2\tau_p the channel is busy only for tFt_F (Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →, ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective RepeatARQ (Automatic Repeat reQuest) makes an error-prone link reliable: the receiver acknowledges (ACK) frames received correctly and the sender retransmits when the timeout expires. Timeouts (against deadlock) and sequence numbers (against duplicates) are needed. With t_G = t_F + 2 tau_p + t_A and error probability p: Stop-and-Wait rho = t_F(1-p)/t_G; Go-Back-N with window N >= t_G/t_F rho = (1-p)/(1+(N-1)p); Selective Repeat rho = 1-p. Efficiency eta = rho I/F. The optimal window is the pipe capacity in packets. For Selective Repeat there is also an optimal frame length: with overhead o and bit error probability P_b, x_opt is about o/2 + sqrt(o/P_b) (shorter frames when the channel errs more).ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective Repeat →):

η=tFtF+2τp=11+2a=125=0.04.\eta=\frac{t_F}{t_F+2\tau_p}=\frac1{1+2a}=\frac1{25}=0.04.

The other options: A is 1/(1+a)1/(1+a), forgetting that the ACK also crosses the link (2τp2\tau_p); B is the idle fraction 1−η1-\eta; D doubles the propagation twice (1/(1+2⋅24)1/(1+2\cdot24)).

Quiz 6

A file of 40004000 bytes is hashed with SHA-256. The hash works on blocks of 512512 bit; the last block is completed by padding made of a bit 1, zeros and the length of the message on 6464 bit. How many blocks are processed and how long is the digest?

  • A) 6262 blocks, digest of 256256 bit
  • B) 6363 blocks, digest of 256256 bit
  • C) 6363 blocks, digest of 512512 bit
  • D) 125125 blocks, digest of 256256 bit
Show the result

Answer B.

Show the full solution

The message has L=4000⋅8=32 000L=4000\cdot8=32\,000 bit. With the padding we need L+1+64=32 065L+1+64=32\,065 bit, and ⌈32 065/512⌉=⌈62.63⌉=63\lceil32\,065/512\rceil=\lceil62.63\rceil=63 blocks (Hash Functions and Symmetric CryptographyEncryption turns plaintext into ciphertext with a key; hash functions give a fixed-length one-way digest used for integrity and passwords; symmetric ciphers (Caesar, Vigenere, DES, AES with block modes) share one secret key, exchanged for example with Diffie-Hellman; MAC and HMAC authenticate messages with a shared key.Hash Functions and Symmetric Cryptography →). The output of a hash function has a fixed length whatever the input: 256256 bit =32=32 bytes for SHA-256.

The other options: A forgets the padding, rounding 32 000/512=62.532\,000/512=62.5 down; C confuses the digest with the block size; D uses 256256 bit blocks (32 000/256=12532\,000/256=125): the block is 512512 bit, 256256 is only the digest.

Quiz 7

Alice and Bob use Diffie-Hellman with p=19p=19 and g=2g=2. Alice chooses the secret x=5x=5 and Bob the secret y=7y=7. An eavesdropper sees pp, gg and the two messages exchanged. What is the shared key?

  • A) 1010
  • B) 1111
  • C) 1616
  • D) 88
Show the result

Answer A: K=10K=10.

Show the full solution

Alice sends L=gx mod p=25 mod 19=32 mod 19=13L=g^x\bmod p=2^5\bmod19=32\bmod19=13. Bob sends M=gy mod p=27 mod 19=128 mod 19=14M=g^y\bmod p=2^7\bmod19=128\bmod19=14. Alice computes K=Mx mod p=145 mod 19K=M^x\bmod p=14^5\bmod19, Bob K′=Ly mod p=137 mod 19K'=L^y\bmod p=13^7\bmod19; both equal gxy mod p=235 mod 19=10g^{xy}\bmod p=2^{35}\bmod19=10 (Hash Functions and Symmetric CryptographyEncryption turns plaintext into ciphertext with a key; hash functions give a fixed-length one-way digest used for integrity and passwords; symmetric ciphers (Caesar, Vigenere, DES, AES with block modes) share one secret key, exchanged for example with Diffie-Hellman; MAC and HMAC authenticate messages with a shared key.Hash Functions and Symmetric Cryptography →). Reducing at every step: 142=196≡614^2=196\equiv6, 144≡36≡1714^4\equiv36\equiv17, 145≡17⋅14=238≡10(mod19)14^5\equiv17\cdot14=238\equiv10\pmod{19}.

The eavesdropper would need xx from 2x≡13(mod19)2^x\equiv13\pmod{19}, a discrete logarithm. The other options are wrong combinations that do not correspond to the protocol: B is 2x+y mod 19=L⋅M mod 192^{x+y}\bmod19=L\cdot M\bmod19 (a product, not a power); C is xy mod 19xy\bmod19; D is L+M mod 19L+M\bmod19.

Quiz 8

In TLS 1.0 an attacker who records the traffic and later steals the private key of the server can read all the past sessions; with TLS 1.3 he cannot. Why?

  • A) Because the session key is sent encrypted with the public key of the server, which the attacker does not have.
  • B) Because the certificate of the server is renewed at every session.
  • C) Because the application data are encrypted with RSA, whose private key is used only to sign.
  • D) Because the session key is computed with ephemeral Diffie-Hellman values and the private key is used only to sign the handshake (forward secrecy).
Show the result

Answer D.

Show the full solution

In TLS 1.0 the client generates the session key and sends it encrypted with the public key of the server: whoever later obtains the private key can decrypt that message in the recording and recover the key of every past session. In TLS 1.3 the key is built with Diffie-Hellman (K=gcs mod pK=g^{cs}\bmod p from ephemeral values gcg^c and gsg^s) and the private key of the server only signs the handshake: the ephemeral exponents are discarded, so the stolen private key does not reveal KK (Public-Key Cryptography, RSA and TLSPublic-key cryptography uses a public key to encrypt and a private key to decrypt; certificates issued by a Certificate Authority bind identities to public keys; digital signatures give authenticity, integrity and non-repudiation; RSA relies on the difficulty of factoring; TLS combines certificates, a symmetric session key (derived with Diffie-Hellman since TLS 1.3) and MACs.Public-Key Cryptography, RSA and TLS →). This is called forward secrecy.

The other options: A describes exactly TLS 1.0, where the stolen private key does decrypt the session key; B is false (certificates last for months or years); C is false, because data are encrypted with a fast symmetric cipher and not with RSA.

Quiz 9

A stateless packet filter protects an internal host with the rules, read in order: (1) allow incoming TCP with destination port 2525; (2) allow incoming TCP with destination port above 10231023, to receive the replies of the connections started from inside; (3) deny everything else. Which of the following services of the internal host can still be reached from the outside?

  • A) SSH, port 2222
  • B) an X11 server, port 60006000
  • C) HTTP, port 8080
  • D) Telnet, port 2323
Show the result

Answer B.

Show the full solution

Rules are applied in order and the first match wins (FirewallsA firewall blocks unauthorised traffic between networks using header information of layers 2-4: stateless packet filters apply ordered rules per packet, stateful firewalls track connections (NEW, ESTABLISHED, RELATED, INVALID), application firewalls act as proxies; in Linux netfilter provides five hooks and iptables organises rules in tables and chains.Firewalls →). Ports 2222, 8080 and 2323 are neither 2525 nor above 10231023: they fall in rule 3 and are denied. Port 60006000 is above 10231023, so rule 2 admits it: the X11 server is reachable even if nobody wanted it. This is the weakness of a stateless filter: rule 2 cannot tell a reply to an internal connection from a new connection started by an attacker. Using the ACK flag in rule 2 helps only partly (a crafted packet with ACK=1\text{ACK}=1 still passes); a stateful firewall solves it with the ESTABLISHED state.

Quiz 10

A Linux router has eth0 towards the Internet and eth1 towards the LAN, with the commands

bash
iptables -P FORWARD DROP
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

What happens to a TCP SYN packet that arrives from the Internet for a host of the LAN, and to a TCP connection started by a LAN host towards the Internet?

  • A) The SYN is dropped by the default policy; the connection started from the LAN works, and its replies are accepted.
  • B) The SYN is forwarded, because the destination is a host of the LAN.
  • C) The SYN is dropped and the sender receives an ICMP message; the LAN connections do not work.
  • D) The SYN is accepted as RELATED to existing traffic; the LAN connection works.
Show the result

Answer A.

Show the full solution

The packet from the Internet enters from eth0: the second rule requires -i eth1, and the third requires the connection state ESTABLISHED or RELATED, while the first packet of a connection is NEW (FirewallsA firewall blocks unauthorised traffic between networks using header information of layers 2-4: stateless packet filters apply ordered rules per packet, stateful firewalls track connections (NEW, ESTABLISHED, RELATED, INVALID), application firewalls act as proxies; in Linux netfilter provides five hooks and iptables organises rules in tables and chains.Firewalls →, Firewall Configuration with iptables in KatharàLab 6 configures a packet-filter firewall on Linux with iptables (NetFilter): tables filter, nat, mangle and raw hold chains of rules, the first matching rule wins, otherwise the default policy applies; three experiences cover a firewall protecting a host (INPUT with DROP policy plus loopback, ping, SSH and ESTABLISHED,RELATED), a firewall on a LAN router (FORWARD) and NAT with SNAT and DNAT.Firewall Configuration with iptables in Katharà →). No rule matches, so the default policy DROP discards it silently (no ICMP message: that would be REJECT). A SYN from a LAN host comes in from eth1 and goes out to eth0: rule 2 accepts it, and the replies, which belong to a tracked connection, are accepted by rule 3 as ESTABLISHED.

The other options: B ignores the default policy; C confuses DROP with REJECT and wrongly blocks the LAN; D is wrong because the SYN opens a new connection (state NEW), it is not related to any existing one.

Practical module

Exercise 1 (points 12)

Host A and host B are connected through two routers: A, R1, R2, B in a chain, with three links. The routers are store-and-forward, have FIFO output queues with buffers large enough never to lose a packet, and neglect processing times. The links are:

Link Ends Capacity Propagation
C1C_1 A - R1 2020 Mbit/s 22 ms
C2C_2 R1 - R2 44 Mbit/s 66 ms
C3C_3 R2 - B 1010 Mbit/s 22 ms

Neglect any other traffic, the headers of every layer, and the length of the acknowledgments and of the connection-opening segments (only their propagation counts). Packets and segments have length L=MSS=1250L=\text{MSS}=1250 bytes. A must send to B a message of M=100M=100 kbyte, that is 100 000100\,000 bytes.

(a) (3 points) At the transport layer UDP is used and A sends all the datagrams back to back starting at t=0t=0. Compute the instant at which the last datagram arrives at B, the average throughput, and how long the last datagram waits in the queue of R1 before starting on C2C_2.

(b) (2 points) Compute the round trip time RTT\text{RTT}, the bandwidth-delay product BDP\text{BDP} of the path (in bits and in MSS) and the sender window swnd∗\text{swnd}^{*} that allows a continuous flow.

Now A and B use TCP Reno, with cwnd=1\text{cwnd}=1 MSS at the start, ssthresh=16\text{ssthresh}=16 MSS and receiver window rwnd=1\text{rwnd}=1 Mbyte. Every segment is acknowledged separately. Use the round model of the course: in each round the sender transmits its window back to back; the ACKs of a window come back spaced by the transmission time of the bottleneck, the first one an RTT\text{RTT} after the first segment; the next round starts when the first ACK of the previous round arrives. Data are sent as soon as possible after the opening (SYN, SYN+ACK, then the first segment with the last ACK of the handshake).

(c) (3 points) Compute the total time from the beginning of the opening to the reception of the last ACK, with no losses.

(d) (4 points) Repeat the computation when the 9th segment of the message is lost on C2C_2 and no other segment is lost. The loss is detected by three duplicate ACKs: the sender retransmits the lost segment when the third duplicate ACK arrives; ssthresh\text{ssthresh} becomes W/2W/2, where WW is the window of the round in which the loss occurs; to keep the model simple, no new segment is sent during fast recovery; the cumulative ACK of the retransmitted segment ends fast recovery, sets cwnd=ssthresh\text{cwnd}=\text{ssthresh} and starts a new round in congestion avoidance. Give the window of each round, the instant of the third duplicate ACK and the final instant.

Show the result

(a) Last datagram at B at 211.5211.5 ms; throughput ≈3.78\approx3.78 Mbit/s; queueing in R1: 158158 ms.

(b) RTT=24\text{RTT}=24 ms; BDP=96\text{BDP}=96 kbit =9.6=9.6 MSS; swnd∗=10\text{swnd}^{*}=10 MSS.

(c) TTCP=300T_{\text{TCP}}=300 ms.

(d) Windows: 1,2,4,81,2,4,8; the 9th segment is lost in the round with W=8W=8; third duplicate ACK at 126126 ms; ssthresh=4\text{ssthresh}=4 MSS; ACK of the retransmission at 150150 ms; then 4,5,6,7,8,94,5,6,7,8,9 and from 294294 ms the continuous flow (cwnd≥10\text{cwnd}\ge10). TTCP=380.5T_{\text{TCP}}=380.5 ms.

Show the full solution

Basic data. A segment of 12501250 bytes is 10 00010\,000 bit, so dtrans=L/Cd_{trans}=L/C gives (Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →):

Link C1C_1 C2C_2 C3C_3
T=L/CT=L/C (ms) 0.50.5 2.52.5 11
τ\tau (ms) 22 66 22

The message is 100 000/1250=80100\,000/1250=80 segments. The bottleneck is C2C_2 (44 Mbit/s): Tb=2.5T_b=2.5 ms, the minimum spacing between two consecutive segments after it.

(a) UDP. There is no window, no ACK and no waiting: A sends the 8080 datagrams one after the other (UDP - User Datagram ProtocolUDP is the connectionless, unreliable transport protocol that adds to IP only process-to-process communication through ports and an optional checksum; its header is 8 bytes (source port, destination port, length, checksum), the checksum covers a pseudo-header (IP addresses, protocol 17, length), the UDP header and the data as a one's complement sum (0 means not computed and a computed 0 is sent as 0xFFFF), and UDP has no connection setup, sequence numbers, flow, error or congestion control, which makes it suitable for short messages (DNS, DHCP, RIP, SNMP) and real-time applications.UDP - User Datagram Protocol →). Datagram kk finishes on C1C_1 at 0.5k0.5k ms and arrives at R1 at 0.5k+20.5k+2 ms (Circuit Switching and Packet SwitchingA switching node can connect input to output in three ways. Circuit switching sets up a dedicated physical connection first (telephone network), delivery time T = 3N t_p + N t_s + M/R. Datagram packet switching splits the message into K packets with a header, each routed independently with store-and-forward, T = N t_p + (N+K-1)(M/K+H)/R, with optimal K = sqrt((N-1)M/H). Virtual circuit has three phases (setup, data, teardown): a dedicated logical connection without dedicated resources, with a local identifier that changes at each hop.Circuit Switching and Packet Switching →). Since C1C_1 is faster than C2C_2 the datagrams pile up in R1 and C2C_2 works without pauses (Introduction to Queueing TheoryA queueing system is made of an arrival process (Poisson, rate lambda), a queue and one or more servers with service rate mu. Offered load G = lambda/mu, load factor rho = lambda/(m mu): the system is stable only if rho < 1, and then the throughput is lambda (otherwise m mu). Little's law E[x] = lambda E[s] holds for any discipline. M/M/1: E[x] = rho/(1-rho), E[s] = (1/mu)/(1-rho), E[w] = (rho/mu)/(1-rho). With deterministic service (M/D/1, a special case of Pollaczek-Khinchin): E[w] = rho/(2 mu (1-rho)). The delay grows without bound as rho tends to 1.Introduction to Queueing Theory →): datagram kk starts on C2C_2 at 2.5+2.5(k−1)2.5+2.5(k-1) and ends at 2.5+2.5k2.5+2.5k ms. After C2C_2 the datagram needs 66 ms of propagation, 11 ms on C3C_3 (never a queue in R2: the datagrams arrive 2.52.5 ms apart and C3C_3 needs only 11 ms) and 22 ms of propagation. For the last datagram (k=80k=80):

2.5+2.5⋅80=202.5 ms (end on C2),202.5+6+1+2=211.5 ms.2.5+2.5\cdot80=202.5\ \text{ms (end on }C_2),\qquad 202.5+6+1+2=\mathbf{211.5\ \text{ms}}.

Equivalent: first datagram 0.5+2+2.5+6+1+2=140.5+2+2.5+6+1+2=14 ms plus (80−1) Tb=197.5(80-1)\,T_b=197.5 ms. Average throughput: 80⋅10 kbit=80080\cdot10\ \text{kbit}=800 kbit delivered in 211.5211.5 ms, so 800/211.5=3.78800/211.5=3.78 Mbit/s, a little below the 44 Mbit/s of the bottleneck because of the first 1414 ms.

Queue of R1. The last datagram arrives at R1 at 0.5⋅80+2=420.5\cdot80+2=42 ms, but it starts on C2C_2 only at 2.5+2.5⋅79=2002.5+2.5\cdot79=200 ms: it waits 200−42=158 ms200-42=\mathbf{158\ \text{ms}}. (At 4242 ms only 1515 datagrams have already left R1, one is being transmitted and 6464 are waiting, the last one included.)

Typical mistakes: using 7979 or 8181 spacings instead of 80−180-1; adding a final RTT (with UDP the time stops at the arrival); computing the queueing wait from t=0t=0 instead of from the arrival at R1.

(b) RTT, BDP and swnd∗\text{swnd}^{*}. Forward trip of one segment: T1+τ1+T2+τ2+T3+τ3=0.5+2+2.5+6+1+2=14T_1+\tau_1+T_2+\tau_2+T_3+\tau_3=0.5+2+2.5+6+1+2=14 ms. The ACK has negligible length, so it only has propagation: τ3+τ2+τ1=10\tau_3+\tau_2+\tau_1=10 ms. Then

RTT=14+10=24 ms,BDP=C2⋅RTT=4 Mbit/s⋅24 ms=96 kbit=9.6 MSS.\text{RTT}=14+10=\mathbf{24\ \text{ms}},\qquad\text{BDP}=C_2\cdot\text{RTT}=4\ \text{Mbit/s}\cdot24\ \text{ms}=96\ \text{kbit}=9.6\ \text{MSS}.

To keep the bottleneck always busy at least 9.69.6 segments must be in flight: swnd∗=⌈9.6⌉=10\text{swnd}^{*}=\lceil9.6\rceil=\mathbf{10} MSS (equivalently RTT/Tb=24/2.5=9.6\text{RTT}/T_b=24/2.5=9.6, TCP - Connection, Reliability and Flow ControlTCP is the connection-oriented, reliable transport protocol that turns IP's unreliable service into an ordered byte stream without errors or duplicates; the connection opens with a three-way handshake (SYN, SYN+ACK, ACK) and closes with FIN segments, bytes are numbered (sequence number = first byte of the segment, cumulative ACK = next byte expected), the sender may transmit min(rwnd, cwnd) unacknowledged bytes (rwnd, the receiver window in a 16-bit field, is flow control), errors are handled with checksum, ACKs, retransmission timeout and fast retransmit after three duplicate ACKs, and to fill the pipe the window must reach the bandwidth-delay product, with maximum throughput MSS times Wmax over RTT.TCP - Connection, Reliability and Flow Control →). Rounding down to 99 would leave the bottleneck idle for part of every RTT. With rwnd=1\text{rwnd}=1 Mbyte, much larger than the windows reached, swnd=cwnd\text{swnd}=\text{cwnd}.

(c) TCP without losses. Opening: SYN and SYN+ACK have negligible length, so only propagation counts: τ1+τ2+τ3=10\tau_1+\tau_2+\tau_3=10 ms in each direction, 2020 ms in total (not 1414 ms: there is no data segment to transmit yet). The first data segment leaves at t=20t=20 ms together with the last ACK of the handshake.

Windows. ssthresh=16\text{ssthresh}=16 MSS: slow start doubles the window every round, 1,2,4,8,161,2,4,8,16 (TCP Congestion ControlCongestion arises when fast links feed a slow one, router queues fill and packets are lost or delayed, possibly up to network collapse; TCP controls its congestion window cwnd using loss feedback (timeout or three duplicate ACKs): slow start doubles cwnd every RTT up to the threshold ssthresh, then congestion avoidance adds 1 MSS per RTT, and on a loss ssthresh becomes W/2; variants differ in reaction to three dupACKs: Tahoe restarts from cwnd=1, Reno uses fast recovery (ssthresh=cwnd/2, cwnd=ssthresh+3, +1 per further dupACK), NewReno handles partial ACKs and recovers several losses in one window, SACK acknowledges received blocks and resends only what is missing.TCP Congestion Control →). A round lasts one RTT while the window is below swnd∗=10\text{swnd}^{*}=10 (the sender sends and waits for the ACKs; 8 Tb=20<248\,T_b=20<24). The first four rounds start at 2020, 4444, 6868 and 9292 ms and send 1+2+4+8=151+2+4+8=15 segments. The fifth window is 16≥swnd∗16\ge\text{swnd}^{*}: from t=116t=116 ms the flow is continuous, one segment every TbT_b, for the remaining 80−15=6580-15=65 segments.

TTCP=20⏟opening+4 RTT+(65−1) Tb+RTT=20+96+160+24=300 ms.T_{\text{TCP}}=\underbrace{20}_{\text{opening}}+4\,\text{RTT}+(65-1)\,T_b+\text{RTT}=20+96+160+24=\mathbf{300\ \text{ms}}.

Reading the terms: 4 RTT4\,\text{RTT} are the rounds 1,2,4,81,2,4,8; the first of the 6565 segments leaves at 116116 ms and the last one 64 Tb64\,T_b later; the final RTT\text{RTT} brings back the ACK of the last segment (the exercise asks for the last ACK). Compared with UDP (211.5211.5 ms) TCP is slower by 88.588.5 ms: 2020 ms of opening, the slow start rounds in which the bottleneck is idle, and the last ACK.

(d) One loss detected by three duplicate ACKs. Segments are numbered from 11: round 1 sends segment 11; round 2 segments 22-33; round 3 segments 44-77; round 4, with window W=8W=8, segments 88-1515. The 9th segment is the second of round 4 and it is lost on C2C_2 (the bottleneck still spends its 2.52.5 ms on it, so the spacing of the following segments does not change). Round 4 starts at s4=92s_4=92 ms.

Detection. The ACK of segment mm of this round returns at s4+RTT+(m−8) Tbs_4+\text{RTT}+(m-8)\,T_b. Segment 88 arrives and its ACK returns at 92+24=11692+24=116 ms (asking for segment 99). Segments 1010, 1111, 1212 arrive out of order and each produces a duplicate ACK asking again for segment 99, at

116+2⋅2.5=121 ms,123.5 ms,126 ms.116+2\cdot2.5=121\ \text{ms},\qquad123.5\ \text{ms},\qquad126\ \text{ms}.

At the third duplicate ACK (t=126t=\mathbf{126} ms) Reno applies fast retransmit (TCP Congestion ControlCongestion arises when fast links feed a slow one, router queues fill and packets are lost or delayed, possibly up to network collapse; TCP controls its congestion window cwnd using loss feedback (timeout or three duplicate ACKs): slow start doubles cwnd every RTT up to the threshold ssthresh, then congestion avoidance adds 1 MSS per RTT, and on a loss ssthresh becomes W/2; variants differ in reaction to three dupACKs: Tahoe restarts from cwnd=1, Reno uses fast recovery (ssthresh=cwnd/2, cwnd=ssthresh+3, +1 per further dupACK), NewReno handles partial ACKs and recovers several losses in one window, SACK acknowledges received blocks and resends only what is missing.TCP Congestion Control →): it resends segment 99 at once, with ssthresh=W/2=8/2=4\text{ssthresh}=W/2=8/2=\mathbf{4} MSS (and cwnd=ssthresh+3=7\text{cwnd}=\text{ssthresh}+3=7 in fast recovery, but by our assumption no new segment is sent). Segments 1313, 1414, 1515 produce further duplicate ACKs, which only inflate cwnd\text{cwnd}.

Recovery. The retransmitted segment crosses the path in 1414 ms and arrives at 126+14=140126+14=140 ms. The receiver already holds segments 1010-1515, so it answers with a cumulative ACK that acknowledges everything up to segment 1515; it reaches A after the 1010 ms of the return trip, at 140+10=150140+10=\mathbf{150} ms (that is 126+RTT126+\text{RTT}). Fast recovery ends: cwnd=ssthresh=4\text{cwnd}=\text{ssthresh}=4 MSS and a new round starts in congestion avoidance.

After the recovery. Delivered: segments 11-1515, 1515 in all; 6565 remain. From 150150 ms the window grows by 11 MSS per round, 4,5,6,7,8,94,5,6,7,8,9, each lasting one RTT because W Tb≤9⋅2.5=22.5<24W\,T_b\le9\cdot2.5=22.5<24 ms:

Round start (ms) window (MSS) segments sent so far
1 2020 11 11
2 4444 22 33
3 6868 44 77
4 9292 88 (9th lost) 1515
recovery 126126 to 150150 no new segments 1515
5 150150 44 1919
6 174174 55 2424
7 198198 66 3030
8 222222 77 3737
9 246246 88 4545
10 270270 99 5454
11 294294 10≥swnd∗10\ge\text{swnd}^{*} continuous flow

The six rounds 4,5,6,7,8,94,5,6,7,8,9 send 3939 segments, so 65−39=2665-39=26 remain and they go in continuous flow from round 11 at 150+6⋅24=294150+6\cdot24=294 ms (the window has reached 10=swnd∗10=\text{swnd}^{*} and keeps growing). The last segment leaves (26−1) Tb=62.5(26-1)\,T_b=62.5 ms after the first of the continuous flow:

TTCP=294+(26−1)⋅2.5+RTT=294+62.5+24=380.5 ms.T_{\text{TCP}}=294+(26-1)\cdot2.5+\text{RTT}=294+62.5+24=\mathbf{380.5\ \text{ms}}.

The loss costs 380.5−300=80.5380.5-300=80.5 ms: 2424 ms of recovery round plus the slow regrowth of the window from 44 instead of 1616.

Grafico interattivo: Sender window (MSS) against time (ms): no loss (window 16 from 116 ms) and with the 9th segment lost (third duplicate ACK at 126 ms, ssthresh 4, congestion avoidance from 150 ms); dotted line: BDP = 9.6 MSS

Remark on the model. A real sender does not send the whole window at the beginning of the round: it releases the segments as the ACKs come back, one every TbT_b, and a simulation of this behaviour event by event, with the same assumptions, gives about 389.5389.5 ms for case (d), against 380.5380.5 ms of the round model (the third duplicate ACK at 126126 ms and the ACK of the retransmission at 150150 ms are the same). The exam convention, as in the official solutions, is the round model. For case (c) the two methods give exactly the same 300300 ms.

Typical mistakes: counting the opening as 1414 ms (the data are not there yet) instead of 2020 ms; taking swnd∗=9\text{swnd}^{*}=9; starting congestion avoidance from cwnd=1\text{cwnd}=1 after three duplicate ACKs (that is a timeout, or Tahoe: Reno restarts from ssthresh\text{ssthresh}); taking ssthresh=16/2\text{ssthresh}=16/2 from the old threshold instead of W/2W/2 with W=8W=8; forgetting that the third duplicate ACK arrives (j+2) Tb(j+2)\,T_b after the first ACK of the round, where j=2j=2 is the position of the lost segment; counting the lost segment as not delivered at the end.

Exercise 2 (points 8)

A company has the block 195.88.40.0/22195.88.40.0/22. Router R1 is connected to the Internet provider (the link to the provider is not part of the block: R1 has the address 203.0.113.2/30203.0.113.2/30 on it and the provider router has 203.0.113.1203.0.113.1), to the LAN Production with 300300 hosts, to the LAN Offices with 120120 hosts and, with a point-to-point link, to router R2. Router R2 is connected to the LAN Lab with 6060 hosts and to the LAN DMZ with 2828 hosts. The numbers of hosts do not include the router interfaces: every router has one address in each of its LANs.

(a) (3 points) Define the five subnets (the four LANs and the link R1-R2) using the smallest possible blocks and allocating from the largest to the smallest starting from the beginning of the block. For each subnet give network address, mask, direct broadcast address and maximum number of hosts. Assign to the router interfaces the first usable address of each LAN (on the link R1 has the first and R2 the second address).

(b) (3 points) Write the routing tables of R1 and R2 (apart from the directly connected networks) with the minimum number of rows, using route aggregation, and the row that the provider needs to reach the whole company.

(c) (2 points) How does R1 treat packets with the following destinations: 195.88.42.100195.88.42.100, 195.88.42.150195.88.42.150, 195.88.42.230195.88.42.230, 8.8.8.88.8.8.8? Say whether the delivery is direct or indirect, which interface and next hop are used, and what happens to the packet for 195.88.42.230195.88.42.230, an address not assigned to any host.

Show the result

(a)

Subnet Network Mask Broadcast Max hosts
Production 195.88.40.0/23195.88.40.0/23 255.255.254.0255.255.254.0 195.88.41.255195.88.41.255 510510
Offices 195.88.42.0/25195.88.42.0/25 255.255.255.128255.255.255.128 195.88.42.127195.88.42.127 126126
Lab 195.88.42.128/26195.88.42.128/26 255.255.255.192255.255.255.192 195.88.42.191195.88.42.191 6262
DMZ 195.88.42.192/27195.88.42.192/27 255.255.255.224255.255.255.224 195.88.42.223195.88.42.223 3030
Link R1-R2 195.88.42.224/30195.88.42.224/30 255.255.255.252255.255.255.252 195.88.42.227195.88.42.227 22

R1: 195.88.40.1/23195.88.40.1/23, 195.88.42.1/25195.88.42.1/25, 195.88.42.225/30195.88.42.225/30, 203.0.113.2/30203.0.113.2/30. R2: 195.88.42.226/30195.88.42.226/30, 195.88.42.129/26195.88.42.129/26, 195.88.42.193/27195.88.42.193/27.

(b) R1: 195.88.42.128/25195.88.42.128/25 via 195.88.42.226195.88.42.226; 0.0.0.0/00.0.0.0/0 via 203.0.113.1203.0.113.1. R2: 0.0.0.0/00.0.0.0/0 via 195.88.42.225195.88.42.225. Provider: 195.88.40.0/22195.88.40.0/22 via 203.0.113.2203.0.113.2.

(c) 195.88.42.100195.88.42.100: direct on the interface of Offices. 195.88.42.150195.88.42.150: indirect, next hop 195.88.42.226195.88.42.226, interface towards the link. 195.88.42.230195.88.42.230: indirect to the same next hop (aggregate row), then it loops between R2 and R1 until the TTL expires. 8.8.8.88.8.8.8: indirect, default route, next hop 203.0.113.1203.0.113.1.

Show the full solution

(a) Plan. The size of a subnet is the smallest power of 22, MM, with M≥hosts+2M\ge\text{hosts}+2 (Subnetting, VLSM and SupernettingSubnetting splits an address block into smaller subnets by lengthening the mask (2^s subnets when s bits are borrowed), supernetting does the opposite by shortening the prefix to merge contiguous blocks; design rules for variable-size subnets are power-of-two sizes M with M at least hosts plus 2, prefix 32 minus log2 M, and start addresses divisible by M (largest subnet first), while 2^j blocks of prefix n aggregate into one block of prefix n minus j only if contiguous and aligned.Subnetting, VLSM and Supernetting →, Network Layer and IPv4 AddressingThe network layer delivers datagrams host to host through routers (encapsulation, routing, forwarding); an IPv4 address is 32 bits split into a network prefix and a host suffix, and modern classless addressing (CIDR) gives a block of 2^(32-n) addresses from a.b.c.d/n, with network and broadcast addresses computed through the netmask.Network Layer and IPv4 Addressing →); the router interface is one more host, so M≥hosts+1+2M\ge\text{hosts}+1+2 for the LANs. The prefix is 32−log⁡2M32-\log_2M.

Subnet Hosts + router +2+2 MM Prefix Max hosts
Production 301301 303303 512=29512=2^{9} /23/23 510510
Offices 121121 123123 128=27128=2^{7} /25/25 126126
Lab 6161 6363 64=2664=2^{6} /26/26 6262
DMZ 2929 3131 32=2532=2^{5} /27/27 3030
Link R1-R2 22 44 4=224=2^{2} /30/30 22

The block 195.88.40.0/22195.88.40.0/22 goes from 195.88.40.0195.88.40.0 to 195.88.43.255195.88.43.255 (10241024 addresses). Allocating from the largest and keeping each start address a multiple of its size (so the start is automatically aligned):

  • Production: 195.88.40.0/23195.88.40.0/23 covers 40.040.0 to 41.25541.255 (the third byte takes 22 values, 512=2⋅256512=2\cdot256), broadcast 195.88.41.255195.88.41.255;
  • Offices: next free address 195.88.42.0195.88.42.0, a multiple of 128128: /25/25, from 42.042.0 to 42.12742.127, broadcast 195.88.42.127195.88.42.127;
  • Lab: next free 42.12842.128, multiple of 6464: /26/26, from 42.12842.128 to 42.19142.191, broadcast 42.19142.191;
  • DMZ: next free 42.19242.192, multiple of 3232: /27/27, from 42.19242.192 to 42.22342.223, broadcast 42.22342.223;
  • link: next free 42.22442.224, multiple of 44: /30/30, from 42.22442.224 to 42.22742.227, broadcast 42.22742.227.

The five blocks use 512+128+64+32+4=740512+128+64+32+4=740 addresses; 195.88.42.228195.88.42.228 to 195.88.43.255195.88.43.255 remain free. A /30/30 is the right size for a point-to-point link: two usable addresses, none wasted. Router interfaces: the first usable address of each LAN is the network address plus 11 (195.88.40.1/23195.88.40.1/23, 195.88.42.1/25195.88.42.1/25, 195.88.42.129/26195.88.42.129/26, 195.88.42.193/27195.88.42.193/27); on the link R1 has 195.88.42.225/30195.88.42.225/30 and R2 195.88.42.226/30195.88.42.226/30. Starting from the smaller subnets would break the alignment: a /23/23 cannot start at 42.042.0.

Typical mistakes: forgetting the router interface (here it does not change any prefix, but DMZ is tight: 28+1=2928+1=29 hosts of 3030 available); forgetting network and broadcast, or sizing the blocks with the number of hosts instead of a power of 22; taking a /24/24 for Production (254254 hosts <301<301); forgetting the point-to-point link; starting a subnet at a non-aligned address.

(b) Tables. A table row is (network, mask, next hop) and a packet takes the row with the longest mask that contains the destination (Forwarding and Routing TablesForwarding moves each packet one hop at a time toward its destination; it is direct when the destination is on a local network (ARP gives its MAC) and indirect otherwise (the packet goes to the next hop or default gateway given by the routing table). With netmasks, delivery is direct on interface x if the destination AND the mask equals the interface address AND the mask; otherwise the table is scanned from the longest mask (longest prefix match) and the default route 0.0.0.0/0 always matches; route aggregation shortens tables.Forwarding and Routing Tables →).

R1. Its directly connected networks are Production, Offices, the link and the provider link. Lab and DMZ are behind R2, and the three blocks 195.88.42.128/26195.88.42.128/26, 195.88.42.192/27195.88.42.192/27 and 195.88.42.224/30195.88.42.224/30 lie inside 195.88.42.128/25195.88.42.128/25 (42.12842.128 to 42.25542.255, 128128 addresses, 128128 is a multiple of 128128). One aggregate row replaces the two rows of Lab and DMZ:

Network Mask Next hop
195.88.42.128195.88.42.128 255.255.255.128255.255.255.128 195.88.42.226195.88.42.226
0.0.0.00.0.0.0 0.0.0.00.0.0.0 203.0.113.1203.0.113.1

The first row sends to R2 everything of the upper half of 195.88.42.0/24195.88.42.0/24; the default row sends to the provider everything else. Production and Offices cannot be aggregated with the rest (they are not contiguous with a 2j2^j aligned block), but they are connected to R1 and need no row.

R2. It is directly connected to Lab, DMZ and the link, and everything else is reached through R1: one default row 0.0.0.0/00.0.0.0/0 via 195.88.42.225195.88.42.225.

Provider. The five subnets are inside the /22/22, so the whole company is announced with one row, 195.88.40.0/22195.88.40.0/22 via 203.0.113.2203.0.113.2 (Subnetting, VLSM and SupernettingSubnetting splits an address block into smaller subnets by lengthening the mask (2^s subnets when s bits are borrowed), supernetting does the opposite by shortening the prefix to merge contiguous blocks; design rules for variable-size subnets are power-of-two sizes M with M at least hosts plus 2, prefix 32 minus log2 M, and start addresses divisible by M (largest subnet first), while 2^j blocks of prefix n aggregate into one block of prefix n minus j only if contiguous and aligned.Subnetting, VLSM and Supernetting →): instead of five rows, supernetting into the original block (the 22=42^2=4 blocks of /24/24 are contiguous and 4040 is a multiple of 44).

(c) Forwarding at R1. For each destination R1 first tests the networks of its interfaces (direct delivery), then the table with the longest mask (Forwarding and Routing TablesForwarding moves each packet one hop at a time toward its destination; it is direct when the destination is on a local network (ARP gives its MAC) and indirect otherwise (the packet goes to the next hop or default gateway given by the routing table). With netmasks, delivery is direct on interface x if the destination AND the mask equals the interface address AND the mask; otherwise the table is scanned from the longest mask (longest prefix match) and the default route 0.0.0.0/0 always matches; route aggregation shortens tables.Forwarding and Routing Tables →).

Typical mistakes: using the default row for 195.88.42.150195.88.42.150 (the /25/25 row is more specific and wins); treating 195.88.42.100195.88.42.100 as indirect; writing the next hop of the aggregate row as the address of R2 on the Lab LAN (it is the address of R2 on the link, the only one on a network that R1 is attached to).

Self-assessment grid
Item Points What you need for full marks Typical mistakes
Quiz 1 1 6/4=1.56/4=1.5 Mbit/s: the shared link is the bottleneck taking the client access (22 Mbit/s)
Quiz 2 1 each link adds transmission and propagation: 7+6=137+6=13 ms forgetting the propagation; using the bottleneck on all links
Quiz 3 1 31+4=3531+4=35 bits: count restarts after each inserted 00 counting overlapping groups of five
Quiz 4 1 S=C⋅2Tp=400S=C\cdot2T_p=400 bit =50=50 bytes one-way propagation; bit read as bytes
Quiz 5 1 a=12a=12, η=1/(1+2a)=4 %\eta=1/(1+2a)=4\,\% forgetting the factor 22
Quiz 6 1 ⌈(32 000+1+64)/512⌉=63\lceil(32\,000+1+64)/512\rceil=63 blocks, digest 256256 bit forgetting the padding; digest equal to block
Quiz 7 1 1313, 1414, K=gxy mod p=10K=g^{xy}\bmod p=10 multiplying or adding the public values
Quiz 8 1 ephemeral Diffie-Hellman, private key only signs saying the session key is encrypted with RSA in TLS 1.3
Quiz 9 1 port 60006000 is above 10231023 and passes rule 2 thinking a stateless filter recognizes replies
Quiz 10 1 NEW packet from eth0 hits the default DROP, silently confusing DROP and REJECT
Ex. 1 (a) 3 14+79⋅2.5=211.514+79\cdot2.5=211.5 ms; 3.783.78 Mbit/s; wait 158158 ms wrong number of spacings; adding a final RTT
Ex. 1 (b) 2 RTT=24\text{RTT}=24 ms; BDP=9.6\text{BDP}=9.6 MSS; swnd∗=10\text{swnd}^{*}=10 rounding down; wrong bottleneck
Ex. 1 (c) 3 opening 2020 ms; rounds 1,2,4,81,2,4,8; continuous from 116116 ms; 300300 ms opening 1414 ms; summing TbT_b below the BDP
Ex. 1 (d) 4 third dupACK 126126 ms; ssthresh=4\text{ssthresh}=4; ACK 150150 ms; 4,…,94,\dots,9; 380.5380.5 ms restart from 11; wrong ssthresh\text{ssthresh}; wrong dupACK instant
Ex. 2 (a) 3 five aligned blocks, largest first, with the router interfaces forgetting interface or link; misaligned subnets
Ex. 2 (b) 3 R1: aggregate /25/25 and default; R2: default; provider: the /22/22 many rows instead of the aggregate; wrong next hop
Ex. 2 (c) 2 direct, indirect via R2, loop for 42.23042.230, default for 8.8.8.88.8.8.8 default for 42.15042.150; missing the loop