1/47
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What's the main function of the transport layer?
Process to Process communication (Data transfer)
Different services offered by transport layer?
Reliability, time, throughput, and security
Transport layer protocol names and their services (TCP and UDP services). What services are not available?
TCP: Congestion control, Flow control, Connection oriented, reliable transport (make sure in order)
UDP: Unreliable data transfer, •no-frills extension of “best-effort” IP
Services not available:
delay guarantees
bandwidth guarantees
What are the transport layer services NOT provided by above protocol? (Like what's not provided with TCP and UDP)
TCP: Timing, throughput, Security
(TLS can provide security, as an add-on does not come with initially)
UDP: Reliability, Timing, Throughput, Security
How transport layer helps sender sending message to destination?
TCP client initiates connection with TCP server. Uses multiplexing, demultiplexing, and sockets to get message delivered. As well as TCP and UDP
If you are developing a new transport layer protocol, what are mandatory services you need to implement?
- Processor to Process communication (Is multiplexing/demultiplexing)
- Error checking
Explain multiplexing
- Done at the sender side
- Handles data from multiple sockets, puts into one stream, add transport header
(Is used later for demultiplexing)

Explain De-multiplexing
- Done from the receiver
- Uses header info to deliver received to the correct segments
- Host receives IP datagrams
Each datagram has source and destination IP address
Each datagram also carry one transport-layer segment
Each segment has source and destination port number
- Host uses IP address and port numbers to direct segment to appropriate socket
- Revises with sockets/port numbers
Explain multiplexing, demultiplexing with help of socket
Multiplexing
- Takes data from multiple sockets, creates the header
Demultiplexing
- Uses header info to correct socket using IP address and port number
Both are in the transport and go through the network layer as well
IP tells it which device to send it to, port number determines which socket to go through

How client and server assign port number to the sockets
Port number:
16 bit [0, 65535]
[0,1023] are well known port numbers
HTTP: 80
FTP: 21
Server side:
The server assigns a specific, well-known port number to its socket. These port numbers are standardized and predefined for common services
Client side:
The client assigns a temporary (ephemeral) port number to its socket. This port number is usually chosen automatically by the operating system from a designated range of ephemeral ports. It’s used for the duration of the communication session.

Connectionless demultiplexing
Connectionless Demultiplexing:
UDP
IP/UDP datagrams with different source IP/port number but same destination it'll be received at same socket at receiving host
When creating socket, must specify host-local port #:
DatagramSocket mySocket1 = new DatagramSocket(12534);
Connectionless demultiplexing is when the UDP has each segment that is handled independently with no prior communication required (aka not connection oriented). For directing the segments to their proper processes, this would use the destination port number.
Connection oriented
Connection oriented demultiplexing:
Receivers uses all four values (4-tuple) Source/Destination IP and Source/Destination Port number
To direct segment to appropriate socket
TCP server has "welcoming socket" - waits for connection establishment (TCP client creates sockets and sends request to here)
When "Welcoming socket" receives the request and server creates new socket in response
Newly created connection socket is identified by 4 values (source and destination's IP addresses and port numbers)
• Subsequent request/response is handled by the new socket
What is Checksum
Goal: Verifying packet was sent without corruption
How does it work:
Sender
- converts data into binary, gets sum of that and does 1's compliment
- treat contents of UDP segment (including UDP header fields and IP addresses) as sequence of 16-bit integers
- If overflow, add one back in on least significant bit, then do 1’s compliment
Receiver
- compute checksum of received segment
- check if computed checksum equals checksum field value:
• not equal - error detected
equal - no error detected. But maybe errors nonetheless?
UDP -> Basic Functions
- Process to Process (unreliable)
- Error checking
UDP advantages?
no connection establishment (which can add RTT delay)
simple: no connection state at sender, receiver
small header size(TCP- 20 bytes UDP- 8 bytes)
no congestion control
UDP can blast away as fast as desired!
can function in the face of congestion
Why Simple Network Management Protocol (SNMP) uses UDP?
SNMP uses UDP because of the RTT (less than TCP) and UDP works against congestion while TCP can not (TCP throttles the user)
Why application using UDP still need to consider congestion control?
- UDP does not care and still sends data at highest rate
- Since receiver at max, packets getting sent will get lost
- Won't be able to have proper communication
How does UDP achieve error detection?
Checksum, by adding binary value of UDP segment (UDP header fields and IP address)
Sums all 16 bot words in the segment, overflow is wrapped around
Performs 1’s complement
Puts it in the checksum field of the udp segment
- checksum field is 16 bit
Explain the problem, solution, and recovery for RDT 2.0, 2.1
RDT 2.0
ACK’s while sending data through first reliable channel (TCP), how do we know if packet is received
- Problem: Corrupted packets
- Solution: Packet checks checksum and if packet is in valid state…
ACK, NACK, checksum, retransmit
- Recovery: ARR (Automatic Repeat Request)
RDT 2.1
- Problem: RDT 2.0 + ACK/NACK corruption
- Solution: Add Checksum to ACK and the Sequence Number (Data) lets you know if the packet being sent is a duplicate
If corrupted, retransmit
- Recovery: Data
R(1) Duplicate pkt = send ACK again, S(1) Corrupted -> retransmit
Explain the problem, solution, and recovery for 2.2, and 3.0 (packet corrupted + packet loss)
RDT 2.2
Problem: NAK free protocol because of sequence number
Solution: On corruption, send ACK to which packet received properly
If duplicate at sender, retransmit
If sender sends 0 ACK and gets 0 ACK back, sender reads ACK 0 and sends 0 and repeats until it gets 1 ACK (ACKs are always 0 or 1 and is a cycle like 0, 1, 0, 1…)
Recovery: ACK with sequence, Duplicate ACK (sender) = Retransmit
RDT 3.0
Problem: Packet loss and Packet corruption
Solution:
To recover from packet loss, Timer (Timeout interval = RTT), retransmit
For corruption, still uses RDT 2.2
Recovery:
How to calculate sender utilization in stop and wait protocol RDT 3.0? What happens if you send more than one packet?
example: 1 Gbps link, 15 ms prop. delay, 8000 bit packet
U sender:
(L / R) / (L / R) + RTT
If you send more than one packet:
(N * L/R) / (L/R + Propagation delay (RTT))
Pipelining increases utilization by a factor of N Packets
Look at picture for some of example…
(0.008 s) / (0.008 s + [15 ms * 2]) => 0.008 / 30.008 => 0.00027
You multiply prop delay by 2 because it is RTT (ROUND TRIP TIME)
![<p>U sender:</p><p>(L / R) / (L / R) + RTT</p><p></p><p>If you send more than one packet:</p><p>(N * L/R) / (L/R + Propagation delay (RTT))</p><p></p><p>Pipelining increases utilization by a factor of N Packets</p><p></p><p>Look at picture for some of example…</p><p></p><p>(0.008 s) / (0.008 s + [15 ms * 2]) => 0.008 / 30.008 => 0.00027</p><p><strong>You multiply prop delay by 2 because it is RTT (ROUND TRIP TIME)</strong></p>](https://knowt-user-attachments.s3.amazonaws.com/8f52ee7b-50ae-4ba3-bde8-c042b1aa5605.png)
Why pipelined protocols are natural next step from stop and wait?
Because with stop and wait, the sender has to wait for each packet to be responded by the receiver
- With pipelining, you can send multiple consecutive unACKed packets without needing to wait
What is window?
FOR GBN: A sender "window" of up to N consecutive transmitted but unACKed packets (DOES NOT HAVE BUFFER)
FOR SELECTIVE REPEAT: A sender “‘window” of up to N transmitted packets (DOES HAVE A BUFFER)
If window full: Can't send packets
If not full:
send packets

Explain GBN sender
Sender sends N number of consecutive unACKed packets (that are within the window size)
ACK(n): ACKs all packets up to, including seq # n
When receiving ACK(n): move window forward to start at n + 1
Timer on for oldest in-flight packet
Timeout(n): retransmit packet n and all higher seq # packets in window
Explain GBN Receiver
ACK-only: always send ACK for correctly-received packet so far, with highest in-order seq #
• may generate duplicate ACKs
• need only remember rcv_base
on receipt of out-of-order packet:
• can discard (don’t buffer) or buffer: an implementation decision
• re-ACK pkt with highest in-order seq #

Explain Selective Repeat
The receiver individually ACKs all correctly received packets
Buffers packets (when needed) for in-order delivery to upper layer
Sender times-out/retransmits individually for unACKed packets
sender maintains timer for each unACKed packet
Send window
N seq #s
limts seq #s of sent, unACKed packets


What happens on the sender side of Selective Repeat?
data from above:
if next available seq # in window, send packet
timeout(n):
resend packet n, restart timer
ACK(n) in [sendbase,sendbase+N]:
mark packet n as received
if n smallest unACKed packet, advance window base to next unACKed seq #
What happens on the receiver side of Selective Repeat?
packet n in [rcvbase, rcvbase+N-1]
send ACK(n)
out-of-order: buffer
in-order: deliver (also deliver buffered, in-order packets), advance window to next not-yet-received packet
packet n in [rcvbase-N,rcvbase-1] (aka previous window)
ACK(n)… so it can get out of the retransmission loop
otherwise:
ignore
What is sequence number and it’s purpose?
A unique identifier for each packet to ensure that there is proper ordering and helps the receiver know when there is an out of order packet
What is the difference between Transport vs Network layer services and protocols?
Transport: logical communication between processes (relies on or enhances network layer services)
Houses = networks,
In the houses are people who can send letters: people are the process, letters = packets
Network: logical communication between hosts
postal service = network-layer protocol
Person who collects/distributes mail= multiplexing/demultiplexing
True or False: In sliding windows protocol GBN receiver must have a buffer.
Also is it better to have a buffer or not?
FALSE, receiver can discard (NOT buffer) or buffer based on implementation decision
It is BETTER to have a buffer because it can store the out-of-order packets in the buffer and doesn’t need to retransmission
Differentiate: Cumulative ACK vs Selective ACK
Cumulative:
When receiver sends ACK, all previous packets up to and including N are received properly
Selective:
Only tells you N packet was received properly
Discuss problem of GBN
Problem: If ACK is not at all (not every packet received an ACK), retransmit all data packets
In SR, why is it necessary for SR receiver to send ACK back when packet received in [rbase - N, Rbase - 1]
If the previous packet does not get an ack then the timer will timeout on the sender side causing it to retransmit (which can potentially loop) eventually not allowing the window to move up
True or False: In SR, individual timer is used for every sent but unACK packet
True, sender starts timer when packet is sent
If the timer times out, then sender selectively retransmits that specific packet

How does TCP determine the sequence number and ACKs
Sequence #
Sequence # of first byte
Ex: File size = 500 k bytes, MSS = 1k bytes, Total segment = 500
Seq # of first segment = 0, seq # of 2nd = 1000, seq # of 3rd = 2000…
DOES NOT always start at 0
ACKs
Seq # of next byte expected from other side
If data > 1, need to add data to seq to next response (look at image to understand more)
True/False
(1) The network's routers and switches are primarily responsible for implementing the functions of the Transport layer.
(2) UDP packet header has 8 bytes
(3) TCP packet header has 20 bytes
(1) False
(2) True, Destination and Source port and checksum and length of header are each 8 bits (total = 64 bits)
(3) True, 10 mandatory fields (source, destination, ack number, and others)
What is multiplexing and demultiplexing ?
–UDP
–TCP
–Differentiate : UDP demultiplexing and TCP demultiplexing
Multiplexing, demultiplexing: based on segment, datagram header field values
UDP: demultiplexing using destination port number (only)
TCP: demultiplexing using 4-tuple: source and destination IP addresses, and port numbers
Multiplexing/demultiplexing happen at all layers

•Rdt 2.0: show state transitions for given situation. (check the assignment questions)

• Is this stop and wait protocol?
• What is the equation for Sender utilization?
• How many number of bits required for this protocol?
1) Pipelining: increased utilization
2) (L / R) / [ (L / R) + RTT ]
3)
For Go-Back-N: Need k bits such that: 𝑁 ≤ 2^𝑘 − 1
For Selective Repeat: Need k bits such that 𝑁 ≤ 2^(𝑘 − 1)
Plug in the window size for N and solve for k. k is the number of required bits for the protocol.
Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-to-back. The first segment and second segments contain 80 and 40 bytes of data, respectively. In the first segment the sequence number is 127. Host B sends an acknowledgment whenever it receives a segment from Host A.
A) In the second segment sent from Host A to B, what is the sequence number?
B) If the first segment arrives before the second segment, in the acknowledgment of the arriving segment, what is the acknowledgment number Host B will send?
C) If the second segment arrives before the first segment, in the acknowledgment of the arriving segment, what is the acknowledgment number Host B will send?
A) 207
B) 207
C) 127
Suppose Host A sends two TCP segments back-to-back to Host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110.
Suggestion: draw the scenario
A) How much data is in the first segment?
B) Suppose that the first segment is lost but the second segment arrives at B. In the acknowledgment that Host B sends to Host A, what will be the acknowledgment number?
A) 20 bytes
B) ACK number = 90

TCP Segment Structure
Sequence number, Acknowledgement number
Port Number, sequence number, acknowledgement number, checksum, data = big box… know which thing goes to which box
UDP everything 16, Data is 32
TCP Port number = 16 bit
Length and checksum of UDP = 16 bit
Sequence number = 32
ACK = 32 bit
TCP header = 16 bit
TCP header length = 4 bit
RDT 1.0
Basics of reliability (No packet loss, not out of order, and reliable transport)
Recover: ACK/NAK
Can retransmit but could be duplicate so intro to sequence number
TCP Overview
point-to-point:
one sender, one receiver
reliable, in-order byte steam:
no “message boundaries"
full duplex data:
bi-directional data flow in same connection
MSS = Maximum Segment size
Why rdt protocols are stop and wait protocol?
Because after sending a packet, they have to wait for the ACK for the packet before sending next one to ensure accurate packet delivery
GBN receiver does not have receiver buffer, What are the disadvantages of not having receiver buffer in GBN?
DisAdv:
If it receives a packet out of order, can’t remember it bc it is waiting for the one in order
If you have a buffer, it can remember the packet out of order and when it is time to send ACK for the buffer. Can send the ACK without needing to be resent
If GBN is not in order, have to retransmit all of them
In Selective Repeat why it is necessary for SR receiver to send ACK when, packet has arrived in the previous window [receiver_base –n, receiver_base -1].
Until that ACK is received the window can’t slide up
If the ACK is NOT received, since there is a timer, there will be a loop for retransmitting
Also window can’t be moved forward