• 计网个人作业02


    P2.

    Consider an HTTP client that wants to retrieve a Web document at a given URL. The IP address of the HTTP server is initially unknown. What transport and application-layer protocols besides HTTP are needed in this scenario?

    1. 应用层协议:DNS和HTTP
    2. 传输层协议:UDP for DNS;TCP for HTTP

    P8

    P8. Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1, . . ., RTTn. Further suppose that the Web page associated with the link contains
    exactly one object, consisting of a small amount of HTML text. Let RTT0 denote the RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the object?

    首先根据课本可以知道,获取IP地址总时间为
    R T T 1 + R T T 2 + . . . + R T T n = ∑ i = 1 n R T T i RTT_1+RTT_2+...+RTT_n = \sum^n_{i=1}RTT_i RTT1+RTT2+...+RTTn=i=1nRTTi

    知道IP地址之后,需要有一个 R T T 0 RTT_0 RTT0的时间用来建立TCP链接,再来一个 R T T 0 RTT_0 RTT0时间用来请求、接受对象,总响应时间为
    2 R T T 0 + ∑ i = 1 n R T T i 2RTT_0 + \sum^n_{i=1}RTT_i 2RTT0+i=1nRTTi

    P9

    P9. Referring to Problem P8, suppose the HTML file references three very small
    objects on the same server. Neglecting transmission times, how much time elapses
    with
    a. Non-persistent HTTP with parallel connections?
    b. Non-persistent HTTP with no parallel TCP connections?
    c. Persistent HTTP?

    这个题目对应第七版的P8,细节有一些出入,第七版问的是8个对象,且第二问为5个并行链接的非持续TCP链接

    先回答本问

    a.
    根据前文可以知道每次没有并行TCP连接的每个object都得单独消耗 2 R T T 0 2RTT_0 2RTT0的时间用来传输文件
    所以总耗时为

    3 × 2 R T T 0 + 2 R T T 0 + ∑ i = 1 n R T T i = 8 R T T 0 + ∑ i = 1 n R T T i 3\times 2RTT_0 + 2RTT_0 + \sum^n_{i=1}RTT_i = 8RTT_0 + \sum^n_{i=1}RTT_i 3×2RTT0+2RTT0+i=1nRTTi=8RTT0+i=1nRTTi

    b.
    如果为并行,那么三个object都可以同时发送并接受
    总耗时为

    1 × 2 R T T 0 + 2 R T T 0 + ∑ i = 1 n R T T i = 4 R T T 0 + ∑ i = 1 n R T T i 1\times 2RTT_0 + 2RTT_0 + \sum^n_{i=1}RTT_i = 4RTT_0 + \sum^n_{i=1}RTT_i 1×2RTT0+2RTT0+i=1nRTTi=4RTT0+i=1nRTTi

    c.
    持续HTTP就认为请求和传输同时发生,所有 2 R R T 0 2RRT_0 2RRT0的时间变为 R T T 0 RTT_0 RTT0时间
    总耗时为

    3 R T T 0 + ∑ i = 1 n R T T i 3RTT_0 + \sum^n_{i=1}RTT_i 3RTT0+i=1nRTTi

    接下来考虑第七版书的情况
    参照习题P7,假定在同一服务器上某HTML文件引用了 8个非常小的对象。忽略发送时间,在下列
    情况下需要多长时间:

    a.没有并行TCP连接的非持续HTTP。

    b.配置有5个并行连接的非持续HTTP。

    c.持续 HTTPO

    分析同上,这里直接给出答案

    8 × 2 R T T 0 + 2 R T T 0 + ∑ i = 1 n R T T i = 18 R T T 0 + ∑ i = 1 n R T T i 8\times 2RTT_0 + 2RTT_0 + \sum^n_{i=1}RTT_i = 18RTT_0 + \sum^n_{i=1}RTT_i 8×2RTT0+2RTT0+i=1nRTTi=18RTT0+i=1nRTTi
    ( 8 / / 5 ) × 2 R T T 0 + 2 R T T 0 + ∑ i = 1 n R T T i = 6 R T T 0 + ∑ i = 1 n R T T i (8//5)\times 2RTT_0 + 2RTT_0 + \sum^n_{i=1}RTT_i = 6RTT_0 + \sum^n_{i=1}RTT_i (8//5)×2RTT0+2RTT0+i=1nRTTi=6RTT0+i=1nRTTi
    3 R T T 0 + ∑ i = 1 n R T T i 3RTT_0 + \sum^n_{i=1}RTT_i 3RTT0+i=1nRTTi

    P11

    P11. What is the difference between MAIL FROM: in SMTP and From: in the mail
    message itself?

    SMTP中的MAIL FROM:是来自SMTP客户端的一个信息,它确定了向SMTP服务器发送邮件的发件人。

    邮件报文本身的**FROM:**并不是SMTP信息,只是邮件信息正文中的一行

    15

    P15. Consider accessing your e-mail with POP3.

    a

    a. Suppose you have configured your POP mail client to operate in the
    download-and-keep mode. Complete the following transaction:

    C: list
    S: 1 498
    S: 2 912
    S: .
    C: retr 1
    S: blah blah ...
    S: ..........blah
    S: .
    ?
    ?
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    根据课本上的内容
    只需要往后补充一下信息

    C: dele 1
    C: retr 2
    S:(blah blah blah
    S: blah blah blah...
    S: ..........blah)
    S:.
    C:dele2
    C:quit
    S:+OK POP3 server signing off
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    b

    b. Suppose you have configured your POP mail client to operate in the
    download-and-delete mode. Complete the following transaction:

    S: ..........blah
    S: .
    ?
    ?
    
    • 1
    • 2
    • 3
    • 4

    你已经配置以下载并保持模式运行的POP邮件客户,那就不需要删除

    C: retr 2
    S:(blah blah blah
    S: blah blah blah...
    S: ..........blah)
    S:
    C: quit
    S: +OK POP3 server signing off
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    c

    c. Suppose you have configured your POP mail client to operate in the
    download-and-keep mode. Using your transcript in part (b), suppose you retrieve messages 1 and 2, exit POP, and then five minutes later you again access POP to retrieve new e-mail. Suppose that in the five-minute interval no new messages have been sent to you. Provide a transcript of this second POP session

    C: list
    S: 1 498
    S: 2 912
    S:
    C: retr 1
    S:(blah blah blah
    S: blah blah blah...
    S: ..........blah)
    S:
    C: retr 2
    S:(blah blah blah
    S: blah blah blah...
    S: ..........blah)
    S:
    C: quit
    S: +OK POP3 server signing off
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    P23

    P23. Consider query flooding, as discussed in Section 2.6. Suppose that each peer is connected to at most N neighbors in the overlay network. Also suppose that the node-count field is initially set to K. Suppose Alice makes a query. Find an upper bound on the number of query messages that are sent into the overlay network

    Alice发送她的请求给最近的N个邻居,每个他的邻居转发请求到N-1个邻居,然后从邻居开始,一共会发生M次这种转发N-1个邻居的转发,所以请求的次数为等比数列的求和

    N + N ( N − 1 ) + . . . N ( N − 1 ) K − 1 = N [ ( N − 1 ) K − 1 ] N − 2 N + N(N-1) + ... N(N-1)^{K-1} =\frac{N[(N-1)^K-1]}{N-2} N+N(N1)+...N(N1)K1=N2N[(N1)K1]

  • 相关阅读:
    入行IC | 新人入行IC选择哪个岗位更好?
    【服务器数据恢复】Linux网站服务器的数据恢复案例
    【Python】-- Turtle绘图(使用代码画喜欢的图形!)
    springBoot2笔记
    基于springboot2+mybatis-plus+jsp增删改查
    Git代码上传
    C#【必备技能篇】Winform实现多语言切换(.resx文件的应用)
    EPLAN_006#部件库快速导入、树结构、部件导航器、材料表导航器
    自动化物流运输设备模组要选择哪种类型?
    K8s 搭建一主一从
  • 原文地址:https://blog.csdn.net/JamSlade/article/details/128160030