Application Layer Flashcards
What are the downsides of using Telnet? What’s the solution to these problems?
Telnet has transmits user credentials in the open and has no server authentication. The solution is to use SSH.
Why is SSH used?
SSH solves the problems of Telnet, namely server authentication and cyber security. The first layer of SSH is the connection layer. Here, file transfer and TCP forwarding takes place. The second layer is the authentication layer where password and public-key authentication takes place. The last layer is the connection layer. Key exchange and server authentication take place in this layer.
Discuss HTTP
HTTP support client-server communication with a request/response protocol. It is connectionless, stateless and has no notion of session. It operates over TCP. Clients can retrieve HTML files from web servers at a specified URI.
How can we improve HTTP 1.0?
HTTP retrieves HTML files with embedded objects from web servers. Since it operates over TCP, a new TCP connection is made for every new embedded object. However, TCP has a costly setup for new connections, making the process inefficient. The TCP congestion algorithm also slowly increases speed, meaning that the transfer rate of new connections is slower.
The solution to this problem is to have a persistent TCP connection for all the embedded objects that were requested. It can even improve further, by pipelining different embedded objects in the same persistent connection.
Another improvement for HTTP in general is using caches. Recent request are getting stored in a cache so that the client doesn’t need to download the same request every single time.
Discuss FTP
FTP is designed to transfer files and navigate directory listings. It uses two TCP ports: one for a control connection and one for the actual data trasnfer. This way we have a simple control flow by using commands whilst being able to download at the same time. A TCP connection is used because we don’t want to chop the big transfers in little pieces. We also want ordering and we don’t want to overwhelm the local connection.
Discuss the different mail protocols
Post Office Protocol: Unsynchronized, download messages from server to 1 device. After downloading, the messages get removed from the server. Therefore it’s not possible to get your mail on different devices.
IMAP: Synchronized, the mail server is copied locally to the client device, causing higher overhead. When something changes on the server it also changes on the client device.
Web-mail: No synchronization, because everything is stored on the server making this a lightweight protocol. It does require a consistent Internet connection
SMTP: Three phases, namely handshaking, transfer and closure. SMTP uses TCP because we want reliability and ordering.
Discuss the different mail protocols
Post Office Protocol: Unsynchronized, download messages from server to 1 device. After downloading, the messages get removed from the server. Therefore it’s not possible to get your mail on different devices.
IMAP: Synchronized, the mail server is copied locally to the client device, causing higher overhead. When something changes on the server it also changes on the client device.
Web-mail: No synchronization, because everything is stored on the server making this a lightweight protocol. It does require a consistent Internet connection
SMTP: Three phases, namely handshaking, transfer and closure. SMTP uses TCP because we want reliability and ordering.
What is DHCP?
The Dynamic Host Configuration Protocol provides automated leasing of IP addresses. It uses UDP because we have to broadcast a discovery message on the local network. Short leases improve the allocation of addresses, while long leases reduce the load on the DHCP server.
How does a client obtain a new IP address using DHCP?
The client broadcasts a DHCPDISCOVER message on the local network. Different DHCP servers respond to the broadcast message with a DHCPOFFER by using the MAC layer entry created by the client when sending the DHCPDISCOVER message. The client picks the best offer and sends a DHCPREQUEST message to the corresponding DHCP server. When the server responds with a DHCPACK message, the lease begins. When 50% of the lease has expired, it has to be renewed. When the client sends a DHCPRELEASE or receives a DHCPNACK message, the lease is released. To avoid multiple clients using the same IP address, duplicate address detection is used. The offered IP address is translated to a MAC address. If this address is already in use, the client sends a DHCPDECLINE message.
Discuss DNS. How does the protocol work?
The Domain Name System maps IP addresses to human-readable names. It does so by using a hierarchical system. This reduces complexity, enables distribution and reduces bottlenecks.
An originator sends a query to a local name server, requesting the IP address of a certain URI (recursive part). The local name server searches the DNS tree to find the URI, starting at the root name server (iterative part). All intermediate results in the tree are stored in a cache to improve performance.
Why is UDP used in the DNS protocol instead of TCP?
A DNS lookup is a single packet interaction. If we would use TCP, multiple lookups require a new connection per packter resulting in high setup costs and overhead. Multiple machines can be mapped to the same IP address (e.g. the root name server) to provide redundancy and load balancing. When we want to do a lookup, anycast is used to choose one of the machines mapped behind the IP address to answer the query. TCP doesn’t support anycast, UDP does.
Why is UDP used in the DNS protocol instead of TCP?
A DNS lookup is a single packet interaction. If we would use TCP, multiple lookups require a new connection per packter resulting in high setup costs and overhead. Multiple machines can be mapped to the same IP address (e.g. the root name server) to provide redundancy and load balancing. When we want to do a lookup, anycast is used to choose one of the machines mapped behind the IP address to answer the query. TCP doesn’t support anycast, UDP does.
When do we use UDP and when do we use TCP?
UDP: Broadcast when receiver address unknown. Using multicast and anycast. When the connections are short-lived or when the data consists of 1 packet.
TCP: Ordering, reliability, congestion and flow control. When the data consists of large files.
Discuss Napster
Napster was a large-scale download service with only 1 server and a few high bandwidth connections. Napster peers upload a list of files that they offered to the central Napster server. Other peers can request files to the Napster server. It returns a list of all the peers that offer the requested files. The peer can send a file request to one of the peers from the list. After receiving the files the Napster server index needs to be updated, because now there is an extra peer offering these files.
What are problems of the Napster system?
Napster isn’t resilient. It has 1 point of failure, the Napster server. If this server crashes, the entire system won’t work anymore untill the server is fixed. Another problem has to do with privacy. When the server sends the list of peers offering certain files, their credentials are sent over a TCP connection. Lastly, there aren’t enough usable IP addresses for this system.