Salta al contenuto
Note per Studenti Internet and Security - Exam of 9 September 2020 Report

Internet and Security - Exam of 9 September 2020

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

In questa pagina 3

This is the part 2 (numerical exercises) of the written exam of 9 September 2020 (session 4, academic year 2019/2020) of the Internet course taught at the Department of Information Engineering, University of Padua (Master degree on ICT for Internet and Multimedia Engineering, in English). It is not an exam of this course, but the exercises have the same structure and the same topics as the practical module of Internet and Security. The theory part (part 1) of that exam is not public. The sheet contains two exercises, 12+8=2012+8=20 points, plus 11 optional extra point; the duration and the allowed material are not printed.

The sheet reports only the final results (printed in blue), without any solution: every step below was derived from the notes of the course and then checked against the official results, with Python scripts (event simulation of the queues, round-by-round simulation of TCP, longest prefix match and fragmentation with the ipaddress module). All the official results are reproduced; for one of them (Exercise 1, Question 4) the convention that gives the official value has to be stated explicitly, see the solution.

Official exam format of Internet and Security (University of Padua, 9 credits, in English): a written test in two modules, theory (questions on the course) and practice (network configuration exercises like those seen in class), then a laboratory test. There are four attempts (June and July, September, January or February). A student with at least 18 out of 30 in the written test may ask for an oral exam on the whole programme, and the oral exam may also be imposed to clarify a doubt.

Exercise 1 (points 12)

Consider the network shown in the figure below, where the intermediate routers R1, R2 and R3 implement a packet-switched network paradigm with datagram (store-and-forward) approach. Every router operates with independent queues for every output interface.

Description of the figure. Server A (whose output queue is drawn on the left, holding the packets D, D, E, E, with the last one on the left) is connected to router R1 by link C1C_1. R1 is connected to R2 by link C2C_2. R2 is connected to three other nodes: host B by link C3C_3, host C by link C4C_4, and router R3 by link C5C_5. R3 is connected to host E by link C7C_7 and to host D by link C6C_6.

Link Endpoints Capacity Propagation delay
C1C_1 A - R1 2020 Mbps τ1=6\tau_1=6 ms
C2C_2 R1 - R2 1010 Mbps τ2=4\tau_2=4 ms
C3C_3 R2 - B 22 Mbps τ3=10\tau_3=10 ms
C4C_4 R2 - C 44 Mbps τ4=1\tau_4=1 ms
C5C_5 R2 - R3 12.512.5 Mbps τ5=2\tau_5=2 ms
C6C_6 R3 - D 2020 Mbps τ6=0.8\tau_6=0.8 ms
C7C_7 R3 - E 55 Mbps τ7=0.2\tau_7=0.2 ms

Question 1 (4 pt.) At time t=0t=0, the output queue of server A has four packets towards respectively E, E, D, D (D is the last sent). Considering packets of length LD=250L_D=250 Byte and LE=1250L_E=1250 Byte, and assuming that packet transmissions start at time t=0t=0 for all nodes, calculate the instant of time the four packets arrive to their intended destinations.

Assume now that a TCP connection is established between server A to host B (neglect the effect of any other parallel transmission within the network). Server A transmits TCP segments of size MSS=1250\text{MSS}=1250 Byte. The size of the opening and acknowledgment segments is negligible, so it is the header at every single layer. Assume that the initial value of the cwnd\text{cwnd} is 12501250 Byte, the slow start threshold ssthresh\text{ssthresh} is 1010 KByte, and the receive window rwnd\text{rwnd} is 11 MByte. Determine what follows.

Question 2 (2 pt.) Find the Round Trip Time (RTT) and the value of the TCP sender window swnd∗\text{swnd}^* that would allow for a continuous stream of segments between server A and host B.

Question 3 (3 pt.) Determine the total time it takes to transfer a message of M=100M=100 KByte (from TCP connection setup to reception of last ACK), assuming that the data exchange starts as soon as possible. Neglect processing and queuing delays.

Question 4 (3 pt.) Repeat the previous calculation assuming that, instead of TCP, Stop&Wait (S&W) ARQ is used on each link at the data link layer.

Show the result
  • Question 1: the arrival instants are 16.516.5 ms for the first E packet, 18.518.5 ms for the second E packet, 16.3616.36 ms for the first D packet and 16.5216.52 ms for the second D packet.
  • Question 2: RTT=46.5\text{RTT}=46.5 ms; swnd∗=10\text{swnd}^*=10 MSS.
  • Question 3: TTCP=594T_{\text{TCP}}=594 ms.
  • Question 4: T=2021.5T=2021.5 ms.
Show the full solution

Question 1: arrival times. The transmission time of a packet on a link is T=L/CT=L/C (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 two packet sizes are LE=1250L_E=1250 B =10 000=10\,000 bit and LD=250L_D=250 B =2000=2000 bit. With the capacities in Mbit/s, bit divided by Mbit/s gives microseconds, so 10 000/20=500 μs10\,000/20=500\ \mu\text{s}, and so on. Only the links on the paths are needed: E uses C1,C2,C5,C7C_1,C_2,C_5,C_7; D uses C1,C2,C5,C6C_1,C_2,C_5,C_6.

Packet TT on C1C_1 TT on C2C_2 TT on C5C_5 TT on last link
E (10 00010\,000 bit) 0.50.5 ms 11 ms 0.80.8 ms C7C_7: 22 ms
D (20002000 bit) 0.10.1 ms 0.20.2 ms 0.160.16 ms C6C_6: 0.10.1 ms

The four packets are E1,E2,D1,D2E_1,E_2,D_1,D_2 in the order in which they leave A. Every router receives a packet completely before retransmitting it (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 →), and every output queue serves the packets in the order in which they arrive (FIFO). A packet starts on a link at the later of two instants: when it is ready (it has arrived) and when the link becomes free. It arrives at the next node τ\tau after the end of its transmission. The three links C1,C2,C5C_1,C_2,C_5 are shared by all four packets, so queues form there; the last links C7C_7 and C6C_6 are different, so EE and DD do not compete on them.

Link C1C_1 (the server sends back to back from t=0t=0): E1E_1 0→0.50\to0.5, E2E_2 0.5→1.00.5\to1.0, D1D_1 1.0→1.11.0\to1.1, D2D_2 1.1→1.21.1\to1.2. Arrival in R1 (+6+6): 6.56.5, 7.07.0, 7.17.1, 7.27.2 ms.

Link C2C_2. E1E_1 finds it free and starts at 6.56.5; the others arrive while it is busy and wait.

Packet ready start end arrival in R2 (+4+4)
E1E_1 6.56.5 6.56.5 7.57.5 11.511.5
E2E_2 7.07.0 7.57.5 8.58.5 12.512.5
D1D_1 7.17.1 8.58.5 8.78.7 12.712.7
D2D_2 7.27.2 8.78.7 8.98.9 12.912.9

Link C5C_5.

Packet ready start end arrival in R3 (+2+2)
E1E_1 11.511.5 11.511.5 12.312.3 14.314.3
E2E_2 12.512.5 12.512.5 13.313.3 15.315.3
D1D_1 12.712.7 13.313.3 13.4613.46 15.4615.46
D2D_2 12.912.9 13.4613.46 13.6213.62 15.6215.62

Last links. E1E_1 on C7C_7: 14.3→16.314.3\to16.3, arrives at E at 16.3+0.2=16.516.3+0.2=\mathbf{16.5} ms. E2E_2 is ready at 15.315.3 but C7C_7 is busy until 16.316.3: it transmits 16.3→18.316.3\to18.3 and arrives at 18.3+0.2=18.518.3+0.2=\mathbf{18.5} ms. The D packets use C6C_6, which is free: D1D_1 15.46→15.5615.46\to15.56, arrival 15.56+0.8=16.3615.56+0.8=\mathbf{16.36} ms; D2D_2 15.62→15.7215.62\to15.72, arrival 15.72+0.8=16.5215.72+0.8=\mathbf{16.52} ms.

Note that the D packets, although sent last, arrive before the second E packet: they have to wait in the queues of C2C_2 and C5C_5 behind the long packets, but the long packet E2E_2 is then slowed down by C7C_7 (55 Mbps, 22 ms of transmission), while the D packets leave through the fast and empty C6C_6. Typical error: assuming that the order of arrival at the destinations is the order of sending, or forgetting the wait of E2E_2 on C7C_7 behind E1E_1.

Question 2: RTT and swnd∗\text{swnd}^*. The path of the connection is A→R1→R2→BA\to R1\to R2\to B, that is C1,C2,C3C_1,C_2,C_3. A segment is MSS=1250\text{MSS}=1250 B =10 000=10\,000 bit, so T1=0.5T_1=0.5 ms, T2=1T_2=1 ms, T3=10 000/2=5T_3=10\,000/2=5 ms. The bottleneck is C3C_3 (the slowest link, 22 Mbit/s): Tb=5T_b=5 ms.

RTT=26.5+20=46.5 ms.\text{RTT}=26.5+20=\mathbf{46.5\ ms}.

The window that keeps the bottleneck always busy is the one that fills the pipe, i.e. the number of segments that the bottleneck sends during one RTT: RTT/Tb=46.5/5=9.3\text{RTT}/T_b=46.5/5=9.3 segments, equivalent to a bandwidth-delay product of 2 Mbit/s⋅46.5 ms=93 0002\ \text{Mbit/s}\cdot46.5\ \text{ms}=93\,000 bit =9.3=9.3 MSS. Windows are integers and the stream is continuous only if the ACK of the first segment returns before the window is finished, so the window must be rounded up: swnd∗=⌈9.3⌉=10 MSS.\text{swnd}^*=\lceil9.3\rceil=\mathbf{10\ MSS}. With 99 segments the window needs 9⋅5=45<46.59\cdot5=45<46.5 ms to be sent, so the sender stops for 1.51.5 ms at every round.

Question 3: transfer of M=100M=100 KByte. In segments: M=100 000M=100\,000 B /1250/1250 B =K=80=K=80 segments (the exact count fits only with 11 KByte =1000=1000 B; with 10241024 B one would get 81.9281.92, which is not an integer). The threshold is ssthresh=10 000/1250=8\text{ssthresh}=10\,000/1250=8 MSS, and rwnd=1\text{rwnd}=1 MB is 800800 MSS: it never limits the window here (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 →).

Connection setup. SYN and SYN+ACK have negligible transmission time, so only the propagation delays count: each takes τ1+τ2+τ3=20\tau_1+\tau_2+\tau_3=20 ms, so 4040 ms in total. The third segment of the handshake is the ACK, sent together with the first data segment, so the data start immediately after the 4040 ms.

Windows (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 →). cwnd\text{cwnd} starts from 11 MSS. In slow start it doubles at every round: 1,2,4,81,2,4,8; at 88 it reaches ssthresh\text{ssthresh} and congestion avoidance starts, with +1+1 MSS per round: 9,10,…9,10,\dots In each round the sender can send swnd=min⁡(cwnd,rwnd)\text{swnd}=\min(\text{cwnd},\text{rwnd}) segments.

Round (window) 1 2 3 4 5 6
cwnd\text{cwnd} (MSS) 11 22 44 88 99 1010
phase SS SS SS SS to ssthresh\text{ssthresh} CA CA

While swnd<swnd∗=10\text{swnd}<\text{swnd}^*=10, the whole window is sent in less than one RTT (for example 9⋅5=45<46.59\cdot5=45<46.5 ms), so the sender has to wait for the first ACK before sending the next window: each of the first five rounds lasts one RTT, and they carry 1+2+4+8+9=241+2+4+8+9=24 segments. From the sixth round swnd=10=swnd∗\text{swnd}=10=\text{swnd}^*: the transmission is continuous and the remaining 80−24=5680-24=56 segments leave one every Tb=5T_b=5 ms (the window keeps growing, but nothing changes: the bottleneck is already saturated).

TTCP=40⏟setup+5 RTT⏟232.5+(56−1) Tb⏟275+RTT⏟46.5=594 ms.T_{\text{TCP}}=\underbrace{40}_{\text{setup}}+\underbrace{5\,\text{RTT}}_{232.5}+\underbrace{(56-1)\,T_b}_{275}+\underbrace{\text{RTT}}_{46.5}=\mathbf{594\ ms}.

Reading of the terms: 5 RTT5\,\text{RTT} are the first five rounds; (56−1)Tb(56-1)T_b separates the departure of the first from that of the last of the 5656 segments sent continuously; the last RTT\text{RTT} is the time for the final segment to reach B and for its ACK to come back to A (the transmission of that segment on the bottleneck is already part of the RTT). Typical errors: forgetting the 4040 ms of the handshake or the final RTT; not rounding swnd∗\text{swnd}^* up; continuing slow start beyond ssthresh=8\text{ssthresh}=8 (that would give 1,2,4,8,161,2,4,8,16 and a wrong number of rounds).

Question 4: Stop-and-Wait ARQ on every link. Now there is no end-to-end window: each link runs its own S&W (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 →). The sender of a link transmits one frame and waits for its ACK (negligible transmission time) before sending the next, so the link is busy for a cycle Ti+2τiT_i+2\tau_i:

Link TiT_i 2τi2\tau_i cycle Ti+2τiT_i+2\tau_i
C1C_1 0.50.5 1212 12.512.5 ms
C2C_2 11 88 99 ms
C3C_3 55 2020 2525 ms

The slowest cycle is the one of C3C_3 (2525 ms, a link efficiency of only 5/25=205/25=20 percent in the sense of the S&W formula). Packets reach R2 every 12.512.5 ms (limit of C1C_1; C2C_2 is faster, so R1 never accumulates a queue), but leave R2 only every 2525 ms: a queue grows in R2, and the whole flow proceeds at the rhythm of C3C_3. The first packet reaches R2 at T1+τ1+T2+τ2=0.5+6+1+4=11.5T_1+\tau_1+T_2+\tau_2=0.5+6+1+4=11.5 ms and starts at once on C3C_3. After that, C3C_3 is never idle: it serves K=80K=80 packets, one every 2525 ms, so the last ACK of the link C3C_3 arrives at R2 at 11.5+80⋅25=2011.5 ms.11.5+80\cdot25=2011.5\ \text{ms}. (The last packet is received by B at 2001.52001.5 ms: it starts on C3C_3 at 11.5+79⋅25=1986.511.5+79\cdot25=1986.5, ends at 1991.51991.5 and arrives at 1991.5+10=2001.51991.5+10=2001.5.)

Which convention gives the official value. The official result is 2021.52021.5 ms, exactly 1010 ms more than 2011.52011.5. The difference is τ2+τ1=4+6\tau_2+\tau_1=4+6: the official solution counts the time at which the last acknowledgment is received by the server A, i.e. the ACK crosses all three links on its way back (τ3+τ2+τ1=20\tau_3+\tau_2+\tau_1=20 ms after the arrival at B, as in the RTT of Question 2, where the ACK was end-to-end), not only the link-level ACK of the last hop. Under that convention T=(T1+τ1+T2+τ2)⏟11.5+K (T3+2τ3)+(τ2+τ1)⏟10=11.5+2000+10=2021.5 ms.T=\underbrace{(T_1+\tau_1+T_2+\tau_2)}_{11.5}+K\,(T_3+2\tau_3)+\underbrace{(\tau_2+\tau_1)}_{10}=11.5+2000+10=\mathbf{2021.5\ ms}. The data transfer has no connection setup in this scenario (there is no TCP), consistently with the official value. If instead only the last link-level ACK were counted, the answer would be 2011.52011.5 ms. S&W is about 3.43.4 times slower than TCP (594594 ms) because each link idles while waiting for its ACK; TCP keeps the bottleneck full with 1010 segments in flight. Typical errors: using the cycle of C1C_1 (12.512.5 ms) or adding the three cycles per packet (a pipeline works in parallel on different links, so only the slowest cycle counts); forgetting that the first packet needs 11.511.5 ms to reach the bottleneck.

Exercise 2 (points 8)

A router has the following interface configuration and routing table:

Network Netmask Next hop
142.124.123.0 255.255.255.128 142.124.124.192
142.124.124.0 255.255.255.128 142.124.123.201
142.124.16.0 255.255.255.0 142.124.124.192
142.124.19.0 255.255.255.128 142.124.123.202
142.124.28.0 255.255.255.0 142.124.124.192
142.124.31.0 255.255.255.0 192.168.0.254
142.124.8.0 255.255.248.0 192.168.0.254
0.0.0.0 0.0.0.0 192.168.0.254
Interface IP address Netmask MTU [B]
eth0 142.124.123.254 255.255.255.128 1000
eth1 142.124.124.254 255.255.255.128 500
eth2 192.168.0.1 255.255.255.0 1000

Question 1 (5 pt.) Indicate how packets with the following destination IP addresses are handled. Indicate if direct or indirect forwarding is used (in case of indirect forwarding, indicate what is the next hop and its corresponding output interface), and whether and why the packet is dropped.

  • 142.124.123.200 from eth1. Packet size is 300 B and Don't Fragment bit set to 1.
  • 142.124.123.120 from eth0. Packet size is 300 B and Don't Fragment bit set to 1.
  • 142.124.19.232 from eth0. Packet size is 400 B and Don't Fragment bit set to 1.
  • 142.124.27.230 from eth1. Packet size is 20'000 B and Don't Fragment bit set to 0 (in case IP fragmentation is needed, indicate how many fragments should be sent).

Question 2 (3 pt.) The network administrator of network with IP 142.124.0.0 and netmask 255.255.192.0 wants to partition the network to serve a previous network of 1014 hosts. Define an addressing plan for this network indicating IP addresses and netmask, direct broadcast address, and maximum number of hosts.

EXTRA 1 POINT (OPTIONAL). Assess how many subnetworks of 34 nodes can be defined within the subnetwork created at the previous point, and the corresponding netmask.

Show the result

Question 1:

  • 142.124.123.200 from eth1: direct forwarding through eth0.
  • 142.124.123.120 from eth0: indirect forwarding through eth1 (next hop 142.124.124.192).
  • 142.124.19.232 from eth0: indirect forwarding through eth2 (next hop 192.168.0.254, default route).
  • 142.124.27.230 from eth1: indirect forwarding through eth2 (next hop 192.168.0.254, default route); 2121 fragments are sent.

Question 2: IP 142.124.0.0/22142.124.0.0/22 (netmask 255.255.252.0255.255.252.0); direct broadcast 142.124.3.255142.124.3.255; maximum number of hosts 10221022.

Extra: 1616 subnetworks, with netmask 255.255.255.192255.255.255.192 (/26/26).

Show the full solution

Question 1: forwarding. The procedure is the one of 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 →: first the direct delivery test on every interface (destination AND netmask equal to interface address AND netmask), then, if no interface matches, the table with longest prefix match. Finally the output interface is the one whose network contains the next hop, and the packet size is compared with the MTU of that interface (IPv4 Datagram and FragmentationIPv4 is a connectionless, unreliable best-effort service; the header is 20 to 60 bytes (HLen counts 4-byte words), TTL limits hops, Protocol identifies the payload (1 ICMP, 6 TCP, 17 UDP) and the checksum covers only the header; a datagram larger than the link MTU is fragmented (only the payload is split, offsets are in units of 8 bytes, MF is 1 in all fragments but the last) and reassembled only at the destination.IPv4 Datagram and Fragmentation →).

Networks of the interfaces (the AND is needed only on the byte where the mask is not 00 or 255255; here the mask byte is 128=100000002128=10000000_2 or 255255):

  • eth0: 142.124.123.254142.124.123.254, mask /25/25: 254=111111102254=11111110_2 AND 100000002=12810000000_2=128, so the network is 142.124.123.128/25142.124.123.128/25 (addresses 123.128123.128 to 123.255123.255).
  • eth1: 142.124.124.254142.124.124.254, mask /25/25: the network is 142.124.124.128/25142.124.124.128/25 (addresses 124.128124.128 to 124.255124.255).
  • eth2: 192.168.0.1/24192.168.0.1/24: network 192.168.0.0/24192.168.0.0/24.

Output interface of each next hop: 142.124.124.192142.124.124.192 is in 124.128/25124.128/25 (since 192≥128192\ge128): eth1; 142.124.123.201142.124.123.201 and 142.124.123.202142.124.123.202 are in 123.128/25123.128/25: eth0; 192.168.0.254192.168.0.254 is in 192.168.0.0/24192.168.0.0/24: eth2. (The routing table rows of the first two networks look like the two interface networks but are the lower halves .0/25.0/25: not the same networks.)

Packet Analysis Result
142.124.123.200142.124.123.200 from eth1, 300300 B, DF=1=1 Direct test on eth0: 200=110010002200=11001000_2, AND 128=128128=128, equal to the network of eth0 (123.128123.128): it belongs to the network of eth0, so no table lookup is needed. The packet is delivered directly through eth0 (with ARP, ARP - Address Resolution ProtocolTo place an IP datagram in a frame a node needs the MAC address of the next hop, obtained with ARP: a broadcast request (destination MAC FF:FF:FF:FF:FF:FF, carrying the sender's IP and MAC and the wanted IP) and a unicast reply with the wanted MAC, stored in the ARP cache; ARP always resolves the next hop (destination host or router), never the final destination, and since broadcasts do not leave the subnet a router can answer with its own MAC (proxy ARP).ARP - Address Resolution Protocol →). It is not in the row 142.124.123.0/25142.124.123.0/25 (200≥128200\ge128). 300≤1000300\le1000: it passes direct forwarding through eth0
142.124.123.120142.124.123.120 from eth0, 300300 B, DF=1=1 Direct test: 120<128120<128, so it is not in the network of eth0 (123.128/25123.128/25); not in eth1 or eth2. Table: the row 142.124.123.0/25142.124.123.0/25 matches (120120 AND 128=0128=0, network 123.0123.0); the default row also matches, but has the shortest mask. Next hop 142.124.124.192142.124.124.192, in eth1. MTU 500≥300500\ge300: it passes indirect forwarding, next hop 142.124.124.192142.124.124.192, through eth1
142.124.19.232142.124.19.232 from eth0, 400400 B, DF=1=1 Direct: no interface. Table: 142.124.19.0/25142.124.19.0/25 covers only 19.019.0 to 19.12719.127, and 232232 AND 128=128≠0128=128\neq0: no match (this is the trap, the address looks like that row); 142.124.16.0/24142.124.16.0/24 no (third byte 19≠1619\ne16); 142.124.8.0/21142.124.8.0/21 covers third byte 88 to 1515 (1919 AND 248=16≠8248=16\ne8): no. Only the default row matches: next hop 192.168.0.254192.168.0.254, on eth2. 400≤1000400\le1000 indirect forwarding, next hop 192.168.0.254192.168.0.254, through eth2
142.124.27.230142.124.27.230 from eth1, 20 00020\,000 B, DF=0=0 Direct: no interface. Table: 142.124.28.0/24142.124.28.0/24 and 142.124.31.0/24142.124.31.0/24 no (third byte 2727); 142.124.16.0/24142.124.16.0/24 no; 142.124.8.0/21142.124.8.0/21: 2727 AND 248=24≠8248=24\ne8, no. Default: next hop 192.168.0.254192.168.0.254, eth2, MTU 1000<20 0001000<20\,000 and DF=0=0: fragmentation indirect forwarding through eth2, 2121 fragments

Fragmentation of the fourth packet. The datagram has 2020 B of header and 20 000−20=19 98020\,000-20=19\,980 B of payload. Each fragment can have at most 1000−20=9801000-20=980 B of data, and the data of every fragment except the last must be a multiple of 88 (the offset is in units of 88 B): 980/8=122.5980/8=122.5, so the maximum is 122⋅8=976122\cdot8=976 B. Then 19 980/976=20.4719\,980/976=20.47, rounded up: 2121 fragments, the first 2020 with 976976 B of data (996996 B in total, offsets 0,122,244,…,23180,122,244,\dots,2318) and the last one with 19 980−20⋅976=46019\,980-20\cdot976=460 B of data (480480 B in total, offset 24402440). Even without the multiple-of-88 rule one would get ⌈19 980/980⌉=21\lceil19\,980/980\rceil=21, so the answer does not depend on it here. Typical errors: comparing 20 00020\,000 with the MTU of eth1 (the incoming interface) instead of eth2 (the output one); forgetting the header in the payload; taking the row 142.124.19.0/25142.124.19.0/25 for the third packet.

Question 2: addressing plan. The network 142.124.0.0142.124.0.0 with netmask 255.255.192.0255.255.192.0 is 142.124.0.0/18142.124.0.0/18: 1414 host bits, addresses from 142.124.0.0142.124.0.0 to 142.124.63.255142.124.63.255 (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 →). A subnet for 10141014 hosts needs 10141014 host addresses plus the network address and the direct broadcast address, that is 10161016 addresses, and the number of host bits bb satisfies 2b≥10162^b\ge1016: 29=5122^9=512 is too small, 210=10242^{10}=1024 is enough (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 →). So b=10b=10 and the netmask has 32−10=2232-10=22 bits: /22=255.255.252.0/22=255.255.252.0 (third byte 111111002=25211111100_2=252).

A subnet must start at a multiple of its size (1024=4⋅2561024=4\cdot256 addresses, so the third byte must be a multiple of 44) and lie inside the /18/18 (third byte from 00 to 6363): the first possibility, used by the official solution, is

  • network address 142.124.0.0/22142.124.0.0/22, netmask 255.255.252.0255.255.252.0;
  • direct broadcast: the last address of the block, third byte 0+4−1=30+4-1=3, fourth byte 255255: 142.124.3.255142.124.3.255;
  • maximum number of hosts: 210−2=10222^{10}-2=1022 (from 142.124.0.1142.124.0.1 to 142.124.3.254142.124.3.254).

Any of the 1616 aligned /22/22 blocks of the /18/18 (142.124.0.0142.124.0.0, 142.124.4.0142.124.4.0, …\dots, 142.124.60.0142.124.60.0) is a correct answer. Typical errors: choosing /21/21 (too large, 20462046 hosts) or /23/23 (only 510510); comparing 10141014 with 2b2^{b} without adding the two reserved addresses (here it makes no difference, b=10b=10 either way, but with 10231023 hosts it would).

Extra point. Subnetworks of 3434 nodes inside the /22/22: with the two reserved addresses, 34+2=3634+2=36 addresses are needed, and 25=32<36≤64=262^5=32<36\le64=2^6, so 66 host bits and netmask /26=255.255.255.192/26=255.255.255.192 (each subnet has 6262 usable addresses). The number of subnets is 226−22=24=162^{26-22}=2^4=\mathbf{16}, with networks 142.124.0.0/26, 142.124.0.64/26, 142.124.0.128/26, 142.124.0.192/26, 142.124.1.0/26, …, 142.124.3.192/26142.124.0.0/26,\ 142.124.0.64/26,\ 142.124.0.128/26,\ 142.124.0.192/26,\ 142.124.1.0/26,\ \dots,\ 142.124.3.192/26 (equivalently, 1024/64=161024/64=16). Typical error: choosing /27/27 (3030 hosts only, fewer than 3434) or counting 1024/341024/34.

Self-assessment grid
Exercise Points What must be there for full marks Typical errors
1, Question 1 4 T=L/CT=L/C for each packet and link; tables of ready, start, end and arrival at each hop with FIFO waiting on C2C_2, C5C_5 and C7C_7; the four results 16.516.5, 18.518.5, 16.3616.36, 16.5216.52 ms wrong order in the queues; forgetting the wait of E2E_2 on C7C_7; mixing bytes and bits
1, Question 2 2 path C1,C2,C3C_1,C_2,C_3 and bottleneck C3C_3 (Tb=5T_b=5 ms); delay 26.526.5 ms and ACK 2020 ms; RTT=46.5\text{RTT}=46.5 ms; swnd∗=⌈9.3⌉=10\text{swnd}^*=\lceil9.3\rceil=10 MSS counting the transmission of the ACK; rounding swnd∗\text{swnd}^* down; using the wrong path
1, Question 3 3 K=80K=80, ssthresh=8\text{ssthresh}=8 MSS; windows 1,2,4,8,91,2,4,8,9 (one RTT each) then continuous from the sixth; 40+5 RTT+55 Tb+RTT=59440+5\,\text{RTT}+55\,T_b+\text{RTT}=594 ms forgetting the handshake (4040 ms) or the final RTT; slow start beyond ssthresh\text{ssthresh}
1, Question 4 3 per-link cycles 12.512.5, 99, 2525 ms; C3C_3 is the bottleneck; 11.5+80⋅25+10=2021.511.5+80\cdot25+10=2021.5 ms, with the convention on the last ACK stated using the wrong cycle; summing the cycles of the three links per packet; no pipeline term of 11.511.5 ms
2, Question 1 5 networks of the interfaces by AND; direct delivery first; longest prefix match; output interface from the next hop; DF and MTU check; 2121 fragments of 976976 B (last 460460 B) trap row 142.124.19.0/25142.124.19.0/25; applying the table before the direct test; MTU of the wrong interface; offsets not multiple of 88
2, Question 2 3 1014+2=1016≤10241014+2=1016\le1024, b=10b=10, /22/22, netmask 255.255.252.0255.255.252.0, broadcast 142.124.3.255142.124.3.255, 10221022 hosts, block inside the /18/18 /21/21 or /23/23; broadcast of the wrong block; block not aligned
2, Extra 1 34+2=36≤6434+2=36\le64, /26/26, 24=162^{4}=16 subnets /27/27; dividing 10241024 by 3434