Communication Networks Example

download Communication Networks Example

of 19

Transcript of Communication Networks Example

  • 8/12/2019 Communication Networks Example

    1/19

    t1-1

    Test1: Solutions

    Silvia Giordano

    ICA, EPFL

  • 8/12/2019 Communication Networks Example

    2/19

    t1-2

    EX1: Delay Consider sending two large files File1 and File2

    from host A to host B. The size of the files is F1andF2=3*F1 bits, respectively. The two hosts areconnected by two single point-to-point links both ofm meters. Suppose that the propagation speed

    along both links is s meters/sec. Suppose that thelinks are uncongested (that is, no queuing delays),and that the link rate of link1 is R1 bps, and the linkrate of link2 is R2 bps. A can transmit on both links

    in parallel. Answer the following questions:

    A B

    link 1

    link 2

    A B

    link 1

    link 2

  • 8/12/2019 Communication Networks Example

    3/19

    t1-3

    EX1: Delay1) Suppose there is no segmentation (the

    transmission unit is the entire file). If A starts attime t=t0 at what time, at earliest, B can receivethe whole File1?

    The fastest way is to send File 1 on the link withlarger rate, max(R1,R2). The File 1 is received, atearliest, at:

    t = t0 + m/s + F1/(max(R1,R2))

    F1

    max(R1,R2))A B

    File1

    t0transmission delayF1/(max(R1,R2))

    propagationdelay m/s

  • 8/12/2019 Communication Networks Example

    4/19

    t1-4

    EX1: Delay2) If A starts at time t=t0 at what time, at

    earliest, B can receive the whole File2?

    t = t0 + m/s + F2/(max(R1,R2))

    F2

    max(R1,R2))A B

    File2

    t0transmission delayF2/(max(R1,R2))

    propagationdelay m/s

  • 8/12/2019 Communication Networks Example

    5/19

    t1-5

    EX1: Delay3) If A starts at time t=t0 at what time, at

    earliest, B can receive the whole File1 and thewhole File2?

    t = t0 + m/s + min{ P1, P2)}

    P1= max{ F1/min(R1,R2) , F2/max(R1,R2) }P2 = (F1+F2)/max(R1,R2)

    A B

    A B

    File1+ File2

    t0

    transmission delayP2=(F1+F2)/(max(R1,R2))

    propagationdelay m/s

    File1

    t0

    transmission delayP1 = max{F1/min(R1,R2) , F2/max(R1,R2) }

    propagationdelay m/s

    File2t=t0 + m/s +min{ P1, P2)}

  • 8/12/2019 Communication Networks Example

    6/19

    t1-6

    EX1: Delay

    4)Suppose that host A segments the file intosegments of S=F1 bits each and adds h bitsof header to each segment, forming packetsof L = h + S bit. In this question, we supposeR1=R2=R. Which is the best transmissionstrategy for transmitting both File1 andFile2? Sequential (first one file, and, when

    possible, the other one) or parallel (start totransmit the two files at the same time)?Why?

  • 8/12/2019 Communication Networks Example

    7/19

    t1-7

    EX1: DelayAs S=F1 and R1=R2=R, the 2 strategies are

    equivalent:

    Sequential: start sending File 1. As S=F1, thereis only one segment, which is sent on one link.

    Thus, the other link can be used to start sendingFile 2. When File 1 ends, we can start using the2 links in parallel:

    t = 2L/R + t0 + m/slink1

    link2

  • 8/12/2019 Communication Networks Example

    8/19

    t1-8

    EX1: Delay

    As S=F1 and R1=R2=R, the 2 strategies areequivalent:

    Parallel: start sending File 1 on one link and File 2on the other link. When File 1 ends, we can start

    using both links for File 2:

    t = 2L/R + to + m/s

    link1

    link2

  • 8/12/2019 Communication Networks Example

    9/19

    t1-9

    EX2: JAVA

    Consider the Intranet INTRA007 in the diagram3, with addresses 111.1.1.0/24. Security is ahigh concern of INTRA007 and people frominside can go out only with SMTP protocol (email).

    A

    B

    G

    INTERNETINTRA007

    A

    B

    G

    INTERNETINTRA007

  • 8/12/2019 Communication Networks Example

    10/19

    t1-10

    EX2: JAVA

    The gateway G is the access node to/from theInternet. When a person from inside wants to sendan email, he accesses the INTRA007-userinterfacethat passes the users data to the INTRA007-

    emailClient. The INTRA007-emailClient builds, withthe user data, the following packet, and then itsends it.

    A

    B

    G

    INTERNETINTRA007

    A

    B

    G

    INTERNETINTRA007ToGemail

  • 8/12/2019 Communication Networks Example

    11/19

    t1-11

    EX2: JAVA1) Describe what happens to the mail written by

    the users before eventually getting to theInternet.

    The mail is controlled by G. It checks both the

    recipients and the data of the mail.2) Describe what is G.

    G is a controller working on UDP. Technically, it iscalled an application gateway (will see it next week).

  • 8/12/2019 Communication Networks Example

    12/19

    t1-12

    EX2: JAVA3) Suppose A, B and C clients contact G at the

    same time and they enter as following in theincoming request queue on the host that runs G:[A, C, B]. At time t, when G receives the first

    packet, what is going on at A, B and C?A, B and C have sent their packet to G. They have

    closed the UDP socket and they will not wait forany ACK. The packet from A is being received.

    After the execution of the datagrampacket.receivefor packet sent by A, the packet the packet sentby C is received, and finally, so is the one sent by B.

  • 8/12/2019 Communication Networks Example

    13/19

    t1-13

    EX2: JAVA4) How would you introduce the access to the Web

    (HTTP), respecting the same security-basedphilosophy? (You are not required to write anycode, just to describe the architecture and how

    it works).When a user wants to access a web page from/at

    INTRA007, he accesses theINTRA007.userInterface that passes the users

    data to INTRA007.web. This controls the data andcheck whether the client/server are authorised.If so, the connection is started.

  • 8/12/2019 Communication Networks Example

    14/19

    t1-14

    EX3: GBN and SR

    Consider the Go-back-N and Selective Repeatprotocols. Suppose the sequence number space is,for both, of size k. Assume that the round-trip-time between the sender S and the receiver R is

    constant and equal to RTT seconds.sender S receiver R

    pkt0

    pkt1

    constant RTT

  • 8/12/2019 Communication Networks Example

    15/19

    t1-15

    EX3: GBN and SR1) What is the largest allowable sender window for

    Go-back-N that will avoid the problem ofunderstanding if a packet is a new packet or aretransmission, as we analyzed in class?

    The sender window has to be smaller than k/2.2) What is the largest allowable sender window for

    Selective Repeat that will avoid the sameproblem?

    k/2

  • 8/12/2019 Communication Networks Example

    16/19

    t1-16

    EX3: GBN and SR3)Suppose that the whole session consists of hpackets and that the sender S starts to send the

    first packet at time t=t0. Suppose that thepacket pkt2 is lost, and that there are no other

    losses afterwards. In this question, we supposethat the transmission delay of a packet is seconds and that the retransmission timer(timeout) starts when sender S starts

    transmitting the packet. At what time, atearliest, the receiver R can receive the lastpacket pkth if Go-Back-N protocol is used?

  • 8/12/2019 Communication Networks Example

    17/19

    t1-17

    EX3: GBN and SR

    The pkt0 and pkt1 are correctly transmitted, withpkt2, the timer is started at time t=2. When itexpires, all packets from pkt2 must beretransmitted. To this time we must add the time

    for propagating a packet to B (rtt/2):t = t0 + rtt/2 + 2 + timeout + (h-2)

    = t0 + rrt/2 + timeout + h

    S Rpkt0

    pkt1

    timeoutpk

    t2

    pkt2

    pkt3

  • 8/12/2019 Communication Networks Example

    18/19

    t1-18

    EX3: GBN and SR4) Suppose that the whole session consists of hpackets and that the sender S starts to send the

    first packet at time t=t0. Suppose that the packetpkt2 is lost, and that there are no other losses

    afterwards. At what time, at earliest, the receiverR can receive the last packet pkth if SelectiveRepeat protocol is used?

  • 8/12/2019 Communication Networks Example

    19/19

    t1-19

    EX3: GBN and SR

    All packets, but pkt2, are correctly transmitted.When timer expires, only pkt2 is retransmitted. Tothis time we must add the time for propagating apacket to B (rtt/2):

    t = t0 + rtt/2 + 2 + max(timeout,(h-2) ) +

    S Rpkt0

    pkt1

    timeoutpkt2

    pkt2

    pkt3pkt4

    pkt5

    S Rpkt0

    pkt1

    timeoutpk

    t2

    pkth

    pkt3pkt4pkt5

    pktkpkt2

    pkt(k+1)