天天看點

comp3331-9331-21t2-midterm複習

文章目錄

  • ​​21T2-sample 複習​​
  • ​​域名​​
  • ​​http​​
  • ​​電路交換 circuit switch​​
  • ​​封包交換packet switching​​
  • ​​BitTorrent Tit/Tat​​
  • ​​UDP​​
  • ​​checksum​​
  • ​​應用​​
  • ​​TCP​​
  • ​​RDT​​
  • ​​GBN and SR​​
  • ​​sequence number​​
  • ​​四大延遲-資料傳輸大題​​
  • ​​算傳播和傳輸延遲​​
  • ​​不同線路算延遲​​
  • ​​socket​​
  • ​​21T2真題​​

文章目錄

  • ​​21T2-sample 複習​​
  • ​​域名​​
  • ​​http​​
  • ​​電路交換 circuit switch​​
  • ​​封包交換packet switching​​
  • ​​BitTorrent Tit/Tat​​
  • ​​UDP​​
  • ​​checksum​​
  • ​​應用​​
  • ​​TCP​​
  • ​​RDT​​
  • ​​GBN and SR​​
  • ​​sequence number​​
  • ​​四大延遲-資料傳輸大題​​
  • ​​算傳播和傳輸延遲​​
  • ​​不同線路算延遲​​
  • ​​socket​​
  • ​​21T2真題​​

21T2-sample 複習

域名

resource records (RR) 儲存在域名伺服器上(DNS),其他用戶端或者伺服器可以去dns上找到某個網址記錄,比如找到域名的ip位址,然後去通路。

視訊教程:https://www.youtube.com/watch?v=6uEwzkfViSM

[外鍊圖檔轉存失敗,源站可能有防盜鍊機制,建議将圖檔儲存下來直接上傳(img-GfTTnkrA-1648423914702)(C:/Users/YMXD/AppData/Roaming/Typora/typora-user-images/image-20220326185015011.png)]

type A就是主機名和ip,value是ip位址

cname就是容易記的别名指到某個規範名字,name是很好記的名字,value就比較長的名字

ns就是權威域名伺服器的位址,上面儲存了想查詢的這個記錄具體的内容,一般value有字首ns , ns1.google.com主要域名伺服器,次級域名伺服器 ns2.gogle.com

mx就是某個郵件伺服器想給這個網址(test.com)發郵件,發到這個網站接受郵件的網址。一般value字首有mail,比如mail1.test.com,再比如smtp.gmail.com

某個主機名(google.com)的權威名稱伺服器的資訊存儲在.com TLD(top level domain)伺服器中,這樣當本地DNS伺服器查詢主機名的映射時,它們可以被定向到包含實際答案(即所請求的映射)的權威名稱伺服器。是以,谷歌域名伺服器(主要和次要)的NS記錄将存儲在.com TLD伺服器中。此外,這些名稱伺服器(即A記錄)的對應IP位址也會存儲在.com TLD伺服器。

​也就是說,value帶ns的,和值帶ns的,都可以在頂級域名伺服器中找到。​

© (google.com, ns1.google.com, XXX, 2 days)

(d) (google.com, ns2.google.com, XXX, 2 days)

(e) (ns1.google.com, 216.239.32.10, XXX, 2 days)

(f) (ns2.google.com, 216.239.34.1, XXX, 2 days)

© (google.com, ns1.google.com, XXX, 2 days)

(d) (google.com, ns2.google.com, XXX, 2 days)

(e) (ns1.google.com, 216.239.32.10, XXX, 2 days)

(f) (ns2.google.com, 216.239.34.1, XXX, 2 days)

有個網址(alias name),用戶端通路,先去本地dns找對應的ip或者郵件伺服器的名稱,本地dns緩存的内容和權威dns一樣。

權威dns的資訊,儲存在tld域名伺服器上。

http

non-persistent

persistent

persistent with pipeline:先接收index,之後的objects同一時刻送出請求,所有的objects都同時過來。

電路交換 circuit switch

comp3331-9331-21t2-midterm複習

線路獨占,因為無法确定哪個時間段在用,是以就一直維護這段線路。

封包交換packet switching

要發資訊了,就建立一個封包,然後去發,發完馬上結束占用。是以,如果某一時刻用的人多了,超過線路帶寬,就需要排隊。

BitTorrent Tit/Tat

tit for tat 以牙還牙

​​最後一節​​

[外鍊圖檔轉存失敗,源站可能有防盜鍊機制,建議将圖檔儲存下來直接上傳(img-GIh2LQwW-1648423914703)(C:/Users/YMXD/AppData/Roaming/Typora/typora-user-images/image-20220326193748742.png)]

alice 和 bob都需要下載下傳某檔案,也都有某檔案的一些塊,alice先随機選擇bob給他塊,成為4個給bob最快檔案塊的之一,那bob也會很快地優先給alice塊,是以互相受益。

但是,如果alice已經下載下傳完了,那其實以牙還牙,alice沒受到好處,找不到4個給alice最快檔案塊的人。

UDP

checksum

偶校驗:資料和校驗位加起來是偶數個1.

[外鍊圖檔轉存失敗,源站可能有防盜鍊機制,建議将圖檔儲存下來直接上傳(img-QU7paeFL-1648423914703)(C:/Users/YMXD/AppData/Roaming/Typora/typora-user-images/image-20220326195018349.png)]

應用

udp速度快,可靠性不高。dns和fps遊戲,看視訊用udp

email和bittorrent用tcp

TCP

RDT

5個特征:

TCP對最老的未确認段使用一個定時器。

根據快速重傳機制,當它收到三次重複的ACK時,發送方重新發送一個段。

tcp使用累積的ACK。​​累積确認​​

計時器過期将導緻傳輸最老的沒收到ack的段

GBN and SR

GBN: 使用累積确認的方式,不按照順序接受到的包會被丢棄。

SR: 每一個包都會被單獨确認,是以不需要按照順序。

sequence number

兩個知識點:

  • 一個bytes消耗一個sequence number
  • ack number 是下一個期望到來的squence number

[外鍊圖檔轉存失敗,源站可能有防盜鍊機制,建議将圖檔儲存下來直接上傳(img-IGGZxruw-1648423914704)(C:/Users/YMXD/AppData/Roaming/Typora/typora-user-images/image-20220327111537592.png)]

四大延遲-資料傳輸大題

算傳播和傳輸延遲

link type 1線路上傳播dp1: = 2X10^6 m/2X 10^8 = 0.01s

hostA往線路上打的傳輸延遲dt1(一個包): 1000 X 8 bits /(100 000 bits/s) = 0.08s

​注意:!!! 打包算傳輸延遲,一定要轉成bits的機關,而且要一個包,一個包分析​

仔細地一個一個包算,一定可以。

不同線路算延遲

注意畫圖仔細

socket

ip address是點分十進制的表示,port是數字

21T2真題

  1. TIME ALLOWED: 1 hours and 10 minutes.
  2. TOTAL MARKS AVAILABLE: 20 marks worth 20% of the total marks for the course.
  3. ALL QUESTIONS MUST BE ANSWERED.
  4. MARKS AVAILABLE FOR EACH QUESTION ARE SHOWN IN THE EXAM. THERE IS NO

    NEGATIVE MARKING, IN THAT THE MINIMUM MARK FOR EACH QUESTION IS ZERO.

  5. THE EXAM IS OPEN BOOK, OPEN NOTES. USE OF CALCULATORS IS PERMITTED.
  6. STUDENTS ARE ADVISED TO READ THE EXAMINATION QUESTION BEFORE

    ATTEMPTING TO ANSWER THE QUESTION.

  7. THIS EXAM CANNOT BE COPIED, FORWARDED, OR SHARED IN ANY WAY.
  8. STUDENTS ARE REMINDED OF THE UNSW RULES REGARDING ACADEMIC INTEGRITY

    AND PLAGIARISM.

  9. YOUR WORK WILL BE SAVED PERIODICALLY THROUGHOUT THE EXAM AND WILL BE

    AUTOMATICALLY SUBMITTED PROVIDED YOU ARE CONNECTED TO THE INTERNET.

    09/07/2021

    Sample Mid Term Exam

    ​​​https://unsw.inspera.com/admin#author/test/87304030​​​2/33

    We know smtp.gmail.com is the mail server of gmail.com and ns1.google.com and

    ns2.google.com are the authoritative DNS servers for google.com. The questions

    below are about the following DNS Resource Records (a - f) where the entry types

    are masked (XXX).

    (a) (gmail.com, smtp.gmail.com, XXX, 2 days)

    (b) (smtp.gmail.com, 108.177.125.10, XXX, 2 days)

    © (google.com, ns1.google.com, XXX, 2 days)

    (d) (google.com, ns2.google.com, XXX, 2 days)

    (e) (ns1.google.com, 216.239.32.10, XXX, 2 days)

    (f) (ns2.google.com, 216.239.34.1, XXX, 2 days)

    Answer the 6 multiple-choice questions. You may select multiple choices for each

    answer. However, note that selecting additional choices beyond the correct

    answer(s) will be considered incorrect. Partial marks may be allocated as noted in

    the marking scheme. The lowest possible mark is 0.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    3/33

    1 DNS Q1

  10. Which of the provided Resource Records are Type A entries?

    Select one or more alternatives:

    (b)

    (f)

    None of the provided records

    (e)

    ©

    (a)

    (d)

    Maximum marks: 0.5

    Type A records provide a mapping from hostname to IP address. Thus the correct answer is (b), (e)

    and (f). 0.167 mark for each correct answer and -0.167 mark for each incorrect answer. 0 if “none of

    the provided records” is chosen. Minimum possible mark is 0.

    09/07/2021

    Sample Mid Term Exam

    ​​​https://unsw.inspera.com/admin#author/test/87304030​​​4/33

    2 DNS Q2

    Which of the provided Resource Records are Type MX entries?

    Select one or more alternatives:

    (b)

    (a)

    ©

    (f)

    (e)

    (d)

    None of the provided records

    Maximum marks: 0.5

    MX refers to the mail server record, thus the correct answer is (a). 0.5 mark for the correct answer and

    -0.1 for each incorrect answer. 0 if “none of the provided records” is chosen. Minimum possible mark is 0.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    5/33

    3 DNS Q3

    Which of the provided Resource Records are Type NS entries?

    Select one or more alternatives:

    (f)

    None of the provided records

    (a)

    (b)

    (d)

    (e)

    ©

    Maximum marks: 0.5

    NS refers to a name server record which provides the name of the nameserver responsible for the

    hostname/domain.

    Thus the correct answer is © and (d) , which are the primary and secondary nameserver for google.com.

    0.25 for each correct answer and -0.125 answer for each incorrect answer. 0 if “none of the provided

    records” is chosen. Minimum possible mark is 0.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    6/33

    4 DNS Q4

    Which of the provided Resource Records are type CNAME entries?

    Select one or more alternatives:

    None of the provided records

    ©

    (b)

    (a)

    (f)

    (d)

    (e)

    Maximum marks: 0.5

    CNAME refers to a canonical name record for the hostname. None of the provided records are of this

    type. 0.5 mark for the correct answer. -0.5 mark if any of the other answers is chosen. Minimum possible

    mark is 0.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    7/33

    5 DNS Q5

    Which of the provided Resource Records are stored in the .com TLD servers?

    Select one or more alternatives:

    (b)

    (f)

    None of the provided records

    (a)

    (e)

    ©

    (d)

    Maximum marks: 0.5

    Information of the authoritative name servers of a hostname is stored in the TLD servers so that when a

    local DNS server queries for the mapping for the hostname, they can be directed to the authoritative

    name servers which would contain the actual answer (i.e. the mapping requested). Thus, the NS records

    for the Google name servers (primary and secondary) would be stored in the .com TLD server. In

    addition, the corresponding IP addresses of these name servers (i.e. the A records) would also be stored

    in the .com TLD server.

    Thus, the correct answer is ©, (d), (e) and (f). 0.125 for each correct answer and -0.25 for each incorrect

    answer. 0 if “none of the provided records” is chosen. Minimum possible mark is 0.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    8/33

    6 DNS Q6

    Which of the provided Resource Records are stored at an authoritative name server?

    Select one or more alternatives:

    (a)

    (d)

    (f)

    (e)

    ©

    None of the provided records

    (b)

    Maximum marks: 0.5

    The MX record for the gmail mail server and the corresponding A record that holds the IP address for this

    server would be stored at the authoritative name servers (i.e. ns1.google.com and ns2.google.com). These

    are the “final” answers that are provided in response to a MX query for the gmail mail server.

    Thus, the correct answer is (a) and (b). 0.25 for each correct answer and -0.125 mark for each incorrect

    answer. 0 if “none of the provided records” is chosen. Minimum possible mark is 0.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    9/33

    Assume a webpage comprised of 10 objects which includes the index.html file, 8

    embedded images and one embedded audio clip. The 10 objects are so small that:

    (i) their transmission time is negligible and (ii) each object can be completely

    transmitted in one TCP segment. Consider a client wishing to download the

    webpage.

    You are asked to make the following assumptions:

    the round trip time between the client and all servers is T

    the time to set up and tear down a TCP connection is S and F, respectively.

    You must account for both these times in your computations. Note

    that, S includes the 3-way handshake (SYN, SYN-ACK, ACK) and F includes

    the time for sending FINs and ACKs from both endpoints.

    there are no packet losses.

    the client knows the IP address of all servers (i.e. neglect DNS resolution

    delay).

    neither the client nor any of the servers support parallel TCP connections.

    Answer the following 5 questions. No explanations are required. Simply write the

    expression for each answer which should ONLY contain the

    variables T, S and F (e.g., 20T+100S+50F) in the space provided.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    10/33

    7 HTTP Q1

    Assume that the client uses non-persistent HTTP for downloading the web page. What is the time

    required to complete the transfer of the web page (including the time for setting up and tearing

    down each TCP connection involved)?

    Fill in your answer here

    Maximum marks: 0.6

    In non-persistent HTTP, every object is downloaded over a fresh TCP connection. Since parallel

    connections are not supported, this would mean the ten objects are fetched serially.

    The time required to fetch one object = time to setup TCP connection + RTT for sending GET request

    and receiving response + time to tear down TCP connection = S + T + F.

    Thus, the total time = 10S +10T + 10F.

    10S +10T + 10F

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    11/33

    8 HTTP Q2

    Assume that the client uses persistent HTTP without pipelining for downloading the web page.

    What is the time required to complete the transfer of the web page (including the time for setting

    up and tearing down each TCP connection involved)?

    Fill in your answer here

    Maximum marks: 0.6

    In this instance, all objects can be fetched over one single TCP connection but serially (one after the

    other).

    Thus the total time = time to setup TCP connection + 10 x (RTT for sending GET request and receiving

    the object) + time to tear down TCP connection = S + 10T + F.

    S + 10T + F.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    12/33

    9 HTTP Q3

    Assume that the client uses persistent HTTP with pipelining for downloading the web page. What

    is the time required to complete the transfer of the web page (including the time for setting up and

    tearing down each TCP connection involved)?

    Fill in your answer here

    Maximum marks: 0.6

    In this instance, since pipelining is used once the index page is fetched and the client knows of the 9

    embedded objects, these 9 objects can be requested back-to-back (simultaneously) and the corresponding

    objects would also be received back-to-back.

    Thus the total time = time to setup TCP connection + RTT for sending GET request for the index page and

    receiving that page + RTT for sending 9 GET requests for embedded objects and receiving them + time to

    tear down TCP connection = S + T + T + F = S + 2T + F.

    S + 2T + F

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    13/33

    10 HTTP Q4

    Now assume that all 10 objects are located on 10 different servers (one object on each server).

    The client can only have one active TCP connection at any given time. Assume that the round

    trip time between the client and each of the 10 servers is T. Neglect DNS queries. Assume that

    the client uses persistent HTTP with pipelining for downloading the web page. What is the time

    required to complete the transfer of the web page (including the time for setting up and tearing

    down each TCP connection involved)?

    Fill in your answer here

    Maximum marks: 0.6

    Now each object is fetched from a different server. Since parallel connections are not supported, this

    would mean these objects have to be fetched serially (one after the one).

    The time to fetch one object from one server = time to setup TCP connection + RTT for sending GET

    request for the object and receiving that object + time to tear down TCP connection = S + T + F.

    Thus the total time = 10 (S + T + F)

    10S + 10T + 10F

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    14/33

    11 HTTP Q5

    Now assume that the index page and 7 embedded images are on one server, while the

    remaining image and audio clip are on another server. The client can only have one active TCP

    connection at any given time. Assume that the round trip time between the client and both

    servers is T. Neglect DNS queries. Assume that the client uses persistent HTTP with pipelining

    for downloading the web page. What is the time required to complete the transfer of the web

    page (including the time for setting up and tearing down each TCP connection involved)?

    Fill in your answer here

    Maximum marks: 0.6

    In this instance, all objects from each server can be fetched over a single TCP connection established

    with that server.

    The client would first fetch the index page and would become aware of the embedded objects. The 7

    objects hosted on this same server (as the index page) are then fetched in one go. Next, the client

    fetches the other two objects from the other server in one go.

    Thus the total time = time to setup TCP connection with the first server + RTT for sending GET request

    for the index page and receiving that page + RTT for sending 7 GET requests for embedded objects and

    receiving them + time to tear down TCP connection + time to setup TCP connection with the second

    server + RTT for sending 2 2 GET requests for embedded objects and receiving them = S + T + T + F +

    S + T + F = 2S + 3T + 2F.

    2S + 3T + 2F

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    15/33

    Suppose a number of users share a 4 Mbps link. Also, suppose that each user

    transmits continuously at 2 Mbps when transmitting, but each user transmits only

    20% of the time.

    Answer the 3 questions.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    16/33

    12 Packet/Circuit Switching Q1

    When circuit switching is used, how many users can be supported? No explanation is required.

    Simply enter the numeric value in the space provided:

    (2)

    Maximum marks: 0.25

    In circuit switching, the percentage of time a user is active is irrelevant. A circuit needs to be established

    for each active user. Since each user requires 2Mbps and the link capacity is 4Mbps, 2 users can be

    supported.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    17/33

    13 Packet/Circuit Switching Q2

    Now suppose packet switching is used. Why will there be essentially no queuing delay before the

    link if two or fewer users transmit at the same time? Why will there be queuing delay if three

    users transmit at the same time? Be brief (2 sentences at most for each question).

    Fill in your answer here

    Format

    Σ

    Words: 0

    Maximum marks: 0.75

    Since each user requires 2 Mbps when transmitting, if two or fewer users transmit simultaneously, a

    maximum of 4 Mbps will be required. Since the available bandwidth of the shared link is 4 Mbps, there

    will be no queuing delay before the link. (0.25 marks)

    Whereas, if three users transmit simultaneously, the bandwidth required will be 6 Mbps which is more

    than the available bandwidth of the shared link. In this case, there will be queuing delay before the link.

    (0. 5 marks)

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    18/33

    14 Packet/Circuit Switching Q3

    Suppose with packet switching, there are three users. Find the probability that at any given time,

    all three users are transmitting simultaneously. No explanation is required.Simply enter the

    numeric value in the space provided:

    (0.008)

    Maximum marks: 0.5

    The probability that all three users are transmitting simultaneously =(0.2)^3 = 0.008

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    19/33

    15 BitTorrent Tit/Tat Short Answer

    BitTorrent uses a “tit-for-tat” incentive mechanism for selecting peers to whom a particular peer

    would upload chunks. Consider a peer who has finished downloading the file but wishes to

    continue seeding the file to other peers (i.e. continue uploading chunks of that file) participating in

    the torrent. Will “tit-for-tat” still be useful for this peer? Explain why or why not in 2-3 sentences.

    Answers without explanations will not receive marks.

    Fill in your answer here

    Format

    Σ

    Words: 0

    Maximum marks: 1

    No. Tit-for-tat is not useful. This peer is no longer downloading any chunks of this file.

    So the peer will never be able to determine the top (four) peers that are providing her

    chunks at the best rate. Recall that “tit-for-tat” selects these top four peers to upload

    chunks.

    NOT EXPECTED IN ANSWER. THIS IS JUST FYI: In this instance, BitTorrent

    selects the peers who have the best upload rate (in general). This ensures that

    chunks get uploaded faster, and they get replicated faster.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    20/33

    16 UDP Checksum

    Assume that the UDP checksum is only computed over the data (i.e. ignore all other UDP

    headers and pseudo IP headers from the computation). Assume that the UDP segment format is

    (checksum, data). Assume that a UDP sender sends a segment (0010, 1110) and the UDP

    receiver receives (0011, 1110). Which of the following is true of the UDP receiver?

    Select one alternative:

    It thinks that the segment is corrupted and discards the segment.

    It thinks only the checksum is corrupted and delivers the correct data to the application.

    It concludes that nothing is wrong with the segment.

    It explodes.

    Maximum marks: 1

    Recall that the checksum algorithm can detect errors but not locate the precise bits that are in

    error.The receiver can thus detect an error, but it would know which bit(s) is/are in error. Thus, it

    must discard the segment. The correct answer is thus (a).

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    21/33

    17 TCP RDT

    Which of the following is true about how TCP implements reliable data transfer? (Multiple choices

    may be correct. Selecting additional choices beyond those that is/are correct will be considered

    as incorrect)

    Select one or more alternatives:

    TCP uses multiple timers

    TCP receiver always transmits acknowledgement immediately upon receiving a data

    packet

    TCP may retransmit packets upon receiving duplicate acknowledgements

    TCP uses cumulative acknowledgements

    TCP may retransmit packets upon timer timeout events

    Maximum marks: 1

    TCP uses a single timer for the oldest unacknowledged segment.

    The receiver employs a delayed ACK mechanism as noted in the lectures

    The sender retransmits a segment when it receives triple duplicate ACKs as per the fast

    retransmit mechanism

    TCP uses cumulative acks

    The expiration of a timer will result in the transmission of the oldest unacknowledged

    segment

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    22/33

    18 GBN and SR

    Two hosts A and B are using the go-back-N (GBN) protocol with a window size of 4. Host A

    sends host B four segments back to back with sequence numbers 15, 16, 17 and 18. These

    segments arrive at host B in the following order: 15, 18, 17, 16. When host B receives each of

    these segments, it sends an acknowledgment segment to host A. What are the

    acknowledgement numbers in the acknowledgement segments that host B sends to host A in the

    order in which host B sends them? You may assume that all previous segments (14, 13, …) have

    been correctly received by host B in the expected order.

    Repeat the above if the two hosts are using the selective-repeat (SR) protocol.

    Note: You are not required to provide any explanation. Simply note down the sequence of ack

    numbers in the space provided below, first for GBN and then for SR.

    Fill in your answer here

    Format

    Σ

    Words: 0

    Maximum marks: 2

    Go-Back-N (1 mark):

    15, 15, 15, 16

    The second and third packets arrive out of order. These are thus discarded. The acknowledgments for

    these packets will contain the last in-order received segment number, which is 15 (cumulative acks). The

    last received packet is the next expected packet (sequence number 16) and thus the acknowledgment

    will now contain the sequence number 16.

    Selective Repeat (1 mark):

    15, 18, 17, 16

    In selective repeat, each packet is individually acknowledged and out of order packets are buffered, thus

    resulting in the above-noted pattern.

    GBN: 15, 15, 15, 16

    SR: 15, 18, 17, 16

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    23/33

    19 UDP and Applications

    Which of the following statements is corrrect?

    Select one alternative:

    BitTorrent, DNS and First Person Shooter Games typically use UDP.

    DNS and First Person Shooter Games typically use UDP.

    E-mail and DNS typically use UDP.

    E-mail, DNS, BitTorrent and First Person Shooter Games use UDP.

    DNS and BitTorrent typically use UDP.

    Maximum marks: 0.75

    E-mail and BitTorrent use TCP.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    24/33

    20 TCP Sequence Number

    Host A sends a 128-byte TCP segment carrying a sequence number of 100 to Host B. Host B

    receives it correctly and sends an ACK to Host A. What is the acknowledgement number in the

    ACK?

    Select one alternative:

    101

    227

    228

    226

    Maximum marks: 0.75

    The segment contains bytes numbered from 100 to 227. The ACK number is always for the next

    expected sequence number which is 228.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    25/33

    Consider the network in the figure below. Host A can choose between two different

    paths to communicate with host B. Host can choose to send packets via either

    Router 1 or Router 2 to host B. The communication links are of two different types,

    as indicated in the figure. The characteristics of these two types of links are:

    Link type 1: Each link is of length 2000km, propagation speed is 2 x 10 m/s and

    bandwidth is 100kbps.

    Link type 2: Each link is of length 4000km, propagation speed is 2 x 10 m/s and

    bandwidth is 50kbps.

    Host A wishes to transmit a message of size 4Kbytes to host B. It breaks this

    message into 4 packets of equal size. Neglect any packet headers. Remember that

    routers work on the store-and-forward principle.

    Assume that the processing delay and queuing delay in the routers are negligible.

    You may also approximate file sizes to be an order of 10 (i.e. 4Kbytes = 4000 bytes

    instead of 4096 bytes).

    8

    8

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    26/33

    21 Switching Q1

    If host A chooses to send the packets via Router 1, determine the time it takes to move the

    packets from host A to host B, i.e., beginning from the time that host A starts to send the first bit

    of the first packet till the time that host B receives the last bit of the last packet.

    You are encouraged to draw a timing diagram to help you visualise the delays. However, you are

    NOT required to upload such a diagram with your answers.

    Do not simply write the final answer. Show us your work (just type it in the space provided).

    Fill in your answer here

    Format

    Σ

    Words: 0

    Maximum marks: 2

    From the timing diagram below, the time required = 5dt1 + 2 dp1 = 5(0.08 ) + 2(0.01) = 0.42 second

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    27/33

    22 Switching Q2

    Now assume that host A chooses to send the packets via Router 2 to host B. Determine the time

    it takes to move the packets from host A to host B, i.e., beginning from the time that host A starts

    to send the first bit of the first packet till the time that host B receives the last bit of the last

    packet.

    You are encouraged to draw a timing diagram to help you visualise the delays. However, you are

    NOT required to upload such a diagram with your answers.

    Do not simply write the final answer. Show us your work (just type it in the space provided).

    Fill in your answer here

    Format

    Σ

    Words: 0

    Maximum marks: 2

    From the timing diagram below, the time required = dp1 + dt1 + dp2 + 4dt2

    = 0.01 + 0.08 + 0.02 + 4(0.16) = 0.75 s.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    28/33

    Consider the picture below. Process P3 on the host with IP address X has set up a

    TCP connection with process P4 on the server with IP address Y. Process P2 on the

    host with IP address Z has set up a TCP connection with process P5 on the server

    with IP address Y. There are no other TCP connections open at the server.

    4 TCP segments S1 - S4 are shown in the picture. The source and destination IP

    addresses and port numbers for S1, S3 and S4 are noted. S1 is sent by P3 to P4, S2

    is sent by P4 to P3 and S3 is sent by P2 to P5.

    Answer the 5 following questions.

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    29/33

    23 Socket Q1

    What is the source IP address for TCP segment S2? No explanation needed.

    (Y, y)

    Maximum marks: 0.25

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    30/33

    24 Socket Q2

    What is the source port number for TCP segment S2? No explanation needed.

    (12004)

    Maximum marks: 0.25

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    31/33

    25 Socket Q3

    What is the destination IP address for TCP segment S2? No explanation needed.

    (X, x)

    Maximum marks: 0.25

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    32/33

    26 Socket Q4

    What is the destination port number for TCP segment S2? No explanation needed

    (4242)

    Maximum marks: 0.25

    09/07/2021

    Sample Mid Term Exam

    https://unsw.inspera.com/admin#author/test/87304030

    33/33

    27 Socket Q5

    Consider TCP segment S4 sent by process P1. Assume that S4 contains data. Describe what

    happens to this segment and why? 2-3 sentences should be sufficient.

    Fill in your answer here

    Maximum marks: 1

    S4 will be routed by the Internet to arrive at server Y. The server will try to match the

    (source IP, source port, destination port) tuple, i.e. (Z, 4242, 12005) against all active

    TCP sockets.

    The two active TCP connections will have the following entries in the active TCP socket

    table:

    (X, 4242, 12004) -> For the TCP connection between P3 and P4.

    (Z, 2543, 12005) -> For the TCP connection between P2 and P5.

    Notice that, S4 does not generate an exact match with either. Thus this segment will be

    dropped.

    NOT REQUIRED FOR MARKING: The server would respond to P1 with a TCP RST

    (Reset) segment.

繼續閱讀