MOD 3 - Transport Layer Flashcards

1
Q

What is window size, what is the formula?

A

Window size = #bytes a receiver is willing to accept

R = link size/bandwidth
RTT = round trip time, 2 way propagation
segment size = bits per segment

Window size = (R x RTT) / segment size

Avg Window size = ¾ (Window size)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the transport layer responsible for? What is the network layer responsible for?

A

Transport layer = logical communication between
processes (of applications) / process-process data transfer

Network layer = logical communication between hosts / routing of datagrams from source to dest

EXAMPLE
▪ hosts = houses
▪ processes = kids
▪ app messages = letters in
envelopes
▪ transport protocol = Ann and Bill
who deliver to post office the
letters of in-house siblings
▪ network-layer protocol = postal
service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 2 transport layer protocols and their descriptions? Header size?

A

TCP
- Establishes connection/ 3 way handshake before exchanging data
- reliable data transfer, flow control, congestion control, in-order delivery
- header = 20 bytes

UDP
- connectionless, no handshaking
- unreliable, unordered delivery, no flow control or congestion control
- better for shorter/faster services (ex: DNS, streaming)
- header = 8 bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How are TCP and UDP sockets identified?

A

TCP socket :
- source IP
- source port
- dest IP
- dest port
(need source info for handshake!)

UDP socket :
- dest IP
- dest port
(only need dest info since no handshake)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe a TCP and UDP header.

A

UDP Header
- length = 8 bytes
- contains:
- source & dest port
- length
- checksum

TCP Header
- length = 20 bytes
- contains:
- source & dest port
- Sequence number
- ACK number
- data offset, reserved, control flags,…
- rwnd
- checksum
- options

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a checksum and how do you calculate it? how does it detect errors

A

goal = to detect errors (flipped bits) in transmitted segment

process:
sender = adds segment content (sum then 1’s complement) and puts val in checksum field
receiver = computes checksum of received segment. If computed checksum = checksum field, NO errors, else, YES errors.
checksum can detect 1 bit errors, but not 2 bit errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do we recover from errors detect with the checksum?

A

Receiver sends a NAK to the sender, which explicitly tells sender
that packet had errors.

rdt1-3 (didn’t really cover this)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe the TCP 3 way handshake.

A

1) CLIENT, choose initial sequence number x, send TCP SYN msg
2) SERVER, choose initial sequence number y, send TCP SYNACK msg (acking SYN)
3) CLIENT, receive SYNACK(x) indicating server is live. send ACK for SYNACK.
4) SERVER, receive ACK(y) indicating client is live

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you close a TCP connection?

A
  • client & server each close their side of connection by setting flag FIN bit = 1
  • client & server respond to FIN with ACK,
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is congestion? how does TCP keep track of this?

A

-“too many sources sending too much
data too fast for network to handle”
-different from flow control

-AIMD (additive increase multiplicative decrease), sender keeps an additional variable cwnd (congestion window size)
- (AI) increase cwnd by 1 MSS every RTT until loss detected
- (MD) cut cwnd in half after loss (3 dupe acks)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is TCP slow start?

A
  • used for TCP congestion control
  • increase cwnd rate exponentially until first loss event
    / gradually increase the amount of data sent across a network until it determines an appropriate amount that the network can handle without causing congestion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When do we switch from slow start to CA (congestion avoidance)?

A
  • when cwnd gets to
    a threshold value
    ssthresh
  • on loss event, ssthresh is set
    to 1/2 of cwnd just before loss
    event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What indicates that the network is congested?

A

Timeout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain TCP Reno and TCP Tahoe

A

TCP RENO
* dup ACKs indicate network
capable of delivering some
segments
* cwnd is cut in half window then
grows linearly

TCP Tahoe
▪ always sets cwnd to 1 (timeout
or 3 duplicate acks)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is window size and its formula?

A

max amount of unACKed data that can be sent in a TCP connection before receiving an ACK back.

R=link size / bandwidth
RTT=roundtrip time

Window size = (R x RTT) / segment size

Avg Window size = ¾ (Window size)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is TCP throughput and avg throughput and its formula?

A

throughput = 1.22MSS/ RTT sqrt(L)

Avg throughput = avg window size (MSS/RTT) [bitsps]
Avg throughput = 3/4 (w/RTT) [bytesps]

17
Q

Why is TCP fair?

A

adjusts its sending rate and adapts to network conditions through congestion control mechanisms, preventing any single connection from dominating the available bandwidth and ensuring equitable sharing of network resources among multiple connections.

18
Q

How do you calculate ACK and SEQ numbers (TCP)?

A

For tcp handshake and no data:
*SEQ = ACKprev
*ACK = SEQprev + 1

For tcp handshake and data
*SEQ = ACKprev
*ACK = SEQprev + prev data(length)

if there’s no ACK
*Seq = prev Seq + prev data(length)

19
Q

Which protocols use TCP, which use UDP?

A

TCP used by:
- SMTP (Simple mail transfer protocol, sends emails)
- HTTP (Web’s application layer protocol)
- IMAP (to receive emails from server)

UDP used by:
- DNS (because quick service)

20
Q

What are the estimationRTT equations?

A

estRTT = (1-a)estRTT(one before) + a(SampleRTT)

Timeout Interval = estRTT + 4(DevRTT)

DevRTT = (1-B)DevRTT + B abs(SampleRTT-estRTT)

21
Q

ACK vs NAK protocol?

A

ACK = Acknowledgement, receiver tells sender that the packet was received OK

NAK = Negative Acknowledgement, receiver tells sender the packet had errors

NAK protocol = if packet with sequence number 1 has been lost then the loss of the packet will only be detected when packet 2 is received.
- ideal for when sender has lots of data, but not when sender sends infrequently

in rdt2.2, duplicate ACK ( indicated by the same sequence number of the last two received ACKs) at sender results in the same action as NAK: retransmit current pkt

22
Q

List 3 functions performed by TCP. Explain what each function tries to accomplish

A
  • Reliability: TCP delivers data reliably.
  • Ordered delivery: TCP delivers data in order.
  • Flow-Control: TCP makes sure the sender doesn’t overflow the receiver.
  • Congestion-Control: TCP sends less data when it detects congestion.
  • Connection-oriented: TCP is connection-oriented

TCP is not in charge of fragmentation or routing. (network layer)

23
Q

RTT vs Retransmission time ?

A

RTT = Round trip time, time for a small packet to travel from client to server and back
Ex: initiate TCP connection = 1 RTT (SYN, SYN-ACK, ACK)

Retransmission time = duration a sender waits before deciding to retransmit a packet that it suspects may have been lost or not properly received.
Triggered by: timeout events, duplicate acks

24
Q

If a sender receives duplicate ACKs, what does this indicate?

A

indicates that that packet was lost/ not properly received and must be retransmitted by sender

25
Q

give one reason why DNS lookups are run over UDP rather than TCP.

A

DNS lookups are quick and prioritize efficiency. UDP is quicker than TCP as it reduces connection-setup overhead (lower latency), hence is a better choice.

26
Q

What happens to the congestion window when the connection is in slow-start? when the connection is in congestion avoidance (linear mode)?

A

slow start = sender increases its window for each byte (exponential increase)
cwnd = cwnd + #packets(MSS)

congestion avoidance = sender increases its window by one segment each window (linear increase)
cwnd = cwnd + MSS

27
Q

how do you calculate dtrans (tranmission delay)? utilization time?

A

dtrans = L/R

L=packet length
R=link bandwidth/size

U = (L/R)(x) / (RTT + L/R)

x = window size, (usually 1?)

28
Q

Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts, and Host A is sending to Host B an enor- mous file over this connection. Host A can send its application data into its TCP socket at a rate as high as 120 Mbps but Host B can read out of its TCP receive buffer at a maximum rate of 50 Mbps. Describe the effect of TCP flow control. A2- Q3

A

*not sure about this answer

  • sender transmission rate > receiver read rate
  • this means that host A will send out more information than host B can receive, thus will max out the receive buffer
  • when the buffer is full, host b signals host A to stop sending data by setting rwnd = 0
  • when rwnd > 0, host A can continue sending data to host B
29
Q

TTL (time to live) is?

A

In DNS resource record: “TTL” specifies the amount of time (in seconds) DNS servers and applications are allowed to cache the record

In a packet IP header:
TTL specifies the maximum routers the packet could pass through. Each router will decrease this value by 1 before sending it out, and drop a packet if it has a TTL=0. Traceroute program uses this property to measure network path and delay.
Decremented by routers in Network layer.

30
Q

Flow control vs congestion control?

A

Flow-Control: TCP makes sure the sender doesn’t overflow the receiver.
Prevent the sender from overwhelming the receiver with data.

Congestion-Control: Prevent network resources from being overwhelmed. TCP sends less data when it detects congestion.

SUMMARY: flowcontrol = worries about receiver, congestion control = worries about global network