TCP Introduction Flashcards

1
Q

When working with application protocols like HTTP, SMTP, or DNS, what is the recommended practice and why?

A

Always use libraries to avoid reinventing the wheel and ensure reliability

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

What is the most sensible unit for measuring link capacity?

A

Bits per second (bps)

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

What is a baud, and where is it commonly used?

A

A baud is a unit that refers to symbols per second, commonly used in electrical engineering and older communication systems like dial-up modems.

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

What are the two primary components of latency in a network?

A

Propagation delay and transmission delay.

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

What is propagation delay, and what does it depend on?

A

Propagation delay is the time taken for a signal to travel across a physical link. It depends on the distance and the propagation speed.

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

What is transmission delay, and what does it depend on?

A

Transmission delay is the time required to push the entire packet onto the link. It depends on the packet size (in bits) and the transmission rate.

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

How do you calculate propagation delay?

A

Propagation delay = Distance / Propagation speed

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

How do you calculate transmission delay?

A

Transmission delay = Packet size (in bits) / Transmission rate.

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

Why does transmission delay vary with packet size?

A

Because larger packets take more time to transmit at a given transmission rate.

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

Why is propagation delay constant for a link?

A

Because it depends only on the fixed distance and propagation speed of the medium. (Speed of light is constant)

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

What is the difference between “store-and-forward” and “cut-through” systems?

A

Store-and-forward systems buffer packets until the checksum is read at each hop, while cut-through systems process packets as soon as they receive the frame, without waiting for the entire packet (and it’s checksum).

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

Why is “store-and-forward” more common in modern networks?

A

It ensures error-checking through checksum verification at every hop, which is critical for reliable communication.

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

What factors contribute to latency at each hop in a network?

A

Packet clocking time and propagation delay

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

Why are checksums verified at every hop?

A

To detect and correct errors in data transmission

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

Why do network projects often fail, according to the introductory module slides?

A

Due to underestimating latency and its impact on performance

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

What dominates latency in short-distance links?

A

Bandwidth limitations.

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

What dominates latency in long-distance links?

A

Propagation delay.

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

What is the “elephants problem” in networking?

A

Long Fat Networks face performance challenges when bandwidth scales to tens of gigabits or terabits per second, requiring efficient utilisation.

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

Why is “filling” a network link important?

A

To maximise the utilisation of the available bandwidth for optimal performance.

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

What is a Long Fat Network (LFN) and its main challenge?

A

An LFN is a network with high bandwidth and long distances. The challenge is efficiently utilising the high bandwidth despite the high latency caused by long distances.

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

What is the throughput in a network determined by?

A

The throughput is determined by the slowest link in the network path

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

What happens to the excess data sent if the sender transmits more than the capacity of the slowest link?

A

The excess data accumulates in buffers (e.g., at the router), leading to potential buffer overflow and packet drops if the buffers are full.

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

Why don’t core transmission devices have large buffers?

A

Core transmission devices lack large (deep) buffers because fast, error-checked, double-ported RAM is expensive, and designing core switches with large buffers is challenging.

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

How do edge devices differ in terms of buffering compared to core devices?

A

Edge devices can have larger (deeper) buffers, but these are still finite and cannot handle unlimited data overflow.

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

What must happen for data transmission to avoid overwhelming the network?

A

The sender (e.g., device A) must throttle its transmission rate to match the capacity of the slowest link in the network.

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

What was considered fast broadband in the mid-2000s?

A

In the mid-2000s, 2 Mbps downstream and 256 kbps upstream were considered fast broadband.

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

What does the “A” in ADSL stand for, and what does it signify?

A

The “A” in ADSL stands for “Asymmetric,” signifying that the downstream speed is greater than the upstream speed.

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

What is SDSL, and how does it differ from ADSL?

A

SDSL (Symmetric Digital Subscriber Line) provides equal upstream and downstream speeds, unlike ADSL, which is asymmetric.

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

Out of SDSL and ADSL, which is cheaper and which is more common?

A

ADSL is more common because most residential and small office/home office (SOHO) users primarily download content (e.g., streaming, browsing), so higher downstream speeds are more useful. ADSL is also cheaper to deploy due to its focus on asymmetric speeds.

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

What happens when queues fill up in a network?

A

When queues fill up, packets are dropped, leading to reduced throughput and increased latency.

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

How is limited upstream bandwidth apportioned in a network?

A

Bandwidth is managed using queuing disciplines (qdisc) and traffic control (tc), which decide how packets are prioritized and scheduled for transmission.

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

What is the role of ingress and egress queues in a network?

A

Ingress Queues manage incoming traffic, ensuring packets are processed before being sent further.

Egress Queues manage outgoing traffic to prioritize and limit data sent to a lower-bandwidth link.

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

How do core and edge systems differ in their use of queues?

A

Edge systems: Have long, deep, and well-managed queues to handle variable traffic.

Core systems: Use fast, reliable, deterministic systems with small or no queues.

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

What Linux tools are mentioned for managing queues and traffic control in the lecture?

A

The tools mentioned are qdisc (queuing discipline) and tc (traffic control).

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

What is the difference between hosts, switches, and routers?

A

Hosts: Devices running useful programs (e.g., computers).

Switches: Connects multiple hosts within a LAN. Move packets inside subnets or LANs, operating on broadcast domains.

Routers: Connects different LANs. Move packets between networks, needing topology knowledge to deliver packets.

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

Why is the boundary between routers and switches becoming less clear?

A

Modern routers often include switch-like functions, and most routers today have an attached switch fabric.

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

What does a switch do within a LAN?

A

A switch broadcasts a packet within the LAN to ensure the recipient gets it, minimizing unnecessary traffic by learning local addresses.

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

What are the key steps when you click on a link like https://www.bbc.co.uk/index.html?

A
  1. Parse the URL to understand the protocol, host, and path.
  2. Use DNS to find the IP address of the destination.
  3. Establish a TCP connection.
  4. Perform cryptographic handshakes if HTTPS is used.
  5. Fetch the content using HTTP.
  6. Send and receive data at each step.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What does the structure of a URL like https://www.bbc.co.uk/index.html represent?

A

Scheme: The protocol, e.g., https, defines how the resource is accessed.

Host: The server or domain, e.g., www.bbc.co.uk, identifies where the resource is located.

Path: The specific resource being accessed on the server, e.g., /index.html.

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

What is the function of DNS in the context of a URL?

A

DNS maps the human-readable domain name (e.g., www.bbc.co.uk) to its corresponding IP address, enabling communication with the server.

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

Why should you avoid writing your own TCP or networking code in production?

A

It is better to use libraries since they are tested, optimized, and secure. Writing your own code for production is likely error-prone and unnecessary unless for learning purposes.

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

Why does a URL path look like a Unix path? What effect does this have on the server?

A

The URL path follows a Unix-like structure because the web’s early design borrowed from Unix systems. However, servers interpret and handle the path in their own way.

43
Q

What is RFC 1034 and what does it define?

A

RFC 1034 is the foundational document that specifies the concepts and facilities of the Domain Name System (DNS), focusing on the hierarchical naming structure.

It defines DNS as a distributed, hierarchical system for translating domain names into IP addresses and explains the roles of name servers and resolvers.

44
Q

What is RFC 1035?

A

RFC 1035 complements RFC 1034 by providing the implementation details of DNS, including message formats, query/response protocols, and resource record types.

45
Q

What are resource records in RFC 1035?

A

Resource records are the basic data elements of DNS, including types like A (address), MX (mail exchange), and NS (name server).

46
Q

What is an IPv4 address?

A

IPv4 addresses are 32 bits long, written as four decimal numbers separated by dots.

47
Q

What is an IPv6 address?

A

IPv6 addresses are 128 bits long, written in eight groups of four hexadecimal digits separated by colons, e.g., 2a00:1450:400c:c07::6a

48
Q

Why is IPv6 necessary?

A

IPv6 is needed because IPv4’s 32-bit addressing allows only ~4 billion unique addresses, which is insufficient for the growing number of devices worldwide.

49
Q

How does IPv6 expand address space?

A

IPv6 uses 128-bit addresses, enabling 2^128 unique addresses, enough for every device to have its own address.

50
Q

Why is DNS preferred over a “hosts.txt” file?

A

DNS automates name-to-IP mapping for the internet, whereas manually managing mappings in a hosts file is inefficient and error-prone for large-scale networks.

51
Q

What are the main security problems with hosts.txt instead of DNS?

A

Tampering: Attackers can modify it to redirect traffic to malicious sites.

No Authentication: Cannot verify if mappings are legitimate.

Not Scalable: Manual updates are error-prone and infeasible for large networks.

52
Q

What are port numbers, and why are they used?

A

Port numbers distinguish between different services running on a single device, enabling specific communication (e.g., email via SMTP, file transfer via FTP).

53
Q

What are some examples of well-known port numbers?

A

21: Telnet
23: FTP
25: SMTP (email)
53: DNS
22: SSH
80: HTTP

54
Q

Why do some protocols lack assigned port numbers?

A

Older protocols developed before 1983 (prior to NCP) did not have formal port number assignments. (Networks were small so ad-hoc communication arrangements were sufficient). Later systems and updates assigned numbers to newer protocols.

55
Q

What is the difference between UDP and TCP?

A

UDP (RFC 768): Sends “unreliable” packets without guarantees of delivery or order (like a message in a bottle).

TCP (RFC 793): Sets up a virtual connection, offering reliability with checks for delivery, order, and error correction.

56
Q

Why is DNS typically over UDP instead of TCP?

A

UDP is faster and more efficient for DNS queries, which are small and single-request transactions. TCP is used only when reliability or larger data transfers are needed.

57
Q

When might DNS use TCP instead of UDP?

A

DNS switches to TCP if the response size exceeds UDP limits (e.g., DNS zone transfers or large query responses).

58
Q

Why is TCP considered more reliable than UDP?

A

TCP ensures delivery by retransmitting lost packets, maintaining order, and performing error checks, whereas UDP does not.

59
Q

What port does DNS use, and how does communication happen?

A

DNS servers listen for queries on port 53, which is the standard port for DNS communication.

When your computer (the client) sends a DNS query, it picks a random high-numbered port (e.g., 49152–65535) as its source port. This is done to distinguish between different outgoing queries.

60
Q

Why is DNS conventionally done over UDP?

A

UDP is faster and more efficient for DNS because most queries are small, single-question, single-response exchanges. Building a TCP connection adds extra overhead.
Now a days, can just use TCP for everything.

61
Q

What does /24 mean in the IP address 10.92.213.123/24?

A

/24 specifies that the first 24 bits are the network portion, leaving the remaining 8 bits for host addresses. It allows 254 usable hosts.

62
Q

Why is /24 commonly used in home networks?

A

/24 provides a good balance of address availability and simplicity for small networks.

63
Q

How does a netmask like /24 affect equality checking for IP addresses?

A

The netmask ensures only the network portion is compared. For example:

10.92.213.1 & 255.255.255.0 = 10.92.213.0

Two addresses match if their network portions are equal.

64
Q

Why do IPv4 masks align on octet boundaries (e.g., /8, /16, /24)?

A

IPv4 masks align on 8-bit boundaries for simplicity and compatibility, unlike IPv6, which allows non-aligned masks.

65
Q

Why are “random bytes” (like 10.x.x.x) used in private IP addressing?

A

Random bytes help avoid address conflicts:

Private IP ranges (like 10.x.x.x, 192.168.x.x) are reserved for internal use and not routable on the public internet.

Choosing different values for the middle bytes (e.g., 10.1.x.x vs. 10.5.x.x) reduces the risk of overlapping IP addresses when connecting multiple networks, like merging home and office networks.

66
Q

What is an octet in IP addressing?

A

An octet is a group of 8 bits. In IPv4, addresses are 32 bits long, divided into four octets, each represented as a decimal number (0–255), separated by dots. For example: 192.168.1.1.

67
Q

Why are octets used in IP addresses?

A
  1. Human Readability: Splitting a 32-bit address into four octets makes it easier to read and manage (e.g., 192.168.1.1 is simpler than 11000000101010000000000100000001).
  2. Bit Boundary Alignment: Each octet aligns to 8 bits, simplifying calculations for subnetting and masking (e.g., /8, /16, /24).
  3. Efficient Representation: Each octet can represent values from 0 to 255 (2^8 = 256), covering all possible values for an 8-bit binary sequence.
  4. Historical Context: Hexadecimal wasn’t as widely adopted or standardised at the time IPv4 was introduced, so base-10 became the convention.
68
Q

What two addresses does a device have on an Ethernet network?

A

IP Address: A structured, logical address used for routing packets (e.g., 10.92.213.123).

Ethernet Address (MAC): A 48-bit physical address assigned to the device, often unique per interface.

69
Q

How do we send an IP packet on an Ethernet network?

A

To send an IP packet:

  1. Find the Ethernet address (MAC) of the device owning the IP address using ARP.
  2. Encapsulate the IP packet in an Ethernet frame with the correct Ethernet addresses.
  3. Send the frame to the next place.
70
Q

What is ARP, and what does it do?

A

ARP (Address Resolution Protocol) maps an IP address to its corresponding Ethernet (MAC) address by broadcasting a query:

“Who has this IP address?” The device with that IP replies with its MAC address.

71
Q

Why is ARP considered insecure?

A

ARP has no authentication or exchange validation, making it vulnerable to hijacking (e.g., ARP spoofing), where attackers can send fake replies to intercept traffic.

72
Q

What are the sizes of IPv4 and Ethernet addresses?

A

IPv4 addresses: 32 bits
Ethernet (MAC) addresses: 48 bits

73
Q

Why is using an Ethernet hub considered bad?

A

Hubs broadcast all packets to every connected device, meaning any device can see all traffic. This makes hubs insecure, as malicious users can intercept and monitor network traffic (e.g., with tools like Wireshark).

Additionally by broadcasting all packets to every connected device, unnecessary traffic is caused and reducing efficiency. Switches are better as they only send packets to the specific port where the destination device is located.

73
Q

In the realworld, what should you always replace an ethernet hub with?

A

A switch

74
Q

How does an Ethernet switch improve communication compared to a hub?

A

Switches learn which port each device is on by monitoring transmissions and only send packets to the correct port, limiting unnecessary traffic and improving performance.

74
Q

What is Ethernet encapsulation?

A

Ethernet encapsulation wraps an IP packet with an Ethernet frame, which includes:

  1. Destination MAC address
  2. Source MAC address
  3. Payload (the IP packet).
75
Q

How does DNS resolution use UDP?

A

The client sends a query to port 53 on the DNS server. The server replies using the same mechanism, sending the response back to the client’s random source port.

75
Q

Why does a website like www.bbc.co.uk have multiple IP addresses?

A

Multiple IP addresses are used for redundancy (ensuring availability if one server fails) or to distribute load across servers of varying sizes.

76
Q

Why is TCP used instead of UDP for HTTP/HTTPS connections?

A

TCP ensures reliable, ordered delivery of data, which is necessary for web communication, unlike UDP which is unreliable.

76
Q

What happens after DNS resolution provides the IP address?

A

The client initiates a TCP connection to the web server’s IP address (e.g., 212.58.235.1) and communicates:

Over port 80 for HTTP (unencrypted)
Over port 443 for HTTPS (encrypted).

77
Q

What is the purpose of the Source Port and Destination Port in a TCP frame?

A

The Source Port identifies the sending application, while the Destination Port specifies the receiving application, enabling communication between processes.

78
Q

What is the TCP three-way handshake, and what are its steps?

A

The TCP three-way handshake establishes a reliable connection between client and server:

  1. SYN: The client sends a packet with a sequence number to initiate the connection.
  2. SYN-ACK: The server acknowledges the SYN and sends its own sequence number.
  3. ACK: The client acknowledges the server’s response, completing the handshake.
79
Q

What is SYN in the TCP setup?

A

I am going to send a stream of bytes, numbered from this initial sequence number, from this port number to this port numbers. This is called SYNchronise.

80
Q

What is SYN, ACK in the TCP setup?

A

OK, got that. I am going to send a stream of bytes, numbered from this initial sequence number, back to you. This is called SYNchronise ACKnowledge.

81
Q

What is ACK in the TCP setup?

A

OK, got that ACKnowledge.

82
Q

How does TCP sign off the connection using SYN and ACK?

A
  1. A to B says: I got your last, and here’s some bytes.
  2. B to A: I got your last, and here’s some bytes.
  3. A to B Nothing for you, but I got yours. Bare acknowledgement sent back
83
Q

Why is the TCP handshake important?

A

It synchronises sequence numbers and ensures both parties are ready to communicate, establishing a reliable, bi-directional connection.

84
Q

What does signing off mean in TCP?

A

“Signing off” refers to gracefully terminating a TCP connection using the FIN-ACK sequence:

  1. One side sends a FIN (finish) packet to signal it is done sending data.
  2. The other side responds with ACK, and then sends its own FIN.
  3. The sender acknowledges with an ACK, completing the connection teardown.
85
Q

Does a SYN packet carry data?

A

Generally, no. SYN packets only carry control information (sequence numbers) to set up the connection. However, in TCP Fast Open (a modern extension), SYN packets can include data to reduce latency.

86
Q

How many steps does TCP signing off have?

A

TCP connection termination can happen in 3 steps or 4 steps:

4-step termination (normal case):
1. One side sends FIN (I’m done sending).
2. The other side ACKs the FIN.
3. The other side later sends its own FIN.
4. The first side ACKs the second FIN.

3-step termination (combined ACK and FIN):
One side combines the ACK for the first FIN with its own FIN, reducing the steps to three.

87
Q

What does the “default” entry mean in a routing table?

A

It specifies where packets should go if no specific route exists for the destination.

Example: default via 10.92.213.1 dev eno1 means send packets via 10.92.213.1 on interface eno1

88
Q

What does “via” indicate in a routing table?

A

The “via” keyword shows the gateway (next hop) through which traffic should be sent to reach a remote destination.

89
Q

Why is storing the entire routing table feasible today?

A

Modern machines have enough RAM to store complex routing tables with millions of entries (e.g., the global IPv4 table).

90
Q

Why are routers needed in large networks?

A

Routers connect multiple networks and forward packets between them, enabling communication across spread-out systems.

91
Q

What does a router do in a network?

A

A router reads incoming packets, decides the best path to forward them, and sends them to their destination network. It connects multiple networks and enables communication beyond local networks.

92
Q

Whats the process for a device on a local network to send packets to the internet?

A
  1. The device sends the packet to its default gateway (the router).
  2. The router checks its routing table for a match or uses a default route.
  3. The router ARPs for the next hop and forwards the packet to the appropriate network.
93
Q

What is a default route, and why is it important?

A

A default route (0.0.0.0/0) is used when no specific match exists in the routing table. It directs packets to a gateway, enabling access to external or unknown networks.

94
Q

How does a routing table enable communication?

A

The routing table maps IP address ranges (networks) to specific interfaces or gateways, allowing the router to decide where to send packets.

95
Q

What role does ARP play when sending a packet to a gateway?

A

ARP resolves the MAC address of the gateway (next hop) so the IP packet can be encapsulated in an Ethernet frame and sent to the correct device.

96
Q

What is the significance of the HTTP response “301 Moved Permanently”?

A

It tells the client that the requested resource has been permanently moved to a new URL, and the client should use the provided Location header for future requests.

97
Q

Why is HTTPS (encrypted content) important, especially for banks?

A

HTTPS ensures:

  1. Encryption: Protects data from interception.
  2. Authentication: Confirms the server’s identity.
  3. Integrity: Ensures the content hasn’t been tampered with.
98
Q

What tool is generally better for HTTP requests: curl or wget?

A

curl is often preferred for its flexibility, better handling of modern HTTP features, and ability to send HTTP headers and payloads.

99
Q

Why might TCP teardown be merged into fewer packets nowadays?

A

Optimisations allow combining the ACK and FIN flags into a single packet, reducing overhead and speeding up termination.