UDP and TCP

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/30

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

In the context of data segments, what role does the application layer serve?

Defines message contents (i.e., the content of the payload of the packets)

2
New cards

What is the transport layer?

End-to-end abstraction of network services for applications

3
New cards

What does best-effort mean?

Best-effort means that the network will try to deliver the packets to its destination, but makes no promises that they will: arrive at all, arrive in order, or arrive only once

4
New cards

Describe the following aspects of UDP:
-Reliability
-Connection type
-Delivery model

-Reliability: Unreliable, makes one attempt to send and does not check to make sure it was received (“fire-and-forget”)

-Connection type: Connectionless, does not establish a connection with the destination (sends like a postcard, no knowledge of if the destination end host exists or is ready to receive)

-Delivery model: As messages which preserve boundaries. EX: 1000 byte message will send as a single datagram with a payload of 1000 bytes. The message stays in one “chunk” as opposed to something like TCP byte-streaming which fragments the data.

5
New cards

Describe the following aspects of TCP:
-Reliability
-Connection type
-Delivery model

-Reliability: Reliable. Ack system ensures data was received by destination end-host, and attempts retransmission when needed (and discards duplicates when encountered). TCP also guarantees that all data will eventually arrive at destination in order via sequence #s.

-Connection type: Connection-oriented. TCP establishes a connection using 3-way handshake (creates a session)

-Delivery model: Uses a byte-stream to send/read bytes. This does not preserve message boundaries (single messages may be split between TCP segments)

6
New cards

How does UDP reveal network issues to application layer? Give an example.

UDP makes no guarentee that transmission was successful, and so any network issues that occur are then exposed to applications.

(EX: An application sends data that is then not responded to in some time frame because the UDP datagram was lost or dropped. The application notices the network error and then has to decide what to do with the error)

7
New cards

How does TCP hide network issues from the application layer? Give an example.

TCP handles network issues like:

packet loss → by retransmission

packet arrival out-of-order → by reordering using sequence #s

duplicate data sends → by discarding unneeded data

So, application layer doesn’t notice these issues.

EX: An application uses TCP to send some data to its destination, byte segments 1-1000 and bytes 1001-2000. However, bytes 1-1000 are dropped along the network for some reason. TCP will buffer bytes 1001-2000, and then send an ACK for byte 1 indicating that it is missing a segment. Sender will retransmit bytes 1-1000 belonging to that segment and then ACK up to 2000, meaning all the bytes were received. Application layer does not notice this error nor does it need to do anything when these errors occur.

8
New cards

Traditionally, transport protocols are part of the ________

OS kernel

9
New cards

What is a port number?

A port number is a 16-bit number identifying a process on the host machine

10
New cards

What is an IP address?

An IP address is a (at least in IPv4) 32-bit number identifying an interface on the host (machines can have multiple interfaces such as an eth0 interface, wlan, etc. each with their own IP address)

11
New cards

IP delivers packets to the _________, then transport layer delivers the packet to the __________.

destination IP address, destination port

12
New cards

What are the 4 basic sections of a TCP/UDP segment? (They’re both different, but both share these common characteristics)

Source port #
destination port #
header fields
application data (message)

13
New cards

What is a transport connection?

Logical association between two ends of the transport protocol, identified by IP address and port #, with both ends maintaining state (state info includes things like sequence/ack numbers, window sizes, and connection status)

14
New cards

What is demultiplexing?

Demultiplexing is the process of taking incoming data and delivering it to the correct application process

15
New cards

Explain what connectionless means (UDP)

Receiver demultiplexes incoming packets based on a 3-tuple (protocol, destination IP/Port)
Sort of like a postcard method of sending data

16
New cards

Explain what connection-oriented means (TCP)

Receiver demultiplexes incoming packets based on a 5-tuple of (protocol, dest IP/Port, source IP/Port), maintains state and parameter information about the connection, and sets up/tears down the connection via TCP three-way handshake

17
New cards

What is message-based transport?

Application sends/reads messages, transport layer preserves message boundaries (one send operation will send exactly one message, and transport layer will not split it)

18
New cards

T/F: All applications agree on the same message size limit (UDP)

False

19
New cards

What is byte-stream transport?

Applications send/read streams of bytes, where the transport layer doesn’t preserve message boundaries (transport layer may join multiple messages or split a single message as necessary on the sender side)

20
New cards

Why do applications need to denote the message boundary within the data byte stream?

Since TCP uses byte stream which does not preserve message boundaries, application-layer needs to know how to “extract” or denote message boundaries to know where messages start and end.

21
New cards

How is a datagram split up from outermost to innermost?

Ethernet frame, IP packet, TCP segment, application message

22
New cards

What are some of the benefits of UDP?

-No overhead of establishing connection (less delay), makes it a good choice for apps where speed and low latency are more important than reliability
-Smaller headers than TCP
-No built-in congestion control, so UDP can full-blast data as desired (for better or worse)
-Multicast use (one sender to many receivers)
-Acts as a barebones transport protocol that apps can implement features on top of if desired (Google’s QUIC is one example of this)

23
New cards

What is end-to-end unicast? Which transport protocol uses it?

One sender, one receiver - TCP

24
New cards

What are packets exchanged between TCP peers called?

TCP segments

25
New cards

Describe how TCP buffers work on both the sender and receiver side

Source host buffers bytes from the sending application, at least enough to fill a reasonably sized segment, then is sent to the network layer for transmission
Destination host empties contents of the segment into a receive buffer, then the receiving application reads from this buffer as desired

26
New cards

What does the sequence number inside a TCP segment describe?

Where in the byte stream the first byte of the given TCP segment belongs to

27
New cards

What do acknowledgement numbers describe?

ACK numbers indicate the position in the byte stream up to which the receiver has successfully received data to

EX: Ack (z) means “I have received up to byte z - 1, I am ready to receive a TCP segment with seq # z”

28
New cards

Describe each phase of the three-way handshake

  1. Machine A sends TCP SYN segment to Machine B
    -Sets up Machine A’s initial seq #
    -Sets the SYN flag

  2. Machine B receives SYN segment, replies with SYN_ACK segment
    -Sets up Machine B’s initial seq #
    -Sets both the SYN and ACK flag of the TCP segment

  3. Machine A sends TCP ACK segment to machine B
    -Sets the ACK flag of the TCP segment
    -Since connection from A → B has been established at this point, this segment may carry data

29
New cards

What do the following TCP flags indicate about the TCP segment when they are set?:
ACK, SYN, FIN

ACK - Indicates an acknowledgement of bytes received. Special note, also recognizes the other machines seq #’s were received during three-way handshake

SYN - Indicates that the sender wishes to establish a connection

FIN - Indicates the sender wishes to close its end of the connection (Sender of the TCP segment is done sending data to its recipient)

30
New cards

What is Automatic Repeat reQuest?

System for ensuring in-order delivery through retransmission timeouts
1. Sender sends packet and starts a timer for awaiting an ACK
2. Receiver receives packet and sends ACK
3. If time out, sender retransmits the packet

31
New cards

Explain the “stop-and-wait” system. What is its main issue?

A system of exchanging data in which the sender has at most one outstanding un-acked data segment at any time

Main issue is it severely under-utilizes the link

Explore top flashcards