Chapter 2/Lecture 2 Application Layer Flashcards

1
Q

Which ports and protocols are used by HTTP(S), FTP, DHCP, DNS and ICMP?

A

HTTP(S):80(443) TCP, FTP:20(data), 21(control) TCP, DHCP: 67(server)/68(client) UDP, DNS:53 UDP, ICMP: None None(Layer 3 protocol, not Layer 4).

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

What does an app-layer protocol define?

A

Type of message(request/response/etc), message-syntax(fields and how they are delineated), semantics(what does information mean) and rules for when/how send/recieve.

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

What’s the api from L5 to L4?

A

Sockets.

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

What does UDP offer?

A

Lower overhead because of unreliable data transfer(no setup).

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

What does TCP offer?

A

Reliable transport(sequence number and acks), flow control(sliding window, receive window telling how many bytes), congestion control(slow-start, congestion avoidance(?), fast retransmit), connection-oriented(3-way).

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

What’s the difference between stateless and statefull?

A

Stateless; server maintains no information about past requests. If either server or client crashes, no biggie. Example: HTTP
Statefull; server maintains information about past requests. If server crashes, must rebuild state. Example: FTP

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

What’s the difference between non-persistent and persistent HTTP?

A

Non-persistent sends at most one object, then shuts down the connection. Persistent leaves the connection ope, so that several objects can be sent over one connection.

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

What does RTT stand for, and what is the definition?

A

Round Trip Time, time for a small packet to travel from client to server and back(or ack back).

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

What are the different method types, and how’s the HTTP message request/response defined?

A
Methods; GET/POST/HEAD(1.0), PUT/DELETE(1.1)
Message:
"method" "url" "version" or "version" "status_code" "status_phrase"\r\n
 "header" "value"\r\n
....
"header" "value"\r\n
\r\n
body
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the three major components in e-mail?

A

User agent, mail server and SMTP.

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

Explain the SMTP protocol(port, phases, what does it do etc).

A

SMTP goes over TCP on port 25. It’s a protocol for delivery of message from sender to receiver. It has three phases, handshake, transfer and closure. Commands are ASCII text, and response is a status code and phrase.

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

Which protocols are used for retrieval?

A

POP(Post Office Protocol), IMAP(Internet Message Access Protocol) and HTTP

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

What’s the different between POP and IMAP?

A

POP is stateless(mails are downloaded to the client, but no status change is recorded on server. Download and delete(on server) or keep(on server)), while IMAP is statefull(mails are changed on server, so changes are synced between user agent(s) and server).

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

What does DNS stand for, and how is it organized?

A

Domain name system, distributed database to avoid single-point-of-failure(due to traffic volume, load distribution etc). Organized with root servers at the top, followed by TLD(top level domains) and authoritative DNS server(organizations own). Also has local DNS servers, which is operated by company, university, residential isp etc. Local DNS does not belong in the hierarchy.

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

How does DNS (queries) work?

A

Local DNS(default name server) stores a cache of recent name-to-address translations. Cache entries has a timeout(TTL), after which the record disappears, but entry may still be out of date because new records takes time to spread(best-effort). If lookup misses, local dns queries hierarchy. Either via recursive query(if dns miss, asked server asks higher up) or iterative query(server responds with new server to contact if dns mss).

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

Explain a DNS record.

A

Resource records is on the following format: RR(name, value, type, ttl)
Type A/AAA => name is hostname, value is IPv4/IPv6 address
Type CNAME => name is alias for some other hostname
Type NS => name is domain, value is authoritative server
Type MX => name is host, value is mailserver

17
Q

Explain the DNS protocol

A
Query and reply has same format.
Possible flags: (query or reply) | (recursion desired) | (recursion available) | (reply is authoritative)
"identification"(2) "flags"(2)
"# questions" "# answer RRs"(4)
"# authority RRs" "# additional RRs"(4)
"questions(variable # of questions)"(4)
"answer(variable # of RRs)"(4)
"authority(variable # of RRs)"(4)
"additional info(variable # of RRs"(4)
18
Q

What does DHCP stand for, and what does it do?

A

Dynamic Host Configuration Protocol. It allows hosts to dynamically obtain IP address. It also (usually) provides first-hop router(default gateway), name/ip address of DNS server and network mask. The addresses are “rented”, which means a host can renew its address and an address can be reused by other hosts.

19
Q

Which port does DHCP go over, and what are the messages?

A

Port 68 on client, port 67 on server, UDP for both. Messages are the following(the first two are optional, and broadcast address is FFx6 on link layer);

  • DHCP Discover - src 0.0.0.0, dest 255.255.255.255
  • DHCP Offer - src DHCP-server IP, dest 255.255.255.255
  • DHCP Request - src 0.0.0.0, dest 255.255.255.255
  • DHCP Ack - src DHCP-server IP, dest 255.255.255.255
20
Q

How’s the message format for DHCP?

A
"op"(1) "htype"(1) "hlen"(1) "hops"(1)
"xid"(4)
"secs"(2) "flags"(2)
"ciaddr"(4)
"yiaddr"(4)
"siaddr"(4)
"giaddr"(4)
"chaddr"(16)
"sname"(64)
"file"(128)
"options"(312)