CS 176A -- Introduction to Computer Communication Networks
Homework Assignment #3

NOTE: All questions were worth 10 points. In some cases alternative answers may also be correct.

  1. Run the simulation applet on the web page: http://www.rad.com/networks/1998/packet/sim.htm. Run both the virtual circuit and datagram configurations.

  2. The Type of Service field of the IP header has two unused bits. Intuitively, having two unused bits is wasteful. Discuss why eliminating the two unused bits is difficult.

    For one, these bits occur within the header, whose length is specified by the IHL field in blocks of 32 bits. In order to incure a useful reduction in overhead, at least 32 bits must be removed. Otherwise the value of IHL will not decrease and the header will have to be padded until it's size is equal to that specified by the IHL: the exact number of bits removed... totally defeating the purpose.

    Another important problem that would result from removing the two unused TOS bits is that the subsequent offsets of other IP header fields would change, requiring that all routers and hosts be updated to work with this change.

    Finally, while having the unused bits in the current version of IP is wasteful, eliminating them could make deployment of future versions of IP more difficult. According to RFC 1812 "These rules are intended to ensure that these revisions can be deployed without having to simultaneously upgrade all routers in the Internet."

  3. Consider sending a 3000 byte datagram into a link that has an MTU of 500 bytes. How many fragments are generated? What are their characteristics (i.e. what are the flags and offset values for each

    Assume that the DF flag was not set : )
    Assume that no optional fields of the IP header are in use (i.e. IP header is 20 bytes)
    The original datagram was 3000 bytes, subtracting 20 bytes for header, that leaves 2980 bytes of data.
    Assume the ID of the original packet is 'x'
    With an MTU of 500 bytes, 500 - 20 = 480 bytes of data may be transmitted in each packet
    Therefore, ceiling(2980 / 480) = 7 packets are needed to carry the data.
    The packets will have the following characteristics (NOTE: offset is measured in 8 byte blocks, you don't need to specify Total_len)

    Packet 1: ID=x, Total_len=500, MF=1, Frag_offset=0
    Packet 2: ID=x, Total_len=500, MF=1, Frag_offset=60
    Packet 3: ID=x, Total_len=500, MF=1, Frag_offset=120
    Packet 4: ID=x, Total_len=500, MF=1, Frag_offset=180
    Packet 5: ID=x, Total_len=500, MF=1, Frag_offset=240
    Packet 6: ID=x, Total_len=500, MF=1, Frag_offset=300
    Packet 7: ID=x, Total_len=120, MF=0, Frag_offset=360

  4. A router is blasting out IP packets whose total length (data plus header) is 1024 bytes. Assuming that packets live for 10 seconds, what is the maximum line speed the router can operate at without danger of cycling through the IP datagram ID number space? Now assume that packets are 40 bytes long (e.g. IP and TCP but with no data), what is the new maximum line speed?

    The IP datagram ID number space is 216 = 65535
    Packet lifetime = 10 seconds
    Therefore, a maximum of 65535 packets may be sent in 10 seconds. If any more packets were to be sent within the 10 seconds, there would be multiple live packets with the same ID.
    floor(65535/10) = 6553 packets/sec

    The maximum line speed @ 1024 bytes/packet is:
    1024 bytes/packet * 6553 packets/sec * 8 bits/byte = 53,682,176 bps (~ 53.7 Mbps)

    The maximum line speed @ 40 bytes/packet is:
    40 bytes/packet * 6553 packets/sec * 8 bits/byte = 2,096,960 bps (~2.1 Mbps)


  5. Suppose that instead of using 16 bits for the network part of a class B address originally, 20 bits had been used. How many class B networks would there have been?

    Class B networks range from 128-191 (or 64 possible values) over their first 8 bits. Therefore, the number of networks had class B used 20 bits to represent the network part of the address would have been 64 * 212 = 262,144

    Another way to think of this is that there are 2 [number of network bits - 2] addresses. We subtract 2 because Class B address must start with 10 (in binary). Thus there are 218 = 262,144 networks.

  6. Can the following IP addresses be aggregated: 57.6.96.0/21, 57.6.104.0/21, 57.6.112.0/21, 57.6.120.0/21? If so, to what? If not, why not?

    57.6.96.0  = 00111000 00000110 01100000 00000000
    57.6.104.0 = 00111000 00000110 01101000 00000000
    57.6.112.0 = 00111000 00000110 01110000 00000000
    57.6.120.0 = 00111000 00000110 01111000 00000000
    Note that these 4 IP addresses are adjecent in binary. Because of this, they can be aggregated to:
    57.6.96.0/19 = 00111000 00000110 01100000 00000000


  7. If UCSB is allocated the range of addresses 128.111/16 and they want to divide it into 8 equal groups of addresses, what exactly would the new ranges of addresses be?

    128.111/16 = 10000000 01101111

    To split an address range into 8 groups we need to use log2 8 = 3 bits, resulting in:
    128.111.0/19   = 10000000 01101111 00000000
    128.111.32/19 = 10000000 01101111 00100000
    128.111.64/19 = 10000000 01101111 01000000
    128.111.96/19 = 10000000 01101111 01100000
    128.111.128/19 = 10000000 01101111 10000000
    128.111.160/19 = 10000000 01101111 10100000
    128.111.192/19 = 10000000 01101111 11000000
    128.111.224/19 = 10000000 01101111 11100000
  8. Explain how traceroute works. Include a traceroute to a host at least 20 hops away.

    Traceroute transmits packets with small TTL values. Recall that the TTL (Time To Live) is an IP header field that is designed to prevent packets from running in loops. Every router that handles a packet subtracts one from the packet's TTL. If the TTL reaches zero, the packet has expired and is discarded. Traceroute depends on the common router practice of sending an ICMP Time Exceeded message, documented in RFC 792, back to the sender when this occurs. By using small TTL values which quickly expire, traceroute causes routers along a packet's normal delivery path to generate these ICMP messages which identify the router. A TTL value of one should produce a message from the first router; a TTL value of two generates a message from the second; etc. Here is a traceroute to a host at least 20 hops away:

    $ traceroute iitkgp.ernet.in
    traceroute: Warning: iitkgp.ernet.in has multiple addresses; using 202.141.127.2traceroute to iitkgp.ernet.in (202.141.127.2), 30 hops max, 38 byte packets
     1  csworld43 (128.111.43.1)  14.072 ms  1.448 ms  1.302 ms
     2  128.111.235.1 (128.111.235.1)  2.156 ms  4.469 ms  1.912 ms
     3  556-NOC-556-c.noc.ucsb.edu (128.111.4.65)  1.479 ms  3.376 ms  0.913 ms
     4  574-c.noc.ucsb.edu (128.111.2.19)  3.636 ms  4.275 ms  1.545 ms
     5  gsr-ngb.commserv.ucsb.edu (128.111.252.153)  1.345 ms  4.358 ms  1.879 ms
     6  border1-g-1-0-0.commserv.ucsb.edu (128.111.252.149)  1.770 ms  4.407 ms  2.158 ms
     7  teanet-qanh-far.commserv.ucsb.edu (128.111.252.10)  13.318 ms  4.928 ms  5.578 ms
     8  bur-edge-01.inet.qwest.net (65.119.29.93)  8.644 ms  6.570 ms  6.764 ms
     9  bur-core-01.inet.qwest.net (205.171.13.13)  8.925 ms  7.008 ms  7.161 ms
    10  lax-core-01.inet.qwest.net (205.171.8.41)  8.218 ms  9.144 ms  6.761 ms
    11  lax-brdr-01.inet.qwest.net (205.171.19.38)  13.481 ms  7.421 ms  7.254 ms
    12  so3-1-0-622M.br1.LAX1.gblx.net (208.50.13.9)  15.233 ms  7.610 ms  7.220 ms
    13  pos2-1-155M.cr2.LAX1.gblx.net (206.132.112.121)  13.052 ms  7.868 ms  8.239 ms
    14  pos1-0-622M.cr2.NYC2.gblx.net (206.132.249.170)  76.944 ms  76.532 ms  76.565 ms
    15  so7-0-0-2488M.ar2.NYC2.gblx.net (64.215.195.170)  76.859 ms  77.772 ms  77.042 ms
    16  TelecomItaliaMumbiNYC4.so-2-3-3.ar2.NYC2.gblx.net (64.211.60.250)  275.347 ms  275.070 ms  274.573 ms
    17  202.54.2.189 (202.54.2.189)  280.670 ms  282.561 ms  281.847 ms
    18  202.54.2.174 (202.54.2.174)  301.437 ms  301.736 ms  302.358 ms
    19  203.197.119.1 (203.197.119.1)  302.292 ms  301.906 ms  301.967 ms
    20  202.54.55.165 (202.54.55.165)  484.014 ms  361.006 ms  336.702 ms
    21  iitkgp.iitkgp.ernet.in (203.197.98.10)  342.921 ms  334.959 ms *


  9. Use the shortest path simulation applet from the web page:http://www.cs.uwa.edu.au/undergraduate/courses/230.300/readings/graphapplet/dijkstra.html


  10. Run the simulation of RIP available on the web page:http://www-mm.informatik.uni-mannheim.de/veranstaltungen/animation/routing/ripdvmrp/