Midterm Review
Midterm Review
Quiz 2
Suppose within your Web browser you click on a link to obtain a Web page. Let's suppose that the
Web page associated with the link is a simple HTML document that references 8 objects.
Suppose the RTT between the local host and the Web server is RTT = 80 msecs. Assumption:
zero transmission time for HTML document and the referenced objects. Non-persistent HTTP is
used. There are no parallel TCP connections.
How much time elapses from when the client clicks on the link until the base html document and
all 8 additional objects are received from web server at the client.
800
160
1280
1440
Download delays for 100 objects (HTTP 1.1 with local web caching).
Consider an HTTP 1.1 client and server. The RTT delay between the client and server
is 2 seconds. Suppose the time a server needs to transmit an object into its outgoing
link is 3 seconds.
There is also a local web cache, as shown in the figure below, with negligible (zero)
propagation delay and object transmission time. The client makes 100 requests
one after the other, waiting for a reply before sending the next request. All requests
first go to the cache (which also has a 2.0 sec. RTT delay to the server but zero RTT to
the client).
How much time elapses between the client transmitting the first request, and the
receipt of the last requested object, assuming no use of the IF-MODIFIED-SINCE
header line anywhere, and assuming that 50% of the objects requested are "hits"
(found) in the local cache?
Note: HTTP 1.1 is being used. It means the client set up a TCP connection to the
server only once.
Solution
1 TCP connection + 50 (time if hits) + 50 (time if missed)
2 + 50*0 + 50 (2 + 3)
A: pkt 0
B: Ack 0
C: pkt 0
D: Ack 0
E: Pkt 0
F: Pkt 0 (duplicate)
G: Ack 0
H: Pkt 1
I: Ack 0
J: Pkt 1
K: Ack 1
Question 13: Calculating checksum
11010010 01111010
10011010 01011001
Question 14
web caching reduces the delay for all objects (cached+non-cached) requested by
a user not just for some of the objects (cached objects).
True
False
Quiz 1
Question 12
Consider the figure below, showing a link-layer frame heading from a host to a
router. There are three header fields shown. Match the name of a header with a
header label shown in the figure.
H1: ?
H2: ?
H3: ?
Suppose we have four different servers connected to four different
clients over three links, as shown in the following figure. The four pairs
share a common link with a transmission capacity of R = 300 Mbps.
The four links from the servers to the shared link have a transmission
capacity of RS = 30 Mbps. Each of the four links from the shared middle
link to a client has a transmission capacity of RC = 100 Mbps.
● 30 Mbps
● 75 Mbps
● 300 Mbps
● 100 Mbps
Consider the two cases given below:
● A circuit-switching in which N users, each requiring a bandwidth of 25 Mbps, must share a link of
capacity 100 Mbps.
● A packet-switching in which M users sharing a 100 Mbps link, where each user again requires 25 Mbps
when transmitting, but only needs to transmit 20 percent of the time.
When circuit switching is used, what is the maximum number of users that can be supported?
25
10
4
Consider the circuit-switched network below. There are four circuit switches: A, B, C, and
D. Suppose there are 13 circuits between A and B, 20 circuits between B and C, 12
circuits between C and D, and 13 circuits between D and A.
Suppose that these maximum number of connections are all ongoing. What happens
when another call connection request arrives to the network, will it be accepted? Answer
Yes or No
Yes
No
● Question: A B
○ if each link has 1 Mbps transmission rate,
what is the transmission rate of an end-to-end
circuit switch connection between A and C?
A. 250 kbps
B. 1 Mbps
C. 4 Mbps
D
C
Circuit Switching Characteristics
● Question: A B
○ What is the maximum number of
simultaneous connections that can
be in progress at any one time in
this network?
A. 4
B. 8
C. 16
D. 32
D
C
Question
Simple HTTP GET request response time. Suppose an HTTP client makes a request to the www.wlu.ca web server. The client
has never before requested a given base object, nor has it communicated recently with the www.wlu.ca server. You can assume,
however, that the client host knows the IP address of www.wlu.ca.
How many round trip times (RTTs) are needed from when the client first makes the request to when the base page is completely
downloaded, assuming the time needed by the server to transmit the base file into the server's link is equal to 1/2 RTT and that
the time needed to transmit the HTTP GET into the client's link is zero? (Note: You should take into account any TCP setup time
required before the HTTP GET is actually sent by the client, the time needed to request the object, and the time needed for the
server to transmit the requested object. You can assume the propagation delay is zero.)
Slides Summary
Note
● These slides summarizes some of the important concepts in Chapters 1,
Chapters 2, and Chapters 3 (sections 3-1 to 3-5)
● It does NOT mean only the content of these slides will be asked in the
midterm
Chapter 1
Internet
● Nuts and bolts view of the Internet
○ A collection of hardware and software components executing protocols
○ A collection of billions of computing devices, and packet switches interconnected by links
● Service View of the Internet
○ A place I go for information, entertainment, and to communicate with people
○ A platform for building network applications.
■ infrastructure that provides services to the applications
■ Enables distributed Applications.
○ Distributed Applications:
■ runs on end systems and exchanges data via the computer network
■ Web surfing, e-mail, instant messaging, Internet phone, distributed games, peer-to-
peer file sharing, television distribution, and video conferencing.
■ More to come
Packet Switching
● When one end system sends data to another end system, the sending end
system breaks the data into chunks, called packets.
● the Internet transports each packet separately, routing a packet to its
destination using a destination address that is written into the packet.
○ Analogy: Similar to the process of delivering post-office mail
● Forwarding (packet switching)
○ Forwarding incoming packets to outgoing links by using packet’s destination address
■ determine on which link it should forward the packet.
○ on a packet by packet basis
● Packet switches “store and forward” packets:
○ before forwarding a packet on an outgoing link, packet switch first receives and stores the entire
packet.
Protocol
● A protocol defines the format and order of messages exchanged between two
or more communication entities, as well as the actions taken on the
transmission and/or receipt of a message or other event
● Used extensively in computer networks
● human protocol and a computer network protocol
What’s a protocol?
Note: when adding numbers, a carryout from the most significant bit needs to be added to the result
Multiplexing and demultiplexing
● demultiplexing: The mechanism of passing the payload to the appropriate
socket
○ A receiving host may be running more than one network application process
○ When a host receives a packet, it must decide to which of its ongoing processes it is to pass
the packet’s payload
○ In particular, when a transport-layer protocol in a host receives a segment from the network
layer, it must decide to which socket it is to pass the segment’s payload
● Multiplexing:
○ At the source host
○ the job of gathering data chunks from different sockets, adding header information (for
demultiplexing at the receiver), and passing the resulting segments to the network layer
Connectionless and Connection-Oriented Demultiplexing
● Multiplexing and demultiplexing in TCP and UDP
○ Using port number in the header field of UDP and TCP segments
■ Every UDP and TCP segment has a field for a source port number and another field for
a destination port number.
● Multiplexing and demultiplexing in UDP vs. TCP
○ UDP: each UDP socket is assigned a port number, and when a segment arrives to a host, the
transport layer examines the destination port number in the segment and directs the segment
to the corresponding socket.
○ TCP: a TCP socket is identified by the four-tuple: (source IP address, source port number,
destination IP address, destination port number)
■ When a TCP segment arrives from the network to a host, the host uses all four values
to direct (demultiplex) the segment to the appropriate socket.
Transport Layers in the Internet
● UDP
● TCP
UDP
● UDP is a no-frills, bare-bones protocol, allowing the application to talk almost directly
with the network layer.
● Services:
○ multiplexing/demultiplexing
○ error checking
○ The UDP segment has only four header fields
■ source port number, destination port number, length of the segment, and checksum
● Why an application may choose to use UDP:
○ finer control of what data is sent in a segment
○ It has no connection establishment; it has no connection state at servers; and it has less packet header
overhead than TCP
■ DNS is an example of an application protocol which uses DNS. DNS sends its queries and answers
within UDP segments, without any connection establishment between communicating entities.
Reliable Data Transfer
● Network layer in the internet provides unreliable data transfer
○ when the transport layer in the source host passes a segment to the network layer, the network
layer does not guarantee it will deliver the segment to the transport layer in the destination host.
The segment could get lost and never arrive at the destination.
● A transport layer could provide reliable data transfer (RDT)
○ guarantee process-to-process message delivery even when the underlying network layer is
unreliable.
● Idea:
○ The receiver acknowledges the receipt of a packet
○ The sender retransmits the packet if it does not receive the acknowledgement
○ handles bit errors as well as packet loss
○ mechanisms:
■ acknowledgements, timers, checksums, sequence numbers, and acknowledgement numbers
Reliable Data Transfer
● The textbook incrementally develops an RDT stop-and-wait protocol in
Section 3.4.
● rdt 1.0
● rdt 2.0
● rdt 2.1
● rdt 2.2
● rdt 3.0
Pipelined Reliable Data Transfer
● Stop-and-wait protocol is inefficient
○ The source sends one packet at a time, only sending a new packet once it has received an
acknowledgment for the previous packet.
○ poor throughput performance, particularly if either the transmission rate, R, or the round-trip
time, RTT, is large.
● Solution: pipelined protocol
○ the sender is allowed to send multiple packets without waiting for an acknowledgment
○ Pipelining requires an increased range in sequence numbers and additional buffering at
sender and receiver.
○ Two pipelined RDT protocols:
■ Go-Back-N (GBN)
■ Selective Repeat (SR)
Pipelined Reliable Data Transfer
● Go-Back-N (GBN) vs Selective Repeat (SR)
○ Similarities:
■ Both protocols limit the number of outstanding unacknowledged packets the sender can
have in the pipeline
○ Differences:
■ GBN uses cumulative acknowledgments, only acknowledging up to the first non-
received packet. A single-packet error can cause GBN to retransmit a large number of
packets.
■ In SR, the receiver individually acknowledges correctly received packets. SR has better
performance than GBN, but is more complicated, both at sender and receiver.
TCP
● TCP is connection oriented
○ Before one process can send application data to the other process, the two processes must “handshake” with
each other by sending to each other (a total of) three empty TCP segments
○ The process initiating the TCP handshake is called the client.
○ The process waiting to be hand shaken is the server
○ After the 3-packet handshake is complete, a connection is said to be established and the two processes can
send application data to each other
● TCP is a byte-stream protocol
○ A segment may not contain a single application-layer message
■ It may contain, for example, only a portion of a message or contain multiple messages
● A TCP connection has a send buffer and a receive buffer
○ On the send side, the application sends bytes to the send buffer, and TCP grabs bytes from the send buffer to
form a segment.
○ On the receive side, TCP receives segments from the network layer, deposits the bytes in the segments in the
receive buffer, and the application reads bytes from the receive buffer.
TCP
● TCP is reliable: it employs a Reliable Data Transfer (RDT) protocol
○ TCP’s RDT service ensures that the byte stream that a process reads out of its receive buffer is
exactly the byte stream that was sent by the process at the other end of the connection.
● TCP Reliable data transfer mechanisms
○ pipelined
○ cumulative acknowledgments
○ sequence numbers and acknowledgment numbers
○ a timer, and a dynamic timeout interval.
■ In order to set the timeout in its RDT protocol, TCP uses a dynamic RTT estimation
algorithm.
● Retransmissions at the sender are triggered by two different mechanisms:
○ timer expiration
○ triple duplicate acknowledgments.