Solved Assignment 1

download Solved Assignment 1

of 6

Transcript of Solved Assignment 1

  • 7/30/2019 Solved Assignment 1

    1/6

    Distributed

    Networks 303

    Assignment 1

    Muhammad

    Nasir

    Masood

    7E2A9729/16313008

  • 7/30/2019 Solved Assignment 1

    2/6

    Distributed Networks 303 .. Assignment 1 2013

    2

    Question 1:

    Consider sending voice from host A to host B over a packet-switched network. Host A converts analog voice to a digital 64 Kbps bitstream on the fly. Host A then groups the bits into 48-byte packets.There is one link between hosts A and B; its transmission rate is 1Mbpsand its propagation delay is 1msec. As soon as host A gathers apacket, it sends it to host B. As soon as host B receives an entirepacket, it converts the packets bits to an analog signal. How much timeelapses from the time a bit is created (from the original analog signal athost A) unit the bit is decoded (as part of the analog signal at host B)?

    Answer:

    Other bits belonging to the same packet need to be generated beforefirst bit of a packet.

    So

    = 6ms

    The time to transmit this required is = 0.384 ms

    The propagation is 1 ms

    Therefore, the delay until decoding is: 6ms + 0.384 +1ms = 7.384 ms

    Question 2:

    Suppose users share a 1Mbps link. Also suppose each user requires100Kbps when transmitting, but each user transmits only 20% of thetime.

    a) When circuit switching is used, how many users can besupported? (5 marks)

    b) For the remainder of the problem, suppose packet switching isused. Find the probability that a given user is transmitting. (5marks)

    c) Suppose there are 20 users. Find the probability that at any giventime, exactly n users are transmitting simultaneously. (10 marks)

    d) Find the probability that there are 11 or more users transmittingsimultaneously. (10 marks)

  • 7/30/2019 Solved Assignment 1

    3/6

    Distributed Networks 303 .. Assignment 1 2013

    3

    Answers:

    a) Total transmission rate = 1 MbpsMinimum transmission rate required by each user = 100 kbps

    Therefore

    = 10.24

    So, around 10 users can support the link.

    b) Each user transmit only 20% of the time

    So the probability that a user is transmitting is

    = 0.2

    c) Total number of users = 20Number of users transmitting = nSince each user transmit 20 % of the time

    Hence probability p =

    = 0.2 and q= (1-p) = 0.8Probability of n users transmitting simultaneously by using binominaldistribution is

    (0.2)

    n (0.8) 20 - n

    d) No. of users = 20No. of user transmitting R= 11Probability of each user P = 20 percent

    q = (1-p) = 0.8

    1 - ( )

    (less than 11 user)

  • 7/30/2019 Solved Assignment 1

    4/6

    Distributed Networks 303 .. Assignment 1 2013

    4

    Question 3:

    Please explain briefly how multiple users behind a NAT router can share oneIP address.

    Answer:

    NAT (Network Address Translation) is a method which connects multipledevices to internet using just one public IP address which means only onesingle unique public IP address is enough to connect home users andsmall businesses to Internet easily, cheaply and efficiently.

    For example PC-A wants to access Google.com, the source IP address is192.168.32.10 but when packet reaches to NAT router, the router changePC-A IP address to public IP address 215.37.32.203 which is assigned torouter by ISP. When router receives response from Google to router,

    router knows the source of request and forwards it to PC.

    NAT dont do all this alone, PAT (Port Address Translation) also helpalong with it. Both together do many-to-one translation which means issource IP addresses and their port numbers. In PC there are about 65,536ports which actually uses by different applications to let the network andsystem know the specific request of a specific application over network.

  • 7/30/2019 Solved Assignment 1

    5/6

    Distributed Networks 303 .. Assignment 1 2013

    5

    This table is called Address Translation Table set and stored in router.What here router is doing is actually saves the users IP address and theirports to this table and replacing it with public IP address assign it by ISP.And router also replacing port numbers by generating its own numbers so

    that when response will come back, router forward the packets in homenetwork according to entries is address translation table.

    Like in first entry PC-A has IP address 192.168.32.10 and request camefrom port 400, now source IP address is replaced by 215.37.32.203 withport 1. Now anyone from world wants to communicate with PC will believethat PC-A has 215.37.32.203 with port 1.

    The number of simultaneous translation of IP addresses that a routersupport depends upon DRAM (Dynamic Random Access Memory) it has.But its actually just typical table only takes 160 bytes, so the router with 4

    MB of DRAM could process 26214 translations.

    Question 4:

    a) A network on the Internet has a subnet mask of 255.255.240.0. What isthe maximum number of hosts it can handle?

    Answer:

    Subnet Mask 255.255.255.240.0

    In binary notation 11111111 11111111 11110000 00000000

    Therefore 212 2 = 4094 hosts

    b) A router has the following (CIDR) entries in its routing table:

    Address/mask Next hop135.46.56.0/22 Interface 0135.46.60.0/22 Interface 1135.46.48.0/20 Interface 2192.53.40.0/23 Router 1

  • 7/30/2019 Solved Assignment 1

    6/6

    Distributed Networks 303 .. Assignment 1 2013

    6

    default Router 2

    For each of the following IP addresses, what does the router do if a packetwith that address arrives?

    1) 135.46.63.102) 135.46.121.143) 135.46.52.24) 192.53.41.75) 192.53.57.7

    Answer:

    Address / Mask Binary Address135.46.56.0/22 10000111 00101110 00111000 00000000135.46.60.0/22 10000111 00101110 00111100 00000000135.46.48.0/20 10000111 00101110 00110000 00000000192.53.40.0/23 11000000 00110101 00101000 00000000

    1) 135.46.63.10 = 10000111 00101110 00111111 00001010

    This matches the 2nd

    network mask so the packet will forward to Interface1.

    2) 135.46.121.14 = 10000111 00101110 01111001 00001110This doesnt match with any network masks so router sends this packet to

    the default, Router 2.

    3) 135.46.52.2 = 10000111 00101110 00110100 00000010This matches with 3rd network address so the packet will forward toInterface 2.

    4) 192.53.41.7 = 11000000 00110101 00101001 00000111This matches with 4th network address so the packet will forward to Router1.

    5) 192.53.57.7 = 11000000 00110101 00111001 00000111This doesnt match with any network masks so router sends this packet tothe default, Router 2.