ISDS550
ISDS550
ISDS550
WILLIAM STALLINGS
ACKNOWLEDGEMENT I would like to thank Nikhil Bhargava for providing most of the problems in this problem set.
-2-
TABLE OF CONTENTS
Chapter 5 TCP/IP and OSI....................................................................................4 Chapter 7 Internet-Based Applications ...............................................................5 Chapter 8 Internet Operation ................................................................................7 Chapter 9 Local Area Networks .........................................................................11 Chapter 10 Ethernet..............................................................................................13 Chapter 11 Wireless LANs ..................................................................................15 Chapter 12 Circuit Switching and Packet Switching .......................................16 Chapter 14 Wireless WANs.................................................................................18 Chapter 15 Data Transmission............................................................................19 Chapter 16 Data Communication Fundamentals..............................................20 Chapter 17 Data Link Control and Multiplexing .............................................21 Chapter 18 Computer and Network Security Threats ....................................24 Chapter 19 Computer and Network Security Techniques..............................26
-3-
-4-
root-ser vers.net
edu
net
gov
r utger s
yale
history
cs
cs
eng
a. napoleon.history.yale.edu is a machine installed in the history dept at Yale, and a user on eden.rutgers.edu launches this query: nslookup napoleon.history.yale.edu
-5-
b. At the prompt of paul.cs.rutgers.edu, somebody launches this query: nslookup napoleon.history.yale.edu c. Later, napoleon.history.yale.edu is assigned a new IP (but keeping the complete name) and is physically moved into the engineering building to a local Ethernet with other machines such as electron.eng.yale.edu and theorem.eng.yale.edu. At the prompt of eden.rutgers.edu a user launches this query: nslookup napoleon.history.yale.edu d. In engineering building, on napoleon.history.yale.edu, somebody queries: nslookup paul.cs.rutgers.edu e. Follow the same scenario as in (b), but this time indicating in order, all the queries involved in the process. Use this notation to represent a query: rutgers.edu rootservers.net to indicate that rutgers.edu is generating/forwarding a query to rootservers.net 7.2 Consider an HTTP client that wants to retrieve a Web document at a given URL. The IP address of the HTTP server is initially unknown. The Web document at the URL has one embedded GIF image that resides at the same server as the original document. What transport and application layer protocols besides HTTP are needed in this scenario? Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1, , RTTn. Further suppose that the Web page is an HTML text file and four additional objects. Let RTT0 denote a RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the entire Web page? Assume a non-persistent HTTP protocol with no parallel TCP connections
7.3
-6-
Suppose Host A sends a datagram to host B. Assume that the datagram sent is small enough to fit into one link-layer frame. During the transmission of this datagram from A to B a frame is sent from R4 to R1, a frame is sent from R1 to R2 and a frame from R2 to R3. (Other frames might be sent as well but in this question we are not concerned with them).Each of these frames contains a (1) frame source (MAC) address, (2) a frame destination (MAC) address and an encapsulated datagram containing a (3) source IP address and a (4) destination IP address. In the table below fill in the values of these four items for each of the 3 frames indicated. Frame sent Frame Source Frame Destination IP Datagram IP Datagram on link from (MAC) Address (MAC) Address Source Address Destination Address R4 to R1 R1 to R2 R2 to R3 -7-
8.2
The figure below illustrates Router R1 sending a datagram to host H through Router R2. Link L1 only permits a MTU of 1000 bytes. Link L2 permits a MTU of 1500 bytes. (MTU= Maximum Transfer Unit) A is an IP datagram which i) Has size 4000 bytes (the size of a datagram includes its header) ii) Is not using any of the option fields in its header. Because A is larger than the MTU of Link L1, A is fragmented when it is sent over L1.
a. Into how many IP datagrams is A fragmented when it is sent from R1 to R2 over L1? What is the size (in bytes) of each of these smaller fragments? b. For some fields of the IP header, the fragments created all contain the same value. For some fields, the fragments contain different values. In particular the fragmentation offset and offset-flag bit are different in different fragments. For each of the fragments described in (a) give the value of the fragmentation offset and offset-flag bit. c. In order for Host H to receive the data in A, R2 must also send some datagrams to H. Describe the datagrams that R2 sends to H. How many are there and what are their sizes? d. Explain how the fragmentation offset field and offset-flag bit are used to reconstruct datagrams. 8.3 8.4 In what cases may an IP Router not forward the packets it receives? For this and several subsequent problems, we introduce an alternative notation to that of the subnet mask. A routing prefix is the sequence of leading (mostsignificant) bits of an IP address that precede the portion of the address used as host identifier and, if applicable, the set of bits that designate the subnet number. Routing prefixes are expressed in a notation that uses the first address of a network followed by the bit-length of the prefix, separated by a slash (/) character. For example, 192.168.1.0/24 is the prefix of the IPv4 network starting at the given address, having 24 bits allocated for the network number, and the rest (8 bits) reserved for host addressing. Assume that you are the address administrator at an ISP. You have a 128.20.224.0/20 address block. You have two customers with networks of size 1000 nodes each; two customers whose networks have 500 nodes each; and three customers whose networks have 250 nodes each. What are the addresses blocks (first and last address) you will assign to these customers? Use notation similar to 128.20.224.0/20 to denote the address blocks you allocate. Suppose that all your remaining customers have networks of size 50 nodes each. For how many customers can you allocate address blocks with the remaining addresses you have? -8-
8.5
The traceroute program may be used to determine an end-to-end Internet Path through a network. Consider the following configuration. Explain the set of packets that are exchanged when Client A uses traceroute to find the path to Server B.
C lient A
Switch I
R outer J
R outer K
Ser ver B
8.6
You are given a pool of 220.23.16.0/24 IP addresses to assign to hosts and routers in the system shown in the figure below.
a. How many separate networks are in the system? b. Partition the given address space and assign addresses to the networks. To answer this question properly you should write down the addresses of all of the networks in the A.B.C.D/x format. c. Assign addresses to components of the network. To answer this question you should label all of the interfaces in the diagram below with their assigned addresses. -9-
8.7
a. Do the hosts A and C share the same network part of their IP addresses?. b. Can host C access the WWW server at the same time as host B accesses the Internet through the router? c. Can host A access the WWW server at the same time as host B accesses the Internet through the router? d. What is the maximum size of the bridges table (in the number of entries) in this configuration? e. When host A sends an ARP query to learn the data link address of the router, can host C hear it? 8.8 In the configuration below, an Internet Protocol packet is broadcast by B. Which End Systems receive this?
-10-
9.2
-11-
Frame 1 2 3 4 5 6 9.3
Source node A H C G E B
Consider a network path, consisting of four 10-Mbps LAN bus Ethernet links (segments) A, B, C, D connected by the three store-and-forward switches S1, S2, S3 as shown in the figure below. Assume that each Ethernet link introduces a propagation latency of 10 microseconds, but the switches introduce no queuing delays.
a. Calculate the paths one-way latency (total packet delay) for sending a 1-kB frame from Host H1 to Host H2 b. Calculate the effective data rate for sending a 1-kB frame across the path c. Calculate the effective data rate for sending a sequence of 1-kB frames if the source H1 must wait for a 20-byte ACK of the previous frame before it can send the next packet to destination H2.
-12-
CHAPTER 10 ETHERNET
10.1 Consider hosts A and C connected by two Ethernet segments, with a repeater B in the middle. The segments are 10 Mbps and introduce a latency of 3 s and 7s respectively.
Repeater A B C
7 s
3 s
A is transferring data to C by sending Ethernet frames with a 1500-byte payload. After sending a frame, it waits for an acknowledgment from C before sending the next one. The acknowledgment has a 10-byte payload. Recalling that an Ethernet frame includes an 8-byte preamble and a 14-byte header, a. Calculate the effective data rate of the data transfer. b. Calculate the effective data rate if B were replaced by a bridge. c. Calculate the effective data rate if B were replaced by a cut-through switch. 10.2 Suppose nodes A and B are attached to opposite ends of a 100 Mbps Ethernet cable segment. Suppose A begins transmitting a frame and, before it finishes, B begins transmitting a frame. In order for A to detect collision with B, what should be the maximum length of the Ethernet cable segment? (Assume that the transmit frame size is 500 bits and signal propagation speed is 2 108 m/sec. 10.3 Consider the following linear network
Assume that propagation speed of electromagnetic waves sent over the medium is 2 108 m/s and the transmission rate of the network is 10 Mbps. Also, assume that we are using a CSMA/CD protocol with minimum frame size of 400 bits. -13-
What is the maximum length of the linear network, i.e., distance from A to F that will ensure that CSMA/CD will work properly for this network? 10.4 Assume CSMA/CD protocol. Find the minimum frame length for a 1-Mbps bit rate and maximum network span of 10 kilometers with no repeaters. Assume a medium propagation delay of 4.5 nanoseconds per meter. Is CSMA/CD a reasonable protocol for a network of this span and bit-rate? 10.5 Two hosts, A and B, are connected to an Ethernet Network along with some other hosts. Host A wishes to send frame a and host B wants to send frame b to some other hosts on the Ethernet. Suppose that host A has had 3 collisions while trying to send frame a (with some hosts other than host B) and host B has had 5 collisions while trying to send frame (with some hosts other than host A). At time T, only hosts A and B are the ones that are ready to transmit some data. All other hosts remain idle. a. What is the maximum slot number that A can decide to transmit packet a in? b. What is the probability that A and B will collide in both of the next two transmissions as well? c. Suppose that A generates random number 0.5 and B generates random number 0.6. What are the slots that A and B will transmit their packets in? (Random numbers are generated on the interval [0,1). Assume the 1st slot is the next slot)
-14-
-15-
-16-
12.5 Considering a small network of four hosts and three links as depicted in the figure below. A 1,024,000 bits message is to be sent from A to D. The data rate of the first two links is 0.4 MB/second, but the link between C and D is 1.6 MB/sec. Propagation delays of the links are negligible. ABCD a. Assume that circuit switching is used and the total circuit set-up time is 100 ms, what is the time to send the message from A to D? b. Assume that message switching is used and queuing delays are negligible, what is the time to send the message from A to D? c. Assume that packet switching is used, packet size is 128 bytes and header size is 22 bytes (128 bytes is only payload, excluding header), what is the time to send the message from A to D? Hint: throughput of a pipeline is decided by how long it will take to pass the bottleneck step
-17-
-18-
-19-
-20-
and ACK) are assumed to be error-free. Draw the diagram until the receivers NFE (next frame expected) = 3. 17.4 A sliding window protocol is used between a sender and a receiver. The sender wants to send 10 packets with a rate 1packet/1ms. The propagation time is 2 ms for any packet, and the time out is 8 ms. The time for processing packet is negligible a. Assume that Go-Back-N is used, window size is 5 and the packet #4 is lost. Complete the figure below that shows packets from sender to receiver and ACK packets in the reverse direction.
R eceiver 1 ms
Sender
b. Same as (a) with Selective Reject ARQ. c. Assume that sender wants to send 20 packets, we use selective reject protocol and the packet #4 is lost. What is the minimum window size so that the window is never full? Explain. 17.5 Draw a time line diagram for the transfer of frames on a point-to-point network from a sender node to a receiver node. The diagram should show the time period starting with the transmission of frame 0 by the sender and up to the time when the sender successfully receives an ACK for frame 7. During the transmission the third frame (frame 2) is lost. The Go-Back-N sliding window algorithm is used with SWS = 4 frames and RWS = 3 frames. The receiver uses cumulative ACKs. Assume a time out interval of 2RTT. Moreover, assume that the transmission time (insertion time) of a frame is equal to 0.25 RTT. At the receiver, assume that frames can be processed instantaneously if they arrive in order. On each data frame and ACK frame, indicate the frame number (from 0). In addition, you need to indicate what action is taken by the receiver when a frame is received, for e.g. Processed Buffered or Discarded. 17.6 Suppose synchronous time-division multiplexing is used to share a link among 6 channels, and that channel 1 appears first in the frame and channel 6 appears last. If the bit string 100111000110001111100000 is sent along the data link (leftmost bit is transmitted first; rightmost transmitted last), what bit string is actually transmitted along channel 3? [Again, list the bits in order of arrival, left to right] 17.7 George wants to setup a wireless network in a reserved frequency band for his small department to use. The frequency band reserved for the department is 500MHz wide, for which Peter, Bruce, David, George, and Jacob will share. -22-
George, who did not pay attention during lecture, is trying to figure out the best way to multiplex the channel such that each member can achieve the best throughput in the network. The only method he can currently remember is time division multiplexing (TDM). To test the network the staff will each perform a 1000-kB file transfer simultaneously. Ignore propagation delay and handshaking, and assume a users transceiver is tunable to any frequency and can transmit data at a maximum rate of 2 Mbps, using 100 MHz of the channel. There is a maximum packet size of 1000 bytes, no header is used. Assume a noiseless channel (no loss will occur), such that no ACKing or collision detection scheme is needed. In the TDM protocol that George develops, each staff member is allowed to transmit a single packet, to avoid interference 6 ms of silence is required, followed by the next staff members packet transmission. Therefore, a single round of transmissions looks like this, note the order: George, 6ms, Bruce, 6ms, David, 6ms, Peter, 6ms, Jacob, 6ms. Using this protocol, how long will it take Georges 1000-kB file transmission to finish?
-23-
-24-
18.6 Look at the following code snippet. You may assume that escape() argument is always non-null and points to a \0- terminated string. What's wrong with this code (from a security point of view)? /*Escapes all newlines in the input string, replacing them with"\n".*/ /* Requires: p != NULL; p is a valid \0-terminated string */ void escape(char *p) { while (*p != \0) switch (*p) { case \n: memcpy(p+2, p+1, strlen(p)); *p++ = \\; *p++ = n; break; default: p++; } }
-25-
-26-