Transport Layer

5.0(1)
studied byStudied by 3 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/62

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.

63 Terms

1
New cards

What is the difference between IP and TCP?

TCP is connection-oriented, meaning it needs traffic to be routable in both directions between 2 hosts

2
New cards

How are TCP connections uniquely identified?

Through sockets

3
New cards

How can TCP communicate?

Through ports and sockets

4
New cards

Multiplexing

2 hosts can have more than 1 conversation simultaneously

5
New cards

TCP flow

Identified by a 4-tuple

- Source IP address

- Source port number

- Destination IP address

- Destination port number

6
New cards

Socket

Combinations of an IP address, and a TCP port number

7
New cards

Who maintains the list of assigned TCP ports?

IANA

8
New cards

TCP header

- 32 bits wide

- Includes source and destination port

- Header has a mandatory 20 bytes as well as optional extensions

- Sequence number

- Acknowledgement number

- Window size

- Flags e.g SYN, ACK, FIN

<p>- 32 bits wide</p><p>- Includes source and destination port</p><p>- Header has a mandatory 20 bytes as well as optional extensions</p><p>- Sequence number</p><p>- Acknowledgement number</p><p>- Window size</p><p>- Flags e.g SYN, ACK, FIN</p>
9
New cards

How long is a port?

16 bits long

10
New cards

What is the maximum value a port can have?

2^16 - 1

11
New cards

What is the sequence number used for in a TCP message header?

- For order + reassembly

- It is the number assigned to the first data byte of a segment

12
New cards

What is the acknowledgement number used for in a TCP message header?

- For reliability

- It is next sequence number that the sender of the ACK message expects (or the sequence number + 1)

13
New cards

What is the window size used for in a TCP message header?

- For flow control

- It is the number of bytes a receiver can get

14
New cards

Where is a TCP message encapsulated in?

An IP message

15
New cards

What is the client/server model?

- A server is a host that is ready to accept communication on 1+ ports

- A client is a host that initiates communication with a server

<p>- A server is a host that is ready to accept communication on 1+ ports</p><p>- A client is a host that initiates communication with a server</p>
16
New cards

TCP connection setup/ 3-way handshake

1. Client synchronises with server (SYN)

2. Server acknowledges synchronise (SYN ACK)

3. Client acknowledges server acknowledgement (ACK)

4. Connection is set up

<p>1. Client synchronises with server (SYN)</p><p>2. Server acknowledges synchronise (SYN ACK)</p><p>3. Client acknowledges server acknowledgement (ACK)</p><p>4. Connection is set up</p>
17
New cards

TCP connection tear-down

1. Client sends finalise (FIN)

2. Server acknowledges finalise (ACK + FIN)

3. Client acknowledges acknowledgement (ACK)

4. Connection closes

<p>1. Client sends finalise (FIN)</p><p>2. Server acknowledges finalise (ACK + FIN)</p><p>3. Client acknowledges acknowledgement (ACK)</p><p>4. Connection closes</p>
18
New cards

TCP segment

Data that has been divided into chunks and had a TCP header added to it

19
New cards

What can a host do to avoid data fragmentation in the IP layer?

Add a maximum segment size to the TCP header

20
New cards

What is a maximum segment size?

The largest IP datagram a host can handle MINUS the IP and TCP header sizes

21
New cards

What is the equation that links MTU and MSS together?

MSS = MTU - 40

- 20 bytes for the IP header

- 20 bytes for the TCP header

<p>MSS = MTU - 40</p><p>- 20 bytes for the IP header</p><p>- 20 bytes for the TCP header</p>
22
New cards

In what types of segments is the MSS value sent?

In SYN segments

23
New cards

What is the default value for MSS?

536 bytes

24
New cards

Is the MSS value negotiated between hosts?

No! Each host dictates the MSS for its receiving direction of flow

25
New cards

Types of TCP reliability mechanisms

- Duplicate acknowledgement retransmission

- Timeout-based retransmission

26
New cards

Duplicate acknowledgement retransmission

- Acknowledgement numbers sent for each ACK segment are cumulative

- If a segment is lost, the receiver will acknowledge the same segment over and over again until the info in the lost segment is received

- The sender interprets this as packet loss

27
New cards

Timeout-based retransmission

- When a sender sends a segment, it starts a timer

- If the timer runs out before an ACK is received, the segment is sent again

28
New cards

What concept is associated with the window size header?

Sliding window approach

29
New cards

What is the sliding window approach?

- When a TCP segment is received, the window size value is read

- The sender cannot send any bytes past this window size until an ACK segment is received

- When an ACK segment is received, the window size is updated according to the receiver's capacity

30
New cards

What happens when TCP sequence numbers and window sizes overflow?

The number rolls back to 0

31
New cards

What happens when a sender receives a window size of 0?

The sender stops sending data

32
New cards

After a sender receives a window size of 0, what is the name of the timer that begins?

Persist timer

33
New cards

What is a persist timer?

- Used to time elapsed time after window size of 0 is sent

- Checks if 0 was sent on purpose or because of lost/corrupt segments

- When timer expires, small empty segment sent so that receiver sends another acknowledgement

34
New cards

What is congestion?

When the amount of traffic within a network overwhelms router buffers

35
New cards

Congestion vs flow control

Congestion concerns router buffers, whilst flow control concerns receiver buffers

36
New cards

What does congestion cause?

- Long delays

- Packet loss

- Decreased throughput due to more unneeded and duplicate retransmissions

37
New cards

Approaches to congestion control

- End-end (Do nothing)

- Network-assisted (Feedback to hosts)

38
New cards

What is a type of TCP congestion control?

Additive Increase Multiplicative Decrease (AIMD)

39
New cards

What is Additive Increase Multiplicative Decrease (AIMD)?

- Senders can increase sending rate slowly until segment loss occurs, in this case, decrease sending rate quickly to isolate issues

40
New cards

What is TCP Slow Start?

- An algorithm used to increase from initial sending rate of 1 MSS exponentially after every round trip until loss

- This occurs until a threshold amount, and then additive increase starts

41
New cards

When segment loss occurs, how does AIMD decrease sending rate?

AIMD cuts sending rate in half at each loss event

42
New cards

What is the rate of additive increase in AIMD?

1 MSS every round trip time (RTT)

43
New cards

Naming concerns

- TCP itself doesn't treat port numbers specially, but IANA sets well-known port numbers for different applications to be easily identifiable e.g http = 80, https = 443

- Ports 49152 - 65335 are unregistered for dynamic/private ports

44
New cards

Session/state concerns

- TCP is connection-oriented, meaning that a state transition machine captures both client and server states

- Messages can be sent as long as session is open

45
New cards

Security concerns

- No security features, all header and payload details are visible

- Transport Layer Security (TLS) aims for end-to-end security

- Attacks include TCP reset attacks, TCP connection hijacking, TCP SYN floods

46
New cards

Reliability concerns

- Considered reliable due to timeouts and acknowledgements meaning everything transmitted will be delivered eventually

- TCP checksums can detect errors in payload

47
New cards

Scalability concerns

- TCP benefits from IP scalability

- TCP connection setup time can affect performance

48
New cards

Management concerns

- No real management issue apart from applications being able to choose their own ports locally

49
New cards

Governance concerns

- Internet Engineering Task Force (IETF) standardise and govern TCP

- IANA maintain official assignments of port numbers

50
New cards

Description concerns

Transport layer is not self-describing nor queryable

51
New cards

What is User Datagram Protocol (UDP)?

- Second transport layer

- Used by apps that don't need guaranteed delivery of TCP

52
New cards

What does UDP do differently from TCP?

- Takes app data and creates UDP datagram and sends this to network layer

53
New cards

UDP header

Only 4 headers

- Source port

- Destination port

- Checksum

- Length

54
New cards

What are the properties of UDP?

- Connectionless

- Datagram service, meaning packets show up in no order

- Self-contained datagrams

- Unreliable delivery

55
New cards

HTTP request structure

1. Start line

2. Properties

<p>1. Start line</p><p>2. Properties</p>
56
New cards

HTTP response structure

1. Start line

2. Headers

3. Body

57
New cards

What is a URI?

- Uniform Resource Identifier

- Compact string of chars for identifying a resource

- Clients don't look at URI content

<p>- Uniform Resource Identifier</p><p>- Compact string of chars for identifying a resource</p><p>- Clients don't look at URI content</p>
58
New cards

Resource naming hierarchy

- Internationalised Resource Identifier (IRI) is the superset

- Uniform Resource Identifier (URI) is a subset of IRI and a general version of different naming conventions

- Uniform Resource Locator (URL) and Uniform Resource Name (URN) are subsets of URI

59
New cards

What is the web architecture?

A network of named resources

60
New cards

What is a resource?

- Anything with an identity

- Can be retrievable e.g a document, non-retrievable e.g a book, or abstract e.g relationships

61
New cards

What does the web architecture define?

An interface to interact with resources via HTTP

62
New cards

What is a representation?

- Information that is intended to reflect a past, current, or desired state of a given resource

- In a format that can be communicated via protocols

63
New cards

Relationship between resources and representations

- Named resources are represented by representations

- Representations are an abstraction needed to represent the state of a resource during communications