------------------------------------------------------------------------- Mohamed G. Gouda CS 356 Spring 2019 Midterm 2 ------------------------------------------------------------------------- (1) Consider a simplified TCP protocol between two sides src and dst. The seq# of the first data segment (from src to dst) is 50. Side src sends two data segments to side dst: the first segment has 100 data bytes and the second has 150 bytes. These two segments are neither lost nor reordered. Side dst replies by sending two ack segments to src: the first segment is lost but the second segment is not lost. What are the seq#'s of the two data segments, and what are the ack#'s of the two ack segments. ------------------------------------------------------------------------- (2) Given a block of IP addresses whose subnetwork mask is M. Assume that this block is partitioned into 2^B smaller blocks where each smaller block has the same number K of IP addresses. Compute K as a function of M and B. Explain your answer. ------------------------------------------------------------------------- (3) Explain how DHCP can be viewed as an application layer protocol. ------------------------------------------------------------------------- Solutions: ------------------------------------------------------------------------- (1) src --> dst: (Data, 50, 100) src <-- dst: (Ack, 150) This segment is lost src --> dst: (Data, 150, 150) src <-- dst: (Ack, 300) ------------------------------------------------------------------------- (2) K = (number of IP addresses in given block)/ (number of smaller blocks) = (2^(32-M))/(2^B) = 2^(32-M-B) ------------------------------------------------------------------------- (3) Both the DHCP-client and the DHCP-server run on top of UDP like other application layer protocols. ------------------------------------------------------------------------- ------------------------------------------------------------------------- Mohamed G. Gouda CS 356 Spring 2019 Midterm 2A ------------------------------------------------------------------------- (1) Consider a simplified TCP protocol between two sides src and dst. The seq# of the first data segment (from src to dst) is 50. Side src sends two data segments to side dst: the first segment has 100 data bytes and the second has 150 bytes. The first data segment is lost but the second data segment is not lost. After receiving the second data segment, side dst sends the first ack segment. Later, side src times-out and resends the first data segment which is not lost. Finally, side dst sends the second ack segment. What are the seq#'s of the two data segments, and what are the ack#'s of the two ack segments. ------------------------------------------------------------------------- (2) Given a block of IP addresses whose subnetwork mask is M. Assume that this block is partitioned into B smaller blocks where each smaller block has the same number 2^K of IP addresses. Compute B as a function of M and K. Explain your answer. ------------------------------------------------------------------------- (3) Explain how DHCP can be viewed as a network layer protocol. ------------------------------------------------------------------------- Solutions: ------------------------------------------------------------------------- (1) src --> dst: (Data, 50, 100) This segment is lost src --> dst: (Data, 150, 150) src <-- dst: (Ack, 50) src --> dst: (Data, 50, 100) src <-- dst: (Ack, 300) ------------------------------------------------------------------------- (2) B = (number of IP addresses in given block)/ (number of IP addresses in each smaller block) = (2^(32-M))/(2^K) = 2^(32-M-K) ------------------------------------------------------------------------- (3) The objective of DHCP is to allocate temporary IP addresses to DHCP-clients. Thus, DHCP deals with IP addresses like other network layer protocols. -------------------------------------------------------------------------