1、1 CHAPTER 1 Introduction Exercises 1. As of January 2009, the RFC with the highest number is RFC 5459, titled RTP Pay- load Format Update. 3. RFC 2014: This RFC discusses the IRTF working group guidelines and proce- dures. 5. RFC 3692 and RFC 1410 are two examples of experimental RFCs. 7. The main R
2、FC for FTP is RFC 959 that has become the standard STD0009. 9. The main RFC related to TCP is RFC 793 (J. Postel) that has become the standard STD0007. 21 CHAPTER 2 The OSI Model and the TCP/IP Protocol Suite Exercises 1. The International Standards Organization (ISO) is a multinational body dedicat
3、ed to worldwide agreement on international standards. An ISO standard that covers all aspects of network communications is the Open Systems Interconnection (OSI) model. 3. a. Transport layer b. Network layer c. Data link layer d. Application layer e. Physical layer 5. a. Presentation layer b. Sessio
4、n layer c. Data link and transport layers d. Session layer e. Presentation layer 7. If we think about the switch as a passive one (not a bridge), Figure 2.E7 shows the solution. Chapter02.fm Page 1 Saturday, June 13, 2009 8:05 PM2 9. The header at the transport layer should at least include the sour
5、ce and destination port number. This means the size of the header is at least 2 + 2 = 4 bytes. 11. The header at the data link layer should at least include the physical source and destination addresses. This means the size of the header is at least 6 + 6 = 12 bytes. 13. At the physical layer, the s
6、ignal representing the bit stream is broadcast to all sta- tions in a network. Every station receives it; there is no need for addresses in this layer. 15. The destination address is needed to define the recipient of the message; the source address is needed if the receiver of the message has to res
7、pond or the intermediate nodes has to report any error the source. Figure 2.E7 Solution to Exercise 7 A Physical Physical Data link Data link R1 B B Network Network Transport Transport Application Application Message D5 D5 D5 D5 Message A R1 Link 2 Link 1 Chapter02.fm Page 2 Saturday, June 13, 2009
8、8:05 PM1 CHAPTER 3 Underlying Technologies Exercises 1. We know that D = T V , where D is the distance, T is the time, and V is the veloc- ity or speed. In other words, T = D / V. We insert the corresponding values to find the time needed for a bit to travel the cable. 3. Assume that the minimum fra
9、me size is 65 bytes or 520 bits. We have L = T R, where L is the length of the frame, T is the time, and the R is the data rate. We can say T = L / R. The time can be calculated as 5. The padding needs to make the size of the data section 46 bytes. If the data received from the upper layer is 42 byt
10、es, we need 46 42 = 4 bytes of padding. 7. a. Similarities: Each station has an equal right to the medium. Each station senses the medium. b. Differences: CSMA/CD: A station can send if it senses no signal on the line. CSMA/CA: A station needs to inform other stations that it needs the medium for a
11、specific amount of time.CSMA/CD: A collision can occur.CSMA/CA: Collisions are avoided. T = D / V = (2500 meters) / (200,000,000 meters/second) = 0.0000125 s = 12.5 s T = L / R = (520 bits) / (10,000,000) bits/second = 0.000052 s = 52 s 2 8. See Table 3.E8. Table 3.E8 Exercise 8 Fields IEEE 802.3 IE
12、EE 802.11 Destination address 6 Source address 6 Address 1 6 Address 2 6 Address 3 6 Address 4 6 FC 2 D/ID 2 SC 2 PDU length 2 Data and padding 1500 Frame body 2312 FCS (CRC) 4 41 CHAPTER 4 Introduction to Network Layer Exercises 1. We mention one advantage and one disadvantage for a connectionless
13、service: a. The connectionless service has at least one advantage. A connectionless service is simple. The source, destination, and the routers need to deal with each packet individually without considering the relationship between them. This means there are no setup and teardown phases. No extra pa
14、ckets are exchanged between the source and the destination for these two phases. b. The connectionless service has at least one disadvantage. The packets may arrive out of order; the upper layer that receive them needs to reorder them. 3. An n-bit label can create 2 n different virtual-circuit ident
15、ifier.5. Each packet started from the source needs to have a fragmentation identification, which is repeated in each fragment. The destination computer use this identifica- tion to reassemble all fragments belonging to the same packet. 7. The delay in the connection-oriented service is always more t
16、han the delay in the connectionless service no matter the message is long or short. However, the ratio of the overhead delay (setup and teardown phases) to the data transfer delay (trans- mission and propagation) is smaller for a long message than a short message in a connection-oriented service. 9.
17、 A router is normally connected to different link (networks), each with different MTU. The link from which the packet is received may have a larger MTU than the link to which the packet is sent, which means that router needs to fragment the packet. We will see in Chapter 27 that IPv6 does not allow
18、fragmentation at the router, which means the source needs to do some investigation and make the packet small enough to be carried through all links. 11. A fragment may have been lost and never arrives. The destination host cannot wait forever. The destination host starts a time and after the time-ou
19、t, it can sends an error message (see Chapter 9) to inform the source host that the packet is lost and, if necessary, should be resent. The time-out duration can be based on the informa-2 tion the destination host may collect about the status of the Internet. If there are many delays in the previous
20、 packet arrivals, it means that the Internet is congested, and the fragment may arrive soon (it is not necessarily lost). 1 CHAPTER 5 IPv4 Addresses Exercises 1. a. 2 8 = 256 addresses b. 2 16= 65536 addresses c. 2 64= 1.846744737 10 19addresses 3. 3 10= 59,049 addresses 5. a. 0x72220208 b. 0x810E06
21、08 c. 0xD022360C d. 0xEE220201 7. a. (8 bits) / (4 bits per hex digits) = 2 hex digits b. (16 bits) / (4 bits per hex digits) = 4 hex digits c. (24 bits) / (4 bits per hex digits) = 6 hex digits 9. We use Figure 5.6 (the right table) to find the class: a. The first byte is 208 (between 192 and 223)
22、Class C b. The first byte is 238 (between 224 and 299) Class D c. The first byte is 242 (between 240 and 255) Class E d. The first byte is 129 (between 000 and 127) Class A 11. a. Class is A netid: 114 and hostid: 34.2.8 b. Class is B netid: 132.56 and hostid: 8.6 c. Class is C netid: 208.34.54 and
23、hostid: 12 Chapter05.fm Page 1 Saturday, June 13, 2009 9:50 PM2 d. Class is E The address is not divided into netid and hostid. 13. We first change the number of addresses in the range (minus 1) to base 2562,048 1 = (0.0.7.255) 256 We add this number to the first address to find the last address: 15
24、. a. We can apply the first short cut to all bytes here. The result is (22.14.0.0). b. We can apply the first short cut to all bytes here. The result is (12.0.0.0). c. We can apply the first short cut to bytes 1and 4; we need to apply the second short cut to bytes 2 and 3. The result is (14.72.0.0).
25、 d. We can apply the first short cut to bytes 1 and 4; we need to apply the second short cut to bytes 2 and 3. The result is (28.0.32.0). 17. The first address can be found by ANDing the mask with the IP address as shown below: The last address can be found by either adding the number of addresses i
26、n the sub- net 2 32 n= 2 16 or by ORing the complement of the mask with the IP address (see the section on classless addressing because classful addressing is a special case of classless addressing) as shown below: 19. The first address can be found by ANDing the mask with the IP address as shown be
27、low: First Address: 122 . 12 . 7 . 0 Difference (base 256) 0 . 0 . 7 . 255 Last Address: 122 . 12 . 14 . 255 IP Address: 25 . 34 . 12 . 56 Mask: 255 . 255 . 0 . 0 First Address 25 . 34 . 0 . 0 IP Address: 25 . 34 . 12 . 56 Mask Complement: 0 . 0 . 255 . 255 Last Address 25 . 34 . 255 . 255 IP Addres
28、s: 202 . 44 . 82 . 16 Mask: 255 . 255 . 255 . 192 First Address 202 . 44 . 82 . 0 Chapter05.fm Page 2 Saturday, June 13, 2009 9:50 PM3 Note that we use the first short cut on the first three bytes. We use the second short cut on the fourth bytes: The last address can be found by ORing the complement
29、 of the mask with the IP address (see the section on classless addressing because classful addressing is a special case of classless addressing) as shown below: Note that we use the first short cut on the first three bytes. We use the second short cut on the fourth byte: 21. With the information giv
30、en, the first address is found by ANDing the host address with the mask 255.255.0.0 (/16). The last address can be found by ORing the host address with the mask comple- ment 0.0.255.255. However, we need to mention that this is the largest possible block with 2 16 addresses. We can have many small b
31、locks as long as the number of addresses divides this number. 23. See below. The number of created subnets are equal to or greater than required. 16 0 + 0 + 0 + 16 + 0 + 0 + 0 + 0 192 128 + 64 + 32 + 0 + 0 + 0 + 0 + 0 0 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 IP Address: 202 . 44 . 82 . 16 Mask Complement: 0
32、. 0 . 0 . 63 Last Address 202 . 44 . 82 . 127 16 0 + 64 + 32 + 16 + 0 + 0 + 0 + 0 63 0 + 0 + 32 + 16 + 8 + 4 + 2 + 1 127 0 + 64 + 32 + 16 + 8 + 4 + 2 + 1 Host Address: 25 . 34 . 12 . 56 Mask: 255 . 255 . 0 . 0 Network Address (First): 25 . 34 . 0 . 0 Host Address: 25 . 34 . 12 . 56 Mask Complement:
33、0 . 0 . 255 . 255 Last Address: 25 . 34 . 255 . 255 a. log 2 2 = 1 Number of 1s = 1 Number of created subnets: 2 b. log 2 62 = 5.95 Number of 1s = 6 Number of created subnets: 64 Chapter05.fm Page 3 Saturday, June 13, 2009 9:50 PM4 25. a. log 2 1024 = 10 Extra 1s = 10 Possible subnets: 1024 Mask: /2
34、6 b. 2 32 26= 64 addresses in each subnet c. First subnet: The first address is the beginning address of the block. To find the last address, we need to write 63 (one less than the number of addresses in each subnet) in base 256 (0.0.0.63) and add it to the first address (in base 256). d. Last subne
35、t (Subnet 1024): To find the first address in subnet 1024, we need to add 65,472 (1023 64) in base 256 (0.0.255.92) to the first address in subnet 1. Now we can calculate the last address in subnet 1024 as we did for the first address. 27. We first change the mask to binary to find the number of 1s:
36、 a. 11111111 11111111 11111111 00000000 /24 b. 11111111 00000000 00000000 00000000 /8 c. 11111111 11111111 11100000 00000000 /19 d. 11111111 11111111 11110000 00000000 /20 29. If the first and the last addresses are known, the block is fully defined. We can first find the number of addresses in the
37、block. We can then use the relationN = 2 32 n n = 32 log 2 N c. log 2 122 = 6.93 Number of 1s = 7 Number of created subnets: 128 d. log 2 250 = 7.96 Number of 1s = 8 Number of created subnets: 256 first address in subnet 1: 130 . 56 . 0 . 0 first address in subnet 1: 130 . 56 . 0 . 0 number of addre
38、sses: 0 . 0 . 0 . 63 last address in subnet 1: 130 . 56 . 0 . 63 first address in subnet 1 130 . 56 . 0 . 0 number of addresses: 0 . 0 . 255 . 192 first address in subnet 1024: 130 . 56 . 255 . 192 first address in subnet 500: 130 . 56 . 255 . 192 number of addresses: 0 . 0 . 0 . 63 last address in
39、subnet 500: 130 . 56 . 255 . 255 Chapter05.fm Page 4 Saturday, June 13, 2009 9:50 PM5 to find the prefix length. For example, if the first address is 17.24.12.64 and the last address is 17.24.12.127, then the number of addresses in the block is 64. We can find the prefix length as n = 32 log 2 N = 3
40、2 log 2 64 = 26 The block is then 72.24.12.64/26. 31. Many blocks can have the same prefix length. The prefix length only determines the number of addresses in the block, not the block itself. Two blocks can have the same prefix length but start in two different point in the address space. For exam-
41、 ple, the following two blocks have the same prefix length, but they are definitely two different blocks. The length of the blocks are the same, but the blocks are different. 33. Group 1 For this group, each customer needs 128 addresses. This means the suffix length is log 2 128 = 7). The prefix len
42、gth is then 32 7 = 25. The range of addresses are given for the first, second, and the last customer. The range of addresses for other customers can be easily found: Total addresses for group 1 = 200 128 = 25,600 addresses Group 2 For this group, each customer needs 16 addresses. This means the suff
43、ix length is log 2 16 = 4. The prefix length is then 32 4 = 28. The addresses are: Total addresses for group 2 = 400 16 = 6400 addresses Group 3 127.15.12.32/27 174.18.19.64/27 1st customer: 150.80.0.0/25 to 150.80.0.127/25 2nd customer: 150.80.0.128/25 to 150.80.0.255/25 . 200th customer: 150.80.99
44、.128/25 to 150.80.99.255/25 1st customer: 150.80.100.0/28 to 150.80.100.15/28 2nd customer: 150.80.100.16/28 to 150.80.100.31/28 . 400th customer: 150.80.124.240/28 to 150.80.124.255/28 Chapter05.fm Page 5 Saturday, June 13, 2009 9:50 PM6 For this group, each customer needs 4 addresses. This means t
45、he suffix length is log 2 4 = 2. The prefix length is then 32 2 = 30. The addresses are: Total addresses for group 3 = 2048 4 = 8192 addresses Number of allocated addresses: 40,192 Number of available addresses: 25,344 35. There are actually two choices. If the ISP wants to use subnetting (a router
46、with 32 output ports) then the prefix length for each customer is n sub= 32. However, there is no need for a router and subnetting. Each customer can be directly connected to the ISP server. In this case, the whole set of the customer can be taught of addresses in one single block with the prefix le
47、ngth n (the prefix length assigned to the ISP). 1st customer: 150.80.125.0/30 to 150.80.125.3/30 2nd customer: 150.80.125.4/30 to 150.80.100.7/30 . 64th customer: 150.80.125.252/30 to 150.80.125.255/30 65th customer: 150.80.126.0/30 to 150.80.126.3/30 . 2048th customer: 150.80.156.252/30 to 150.80.1
48、56.255/30 Chapter05.fm Page 6 Saturday, June 13, 2009 9:50 PM1 CHAPTER 6 Delivery, Forwarding, and Routing of IP Packets Exercises 1. Direct; Both hosts are on the same network (same netid: 137.23). 3. See Table 6.E3. 5. Destination address: 192.16.7.42 Binary: 11000000 00010000 00000111 00101010 Sh
49、ift copy of address: 00000000 00000000 00000000 00001100 = 12 10 Destination network: Class C Network address: 192.16.7.0 Next hop address: 111.15.17.32 Interface: m0 7. Destination address: 147.26.50.30 Binary: 10010011 00011010 00110010 00011110 Shift copy of address: 00000000 00000000 00000000 00001001 = 9 10 Destination network: Class B Network address: 147.26.0.0 Next hop address: 111.30.31.18 Interface: m0 9. Destination address: 135.11.80.21 Mask: /18 Network address: 135.11.64.0 Next